@stemy/ngx-utils 19.6.12 → 19.7.1
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/fesm2022/stemy-ngx-utils.mjs +740 -803
- package/fesm2022/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +47 -45
- package/ngx-utils/components/dynamic-table/dynamic-table.component.d.ts +10 -5
- package/ngx-utils/components/interactive-canvas/interactive-canvas.component.d.ts +42 -19
- package/ngx-utils/components/interactive-canvas/interactive-circle.component.d.ts +4 -8
- package/ngx-utils/components/interactive-canvas/interactive-item.component.d.ts +27 -23
- package/ngx-utils/components/interactive-canvas/interactive-rect.component.d.ts +6 -9
- package/ngx-utils/ngx-utils.imports.d.ts +2 -5
- package/ngx-utils/tokens.d.ts +1 -2
- package/ngx-utils/utils/{canvas.utils.d.ts → canvas.d.ts} +2 -0
- package/ngx-utils/utils/geometry/distance.d.ts +25 -0
- package/ngx-utils/utils/geometry/functions.d.ts +13 -0
- package/ngx-utils/utils/geometry/index.d.ts +2 -0
- package/ngx-utils/utils/geometry/shapes.d.ts +48 -0
- package/ngx-utils/utils/math.utils.d.ts +1 -1
- package/ngx-utils/utils/misc.d.ts +2 -1
- package/package.json +1 -1
- package/public_api.d.ts +5 -8
- package/ngx-utils/services/wasm.service.d.ts +0 -25
- package/ngx-utils/utils/geometry.d.ts +0 -46
- package/ngx-utils/utils/vector.d.ts +0 -23
- package/ngx-utils/utils/wasi.d.ts +0 -26
- package/ngx-utils/utils/wasm-worker-proxy.d.ts +0 -17
- package/ngx-utils/utils/with-options-provider.d.ts +0 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import 'zone.js';
|
|
2
2
|
import 'reflect-metadata';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, PLATFORM_ID, Inject, Injectable, Optional, Injector, untracked, computed, signal, inject, DestroyRef, isDevMode, ErrorHandler, EventEmitter, createComponent, NgZone, Pipe, input, output, ChangeDetectorRef, ElementRef, effect, HostListener, Directive, Input, HostBinding, Output, TemplateRef, ChangeDetectionStrategy, ViewEncapsulation, Component, ViewChild, forwardRef, ContentChild, ContentChildren, model, contentChildren,
|
|
4
|
+
import { InjectionToken, PLATFORM_ID, Inject, Injectable, Optional, Injector, untracked, computed, signal, inject, DestroyRef, isDevMode, ErrorHandler, EventEmitter, createComponent, NgZone, Pipe, input, output, ChangeDetectorRef, ElementRef, effect, HostListener, Directive, Input, HostBinding, Output, TemplateRef, ChangeDetectionStrategy, ViewEncapsulation, Component, ViewChild, forwardRef, ContentChild, ContentChildren, model, contentChildren, provideAppInitializer, makeEnvironmentProviders, NgModule } from '@angular/core';
|
|
5
5
|
import * as i2 from '@angular/router';
|
|
6
6
|
import { ActivatedRouteSnapshot, Scroll, NavigationEnd, Router, DefaultUrlSerializer, UrlTree, UrlSegmentGroup, UrlSegment, UrlSerializer, ROUTES } from '@angular/router';
|
|
7
|
-
import { BehaviorSubject, Observable, firstValueFrom, Subject, Subscription, from, delay, timer, TimeoutError, combineLatest, lastValueFrom } from 'rxjs';
|
|
7
|
+
import { BehaviorSubject, Observable, firstValueFrom, Subject, Subscription, from, delay, timer, TimeoutError, combineLatest, of, lastValueFrom } from 'rxjs';
|
|
8
8
|
import { skipWhile, debounceTime, distinctUntilChanged, map, filter, mergeMap, timeout } from 'rxjs/operators';
|
|
9
9
|
import * as i1$3 from '@angular/common';
|
|
10
10
|
import { isPlatformBrowser, isPlatformServer, DOCUMENT, APP_BASE_HREF, CommonModule } from '@angular/common';
|
|
@@ -471,7 +471,6 @@ const TOASTER_SERVICE = new InjectionToken("toaster-service");
|
|
|
471
471
|
const DIALOG_SERVICE = new InjectionToken("dialog-service");
|
|
472
472
|
const SOCKET_IO_PATH = new InjectionToken("socket-io-path");
|
|
473
473
|
const PROMISE_SERVICE = new InjectionToken("promise-service");
|
|
474
|
-
const WASI_IMPLEMENTATION = new InjectionToken("wasi-implementation");
|
|
475
474
|
const EXPRESS_REQUEST = new InjectionToken("express-request");
|
|
476
475
|
const API_SERVICE = new InjectionToken("api-service");
|
|
477
476
|
const DYNAMIC_ENTRY_COMPONENTS = new InjectionToken("dynamic-entry-components");
|
|
@@ -1137,6 +1136,16 @@ const shg_table = [
|
|
|
1137
1136
|
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
|
1138
1137
|
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24
|
|
1139
1138
|
];
|
|
1139
|
+
function drawRect(ctx, w, h) {
|
|
1140
|
+
ctx.beginPath();
|
|
1141
|
+
ctx.rect(-w / 2, -h / 2, w, h);
|
|
1142
|
+
ctx.closePath();
|
|
1143
|
+
}
|
|
1144
|
+
function drawOval(ctx, w, h) {
|
|
1145
|
+
ctx.beginPath();
|
|
1146
|
+
ctx.ellipse(0, 0, w / 2, h / 2, 0, 0, Math.PI * 2);
|
|
1147
|
+
ctx.closePath();
|
|
1148
|
+
}
|
|
1140
1149
|
class CanvasUtils {
|
|
1141
1150
|
static manipulatePixels(canvas, ctx, colorTransformer) {
|
|
1142
1151
|
const imgData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
|
@@ -1720,102 +1729,228 @@ class FileSystemEntry {
|
|
|
1720
1729
|
}
|
|
1721
1730
|
}
|
|
1722
1731
|
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
}
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1732
|
+
function dotProduct(a, b) {
|
|
1733
|
+
return a.x * b.x + a.y * b.y;
|
|
1734
|
+
}
|
|
1735
|
+
function isPoint(v) {
|
|
1736
|
+
return typeof v === "object" && !isNaN(v.x) && !isNaN(v.y);
|
|
1737
|
+
}
|
|
1738
|
+
function perpendicular(p) {
|
|
1739
|
+
return { x: -p.y, y: +p.x };
|
|
1740
|
+
}
|
|
1741
|
+
function ptAdd(a, b) {
|
|
1742
|
+
return { x: a.x + b.x, y: a.y + b.y };
|
|
1743
|
+
}
|
|
1744
|
+
function ptDistance(a, b) {
|
|
1745
|
+
const x = b.x - a.x;
|
|
1746
|
+
const y = b.y - a.y;
|
|
1747
|
+
return Math.sqrt(x * x + y * y);
|
|
1748
|
+
}
|
|
1749
|
+
function ptLength(p) {
|
|
1750
|
+
return Math.hypot(p.x, p.y);
|
|
1751
|
+
}
|
|
1752
|
+
function ptMultiply(a, b) {
|
|
1753
|
+
const s = isPoint(b) ? b : { x: b, y: b };
|
|
1754
|
+
return { x: a.x * s.x, y: a.y * s.y };
|
|
1755
|
+
}
|
|
1756
|
+
function ptSubtract(a, b) {
|
|
1757
|
+
return { x: a.x - b.x, y: a.y - b.y };
|
|
1758
|
+
}
|
|
1759
|
+
function rotateDeg(p, ang) {
|
|
1760
|
+
return rotateRad(p, toRadians(ang));
|
|
1761
|
+
}
|
|
1762
|
+
function rotateRad(p, ang) {
|
|
1763
|
+
const c = Math.cos(ang), s = Math.sin(ang);
|
|
1764
|
+
return { x: p.x * c - p.y * s, y: p.x * s + p.y * c };
|
|
1765
|
+
}
|
|
1766
|
+
function toDegrees(rad) {
|
|
1767
|
+
return rad * 180 / Math.PI;
|
|
1768
|
+
}
|
|
1769
|
+
function toRadians(deg) {
|
|
1770
|
+
return deg * Math.PI / 180;
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
function combineA(simplex, bary) {
|
|
1774
|
+
let out = { x: 0, y: 0 };
|
|
1775
|
+
for (let i = 0; i < simplex.length; i++)
|
|
1776
|
+
out = ptAdd(out, ptMultiply(simplex[i].a, bary[i] || 0));
|
|
1777
|
+
return out;
|
|
1778
|
+
}
|
|
1779
|
+
function combineB(simplex, bary) {
|
|
1780
|
+
let out = { x: 0, y: 0 };
|
|
1781
|
+
for (let i = 0; i < simplex.length; i++)
|
|
1782
|
+
out = ptAdd(out, ptMultiply(simplex[i].b, bary[i] || 0));
|
|
1783
|
+
return out;
|
|
1784
|
+
}
|
|
1785
|
+
function closestPointToOrigin(simplex) {
|
|
1786
|
+
// returns { simplex: prunedSimplex, closest: vec, bary: weights[] }
|
|
1787
|
+
if (simplex.length === 1) {
|
|
1788
|
+
return { simplex, closest: simplex[0].p, bary: [1] };
|
|
1789
|
+
}
|
|
1790
|
+
if (simplex.length === 2) {
|
|
1791
|
+
const A = simplex[0], B = simplex[1];
|
|
1792
|
+
const ab = ptSubtract(B.p, A.p);
|
|
1793
|
+
const ab2 = dotProduct(ab, ab);
|
|
1794
|
+
if (ab2 <= 1e-18) {
|
|
1795
|
+
return { simplex: [B], closest: B.p, bary: [1] };
|
|
1796
|
+
}
|
|
1797
|
+
const t = Math.max(0, Math.min(1, -dotProduct(A.p, ab) / ab2));
|
|
1798
|
+
const closest = ptAdd(A.p, ptMultiply(ab, t));
|
|
1799
|
+
if (t <= 1e-9) {
|
|
1800
|
+
return { simplex: [A], closest: A.p, bary: [1] };
|
|
1801
|
+
}
|
|
1802
|
+
if (t >= 1 - 1e-9) {
|
|
1803
|
+
return { simplex: [B], closest: B.p, bary: [1] };
|
|
1804
|
+
}
|
|
1805
|
+
return { simplex: [A, B], closest, bary: [1 - t, t] };
|
|
1806
|
+
}
|
|
1807
|
+
// Triangle case (A,B,C) – use Ericson's closest-point to triangle (p=origin)
|
|
1808
|
+
const A = simplex[0], B = simplex[1], C = simplex[2];
|
|
1809
|
+
const a = A.p, b = B.p, c = C.p;
|
|
1810
|
+
const ab = ptSubtract(b, a), ac = ptSubtract(c, a), ap = { x: -a.x, y: -a.y };
|
|
1811
|
+
const d1 = dotProduct(ab, ap), d2 = dotProduct(ac, ap);
|
|
1812
|
+
if (d1 <= 0 && d2 <= 0)
|
|
1813
|
+
return { simplex: [A], closest: a, bary: [1] };
|
|
1814
|
+
const bp = { x: -b.x, y: -b.y };
|
|
1815
|
+
const d3 = dotProduct(ab, bp), d4 = dotProduct(ac, bp);
|
|
1816
|
+
if (d3 >= 0 && d4 <= d3)
|
|
1817
|
+
return { simplex: [B], closest: b, bary: [1] };
|
|
1818
|
+
const vc = d1 * d4 - d3 * d2;
|
|
1819
|
+
if (vc <= 0 && d1 >= 0 && d3 <= 0) {
|
|
1820
|
+
const v = d1 / (d1 - d3);
|
|
1821
|
+
const closest = ptAdd(a, ptMultiply(ab, v));
|
|
1822
|
+
return { simplex: [A, B], closest, bary: [1 - v, v] };
|
|
1823
|
+
}
|
|
1824
|
+
const cp = { x: -c.x, y: -c.y };
|
|
1825
|
+
const bc = ptSubtract(c, b);
|
|
1826
|
+
const d5 = dotProduct(bc, cp), d6 = dotProduct(ac, cp);
|
|
1827
|
+
if (d6 >= 0 && d5 <= d6)
|
|
1828
|
+
return { simplex: [C], closest: c, bary: [1] };
|
|
1829
|
+
const vb = d5 * d2 - d1 * d6;
|
|
1830
|
+
if (vb <= 0 && d2 >= 0 && d6 <= 0) {
|
|
1831
|
+
const w = d2 / (d2 - d6);
|
|
1832
|
+
const closest = ptAdd(a, ptMultiply(ac, w));
|
|
1833
|
+
return { simplex: [A, C], closest, bary: [1 - w, 0, w] };
|
|
1834
|
+
}
|
|
1835
|
+
const va = d3 * d6 - d5 * d4;
|
|
1836
|
+
if (va <= 0) {
|
|
1837
|
+
const denom = (d4 - d3) + (d5 - d6);
|
|
1838
|
+
const w = denom !== 0 ? (d4 - d3) / denom : 0.5;
|
|
1839
|
+
const closest = ptAdd(b, ptMultiply(bc, w));
|
|
1840
|
+
return { simplex: [B, C], closest, bary: [0, 1 - w, w] };
|
|
1841
|
+
}
|
|
1842
|
+
// Origin inside triangle – distance is zero
|
|
1843
|
+
return { simplex: [A, B, C], closest: { x: 0, y: 0 }, bary: [0, 0, 0] };
|
|
1752
1844
|
}
|
|
1753
|
-
|
|
1845
|
+
/**
|
|
1846
|
+
* ====== GJK distance (2D) ======
|
|
1847
|
+
* We keep, for each simplex vertex, the Minkowski point p = a - b and the witnesses a,b.
|
|
1848
|
+
* @param A
|
|
1849
|
+
* @param B
|
|
1850
|
+
*/
|
|
1851
|
+
function gjkDistance(A, B) {
|
|
1852
|
+
const MAX = 64, EPS = 1e-9;
|
|
1853
|
+
const centerA = { x: A.x, y: A.y }, centerB = { x: B.x, y: B.y };
|
|
1854
|
+
let d = ptSubtract(centerB, centerA);
|
|
1855
|
+
if (Math.abs(d.x) < EPS && Math.abs(d.y) < EPS)
|
|
1856
|
+
d = { x: 1, y: 0 };
|
|
1857
|
+
const sup = (dir) => {
|
|
1858
|
+
const a = A.support(dir);
|
|
1859
|
+
const b = B.support({ x: -dir.x, y: -dir.y });
|
|
1860
|
+
return { p: ptSubtract(a, b), a, b };
|
|
1861
|
+
};
|
|
1862
|
+
let simplex = [sup(d)];
|
|
1863
|
+
let closest = simplex[0].p; // vector to origin
|
|
1864
|
+
let dir = { x: -closest.x, y: -closest.y };
|
|
1865
|
+
let best2 = dotProduct(closest, closest);
|
|
1866
|
+
for (let iter = 0; iter < MAX; iter++) {
|
|
1867
|
+
if (ptLength(dir) <= EPS) { // origin reached
|
|
1868
|
+
const a = simplex[simplex.length - 1].a, b = simplex[simplex.length - 1].b;
|
|
1869
|
+
return { distance: 0, pa: a, pb: b };
|
|
1870
|
+
}
|
|
1871
|
+
const vtx = sup(dir);
|
|
1872
|
+
// termination: support didn't pass beyond previous closest along dir
|
|
1873
|
+
if (dotProduct(vtx.p, dir) - Math.sqrt(best2) <= EPS) {
|
|
1874
|
+
break;
|
|
1875
|
+
}
|
|
1876
|
+
simplex.push(vtx);
|
|
1877
|
+
const reduced = closestPointToOrigin(simplex);
|
|
1878
|
+
simplex = reduced.simplex;
|
|
1879
|
+
closest = reduced.closest;
|
|
1880
|
+
best2 = dotProduct(closest, closest);
|
|
1881
|
+
dir = { x: -closest.x, y: -closest.y };
|
|
1882
|
+
if (best2 <= EPS * EPS) {
|
|
1883
|
+
const pa = combineA(simplex, reduced.bary);
|
|
1884
|
+
const pb = combineB(simplex, reduced.bary);
|
|
1885
|
+
return { distance: 0, pa, pb };
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
const res = closestPointToOrigin(simplex);
|
|
1889
|
+
const pa = combineA(simplex, res.bary);
|
|
1890
|
+
const pb = combineB(simplex, res.bary);
|
|
1891
|
+
return { distance: Math.sqrt(dotProduct(res.closest, res.closest)), pa, pb };
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
class Shape {
|
|
1754
1895
|
get center() {
|
|
1755
|
-
return
|
|
1896
|
+
return this.pt;
|
|
1756
1897
|
}
|
|
1757
|
-
get
|
|
1758
|
-
return
|
|
1759
|
-
}
|
|
1760
|
-
get right() {
|
|
1761
|
-
return new Point(this.x + this.radius, this.y);
|
|
1762
|
-
}
|
|
1763
|
-
get top() {
|
|
1764
|
-
return new Point(this.x, this.y + this.radius);
|
|
1765
|
-
}
|
|
1766
|
-
get bottom() {
|
|
1767
|
-
return new Point(this.x, this.y - this.radius);
|
|
1898
|
+
get x() {
|
|
1899
|
+
return this.center.x;
|
|
1768
1900
|
}
|
|
1769
|
-
get
|
|
1770
|
-
return
|
|
1901
|
+
get y() {
|
|
1902
|
+
return this.center.y;
|
|
1771
1903
|
}
|
|
1772
|
-
constructor(x, y
|
|
1773
|
-
this.
|
|
1774
|
-
this.y = y;
|
|
1775
|
-
this.radius = radius;
|
|
1904
|
+
constructor(x, y) {
|
|
1905
|
+
this.pt = { x, y };
|
|
1776
1906
|
}
|
|
1777
1907
|
distance(p) {
|
|
1778
|
-
return this.center
|
|
1908
|
+
return ptDistance(this.center, p);
|
|
1909
|
+
}
|
|
1910
|
+
minDistance(shape) {
|
|
1911
|
+
return gjkDistance(this, shape).distance;
|
|
1779
1912
|
}
|
|
1780
1913
|
}
|
|
1781
|
-
class Point {
|
|
1914
|
+
class Point extends Shape {
|
|
1782
1915
|
static { this.Zero = new Point(0, 0); }
|
|
1783
1916
|
get length() {
|
|
1784
|
-
return this
|
|
1917
|
+
return ptLength(this);
|
|
1785
1918
|
}
|
|
1786
1919
|
get perpendicular() {
|
|
1787
|
-
return new Point(this
|
|
1920
|
+
return new Point(perpendicular(this));
|
|
1788
1921
|
}
|
|
1789
|
-
constructor(
|
|
1790
|
-
|
|
1791
|
-
|
|
1922
|
+
constructor(xOrP, y = 0) {
|
|
1923
|
+
super(0, y);
|
|
1924
|
+
const x = Number(xOrP);
|
|
1925
|
+
this.pt = isPoint(xOrP) ? xOrP : { x: isNaN(x) ? 0 : xOrP, y };
|
|
1926
|
+
}
|
|
1927
|
+
support() {
|
|
1928
|
+
return this.pt;
|
|
1792
1929
|
}
|
|
1793
1930
|
add(p) {
|
|
1794
|
-
return new Point(this
|
|
1931
|
+
return new Point(ptAdd(this, p));
|
|
1795
1932
|
}
|
|
1796
|
-
|
|
1797
|
-
return new Point(this
|
|
1933
|
+
sub(p) {
|
|
1934
|
+
return new Point(ptSubtract(this, p));
|
|
1798
1935
|
}
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
return new Point(this.x * p.x, this.y * p.y);
|
|
1802
|
-
}
|
|
1803
|
-
return new Point(this.x * p, this.y * p);
|
|
1936
|
+
mul(p) {
|
|
1937
|
+
return new Point(ptMultiply(this, p));
|
|
1804
1938
|
}
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1939
|
+
dot(p) {
|
|
1940
|
+
return new Point(dotProduct(this, p));
|
|
1941
|
+
}
|
|
1942
|
+
distance(p) {
|
|
1943
|
+
return ptDistance(this, p);
|
|
1809
1944
|
}
|
|
1810
1945
|
lerp(p, ratio) {
|
|
1811
|
-
const diff = p.
|
|
1812
|
-
return this.add(diff.
|
|
1946
|
+
const diff = p.sub(this);
|
|
1947
|
+
return this.add(diff.mul(ratio));
|
|
1813
1948
|
}
|
|
1814
1949
|
perpendicularTo(p, length) {
|
|
1815
|
-
const diff = p.perpendicular.
|
|
1950
|
+
const diff = p.perpendicular.sub(this.perpendicular);
|
|
1816
1951
|
const ratio = length / diff.length;
|
|
1817
1952
|
const center = this.lerp(p, .5);
|
|
1818
|
-
return center.add(diff.
|
|
1953
|
+
return center.add(diff.mul(ratio));
|
|
1819
1954
|
}
|
|
1820
1955
|
circleWith(a, b) {
|
|
1821
1956
|
const yDelta_a = b.y - a.y;
|
|
@@ -1830,8 +1965,8 @@ class Point {
|
|
|
1830
1965
|
return new Circle(center.x, center.y, center.distance(this));
|
|
1831
1966
|
}
|
|
1832
1967
|
tangents(c) {
|
|
1833
|
-
const pd = c.center
|
|
1834
|
-
const a = Math.asin(c.radius / pd
|
|
1968
|
+
const pd = ptSubtract(c.center, this);
|
|
1969
|
+
const a = Math.asin(c.radius / ptLength(pd));
|
|
1835
1970
|
const b = Math.atan2(pd.y, pd.x);
|
|
1836
1971
|
// Tangent points
|
|
1837
1972
|
let t = b - a;
|
|
@@ -1841,7 +1976,7 @@ class Point {
|
|
|
1841
1976
|
return [t1, t2];
|
|
1842
1977
|
}
|
|
1843
1978
|
angle(p) {
|
|
1844
|
-
const diff = p.
|
|
1979
|
+
const diff = p.sub(this);
|
|
1845
1980
|
return Math.atan2(diff.y, diff.x) * 180 / Math.PI;
|
|
1846
1981
|
}
|
|
1847
1982
|
rotateAround(p, angle) {
|
|
@@ -1851,6 +1986,48 @@ class Point {
|
|
|
1851
1986
|
return p.add(rotated);
|
|
1852
1987
|
}
|
|
1853
1988
|
}
|
|
1989
|
+
class Rect extends Shape {
|
|
1990
|
+
constructor(x, y, width, height, rotation = 0) {
|
|
1991
|
+
super(x, y);
|
|
1992
|
+
this.width = width;
|
|
1993
|
+
this.height = height;
|
|
1994
|
+
this.rotation = rotation;
|
|
1995
|
+
}
|
|
1996
|
+
support(dir) {
|
|
1997
|
+
const ang = this.rotation ?? 0;
|
|
1998
|
+
const dLocal = rotateDeg(dir, -ang);
|
|
1999
|
+
const hw = Math.max(0, this.width / 2), hh = Math.max(0, this.height / 2);
|
|
2000
|
+
const lx = dLocal.x >= 0 ? hw : -hw;
|
|
2001
|
+
const ly = dLocal.y >= 0 ? hh : -hh;
|
|
2002
|
+
return ptAdd(rotateDeg({ x: lx, y: ly }, ang), { x: this.x, y: this.y });
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
class Oval extends Shape {
|
|
2006
|
+
constructor(x, y, width, height, rotation = 0) {
|
|
2007
|
+
super(x, y);
|
|
2008
|
+
this.width = width;
|
|
2009
|
+
this.height = height;
|
|
2010
|
+
this.rotation = rotation;
|
|
2011
|
+
}
|
|
2012
|
+
support(dir) {
|
|
2013
|
+
const ang = this.rotation ?? 0;
|
|
2014
|
+
const d = rotateDeg(dir, -ang);
|
|
2015
|
+
const a = Math.max(0, this.width / 2);
|
|
2016
|
+
const b = Math.max(0, this.height / 2);
|
|
2017
|
+
if (Math.abs(d.x) < 1e-12 && Math.abs(d.y) < 1e-12)
|
|
2018
|
+
return { x: this.x, y: this.y };
|
|
2019
|
+
const q = Math.hypot(a * d.x, b * d.y) || 1; // sqrt((a*dx)^2 + (b*dy)^2)
|
|
2020
|
+
const lx = (a * a * d.x) / q;
|
|
2021
|
+
const ly = (b * b * d.y) / q;
|
|
2022
|
+
return ptAdd(rotateDeg({ x: lx, y: ly }, ang), { x: this.x, y: this.y });
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
class Circle extends Oval {
|
|
2026
|
+
constructor(x, y, radius, rotation = 0) {
|
|
2027
|
+
super(x, y, radius * 2, radius * 2, rotation);
|
|
2028
|
+
this.radius = radius;
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
1854
2031
|
|
|
1855
2032
|
class Initializer {
|
|
1856
2033
|
get isInitialized() {
|
|
@@ -1981,10 +2158,10 @@ class LoaderUtils {
|
|
|
1981
2158
|
}
|
|
1982
2159
|
}
|
|
1983
2160
|
|
|
2161
|
+
const EPSILON = 1e-9;
|
|
1984
2162
|
class MathUtils {
|
|
1985
|
-
static { this.EPSILON = 1e-9; }
|
|
1986
2163
|
static equal(a, b, epsilon = null) {
|
|
1987
|
-
epsilon = ObjectUtils.isNumber(epsilon) ? epsilon :
|
|
2164
|
+
epsilon = ObjectUtils.isNumber(epsilon) ? epsilon : EPSILON;
|
|
1988
2165
|
return Math.abs(a - b) < epsilon;
|
|
1989
2166
|
}
|
|
1990
2167
|
static clamp(value, min, max) {
|
|
@@ -2158,6 +2335,27 @@ function provideEntryComponents(components, moduleId) {
|
|
|
2158
2335
|
multi: true
|
|
2159
2336
|
};
|
|
2160
2337
|
}
|
|
2338
|
+
function provideWithOptions(type, options) {
|
|
2339
|
+
return {
|
|
2340
|
+
useFactory: function (parent) {
|
|
2341
|
+
const providers = [
|
|
2342
|
+
{
|
|
2343
|
+
provide: OPTIONS_TOKEN,
|
|
2344
|
+
useValue: options
|
|
2345
|
+
},
|
|
2346
|
+
{
|
|
2347
|
+
provide: type,
|
|
2348
|
+
useClass: type
|
|
2349
|
+
}
|
|
2350
|
+
];
|
|
2351
|
+
return Injector.create({
|
|
2352
|
+
providers,
|
|
2353
|
+
parent
|
|
2354
|
+
}).get(type, null, { optional: true });
|
|
2355
|
+
},
|
|
2356
|
+
deps: [Injector]
|
|
2357
|
+
};
|
|
2358
|
+
}
|
|
2161
2359
|
|
|
2162
2360
|
class TimerUtils {
|
|
2163
2361
|
static createTimeout(func, time) {
|
|
@@ -2575,202 +2773,112 @@ class UniqueUtils {
|
|
|
2575
2773
|
}
|
|
2576
2774
|
}
|
|
2577
2775
|
|
|
2578
|
-
class
|
|
2579
|
-
get
|
|
2580
|
-
return
|
|
2581
|
-
}
|
|
2582
|
-
get length() {
|
|
2583
|
-
return Math.sqrt(this.dot(this));
|
|
2584
|
-
}
|
|
2585
|
-
get unit() {
|
|
2586
|
-
return this.divide(this.length);
|
|
2776
|
+
class EventsService {
|
|
2777
|
+
get isSticky() {
|
|
2778
|
+
return this.sticky;
|
|
2587
2779
|
}
|
|
2588
|
-
get
|
|
2589
|
-
return
|
|
2780
|
+
get isAuthenticated() {
|
|
2781
|
+
return !!this.user;
|
|
2590
2782
|
}
|
|
2591
|
-
|
|
2592
|
-
|
|
2783
|
+
constructor() {
|
|
2784
|
+
this.eventForwarded = new Subject();
|
|
2785
|
+
this.stickyUpdated = new Subject();
|
|
2786
|
+
this.languageChanged = new Subject();
|
|
2787
|
+
this.translationsEnabled = new Subject();
|
|
2788
|
+
this.userChanged = new Subject();
|
|
2789
|
+
this.sticky = false;
|
|
2790
|
+
this.user = null;
|
|
2791
|
+
this.userChanged.subscribe(user => {
|
|
2792
|
+
this.user = user;
|
|
2793
|
+
});
|
|
2593
2794
|
}
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
theta: Math.atan2(this.z, this.x),
|
|
2597
|
-
phi: Math.asin(this.y / this.length)
|
|
2598
|
-
};
|
|
2795
|
+
event(e) {
|
|
2796
|
+
this.eventForwarded.next(e);
|
|
2599
2797
|
}
|
|
2600
|
-
|
|
2601
|
-
this.
|
|
2602
|
-
this.
|
|
2603
|
-
this.z = z;
|
|
2604
|
-
}
|
|
2605
|
-
add(v) {
|
|
2606
|
-
if (v instanceof Vector)
|
|
2607
|
-
return new Vector(this.x + v.x, this.y + v.y, this.z + v.z);
|
|
2608
|
-
else
|
|
2609
|
-
return new Vector(this.x + v, this.y + v, this.z + v);
|
|
2610
|
-
}
|
|
2611
|
-
subtract(v) {
|
|
2612
|
-
if (v instanceof Vector)
|
|
2613
|
-
return new Vector(this.x - v.x, this.y - v.y, this.z - v.z);
|
|
2614
|
-
else
|
|
2615
|
-
return new Vector(this.x - v, this.y - v, this.z - v);
|
|
2616
|
-
}
|
|
2617
|
-
multiply(v) {
|
|
2618
|
-
if (v instanceof Vector)
|
|
2619
|
-
return new Vector(this.x * v.x, this.y * v.y, this.z * v.z);
|
|
2620
|
-
else
|
|
2621
|
-
return new Vector(this.x * v, this.y * v, this.z * v);
|
|
2622
|
-
}
|
|
2623
|
-
divide(v) {
|
|
2624
|
-
if (v instanceof Vector)
|
|
2625
|
-
return new Vector(this.x / v.x, this.y / v.y, this.z / v.z);
|
|
2626
|
-
else
|
|
2627
|
-
return new Vector(this.x / v, this.y / v, this.z / v);
|
|
2628
|
-
}
|
|
2629
|
-
equals(v) {
|
|
2630
|
-
return this.x == v.x && this.y == v.y && this.z == v.z;
|
|
2631
|
-
}
|
|
2632
|
-
dot(v) {
|
|
2633
|
-
return this.x * v.x + this.y * v.y + this.z * v.z;
|
|
2634
|
-
}
|
|
2635
|
-
cross(v) {
|
|
2636
|
-
return new Vector(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x);
|
|
2637
|
-
}
|
|
2638
|
-
angleTo(v) {
|
|
2639
|
-
return Math.acos(this.dot(v) / (this.length * v.length));
|
|
2640
|
-
}
|
|
2641
|
-
toArray(n) {
|
|
2642
|
-
return [this.x, this.y, this.z].slice(0, n || 3);
|
|
2643
|
-
}
|
|
2644
|
-
clone() {
|
|
2645
|
-
return new Vector(this.x, this.y, this.z);
|
|
2646
|
-
}
|
|
2647
|
-
init(x, y, z) {
|
|
2648
|
-
this.x = x;
|
|
2649
|
-
this.y = y;
|
|
2650
|
-
this.z = z;
|
|
2651
|
-
return this;
|
|
2798
|
+
updateSticky(sticky) {
|
|
2799
|
+
this.sticky = sticky;
|
|
2800
|
+
this.stickyUpdated.next(sticky);
|
|
2652
2801
|
}
|
|
2802
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: EventsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2803
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: EventsService }); }
|
|
2653
2804
|
}
|
|
2805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: EventsService, decorators: [{
|
|
2806
|
+
type: Injectable
|
|
2807
|
+
}], ctorParameters: () => [] });
|
|
2654
2808
|
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
wasmResolve = resolve;
|
|
2681
|
-
});
|
|
2682
|
-
self.onmessage = function (e) {
|
|
2683
|
-
const data = e.data;
|
|
2684
|
-
const { type, payload } = data;
|
|
2685
|
-
switch (type) {
|
|
2686
|
-
case "wasm":
|
|
2687
|
-
const { url, wasi } = payload;
|
|
2688
|
-
fetch(url).then(response => response.arrayBuffer()).then(bytes => {
|
|
2689
|
-
const wasiImpl = JSONfn.parse(wasi);
|
|
2690
|
-
return new wasiImpl().instantiate(bytes);
|
|
2691
|
-
}).then(instance => {
|
|
2692
|
-
wasmResolve(instance);
|
|
2693
|
-
const methods = Object.getOwnPropertyNames(instance).filter(key => typeof instance[key] === "function");
|
|
2694
|
-
self.postMessage({ type: "methods", payload: methods });
|
|
2695
|
-
});
|
|
2696
|
-
break;
|
|
2697
|
-
case "call":
|
|
2698
|
-
wasmInstance.then(instance => {
|
|
2699
|
-
const { name, id, args } = payload;
|
|
2700
|
-
if (logTimes) {
|
|
2701
|
-
console.time(id);
|
|
2702
|
-
console.timeLog(id, `Calling ${name} ...`);
|
|
2809
|
+
const emptyGuards = [];
|
|
2810
|
+
class AclService {
|
|
2811
|
+
constructor(injector, state, events) {
|
|
2812
|
+
this.injector = injector;
|
|
2813
|
+
this.state = state;
|
|
2814
|
+
this.events = events;
|
|
2815
|
+
this.components = [];
|
|
2816
|
+
this.events.userChanged.subscribe(() => {
|
|
2817
|
+
this.components.forEach(t => t.dirty = true);
|
|
2818
|
+
const info = this.getStateInfo();
|
|
2819
|
+
const check = info && info.guard instanceof AuthGuard ? info.guard.checkRoute(info.route) : Promise.resolve(true);
|
|
2820
|
+
check.then(result => {
|
|
2821
|
+
if (result) {
|
|
2822
|
+
if (!info || !info.dirty)
|
|
2823
|
+
return;
|
|
2824
|
+
info.dirty = false;
|
|
2825
|
+
const component = info.component;
|
|
2826
|
+
if (!info.component)
|
|
2827
|
+
return;
|
|
2828
|
+
if (info.first) {
|
|
2829
|
+
if (ObjectUtils.isFunction(component.onUserInitialized)) {
|
|
2830
|
+
component.onUserInitialized();
|
|
2831
|
+
}
|
|
2832
|
+
info.first = false;
|
|
2833
|
+
return;
|
|
2703
2834
|
}
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
if (logTimes) {
|
|
2707
|
-
console.timeLog(id, `Called ${name}`);
|
|
2708
|
-
console.timeEnd(id);
|
|
2835
|
+
if (ObjectUtils.isFunction(component.onUserChanged)) {
|
|
2836
|
+
component.onUserChanged();
|
|
2709
2837
|
}
|
|
2710
|
-
|
|
2838
|
+
return;
|
|
2839
|
+
}
|
|
2840
|
+
info.guard.getReturnState(info.route).then(returnState => {
|
|
2841
|
+
if (!returnState)
|
|
2842
|
+
return;
|
|
2843
|
+
this.state.navigate(returnState);
|
|
2711
2844
|
});
|
|
2712
|
-
|
|
2713
|
-
}
|
|
2714
|
-
};
|
|
2715
|
-
}
|
|
2716
|
-
class WasmWorkerProxy {
|
|
2717
|
-
constructor(wasmPath, wasi, logTimes = false) {
|
|
2718
|
-
this.methods = new Promise(resolve => {
|
|
2719
|
-
this.onMethods = resolve;
|
|
2720
|
-
});
|
|
2721
|
-
const lt = logTimes ? "true" : "false";
|
|
2722
|
-
const blob = new Blob([`${JSONfn.toString()} (${workerFunction.toString()})(JSONfn, ${lt})`], { type: 'application/javascript' });
|
|
2723
|
-
this.worker = new Worker(URL.createObjectURL(blob));
|
|
2724
|
-
this.worker.postMessage({
|
|
2725
|
-
type: "wasm",
|
|
2726
|
-
payload: { url: wasmPath, wasi: JSONfn.stringify(wasi), logTimes }
|
|
2845
|
+
});
|
|
2727
2846
|
});
|
|
2728
|
-
this.
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
}
|
|
2736
|
-
return (...args) => {
|
|
2737
|
-
return this.call(prop.toString(), args);
|
|
2738
|
-
};
|
|
2847
|
+
this.state.subscribe(() => {
|
|
2848
|
+
const info = this.getStateInfo();
|
|
2849
|
+
if (!info?.component)
|
|
2850
|
+
return;
|
|
2851
|
+
const component = info.component;
|
|
2852
|
+
if (ObjectUtils.isFunction(component.onUserInitialized)) {
|
|
2853
|
+
component.onUserInitialized();
|
|
2739
2854
|
}
|
|
2855
|
+
info.first = false;
|
|
2740
2856
|
});
|
|
2741
2857
|
}
|
|
2742
|
-
|
|
2743
|
-
const
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
break;
|
|
2757
|
-
}
|
|
2758
|
-
}
|
|
2759
|
-
async call(method, args) {
|
|
2760
|
-
const methods = await this.methods;
|
|
2761
|
-
if (!methods.includes(method)) {
|
|
2762
|
-
throw new Error(`Method ${method} not found`);
|
|
2858
|
+
getStateInfo() {
|
|
2859
|
+
const route = this.state.route;
|
|
2860
|
+
if (!route)
|
|
2861
|
+
return null;
|
|
2862
|
+
let info = this.components.find(t => t.route == this.state.route);
|
|
2863
|
+
if (!info) {
|
|
2864
|
+
const guardType = (route.canActivate || emptyGuards)[0];
|
|
2865
|
+
info = {
|
|
2866
|
+
route: this.state.route,
|
|
2867
|
+
guard: guardType ? this.injector.get(guardType) : null,
|
|
2868
|
+
dirty: true,
|
|
2869
|
+
first: true
|
|
2870
|
+
};
|
|
2871
|
+
this.components.push(info);
|
|
2763
2872
|
}
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
this.worker.postMessage({
|
|
2767
|
-
type: "call",
|
|
2768
|
-
payload: { name: method, id, args }
|
|
2769
|
-
});
|
|
2770
|
-
this.promises.set(id, { resolve, reject });
|
|
2771
|
-
});
|
|
2873
|
+
info.component = this.state.component;
|
|
2874
|
+
return info;
|
|
2772
2875
|
}
|
|
2876
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AclService, deps: [{ token: i0.Injector }, { token: StateService }, { token: EventsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2877
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AclService }); }
|
|
2773
2878
|
}
|
|
2879
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AclService, decorators: [{
|
|
2880
|
+
type: Injectable
|
|
2881
|
+
}], ctorParameters: () => [{ type: i0.Injector }, { type: StateService }, { type: EventsService }] });
|
|
2774
2882
|
|
|
2775
2883
|
class BaseHttpClient extends HttpClient {
|
|
2776
2884
|
constructor(handler) {
|
|
@@ -2858,39 +2966,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2858
2966
|
type: Injectable
|
|
2859
2967
|
}], ctorParameters: () => [{ type: UniversalService }] });
|
|
2860
2968
|
|
|
2861
|
-
class EventsService {
|
|
2862
|
-
get isSticky() {
|
|
2863
|
-
return this.sticky;
|
|
2864
|
-
}
|
|
2865
|
-
get isAuthenticated() {
|
|
2866
|
-
return !!this.user;
|
|
2867
|
-
}
|
|
2868
|
-
constructor() {
|
|
2869
|
-
this.eventForwarded = new Subject();
|
|
2870
|
-
this.stickyUpdated = new Subject();
|
|
2871
|
-
this.languageChanged = new Subject();
|
|
2872
|
-
this.translationsEnabled = new Subject();
|
|
2873
|
-
this.userChanged = new Subject();
|
|
2874
|
-
this.sticky = false;
|
|
2875
|
-
this.user = null;
|
|
2876
|
-
this.userChanged.subscribe(user => {
|
|
2877
|
-
this.user = user;
|
|
2878
|
-
});
|
|
2879
|
-
}
|
|
2880
|
-
event(e) {
|
|
2881
|
-
this.eventForwarded.next(e);
|
|
2882
|
-
}
|
|
2883
|
-
updateSticky(sticky) {
|
|
2884
|
-
this.sticky = sticky;
|
|
2885
|
-
this.stickyUpdated.next(sticky);
|
|
2886
|
-
}
|
|
2887
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: EventsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2888
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: EventsService }); }
|
|
2889
|
-
}
|
|
2890
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: EventsService, decorators: [{
|
|
2891
|
-
type: Injectable
|
|
2892
|
-
}], ctorParameters: () => [] });
|
|
2893
|
-
|
|
2894
2969
|
class CacheService {
|
|
2895
2970
|
get userChanged() {
|
|
2896
2971
|
return this.events.userChanged;
|
|
@@ -3257,167 +3332,7 @@ class HttpPromise extends Promise {
|
|
|
3257
3332
|
catch(onRejected) {
|
|
3258
3333
|
return this.then(null, onRejected);
|
|
3259
3334
|
}
|
|
3260
|
-
}
|
|
3261
|
-
|
|
3262
|
-
class LocalHttpService extends BaseHttpService {
|
|
3263
|
-
get name() {
|
|
3264
|
-
return "local-http";
|
|
3265
|
-
}
|
|
3266
|
-
get config() {
|
|
3267
|
-
return this.configs.config;
|
|
3268
|
-
}
|
|
3269
|
-
get withCredentials() {
|
|
3270
|
-
return false;
|
|
3271
|
-
}
|
|
3272
|
-
initService() {
|
|
3273
|
-
super.initService();
|
|
3274
|
-
this.images = {};
|
|
3275
|
-
}
|
|
3276
|
-
url(url) {
|
|
3277
|
-
if (!url)
|
|
3278
|
-
return url;
|
|
3279
|
-
const config = this.config;
|
|
3280
|
-
const baseUrl = config.cdnUrl || config.baseUrl || "";
|
|
3281
|
-
return url.startsWith("data:") || url.startsWith("http") || url.startsWith("//")
|
|
3282
|
-
? url
|
|
3283
|
-
: `${baseUrl}${url}`;
|
|
3284
|
-
}
|
|
3285
|
-
get(url, options, body) {
|
|
3286
|
-
options = this.makeOptions(options, "GET", body, this.caches.permanent);
|
|
3287
|
-
return this.toPromise(url, options);
|
|
3288
|
-
}
|
|
3289
|
-
getImage(url) {
|
|
3290
|
-
if (this.universal.isServer)
|
|
3291
|
-
return Promise.resolve(null);
|
|
3292
|
-
if (!url)
|
|
3293
|
-
return Promise.resolve(new Image());
|
|
3294
|
-
this.images[url] = this.images[url] || new Promise((resolve, reject) => {
|
|
3295
|
-
const image = new Image();
|
|
3296
|
-
image.crossOrigin = "Anonymous";
|
|
3297
|
-
image.src = this.url(url);
|
|
3298
|
-
image.onload = () => resolve(image);
|
|
3299
|
-
image.onerror = reject;
|
|
3300
|
-
});
|
|
3301
|
-
return this.images[url];
|
|
3302
|
-
}
|
|
3303
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LocalHttpService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3304
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LocalHttpService }); }
|
|
3305
|
-
}
|
|
3306
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LocalHttpService, decorators: [{
|
|
3307
|
-
type: Injectable
|
|
3308
|
-
}] });
|
|
3309
|
-
|
|
3310
|
-
/**
|
|
3311
|
-
* Use this service to load WebAssembly modules
|
|
3312
|
-
*/
|
|
3313
|
-
class WasmService {
|
|
3314
|
-
constructor(universal, http, wasi) {
|
|
3315
|
-
this.universal = universal;
|
|
3316
|
-
this.http = http;
|
|
3317
|
-
this.wasi = wasi.constructor;
|
|
3318
|
-
}
|
|
3319
|
-
async getModule(name) {
|
|
3320
|
-
if (!this.universal.isBrowser || !name)
|
|
3321
|
-
return null;
|
|
3322
|
-
this.modules = this.modules || {};
|
|
3323
|
-
this.modules[name] = this.modules[name] || this.http.get(`wasm/${name}.wasm`, {
|
|
3324
|
-
responseType: "arraybuffer"
|
|
3325
|
-
}).then(async (bytes) => {
|
|
3326
|
-
const wasi = new this.wasi();
|
|
3327
|
-
return await wasi.instantiate(bytes);
|
|
3328
|
-
});
|
|
3329
|
-
return this.modules[name];
|
|
3330
|
-
}
|
|
3331
|
-
getWorkerModule(name) {
|
|
3332
|
-
if (!this.universal.isBrowser || !name)
|
|
3333
|
-
return null;
|
|
3334
|
-
this.workerModules = this.workerModules || {};
|
|
3335
|
-
this.workerModules[name] = new WasmWorkerProxy(this.http.url(`wasm/${name}.wasm`), this.wasi);
|
|
3336
|
-
return this.workerModules[name];
|
|
3337
|
-
}
|
|
3338
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: WasmService, deps: [{ token: UniversalService }, { token: LocalHttpService }, { token: WASI_IMPLEMENTATION }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3339
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: WasmService }); }
|
|
3340
|
-
}
|
|
3341
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: WasmService, decorators: [{
|
|
3342
|
-
type: Injectable
|
|
3343
|
-
}], ctorParameters: () => [{ type: UniversalService }, { type: LocalHttpService }, { type: undefined, decorators: [{
|
|
3344
|
-
type: Inject,
|
|
3345
|
-
args: [WASI_IMPLEMENTATION]
|
|
3346
|
-
}] }] });
|
|
3347
|
-
|
|
3348
|
-
const emptyGuards = [];
|
|
3349
|
-
class AclService {
|
|
3350
|
-
constructor(injector, state, events) {
|
|
3351
|
-
this.injector = injector;
|
|
3352
|
-
this.state = state;
|
|
3353
|
-
this.events = events;
|
|
3354
|
-
this.components = [];
|
|
3355
|
-
this.events.userChanged.subscribe(() => {
|
|
3356
|
-
this.components.forEach(t => t.dirty = true);
|
|
3357
|
-
const info = this.getStateInfo();
|
|
3358
|
-
const check = info && info.guard instanceof AuthGuard ? info.guard.checkRoute(info.route) : Promise.resolve(true);
|
|
3359
|
-
check.then(result => {
|
|
3360
|
-
if (result) {
|
|
3361
|
-
if (!info || !info.dirty)
|
|
3362
|
-
return;
|
|
3363
|
-
info.dirty = false;
|
|
3364
|
-
const component = info.component;
|
|
3365
|
-
if (!info.component)
|
|
3366
|
-
return;
|
|
3367
|
-
if (info.first) {
|
|
3368
|
-
if (ObjectUtils.isFunction(component.onUserInitialized)) {
|
|
3369
|
-
component.onUserInitialized();
|
|
3370
|
-
}
|
|
3371
|
-
info.first = false;
|
|
3372
|
-
return;
|
|
3373
|
-
}
|
|
3374
|
-
if (ObjectUtils.isFunction(component.onUserChanged)) {
|
|
3375
|
-
component.onUserChanged();
|
|
3376
|
-
}
|
|
3377
|
-
return;
|
|
3378
|
-
}
|
|
3379
|
-
info.guard.getReturnState(info.route).then(returnState => {
|
|
3380
|
-
if (!returnState)
|
|
3381
|
-
return;
|
|
3382
|
-
this.state.navigate(returnState);
|
|
3383
|
-
});
|
|
3384
|
-
});
|
|
3385
|
-
});
|
|
3386
|
-
this.state.subscribe(() => {
|
|
3387
|
-
const info = this.getStateInfo();
|
|
3388
|
-
if (!info?.component)
|
|
3389
|
-
return;
|
|
3390
|
-
const component = info.component;
|
|
3391
|
-
if (ObjectUtils.isFunction(component.onUserInitialized)) {
|
|
3392
|
-
component.onUserInitialized();
|
|
3393
|
-
}
|
|
3394
|
-
info.first = false;
|
|
3395
|
-
});
|
|
3396
|
-
}
|
|
3397
|
-
getStateInfo() {
|
|
3398
|
-
const route = this.state.route;
|
|
3399
|
-
if (!route)
|
|
3400
|
-
return null;
|
|
3401
|
-
let info = this.components.find(t => t.route == this.state.route);
|
|
3402
|
-
if (!info) {
|
|
3403
|
-
const guardType = (route.canActivate || emptyGuards)[0];
|
|
3404
|
-
info = {
|
|
3405
|
-
route: this.state.route,
|
|
3406
|
-
guard: guardType ? this.injector.get(guardType) : null,
|
|
3407
|
-
dirty: true,
|
|
3408
|
-
first: true
|
|
3409
|
-
};
|
|
3410
|
-
this.components.push(info);
|
|
3411
|
-
}
|
|
3412
|
-
info.component = this.state.component;
|
|
3413
|
-
return info;
|
|
3414
|
-
}
|
|
3415
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AclService, deps: [{ token: i0.Injector }, { token: StateService }, { token: EventsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3416
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AclService }); }
|
|
3417
|
-
}
|
|
3418
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AclService, decorators: [{
|
|
3419
|
-
type: Injectable
|
|
3420
|
-
}], ctorParameters: () => [{ type: i0.Injector }, { type: StateService }, { type: EventsService }] });
|
|
3335
|
+
}
|
|
3421
3336
|
|
|
3422
3337
|
class ApiService extends BaseHttpService {
|
|
3423
3338
|
get name() {
|
|
@@ -4078,6 +3993,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4078
3993
|
type: Injectable
|
|
4079
3994
|
}] });
|
|
4080
3995
|
|
|
3996
|
+
class LocalHttpService extends BaseHttpService {
|
|
3997
|
+
get name() {
|
|
3998
|
+
return "local-http";
|
|
3999
|
+
}
|
|
4000
|
+
get config() {
|
|
4001
|
+
return this.configs.config;
|
|
4002
|
+
}
|
|
4003
|
+
get withCredentials() {
|
|
4004
|
+
return false;
|
|
4005
|
+
}
|
|
4006
|
+
initService() {
|
|
4007
|
+
super.initService();
|
|
4008
|
+
this.images = {};
|
|
4009
|
+
}
|
|
4010
|
+
url(url) {
|
|
4011
|
+
if (!url)
|
|
4012
|
+
return url;
|
|
4013
|
+
const config = this.config;
|
|
4014
|
+
const baseUrl = config.cdnUrl || config.baseUrl || "";
|
|
4015
|
+
return url.startsWith("data:") || url.startsWith("http") || url.startsWith("//")
|
|
4016
|
+
? url
|
|
4017
|
+
: `${baseUrl}${url}`;
|
|
4018
|
+
}
|
|
4019
|
+
get(url, options, body) {
|
|
4020
|
+
options = this.makeOptions(options, "GET", body, this.caches.permanent);
|
|
4021
|
+
return this.toPromise(url, options);
|
|
4022
|
+
}
|
|
4023
|
+
getImage(url) {
|
|
4024
|
+
if (this.universal.isServer)
|
|
4025
|
+
return Promise.resolve(null);
|
|
4026
|
+
if (!url)
|
|
4027
|
+
return Promise.resolve(new Image());
|
|
4028
|
+
this.images[url] = this.images[url] || new Promise((resolve, reject) => {
|
|
4029
|
+
const image = new Image();
|
|
4030
|
+
image.crossOrigin = "Anonymous";
|
|
4031
|
+
image.src = this.url(url);
|
|
4032
|
+
image.onload = () => resolve(image);
|
|
4033
|
+
image.onerror = reject;
|
|
4034
|
+
});
|
|
4035
|
+
return this.images[url];
|
|
4036
|
+
}
|
|
4037
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LocalHttpService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4038
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LocalHttpService }); }
|
|
4039
|
+
}
|
|
4040
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LocalHttpService, decorators: [{
|
|
4041
|
+
type: Injectable
|
|
4042
|
+
}] });
|
|
4043
|
+
|
|
4081
4044
|
class OpenApiService {
|
|
4082
4045
|
constructor(api, staticSchemas) {
|
|
4083
4046
|
this.api = api;
|
|
@@ -7318,6 +7281,9 @@ class DynamicTableComponent {
|
|
|
7318
7281
|
this.testId = "table";
|
|
7319
7282
|
this.titlePrefix = "label";
|
|
7320
7283
|
this.realColumns = {};
|
|
7284
|
+
this.cols = [];
|
|
7285
|
+
this.sortable = false;
|
|
7286
|
+
this.localData = [];
|
|
7321
7287
|
}
|
|
7322
7288
|
setProperty(name, value) {
|
|
7323
7289
|
const elem = this.element.nativeElement;
|
|
@@ -7342,6 +7308,9 @@ class DynamicTableComponent {
|
|
|
7342
7308
|
ngAfterViewInit() {
|
|
7343
7309
|
this.rowTemplate = this.rowTemplate || this.defaultRowTemplate;
|
|
7344
7310
|
}
|
|
7311
|
+
ngOnDestroy() {
|
|
7312
|
+
this.subscription?.unsubscribe();
|
|
7313
|
+
}
|
|
7345
7314
|
ngOnChanges(changes) {
|
|
7346
7315
|
const orderBy = this.orderBy;
|
|
7347
7316
|
if (changes.columns) {
|
|
@@ -7361,6 +7330,7 @@ class DynamicTableComponent {
|
|
|
7361
7330
|
this.cols = Object.keys(this.realColumns);
|
|
7362
7331
|
const sortable = this.cols.filter(c => this.realColumns[c].sort);
|
|
7363
7332
|
const query = this.query || {};
|
|
7333
|
+
this.sortable = sortable.length > 0;
|
|
7364
7334
|
this.orderBy = sortable.includes(this.orderBy) ? this.orderBy : sortable[0] || null;
|
|
7365
7335
|
this.query = this.cols.reduce((res, col) => {
|
|
7366
7336
|
const value = query[col];
|
|
@@ -7374,11 +7344,17 @@ class DynamicTableComponent {
|
|
|
7374
7344
|
this.hasQuery = this.cols.some(col => this.realColumns[col].filter);
|
|
7375
7345
|
if (changes.orderBy && this.realColumns && this.cols) {
|
|
7376
7346
|
const sortable = this.cols.filter(c => this.realColumns[c].sort);
|
|
7347
|
+
this.sortable = sortable.length > 0;
|
|
7377
7348
|
this.orderBy = sortable.includes(this.orderBy) ? this.orderBy : sortable[0] || null;
|
|
7378
7349
|
}
|
|
7379
7350
|
if (!changes.data && !changes.parallelData && !changes.dataLoader && !changes.itemsPerPage && !changes.orderDescending && orderBy === this.orderBy)
|
|
7380
7351
|
return;
|
|
7381
|
-
this.
|
|
7352
|
+
const source = this.data instanceof Observable ? this.data : of(this.data || []);
|
|
7353
|
+
this.subscription?.unsubscribe();
|
|
7354
|
+
this.subscription = source.subscribe(data => {
|
|
7355
|
+
this.localData = data;
|
|
7356
|
+
this.refresh();
|
|
7357
|
+
});
|
|
7382
7358
|
}
|
|
7383
7359
|
onDragStart(ev, elem, item) {
|
|
7384
7360
|
if (!elem || !item || !ObjectUtils.isFunction(this.dragStartFn) || !this.dragStartFn({ ev, elem, item })) {
|
|
@@ -7480,21 +7456,21 @@ class DynamicTableComponent {
|
|
|
7480
7456
|
this.itemsPerPage = count;
|
|
7481
7457
|
this.refresh();
|
|
7482
7458
|
}
|
|
7483
|
-
loadLocalData(page, rowsPerPage, orderBy, orderDescending, filter) {
|
|
7484
|
-
if (!this.
|
|
7485
|
-
return
|
|
7459
|
+
async loadLocalData(page, rowsPerPage, orderBy, orderDescending, filter) {
|
|
7460
|
+
if (!this.localData) {
|
|
7461
|
+
return {
|
|
7486
7462
|
total: 0,
|
|
7487
7463
|
items: []
|
|
7488
|
-
}
|
|
7464
|
+
};
|
|
7489
7465
|
}
|
|
7490
7466
|
const compare = orderDescending
|
|
7491
7467
|
? (a, b) => DynamicTableComponent.compare(orderBy, b, a)
|
|
7492
7468
|
: (a, b) => DynamicTableComponent.compare(orderBy, a, b);
|
|
7493
7469
|
const from = (page - 1) * rowsPerPage;
|
|
7494
|
-
const dataLength = this.
|
|
7470
|
+
const dataLength = this.localData.length;
|
|
7495
7471
|
const length = Math.min(rowsPerPage, dataLength - from);
|
|
7496
7472
|
const parallelData = this.parallelData || [];
|
|
7497
|
-
let data = this.
|
|
7473
|
+
let data = this.localData.map((item, ix) => {
|
|
7498
7474
|
return new PaginationItemContext(item, parallelData[ix] || {}, dataLength, ix, ix);
|
|
7499
7475
|
});
|
|
7500
7476
|
if (ObjectUtils.isString(filter) && filter.length > 0) {
|
|
@@ -7503,19 +7479,20 @@ class DynamicTableComponent {
|
|
|
7503
7479
|
}
|
|
7504
7480
|
const items = orderBy ? data.sort(compare).splice(from, length) : data.splice(from, length);
|
|
7505
7481
|
items.forEach((context, ix) => {
|
|
7506
|
-
context.index =
|
|
7482
|
+
context.index = ix;
|
|
7483
|
+
context.dataIndex = from + ix;
|
|
7507
7484
|
});
|
|
7508
|
-
return
|
|
7485
|
+
return {
|
|
7509
7486
|
total: dataLength,
|
|
7510
7487
|
items: items
|
|
7511
|
-
}
|
|
7488
|
+
};
|
|
7512
7489
|
}
|
|
7513
7490
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicTableComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7514
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DynamicTableComponent, isStandalone: false, selector: "dynamic-table", inputs: { dataLoader: "dataLoader", data: "data", selected: "selected", page: "page", urlParam: "urlParam", parallelData: "parallelData", columns: "columns", showFilter: "showFilter", filterLabel: "filterLabel", placeholder: "placeholder", showItems: "showItems", itemsPerPage: "itemsPerPage", updateTime: "updateTime", filterTime: "filterTime", maxPages: "maxPages", directionLinks: "directionLinks", boundaryLinks: "boundaryLinks", orderBy: "orderBy", orderDescending: "orderDescending", testId: "testId", titlePrefix: "titlePrefix", dragStartFn: "dragStartFn", dragEnterFn: "dragEnterFn", dropFn: "dropFn" }, queries: [{ propertyName: "rowTemplate", first: true, predicate: ["rowTemplate"], descendants: true, static: true }, { propertyName: "wrapperTemplate", first: true, predicate: ["wrapperTemplate"], descendants: true, static: true }, { propertyName: "templateDirectives", predicate: DynamicTableTemplateDirective }], viewQueries: [{ propertyName: "columnsTemplate", first: true, predicate: ["columnsTemplate"], descendants: true, static: true }, { propertyName: "defaultRowTemplate", first: true, predicate: ["defaultRowTemplate"], descendants: true, static: true }, { propertyName: "defaultWrapperTemplate", first: true, predicate: ["defaultWrapperTemplate"], descendants: true, static: true }, { propertyName: "pagination", first: true, predicate: ["pagination"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-template #columnTemplate let-context let-column=\"column\" let-template=\"template\">\n <ng-template #defaultTemplate let-column=\"column\" let-item=\"item\">\n <span>{{ item[column] == undefined || item[column] == null ? '-' : item[column] }}</span>\n </ng-template>\n <ng-template #pureTemplate>\n <ng-container [ngxTemplateOutlet]=\"template.ref\" [context]=\"context\"></ng-container>\n </ng-template>\n <td [ngClass]=\"'column-' + column\"\n [attr.data-testid]=\"testId + '-' + column + '-' + context.rowIndex\"\n *ngIf=\"!template || !template.pure; else pureTemplate\">\n <ng-container [ngxTemplateOutlet]=\"!template ? defaultTemplate : template.ref\"\n [context]=\"context\"></ng-container>\n </td>\n</ng-template>\n\n<ng-template #columnsTemplate let-context>\n <ng-container *ngFor=\"let column of cols\"\n [ngxTemplateOutlet]=\"columnTemplate\"\n [context]=\"context\"\n [additionalContext]=\"{\n template: templates[column],\n column: column\n }\"></ng-container>\n</ng-template>\n\n<ng-template #defaultRowTemplate let-context>\n <tr #elem\n [draggable]=\"!!dragStartFn\"\n [ngClass]=\"{active: selected === context.item}\"\n (dragstart)=\"onDragStart($event, elem, context.item)\"\n (dragenter)=\"onDragEnter($event, elem, context.item)\"\n (dragleave)=\"onDragLeave($event, elem)\"\n (drop)=\"onDrop($event, elem, context.item)\">\n <ng-container [ngxTemplateOutlet]=\"columnsTemplate\" [context]=\"context\"></ng-container>\n </tr>\n</ng-template>\n\n<ng-template #headerTemplate let-column=\"column\" let-toggle=\"toggle\">\n <ng-template #defaultCol>\n <span>{{ realColumns[column].title | translate }}</span>\n </ng-template>\n <ng-template #emptyCol>\n <span>-</span>\n </ng-template>\n <ng-container *ngIf=\"realColumns[column]; else emptyCol\">\n <a *ngIf=\"realColumns[column].sort; else defaultCol\"\n [ngClass]=\"['sort', orderBy !== column ? '' : (orderDescending ? 'sort-desc' : 'sort-asc')]\"\n (click)=\"setSorting(column, toggle)\">\n <span>{{ realColumns[column].title | translate }}</span>\n </a>\n </ng-container>\n</ng-template>\n\n<div class=\"dynamic-table\">\n <div class=\"table-features-row\">\n <ng-content select=\"[table-features-before]\"></ng-content>\n <div class=\"table-input-wrap table-search-filter\" *ngIf=\"showFilter\">\n <label *ngIf=\"filterLabel\" [attr.for]=\"tableId\">\n {{ filterLabel | translate }}\n </label>\n <input type=\"text\"\n class=\"search-input\"\n [attr.id]=\"tableId\"\n [attr.data-testid]=\"testId + '-filter-input'\"\n [placeholder]=\"placeholder | translate\"\n [ngModel]=\"filter\"\n (ngModelChange)=\"setFilter($event)\"/>\n </div>\n <dropdown-box componentClass=\"sort-dropdown\" #sortDd>\n <ng-container toggle-content\n [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{column: orderBy, toggle: sortDd}\"></ng-container>\n <ul>\n <ng-container *ngFor=\"let column of cols\">\n <li [ngClass]=\"'sort-column sort-' + column\" *ngIf=\"realColumns[column].sort\">\n <ng-container [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\n </li>\n </ng-container>\n </ul>\n </dropdown-box>\n <div class=\"table-input-wrap table-items-count\" *ngIf=\"showItems\">\n <label>\n {{ 'label.items.before' | translate }}\n </label>\n <dropdown-box>\n <ng-container toggle-content>\n {{ itemsPerPage }}\n </ng-container>\n <ul>\n <ng-container *ngFor=\"let count of showItems\">\n <li [ngClass]=\"'item-count count-' + count\" (click)=\"setItemsPerPage(count)\">\n {{ count }}\n </li>\n </ng-container>\n </ul>\n </dropdown-box>\n <label>\n {{ 'label.items.after' | translate }}\n </label>\n </div>\n <ng-content select=\"[table-features-after]\"></ng-content>\n </div>\n <div class=\"table-content-row\"\n #pagination=\"pagination\"\n [pagination]=\"loadData\"\n [page]=\"page\"\n [itemsPerPage]=\"itemsPerPage\"\n [updateTime]=\"updateTime\">\n <pagination-menu [urlParam]=\"urlParam\" [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\"\n [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\n <div class=\"table-responsive\">\n <ng-template #defaultWrapperTemplate>\n <table class=\"table table-striped\">\n <thead>\n <tr>\n <th *ngFor=\"let column of cols\" [ngClass]=\"'header-column column-' + column\">\n <ng-container [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\n </th>\n </tr>\n <tr *ngIf=\"hasQuery\">\n <th *ngFor=\"let column of cols\" [ngClass]=\"['column-' + column, 'filter-column']\">\n <ng-container *ngIf=\"realColumns[column].filter\" [ngSwitch]=\"realColumns[column].filterType\">\n <ng-container *ngSwitchCase=\"'enum'\">\n <ng-template #optionItem let-option=\"option\">\n {{ (realColumns[column].enumPrefix ? realColumns[column].enumPrefix + '.' + option : option) | translate }}\n </ng-template>\n <dropdown-box componentClass=\"filter-box\"\n [ngClass]=\"'filter-box-' + column\" [closeInside]=\"false\">\n <ng-container toggle-content>\n <span class=\"toggle-placeholder\" *ngIf=\"!query[column]\">\n {{ realColumns[column].title | translate }}\n </span>\n <span [ngClass]=\"['option-' + option, column + '-option-' + option, option]\"\n *ngFor=\"let option of query[column] | values; let ix = index\">\n <ng-container *ngIf=\"ix > 0\">, </ng-container>\n <ng-container [ngTemplateOutlet]=\"optionItem\"\n [ngTemplateOutletContext]=\"{option: option}\"></ng-container>\n </span>\n </ng-container>\n <ul>\n <li [ngClass]=\"[column + '-option', 'option-' + option, option]\"\n (click)=\"setQueryValue(column, option)\"\n *ngFor=\"let option of realColumns[column].enum\">\n <a [ngClass]=\"'toggle-link-' + column\">\n <input type=\"checkbox\" [checked]=\"query[column] | includes: option\">\n <ng-container [ngTemplateOutlet]=\"optionItem\"\n [ngTemplateOutletContext]=\"{option: option}\"></ng-container>\n </a>\n </li>\n </ul>\n </dropdown-box>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <input type=\"checkbox\"\n [attr.data-testid]=\"testId + '-filter-' + column\"\n [placeholder]=\"realColumns[column].title | translate\"\n [ngModel]=\"query[column]\"\n (ngModelChange)=\"setQueryValue(column, $event)\"/>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <input class=\"search-input\"\n type=\"text\"\n [attr.data-testid]=\"testId + '-filter-' + column\"\n [placeholder]=\"realColumns[column].title | translate\"\n [ngModel]=\"query[column]\"\n (ngModelChange)=\"setQueryValue(column, $event)\"/>\n </ng-container>\n </ng-container>\n </th>\n </tr>\n </thead>\n <tbody>\n <ng-container *paginationItem=\"let context\"\n [ngxTemplateOutlet]=\"rowTemplate\"\n [context]=\"context\"\n [additionalContext]=\"this\"></ng-container>\n </tbody>\n </table>\n </ng-template>\n\n <div class=\"table-wrapper\">\n <ng-content select=\"[table-top]\"></ng-content>\n <ng-container [ngxTemplateOutlet]=\"wrapperTemplate || defaultWrapperTemplate\"\n [context]=\"this\"></ng-container>\n <ng-content select=\"[table-bottom]\"></ng-content>\n </div>\n </div>\n <pagination-menu [urlParam]=\"urlParam\" [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\"\n [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\n </div>\n</div>\n", styles: [".dynamic-table{--table-bg: transparent;--table-stripe-bg: rgba(210, 210, 210, .35);--border-size: 1px;--border-color: #ced4da;--bg-color: #ffffff;--text-color: #151515;--highlight-color: var(--primary-color, #888888);--highlight-text-color: #ffffff;--display-toggle: none;--arrow-size: 6px;--arrow-rotation: 90;--arrow-space: calc(var(--arrow-size) * .5 + 1px);--arrow-color: #c6c6c6}.dynamic-table *{box-sizing:border-box}.dynamic-table .search-input{background:var(--bg-color);color:var(--text-color);border:var(--border-size) solid var(--border-color);border-radius:5px;padding:6px 12px;-webkit-user-select:none;user-select:none;font-weight:400;font-size:var(--table-input-font-size, 15px);line-height:var(--table-input-line-height, 18px);outline:none}.dynamic-table .search-input .toggle-placeholder,.dynamic-table .search-input ::placeholder{color:#495057}.dynamic-table .table-responsive{border:1px solid var(--border-color);overflow:hidden;overflow-x:auto;margin-bottom:1rem}.dynamic-table .table-features-row:not(:empty){display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:space-between;margin-bottom:20px}.dynamic-table .table-content-row{position:relative}.dynamic-table .sort-dropdown{display:none}.dynamic-table .table-input-wrap{display:flex;align-items:center;justify-content:flex-end;gap:5px}.dynamic-table .table-input-wrap>label{margin:0;font-weight:700}.dynamic-table .table-input-wrap>input{max-width:400px}.dynamic-table .table-items-count{flex:1}.dynamic-table .table-wrapper{position:relative}.dynamic-table table.table{border-collapse:collapse;margin:0;width:100%;font-family:inherit;font-size:inherit}.dynamic-table table.table th{text-align:left}.dynamic-table table.table th,.dynamic-table table.table td{text-align:left;padding:6px 12px;border:1px solid var(--border-color);vertical-align:middle;white-space:nowrap;width:var(--cell-width, 25%);min-width:fit-content}.dynamic-table table.table-sm th,.dynamic-table table.table-sm td{font-size:var(--font-size-sm);padding:4px 6px}.dynamic-table table.table thead th{font-weight:500}.dynamic-table table.table thead th .dropdown-box{display:block;width:100%;text-align:left}.dynamic-table table.table thead th .search-input{width:100%}.dynamic-table table.table thead th span{display:inline-block;vertical-align:top}.dynamic-table table.table thead th a{cursor:pointer;text-align:left}.dynamic-table table.table thead th.filter-column{text-align:center}.dynamic-table table.table thead tr:first-child th{border-top-width:0}.dynamic-table table.table tbody tr:last-child td{border-bottom-width:0}.dynamic-table table.table thead tr th,.dynamic-table table.table tbody tr td{background-color:var(--table-bg)}.dynamic-table table.table thead tr th:first-child,.dynamic-table table.table tbody tr td:first-child{border-left-width:0}.dynamic-table table.table thead tr th:last-child,.dynamic-table table.table tbody tr td:last-child{border-right-width:0}.dynamic-table table.table tbody tr.active td{background-color:var(--highlight-color);color:var(--highlight-text-color)}.dynamic-table .table-striped>tbody>tr:nth-of-type(odd) td{background-color:var(--table-stripe-bg)}.dynamic-table .table-striped>tbody>tr:nth-of-type(odd).active td{background-color:var(--highlight-color);color:var(--highlight-text-color)}.sort-dropdown .dropdown-box-toggle a.dropdown-box-toggle-link{margin-right:0;padding-right:0}.sort-dropdown .dropdown-box-toggle a.dropdown-box-toggle-link:after{display:none}.sort-dropdown-content-wrapper a.sort,.dynamic-table a.sort{position:relative;display:block;margin-right:calc(var(--arrow-size) * 2);-webkit-user-select:none;user-select:none;padding-right:5px}.sort-dropdown-content-wrapper a.sort:before,.sort-dropdown-content-wrapper a.sort:after,.dynamic-table a.sort:before,.dynamic-table a.sort:after{content:\"\";position:absolute;transition:.2s ease;left:calc(100% + var(--arrow-size));top:calc(50% - var(--arrow-size));border-top:var(--arrow-size) solid transparent;border-bottom:var(--arrow-size) solid transparent;border-left:var(--arrow-size) solid var(--arrow-color);transform:rotate(calc(var(--arrow-rotation) * 1deg)) translate(var(--arrow-space))}.sort-dropdown-content-wrapper a.sort:before,.dynamic-table a.sort:before{--arrow-rotation: -90}.sort-dropdown-content-wrapper a.sort.sort-desc:before,.dynamic-table a.sort.sort-desc:before{--arrow-color: black}.sort-dropdown-content-wrapper a.sort.sort-asc:after,.dynamic-table a.sort.sort-asc:after{--arrow-color: black}\n"], dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1$3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgxTemplateOutletDirective, selector: "[ngxTemplateOutlet]", inputs: ["context", "additionalContext", "ngxTemplateOutlet"] }, { kind: "directive", type: PaginationDirective, selector: "[pagination]", inputs: ["pagination", "page", "itemsPerPage", "updateTime", "waitFor"], outputs: ["pageChange", "onRefresh"], exportAs: ["pagination"] }, { kind: "directive", type: PaginationItemDirective, selector: "[paginationItem]" }, { kind: "component", type: DropdownBoxComponent, selector: "dropdown-box", inputs: ["closeInside", "attachTo", "placement", "crossAxis", "alignment", "autoAlignment", "allowedPlacements", "componentClass"] }, { kind: "component", type: PaginationMenuComponent, selector: "pagination-menu", inputs: ["maxSize", "urlParam", "directionLinks", "boundaryLinks"] }, { kind: "pipe", type: IncludesPipe, name: "includes" }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: ValuesPipe, name: "values" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
7491
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DynamicTableComponent, isStandalone: false, selector: "dynamic-table", inputs: { dataLoader: "dataLoader", data: "data", selected: "selected", page: "page", urlParam: "urlParam", parallelData: "parallelData", columns: "columns", showFilter: "showFilter", filterLabel: "filterLabel", placeholder: "placeholder", showItems: "showItems", itemsPerPage: "itemsPerPage", updateTime: "updateTime", filterTime: "filterTime", maxPages: "maxPages", directionLinks: "directionLinks", boundaryLinks: "boundaryLinks", orderBy: "orderBy", orderDescending: "orderDescending", testId: "testId", titlePrefix: "titlePrefix", dragStartFn: "dragStartFn", dragEnterFn: "dragEnterFn", dropFn: "dropFn" }, queries: [{ propertyName: "rowTemplate", first: true, predicate: ["rowTemplate"], descendants: true, static: true }, { propertyName: "wrapperTemplate", first: true, predicate: ["wrapperTemplate"], descendants: true, static: true }, { propertyName: "templateDirectives", predicate: DynamicTableTemplateDirective }], viewQueries: [{ propertyName: "columnsTemplate", first: true, predicate: ["columnsTemplate"], descendants: true, static: true }, { propertyName: "defaultRowTemplate", first: true, predicate: ["defaultRowTemplate"], descendants: true, static: true }, { propertyName: "defaultWrapperTemplate", first: true, predicate: ["defaultWrapperTemplate"], descendants: true, static: true }, { propertyName: "pagination", first: true, predicate: ["pagination"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-template #columnTemplate let-context let-column=\"column\" let-template=\"template\">\n <ng-template #defaultTemplate let-column=\"column\" let-item=\"item\">\n <span>{{ item[column] == undefined || item[column] == null ? '-' : item[column] }}</span>\n </ng-template>\n <ng-template #pureTemplate>\n <ng-container [ngxTemplateOutlet]=\"template.ref\" [context]=\"context\"></ng-container>\n </ng-template>\n <td [ngClass]=\"'column-' + column\"\n [attr.data-testid]=\"testId + '-' + column + '-' + context.rowIndex\"\n *ngIf=\"!template || !template.pure; else pureTemplate\">\n <ng-container [ngxTemplateOutlet]=\"!template ? defaultTemplate : template.ref\"\n [context]=\"context\"></ng-container>\n </td>\n</ng-template>\n\n<ng-template #columnsTemplate let-context>\n <ng-container *ngFor=\"let column of cols\"\n [ngxTemplateOutlet]=\"columnTemplate\"\n [context]=\"context\"\n [additionalContext]=\"{\n template: templates[column],\n column: column\n }\"></ng-container>\n</ng-template>\n\n<ng-template #defaultRowTemplate let-context>\n <tr #elem\n [draggable]=\"!!dragStartFn\"\n [ngClass]=\"{active: selected === context.item}\"\n (dragstart)=\"onDragStart($event, elem, context.item)\"\n (dragenter)=\"onDragEnter($event, elem, context.item)\"\n (dragleave)=\"onDragLeave($event, elem)\"\n (drop)=\"onDrop($event, elem, context.item)\">\n <ng-container [ngxTemplateOutlet]=\"columnsTemplate\" [context]=\"context\"></ng-container>\n </tr>\n</ng-template>\n\n<ng-template #headerTemplate let-column=\"column\" let-toggle=\"toggle\">\n <ng-template #defaultCol>\n <span>{{ realColumns[column].title | translate }}</span>\n </ng-template>\n <ng-template #emptyCol>\n <span>-</span>\n </ng-template>\n <ng-container *ngIf=\"realColumns[column]; else emptyCol\">\n <a *ngIf=\"realColumns[column].sort; else defaultCol\"\n [ngClass]=\"['sort', orderBy !== column ? '' : (orderDescending ? 'sort-desc' : 'sort-asc')]\"\n (click)=\"setSorting(column, toggle)\">\n <span>{{ realColumns[column].title | translate }}</span>\n </a>\n </ng-container>\n</ng-template>\n\n<div class=\"dynamic-table\">\n <div class=\"table-features-row\">\n <ng-content select=\"[table-features-before]\"></ng-content>\n @if (showFilter) {\n <div class=\"table-input-wrap table-search-filter\">\n <label *ngIf=\"filterLabel\" [attr.for]=\"tableId\">\n {{ filterLabel | translate }}\n </label>\n <input type=\"text\"\n class=\"search-input\"\n [attr.id]=\"tableId\"\n [attr.data-testid]=\"testId + '-filter-input'\"\n [placeholder]=\"placeholder | translate\"\n [ngModel]=\"filter\"\n (ngModelChange)=\"setFilter($event)\"/>\n </div>\n }\n @if (sortable) {\n <dropdown-box componentClass=\"sort-dropdown\" #sortDd>\n <ng-container toggle-content\n [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{column: orderBy, toggle: sortDd}\"></ng-container>\n <ul>\n <ng-container *ngFor=\"let column of cols\">\n <li [ngClass]=\"'sort-column sort-' + column\" *ngIf=\"realColumns[column].sort\">\n <ng-container [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\n </li>\n </ng-container>\n </ul>\n </dropdown-box>\n }\n @if (showItems) {\n <div class=\"table-input-wrap table-items-count\">\n <label>\n {{ 'label.items.before' | translate }}\n </label>\n <dropdown-box>\n <ng-container toggle-content>\n {{ itemsPerPage }}\n </ng-container>\n <ul>\n <ng-container *ngFor=\"let count of showItems\">\n <li [ngClass]=\"'item-count count-' + count\" (click)=\"setItemsPerPage(count)\">\n {{ count }}\n </li>\n </ng-container>\n </ul>\n </dropdown-box>\n <label>\n {{ 'label.items.after' | translate }}\n </label>\n </div>\n }\n <ng-content select=\"[table-features-after]\"></ng-content>\n </div>\n <div class=\"table-content-row\"\n #pagination=\"pagination\"\n [pagination]=\"loadData\"\n [page]=\"page\"\n [itemsPerPage]=\"itemsPerPage\"\n [updateTime]=\"updateTime\">\n <pagination-menu [urlParam]=\"urlParam\" [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\"\n [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\n <div class=\"table-responsive\">\n <ng-template #defaultWrapperTemplate>\n <table class=\"table table-striped\">\n <thead>\n <tr>\n <th *ngFor=\"let column of cols\" [ngClass]=\"'header-column column-' + column\">\n <ng-container [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\n </th>\n </tr>\n <tr *ngIf=\"hasQuery\">\n <th *ngFor=\"let column of cols\" [ngClass]=\"['column-' + column, 'filter-column']\">\n <ng-container *ngIf=\"realColumns[column].filter\" [ngSwitch]=\"realColumns[column].filterType\">\n <ng-container *ngSwitchCase=\"'enum'\">\n <ng-template #optionItem let-option=\"option\">\n {{ (realColumns[column].enumPrefix ? realColumns[column].enumPrefix + '.' + option : option) | translate }}\n </ng-template>\n <dropdown-box componentClass=\"filter-box\"\n [ngClass]=\"'filter-box-' + column\" [closeInside]=\"false\">\n <ng-container toggle-content>\n <span class=\"toggle-placeholder\" *ngIf=\"!query[column]\">\n {{ realColumns[column].title | translate }}\n </span>\n <span [ngClass]=\"['option-' + option, column + '-option-' + option, option]\"\n *ngFor=\"let option of query[column] | values; let ix = index\">\n <ng-container *ngIf=\"ix > 0\">, </ng-container>\n <ng-container [ngTemplateOutlet]=\"optionItem\"\n [ngTemplateOutletContext]=\"{option: option}\"></ng-container>\n </span>\n </ng-container>\n <ul>\n <li [ngClass]=\"[column + '-option', 'option-' + option, option]\"\n (click)=\"setQueryValue(column, option)\"\n *ngFor=\"let option of realColumns[column].enum\">\n <a [ngClass]=\"'toggle-link-' + column\">\n <input type=\"checkbox\" [checked]=\"query[column] | includes: option\">\n <ng-container [ngTemplateOutlet]=\"optionItem\"\n [ngTemplateOutletContext]=\"{option: option}\"></ng-container>\n </a>\n </li>\n </ul>\n </dropdown-box>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <input type=\"checkbox\"\n [attr.data-testid]=\"testId + '-filter-' + column\"\n [placeholder]=\"realColumns[column].title | translate\"\n [ngModel]=\"query[column]\"\n (ngModelChange)=\"setQueryValue(column, $event)\"/>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <input class=\"search-input\"\n type=\"text\"\n [attr.data-testid]=\"testId + '-filter-' + column\"\n [placeholder]=\"realColumns[column].title | translate\"\n [ngModel]=\"query[column]\"\n (ngModelChange)=\"setQueryValue(column, $event)\"/>\n </ng-container>\n </ng-container>\n </th>\n </tr>\n </thead>\n <tbody>\n <ng-container *paginationItem=\"let context\"\n [ngxTemplateOutlet]=\"rowTemplate\"\n [context]=\"context\"\n [additionalContext]=\"this\"></ng-container>\n </tbody>\n </table>\n </ng-template>\n\n <div class=\"table-wrapper\">\n <ng-content select=\"[table-top]\"></ng-content>\n <ng-container [ngxTemplateOutlet]=\"wrapperTemplate || defaultWrapperTemplate\"\n [context]=\"this\"></ng-container>\n <ng-content select=\"[table-bottom]\"></ng-content>\n </div>\n </div>\n <pagination-menu [urlParam]=\"urlParam\" [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\"\n [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\n </div>\n</div>\n", styles: [".dynamic-table{--table-bg: transparent;--table-stripe-bg: rgba(210, 210, 210, .35);--border-size: 1px;--border-color: #ced4da;--bg-color: #ffffff;--text-color: #151515;--highlight-color: var(--primary-color, #888888);--highlight-text-color: #ffffff;--display-toggle: none;--arrow-size: 6px;--arrow-rotation: 90;--arrow-space: calc(var(--arrow-size) * .5 + 1px);--arrow-color: #c6c6c6}.dynamic-table *{box-sizing:border-box}.dynamic-table .search-input{background:var(--bg-color);color:var(--text-color);border:var(--border-size) solid var(--border-color);border-radius:5px;padding:6px 12px;-webkit-user-select:none;user-select:none;font-weight:400;font-size:var(--table-input-font-size, 15px);line-height:var(--table-input-line-height, 18px);outline:none}.dynamic-table .search-input .toggle-placeholder,.dynamic-table .search-input ::placeholder{color:#495057}.dynamic-table .table-responsive{border:1px solid var(--border-color);overflow:hidden;overflow-x:auto;margin-bottom:1rem}.dynamic-table .table-features-row:not(:empty){display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:space-between;margin-bottom:20px}.dynamic-table .table-content-row{position:relative}.dynamic-table .sort-dropdown{display:none}.dynamic-table .table-input-wrap{display:flex;align-items:center;justify-content:flex-end;gap:5px}.dynamic-table .table-input-wrap>label{margin:0;font-weight:700}.dynamic-table .table-input-wrap>input{max-width:400px}.dynamic-table .table-items-count{flex:1}.dynamic-table .table-wrapper{position:relative}.dynamic-table table.table{border-collapse:collapse;margin:0;width:100%;font-family:inherit;font-size:inherit}.dynamic-table table.table th{text-align:left}.dynamic-table table.table th,.dynamic-table table.table td{text-align:left;padding:6px 12px;border:1px solid var(--border-color);vertical-align:middle;white-space:nowrap;width:var(--cell-width, 25%);min-width:fit-content}.dynamic-table table.table-sm th,.dynamic-table table.table-sm td{font-size:var(--font-size-sm);padding:4px 6px}.dynamic-table table.table thead th{font-weight:500}.dynamic-table table.table thead th .dropdown-box{display:block;width:100%;text-align:left}.dynamic-table table.table thead th .search-input{width:100%}.dynamic-table table.table thead th span{display:inline-block;vertical-align:top}.dynamic-table table.table thead th a{cursor:pointer;text-align:left}.dynamic-table table.table thead th.filter-column{text-align:center}.dynamic-table table.table thead tr:first-child th{border-top-width:0}.dynamic-table table.table tbody tr:last-child td{border-bottom-width:0}.dynamic-table table.table thead tr th,.dynamic-table table.table tbody tr td{background-color:var(--table-bg)}.dynamic-table table.table thead tr th:first-child,.dynamic-table table.table tbody tr td:first-child{border-left-width:0}.dynamic-table table.table thead tr th:last-child,.dynamic-table table.table tbody tr td:last-child{border-right-width:0}.dynamic-table table.table tbody tr.active td{background-color:var(--highlight-color);color:var(--highlight-text-color)}.dynamic-table .table-striped>tbody>tr:nth-of-type(odd) td{background-color:var(--table-stripe-bg)}.dynamic-table .table-striped>tbody>tr:nth-of-type(odd).active td{background-color:var(--highlight-color);color:var(--highlight-text-color)}.sort-dropdown .dropdown-box-toggle a.dropdown-box-toggle-link{margin-right:0;padding-right:0}.sort-dropdown .dropdown-box-toggle a.dropdown-box-toggle-link:after{display:none}.sort-dropdown-content-wrapper a.sort,.dynamic-table a.sort{position:relative;display:block;margin-right:calc(var(--arrow-size) * 2);-webkit-user-select:none;user-select:none;padding-right:5px}.sort-dropdown-content-wrapper a.sort:before,.sort-dropdown-content-wrapper a.sort:after,.dynamic-table a.sort:before,.dynamic-table a.sort:after{content:\"\";position:absolute;transition:.2s ease;left:calc(100% + var(--arrow-size));top:calc(50% - var(--arrow-size));border-top:var(--arrow-size) solid transparent;border-bottom:var(--arrow-size) solid transparent;border-left:var(--arrow-size) solid var(--arrow-color);transform:rotate(calc(var(--arrow-rotation) * 1deg)) translate(var(--arrow-space))}.sort-dropdown-content-wrapper a.sort:before,.dynamic-table a.sort:before{--arrow-rotation: -90}.sort-dropdown-content-wrapper a.sort.sort-desc:before,.dynamic-table a.sort.sort-desc:before{--arrow-color: black}.sort-dropdown-content-wrapper a.sort.sort-asc:after,.dynamic-table a.sort.sort-asc:after{--arrow-color: black}\n"], dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1$3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgxTemplateOutletDirective, selector: "[ngxTemplateOutlet]", inputs: ["context", "additionalContext", "ngxTemplateOutlet"] }, { kind: "directive", type: PaginationDirective, selector: "[pagination]", inputs: ["pagination", "page", "itemsPerPage", "updateTime", "waitFor"], outputs: ["pageChange", "onRefresh"], exportAs: ["pagination"] }, { kind: "directive", type: PaginationItemDirective, selector: "[paginationItem]" }, { kind: "component", type: DropdownBoxComponent, selector: "dropdown-box", inputs: ["closeInside", "attachTo", "placement", "crossAxis", "alignment", "autoAlignment", "allowedPlacements", "componentClass"] }, { kind: "component", type: PaginationMenuComponent, selector: "pagination-menu", inputs: ["maxSize", "urlParam", "directionLinks", "boundaryLinks"] }, { kind: "pipe", type: IncludesPipe, name: "includes" }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: ValuesPipe, name: "values" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
7515
7492
|
}
|
|
7516
7493
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicTableComponent, decorators: [{
|
|
7517
7494
|
type: Component,
|
|
7518
|
-
args: [{ standalone: false, encapsulation: ViewEncapsulation.None, selector: "dynamic-table", template: "<ng-template #columnTemplate let-context let-column=\"column\" let-template=\"template\">\n <ng-template #defaultTemplate let-column=\"column\" let-item=\"item\">\n <span>{{ item[column] == undefined || item[column] == null ? '-' : item[column] }}</span>\n </ng-template>\n <ng-template #pureTemplate>\n <ng-container [ngxTemplateOutlet]=\"template.ref\" [context]=\"context\"></ng-container>\n </ng-template>\n <td [ngClass]=\"'column-' + column\"\n [attr.data-testid]=\"testId + '-' + column + '-' + context.rowIndex\"\n *ngIf=\"!template || !template.pure; else pureTemplate\">\n <ng-container [ngxTemplateOutlet]=\"!template ? defaultTemplate : template.ref\"\n [context]=\"context\"></ng-container>\n </td>\n</ng-template>\n\n<ng-template #columnsTemplate let-context>\n <ng-container *ngFor=\"let column of cols\"\n [ngxTemplateOutlet]=\"columnTemplate\"\n [context]=\"context\"\n [additionalContext]=\"{\n template: templates[column],\n column: column\n }\"></ng-container>\n</ng-template>\n\n<ng-template #defaultRowTemplate let-context>\n <tr #elem\n [draggable]=\"!!dragStartFn\"\n [ngClass]=\"{active: selected === context.item}\"\n (dragstart)=\"onDragStart($event, elem, context.item)\"\n (dragenter)=\"onDragEnter($event, elem, context.item)\"\n (dragleave)=\"onDragLeave($event, elem)\"\n (drop)=\"onDrop($event, elem, context.item)\">\n <ng-container [ngxTemplateOutlet]=\"columnsTemplate\" [context]=\"context\"></ng-container>\n </tr>\n</ng-template>\n\n<ng-template #headerTemplate let-column=\"column\" let-toggle=\"toggle\">\n <ng-template #defaultCol>\n <span>{{ realColumns[column].title | translate }}</span>\n </ng-template>\n <ng-template #emptyCol>\n <span>-</span>\n </ng-template>\n <ng-container *ngIf=\"realColumns[column]; else emptyCol\">\n <a *ngIf=\"realColumns[column].sort; else defaultCol\"\n [ngClass]=\"['sort', orderBy !== column ? '' : (orderDescending ? 'sort-desc' : 'sort-asc')]\"\n (click)=\"setSorting(column, toggle)\">\n <span>{{ realColumns[column].title | translate }}</span>\n </a>\n </ng-container>\n</ng-template>\n\n<div class=\"dynamic-table\">\n <div class=\"table-features-row\">\n <ng-content select=\"[table-features-before]\"></ng-content>\n <div class=\"table-input-wrap table-search-filter\" *ngIf=\"showFilter\">\n <label *ngIf=\"filterLabel\" [attr.for]=\"tableId\">\n {{ filterLabel | translate }}\n </label>\n <input type=\"text\"\n class=\"search-input\"\n [attr.id]=\"tableId\"\n [attr.data-testid]=\"testId + '-filter-input'\"\n [placeholder]=\"placeholder | translate\"\n [ngModel]=\"filter\"\n (ngModelChange)=\"setFilter($event)\"/>\n </div>\n <dropdown-box componentClass=\"sort-dropdown\" #sortDd>\n <ng-container toggle-content\n [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{column: orderBy, toggle: sortDd}\"></ng-container>\n <ul>\n <ng-container *ngFor=\"let column of cols\">\n <li [ngClass]=\"'sort-column sort-' + column\" *ngIf=\"realColumns[column].sort\">\n <ng-container [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\n </li>\n </ng-container>\n </ul>\n </dropdown-box>\n <div class=\"table-input-wrap table-items-count\" *ngIf=\"showItems\">\n <label>\n {{ 'label.items.before' | translate }}\n </label>\n <dropdown-box>\n <ng-container toggle-content>\n {{ itemsPerPage }}\n </ng-container>\n <ul>\n <ng-container *ngFor=\"let count of showItems\">\n <li [ngClass]=\"'item-count count-' + count\" (click)=\"setItemsPerPage(count)\">\n {{ count }}\n </li>\n </ng-container>\n </ul>\n </dropdown-box>\n <label>\n {{ 'label.items.after' | translate }}\n </label>\n </div>\n <ng-content select=\"[table-features-after]\"></ng-content>\n </div>\n <div class=\"table-content-row\"\n #pagination=\"pagination\"\n [pagination]=\"loadData\"\n [page]=\"page\"\n [itemsPerPage]=\"itemsPerPage\"\n [updateTime]=\"updateTime\">\n <pagination-menu [urlParam]=\"urlParam\" [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\"\n [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\n <div class=\"table-responsive\">\n <ng-template #defaultWrapperTemplate>\n <table class=\"table table-striped\">\n <thead>\n <tr>\n <th *ngFor=\"let column of cols\" [ngClass]=\"'header-column column-' + column\">\n <ng-container [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\n </th>\n </tr>\n <tr *ngIf=\"hasQuery\">\n <th *ngFor=\"let column of cols\" [ngClass]=\"['column-' + column, 'filter-column']\">\n <ng-container *ngIf=\"realColumns[column].filter\" [ngSwitch]=\"realColumns[column].filterType\">\n <ng-container *ngSwitchCase=\"'enum'\">\n <ng-template #optionItem let-option=\"option\">\n {{ (realColumns[column].enumPrefix ? realColumns[column].enumPrefix + '.' + option : option) | translate }}\n </ng-template>\n <dropdown-box componentClass=\"filter-box\"\n [ngClass]=\"'filter-box-' + column\" [closeInside]=\"false\">\n <ng-container toggle-content>\n <span class=\"toggle-placeholder\" *ngIf=\"!query[column]\">\n {{ realColumns[column].title | translate }}\n </span>\n <span [ngClass]=\"['option-' + option, column + '-option-' + option, option]\"\n *ngFor=\"let option of query[column] | values; let ix = index\">\n <ng-container *ngIf=\"ix > 0\">, </ng-container>\n <ng-container [ngTemplateOutlet]=\"optionItem\"\n [ngTemplateOutletContext]=\"{option: option}\"></ng-container>\n </span>\n </ng-container>\n <ul>\n <li [ngClass]=\"[column + '-option', 'option-' + option, option]\"\n (click)=\"setQueryValue(column, option)\"\n *ngFor=\"let option of realColumns[column].enum\">\n <a [ngClass]=\"'toggle-link-' + column\">\n <input type=\"checkbox\" [checked]=\"query[column] | includes: option\">\n <ng-container [ngTemplateOutlet]=\"optionItem\"\n [ngTemplateOutletContext]=\"{option: option}\"></ng-container>\n </a>\n </li>\n </ul>\n </dropdown-box>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <input type=\"checkbox\"\n [attr.data-testid]=\"testId + '-filter-' + column\"\n [placeholder]=\"realColumns[column].title | translate\"\n [ngModel]=\"query[column]\"\n (ngModelChange)=\"setQueryValue(column, $event)\"/>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <input class=\"search-input\"\n type=\"text\"\n [attr.data-testid]=\"testId + '-filter-' + column\"\n [placeholder]=\"realColumns[column].title | translate\"\n [ngModel]=\"query[column]\"\n (ngModelChange)=\"setQueryValue(column, $event)\"/>\n </ng-container>\n </ng-container>\n </th>\n </tr>\n </thead>\n <tbody>\n <ng-container *paginationItem=\"let context\"\n [ngxTemplateOutlet]=\"rowTemplate\"\n [context]=\"context\"\n [additionalContext]=\"this\"></ng-container>\n </tbody>\n </table>\n </ng-template>\n\n <div class=\"table-wrapper\">\n <ng-content select=\"[table-top]\"></ng-content>\n <ng-container [ngxTemplateOutlet]=\"wrapperTemplate || defaultWrapperTemplate\"\n [context]=\"this\"></ng-container>\n <ng-content select=\"[table-bottom]\"></ng-content>\n </div>\n </div>\n <pagination-menu [urlParam]=\"urlParam\" [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\"\n [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\n </div>\n</div>\n", styles: [".dynamic-table{--table-bg: transparent;--table-stripe-bg: rgba(210, 210, 210, .35);--border-size: 1px;--border-color: #ced4da;--bg-color: #ffffff;--text-color: #151515;--highlight-color: var(--primary-color, #888888);--highlight-text-color: #ffffff;--display-toggle: none;--arrow-size: 6px;--arrow-rotation: 90;--arrow-space: calc(var(--arrow-size) * .5 + 1px);--arrow-color: #c6c6c6}.dynamic-table *{box-sizing:border-box}.dynamic-table .search-input{background:var(--bg-color);color:var(--text-color);border:var(--border-size) solid var(--border-color);border-radius:5px;padding:6px 12px;-webkit-user-select:none;user-select:none;font-weight:400;font-size:var(--table-input-font-size, 15px);line-height:var(--table-input-line-height, 18px);outline:none}.dynamic-table .search-input .toggle-placeholder,.dynamic-table .search-input ::placeholder{color:#495057}.dynamic-table .table-responsive{border:1px solid var(--border-color);overflow:hidden;overflow-x:auto;margin-bottom:1rem}.dynamic-table .table-features-row:not(:empty){display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:space-between;margin-bottom:20px}.dynamic-table .table-content-row{position:relative}.dynamic-table .sort-dropdown{display:none}.dynamic-table .table-input-wrap{display:flex;align-items:center;justify-content:flex-end;gap:5px}.dynamic-table .table-input-wrap>label{margin:0;font-weight:700}.dynamic-table .table-input-wrap>input{max-width:400px}.dynamic-table .table-items-count{flex:1}.dynamic-table .table-wrapper{position:relative}.dynamic-table table.table{border-collapse:collapse;margin:0;width:100%;font-family:inherit;font-size:inherit}.dynamic-table table.table th{text-align:left}.dynamic-table table.table th,.dynamic-table table.table td{text-align:left;padding:6px 12px;border:1px solid var(--border-color);vertical-align:middle;white-space:nowrap;width:var(--cell-width, 25%);min-width:fit-content}.dynamic-table table.table-sm th,.dynamic-table table.table-sm td{font-size:var(--font-size-sm);padding:4px 6px}.dynamic-table table.table thead th{font-weight:500}.dynamic-table table.table thead th .dropdown-box{display:block;width:100%;text-align:left}.dynamic-table table.table thead th .search-input{width:100%}.dynamic-table table.table thead th span{display:inline-block;vertical-align:top}.dynamic-table table.table thead th a{cursor:pointer;text-align:left}.dynamic-table table.table thead th.filter-column{text-align:center}.dynamic-table table.table thead tr:first-child th{border-top-width:0}.dynamic-table table.table tbody tr:last-child td{border-bottom-width:0}.dynamic-table table.table thead tr th,.dynamic-table table.table tbody tr td{background-color:var(--table-bg)}.dynamic-table table.table thead tr th:first-child,.dynamic-table table.table tbody tr td:first-child{border-left-width:0}.dynamic-table table.table thead tr th:last-child,.dynamic-table table.table tbody tr td:last-child{border-right-width:0}.dynamic-table table.table tbody tr.active td{background-color:var(--highlight-color);color:var(--highlight-text-color)}.dynamic-table .table-striped>tbody>tr:nth-of-type(odd) td{background-color:var(--table-stripe-bg)}.dynamic-table .table-striped>tbody>tr:nth-of-type(odd).active td{background-color:var(--highlight-color);color:var(--highlight-text-color)}.sort-dropdown .dropdown-box-toggle a.dropdown-box-toggle-link{margin-right:0;padding-right:0}.sort-dropdown .dropdown-box-toggle a.dropdown-box-toggle-link:after{display:none}.sort-dropdown-content-wrapper a.sort,.dynamic-table a.sort{position:relative;display:block;margin-right:calc(var(--arrow-size) * 2);-webkit-user-select:none;user-select:none;padding-right:5px}.sort-dropdown-content-wrapper a.sort:before,.sort-dropdown-content-wrapper a.sort:after,.dynamic-table a.sort:before,.dynamic-table a.sort:after{content:\"\";position:absolute;transition:.2s ease;left:calc(100% + var(--arrow-size));top:calc(50% - var(--arrow-size));border-top:var(--arrow-size) solid transparent;border-bottom:var(--arrow-size) solid transparent;border-left:var(--arrow-size) solid var(--arrow-color);transform:rotate(calc(var(--arrow-rotation) * 1deg)) translate(var(--arrow-space))}.sort-dropdown-content-wrapper a.sort:before,.dynamic-table a.sort:before{--arrow-rotation: -90}.sort-dropdown-content-wrapper a.sort.sort-desc:before,.dynamic-table a.sort.sort-desc:before{--arrow-color: black}.sort-dropdown-content-wrapper a.sort.sort-asc:after,.dynamic-table a.sort.sort-asc:after{--arrow-color: black}\n"] }]
|
|
7495
|
+
args: [{ standalone: false, encapsulation: ViewEncapsulation.None, selector: "dynamic-table", template: "<ng-template #columnTemplate let-context let-column=\"column\" let-template=\"template\">\n <ng-template #defaultTemplate let-column=\"column\" let-item=\"item\">\n <span>{{ item[column] == undefined || item[column] == null ? '-' : item[column] }}</span>\n </ng-template>\n <ng-template #pureTemplate>\n <ng-container [ngxTemplateOutlet]=\"template.ref\" [context]=\"context\"></ng-container>\n </ng-template>\n <td [ngClass]=\"'column-' + column\"\n [attr.data-testid]=\"testId + '-' + column + '-' + context.rowIndex\"\n *ngIf=\"!template || !template.pure; else pureTemplate\">\n <ng-container [ngxTemplateOutlet]=\"!template ? defaultTemplate : template.ref\"\n [context]=\"context\"></ng-container>\n </td>\n</ng-template>\n\n<ng-template #columnsTemplate let-context>\n <ng-container *ngFor=\"let column of cols\"\n [ngxTemplateOutlet]=\"columnTemplate\"\n [context]=\"context\"\n [additionalContext]=\"{\n template: templates[column],\n column: column\n }\"></ng-container>\n</ng-template>\n\n<ng-template #defaultRowTemplate let-context>\n <tr #elem\n [draggable]=\"!!dragStartFn\"\n [ngClass]=\"{active: selected === context.item}\"\n (dragstart)=\"onDragStart($event, elem, context.item)\"\n (dragenter)=\"onDragEnter($event, elem, context.item)\"\n (dragleave)=\"onDragLeave($event, elem)\"\n (drop)=\"onDrop($event, elem, context.item)\">\n <ng-container [ngxTemplateOutlet]=\"columnsTemplate\" [context]=\"context\"></ng-container>\n </tr>\n</ng-template>\n\n<ng-template #headerTemplate let-column=\"column\" let-toggle=\"toggle\">\n <ng-template #defaultCol>\n <span>{{ realColumns[column].title | translate }}</span>\n </ng-template>\n <ng-template #emptyCol>\n <span>-</span>\n </ng-template>\n <ng-container *ngIf=\"realColumns[column]; else emptyCol\">\n <a *ngIf=\"realColumns[column].sort; else defaultCol\"\n [ngClass]=\"['sort', orderBy !== column ? '' : (orderDescending ? 'sort-desc' : 'sort-asc')]\"\n (click)=\"setSorting(column, toggle)\">\n <span>{{ realColumns[column].title | translate }}</span>\n </a>\n </ng-container>\n</ng-template>\n\n<div class=\"dynamic-table\">\n <div class=\"table-features-row\">\n <ng-content select=\"[table-features-before]\"></ng-content>\n @if (showFilter) {\n <div class=\"table-input-wrap table-search-filter\">\n <label *ngIf=\"filterLabel\" [attr.for]=\"tableId\">\n {{ filterLabel | translate }}\n </label>\n <input type=\"text\"\n class=\"search-input\"\n [attr.id]=\"tableId\"\n [attr.data-testid]=\"testId + '-filter-input'\"\n [placeholder]=\"placeholder | translate\"\n [ngModel]=\"filter\"\n (ngModelChange)=\"setFilter($event)\"/>\n </div>\n }\n @if (sortable) {\n <dropdown-box componentClass=\"sort-dropdown\" #sortDd>\n <ng-container toggle-content\n [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{column: orderBy, toggle: sortDd}\"></ng-container>\n <ul>\n <ng-container *ngFor=\"let column of cols\">\n <li [ngClass]=\"'sort-column sort-' + column\" *ngIf=\"realColumns[column].sort\">\n <ng-container [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\n </li>\n </ng-container>\n </ul>\n </dropdown-box>\n }\n @if (showItems) {\n <div class=\"table-input-wrap table-items-count\">\n <label>\n {{ 'label.items.before' | translate }}\n </label>\n <dropdown-box>\n <ng-container toggle-content>\n {{ itemsPerPage }}\n </ng-container>\n <ul>\n <ng-container *ngFor=\"let count of showItems\">\n <li [ngClass]=\"'item-count count-' + count\" (click)=\"setItemsPerPage(count)\">\n {{ count }}\n </li>\n </ng-container>\n </ul>\n </dropdown-box>\n <label>\n {{ 'label.items.after' | translate }}\n </label>\n </div>\n }\n <ng-content select=\"[table-features-after]\"></ng-content>\n </div>\n <div class=\"table-content-row\"\n #pagination=\"pagination\"\n [pagination]=\"loadData\"\n [page]=\"page\"\n [itemsPerPage]=\"itemsPerPage\"\n [updateTime]=\"updateTime\">\n <pagination-menu [urlParam]=\"urlParam\" [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\"\n [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\n <div class=\"table-responsive\">\n <ng-template #defaultWrapperTemplate>\n <table class=\"table table-striped\">\n <thead>\n <tr>\n <th *ngFor=\"let column of cols\" [ngClass]=\"'header-column column-' + column\">\n <ng-container [ngTemplateOutlet]=\"headerTemplate\"\n [ngTemplateOutletContext]=\"{column: column}\"></ng-container>\n </th>\n </tr>\n <tr *ngIf=\"hasQuery\">\n <th *ngFor=\"let column of cols\" [ngClass]=\"['column-' + column, 'filter-column']\">\n <ng-container *ngIf=\"realColumns[column].filter\" [ngSwitch]=\"realColumns[column].filterType\">\n <ng-container *ngSwitchCase=\"'enum'\">\n <ng-template #optionItem let-option=\"option\">\n {{ (realColumns[column].enumPrefix ? realColumns[column].enumPrefix + '.' + option : option) | translate }}\n </ng-template>\n <dropdown-box componentClass=\"filter-box\"\n [ngClass]=\"'filter-box-' + column\" [closeInside]=\"false\">\n <ng-container toggle-content>\n <span class=\"toggle-placeholder\" *ngIf=\"!query[column]\">\n {{ realColumns[column].title | translate }}\n </span>\n <span [ngClass]=\"['option-' + option, column + '-option-' + option, option]\"\n *ngFor=\"let option of query[column] | values; let ix = index\">\n <ng-container *ngIf=\"ix > 0\">, </ng-container>\n <ng-container [ngTemplateOutlet]=\"optionItem\"\n [ngTemplateOutletContext]=\"{option: option}\"></ng-container>\n </span>\n </ng-container>\n <ul>\n <li [ngClass]=\"[column + '-option', 'option-' + option, option]\"\n (click)=\"setQueryValue(column, option)\"\n *ngFor=\"let option of realColumns[column].enum\">\n <a [ngClass]=\"'toggle-link-' + column\">\n <input type=\"checkbox\" [checked]=\"query[column] | includes: option\">\n <ng-container [ngTemplateOutlet]=\"optionItem\"\n [ngTemplateOutletContext]=\"{option: option}\"></ng-container>\n </a>\n </li>\n </ul>\n </dropdown-box>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <input type=\"checkbox\"\n [attr.data-testid]=\"testId + '-filter-' + column\"\n [placeholder]=\"realColumns[column].title | translate\"\n [ngModel]=\"query[column]\"\n (ngModelChange)=\"setQueryValue(column, $event)\"/>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <input class=\"search-input\"\n type=\"text\"\n [attr.data-testid]=\"testId + '-filter-' + column\"\n [placeholder]=\"realColumns[column].title | translate\"\n [ngModel]=\"query[column]\"\n (ngModelChange)=\"setQueryValue(column, $event)\"/>\n </ng-container>\n </ng-container>\n </th>\n </tr>\n </thead>\n <tbody>\n <ng-container *paginationItem=\"let context\"\n [ngxTemplateOutlet]=\"rowTemplate\"\n [context]=\"context\"\n [additionalContext]=\"this\"></ng-container>\n </tbody>\n </table>\n </ng-template>\n\n <div class=\"table-wrapper\">\n <ng-content select=\"[table-top]\"></ng-content>\n <ng-container [ngxTemplateOutlet]=\"wrapperTemplate || defaultWrapperTemplate\"\n [context]=\"this\"></ng-container>\n <ng-content select=\"[table-bottom]\"></ng-content>\n </div>\n </div>\n <pagination-menu [urlParam]=\"urlParam\" [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\"\n [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\n </div>\n</div>\n", styles: [".dynamic-table{--table-bg: transparent;--table-stripe-bg: rgba(210, 210, 210, .35);--border-size: 1px;--border-color: #ced4da;--bg-color: #ffffff;--text-color: #151515;--highlight-color: var(--primary-color, #888888);--highlight-text-color: #ffffff;--display-toggle: none;--arrow-size: 6px;--arrow-rotation: 90;--arrow-space: calc(var(--arrow-size) * .5 + 1px);--arrow-color: #c6c6c6}.dynamic-table *{box-sizing:border-box}.dynamic-table .search-input{background:var(--bg-color);color:var(--text-color);border:var(--border-size) solid var(--border-color);border-radius:5px;padding:6px 12px;-webkit-user-select:none;user-select:none;font-weight:400;font-size:var(--table-input-font-size, 15px);line-height:var(--table-input-line-height, 18px);outline:none}.dynamic-table .search-input .toggle-placeholder,.dynamic-table .search-input ::placeholder{color:#495057}.dynamic-table .table-responsive{border:1px solid var(--border-color);overflow:hidden;overflow-x:auto;margin-bottom:1rem}.dynamic-table .table-features-row:not(:empty){display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:space-between;margin-bottom:20px}.dynamic-table .table-content-row{position:relative}.dynamic-table .sort-dropdown{display:none}.dynamic-table .table-input-wrap{display:flex;align-items:center;justify-content:flex-end;gap:5px}.dynamic-table .table-input-wrap>label{margin:0;font-weight:700}.dynamic-table .table-input-wrap>input{max-width:400px}.dynamic-table .table-items-count{flex:1}.dynamic-table .table-wrapper{position:relative}.dynamic-table table.table{border-collapse:collapse;margin:0;width:100%;font-family:inherit;font-size:inherit}.dynamic-table table.table th{text-align:left}.dynamic-table table.table th,.dynamic-table table.table td{text-align:left;padding:6px 12px;border:1px solid var(--border-color);vertical-align:middle;white-space:nowrap;width:var(--cell-width, 25%);min-width:fit-content}.dynamic-table table.table-sm th,.dynamic-table table.table-sm td{font-size:var(--font-size-sm);padding:4px 6px}.dynamic-table table.table thead th{font-weight:500}.dynamic-table table.table thead th .dropdown-box{display:block;width:100%;text-align:left}.dynamic-table table.table thead th .search-input{width:100%}.dynamic-table table.table thead th span{display:inline-block;vertical-align:top}.dynamic-table table.table thead th a{cursor:pointer;text-align:left}.dynamic-table table.table thead th.filter-column{text-align:center}.dynamic-table table.table thead tr:first-child th{border-top-width:0}.dynamic-table table.table tbody tr:last-child td{border-bottom-width:0}.dynamic-table table.table thead tr th,.dynamic-table table.table tbody tr td{background-color:var(--table-bg)}.dynamic-table table.table thead tr th:first-child,.dynamic-table table.table tbody tr td:first-child{border-left-width:0}.dynamic-table table.table thead tr th:last-child,.dynamic-table table.table tbody tr td:last-child{border-right-width:0}.dynamic-table table.table tbody tr.active td{background-color:var(--highlight-color);color:var(--highlight-text-color)}.dynamic-table .table-striped>tbody>tr:nth-of-type(odd) td{background-color:var(--table-stripe-bg)}.dynamic-table .table-striped>tbody>tr:nth-of-type(odd).active td{background-color:var(--highlight-color);color:var(--highlight-text-color)}.sort-dropdown .dropdown-box-toggle a.dropdown-box-toggle-link{margin-right:0;padding-right:0}.sort-dropdown .dropdown-box-toggle a.dropdown-box-toggle-link:after{display:none}.sort-dropdown-content-wrapper a.sort,.dynamic-table a.sort{position:relative;display:block;margin-right:calc(var(--arrow-size) * 2);-webkit-user-select:none;user-select:none;padding-right:5px}.sort-dropdown-content-wrapper a.sort:before,.sort-dropdown-content-wrapper a.sort:after,.dynamic-table a.sort:before,.dynamic-table a.sort:after{content:\"\";position:absolute;transition:.2s ease;left:calc(100% + var(--arrow-size));top:calc(50% - var(--arrow-size));border-top:var(--arrow-size) solid transparent;border-bottom:var(--arrow-size) solid transparent;border-left:var(--arrow-size) solid var(--arrow-color);transform:rotate(calc(var(--arrow-rotation) * 1deg)) translate(var(--arrow-space))}.sort-dropdown-content-wrapper a.sort:before,.dynamic-table a.sort:before{--arrow-rotation: -90}.sort-dropdown-content-wrapper a.sort.sort-desc:before,.dynamic-table a.sort.sort-desc:before{--arrow-color: black}.sort-dropdown-content-wrapper a.sort.sort-asc:after,.dynamic-table a.sort.sort-asc:after{--arrow-color: black}\n"] }]
|
|
7519
7496
|
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { dataLoader: [{
|
|
7520
7497
|
type: Input
|
|
7521
7498
|
}], data: [{
|
|
@@ -7616,106 +7593,134 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
7616
7593
|
}] } });
|
|
7617
7594
|
|
|
7618
7595
|
class InteractiveItemComponent {
|
|
7596
|
+
get shapes() {
|
|
7597
|
+
return this.mShapes;
|
|
7598
|
+
}
|
|
7599
|
+
get hovered() {
|
|
7600
|
+
return this.canvas?.hoveredItem === this;
|
|
7601
|
+
}
|
|
7602
|
+
set hovered(value) {
|
|
7603
|
+
if (!this.canvas)
|
|
7604
|
+
return;
|
|
7605
|
+
this.canvas.hoveredItem = value ? this : null;
|
|
7606
|
+
}
|
|
7607
|
+
get x() {
|
|
7608
|
+
return this.pos.x;
|
|
7609
|
+
}
|
|
7619
7610
|
set x(value) {
|
|
7620
|
-
if (isNaN(value))
|
|
7611
|
+
if (isNaN(value) || value === this.pos.x)
|
|
7621
7612
|
return;
|
|
7622
7613
|
this.pos = new Point(value, this.pos.y);
|
|
7614
|
+
this.validPosition = this.pos;
|
|
7615
|
+
}
|
|
7616
|
+
get y() {
|
|
7617
|
+
return this.pos.y;
|
|
7623
7618
|
}
|
|
7624
7619
|
set y(value) {
|
|
7625
|
-
if (isNaN(value))
|
|
7620
|
+
if (isNaN(value) || value === this.pos.y)
|
|
7626
7621
|
return;
|
|
7627
7622
|
this.pos = new Point(this.pos.x, value);
|
|
7623
|
+
this.validPosition = this.pos;
|
|
7624
|
+
}
|
|
7625
|
+
get position() {
|
|
7626
|
+
return this.pos;
|
|
7628
7627
|
}
|
|
7629
7628
|
set position(value) {
|
|
7630
7629
|
if (typeof value !== "object" || isNaN(value.x) || isNaN(value.y) || value === this.pos)
|
|
7631
7630
|
return;
|
|
7632
7631
|
this.pos = new Point(value.x, value.y);
|
|
7632
|
+
this.validPosition = this.pos;
|
|
7633
7633
|
}
|
|
7634
|
-
get
|
|
7635
|
-
return this.
|
|
7636
|
-
}
|
|
7637
|
-
get canvas() {
|
|
7638
|
-
return null;
|
|
7639
|
-
}
|
|
7640
|
-
get position() {
|
|
7641
|
-
return this.pos;
|
|
7642
|
-
}
|
|
7643
|
-
get x() {
|
|
7644
|
-
return this.pos.x;
|
|
7634
|
+
get isValid() {
|
|
7635
|
+
return this.valid;
|
|
7645
7636
|
}
|
|
7646
|
-
get
|
|
7647
|
-
return this.
|
|
7637
|
+
get validPosition() {
|
|
7638
|
+
return this.validPos;
|
|
7648
7639
|
}
|
|
7649
|
-
|
|
7650
|
-
|
|
7640
|
+
set validPosition(value) {
|
|
7641
|
+
if (typeof value !== "object" || isNaN(value.x) || isNaN(value.y) || value === this.validPos)
|
|
7642
|
+
return;
|
|
7643
|
+
this.validPos = new Point(value.x, value.y);
|
|
7644
|
+
this.valid = true;
|
|
7651
7645
|
}
|
|
7652
7646
|
constructor() {
|
|
7653
|
-
this.onClick = new EventEmitter();
|
|
7654
|
-
this.onPan = new EventEmitter();
|
|
7655
|
-
this.onPanStart = new EventEmitter();
|
|
7656
|
-
this.onPanEnd = new EventEmitter();
|
|
7657
7647
|
this.active = false;
|
|
7658
7648
|
this.index = -1;
|
|
7659
|
-
this.
|
|
7649
|
+
this.valid = true;
|
|
7660
7650
|
this.pos = Point.Zero;
|
|
7661
|
-
this.rotation = 0;
|
|
7662
7651
|
this.direction = "none";
|
|
7663
7652
|
this.mShapes = [];
|
|
7664
|
-
this.subscription = ObservableUtils.multiSubscription(this.onPan.subscribe(ev => {
|
|
7665
|
-
switch (this.direction) {
|
|
7666
|
-
case "free":
|
|
7667
|
-
this.x += ev.deltaX;
|
|
7668
|
-
this.y += ev.deltaY;
|
|
7669
|
-
break;
|
|
7670
|
-
case "horizontal":
|
|
7671
|
-
this.x += ev.deltaX;
|
|
7672
|
-
break;
|
|
7673
|
-
case "vertical":
|
|
7674
|
-
this.y += ev.deltaY;
|
|
7675
|
-
break;
|
|
7676
|
-
}
|
|
7677
|
-
if (this.direction !== "none") {
|
|
7678
|
-
this.calcShapes();
|
|
7679
|
-
}
|
|
7680
|
-
}));
|
|
7681
7653
|
}
|
|
7682
|
-
|
|
7683
|
-
|
|
7654
|
+
draw(ctx) {
|
|
7655
|
+
drawOval(ctx, 4, 4);
|
|
7656
|
+
ctx.fill();
|
|
7657
|
+
ctx.stroke();
|
|
7684
7658
|
}
|
|
7685
7659
|
ngOnChanges() {
|
|
7660
|
+
if (!this.canvas)
|
|
7661
|
+
return;
|
|
7686
7662
|
this.calcShapes();
|
|
7687
7663
|
}
|
|
7688
|
-
calcShapes(
|
|
7689
|
-
const
|
|
7690
|
-
const ratio = canvas.ratio;
|
|
7664
|
+
calcShapes() {
|
|
7665
|
+
const ratio = this.canvas.ratio ?? 1;
|
|
7691
7666
|
const x = this.pos.x * ratio;
|
|
7692
|
-
|
|
7693
|
-
this.mShapes = this.cycles.map(pan =>
|
|
7694
|
-
const y = this.pos.y * ratio + pan;
|
|
7695
|
-
return this.calcShape(x, y);
|
|
7696
|
-
});
|
|
7667
|
+
const y = this.pos.y * ratio;
|
|
7668
|
+
this.mShapes = this.canvas.cycles.map(pan => this.calcShape(x, y + pan));
|
|
7697
7669
|
}
|
|
7698
7670
|
hit(point) {
|
|
7699
7671
|
for (const shape of this.shapes) {
|
|
7700
|
-
if (shape.
|
|
7672
|
+
if (shape.minDistance(point) <= 0)
|
|
7701
7673
|
return true;
|
|
7702
7674
|
}
|
|
7703
7675
|
return false;
|
|
7704
7676
|
}
|
|
7705
|
-
|
|
7706
|
-
|
|
7677
|
+
moveBy(dx, dy) {
|
|
7678
|
+
if (this.direction === "none")
|
|
7679
|
+
return;
|
|
7680
|
+
switch (this.direction) {
|
|
7681
|
+
case "horizontal":
|
|
7682
|
+
this.pos = new Point(this.pos.x + dx, this.pos.y);
|
|
7683
|
+
break;
|
|
7684
|
+
case "vertical":
|
|
7685
|
+
this.pos = new Point(this.pos.x, this.pos.y + dy);
|
|
7686
|
+
break;
|
|
7687
|
+
default:
|
|
7688
|
+
this.pos = new Point(this.pos.x + dx, this.pos.y + dy);
|
|
7689
|
+
break;
|
|
7690
|
+
}
|
|
7691
|
+
this.calcShapes();
|
|
7692
|
+
this.valid = this.isValidByParams() && this.canvas.items.every(other => this === other || this.isValidByDistance(other));
|
|
7693
|
+
this.validPos = this.valid ? this.pos : this.validPos;
|
|
7694
|
+
}
|
|
7695
|
+
moveEnd() {
|
|
7696
|
+
if (this.valid)
|
|
7697
|
+
return;
|
|
7698
|
+
this.pos = this.validPos;
|
|
7699
|
+
this.valid = true;
|
|
7700
|
+
this.calcShapes();
|
|
7701
|
+
}
|
|
7702
|
+
isValidByParams() {
|
|
7703
|
+
return true;
|
|
7707
7704
|
}
|
|
7708
|
-
|
|
7709
|
-
this.
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
ctx.stroke();
|
|
7705
|
+
isValidByDistance(other) {
|
|
7706
|
+
const minPixels = this.distToPixels(this.getMinDistance(other));
|
|
7707
|
+
return !this.shapes.some(shape => {
|
|
7708
|
+
return other.shapes.some(os => {
|
|
7709
|
+
return os.minDistance(shape) <= minPixels;
|
|
7710
|
+
});
|
|
7715
7711
|
});
|
|
7716
7712
|
}
|
|
7713
|
+
distToPixels(value) {
|
|
7714
|
+
return !this.canvas ? 1 : Math.max(1, (isNaN(value) || value < 0 ? 0 : value) * (this.canvas.ratio ?? 1));
|
|
7715
|
+
}
|
|
7716
|
+
getMinDistance(other) {
|
|
7717
|
+
return !other ? 0 : null;
|
|
7718
|
+
}
|
|
7719
|
+
calcShape(x, y) {
|
|
7720
|
+
return new Point(x, y);
|
|
7721
|
+
}
|
|
7717
7722
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: InteractiveItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7718
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: InteractiveItemComponent, isStandalone: false, selector: "__interactive-item__", inputs: { x: "x", y: "y", position: "position",
|
|
7723
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: InteractiveItemComponent, isStandalone: false, selector: "__interactive-item__", inputs: { x: "x", y: "y", position: "position", direction: "direction", disabled: "disabled" }, usesOnChanges: true, ngImport: i0, template: "", isInline: true }); }
|
|
7719
7724
|
}
|
|
7720
7725
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: InteractiveItemComponent, decorators: [{
|
|
7721
7726
|
type: Component,
|
|
@@ -7730,50 +7735,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
7730
7735
|
type: Input
|
|
7731
7736
|
}], position: [{
|
|
7732
7737
|
type: Input
|
|
7733
|
-
}], rotation: [{
|
|
7734
|
-
type: Input
|
|
7735
7738
|
}], direction: [{
|
|
7736
7739
|
type: Input
|
|
7737
7740
|
}], disabled: [{
|
|
7738
7741
|
type: Input
|
|
7739
|
-
}], onClick: [{
|
|
7740
|
-
type: Output
|
|
7741
|
-
}], onPan: [{
|
|
7742
|
-
type: Output
|
|
7743
|
-
}], onPanStart: [{
|
|
7744
|
-
type: Output
|
|
7745
|
-
}], onPanEnd: [{
|
|
7746
|
-
type: Output
|
|
7747
7742
|
}] } });
|
|
7748
7743
|
|
|
7749
7744
|
class InteractiveCanvasComponent {
|
|
7745
|
+
get items() {
|
|
7746
|
+
return this.$items.value;
|
|
7747
|
+
}
|
|
7748
|
+
get canvas() {
|
|
7749
|
+
return this.canvasElem?.nativeElement;
|
|
7750
|
+
}
|
|
7751
|
+
get lockedItem() {
|
|
7752
|
+
return this.items[this.lockedIndex];
|
|
7753
|
+
}
|
|
7750
7754
|
get selectedItem() {
|
|
7751
7755
|
return this.items[this.selectedIndex];
|
|
7752
7756
|
}
|
|
7753
7757
|
get hoveredItem() {
|
|
7754
7758
|
return this.items[this.hoveredIndex];
|
|
7755
7759
|
}
|
|
7756
|
-
|
|
7757
|
-
|
|
7760
|
+
set hoveredItem(item) {
|
|
7761
|
+
this.hoveredIndex = !item ? -1 : this.items.indexOf(item);
|
|
7758
7762
|
}
|
|
7759
|
-
constructor(renderer) {
|
|
7763
|
+
constructor(renderer, universal, element, rootElement) {
|
|
7760
7764
|
this.renderer = renderer;
|
|
7765
|
+
this.universal = universal;
|
|
7766
|
+
this.element = element;
|
|
7767
|
+
this.rootElement = rootElement;
|
|
7768
|
+
this.debug = false;
|
|
7761
7769
|
this.horizontal = false;
|
|
7762
7770
|
this.selectedIndex = 0;
|
|
7763
7771
|
this.resizeMode = "fit";
|
|
7764
|
-
this.
|
|
7765
|
-
this.
|
|
7766
|
-
this.shouldDraw = true;
|
|
7772
|
+
this.realWidth = 100;
|
|
7773
|
+
this.realHeight = 100;
|
|
7767
7774
|
this.panOffset = 0;
|
|
7768
|
-
this.
|
|
7775
|
+
this.params = {};
|
|
7776
|
+
this.beforeItems = [];
|
|
7777
|
+
this.afterItems = [];
|
|
7778
|
+
this.selectedIndexChange = new EventEmitter();
|
|
7779
|
+
this.onRotate = new EventEmitter();
|
|
7780
|
+
this.onItemPan = new EventEmitter();
|
|
7781
|
+
this.onItemPanned = new EventEmitter();
|
|
7782
|
+
this.onPan = new EventEmitter();
|
|
7783
|
+
this.onPanned = new EventEmitter();
|
|
7784
|
+
this.$items = new BehaviorSubject([]);
|
|
7785
|
+
this.tempCanvas = this.universal.isServer ? null : document.createElement("canvas");
|
|
7786
|
+
this.shouldDraw = !this.universal.isServer;
|
|
7769
7787
|
this.rotation = 0;
|
|
7770
7788
|
this.canvasWidth = 0;
|
|
7771
7789
|
this.canvasHeight = 0;
|
|
7772
7790
|
this.hoveredIndex = null;
|
|
7773
|
-
this.items = [];
|
|
7774
7791
|
this.touched = false;
|
|
7775
7792
|
this.deltaX = 0;
|
|
7776
7793
|
this.deltaY = 0;
|
|
7794
|
+
this.ctrInit();
|
|
7795
|
+
}
|
|
7796
|
+
ctrInit() {
|
|
7777
7797
|
}
|
|
7778
7798
|
ngOnInit() {
|
|
7779
7799
|
this.redraw();
|
|
@@ -7783,12 +7803,29 @@ class InteractiveCanvasComponent {
|
|
|
7783
7803
|
this.subscription?.unsubscribe();
|
|
7784
7804
|
}
|
|
7785
7805
|
ngOnChanges() {
|
|
7806
|
+
this.params = this.params || {};
|
|
7807
|
+
this.renderCtx = this.renderCtx || {};
|
|
7808
|
+
this.beforeItems = this.beforeItems || [];
|
|
7809
|
+
this.afterItems = this.afterItems || [];
|
|
7786
7810
|
this.resize();
|
|
7787
7811
|
}
|
|
7788
7812
|
ngAfterViewInit() {
|
|
7789
7813
|
this.subscription = this.itemList.changes.subscribe(() => this.fixItems());
|
|
7790
7814
|
this.fixItems();
|
|
7791
7815
|
}
|
|
7816
|
+
async tempPaint(cb) {
|
|
7817
|
+
const renderCanvas = this.canvas;
|
|
7818
|
+
const canvas = this.tempCanvas;
|
|
7819
|
+
canvas.width = renderCanvas.width;
|
|
7820
|
+
canvas.height = renderCanvas.height;
|
|
7821
|
+
const ctx = canvas.getContext("2d");
|
|
7822
|
+
ctx.globalCompositeOperation = "source-over";
|
|
7823
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
7824
|
+
const bgCtx = renderCanvas.getContext("2d");
|
|
7825
|
+
bgCtx.globalCompositeOperation = await cb(ctx) || "source-over";
|
|
7826
|
+
bgCtx.drawImage(canvas, 0, 0);
|
|
7827
|
+
bgCtx.globalCompositeOperation = "source-over";
|
|
7828
|
+
}
|
|
7792
7829
|
resize() {
|
|
7793
7830
|
if (!this.canvasElem || !this.containerElem || !this.realWidth || !this.realWidth)
|
|
7794
7831
|
return;
|
|
@@ -7805,20 +7842,24 @@ class InteractiveCanvasComponent {
|
|
|
7805
7842
|
canvas[axisX] = this.realWidth * this.ratio;
|
|
7806
7843
|
canvas[axisY] = this.realHeight * this.ratio;
|
|
7807
7844
|
}
|
|
7845
|
+
this.styles = getComputedStyle(canvas);
|
|
7846
|
+
this.ctx = canvas.getContext("2d");
|
|
7808
7847
|
this.canvasWidth = canvas[axisX];
|
|
7809
7848
|
this.canvasHeight = canvas[axisY];
|
|
7810
7849
|
this.fullHeight = this.realHeight * this.ratio;
|
|
7811
|
-
this.
|
|
7812
|
-
this.
|
|
7850
|
+
this.viewRatio = Math.round(this.canvasHeight / this.fullHeight * 100) / 100;
|
|
7851
|
+
this.fixRotation();
|
|
7813
7852
|
}
|
|
7814
7853
|
onTouchStart($event) {
|
|
7815
7854
|
this.hoveredIndex = this.getIndexUnderPointer($event.touches.item(0));
|
|
7855
|
+
this.lockedIndex = this.hoveredIndex;
|
|
7816
7856
|
this.touched = true;
|
|
7817
7857
|
}
|
|
7818
7858
|
onTouchEnd($event) {
|
|
7819
7859
|
this.selectItem($event.touches.item(0));
|
|
7820
7860
|
}
|
|
7821
|
-
onMouseDown() {
|
|
7861
|
+
onMouseDown($event) {
|
|
7862
|
+
this.lockedIndex = this.getIndexUnderPointer($event);
|
|
7822
7863
|
this.touched = true;
|
|
7823
7864
|
}
|
|
7824
7865
|
onMouseUp($event) {
|
|
@@ -7834,67 +7875,76 @@ class InteractiveCanvasComponent {
|
|
|
7834
7875
|
this.hoveredIndex = null;
|
|
7835
7876
|
this.updateCursor();
|
|
7836
7877
|
}
|
|
7837
|
-
onPanStart(
|
|
7838
|
-
this.lockedIndex = this.getIndexUnderPointer($event?.pointers[0]);
|
|
7839
|
-
this.lockedItem?.onPanStart.emit({
|
|
7840
|
-
pointers: [],
|
|
7841
|
-
deltaX: 0,
|
|
7842
|
-
deltaY: 0,
|
|
7843
|
-
item: this.lockedItem
|
|
7844
|
-
});
|
|
7878
|
+
onPanStart() {
|
|
7845
7879
|
this.deltaX = 0;
|
|
7846
7880
|
this.deltaY = 0;
|
|
7847
7881
|
}
|
|
7848
|
-
|
|
7882
|
+
onPanMove($event) {
|
|
7849
7883
|
const item = this.lockedItem;
|
|
7850
7884
|
const deltaX = ($event.deltaX - this.deltaX) / this.ratio;
|
|
7851
7885
|
const deltaY = ($event.deltaY - this.deltaY) / this.ratio;
|
|
7886
|
+
const data = {
|
|
7887
|
+
canvas: this,
|
|
7888
|
+
pointers: $event.pointers,
|
|
7889
|
+
item,
|
|
7890
|
+
deltaX,
|
|
7891
|
+
deltaY
|
|
7892
|
+
};
|
|
7893
|
+
if (this.horizontal) {
|
|
7894
|
+
data.deltaX = -deltaY;
|
|
7895
|
+
data.deltaY = +deltaX;
|
|
7896
|
+
}
|
|
7852
7897
|
if (item) {
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
: { pointers: $event.pointers, deltaX, deltaY };
|
|
7856
|
-
data.item = item;
|
|
7857
|
-
item.onPan.emit(data);
|
|
7898
|
+
item.moveBy(data.deltaX, data.deltaY);
|
|
7899
|
+
this.onItemPan.emit(data);
|
|
7858
7900
|
}
|
|
7859
7901
|
else if (this.resizeMode == "fill") {
|
|
7860
|
-
this.
|
|
7861
|
-
this.
|
|
7902
|
+
this.rotation += (this.horizontal ? deltaX : deltaY) / this.realHeight * 360;
|
|
7903
|
+
this.fixRotation();
|
|
7904
|
+
this.onPan.emit(data);
|
|
7862
7905
|
}
|
|
7863
7906
|
this.deltaX = $event.deltaX;
|
|
7864
7907
|
this.deltaY = $event.deltaY;
|
|
7865
7908
|
}
|
|
7866
7909
|
onPanEnd() {
|
|
7867
7910
|
const item = this.lockedItem;
|
|
7868
|
-
|
|
7911
|
+
const data = {
|
|
7912
|
+
canvas: this,
|
|
7869
7913
|
pointers: [],
|
|
7870
7914
|
deltaX: 0,
|
|
7871
7915
|
deltaY: 0,
|
|
7872
7916
|
item
|
|
7873
|
-
}
|
|
7917
|
+
};
|
|
7918
|
+
if (item) {
|
|
7919
|
+
item.moveEnd();
|
|
7920
|
+
this.onItemPanned.emit(data);
|
|
7921
|
+
}
|
|
7922
|
+
else {
|
|
7923
|
+
this.onPanned.emit(data);
|
|
7924
|
+
}
|
|
7874
7925
|
this.lockedIndex = -1;
|
|
7875
7926
|
}
|
|
7876
|
-
|
|
7927
|
+
fixRotation() {
|
|
7877
7928
|
if (this.fullHeight <= 0)
|
|
7878
7929
|
return;
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
this.
|
|
7884
|
-
}
|
|
7885
|
-
this.rotation = Math.round(this.pan / this.fullHeight * 360);
|
|
7886
|
-
const basePan = (this.rotation / 360 - 1) * this.fullHeight;
|
|
7887
|
-
const cycles = this.resizeMode == "fit" ? [0] : [basePan - this.fullHeight, basePan, basePan + this.fullHeight];
|
|
7930
|
+
this.rotation = ((this.rotation + 180) % 360 + 360) % 360 - 180;
|
|
7931
|
+
this.rotation = Math.round(this.rotation * 100) / 100;
|
|
7932
|
+
this.basePan = (this.rotation / 360 - 1) * this.fullHeight + this.canvasHeight * this.panOffset;
|
|
7933
|
+
this.cycles = this.resizeMode == "fit"
|
|
7934
|
+
? [0] : [this.basePan - this.fullHeight, this.basePan, this.basePan + this.fullHeight];
|
|
7888
7935
|
this.items.forEach(item => {
|
|
7889
|
-
item.calcShapes(
|
|
7936
|
+
item.calcShapes();
|
|
7890
7937
|
});
|
|
7938
|
+
this.onRotate.emit(this.rotation);
|
|
7891
7939
|
}
|
|
7892
7940
|
fixItems() {
|
|
7893
|
-
|
|
7894
|
-
this
|
|
7941
|
+
const items = this.itemList.toArray();
|
|
7942
|
+
this.$items.next(items);
|
|
7943
|
+
items.forEach((item, ix) => {
|
|
7944
|
+
item.canvas = this;
|
|
7895
7945
|
item.index = ix;
|
|
7896
7946
|
});
|
|
7897
|
-
this.
|
|
7947
|
+
this.fixRotation();
|
|
7898
7948
|
}
|
|
7899
7949
|
selectItem(pointer) {
|
|
7900
7950
|
const selected = this.getIndexUnderPointer(pointer);
|
|
@@ -7926,7 +7976,6 @@ class InteractiveCanvasComponent {
|
|
|
7926
7976
|
}
|
|
7927
7977
|
updateCursor() {
|
|
7928
7978
|
const cursor = this.getCursor();
|
|
7929
|
-
this.renderer.setStyle(this.canvasElem.nativeElement, "cursor", cursor);
|
|
7930
7979
|
this.renderer.setStyle(this.containerElem.nativeElement, "cursor", cursor);
|
|
7931
7980
|
}
|
|
7932
7981
|
getCursor() {
|
|
@@ -7946,7 +7995,6 @@ class InteractiveCanvasComponent {
|
|
|
7946
7995
|
redraw() {
|
|
7947
7996
|
if (!this.shouldDraw)
|
|
7948
7997
|
return;
|
|
7949
|
-
this.ctx = this.canvasElem.nativeElement?.getContext("2d");
|
|
7950
7998
|
if (!this.ctx) {
|
|
7951
7999
|
requestAnimationFrame(() => this.redraw());
|
|
7952
8000
|
return;
|
|
@@ -7955,29 +8003,78 @@ class InteractiveCanvasComponent {
|
|
|
7955
8003
|
requestAnimationFrame(() => this.redraw());
|
|
7956
8004
|
});
|
|
7957
8005
|
}
|
|
8006
|
+
async drawItems() {
|
|
8007
|
+
const ctx = this.ctx;
|
|
8008
|
+
for (const item of this.items) {
|
|
8009
|
+
for (const shape of item.shapes) {
|
|
8010
|
+
ctx.save();
|
|
8011
|
+
ctx.translate(shape.x, shape.y);
|
|
8012
|
+
ctx.lineWidth = 1;
|
|
8013
|
+
ctx.strokeStyle = "black";
|
|
8014
|
+
ctx.fillStyle = "white";
|
|
8015
|
+
await item.draw(ctx);
|
|
8016
|
+
ctx.restore();
|
|
8017
|
+
}
|
|
8018
|
+
}
|
|
8019
|
+
if (!this.debug)
|
|
8020
|
+
return;
|
|
8021
|
+
ctx.lineWidth = 2;
|
|
8022
|
+
ctx.strokeStyle = "rgba(114,232,45,0.55)";
|
|
8023
|
+
for (const item of this.items) {
|
|
8024
|
+
for (const shape of item.shapes) {
|
|
8025
|
+
ctx.save();
|
|
8026
|
+
ctx.translate(shape.x, shape.y);
|
|
8027
|
+
if (shape instanceof Rect || shape instanceof Oval) {
|
|
8028
|
+
ctx.rotate(toRadians(shape.rotation));
|
|
8029
|
+
if (shape instanceof Oval) {
|
|
8030
|
+
drawOval(ctx, shape.width, shape.height);
|
|
8031
|
+
}
|
|
8032
|
+
else {
|
|
8033
|
+
drawRect(ctx, shape.width, shape.height);
|
|
8034
|
+
}
|
|
8035
|
+
ctx.stroke();
|
|
8036
|
+
}
|
|
8037
|
+
ctx.restore();
|
|
8038
|
+
}
|
|
8039
|
+
}
|
|
8040
|
+
}
|
|
7958
8041
|
async draw() {
|
|
7959
8042
|
const ctx = this.ctx;
|
|
7960
8043
|
const canvas = ctx.canvas;
|
|
8044
|
+
if (canvas.width < 1 || canvas.height < 1)
|
|
8045
|
+
return;
|
|
7961
8046
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
7962
8047
|
ctx.save();
|
|
7963
|
-
const width = this.realWidth * this.ratio;
|
|
7964
|
-
const height = this.realHeight * this.ratio;
|
|
7965
|
-
const x = canvas.width / 2 - width / 2;
|
|
7966
|
-
const y = canvas.height / 2 - height / 2;
|
|
7967
8048
|
if (this.horizontal) {
|
|
7968
8049
|
ctx.rotate(-Math.PI / 2);
|
|
7969
8050
|
ctx.translate(-this.canvasWidth, 0);
|
|
7970
8051
|
}
|
|
7971
|
-
|
|
8052
|
+
try {
|
|
8053
|
+
for (const renderer of this.beforeItems) {
|
|
8054
|
+
await renderer(this, this.renderCtx);
|
|
8055
|
+
}
|
|
8056
|
+
await this.drawItems();
|
|
8057
|
+
for (const renderer of this.afterItems) {
|
|
8058
|
+
await renderer(this, this.renderCtx);
|
|
8059
|
+
}
|
|
8060
|
+
}
|
|
8061
|
+
catch (e) {
|
|
8062
|
+
console.warn(`There was an error rendering the canvas: ${e}`);
|
|
8063
|
+
}
|
|
7972
8064
|
ctx.restore();
|
|
7973
8065
|
}
|
|
7974
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: InteractiveCanvasComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7975
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: InteractiveCanvasComponent, isStandalone: false, selector: "interactive-canvas", inputs: { horizontal: "horizontal", selectedIndex: "selectedIndex", resizeMode: "resizeMode", realWidth: "realWidth", realHeight: "realHeight",
|
|
8066
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: InteractiveCanvasComponent, deps: [{ token: i0.Renderer2 }, { token: UniversalService }, { token: i0.ElementRef }, { token: ROOT_ELEMENT }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8067
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: InteractiveCanvasComponent, isStandalone: false, selector: "interactive-canvas", inputs: { debug: "debug", horizontal: "horizontal", selectedIndex: "selectedIndex", resizeMode: "resizeMode", realWidth: "realWidth", realHeight: "realHeight", panOffset: "panOffset", params: "params", renderCtx: "renderCtx", beforeItems: "beforeItems", afterItems: "afterItems" }, outputs: { selectedIndexChange: "selectedIndexChange", onRotate: "onRotate", onItemPan: "onItemPan", onItemPanned: "onItemPanned", onPan: "onPan", onPanned: "onPanned" }, host: { listeners: { "window:touchend": "onTouchEnd($event)", "window:mouseup": "onMouseUp($event)" } }, queries: [{ propertyName: "itemList", predicate: InteractiveItemComponent }], viewQueries: [{ propertyName: "containerElem", first: true, predicate: ["containerElem"], descendants: true, static: true }, { propertyName: "canvasElem", first: true, predicate: ["canvasElem"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div #containerElem\n [ngClass]=\"['interactive-canvas-container', horizontal ? 'horizontal' : 'vertical']\"\n (resize)=\"resize()\"\n (touchstart)=\"onTouchStart($event)\"\n (mousedown)=\"onMouseDown($event)\"\n (mousemove)=\"onMouseMove($event)\"\n (mouseleave)=\"onMouseLeave()\"\n (panend)=\"onPanEnd()\"\n (panmove)=\"onPanMove($event)\"\n (panstart)=\"onPanStart()\">\n <canvas #canvasElem class=\"interactive-canvas-element\"></canvas>\n</div>\n", styles: [".interactive-canvas-container{width:100%;height:100%;position:relative;display:flex;align-items:center;justify-content:center}.interactive-canvas-container .interactive-canvas-element{position:absolute;pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i1$3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
|
|
7976
8068
|
}
|
|
7977
8069
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: InteractiveCanvasComponent, decorators: [{
|
|
7978
8070
|
type: Component,
|
|
7979
|
-
args: [{ standalone: false, selector: "interactive-canvas", template: "<div #containerElem\n [ngClass]=\"['interactive-canvas-
|
|
7980
|
-
}], ctorParameters: () => [{ type: i0.Renderer2 }
|
|
8071
|
+
args: [{ standalone: false, selector: "interactive-canvas", template: "<div #containerElem\n [ngClass]=\"['interactive-canvas-container', horizontal ? 'horizontal' : 'vertical']\"\n (resize)=\"resize()\"\n (touchstart)=\"onTouchStart($event)\"\n (mousedown)=\"onMouseDown($event)\"\n (mousemove)=\"onMouseMove($event)\"\n (mouseleave)=\"onMouseLeave()\"\n (panend)=\"onPanEnd()\"\n (panmove)=\"onPanMove($event)\"\n (panstart)=\"onPanStart()\">\n <canvas #canvasElem class=\"interactive-canvas-element\"></canvas>\n</div>\n", styles: [".interactive-canvas-container{width:100%;height:100%;position:relative;display:flex;align-items:center;justify-content:center}.interactive-canvas-container .interactive-canvas-element{position:absolute;pointer-events:none}\n"] }]
|
|
8072
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: UniversalService }, { type: i0.ElementRef }, { type: HTMLElement, decorators: [{
|
|
8073
|
+
type: Inject,
|
|
8074
|
+
args: [ROOT_ELEMENT]
|
|
8075
|
+
}] }], propDecorators: { debug: [{
|
|
8076
|
+
type: Input
|
|
8077
|
+
}], horizontal: [{
|
|
7981
8078
|
type: Input
|
|
7982
8079
|
}], selectedIndex: [{
|
|
7983
8080
|
type: Input
|
|
@@ -7987,10 +8084,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
7987
8084
|
type: Input
|
|
7988
8085
|
}], realHeight: [{
|
|
7989
8086
|
type: Input
|
|
7990
|
-
}],
|
|
8087
|
+
}], panOffset: [{
|
|
8088
|
+
type: Input
|
|
8089
|
+
}], params: [{
|
|
8090
|
+
type: Input
|
|
8091
|
+
}], renderCtx: [{
|
|
8092
|
+
type: Input
|
|
8093
|
+
}], beforeItems: [{
|
|
8094
|
+
type: Input
|
|
8095
|
+
}], afterItems: [{
|
|
7991
8096
|
type: Input
|
|
7992
8097
|
}], selectedIndexChange: [{
|
|
7993
8098
|
type: Output
|
|
8099
|
+
}], onRotate: [{
|
|
8100
|
+
type: Output
|
|
8101
|
+
}], onItemPan: [{
|
|
8102
|
+
type: Output
|
|
8103
|
+
}], onItemPanned: [{
|
|
8104
|
+
type: Output
|
|
8105
|
+
}], onPan: [{
|
|
8106
|
+
type: Output
|
|
8107
|
+
}], onPanned: [{
|
|
8108
|
+
type: Output
|
|
7994
8109
|
}], containerElem: [{
|
|
7995
8110
|
type: ViewChild,
|
|
7996
8111
|
args: ["containerElem", { static: true }]
|
|
@@ -8009,31 +8124,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
8009
8124
|
}] } });
|
|
8010
8125
|
|
|
8011
8126
|
class InteractiveCircleComponent extends InteractiveItemComponent {
|
|
8012
|
-
|
|
8013
|
-
return this.iCanvas;
|
|
8014
|
-
}
|
|
8015
|
-
get shape() {
|
|
8016
|
-
return "circle";
|
|
8017
|
-
}
|
|
8018
|
-
constructor(iCanvas) {
|
|
8127
|
+
constructor() {
|
|
8019
8128
|
super();
|
|
8020
|
-
this.
|
|
8129
|
+
this.radius = 10;
|
|
8130
|
+
}
|
|
8131
|
+
draw(ctx) {
|
|
8132
|
+
const diameter = this.radius * 2 * this.canvas.ratio;
|
|
8133
|
+
drawOval(ctx, diameter, diameter);
|
|
8134
|
+
ctx.fill();
|
|
8135
|
+
ctx.stroke();
|
|
8021
8136
|
}
|
|
8022
8137
|
calcShape(x, y) {
|
|
8023
8138
|
const ratio = this.canvas.ratio;
|
|
8024
8139
|
return new Circle(x, y, this.radius * ratio);
|
|
8025
8140
|
}
|
|
8026
|
-
|
|
8027
|
-
const radius = this.radius * this.canvas.ratio * scale;
|
|
8028
|
-
this.shapes.forEach(shape => {
|
|
8029
|
-
ctx.beginPath();
|
|
8030
|
-
ctx.arc(shape.x, shape.y, radius, 0, Math.PI * 2);
|
|
8031
|
-
ctx.closePath();
|
|
8032
|
-
ctx.fill();
|
|
8033
|
-
ctx.stroke();
|
|
8034
|
-
});
|
|
8035
|
-
}
|
|
8036
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: InteractiveCircleComponent, deps: [{ token: InteractiveCanvasComponent }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8141
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: InteractiveCircleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8037
8142
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: InteractiveCircleComponent, isStandalone: false, selector: "interactive-circle", inputs: { radius: "radius" }, providers: [
|
|
8038
8143
|
{ provide: InteractiveItemComponent, useExisting: InteractiveCircleComponent },
|
|
8039
8144
|
], usesInheritance: true, ngImport: i0, template: "", isInline: true }); }
|
|
@@ -8048,39 +8153,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
8048
8153
|
{ provide: InteractiveItemComponent, useExisting: InteractiveCircleComponent },
|
|
8049
8154
|
]
|
|
8050
8155
|
}]
|
|
8051
|
-
}], ctorParameters: () => [
|
|
8156
|
+
}], ctorParameters: () => [], propDecorators: { radius: [{
|
|
8052
8157
|
type: Input
|
|
8053
8158
|
}] } });
|
|
8054
8159
|
|
|
8055
8160
|
class InteractiveRectComponent extends InteractiveItemComponent {
|
|
8056
|
-
|
|
8057
|
-
return this.iCanvas;
|
|
8058
|
-
}
|
|
8059
|
-
get shape() {
|
|
8060
|
-
return "rect";
|
|
8061
|
-
}
|
|
8062
|
-
constructor(iCanvas) {
|
|
8161
|
+
constructor() {
|
|
8063
8162
|
super();
|
|
8064
|
-
this.
|
|
8163
|
+
this.width = 10;
|
|
8164
|
+
this.height = 10;
|
|
8165
|
+
this.rotation = 0;
|
|
8166
|
+
}
|
|
8167
|
+
draw(ctx) {
|
|
8168
|
+
const ratio = this.canvas.ratio;
|
|
8169
|
+
ctx.rotate(toRadians(this.rotation));
|
|
8170
|
+
drawRect(ctx, this.width * ratio, this.height * ratio);
|
|
8171
|
+
ctx.fill();
|
|
8172
|
+
ctx.stroke();
|
|
8065
8173
|
}
|
|
8066
8174
|
calcShape(x, y) {
|
|
8067
8175
|
const ratio = this.canvas.ratio;
|
|
8068
8176
|
return new Rect(x, y, this.width * ratio, this.height * ratio, this.rotation);
|
|
8069
8177
|
}
|
|
8070
|
-
|
|
8071
|
-
|
|
8072
|
-
const width = this.width * scale;
|
|
8073
|
-
const height = this.height * scale;
|
|
8074
|
-
this.shapes.forEach(shape => {
|
|
8075
|
-
ctx.beginPath();
|
|
8076
|
-
ctx.rect(shape.x - width / 2, shape.y - height / 2, width, height);
|
|
8077
|
-
ctx.closePath();
|
|
8078
|
-
ctx.fill();
|
|
8079
|
-
ctx.stroke();
|
|
8080
|
-
});
|
|
8081
|
-
}
|
|
8082
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: InteractiveRectComponent, deps: [{ token: InteractiveCanvasComponent }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8083
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: InteractiveRectComponent, isStandalone: false, selector: "interactive-rect", inputs: { width: "width", height: "height" }, providers: [
|
|
8178
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: InteractiveRectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8179
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: InteractiveRectComponent, isStandalone: false, selector: "interactive-rect", inputs: { width: "width", height: "height", rotation: "rotation" }, providers: [
|
|
8084
8180
|
{ provide: InteractiveItemComponent, useExisting: InteractiveRectComponent },
|
|
8085
8181
|
], usesInheritance: true, ngImport: i0, template: "", isInline: true }); }
|
|
8086
8182
|
}
|
|
@@ -8094,10 +8190,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
8094
8190
|
{ provide: InteractiveItemComponent, useExisting: InteractiveRectComponent },
|
|
8095
8191
|
]
|
|
8096
8192
|
}]
|
|
8097
|
-
}], ctorParameters: () => [
|
|
8193
|
+
}], ctorParameters: () => [], propDecorators: { width: [{
|
|
8098
8194
|
type: Input
|
|
8099
8195
|
}], height: [{
|
|
8100
8196
|
type: Input
|
|
8197
|
+
}], rotation: [{
|
|
8198
|
+
type: Input
|
|
8101
8199
|
}] } });
|
|
8102
8200
|
|
|
8103
8201
|
class TabsComponent {
|
|
@@ -8586,7 +8684,6 @@ const providers = [
|
|
|
8586
8684
|
ComponentLoaderService,
|
|
8587
8685
|
TranslatedUrlSerializer,
|
|
8588
8686
|
UniversalService,
|
|
8589
|
-
WasmService,
|
|
8590
8687
|
DeviceDetectorService,
|
|
8591
8688
|
GlobalTemplateService,
|
|
8592
8689
|
{
|
|
@@ -8617,163 +8714,6 @@ function loadConfig(config) {
|
|
|
8617
8714
|
return config.load;
|
|
8618
8715
|
}
|
|
8619
8716
|
|
|
8620
|
-
class Wasi {
|
|
8621
|
-
constructor() {
|
|
8622
|
-
this.env = {};
|
|
8623
|
-
this.instantiated = false;
|
|
8624
|
-
this.wasi = [
|
|
8625
|
-
"emscripten_notify_memory_growth",
|
|
8626
|
-
"proc_exit",
|
|
8627
|
-
"environ_get",
|
|
8628
|
-
"environ_sizes_get",
|
|
8629
|
-
"fd_close",
|
|
8630
|
-
"fd_write",
|
|
8631
|
-
"fd_read",
|
|
8632
|
-
"fd_seek",
|
|
8633
|
-
].reduce((res, key) => {
|
|
8634
|
-
if (typeof this[key] === "function") {
|
|
8635
|
-
res[key] = this[key].bind(this);
|
|
8636
|
-
}
|
|
8637
|
-
return res;
|
|
8638
|
-
}, {});
|
|
8639
|
-
}
|
|
8640
|
-
instantiate(bytes) {
|
|
8641
|
-
if (this.instantiated) {
|
|
8642
|
-
throw new Error("WASI already instantiated");
|
|
8643
|
-
}
|
|
8644
|
-
this.instantiated = true;
|
|
8645
|
-
return WebAssembly.instantiate(bytes, {
|
|
8646
|
-
wasi_snapshot_preview1: this.wasi,
|
|
8647
|
-
env: this.wasi
|
|
8648
|
-
}).then(module => {
|
|
8649
|
-
const exports = module.instance.exports;
|
|
8650
|
-
this.wasm = {
|
|
8651
|
-
...exports,
|
|
8652
|
-
writeArrayToMemory: (array) => {
|
|
8653
|
-
const bytes = array.length * array.BYTES_PER_ELEMENT;
|
|
8654
|
-
const pointer = exports.malloc(bytes);
|
|
8655
|
-
const ctr = array.constructor;
|
|
8656
|
-
const heapArray = new ctr(this.wasm.memory.buffer, pointer, array.length);
|
|
8657
|
-
heapArray.set(array);
|
|
8658
|
-
return pointer;
|
|
8659
|
-
},
|
|
8660
|
-
readArrayFromMemory: (pointer, array) => {
|
|
8661
|
-
const ctr = array.constructor;
|
|
8662
|
-
const heapArray = new ctr(this.wasm.memory.buffer, pointer, array.length);
|
|
8663
|
-
array.set(heapArray);
|
|
8664
|
-
return array;
|
|
8665
|
-
}
|
|
8666
|
-
};
|
|
8667
|
-
this.updateMemoryViews();
|
|
8668
|
-
return this.wasm;
|
|
8669
|
-
});
|
|
8670
|
-
}
|
|
8671
|
-
updateMemoryViews() {
|
|
8672
|
-
const buffer = this.wasm.memory.buffer;
|
|
8673
|
-
this.wasm.HEAP8 = new Int8Array(buffer);
|
|
8674
|
-
this.wasm.HEAP16 = new Int16Array(buffer);
|
|
8675
|
-
this.wasm.HEAP32 = new Int32Array(buffer);
|
|
8676
|
-
this.wasm.HEAPU8 = new Uint8Array(buffer);
|
|
8677
|
-
this.wasm.HEAPU16 = new Uint16Array(buffer);
|
|
8678
|
-
this.wasm.HEAPU32 = new Uint32Array(buffer);
|
|
8679
|
-
this.wasm.HEAPF32 = new Float32Array(buffer);
|
|
8680
|
-
this.wasm.HEAPF64 = new Float64Array(buffer);
|
|
8681
|
-
}
|
|
8682
|
-
getEnvStrings() {
|
|
8683
|
-
if (!this.envStrings) {
|
|
8684
|
-
let x;
|
|
8685
|
-
const env = {};
|
|
8686
|
-
for (x in this.env) {
|
|
8687
|
-
if (this.env[x] === undefined)
|
|
8688
|
-
delete env[x];
|
|
8689
|
-
else
|
|
8690
|
-
env[x] = this.env[x];
|
|
8691
|
-
}
|
|
8692
|
-
const strings = [];
|
|
8693
|
-
for (x in env) {
|
|
8694
|
-
strings.push(x + "=" + env[x]);
|
|
8695
|
-
}
|
|
8696
|
-
this.envStrings = strings;
|
|
8697
|
-
}
|
|
8698
|
-
return this.envStrings;
|
|
8699
|
-
}
|
|
8700
|
-
stringToAscii(str, buffer) {
|
|
8701
|
-
const HEAP8 = this.wasm.HEAP8;
|
|
8702
|
-
for (let i = 0; i < str.length; ++i) {
|
|
8703
|
-
HEAP8[buffer++ >> 0] = str.charCodeAt(i);
|
|
8704
|
-
}
|
|
8705
|
-
HEAP8[buffer >> 0] = 0;
|
|
8706
|
-
}
|
|
8707
|
-
emscripten_notify_memory_growth(memoryIndex) {
|
|
8708
|
-
this.updateMemoryViews();
|
|
8709
|
-
}
|
|
8710
|
-
proc_exit(rval) {
|
|
8711
|
-
console.log("proc_exit", rval);
|
|
8712
|
-
}
|
|
8713
|
-
environ_get(environ, environ_buf) {
|
|
8714
|
-
if (!this.wasm.HEAP8.byteLength) {
|
|
8715
|
-
this.emscripten_notify_memory_growth(0);
|
|
8716
|
-
}
|
|
8717
|
-
const HEAPU32 = this.wasm.HEAPU32;
|
|
8718
|
-
let bufSize = 0;
|
|
8719
|
-
this.getEnvStrings().forEach((str, i) => {
|
|
8720
|
-
const ptr = environ_buf + bufSize;
|
|
8721
|
-
HEAPU32[environ + i * 4 >> 2] = ptr;
|
|
8722
|
-
this.stringToAscii(str, ptr);
|
|
8723
|
-
bufSize += str.length + 1;
|
|
8724
|
-
});
|
|
8725
|
-
return 0;
|
|
8726
|
-
}
|
|
8727
|
-
environ_sizes_get(penviron_count, penviron_buf_size) {
|
|
8728
|
-
if (!this.wasm.HEAP8.byteLength) {
|
|
8729
|
-
this.emscripten_notify_memory_growth(0);
|
|
8730
|
-
}
|
|
8731
|
-
const HEAPU32 = this.wasm.HEAPU32;
|
|
8732
|
-
const strings = this.getEnvStrings();
|
|
8733
|
-
HEAPU32[penviron_count >> 2] = strings.length;
|
|
8734
|
-
let bufSize = 0;
|
|
8735
|
-
strings.forEach(function (string) {
|
|
8736
|
-
bufSize += string.length + 1;
|
|
8737
|
-
});
|
|
8738
|
-
HEAPU32[penviron_buf_size >> 2] = bufSize;
|
|
8739
|
-
// WASI_ESUCCESS
|
|
8740
|
-
return 0;
|
|
8741
|
-
}
|
|
8742
|
-
fd_close(fd) {
|
|
8743
|
-
// WASI_ESUCCESS
|
|
8744
|
-
return 0;
|
|
8745
|
-
}
|
|
8746
|
-
fd_write(fd, iovs, iovs_len, nwritten) {
|
|
8747
|
-
if (fd !== 1) {
|
|
8748
|
-
// WASI_EBADF
|
|
8749
|
-
return 8;
|
|
8750
|
-
}
|
|
8751
|
-
if (iovs_len !== 1) {
|
|
8752
|
-
// WASI_ENOSYS
|
|
8753
|
-
return 52;
|
|
8754
|
-
}
|
|
8755
|
-
this.wasm.HEAPU32[nwritten >> 2] = this.wasm.HEAPU32[iovs + 4 >> 2];
|
|
8756
|
-
// WASI_ESUCCESS
|
|
8757
|
-
return 0;
|
|
8758
|
-
}
|
|
8759
|
-
fd_read(fd, iovs, iovs_len, nread) {
|
|
8760
|
-
// WASI_EINVAL
|
|
8761
|
-
return 28;
|
|
8762
|
-
}
|
|
8763
|
-
fd_seek(fd, offset, whence, newOffset) {
|
|
8764
|
-
// WASI_EINVAL
|
|
8765
|
-
return 28;
|
|
8766
|
-
}
|
|
8767
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: Wasi, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
8768
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: Wasi, providedIn: "root" }); }
|
|
8769
|
-
}
|
|
8770
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: Wasi, decorators: [{
|
|
8771
|
-
type: Injectable,
|
|
8772
|
-
args: [{
|
|
8773
|
-
providedIn: "root"
|
|
8774
|
-
}]
|
|
8775
|
-
}], ctorParameters: () => [] });
|
|
8776
|
-
|
|
8777
8717
|
function loadBaseUrl() {
|
|
8778
8718
|
if (typeof (document) === "undefined" || typeof (location) === "undefined")
|
|
8779
8719
|
return "/";
|
|
@@ -8853,10 +8793,6 @@ class NgxUtilsModule {
|
|
|
8853
8793
|
provide: DIALOG_SERVICE,
|
|
8854
8794
|
useExisting: (!config ? null : config.dialogService) || BaseDialogService
|
|
8855
8795
|
},
|
|
8856
|
-
{
|
|
8857
|
-
provide: WASI_IMPLEMENTATION,
|
|
8858
|
-
useExisting: (!config ? null : config.wasiImplementation) || Wasi
|
|
8859
|
-
},
|
|
8860
8796
|
{
|
|
8861
8797
|
provide: ICON_TYPE,
|
|
8862
8798
|
useValue: (!config ? null : config.iconType) || IconDefaultComponent,
|
|
@@ -8894,17 +8830,18 @@ class NgxUtilsModule {
|
|
|
8894
8830
|
provide: STATIC_SCHEMAS,
|
|
8895
8831
|
useValue: (!config ? null : config.staticSchemas) ?? {},
|
|
8896
8832
|
},
|
|
8897
|
-
{
|
|
8898
|
-
provide: APP_INITIALIZER,
|
|
8899
|
-
useFactory: (!config ? null : config.initializeApp) || loadConfig,
|
|
8900
|
-
multi: true,
|
|
8901
|
-
deps: [(!config ? null : config.initializeApp) ? Injector : CONFIG_SERVICE]
|
|
8902
|
-
},
|
|
8903
8833
|
{
|
|
8904
8834
|
provide: APP_BASE_HREF,
|
|
8905
8835
|
useFactory: loadBaseHref,
|
|
8906
8836
|
deps: [APP_BASE_URL]
|
|
8907
|
-
}
|
|
8837
|
+
},
|
|
8838
|
+
provideAppInitializer(() => {
|
|
8839
|
+
if (config && config.initializeApp) {
|
|
8840
|
+
const initializer = config.initializeApp(inject(Injector));
|
|
8841
|
+
return initializer();
|
|
8842
|
+
}
|
|
8843
|
+
return loadConfig(inject(CONFIG_SERVICE));
|
|
8844
|
+
}),
|
|
8908
8845
|
];
|
|
8909
8846
|
}
|
|
8910
8847
|
static forRoot(config) {
|
|
@@ -8976,5 +8913,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
8976
8913
|
* Generated bundle index. Do not edit.
|
|
8977
8914
|
*/
|
|
8978
8915
|
|
|
8979
|
-
export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AsyncMethodTargetDirective, AuthGuard, BASE_CONFIG, BUTTON_TYPE, BackgroundDirective, BaseDialogService, BaseHttpClient, BaseHttpService, BaseToasterService, BtnComponent, BtnDefaultComponent, CONFIG_SERVICE, CacheService, CanvasColor, CanvasUtils, ChipsComponent, ChunkPipe, Circle, CloseBtnComponent, ComponentLoaderDirective, ComponentLoaderService, ConfigService, DIALOG_SERVICE, DateUtils, DragDropEventPlugin, DropListComponent, DropdownBoxComponent, DropdownContentDirective, DropdownDirective, DropdownToggleDirective, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FakeModuleComponent, FileSystemEntry, FileUtils, FilterPipe, FindPipe, ForbiddenZone, FormatNumberPipe, FormatterService, GenericValue, GetOffsetPipe, GetTypePipe, GetValuePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, ICON_MAP, ICON_SERVICE, ICON_TYPE, IConfiguration, IconComponent, IconDefaultComponent, IconDirective, IconService, IncludesPipe, Initializer, InteractiveCanvasComponent, InteractiveCircleComponent, InteractiveItemComponent, InteractiveRectComponent, IsTypePipe, JSONfn, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, OPTIONS_TOKEN, ObjectType, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, RESIZE_DELAY, RESIZE_STRATEGY, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, STATIC_SCHEMAS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SocketClient, SocketService, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TabsComponent, TabsItemDirective, TabsTemplateDirective, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UploadComponent, ValuedPromise, ValuesPipe,
|
|
8916
|
+
export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AsyncMethodTargetDirective, AuthGuard, BASE_CONFIG, BUTTON_TYPE, BackgroundDirective, BaseDialogService, BaseHttpClient, BaseHttpService, BaseToasterService, BtnComponent, BtnDefaultComponent, CONFIG_SERVICE, CacheService, CanvasColor, CanvasUtils, ChipsComponent, ChunkPipe, Circle, CloseBtnComponent, ComponentLoaderDirective, ComponentLoaderService, ConfigService, DIALOG_SERVICE, DateUtils, DragDropEventPlugin, DropListComponent, DropdownBoxComponent, DropdownContentDirective, DropdownDirective, DropdownToggleDirective, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FakeModuleComponent, FileSystemEntry, FileUtils, FilterPipe, FindPipe, ForbiddenZone, FormatNumberPipe, FormatterService, GenericValue, GetOffsetPipe, GetTypePipe, GetValuePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, ICON_MAP, ICON_SERVICE, ICON_TYPE, IConfiguration, IconComponent, IconDefaultComponent, IconDirective, IconService, IncludesPipe, Initializer, InteractiveCanvasComponent, InteractiveCircleComponent, InteractiveItemComponent, InteractiveRectComponent, IsTypePipe, JSONfn, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, OPTIONS_TOKEN, ObjectType, ObjectUtils, ObservableUtils, OpenApiService, Oval, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, RESIZE_DELAY, RESIZE_STRATEGY, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, STATIC_SCHEMAS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SocketClient, SocketService, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TabsComponent, TabsItemDirective, TabsTemplateDirective, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UploadComponent, ValuedPromise, ValuesPipe, cachedFactory, cancelablePromise, checkTransitions, computedPrevious, createTypedProvider, cssStyles, cssVariables, dotProduct, drawOval, drawRect, getComponentDef, getCssVariables, getRoot, hashCode, impatientPromise, isBrowser, isPoint, parseSelector, perpendicular, provideEntryComponents, provideWithOptions, ptAdd, ptDistance, ptLength, ptMultiply, ptSubtract, rotateDeg, rotateRad, selectorMatchesList, switchClass, toDegrees, toRadians };
|
|
8980
8917
|
//# sourceMappingURL=stemy-ngx-utils.mjs.map
|