@vallift/ngl 0.0.9 → 0.0.11
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/components/button/button.component.d.ts +1 -1
- package/components/color-picker/color-converter.service.d.ts +26 -0
- package/components/color-picker/color-picker-slider.directive.d.ts +23 -0
- package/components/color-picker/color-picker.component.d.ts +58 -0
- package/components/color-picker/color-picker.directive.d.ts +18 -0
- package/components/color-picker/enums/formats.d.ts +6 -0
- package/components/color-picker/utils/formats.d.ts +53 -0
- package/components/color-picker/utils/slider.d.ts +14 -0
- package/components/shimmer/shimmer.component.d.ts +1 -1
- package/fesm2022/vallift-ngl.mjs +876 -11
- package/fesm2022/vallift-ngl.mjs.map +1 -1
- package/inputs/_base/base-input/base-input.component.d.ts +1 -1
- package/inputs/text-area-input/text-area-input.component.d.ts +2 -2
- package/inputs/text-input/text-input.component.d.ts +6 -4
- package/package.json +1 -1
- package/public-api.d.ts +4 -0
package/fesm2022/vallift-ngl.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, Injectable, signal, input, output, Component, Input, ElementRef, Renderer2, EventEmitter, Output, RendererFactory2, HostListener, Directive, computed, ViewChild, Inject, Pipe,
|
|
2
|
+
import { InjectionToken, inject, Injectable, signal, input, output, Component, Input, ElementRef, Renderer2, EventEmitter, Output, RendererFactory2, HostListener, Directive, computed, ChangeDetectorRef, model, ViewChild, ViewContainerRef, ComponentFactoryResolver, ApplicationRef, Injector, Inject, Pipe, ContentChildren, ChangeDetectionStrategy, viewChild } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/common/http';
|
|
4
4
|
import { HttpClient, HttpHeaders, HttpRequest } from '@angular/common/http';
|
|
5
5
|
import { retry, throwError, Subject, debounceTime, fromEvent, filter as filter$1, take, of } from 'rxjs';
|
|
@@ -10,7 +10,7 @@ import { Router, NavigationStart, NavigationEnd } from '@angular/router';
|
|
|
10
10
|
import { DialogRef, DIALOG_DATA, Dialog } from '@angular/cdk/dialog';
|
|
11
11
|
import { Overlay, OverlayConfig, CdkConnectedOverlay } from '@angular/cdk/overlay';
|
|
12
12
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
|
13
|
-
import { NgClass, DOCUMENT, CommonModule, DatePipe
|
|
13
|
+
import { NgClass, DOCUMENT, NgStyle, CommonModule, DatePipe } from '@angular/common';
|
|
14
14
|
import { SvgIconComponent } from 'angular-svg-icon';
|
|
15
15
|
import { CdkPortal } from '@angular/cdk/portal';
|
|
16
16
|
import { NgxMaskDirective } from 'ngx-mask';
|
|
@@ -1593,11 +1593,868 @@ class CloseButtonComponent {
|
|
|
1593
1593
|
}
|
|
1594
1594
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: CloseButtonComponent, decorators: [{
|
|
1595
1595
|
type: Component,
|
|
1596
|
-
args: [{ selector: 'app-close-button', standalone: true, imports: [
|
|
1597
|
-
AppSvgIconComponent
|
|
1598
|
-
], template: "<p class=\"rounded-lg p-3 border border-neutral-300 cursor-pointer hover:bg-neutral-50\">\n <svg class=\"w-12 h-12 text-neutral-800\" xmlns=\"http://www.w3.org/2000/svg\" id=\"mdi-window-close\" viewBox=\"0 0 24 24\">\n <path\n fill=\"currentColor\"\n d=\"M13.46,12L19,17.54V19H17.54L12,13.46L6.46,19H5V17.54L10.54,12L5,6.46V5H6.46L12,10.54L17.54,5H19V6.46L13.46,12Z\"/>\n </svg>\n\n</p>\n" }]
|
|
1596
|
+
args: [{ selector: 'app-close-button', standalone: true, imports: [], template: "<p class=\"rounded-lg p-3 border border-neutral-300 cursor-pointer hover:bg-neutral-50\">\n <svg class=\"w-12 h-12 text-neutral-800\" xmlns=\"http://www.w3.org/2000/svg\" id=\"mdi-window-close\" viewBox=\"0 0 24 24\">\n <path\n fill=\"currentColor\"\n d=\"M13.46,12L19,17.54V19H17.54L12,13.46L6.46,19H5V17.54L10.54,12L5,6.46V5H6.46L12,10.54L17.54,5H19V6.46L13.46,12Z\"/>\n </svg>\n\n</p>\n" }]
|
|
1599
1597
|
}] });
|
|
1600
1598
|
|
|
1599
|
+
class Rgba {
|
|
1600
|
+
r;
|
|
1601
|
+
g;
|
|
1602
|
+
b;
|
|
1603
|
+
a;
|
|
1604
|
+
constructor(r, g, b, a) {
|
|
1605
|
+
this.r = r;
|
|
1606
|
+
this.g = g;
|
|
1607
|
+
this.b = b;
|
|
1608
|
+
this.a = a;
|
|
1609
|
+
}
|
|
1610
|
+
denormalize() {
|
|
1611
|
+
this.r = Math.round(this.r * 255);
|
|
1612
|
+
this.g = Math.round(this.g * 255);
|
|
1613
|
+
this.b = Math.round(this.b * 255);
|
|
1614
|
+
return this;
|
|
1615
|
+
}
|
|
1616
|
+
toString() {
|
|
1617
|
+
this.denormalize();
|
|
1618
|
+
let output = 'rgb' +
|
|
1619
|
+
(this.a != 1 ? 'a(' : '(') +
|
|
1620
|
+
this.r + ', ' +
|
|
1621
|
+
this.g + ', ' +
|
|
1622
|
+
this.b +
|
|
1623
|
+
(this.a != 1 ? ', ' + this.a.toPrecision(2) + ')' : ')');
|
|
1624
|
+
return output;
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
class Hsva {
|
|
1628
|
+
h;
|
|
1629
|
+
s;
|
|
1630
|
+
v;
|
|
1631
|
+
a;
|
|
1632
|
+
onChange = new EventEmitter(true);
|
|
1633
|
+
constructor(h, s, v, a) {
|
|
1634
|
+
this.h = h;
|
|
1635
|
+
this.s = s;
|
|
1636
|
+
this.v = v;
|
|
1637
|
+
this.a = a;
|
|
1638
|
+
}
|
|
1639
|
+
onColorChange(value) {
|
|
1640
|
+
this.s = value.s / value.rgX;
|
|
1641
|
+
this.v = value.v / value.rgY;
|
|
1642
|
+
}
|
|
1643
|
+
onHueChange(value) {
|
|
1644
|
+
this.h = value.v / value.rgX;
|
|
1645
|
+
// this.sliderH = this.hsva.h;
|
|
1646
|
+
}
|
|
1647
|
+
onValueChange(value) {
|
|
1648
|
+
this.v = value.v / value.rgX;
|
|
1649
|
+
}
|
|
1650
|
+
onAlphaChange(value) {
|
|
1651
|
+
this.a = value.v / value.rgX;
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
class Hsla {
|
|
1655
|
+
h;
|
|
1656
|
+
s;
|
|
1657
|
+
l;
|
|
1658
|
+
a;
|
|
1659
|
+
constructor(h, s, l, a) {
|
|
1660
|
+
this.h = h;
|
|
1661
|
+
this.s = s;
|
|
1662
|
+
this.l = l;
|
|
1663
|
+
this.a = a;
|
|
1664
|
+
}
|
|
1665
|
+
denormalize() {
|
|
1666
|
+
this.h = Math.round(this.h * 360);
|
|
1667
|
+
this.s = Math.round(this.s * 100);
|
|
1668
|
+
this.l = Math.round(this.l * 100);
|
|
1669
|
+
return this;
|
|
1670
|
+
}
|
|
1671
|
+
toString() {
|
|
1672
|
+
let output = 'hsl' +
|
|
1673
|
+
(this.a != 1 ? 'a(' : '(') +
|
|
1674
|
+
this.h + ', ' +
|
|
1675
|
+
this.s + '%, ' +
|
|
1676
|
+
this.l + '%' +
|
|
1677
|
+
(this.a != 1 ? ', ' + this.a.toPrecision(2) + ')' : ')');
|
|
1678
|
+
return output;
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
class Cmyk {
|
|
1682
|
+
c;
|
|
1683
|
+
m;
|
|
1684
|
+
y;
|
|
1685
|
+
k;
|
|
1686
|
+
a;
|
|
1687
|
+
constructor(c, m, y, k, a = 1) {
|
|
1688
|
+
this.c = c;
|
|
1689
|
+
this.m = m;
|
|
1690
|
+
this.y = y;
|
|
1691
|
+
this.k = k;
|
|
1692
|
+
this.a = a;
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
var ColorFormats;
|
|
1697
|
+
(function (ColorFormats) {
|
|
1698
|
+
ColorFormats[ColorFormats["HEX"] = 0] = "HEX";
|
|
1699
|
+
ColorFormats[ColorFormats["RGBA"] = 1] = "RGBA";
|
|
1700
|
+
ColorFormats[ColorFormats["HSLA"] = 2] = "HSLA";
|
|
1701
|
+
ColorFormats[ColorFormats["CMYK"] = 3] = "CMYK";
|
|
1702
|
+
})(ColorFormats || (ColorFormats = {}));
|
|
1703
|
+
|
|
1704
|
+
class ColorConverterService {
|
|
1705
|
+
// private active: ColorPickerComponent | null = null;
|
|
1706
|
+
constructor() { }
|
|
1707
|
+
// public setActive(active: ColorPickerComponent | null): void {
|
|
1708
|
+
// this.active = active;
|
|
1709
|
+
// }
|
|
1710
|
+
toFormat(hsva, format) {
|
|
1711
|
+
var output = "";
|
|
1712
|
+
if (hsva) {
|
|
1713
|
+
switch (format) {
|
|
1714
|
+
case ColorFormats.HEX:
|
|
1715
|
+
var rgba = this.hsvaToRgba(hsva);
|
|
1716
|
+
rgba.denormalize();
|
|
1717
|
+
var output = this.rgbaToHex(rgba, true);
|
|
1718
|
+
break;
|
|
1719
|
+
case ColorFormats.HSLA:
|
|
1720
|
+
var hsla = this.hsva2hsla(hsva);
|
|
1721
|
+
hsla.denormalize();
|
|
1722
|
+
var output = hsla.toString();
|
|
1723
|
+
break;
|
|
1724
|
+
case ColorFormats.RGBA:
|
|
1725
|
+
var rgba = this.hsvaToRgba(hsva);
|
|
1726
|
+
var output = rgba.toString();
|
|
1727
|
+
break;
|
|
1728
|
+
case ColorFormats.CMYK:
|
|
1729
|
+
var rgba = this.hsvaToRgba(hsva);
|
|
1730
|
+
var cmyk = this.rgbaToCmyk(rgba);
|
|
1731
|
+
break;
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
return output;
|
|
1735
|
+
}
|
|
1736
|
+
stringToFormat(color, format) {
|
|
1737
|
+
var hsva = this.stringToHsva(color, true);
|
|
1738
|
+
return this.toFormat(hsva, format);
|
|
1739
|
+
}
|
|
1740
|
+
hsva2hsla(hsva) {
|
|
1741
|
+
const h = hsva.h, s = hsva.s, v = hsva.v, a = hsva.a;
|
|
1742
|
+
if (v === 0) {
|
|
1743
|
+
return new Hsla(h, 0, 0, a);
|
|
1744
|
+
}
|
|
1745
|
+
else if (s === 0 && v === 1) {
|
|
1746
|
+
return new Hsla(h, 1, 1, a);
|
|
1747
|
+
}
|
|
1748
|
+
else {
|
|
1749
|
+
const l = (v * (2 - s)) / 2;
|
|
1750
|
+
return new Hsla(h, (v * s) / (1 - Math.abs(2 * l - 1)), l, a);
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
hsla2hsva(hsla) {
|
|
1754
|
+
const h = Math.min(hsla.h, 1), s = Math.min(hsla.s, 1);
|
|
1755
|
+
const l = Math.min(hsla.l, 1), a = Math.min(hsla.a, 1);
|
|
1756
|
+
if (l === 0) {
|
|
1757
|
+
return new Hsva(h, 0, 0, a);
|
|
1758
|
+
}
|
|
1759
|
+
else {
|
|
1760
|
+
const v = l + (s * (1 - Math.abs(2 * l - 1))) / 2;
|
|
1761
|
+
return new Hsva(h, (2 * (v - l)) / v, v, a);
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
hsvaToRgba(hsva) {
|
|
1765
|
+
let r, g, b;
|
|
1766
|
+
const h = hsva.h, s = hsva.s, v = hsva.v, a = hsva.a;
|
|
1767
|
+
const i = Math.floor(h * 6);
|
|
1768
|
+
const f = h * 6 - i;
|
|
1769
|
+
const p = v * (1 - s);
|
|
1770
|
+
const q = v * (1 - f * s);
|
|
1771
|
+
const t = v * (1 - (1 - f) * s);
|
|
1772
|
+
switch (i % 6) {
|
|
1773
|
+
case 0:
|
|
1774
|
+
(r = v), (g = t), (b = p);
|
|
1775
|
+
break;
|
|
1776
|
+
case 1:
|
|
1777
|
+
(r = q), (g = v), (b = p);
|
|
1778
|
+
break;
|
|
1779
|
+
case 2:
|
|
1780
|
+
(r = p), (g = v), (b = t);
|
|
1781
|
+
break;
|
|
1782
|
+
case 3:
|
|
1783
|
+
(r = p), (g = q), (b = v);
|
|
1784
|
+
break;
|
|
1785
|
+
case 4:
|
|
1786
|
+
(r = t), (g = p), (b = v);
|
|
1787
|
+
break;
|
|
1788
|
+
case 5:
|
|
1789
|
+
(r = v), (g = p), (b = q);
|
|
1790
|
+
break;
|
|
1791
|
+
default:
|
|
1792
|
+
(r = 0), (g = 0), (b = 0);
|
|
1793
|
+
}
|
|
1794
|
+
return new Rgba(r, g, b, a);
|
|
1795
|
+
}
|
|
1796
|
+
cmykToRgb(cmyk) {
|
|
1797
|
+
const r = (1 - cmyk.c) * (1 - cmyk.k);
|
|
1798
|
+
const g = (1 - cmyk.m) * (1 - cmyk.k);
|
|
1799
|
+
const b = (1 - cmyk.y) * (1 - cmyk.k);
|
|
1800
|
+
return new Rgba(r, g, b, cmyk.a);
|
|
1801
|
+
}
|
|
1802
|
+
rgbaToCmyk(rgba) {
|
|
1803
|
+
const k = 1 - Math.max(rgba.r, rgba.g, rgba.b);
|
|
1804
|
+
if (k === 1) {
|
|
1805
|
+
return new Cmyk(0, 0, 0, 1, rgba.a);
|
|
1806
|
+
}
|
|
1807
|
+
else {
|
|
1808
|
+
const c = (1 - rgba.r - k) / (1 - k);
|
|
1809
|
+
const m = (1 - rgba.g - k) / (1 - k);
|
|
1810
|
+
const y = (1 - rgba.b - k) / (1 - k);
|
|
1811
|
+
return new Cmyk(c, m, y, k, rgba.a);
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
rgbaToHsva(rgba) {
|
|
1815
|
+
let h, s;
|
|
1816
|
+
const r = Math.min(rgba.r, 1), g = Math.min(rgba.g, 1);
|
|
1817
|
+
const b = Math.min(rgba.b, 1), a = Math.min(rgba.a, 1);
|
|
1818
|
+
const max = Math.max(r, g, b), min = Math.min(r, g, b);
|
|
1819
|
+
const v = max, d = max - min;
|
|
1820
|
+
s = max === 0 ? 0 : d / max;
|
|
1821
|
+
if (max === min) {
|
|
1822
|
+
h = 0;
|
|
1823
|
+
}
|
|
1824
|
+
else {
|
|
1825
|
+
switch (max) {
|
|
1826
|
+
case r:
|
|
1827
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
1828
|
+
break;
|
|
1829
|
+
case g:
|
|
1830
|
+
h = (b - r) / d + 2;
|
|
1831
|
+
break;
|
|
1832
|
+
case b:
|
|
1833
|
+
h = (r - g) / d + 4;
|
|
1834
|
+
break;
|
|
1835
|
+
default:
|
|
1836
|
+
h = 0;
|
|
1837
|
+
}
|
|
1838
|
+
h /= 6;
|
|
1839
|
+
}
|
|
1840
|
+
return new Hsva(h, s, v, a);
|
|
1841
|
+
}
|
|
1842
|
+
rgbaToHex(rgba, allowHex8) {
|
|
1843
|
+
/* tslint:disable:no-bitwise */
|
|
1844
|
+
let hex = "#" +
|
|
1845
|
+
((1 << 24) | (rgba.r << 16) | (rgba.g << 8) | rgba.b)
|
|
1846
|
+
.toString(16)
|
|
1847
|
+
.substr(1);
|
|
1848
|
+
if (rgba.a != 1) {
|
|
1849
|
+
hex += ((1 << 8) | Math.round(rgba.a * 255)).toString(16).substr(1);
|
|
1850
|
+
}
|
|
1851
|
+
/* tslint:enable:no-bitwise */
|
|
1852
|
+
return hex;
|
|
1853
|
+
}
|
|
1854
|
+
normalizeCMYK(cmyk) {
|
|
1855
|
+
return new Cmyk(cmyk.c / 100, cmyk.m / 100, cmyk.y / 100, cmyk.k / 100, cmyk.a);
|
|
1856
|
+
}
|
|
1857
|
+
denormalizeCMYK(cmyk) {
|
|
1858
|
+
return new Cmyk(Math.floor(cmyk.c * 100), Math.floor(cmyk.m * 100), Math.floor(cmyk.y * 100), Math.floor(cmyk.k * 100), cmyk.a);
|
|
1859
|
+
}
|
|
1860
|
+
denormalizeRGBA(rgba) {
|
|
1861
|
+
return new Rgba(Math.round(rgba.r * 255), Math.round(rgba.g * 255), Math.round(rgba.b * 255), rgba.a);
|
|
1862
|
+
}
|
|
1863
|
+
stringToHsva(colorString = "", allowHex8 = true) {
|
|
1864
|
+
let hsva = null;
|
|
1865
|
+
colorString = (colorString || "").toLowerCase();
|
|
1866
|
+
const stringParsers = [
|
|
1867
|
+
{
|
|
1868
|
+
re: /(rgb)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*%?,\s*(\d{1,3})\s*%?(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
|
|
1869
|
+
parse: function (execResult) {
|
|
1870
|
+
return new Rgba(parseInt(execResult[2], 10) / 255, parseInt(execResult[3], 10) / 255, parseInt(execResult[4], 10) / 255, isNaN(parseFloat(execResult[5])) ? 1 : parseFloat(execResult[5]));
|
|
1871
|
+
},
|
|
1872
|
+
},
|
|
1873
|
+
{
|
|
1874
|
+
re: /(hsl)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
|
|
1875
|
+
parse: function (execResult) {
|
|
1876
|
+
return new Hsla(parseInt(execResult[2], 10) / 360, parseInt(execResult[3], 10) / 100, parseInt(execResult[4], 10) / 100, isNaN(parseFloat(execResult[5])) ? 1 : parseFloat(execResult[5]));
|
|
1877
|
+
},
|
|
1878
|
+
},
|
|
1879
|
+
];
|
|
1880
|
+
if (allowHex8) {
|
|
1881
|
+
stringParsers.push({
|
|
1882
|
+
re: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})?$/,
|
|
1883
|
+
parse: function (execResult) {
|
|
1884
|
+
return new Rgba(parseInt(execResult[1], 16) / 255, parseInt(execResult[2], 16) / 255, parseInt(execResult[3], 16) / 255, parseInt(execResult[4] || "FF", 16) / 255);
|
|
1885
|
+
},
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1888
|
+
else {
|
|
1889
|
+
stringParsers.push({
|
|
1890
|
+
re: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,
|
|
1891
|
+
parse: function (execResult) {
|
|
1892
|
+
return new Rgba(parseInt(execResult[1], 16) / 255, parseInt(execResult[2], 16) / 255, parseInt(execResult[3], 16) / 255, 1);
|
|
1893
|
+
},
|
|
1894
|
+
});
|
|
1895
|
+
}
|
|
1896
|
+
stringParsers.push({
|
|
1897
|
+
re: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/,
|
|
1898
|
+
parse: function (execResult) {
|
|
1899
|
+
return new Rgba(parseInt(execResult[1] + execResult[1], 16) / 255, parseInt(execResult[2] + execResult[2], 16) / 255, parseInt(execResult[3] + execResult[3], 16) / 255, 1);
|
|
1900
|
+
},
|
|
1901
|
+
});
|
|
1902
|
+
for (const key in stringParsers) {
|
|
1903
|
+
if (stringParsers.hasOwnProperty(key)) {
|
|
1904
|
+
const parser = stringParsers[key];
|
|
1905
|
+
const match = parser.re.exec(colorString), color = match && parser.parse(match);
|
|
1906
|
+
if (color) {
|
|
1907
|
+
if (color instanceof Rgba) {
|
|
1908
|
+
hsva = this.rgbaToHsva(color);
|
|
1909
|
+
}
|
|
1910
|
+
else if (color instanceof Hsla) {
|
|
1911
|
+
hsva = this.hsla2hsva(color);
|
|
1912
|
+
}
|
|
1913
|
+
return hsva;
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
return hsva;
|
|
1918
|
+
}
|
|
1919
|
+
outputFormat(hsva) {
|
|
1920
|
+
return this.hsvaToRgba(hsva).toString();
|
|
1921
|
+
}
|
|
1922
|
+
getFormatByString(color) {
|
|
1923
|
+
if (color) {
|
|
1924
|
+
color = color.toLowerCase();
|
|
1925
|
+
let regexHex = /(#([\da-f]{3}(?:[\da-f]{3})?(?:[\da-f]{2})?))/;
|
|
1926
|
+
let regexRGBA = /(rgba\((\d{1,3},\s?){3}(1|0?\.\d+)\)|rgb\(\d{1,3}(,\s?\d{1,3}){2}\))/;
|
|
1927
|
+
let regexHSLA = /(hsla\((\d{1,3}%?,\s?){3}(1|0?\.\d+)\)|hsl\(\d{1,3}%?(,\s?\d{1,3}%?){2}\))/;
|
|
1928
|
+
if (regexHex.test(color)) {
|
|
1929
|
+
return "hex";
|
|
1930
|
+
}
|
|
1931
|
+
else if (regexRGBA.test(color)) {
|
|
1932
|
+
return "rgba";
|
|
1933
|
+
}
|
|
1934
|
+
else if (regexHSLA.test(color)) {
|
|
1935
|
+
return "hsla";
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
return "hex";
|
|
1939
|
+
}
|
|
1940
|
+
isValidHexColor(hex) {
|
|
1941
|
+
if (!hex) {
|
|
1942
|
+
return false;
|
|
1943
|
+
}
|
|
1944
|
+
const hexColorPattern = /^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/;
|
|
1945
|
+
return hexColorPattern.test(hex);
|
|
1946
|
+
}
|
|
1947
|
+
addHexPrefixIfMissing(hex) {
|
|
1948
|
+
if (!hex.startsWith('#')) {
|
|
1949
|
+
return '#' + hex;
|
|
1950
|
+
}
|
|
1951
|
+
return hex;
|
|
1952
|
+
}
|
|
1953
|
+
removeAlpha(hex) {
|
|
1954
|
+
const cleanHex = hex.startsWith('#') ? hex.slice(1) : hex;
|
|
1955
|
+
const rgbHex = cleanHex.length === 8 ? cleanHex.slice(0, 6) : cleanHex;
|
|
1956
|
+
return `#${rgbHex.toUpperCase()}`;
|
|
1957
|
+
}
|
|
1958
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ColorConverterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1959
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ColorConverterService, providedIn: 'root' });
|
|
1960
|
+
}
|
|
1961
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ColorConverterService, decorators: [{
|
|
1962
|
+
type: Injectable,
|
|
1963
|
+
args: [{
|
|
1964
|
+
providedIn: 'root'
|
|
1965
|
+
}]
|
|
1966
|
+
}], ctorParameters: () => [] });
|
|
1967
|
+
|
|
1968
|
+
class SliderPosition {
|
|
1969
|
+
h;
|
|
1970
|
+
s;
|
|
1971
|
+
v;
|
|
1972
|
+
a;
|
|
1973
|
+
constructor(h, s, v, a) {
|
|
1974
|
+
this.h = h;
|
|
1975
|
+
this.s = s;
|
|
1976
|
+
this.v = v;
|
|
1977
|
+
this.a = a;
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
class SliderDimension {
|
|
1981
|
+
h;
|
|
1982
|
+
s;
|
|
1983
|
+
v;
|
|
1984
|
+
a;
|
|
1985
|
+
constructor(h, s, v, a) {
|
|
1986
|
+
this.h = h;
|
|
1987
|
+
this.s = s;
|
|
1988
|
+
this.v = v;
|
|
1989
|
+
this.a = a;
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
class ColorPickerSliderDirective {
|
|
1994
|
+
listenerMove;
|
|
1995
|
+
listenerStop;
|
|
1996
|
+
rgX;
|
|
1997
|
+
rgY;
|
|
1998
|
+
dragEnd = new EventEmitter();
|
|
1999
|
+
dragStart = new EventEmitter();
|
|
2000
|
+
valueChanged = new EventEmitter();
|
|
2001
|
+
elementRef = inject(ElementRef);
|
|
2002
|
+
mouseDown(event) {
|
|
2003
|
+
this.start(event);
|
|
2004
|
+
}
|
|
2005
|
+
touchStart(event) {
|
|
2006
|
+
this.start(event);
|
|
2007
|
+
}
|
|
2008
|
+
constructor() {
|
|
2009
|
+
this.listenerMove = (event) => this.move(event);
|
|
2010
|
+
this.listenerStop = () => this.stop();
|
|
2011
|
+
}
|
|
2012
|
+
move(event) {
|
|
2013
|
+
event.preventDefault();
|
|
2014
|
+
this.setCursor(event);
|
|
2015
|
+
}
|
|
2016
|
+
start(event) {
|
|
2017
|
+
this.setCursor(event);
|
|
2018
|
+
event.stopPropagation();
|
|
2019
|
+
document.addEventListener('mouseup', this.listenerStop);
|
|
2020
|
+
document.addEventListener('touchend', this.listenerStop);
|
|
2021
|
+
document.addEventListener('mousemove', this.listenerMove);
|
|
2022
|
+
document.addEventListener('touchmove', this.listenerMove);
|
|
2023
|
+
this.dragStart.emit();
|
|
2024
|
+
}
|
|
2025
|
+
stop() {
|
|
2026
|
+
document.removeEventListener('mouseup', this.listenerStop);
|
|
2027
|
+
document.removeEventListener('touchend', this.listenerStop);
|
|
2028
|
+
document.removeEventListener('mousemove', this.listenerMove);
|
|
2029
|
+
document.removeEventListener('touchmove', this.listenerMove);
|
|
2030
|
+
this.dragEnd.emit();
|
|
2031
|
+
}
|
|
2032
|
+
getXAxis(event) {
|
|
2033
|
+
const position = this.elementRef.nativeElement.getBoundingClientRect();
|
|
2034
|
+
const pageX = (event.pageX !== undefined) ? event.pageX : event.touches[0].pageX;
|
|
2035
|
+
return pageX - position.left - window.pageXOffset;
|
|
2036
|
+
}
|
|
2037
|
+
getYAxis(event) {
|
|
2038
|
+
const position = this.elementRef.nativeElement.getBoundingClientRect();
|
|
2039
|
+
const pageY = (event.pageY !== undefined) ? event.pageY : event.touches[0].pageY;
|
|
2040
|
+
return pageY - position.top - window.pageXOffset;
|
|
2041
|
+
}
|
|
2042
|
+
setCursor(event) {
|
|
2043
|
+
const width = this.elementRef.nativeElement.offsetWidth;
|
|
2044
|
+
const height = this.elementRef.nativeElement.offsetHeight;
|
|
2045
|
+
const x = Math.max(0, Math.min(this.getXAxis(event), width));
|
|
2046
|
+
const y = Math.max(0, Math.min(this.getYAxis(event), height));
|
|
2047
|
+
if (this.rgX !== undefined && this.rgY !== undefined) {
|
|
2048
|
+
this.valueChanged.emit({ x: x, y: y, s: x / width, v: (1 - y / height), rgX: this.rgX, rgY: this.rgY });
|
|
2049
|
+
}
|
|
2050
|
+
else if (this.rgX === undefined && this.rgY !== undefined) {
|
|
2051
|
+
this.valueChanged.emit({ x: x, y: y, v: y / height, rgY: this.rgY });
|
|
2052
|
+
}
|
|
2053
|
+
else if (this.rgX !== undefined && this.rgY === undefined) {
|
|
2054
|
+
this.valueChanged.emit({ x: x, y: y, v: x / width, rgX: this.rgX });
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ColorPickerSliderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2058
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.7", type: ColorPickerSliderDirective, isStandalone: true, selector: "[colorPickerSlider]", inputs: { rgX: "rgX", rgY: "rgY" }, outputs: { dragEnd: "dragEnd", dragStart: "dragStart", valueChanged: "valueChanged" }, host: { listeners: { "mousedown": "mouseDown($event)", "touchstart": "touchStart($event)" } }, ngImport: i0 });
|
|
2059
|
+
}
|
|
2060
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ColorPickerSliderDirective, decorators: [{
|
|
2061
|
+
type: Directive,
|
|
2062
|
+
args: [{
|
|
2063
|
+
selector: '[colorPickerSlider]',
|
|
2064
|
+
standalone: true
|
|
2065
|
+
}]
|
|
2066
|
+
}], ctorParameters: () => [], propDecorators: { rgX: [{
|
|
2067
|
+
type: Input
|
|
2068
|
+
}], rgY: [{
|
|
2069
|
+
type: Input
|
|
2070
|
+
}], dragEnd: [{
|
|
2071
|
+
type: Output
|
|
2072
|
+
}], dragStart: [{
|
|
2073
|
+
type: Output
|
|
2074
|
+
}], valueChanged: [{
|
|
2075
|
+
type: Output
|
|
2076
|
+
}], mouseDown: [{
|
|
2077
|
+
type: HostListener,
|
|
2078
|
+
args: ['mousedown', ['$event']]
|
|
2079
|
+
}], touchStart: [{
|
|
2080
|
+
type: HostListener,
|
|
2081
|
+
args: ['touchstart', ['$event']]
|
|
2082
|
+
}] } });
|
|
2083
|
+
|
|
2084
|
+
class ColorPickerComponent extends BaseControlValueAccessorV3 {
|
|
2085
|
+
hexColor = input('#00FF00F8');
|
|
2086
|
+
enableAdditionalColor = input(false);
|
|
2087
|
+
additionalColors = input([
|
|
2088
|
+
// Gray shades
|
|
2089
|
+
'#FFFFFF', // White
|
|
2090
|
+
'#F5F5F5',
|
|
2091
|
+
'#E0E0E0',
|
|
2092
|
+
'#BDBDBD',
|
|
2093
|
+
'#9E9E9E',
|
|
2094
|
+
'#757575',
|
|
2095
|
+
'#616161',
|
|
2096
|
+
'#424242',
|
|
2097
|
+
'#212121',
|
|
2098
|
+
'#000000', // Black
|
|
2099
|
+
'',
|
|
2100
|
+
// Row 1 – Reds to Purples
|
|
2101
|
+
'#F44336', // Red
|
|
2102
|
+
'#EF5350', // Coral red
|
|
2103
|
+
'#AB47BC', // Orchid
|
|
2104
|
+
'#EC407A', // Pink
|
|
2105
|
+
'#7E57C2', // Lavender purple
|
|
2106
|
+
'#5C6BC0', // Indigo
|
|
2107
|
+
// Row 2 – Teal to Blue
|
|
2108
|
+
'#4DB6AC', // Teal
|
|
2109
|
+
'#4FC3F7', // Sky blue
|
|
2110
|
+
'#4DD0E1', // Cyan
|
|
2111
|
+
'#42A5F5', // Blue
|
|
2112
|
+
'#5C6BC0', // Blue-violet
|
|
2113
|
+
'#1E88E5', // Strong blue
|
|
2114
|
+
// Row 3 – Greens to Oranges
|
|
2115
|
+
'#66BB6A', // Green
|
|
2116
|
+
'#9CCC65', // Lime green
|
|
2117
|
+
'#D4E157', // Light lime
|
|
2118
|
+
'#FFEB3B', // Yellow
|
|
2119
|
+
'#FFCA28', // Gold
|
|
2120
|
+
'#FFA726', // Orange
|
|
2121
|
+
'',
|
|
2122
|
+
// Calm / soft colors
|
|
2123
|
+
'#A8DADC', // Soft teal
|
|
2124
|
+
'#F4A261', // Muted orange
|
|
2125
|
+
'#E9C46A', // Soft yellow
|
|
2126
|
+
'#B5EAD7', // Mint green
|
|
2127
|
+
'#C7CEEA', // Soft blue
|
|
2128
|
+
'#FFDAC1', // Peach
|
|
2129
|
+
'#E2F0CB', // Light green
|
|
2130
|
+
'#D0C9FF', // Lavender
|
|
2131
|
+
'#FFB7B2', // Blush pink
|
|
2132
|
+
'#F1C0E8', // Light magenta
|
|
2133
|
+
]);
|
|
2134
|
+
enableAlpha = input(true);
|
|
2135
|
+
controls = "default";
|
|
2136
|
+
colorChanged = new EventEmitter(false);
|
|
2137
|
+
onAlphaChange = new EventEmitter(false);
|
|
2138
|
+
closeColorPicker = new EventEmitter();
|
|
2139
|
+
color = new Hsva(0, 1, 1, 1);
|
|
2140
|
+
COLOR_PICKER_HEIGHT = signal(140);
|
|
2141
|
+
COLOR_PICKER_WIDTH = signal(250);
|
|
2142
|
+
converterService = inject(ColorConverterService);
|
|
2143
|
+
cdr = inject(ChangeDetectorRef);
|
|
2144
|
+
hsva = signal(new Hsva(0, 1, 1, 1));
|
|
2145
|
+
outputColor;
|
|
2146
|
+
selectedColor = signal("#000000");
|
|
2147
|
+
sliderDimMax = signal(new SliderDimension(0, 1, 1, 1));
|
|
2148
|
+
slider = signal(new SliderPosition(0, 1, 1, 1));
|
|
2149
|
+
hueSliderColor = signal(null);
|
|
2150
|
+
alphaSliderColor = signal(null);
|
|
2151
|
+
hueSlider;
|
|
2152
|
+
alphaSlider;
|
|
2153
|
+
height = computed(() => {
|
|
2154
|
+
return `${this.COLOR_PICKER_HEIGHT()}px`;
|
|
2155
|
+
});
|
|
2156
|
+
width = computed(() => {
|
|
2157
|
+
return `${this.COLOR_PICKER_WIDTH()}px`;
|
|
2158
|
+
});
|
|
2159
|
+
// height = signal(`${this.COLOR_PICKER_HEIGHT()}px`);
|
|
2160
|
+
// width = signal(`${this.COLOR_PICKER_WIDTH()}px`);
|
|
2161
|
+
isTooltip = signal(false);
|
|
2162
|
+
format = ColorFormats.HEX;
|
|
2163
|
+
hexColorValue = model('');
|
|
2164
|
+
alphaValue = signal(1);
|
|
2165
|
+
click(event) {
|
|
2166
|
+
if (this.isOutside(event)) {
|
|
2167
|
+
// this.emitClose('cancel');
|
|
2168
|
+
this.closeColorPicker.emit();
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
isOutside(event) {
|
|
2172
|
+
return event.target.classList.contains('ng-color-picker');
|
|
2173
|
+
}
|
|
2174
|
+
onValueReady(value) {
|
|
2175
|
+
if (this.converterService.isValidHexColor(value)) {
|
|
2176
|
+
this.setHexColor(this.hexColor());
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
ngOnInit() {
|
|
2180
|
+
this.setHexColor(this.hexColor());
|
|
2181
|
+
}
|
|
2182
|
+
ngOnChanges(changes) {
|
|
2183
|
+
if (changes?.hexColor?.currentValue) {
|
|
2184
|
+
this.setHexColor(changes.hexColor.currentValue);
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
ngAfterViewInit() {
|
|
2188
|
+
const hueWidth = this.hueSlider?.nativeElement.offsetWidth || 140;
|
|
2189
|
+
const alphaWidth = this.alphaSlider?.nativeElement.offsetWidth || 140;
|
|
2190
|
+
const sliderDimensionMax = new SliderDimension(hueWidth, this.COLOR_PICKER_WIDTH(), this.COLOR_PICKER_HEIGHT(), alphaWidth);
|
|
2191
|
+
this.sliderDimMax.set(sliderDimensionMax);
|
|
2192
|
+
this.update();
|
|
2193
|
+
}
|
|
2194
|
+
setHexColor(hexColor) {
|
|
2195
|
+
if (!this.enableAlpha()) {
|
|
2196
|
+
hexColor = this.converterService.removeAlpha(hexColor);
|
|
2197
|
+
}
|
|
2198
|
+
if (hexColor != null && hexColor != '') {
|
|
2199
|
+
const hexToHsva = this.converterService.stringToHsva(hexColor);
|
|
2200
|
+
if (hexToHsva) {
|
|
2201
|
+
this.color = hexToHsva;
|
|
2202
|
+
this.hexColorValue.set(hexColor);
|
|
2203
|
+
let alphaPercentage = this.mapRange(this.color.a);
|
|
2204
|
+
this.alphaValue.set(alphaPercentage);
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
if (this.color) {
|
|
2208
|
+
this.slider.set(new SliderPosition(this.color.h, this.color.s, this.color.v, this.color.a));
|
|
2209
|
+
this.update();
|
|
2210
|
+
}
|
|
2211
|
+
else {
|
|
2212
|
+
this.slider.set(new SliderPosition(0, 0, 0, 0));
|
|
2213
|
+
this.update();
|
|
2214
|
+
}
|
|
2215
|
+
if (this.converterService.isValidHexColor(hexColor)) {
|
|
2216
|
+
this.onValueChange(hexColor);
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
mapRange(value) {
|
|
2220
|
+
return Math.round(1 + value * (100 - 1));
|
|
2221
|
+
}
|
|
2222
|
+
onSliderChange(type, event) {
|
|
2223
|
+
switch (type) {
|
|
2224
|
+
case 'saturation-lightness':
|
|
2225
|
+
this.hsva().onColorChange(event);
|
|
2226
|
+
break;
|
|
2227
|
+
case 'hue':
|
|
2228
|
+
this.hsva().onHueChange(event);
|
|
2229
|
+
break;
|
|
2230
|
+
case 'alpha':
|
|
2231
|
+
this.hsva().onAlphaChange(event);
|
|
2232
|
+
this.onAlphaChange.emit(event);
|
|
2233
|
+
break;
|
|
2234
|
+
case 'value':
|
|
2235
|
+
this.hsva().onValueChange(event);
|
|
2236
|
+
break;
|
|
2237
|
+
}
|
|
2238
|
+
this.update();
|
|
2239
|
+
this.setColor(this.outputColor);
|
|
2240
|
+
this.hexColorValue.set(this.converterService.toFormat(this.hsva(), ColorFormats.HEX));
|
|
2241
|
+
this.alphaValue.set(this.mapRange(this.outputColor.a));
|
|
2242
|
+
}
|
|
2243
|
+
setColor(color) {
|
|
2244
|
+
this.color = color;
|
|
2245
|
+
if (!this.isTooltip()) {
|
|
2246
|
+
this.colorChanged.emit(this.converterService.toFormat(this.color, ColorFormats.HEX));
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
getBackgroundColor(color) {
|
|
2250
|
+
return {
|
|
2251
|
+
background: "linear-gradient(90deg, rgba(36,0,0,0) 0%, " + color + " 100%)",
|
|
2252
|
+
};
|
|
2253
|
+
}
|
|
2254
|
+
update() {
|
|
2255
|
+
this.hsva.set(this.color);
|
|
2256
|
+
if (this.sliderDimMax) {
|
|
2257
|
+
let rgba = this.converterService.hsvaToRgba(this.hsva()).denormalize();
|
|
2258
|
+
let hue = this.converterService
|
|
2259
|
+
.hsvaToRgba(new Hsva(this.hsva().h, 1, 1, 1))
|
|
2260
|
+
.denormalize();
|
|
2261
|
+
this.hueSliderColor.set("rgb(" + hue.r + "," + hue.g + "," + hue.b + ")");
|
|
2262
|
+
this.alphaSliderColor.set("rgb(" + rgba.r + "," + rgba.g + "," + rgba.b + ")");
|
|
2263
|
+
this.outputColor = this.hsva();
|
|
2264
|
+
this.selectedColor.set(this.converterService.hsvaToRgba(this.hsva()).toString());
|
|
2265
|
+
const sliderPosition = new SliderPosition(
|
|
2266
|
+
// (this.sHue || this.hsva.h) * this.sliderDimMax.h - 8,
|
|
2267
|
+
this.hsva().h * this.sliderDimMax().h - 5, this.hsva().s * this.sliderDimMax().s, (1 - this.hsva().v) * this.sliderDimMax().v, this.hsva().a * this.sliderDimMax().a - 5);
|
|
2268
|
+
this.slider.set(sliderPosition);
|
|
2269
|
+
this.cdr.detectChanges();
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
onHexColorChange(event) {
|
|
2273
|
+
const hexCode = event.target.value.toString().trim();
|
|
2274
|
+
if (this.converterService.isValidHexColor(hexCode)) {
|
|
2275
|
+
this.setHexColor(this.converterService.addHexPrefixIfMissing(hexCode));
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
alphaChanged(event) {
|
|
2279
|
+
const input = event.target.value.trim();
|
|
2280
|
+
let value = parseInt(input, 10);
|
|
2281
|
+
if (isNaN(value)) {
|
|
2282
|
+
value = 0;
|
|
2283
|
+
}
|
|
2284
|
+
value = Math.max(0, Math.min(100, value));
|
|
2285
|
+
this.alphaValue.set(value);
|
|
2286
|
+
}
|
|
2287
|
+
onApplyCLicked() {
|
|
2288
|
+
this.colorChanged.emit(this.converterService.toFormat(this.color, ColorFormats.HEX));
|
|
2289
|
+
}
|
|
2290
|
+
getColorRows() {
|
|
2291
|
+
const rows = [];
|
|
2292
|
+
let currentRow = [];
|
|
2293
|
+
for (const color of this.additionalColors()) {
|
|
2294
|
+
if (color === '') {
|
|
2295
|
+
if (currentRow.length) {
|
|
2296
|
+
rows.push(currentRow);
|
|
2297
|
+
currentRow = [];
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
else {
|
|
2301
|
+
currentRow.push(color);
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
if (currentRow.length) {
|
|
2305
|
+
rows.push(currentRow);
|
|
2306
|
+
}
|
|
2307
|
+
return rows;
|
|
2308
|
+
}
|
|
2309
|
+
onColorSelected(color) {
|
|
2310
|
+
this.setHexColor(color);
|
|
2311
|
+
}
|
|
2312
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ColorPickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2313
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.7", type: ColorPickerComponent, isStandalone: true, selector: "app-color-picker", inputs: { hexColor: { classPropertyName: "hexColor", publicName: "hexColor", isSignal: true, isRequired: false, transformFunction: null }, enableAdditionalColor: { classPropertyName: "enableAdditionalColor", publicName: "enableAdditionalColor", isSignal: true, isRequired: false, transformFunction: null }, additionalColors: { classPropertyName: "additionalColors", publicName: "additionalColors", isSignal: true, isRequired: false, transformFunction: null }, enableAlpha: { classPropertyName: "enableAlpha", publicName: "enableAlpha", isSignal: true, isRequired: false, transformFunction: null }, controls: { classPropertyName: "controls", publicName: "controls", isSignal: false, isRequired: false, transformFunction: null }, hexColorValue: { classPropertyName: "hexColorValue", publicName: "hexColorValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { colorChanged: "colorChanged", onAlphaChange: "onAlphaChange", closeColorPicker: "closeColorPicker", hexColorValue: "hexColorValueChange" }, host: { listeners: { "document:mousedown": "click($event)" } }, viewQueries: [{ propertyName: "hueSlider", first: true, predicate: ["hueSlider"], descendants: true }, { propertyName: "alphaSlider", first: true, predicate: ["alphaSlider"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div [ngClass]=\"isTooltip() ? 'shadow-1 bg-white' : ''\">\n\n <div [style.width]=\"width()\">\n\n <!--Saturation and Lightness-->\n <div\n class=\"sl\"\n [style.height]=\"height()\"\n [style.width]=\"width()\"\n colorPickerSlider\n [rgX]=\"1\"\n [rgY]=\"1\"\n (valueChanged)=\"onSliderChange('saturation-lightness', $event)\"\n [style.background-color]=\"hueSliderColor()\">\n\n <!--Saturation & Lightness pointer-->\n <div\n class=\"sl-pointer\"\n [style.left.px]=\"slider().s\"\n [style.top.px]=\"slider().v\">\n </div>\n\n </div>\n\n <div class=\"flex flex-col gap-4 mt-4\" [ngClass]=\"isTooltip() ? 'p-4' : ''\">\n <!--Selected Color-->\n <div class=\"flex gap-5 items-center\">\n\n <!-- <div class=\"relative\">-->\n <!-- <div class=\"selected-color-background\"></div>-->\n <!-- <div-->\n <!-- class=\"h-10 w-10 rounded-xl selected-color\"-->\n <!-- [style.background-color]=\"selectedColor()\">-->\n <!-- </div>-->\n <!-- </div>-->\n\n\n <div class=\"flex flex-col w-full gap-4\">\n <div #hueSlider\n class=\"hue\"\n colorPickerSlider\n (valueChanged)=\"onSliderChange('hue', $event)\"\n [rgX]=\"1\">\n <div class=\"hue-pointer\"\n [style.left.px]=\"slider().h\"></div>\n </div>\n\n @if(enableAlpha()) {\n <div #alphaSlider\n class=\"alpha\"\n colorPickerSlider\n [rgX]=\"1\"\n (valueChanged)=\"onSliderChange('alpha', $event)\">\n <div class=\"alpha-gradient\" [ngStyle]=\"getBackgroundColor(alphaSliderColor())\"></div>\n <div class=\"alpha-pointer\"\n [style.left.px]=\"slider().a\"></div>\n </div>\n }\n </div>\n\n </div>\n\n <div class=\"flex items-center gap-3\">\n <div class=\"relative rounded w-full flex items-center bg-gray-50 focus-within:text-neutral-600\">\n <p class=\"absolute text-sm text-blue-500 px-3 pointer-events-none\">HEX</p>\n <input [(ngModel)]=\"hexColorValue\" (input)=\"onHexColorChange($event)\"\n class=\"py-2 pl-12 pr-3 w-36 bg-gray-50 focus:outline-none rounded uppercase\">\n\n </div>\n @if (isTooltip()) {\n <div class=\"px-3 py-2 border border-neutral-300 h-min rounded-md cursor-pointer text-primary-500\"\n (click)=\"onApplyCLicked()\">Apply\n </div>\n }\n </div>\n </div>\n\n </div>\n\n <div class=\"mt-4\">\n @for (row of getColorRows(); let $isLast = $last; track $index) {\n <div class=\"grid grid-cols-8 gap-2 mb-1\">\n @for (color of row; track $index) {\n <div\n (click)=\"onColorSelected(color)\"\n class=\"h-6 w-6 rounded cursor-pointer border border-gray-200\"\n [style.background-color]=\"color\">\n </div>\n }\n </div>\n\n <!-- Separator line unless it's the last row -->\n @if (!$isLast) {\n <div class=\"h-[1px] bg-gray-100 my-2.5 w-full\"></div>\n }\n }\n </div>\n\n\n</div>\n\n\n\n", styles: [".sl{@apply rounded;direction:ltr;cursor:crosshair;position:relative;touch-action:manipulation;background-image:linear-gradient(to top,#000 0%,transparent 100%),linear-gradient(to right,#fff 0%,transparent 100%)}.sl-pointer{@apply absolute rounded-full transform -translate-y-1/2 -translate-x-1/2 bg-transparent h-5 w-5 border-4 shadow-1 border-white;}.hue{direction:ltr;height:14px;width:100%;border:none;border-radius:100px;position:relative;cursor:pointer;background-size:100% 100%;background:linear-gradient(to right,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 66%,#f0f,red)}.hue-pointer{@apply absolute rounded-full top-1/2 transform -translate-y-1/2 -translate-x-1/2 bg-white h-6 w-6 shadow-1 border border-neutral-300;}.alpha{direction:ltr;position:relative;width:100%;height:14px;border:none;border-radius:100px;cursor:pointer;background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0px}.alpha-pointer{@apply absolute rounded-full top-1/2 transform -translate-y-1/2 -translate-x-1/2 bg-white h-6 w-6 shadow-1 border border-neutral-300;}.alpha-gradient{width:100%;height:100%;border-radius:5px;position:absolute}.selected-color-background{@apply h-10 w-10 rounded-xl;background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0px}.selected-color{position:absolute;@apply h-10 w-10 shadow-md;top:0;left:0}\n"], dependencies: [{ kind: "directive", type: ColorPickerSliderDirective, selector: "[colorPickerSlider]", inputs: ["rgX", "rgY"], outputs: ["dragEnd", "dragStart", "valueChanged"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2314
|
+
}
|
|
2315
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ColorPickerComponent, decorators: [{
|
|
2316
|
+
type: Component,
|
|
2317
|
+
args: [{ selector: 'app-color-picker', standalone: true, imports: [
|
|
2318
|
+
ColorPickerSliderDirective,
|
|
2319
|
+
NgStyle,
|
|
2320
|
+
FormsModule,
|
|
2321
|
+
NgClass
|
|
2322
|
+
], template: "<div [ngClass]=\"isTooltip() ? 'shadow-1 bg-white' : ''\">\n\n <div [style.width]=\"width()\">\n\n <!--Saturation and Lightness-->\n <div\n class=\"sl\"\n [style.height]=\"height()\"\n [style.width]=\"width()\"\n colorPickerSlider\n [rgX]=\"1\"\n [rgY]=\"1\"\n (valueChanged)=\"onSliderChange('saturation-lightness', $event)\"\n [style.background-color]=\"hueSliderColor()\">\n\n <!--Saturation & Lightness pointer-->\n <div\n class=\"sl-pointer\"\n [style.left.px]=\"slider().s\"\n [style.top.px]=\"slider().v\">\n </div>\n\n </div>\n\n <div class=\"flex flex-col gap-4 mt-4\" [ngClass]=\"isTooltip() ? 'p-4' : ''\">\n <!--Selected Color-->\n <div class=\"flex gap-5 items-center\">\n\n <!-- <div class=\"relative\">-->\n <!-- <div class=\"selected-color-background\"></div>-->\n <!-- <div-->\n <!-- class=\"h-10 w-10 rounded-xl selected-color\"-->\n <!-- [style.background-color]=\"selectedColor()\">-->\n <!-- </div>-->\n <!-- </div>-->\n\n\n <div class=\"flex flex-col w-full gap-4\">\n <div #hueSlider\n class=\"hue\"\n colorPickerSlider\n (valueChanged)=\"onSliderChange('hue', $event)\"\n [rgX]=\"1\">\n <div class=\"hue-pointer\"\n [style.left.px]=\"slider().h\"></div>\n </div>\n\n @if(enableAlpha()) {\n <div #alphaSlider\n class=\"alpha\"\n colorPickerSlider\n [rgX]=\"1\"\n (valueChanged)=\"onSliderChange('alpha', $event)\">\n <div class=\"alpha-gradient\" [ngStyle]=\"getBackgroundColor(alphaSliderColor())\"></div>\n <div class=\"alpha-pointer\"\n [style.left.px]=\"slider().a\"></div>\n </div>\n }\n </div>\n\n </div>\n\n <div class=\"flex items-center gap-3\">\n <div class=\"relative rounded w-full flex items-center bg-gray-50 focus-within:text-neutral-600\">\n <p class=\"absolute text-sm text-blue-500 px-3 pointer-events-none\">HEX</p>\n <input [(ngModel)]=\"hexColorValue\" (input)=\"onHexColorChange($event)\"\n class=\"py-2 pl-12 pr-3 w-36 bg-gray-50 focus:outline-none rounded uppercase\">\n\n </div>\n @if (isTooltip()) {\n <div class=\"px-3 py-2 border border-neutral-300 h-min rounded-md cursor-pointer text-primary-500\"\n (click)=\"onApplyCLicked()\">Apply\n </div>\n }\n </div>\n </div>\n\n </div>\n\n <div class=\"mt-4\">\n @for (row of getColorRows(); let $isLast = $last; track $index) {\n <div class=\"grid grid-cols-8 gap-2 mb-1\">\n @for (color of row; track $index) {\n <div\n (click)=\"onColorSelected(color)\"\n class=\"h-6 w-6 rounded cursor-pointer border border-gray-200\"\n [style.background-color]=\"color\">\n </div>\n }\n </div>\n\n <!-- Separator line unless it's the last row -->\n @if (!$isLast) {\n <div class=\"h-[1px] bg-gray-100 my-2.5 w-full\"></div>\n }\n }\n </div>\n\n\n</div>\n\n\n\n", styles: [".sl{@apply rounded;direction:ltr;cursor:crosshair;position:relative;touch-action:manipulation;background-image:linear-gradient(to top,#000 0%,transparent 100%),linear-gradient(to right,#fff 0%,transparent 100%)}.sl-pointer{@apply absolute rounded-full transform -translate-y-1/2 -translate-x-1/2 bg-transparent h-5 w-5 border-4 shadow-1 border-white;}.hue{direction:ltr;height:14px;width:100%;border:none;border-radius:100px;position:relative;cursor:pointer;background-size:100% 100%;background:linear-gradient(to right,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 66%,#f0f,red)}.hue-pointer{@apply absolute rounded-full top-1/2 transform -translate-y-1/2 -translate-x-1/2 bg-white h-6 w-6 shadow-1 border border-neutral-300;}.alpha{direction:ltr;position:relative;width:100%;height:14px;border:none;border-radius:100px;cursor:pointer;background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0px}.alpha-pointer{@apply absolute rounded-full top-1/2 transform -translate-y-1/2 -translate-x-1/2 bg-white h-6 w-6 shadow-1 border border-neutral-300;}.alpha-gradient{width:100%;height:100%;border-radius:5px;position:absolute}.selected-color-background{@apply h-10 w-10 rounded-xl;background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0px}.selected-color{position:absolute;@apply h-10 w-10 shadow-md;top:0;left:0}\n"] }]
|
|
2323
|
+
}], propDecorators: { controls: [{
|
|
2324
|
+
type: Input
|
|
2325
|
+
}], colorChanged: [{
|
|
2326
|
+
type: Output
|
|
2327
|
+
}], onAlphaChange: [{
|
|
2328
|
+
type: Output
|
|
2329
|
+
}], closeColorPicker: [{
|
|
2330
|
+
type: Output
|
|
2331
|
+
}], hueSlider: [{
|
|
2332
|
+
type: ViewChild,
|
|
2333
|
+
args: ["hueSlider", { static: false }]
|
|
2334
|
+
}], alphaSlider: [{
|
|
2335
|
+
type: ViewChild,
|
|
2336
|
+
args: ["alphaSlider", { static: false }]
|
|
2337
|
+
}], click: [{
|
|
2338
|
+
type: HostListener,
|
|
2339
|
+
args: ['document:mousedown', ['$event']]
|
|
2340
|
+
}] } });
|
|
2341
|
+
|
|
2342
|
+
class ColorPickerDirective {
|
|
2343
|
+
colorChanged = new EventEmitter(false);
|
|
2344
|
+
componentRef = null;
|
|
2345
|
+
elementRef = inject(ElementRef);
|
|
2346
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
2347
|
+
componentFactoryResolver = inject(ComponentFactoryResolver);
|
|
2348
|
+
appRef = inject(ApplicationRef);
|
|
2349
|
+
injector = inject(Injector);
|
|
2350
|
+
overlay;
|
|
2351
|
+
onClick() {
|
|
2352
|
+
if (this.componentRef) {
|
|
2353
|
+
this.closeColorPicker();
|
|
2354
|
+
return;
|
|
2355
|
+
}
|
|
2356
|
+
this.initializeColorPicker();
|
|
2357
|
+
}
|
|
2358
|
+
initializeColorPicker() {
|
|
2359
|
+
if (this.componentRef === null) {
|
|
2360
|
+
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(ColorPickerComponent);
|
|
2361
|
+
this.componentRef = componentFactory.create(this.injector);
|
|
2362
|
+
this.appRef.attachView(this.componentRef.hostView);
|
|
2363
|
+
const [domElement] = this.componentRef.hostView.rootNodes;
|
|
2364
|
+
const elementRect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
2365
|
+
this.overlay = document.createElement("div");
|
|
2366
|
+
this.overlay.id = "ng-color-picker";
|
|
2367
|
+
this.overlay.classList.add("ng-color-picker");
|
|
2368
|
+
this.overlay.style['position'] = 'fixed';
|
|
2369
|
+
this.overlay.style['height'] = '100%';
|
|
2370
|
+
this.overlay.style['width'] = '100%';
|
|
2371
|
+
this.overlay.style['z-index'] = 2000;
|
|
2372
|
+
this.overlay.style['top'] = '0';
|
|
2373
|
+
this.overlay.style['left'] = '0';
|
|
2374
|
+
this.componentRef.location.nativeElement.style.position = 'absolute';
|
|
2375
|
+
this.componentRef.location.nativeElement.style['z-index'] = 2001;
|
|
2376
|
+
this.componentRef.location.nativeElement.style.top = `${elementRect.bottom + 20}px`;
|
|
2377
|
+
this.componentRef.location.nativeElement.style.left = `${elementRect.left}px`;
|
|
2378
|
+
this.componentRef.instance.COLOR_PICKER_HEIGHT.set(140);
|
|
2379
|
+
this.componentRef.instance.COLOR_PICKER_WIDTH.set(250);
|
|
2380
|
+
this.componentRef.instance.isTooltip.set(true);
|
|
2381
|
+
this.componentRef.instance.colorChanged.subscribe((colorCode) => {
|
|
2382
|
+
this.colorChanged.emit(colorCode);
|
|
2383
|
+
this.closeColorPicker();
|
|
2384
|
+
});
|
|
2385
|
+
this.componentRef.instance.closeColorPicker.subscribe(() => {
|
|
2386
|
+
this.closeColorPicker();
|
|
2387
|
+
});
|
|
2388
|
+
document.body.appendChild(this.overlay);
|
|
2389
|
+
document.body.appendChild(domElement);
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
// private initializeColorPicker() {
|
|
2393
|
+
// if(this.componentRef === null) {
|
|
2394
|
+
// const componentFactory = this.componentFactoryResolver.resolveComponentFactory(ColorPickerComponent);
|
|
2395
|
+
// this.componentRef = componentFactory.create(this.injector);
|
|
2396
|
+
//
|
|
2397
|
+
// this.appRef.attachView(this.componentRef.hostView);
|
|
2398
|
+
// const [domElement] = (this.componentRef.hostView as EmbeddedViewRef<any>).rootNodes;
|
|
2399
|
+
//
|
|
2400
|
+
// this.setColorPickerProperties();
|
|
2401
|
+
//
|
|
2402
|
+
// document.body.appendChild(domElement);
|
|
2403
|
+
//
|
|
2404
|
+
// }
|
|
2405
|
+
// }
|
|
2406
|
+
//
|
|
2407
|
+
// private setColorPickerProperties() {
|
|
2408
|
+
// if (this.componentRef !== null) {
|
|
2409
|
+
// const elementRect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
2410
|
+
//
|
|
2411
|
+
//
|
|
2412
|
+
// this.componentRef.location.nativeElement.style.position = 'absolute';
|
|
2413
|
+
// this.componentRef.location.nativeElement.style.top = `${elementRect.bottom + 20}px`;
|
|
2414
|
+
// this.componentRef.location.nativeElement.style.left = `${elementRect.left}px`;
|
|
2415
|
+
// this.componentRef.instance.COLOR_PICKER_HEIGHT.set(140);
|
|
2416
|
+
// this.componentRef.instance.COLOR_PICKER_WIDTH.set(250);
|
|
2417
|
+
// this.componentRef.instance.isTooltip.set(true);
|
|
2418
|
+
//
|
|
2419
|
+
// this.componentRef.instance.colorChanged.subscribe((colorCode: string) => {
|
|
2420
|
+
// this.colorChanged.emit(colorCode);
|
|
2421
|
+
// this.closeColorPicker();
|
|
2422
|
+
// });
|
|
2423
|
+
//
|
|
2424
|
+
// this.componentRef.instance.closeColorPicker.subscribe(() => {
|
|
2425
|
+
// this.closeColorPicker();
|
|
2426
|
+
// });
|
|
2427
|
+
// }
|
|
2428
|
+
// }
|
|
2429
|
+
closeColorPicker() {
|
|
2430
|
+
if (this.componentRef) {
|
|
2431
|
+
this.appRef.detachView(this.componentRef.hostView);
|
|
2432
|
+
this.componentRef.destroy();
|
|
2433
|
+
this.overlay.remove();
|
|
2434
|
+
this.componentRef = null;
|
|
2435
|
+
}
|
|
2436
|
+
// this.viewContainerRef.clear();
|
|
2437
|
+
// this.componentRef = null;
|
|
2438
|
+
}
|
|
2439
|
+
ngOnDestroy() {
|
|
2440
|
+
this.closeColorPicker();
|
|
2441
|
+
}
|
|
2442
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ColorPickerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2443
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.7", type: ColorPickerDirective, isStandalone: true, selector: "[appColorPicker]", outputs: { colorChanged: "colorChanged" }, host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
2444
|
+
}
|
|
2445
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ColorPickerDirective, decorators: [{
|
|
2446
|
+
type: Directive,
|
|
2447
|
+
args: [{
|
|
2448
|
+
selector: '[appColorPicker]',
|
|
2449
|
+
standalone: true
|
|
2450
|
+
}]
|
|
2451
|
+
}], propDecorators: { colorChanged: [{
|
|
2452
|
+
type: Output
|
|
2453
|
+
}], onClick: [{
|
|
2454
|
+
type: HostListener,
|
|
2455
|
+
args: ['click']
|
|
2456
|
+
}] } });
|
|
2457
|
+
|
|
1601
2458
|
class OverlayContextMenuComponent {
|
|
1602
2459
|
dialogRef = inject(DialogRef);
|
|
1603
2460
|
actions = inject(DIALOG_DATA);
|
|
@@ -1875,6 +2732,8 @@ class TextInputComponent extends BaseControlValueAccessor {
|
|
|
1875
2732
|
showErrorSpace = input(false);
|
|
1876
2733
|
mask = input(null);
|
|
1877
2734
|
debounceSearchEnabled = input(true);
|
|
2735
|
+
autoFocus = input(false);
|
|
2736
|
+
inputRef;
|
|
1878
2737
|
changeValue = output();
|
|
1879
2738
|
actionIconClicked = output();
|
|
1880
2739
|
isFocused = signal(false);
|
|
@@ -1893,6 +2752,9 @@ class TextInputComponent extends BaseControlValueAccessor {
|
|
|
1893
2752
|
if (formControl) {
|
|
1894
2753
|
this.formControl = this.ngControl?.control;
|
|
1895
2754
|
}
|
|
2755
|
+
if (this.autoFocus()) {
|
|
2756
|
+
setTimeout(() => this.inputRef.nativeElement.focus(), 0);
|
|
2757
|
+
}
|
|
1896
2758
|
}
|
|
1897
2759
|
ngAfterViewInit() {
|
|
1898
2760
|
if (this.debounceSearchEnabled()) {
|
|
@@ -1942,7 +2804,7 @@ class TextInputComponent extends BaseControlValueAccessor {
|
|
|
1942
2804
|
this.isFocused.set(false);
|
|
1943
2805
|
}
|
|
1944
2806
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TextInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1945
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.7", type: TextInputComponent, isStandalone: true, selector: "app-text-input", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, viewType: { classPropertyName: "viewType", publicName: "viewType", isSignal: true, isRequired: false, transformFunction: null }, iconSrc: { classPropertyName: "iconSrc", publicName: "iconSrc", isSignal: true, isRequired: false, transformFunction: null }, actionIcon: { classPropertyName: "actionIcon", publicName: "actionIcon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, errorMessages: { classPropertyName: "errorMessages", publicName: "errorMessages", isSignal: true, isRequired: false, transformFunction: null }, showErrorSpace: { classPropertyName: "showErrorSpace", publicName: "showErrorSpace", isSignal: true, isRequired: false, transformFunction: null }, mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, debounceSearchEnabled: { classPropertyName: "debounceSearchEnabled", publicName: "debounceSearchEnabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changeValue: "changeValue", actionIconClicked: "actionIconClicked" }, usesInheritance: true, ngImport: i0, template: "<app-base-input #inputElement [title]=\"label()\" [fullWidth]=\"fullWidth()\" [isRequiredField]=\"hasRequiredValidator()\">\n <div input class=\"relative flex items-center w-full text-neutral-400 bg-white shadow-1 rounded-md\">\n @if (iconSrc()) {\n <app-svg-icon [size]=\"18\" [src]=\"iconSrc()!\"\n class=\"absolute pointer-events-none ml-3 text-neutral-400\"></app-svg-icon>\n }\n\n<!-- <p>{{ formControl.getError('required') ? placeholder + ' ' : placeholder }}</p>-->\n\n <input\n [mask]=\"mask()\"\n class=\"h-[46px] placeholder-neutral-400 text-black rounded-md border-none outline-none focus:border-none ring-1 ring-neutral-300 focus:ring-primary-500 focus:ring-2 transition-all duration-300\"\n [class.text-neutral-400]=\"formControl.disabled\"\n [class.disabled-placeholder]=\"formControl.disabled\"\n [formControl]=\"formControl\"\n [ngClass]=\"getClass()\"\n [type]=\"type()\"\n [placeholder]=\"placeholder()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (input)=\"onValueChange($event)\">\n\n @if (actionIcon()) {\n <div (click)=\"onActionClicked()\"\n class=\"absolute right-2 p-2 flex justify-center items-center hover:bg-neutral-100 rounded-full\">\n <app-svg-icon [size]=\"18\" [src]=\"actionIcon()!\" class=\"text-neutral-400 cursor-pointer\">\n </app-svg-icon>\n </div>\n }\n </div>\n</app-base-input>\n\n@if (formControl.errors && hasErrors) {\n <div class=\"mt-1\">\n <span class=\"text-caption text-red-500\">{{ formControl.errors | humanizeFormMessages: errorMessages() }}</span>\n </div>\n} @else {\n @if (showErrorSpace()) {\n <div class=\"mt-1\">\n <span class=\"text-caption text-transparent\">.</span>\n </div>\n }\n}\n", styles: [""], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: HumanizeFormMessagesPipe, name: "humanizeFormMessages" }, { kind: "component", type: AppSvgIconComponent, selector: "app-svg-icon", inputs: ["src", "stretch", "size", "svgStyle"] }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: BaseInputComponent, selector: "app-base-input", inputs: ["title", "isRequiredField", "fullWidth", "inputType"] }, { kind: "directive", type: NgxMaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime", "leadZero", "triggerOnMaskChange", "apm", "inputTransformFn", "outputTransformFn", "keepCharacterPositions", "instantPrefix"], outputs: ["maskFilled"], exportAs: ["mask", "ngxMask"] }] });
|
|
2807
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.7", type: TextInputComponent, isStandalone: true, selector: "app-text-input", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, viewType: { classPropertyName: "viewType", publicName: "viewType", isSignal: true, isRequired: false, transformFunction: null }, iconSrc: { classPropertyName: "iconSrc", publicName: "iconSrc", isSignal: true, isRequired: false, transformFunction: null }, actionIcon: { classPropertyName: "actionIcon", publicName: "actionIcon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, errorMessages: { classPropertyName: "errorMessages", publicName: "errorMessages", isSignal: true, isRequired: false, transformFunction: null }, showErrorSpace: { classPropertyName: "showErrorSpace", publicName: "showErrorSpace", isSignal: true, isRequired: false, transformFunction: null }, mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, debounceSearchEnabled: { classPropertyName: "debounceSearchEnabled", publicName: "debounceSearchEnabled", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changeValue: "changeValue", actionIconClicked: "actionIconClicked" }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<app-base-input #inputElement [title]=\"label()\" [fullWidth]=\"fullWidth()\" [isRequiredField]=\"hasRequiredValidator()\">\n <div input class=\"relative flex items-center w-full text-neutral-400 bg-white shadow-1 rounded-md\">\n @if (iconSrc()) {\n <app-svg-icon [size]=\"18\" [src]=\"iconSrc()!\"\n class=\"absolute pointer-events-none ml-3 text-neutral-400\"></app-svg-icon>\n }\n\n<!-- <p>{{ formControl.getError('required') ? placeholder + ' ' : placeholder }}</p>-->\n\n <input\n #inputRef\n [mask]=\"mask()\"\n class=\"h-[46px] placeholder-neutral-400 text-black rounded-md border-none outline-none focus:border-none ring-1 ring-neutral-300 focus:ring-primary-500 focus:ring-2 transition-all duration-300\"\n [class.text-neutral-400]=\"formControl.disabled\"\n [class.disabled-placeholder]=\"formControl.disabled\"\n [formControl]=\"formControl\"\n [ngClass]=\"getClass()\"\n [type]=\"type()\"\n [placeholder]=\"placeholder()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (input)=\"onValueChange($event)\">\n\n @if (actionIcon()) {\n <div (click)=\"onActionClicked()\"\n class=\"absolute right-2 p-2 flex justify-center items-center hover:bg-neutral-100 rounded-full\">\n <app-svg-icon [size]=\"18\" [src]=\"actionIcon()!\" class=\"text-neutral-400 cursor-pointer\">\n </app-svg-icon>\n </div>\n }\n </div>\n</app-base-input>\n\n@if (formControl.errors && hasErrors) {\n <div class=\"mt-1\">\n <span class=\"text-caption text-red-500\">{{ formControl.errors | humanizeFormMessages: errorMessages() }}</span>\n </div>\n} @else {\n @if (showErrorSpace()) {\n <div class=\"mt-1\">\n <span class=\"text-caption text-transparent\">.</span>\n </div>\n }\n}\n", styles: [""], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: HumanizeFormMessagesPipe, name: "humanizeFormMessages" }, { kind: "component", type: AppSvgIconComponent, selector: "app-svg-icon", inputs: ["src", "stretch", "size", "svgStyle"] }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: BaseInputComponent, selector: "app-base-input", inputs: ["title", "isRequiredField", "fullWidth", "inputType"] }, { kind: "directive", type: NgxMaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime", "leadZero", "triggerOnMaskChange", "apm", "inputTransformFn", "outputTransformFn", "keepCharacterPositions", "instantPrefix"], outputs: ["maskFilled"], exportAs: ["mask", "ngxMask"] }] });
|
|
1946
2808
|
}
|
|
1947
2809
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TextInputComponent, decorators: [{
|
|
1948
2810
|
type: Component,
|
|
@@ -1954,8 +2816,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
|
|
|
1954
2816
|
CommonModule,
|
|
1955
2817
|
BaseInputComponent,
|
|
1956
2818
|
NgxMaskDirective
|
|
1957
|
-
], template: "<app-base-input #inputElement [title]=\"label()\" [fullWidth]=\"fullWidth()\" [isRequiredField]=\"hasRequiredValidator()\">\n <div input class=\"relative flex items-center w-full text-neutral-400 bg-white shadow-1 rounded-md\">\n @if (iconSrc()) {\n <app-svg-icon [size]=\"18\" [src]=\"iconSrc()!\"\n class=\"absolute pointer-events-none ml-3 text-neutral-400\"></app-svg-icon>\n }\n\n<!-- <p>{{ formControl.getError('required') ? placeholder + ' ' : placeholder }}</p>-->\n\n <input\n [mask]=\"mask()\"\n class=\"h-[46px] placeholder-neutral-400 text-black rounded-md border-none outline-none focus:border-none ring-1 ring-neutral-300 focus:ring-primary-500 focus:ring-2 transition-all duration-300\"\n [class.text-neutral-400]=\"formControl.disabled\"\n [class.disabled-placeholder]=\"formControl.disabled\"\n [formControl]=\"formControl\"\n [ngClass]=\"getClass()\"\n [type]=\"type()\"\n [placeholder]=\"placeholder()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (input)=\"onValueChange($event)\">\n\n @if (actionIcon()) {\n <div (click)=\"onActionClicked()\"\n class=\"absolute right-2 p-2 flex justify-center items-center hover:bg-neutral-100 rounded-full\">\n <app-svg-icon [size]=\"18\" [src]=\"actionIcon()!\" class=\"text-neutral-400 cursor-pointer\">\n </app-svg-icon>\n </div>\n }\n </div>\n</app-base-input>\n\n@if (formControl.errors && hasErrors) {\n <div class=\"mt-1\">\n <span class=\"text-caption text-red-500\">{{ formControl.errors | humanizeFormMessages: errorMessages() }}</span>\n </div>\n} @else {\n @if (showErrorSpace()) {\n <div class=\"mt-1\">\n <span class=\"text-caption text-transparent\">.</span>\n </div>\n }\n}\n" }]
|
|
1958
|
-
}], ctorParameters: () => []
|
|
2819
|
+
], template: "<app-base-input #inputElement [title]=\"label()\" [fullWidth]=\"fullWidth()\" [isRequiredField]=\"hasRequiredValidator()\">\n <div input class=\"relative flex items-center w-full text-neutral-400 bg-white shadow-1 rounded-md\">\n @if (iconSrc()) {\n <app-svg-icon [size]=\"18\" [src]=\"iconSrc()!\"\n class=\"absolute pointer-events-none ml-3 text-neutral-400\"></app-svg-icon>\n }\n\n<!-- <p>{{ formControl.getError('required') ? placeholder + ' ' : placeholder }}</p>-->\n\n <input\n #inputRef\n [mask]=\"mask()\"\n class=\"h-[46px] placeholder-neutral-400 text-black rounded-md border-none outline-none focus:border-none ring-1 ring-neutral-300 focus:ring-primary-500 focus:ring-2 transition-all duration-300\"\n [class.text-neutral-400]=\"formControl.disabled\"\n [class.disabled-placeholder]=\"formControl.disabled\"\n [formControl]=\"formControl\"\n [ngClass]=\"getClass()\"\n [type]=\"type()\"\n [placeholder]=\"placeholder()\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (input)=\"onValueChange($event)\">\n\n @if (actionIcon()) {\n <div (click)=\"onActionClicked()\"\n class=\"absolute right-2 p-2 flex justify-center items-center hover:bg-neutral-100 rounded-full\">\n <app-svg-icon [size]=\"18\" [src]=\"actionIcon()!\" class=\"text-neutral-400 cursor-pointer\">\n </app-svg-icon>\n </div>\n }\n </div>\n</app-base-input>\n\n@if (formControl.errors && hasErrors) {\n <div class=\"mt-1\">\n <span class=\"text-caption text-red-500\">{{ formControl.errors | humanizeFormMessages: errorMessages() }}</span>\n </div>\n} @else {\n @if (showErrorSpace()) {\n <div class=\"mt-1\">\n <span class=\"text-caption text-transparent\">.</span>\n </div>\n }\n}\n" }]
|
|
2820
|
+
}], ctorParameters: () => [], propDecorators: { inputRef: [{
|
|
2821
|
+
type: ViewChild,
|
|
2822
|
+
args: ['inputRef']
|
|
2823
|
+
}] } });
|
|
1959
2824
|
|
|
1960
2825
|
class TextButtonSmall {
|
|
1961
2826
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TextButtonSmall, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -2229,7 +3094,7 @@ class DataTableComponent extends BaseControlValueAccessorV3 {
|
|
|
2229
3094
|
this.onActionPerformed.emit($event);
|
|
2230
3095
|
}
|
|
2231
3096
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: DataTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2232
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.7", type: DataTableComponent, isStandalone: true, selector: "app-data-table", inputs: { columnDefs: { classPropertyName: "columnDefs", publicName: "columnDefs", isSignal: true, isRequired: true, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, enableHorizontallyScrollable: { classPropertyName: "enableHorizontallyScrollable", publicName: "enableHorizontallyScrollable", isSignal: true, isRequired: false, transformFunction: null }, enableResizableColumns: { classPropertyName: "enableResizableColumns", publicName: "enableResizableColumns", isSignal: true, isRequired: false, transformFunction: null }, enableClickableRows: { classPropertyName: "enableClickableRows", publicName: "enableClickableRows", isSignal: true, isRequired: false, transformFunction: null }, expandableComponent: { classPropertyName: "expandableComponent", publicName: "expandableComponent", isSignal: true, isRequired: false, transformFunction: null }, enableColumnsConfig: { classPropertyName: "enableColumnsConfig", publicName: "enableColumnsConfig", isSignal: true, isRequired: false, transformFunction: null }, filterComponent: { classPropertyName: "filterComponent", publicName: "filterComponent", isSignal: true, isRequired: false, transformFunction: null }, enableSearch: { classPropertyName: "enableSearch", publicName: "enableSearch", isSignal: true, isRequired: false, transformFunction: null }, disableInitialLoad: { classPropertyName: "disableInitialLoad", publicName: "disableInitialLoad", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageChange: "pageChange", sortChanged: "sortChanged", tableStateChanged: "tableStateChanged", onActionPerformed: "onActionPerformed", filterChanged: "filterChanged", onRowClicked: "onRowClicked" }, queries: [{ propertyName: "headerComponents", predicate: ["filter"] }], viewQueries: [{ propertyName: "portal", first: true, predicate: CdkPortal, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"flex flex-col bg-white rounded-2xl overflow-clip h-full\">\n\n @if (enableSearch() || headerComponents.length > 0) {\n <div class=\"flex px-6 py-5 border-b border-neutral-100 justify-between\">\n @if (enableSearch()) {\n <app-text-input [iconSrc]=\"'assets/icons/search.svg'\"\n placeholder=\"Search...\"\n type=\"search\"\n [fullWidth]=\"false\"\n (changeValue)=\"onSearchTextChanged($event)\">\n </app-text-input>\n }\n <div>\n <ng-content></ng-content>\n </div>\n </div>\n }\n\n <div class=\"grow h-full w-full min-w-full bg-white overflow-x-auto\">\n <table class=\"h-min w-full\"\n [ngClass]=\"[enableHorizontallyScrollable() ? 'overflow-x-auto' : '']\"\n [appTableResizableColumns]=\"enableResizableColumns()\">\n\n <!-- Table header-->\n <thead class=\"sticky top-0 bg-white z-10\">\n <tr sortableTable (sortChange)=\"onSortChanged($event)\" class=\"text-overline text-neutral-500 text-nowrap h-min\">\n\n @if (expandableComponent()) {\n <th class=\"sticky left-0 z-50 bg-white border-b border-gray-200 px-4 py-3\"></th>\n }\n\n @for (column of columnDefs(); track column) {\n @let isColumnVisible = column.visible || column.visible == undefined || false;\n @if (isColumnVisible) {\n <th\n [attr.data-sortable-key]=\"column.sortKey\"\n class=\"relative cursor-pointer border-b border-gray-200 px-4 py-3 text-caption font-semibold text-gray-700 uppercase tracking-wider\"\n [ngClass]=\"getThTrClass(column)\">\n {{ column.title }}\n </th>\n }\n }\n\n @if (enableColumnsConfig()) {\n <th\n class=\"sticky right-0 bg-white flex justify-center cursor-pointer items-center border-b border-gray-200 px-1.5 py-3\">\n <div\n #columnsConfigTriggerElement\n (click)=\"onColumnSettingsClicked(columnsConfigTriggerElement)\"\n class=\"flex justify-center items-center h-[28px] w-[28px] cursor-pointer rounded-full hover:bg-neutral-100 transition-all duration-500\">\n <svg class=\"h-[16px] w-[16px] text-neutral-600\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"\n fill=\"none\">\n <path\n d=\"M12 8C13.0608 8 14.0782 8.42143 14.8284 9.17157C15.5785 9.92172 16 10.9391 16 12C16 13.0609 15.5785 14.0783 14.8284 14.8284C14.0782 15.5786 13.0608 16 12 16C10.9391 16 9.92168 15.5786 9.17153 14.8284C8.42139 14.0783 7.99996 13.0609 7.99996 12C7.99996 10.9391 8.42139 9.92172 9.17153 9.17157C9.92168 8.42143 10.9391 8 12 8ZM12 10C11.4695 10 10.9608 10.2107 10.5857 10.5858C10.2107 10.9609 9.99996 11.4696 9.99996 12C9.99996 12.5304 10.2107 13.0391 10.5857 13.4142C10.9608 13.7893 11.4695 14 12 14C12.5304 14 13.0391 13.7893 13.4142 13.4142C13.7892 13.0391 14 12.5304 14 12C14 11.4696 13.7892 10.9609 13.4142 10.5858C13.0391 10.2107 12.5304 10 12 10ZM9.99996 22C9.74996 22 9.53996 21.82 9.49996 21.58L9.12996 18.93C8.49996 18.68 7.95996 18.34 7.43996 17.94L4.94996 18.95C4.72996 19.03 4.45996 18.95 4.33996 18.73L2.33996 15.27C2.20996 15.05 2.26996 14.78 2.45996 14.63L4.56996 12.97L4.49996 12L4.56996 11L2.45996 9.37C2.26996 9.22 2.20996 8.95 2.33996 8.73L4.33996 5.27C4.45996 5.05 4.72996 4.96 4.94996 5.05L7.43996 6.05C7.95996 5.66 8.49996 5.32 9.12996 5.07L9.49996 2.42C9.53996 2.18 9.74996 2 9.99996 2H14C14.25 2 14.46 2.18 14.5 2.42L14.87 5.07C15.5 5.32 16.04 5.66 16.56 6.05L19.05 5.05C19.27 4.96 19.54 5.05 19.66 5.27L21.66 8.73C21.79 8.95 21.73 9.22 21.54 9.37L19.43 11L19.5 12L19.43 13L21.54 14.63C21.73 14.78 21.79 15.05 21.66 15.27L19.66 18.73C19.54 18.95 19.27 19.04 19.05 18.95L16.56 17.95C16.04 18.34 15.5 18.68 14.87 18.93L14.5 21.58C14.46 21.82 14.25 22 14 22H9.99996ZM11.25 4L10.88 6.61C9.67996 6.86 8.61996 7.5 7.84996 8.39L5.43996 7.35L4.68996 8.65L6.79996 10.2C6.39996 11.37 6.39996 12.64 6.79996 13.8L4.67996 15.36L5.42996 16.66L7.85996 15.62C8.62996 16.5 9.67996 17.14 10.87 17.38L11.24 20H12.76L13.13 17.39C14.32 17.14 15.37 16.5 16.14 15.62L18.57 16.66L19.32 15.36L17.2 13.81C17.6 12.64 17.6 11.37 17.2 10.2L19.31 8.65L18.56 7.35L16.15 8.39C15.38 7.5 14.32 6.86 13.12 6.62L12.75 4H11.25Z\"\n fill=\"currentColor\"/>\n </svg>\n </div>\n </th>\n }\n\n </tr>\n </thead>\n\n <!-- List Items-->\n <tbody class=\"h-min\">\n <ng-content select=\"[body]\"></ng-content>\n </tbody>\n\n <!-- Shimmer-->\n @if (state().initialLoading()) {\n <tbody class=\"bg-white text-center py-14\">\n <tr>\n <td colspan=\"100\" class=\"h-min\">\n <div class=\"flex flex-col gap-6 px-6 py-4\">\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n </div>\n </td>\n </tr>\n </tbody>\n }\n\n <!-- No Table Indicator-->\n @if (state().success() && (state().response()?.data ?? []).length <= 0) {\n <tbody>\n <tr>\n <td colspan=\"1000\">\n <div class=\"flex flex-col justify-center items-center gap-8 px-6 py-8\">\n <app-no-data-table></app-no-data-table>\n </div>\n </td>\n </tr>\n </tbody>\n }\n\n @if ((state().response()?.data ?? []).length > 0) {\n <tbody class=\"\">\n @for (item of state().response()?.data ?? []; track i; let i = $index) {\n <tr (click)=\"_onRowClicked(item)\"\n [ngClass]=\"[enableClickableRows() ? 'hover:bg-neutral-50 cursor-pointer' : '']\">\n\n @if (expandableComponent()) {\n <td class=\"sticky left-0 bg-white z-50 px-1 py-2 border-b border-gray-100 w-min select-none\">\n <div\n (click)=\"onRowExpandedClicked(i)\"\n class=\"mx-auto flex items-center justify-center h-[40px] w-[40px] rounded-full bg-neutral-50 hover:bg-neutral-100 cursor-pointer transition-all duration-500\">\n <svg class=\"h-[20px] w-[20px] text-neutral-500\" xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\">\n <path d=\"M7.41 8.58L12 13.17L16.59 8.58L18 10L12 16L6 10L7.41 8.58Z\" fill=\"currentColor\"/>\n </svg>\n </div>\n </td>\n }\n\n @for (column of columnDefs(); track column) {\n\n @let isColumnVisible = column.visible || column.visible == undefined || false;\n @if (isColumnVisible) {\n <td\n class=\"px-4 py-3 border-b border-gray-100 relative text-body2 text-gray-800\"\n [ngClass]=\"[getThTrClass(column)]\">\n\n @switch (column.type) {\n @default {\n <span class=\"text-body2 text-neutral-700\"\n [ngClass]=\"column.textConfig?.textColorClass\">{{ getPropertyValue(item, column) }}</span>\n }\n @case ('text') {\n <span class=\"text-body2 text-neutral-700 text-nowrap\"\n [ngClass]=\"column.textConfig?.textColorClass\">{{ getPropertyValue(item, column) }}</span>\n }\n @case ('date') {\n <div class=\"flex items-center gap-3\" [ngClass]=\"[getFlexJustify(column)]\">\n @if (column.dateConfig?.showIcon == undefined ? true : (column.dateConfig?.showIcon)) {\n <svg class=\"h-4 w-4 text-neutral-500\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"\n fill=\"none\">\n <path\n d=\"M19 19H5V8H19M16 1V3H8V1H6V3H5C3.89 3 3 3.89 3 5V19C3 19.5304 3.21071 20.0391 3.58579 20.4142C3.96086 20.7893 4.46957 21 5 21H19C19.5304 21 20.0391 20.7893 20.4142 20.4142C20.7893 20.0391 21 19.5304 21 19V5C21 3.89 20.1 3 19 3H18V1M17 12H12V17H17V12Z\"\n fill=\"currentColor\"/>\n </svg>\n }\n\n @let date = getPropertyValue(item, column);\n @if (date && date != 'null') {\n <span\n class=\"text-body2 text-nowrap\">{{ date | date:column.dateConfig?.dateFormat ?? 'MMM d, y, h:mm a' }}</span>\n }\n </div>\n }\n @case ('badge') {\n @let badgeProperty = getBadgeProperty(item, column);\n <div class=\"flex items-center\" [ngClass]=\"getFlexJustify(column)\">\n <app-status-badge [backgroundColorClass]=\"badgeProperty?.backgroundColorClass ?? null\"\n [indicatorColor]=\"badgeProperty?.indicatorColorClass ?? null\"\n [borderColorClass]=\"badgeProperty?.borderColorClass ?? null\"\n [textColorClass]=\"badgeProperty?.textColorClass ?? null\"\n [isUpperCase]=\"true\"\n [status]=\"badgeProperty?.displayText ?? 'Unknown'\">\n </app-status-badge>\n </div>\n }\n @case ('custom') {\n @if (column.component) {\n <div class=\"flex items-center\">\n <app-dynamic-renderer\n [component]=\"column.component\"\n [rowData]=\"item\"\n [data]=\"column.customConfig?.data\"\n [rowPosition]=\"$index + 1\"\n [isLastRow]=\"$last\"\n (actionPerformed)=\"onRowActionPerformed($event)\">\n </app-dynamic-renderer>\n </div>\n }\n }\n @case ('actions') {\n\n <div class=\"flex items-center gap-3\" [ngClass]=\"getFlexJustify(column)\">\n @if (column.actionsConfig?.iconActions) {\n @for (iconAction of column.actionsConfig?.iconActions ?? []; track iconAction) {\n <div\n (click)=\"_onActionClicked(iconAction.actionKey, item, $event)\"\n class=\"flex items-center justify-center h-[36px] w-[36px] cursor-pointer rounded-full hover:bg-neutral-100\">\n <!-- <app-svg-icon class=\"text-neutral-500\"-->\n <!-- [matTooltip]=\"iconAction.label\"-->\n <!-- matTooltipClass=\"mt-2\"-->\n <!-- [src]=\"iconAction.iconPath\"-->\n <!-- [size]=\"20\"></app-svg-icon>-->\n <app-svg-icon class=\"text-neutral-500\"\n [src]=\"iconAction.iconPath\"\n [size]=\"20\"></app-svg-icon>\n </div>\n }\n }\n @if (column.actionsConfig?.threeDotMenuActions) {\n <app-context-menu-button (onActionClicked)=\"_onActionClicked($event, item, null)\"\n [actions]=\"getContextMenuActions(column.actionsConfig?.threeDotMenuActions ?? [])\"></app-context-menu-button>\n }\n\n @if (column.actionsConfig?.textMenuActions) {\n @for (textAction of column.actionsConfig?.textMenuActions ?? []; track textAction) {\n <app-text-button-small\n (click)=\"_onActionClicked(textAction.actionKey, item, $event)\">{{ textAction.label }}\n </app-text-button-small>\n }\n }\n\n @if (column.actionsConfig?.components) {\n <div class=\"flex items-center\">\n @for (component of (column.actionsConfig?.components ?? []); track $index) {\n <app-dynamic-renderer\n [component]=\"component\"\n [rowData]=\"item\"\n [data]=\"column.customConfig?.data\"\n [rowPosition]=\"$index + 1\"\n [isLastRow]=\"$last\"\n (actionPerformed)=\"onRowActionPerformed($event)\">\n </app-dynamic-renderer>\n }\n </div>\n }\n\n </div>\n\n }\n\n }\n\n </td>\n }\n\n }\n\n @if (enableColumnsConfig()) {\n <td\n class=\"px-1 py-3 border-b border-gray-100 w-min\">\n </td>\n }\n </tr>\n\n @if (expandableComponent()) {\n @if (i == expandedRowIndex()) {\n <tr class=\"transition-all duration-700\">\n <td colspan=\"100\">\n <div class=\"mx-4 my-4 p-4 bg-neutral-50 rounded-lg\">\n <app-dynamic-renderer\n [component]=\"expandableComponent()\"\n [rowData]=\"item\"\n (actionPerformed)=\"onCellActionPerformed($event)\">\n </app-dynamic-renderer>\n </div>\n\n </td>\n </tr>\n }\n }\n\n }\n\n </tbody>\n }\n\n <tbody class=\"h-full\"></tbody>\n\n\n </table>\n </div>\n\n <app-pagination\n [pageSize]=\"pageSize()\"\n [totalItems]=\"state().response()?.totalCount ?? 0\"\n (pageChange)=\"onPageChange($event)\">\n </app-pagination>\n</div>\n\n<ng-template cdkPortal>\n <div\n class=\"flex flex-col gap-3 px-2 py-2 bg-white rounded-md max-h-[400px] border border-neutral-200 shadow-2\">\n <div class=\"flex flex-col overflow-y-scroll\">\n @for (column of columnDefs(); track column; let index = $index) {\n @if (column.type != 'actions') {\n <div class=\"grow flex items-center min-w-[200px] px-1\">\n @let isColumnVisible = column.visible || column.visible == undefined || false;\n <app-checkbox [title]=\"column.title\" [ngModel]=\"isColumnVisible\"\n (valueChanged)=\"onColumnVisibleOrHide($event, column)\"></app-checkbox>\n </div>\n }\n }\n </div>\n\n <span (click)=\"onSelectAllColumnClicked()\" class=\"px-4 text-overline text-info-500 cursor-pointer\">Select All</span>\n </div>\n</ng-template>\n\n", styles: [""], dependencies: [{ kind: "component", type: PaginationComponent, selector: "app-pagination", inputs: ["totalItems", "pageSizeOptions", "pageSize"], outputs: ["pageChange"] }, { kind: "component", type: NoDataTableComponent, selector: "app-no-data-table", inputs: ["message"] }, { kind: "component", type: ShimmerComponent, selector: "app-shimmer", inputs: ["type", "count"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "component", type: AppSvgIconComponent, selector: "app-svg-icon", inputs: ["src", "stretch", "size", "svgStyle"] }, { kind: "component", type: StatusBadgeComponent, selector: "app-status-badge", inputs: ["status", "backgroundColorClass", "indicatorColor", "textColorClass", "borderColorClass", "isUpperCase"] }, { kind: "directive", type: SortableTableDirective, selector: "[sortableTable]", outputs: ["sortChange"] }, { kind: "directive", type: TableResizableColumnsDirective, selector: "[appTableResizableColumns]", inputs: ["appTableResizableColumns"] }, { kind: "directive", type: CdkPortal, selector: "[cdkPortal]", exportAs: ["cdkPortal"] }, { kind: "component", type: CheckboxComponent, selector: "app-checkbox", inputs: ["title"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: TextInputComponent, selector: "app-text-input", inputs: ["appearance", "type", "viewType", "iconSrc", "actionIcon", "label", "fullWidth", "placeholder", "errorMessages", "showErrorSpace", "mask", "debounceSearchEnabled"], outputs: ["changeValue", "actionIconClicked"] }, { kind: "component", type: TextButtonSmall, selector: "app-text-button-small" }, { kind: "component", type: DynamicRendererComponent, selector: "app-dynamic-renderer", inputs: ["component", "rowData", "data", "rowPosition", "isLastRow"], outputs: ["actionPerformed"] }, { kind: "component", type: ContextMenuButtonComponent, selector: "app-context-menu-button", inputs: ["actions", "positionPreference"], outputs: ["onActionClicked"] }] });
|
|
3097
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.7", type: DataTableComponent, isStandalone: true, selector: "app-data-table", inputs: { columnDefs: { classPropertyName: "columnDefs", publicName: "columnDefs", isSignal: true, isRequired: true, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, enableHorizontallyScrollable: { classPropertyName: "enableHorizontallyScrollable", publicName: "enableHorizontallyScrollable", isSignal: true, isRequired: false, transformFunction: null }, enableResizableColumns: { classPropertyName: "enableResizableColumns", publicName: "enableResizableColumns", isSignal: true, isRequired: false, transformFunction: null }, enableClickableRows: { classPropertyName: "enableClickableRows", publicName: "enableClickableRows", isSignal: true, isRequired: false, transformFunction: null }, expandableComponent: { classPropertyName: "expandableComponent", publicName: "expandableComponent", isSignal: true, isRequired: false, transformFunction: null }, enableColumnsConfig: { classPropertyName: "enableColumnsConfig", publicName: "enableColumnsConfig", isSignal: true, isRequired: false, transformFunction: null }, filterComponent: { classPropertyName: "filterComponent", publicName: "filterComponent", isSignal: true, isRequired: false, transformFunction: null }, enableSearch: { classPropertyName: "enableSearch", publicName: "enableSearch", isSignal: true, isRequired: false, transformFunction: null }, disableInitialLoad: { classPropertyName: "disableInitialLoad", publicName: "disableInitialLoad", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageChange: "pageChange", sortChanged: "sortChanged", tableStateChanged: "tableStateChanged", onActionPerformed: "onActionPerformed", filterChanged: "filterChanged", onRowClicked: "onRowClicked" }, queries: [{ propertyName: "headerComponents", predicate: ["filter"] }], viewQueries: [{ propertyName: "portal", first: true, predicate: CdkPortal, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"flex flex-col bg-white rounded-2xl overflow-clip h-full\">\n\n @if (enableSearch() || headerComponents.length > 0) {\n <div class=\"flex px-6 py-5 border-b border-neutral-100 justify-between\">\n @if (enableSearch()) {\n <app-text-input [iconSrc]=\"'assets/icons/search.svg'\"\n placeholder=\"Search...\"\n type=\"search\"\n [fullWidth]=\"false\"\n (changeValue)=\"onSearchTextChanged($event)\">\n </app-text-input>\n }\n <div>\n <ng-content></ng-content>\n </div>\n </div>\n }\n\n <div class=\"grow h-full w-full min-w-full bg-white overflow-x-auto\">\n <table class=\"h-min w-full\"\n [ngClass]=\"[enableHorizontallyScrollable() ? 'overflow-x-auto' : '']\"\n [appTableResizableColumns]=\"enableResizableColumns()\">\n\n <!-- Table header-->\n <thead class=\"sticky top-0 bg-white z-10\">\n <tr sortableTable (sortChange)=\"onSortChanged($event)\" class=\"text-overline text-neutral-500 text-nowrap h-min\">\n\n @if (expandableComponent()) {\n <th class=\"sticky left-0 z-50 bg-white border-b border-gray-200 px-4 py-3\"></th>\n }\n\n @for (column of columnDefs(); track column) {\n @let isColumnVisible = column.visible || column.visible == undefined || false;\n @if (isColumnVisible) {\n <th\n [attr.data-sortable-key]=\"column.sortKey\"\n class=\"relative cursor-pointer border-b border-gray-200 px-4 py-3 text-caption font-semibold text-gray-700 uppercase tracking-wider\"\n [ngClass]=\"getThTrClass(column)\">\n {{ column.title }}\n </th>\n }\n }\n\n @if (enableColumnsConfig()) {\n <th\n class=\"sticky right-0 bg-white flex justify-center cursor-pointer items-center border-b border-gray-200 px-1.5 py-3\">\n <div\n #columnsConfigTriggerElement\n (click)=\"onColumnSettingsClicked(columnsConfigTriggerElement)\"\n class=\"flex justify-center items-center h-[28px] w-[28px] cursor-pointer rounded-full hover:bg-neutral-100 transition-all duration-500\">\n <svg class=\"h-[16px] w-[16px] text-neutral-600\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"\n fill=\"none\">\n <path\n d=\"M12 8C13.0608 8 14.0782 8.42143 14.8284 9.17157C15.5785 9.92172 16 10.9391 16 12C16 13.0609 15.5785 14.0783 14.8284 14.8284C14.0782 15.5786 13.0608 16 12 16C10.9391 16 9.92168 15.5786 9.17153 14.8284C8.42139 14.0783 7.99996 13.0609 7.99996 12C7.99996 10.9391 8.42139 9.92172 9.17153 9.17157C9.92168 8.42143 10.9391 8 12 8ZM12 10C11.4695 10 10.9608 10.2107 10.5857 10.5858C10.2107 10.9609 9.99996 11.4696 9.99996 12C9.99996 12.5304 10.2107 13.0391 10.5857 13.4142C10.9608 13.7893 11.4695 14 12 14C12.5304 14 13.0391 13.7893 13.4142 13.4142C13.7892 13.0391 14 12.5304 14 12C14 11.4696 13.7892 10.9609 13.4142 10.5858C13.0391 10.2107 12.5304 10 12 10ZM9.99996 22C9.74996 22 9.53996 21.82 9.49996 21.58L9.12996 18.93C8.49996 18.68 7.95996 18.34 7.43996 17.94L4.94996 18.95C4.72996 19.03 4.45996 18.95 4.33996 18.73L2.33996 15.27C2.20996 15.05 2.26996 14.78 2.45996 14.63L4.56996 12.97L4.49996 12L4.56996 11L2.45996 9.37C2.26996 9.22 2.20996 8.95 2.33996 8.73L4.33996 5.27C4.45996 5.05 4.72996 4.96 4.94996 5.05L7.43996 6.05C7.95996 5.66 8.49996 5.32 9.12996 5.07L9.49996 2.42C9.53996 2.18 9.74996 2 9.99996 2H14C14.25 2 14.46 2.18 14.5 2.42L14.87 5.07C15.5 5.32 16.04 5.66 16.56 6.05L19.05 5.05C19.27 4.96 19.54 5.05 19.66 5.27L21.66 8.73C21.79 8.95 21.73 9.22 21.54 9.37L19.43 11L19.5 12L19.43 13L21.54 14.63C21.73 14.78 21.79 15.05 21.66 15.27L19.66 18.73C19.54 18.95 19.27 19.04 19.05 18.95L16.56 17.95C16.04 18.34 15.5 18.68 14.87 18.93L14.5 21.58C14.46 21.82 14.25 22 14 22H9.99996ZM11.25 4L10.88 6.61C9.67996 6.86 8.61996 7.5 7.84996 8.39L5.43996 7.35L4.68996 8.65L6.79996 10.2C6.39996 11.37 6.39996 12.64 6.79996 13.8L4.67996 15.36L5.42996 16.66L7.85996 15.62C8.62996 16.5 9.67996 17.14 10.87 17.38L11.24 20H12.76L13.13 17.39C14.32 17.14 15.37 16.5 16.14 15.62L18.57 16.66L19.32 15.36L17.2 13.81C17.6 12.64 17.6 11.37 17.2 10.2L19.31 8.65L18.56 7.35L16.15 8.39C15.38 7.5 14.32 6.86 13.12 6.62L12.75 4H11.25Z\"\n fill=\"currentColor\"/>\n </svg>\n </div>\n </th>\n }\n\n </tr>\n </thead>\n\n <!-- List Items-->\n <tbody class=\"h-min\">\n <ng-content select=\"[body]\"></ng-content>\n </tbody>\n\n <!-- Shimmer-->\n @if (state().initialLoading()) {\n <tbody class=\"bg-white text-center py-14\">\n <tr>\n <td colspan=\"100\" class=\"h-min\">\n <div class=\"flex flex-col gap-6 px-6 py-4\">\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n </div>\n </td>\n </tr>\n </tbody>\n }\n\n <!-- No Table Indicator-->\n @if (state().success() && (state().response()?.data ?? []).length <= 0) {\n <tbody>\n <tr>\n <td colspan=\"1000\">\n <div class=\"flex flex-col justify-center items-center gap-8 px-6 py-8\">\n <app-no-data-table></app-no-data-table>\n </div>\n </td>\n </tr>\n </tbody>\n }\n\n @if ((state().response()?.data ?? []).length > 0) {\n <tbody class=\"\">\n @for (item of state().response()?.data ?? []; track i; let i = $index) {\n <tr (click)=\"_onRowClicked(item)\"\n [ngClass]=\"[enableClickableRows() ? 'hover:bg-neutral-50 cursor-pointer' : '']\">\n\n @if (expandableComponent()) {\n <td class=\"sticky left-0 bg-white z-50 px-1 py-2 border-b border-gray-100 w-min select-none\">\n <div\n (click)=\"onRowExpandedClicked(i)\"\n class=\"mx-auto flex items-center justify-center h-[40px] w-[40px] rounded-full bg-neutral-50 hover:bg-neutral-100 cursor-pointer transition-all duration-500\">\n <svg class=\"h-[20px] w-[20px] text-neutral-500\" xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\">\n <path d=\"M7.41 8.58L12 13.17L16.59 8.58L18 10L12 16L6 10L7.41 8.58Z\" fill=\"currentColor\"/>\n </svg>\n </div>\n </td>\n }\n\n @for (column of columnDefs(); track column) {\n\n @let isColumnVisible = column.visible || column.visible == undefined || false;\n @if (isColumnVisible) {\n <td\n class=\"px-4 py-3 border-b border-gray-100 relative text-body2 text-gray-800\"\n [ngClass]=\"[getThTrClass(column)]\">\n\n @switch (column.type) {\n @default {\n <span class=\"text-body2 text-neutral-700\"\n [ngClass]=\"column.textConfig?.textColorClass\">{{ getPropertyValue(item, column) }}</span>\n }\n @case ('text') {\n <span class=\"text-body2 text-neutral-700 text-nowrap\"\n [ngClass]=\"column.textConfig?.textColorClass\">{{ getPropertyValue(item, column) }}</span>\n }\n @case ('date') {\n <div class=\"flex items-center gap-3\" [ngClass]=\"[getFlexJustify(column)]\">\n @if (column.dateConfig?.showIcon == undefined ? true : (column.dateConfig?.showIcon)) {\n <svg class=\"h-4 w-4 text-neutral-500\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"\n fill=\"none\">\n <path\n d=\"M19 19H5V8H19M16 1V3H8V1H6V3H5C3.89 3 3 3.89 3 5V19C3 19.5304 3.21071 20.0391 3.58579 20.4142C3.96086 20.7893 4.46957 21 5 21H19C19.5304 21 20.0391 20.7893 20.4142 20.4142C20.7893 20.0391 21 19.5304 21 19V5C21 3.89 20.1 3 19 3H18V1M17 12H12V17H17V12Z\"\n fill=\"currentColor\"/>\n </svg>\n }\n\n @let date = getPropertyValue(item, column);\n @if (date && date != 'null') {\n <span\n class=\"text-body2 text-nowrap\">{{ date | date:column.dateConfig?.dateFormat ?? 'MMM d, y, h:mm a' }}</span>\n }\n </div>\n }\n @case ('badge') {\n @let badgeProperty = getBadgeProperty(item, column);\n <div class=\"flex items-center\" [ngClass]=\"getFlexJustify(column)\">\n <app-status-badge [backgroundColorClass]=\"badgeProperty?.backgroundColorClass ?? null\"\n [indicatorColor]=\"badgeProperty?.indicatorColorClass ?? null\"\n [borderColorClass]=\"badgeProperty?.borderColorClass ?? null\"\n [textColorClass]=\"badgeProperty?.textColorClass ?? null\"\n [isUpperCase]=\"true\"\n [status]=\"badgeProperty?.displayText ?? 'Unknown'\">\n </app-status-badge>\n </div>\n }\n @case ('custom') {\n @if (column.component) {\n <div class=\"flex items-center\">\n <app-dynamic-renderer\n [component]=\"column.component\"\n [rowData]=\"item\"\n [data]=\"column.customConfig?.data\"\n [rowPosition]=\"$index + 1\"\n [isLastRow]=\"$last\"\n (actionPerformed)=\"onRowActionPerformed($event)\">\n </app-dynamic-renderer>\n </div>\n }\n }\n @case ('actions') {\n\n <div class=\"flex items-center gap-3\" [ngClass]=\"getFlexJustify(column)\">\n @if (column.actionsConfig?.iconActions) {\n @for (iconAction of column.actionsConfig?.iconActions ?? []; track iconAction) {\n <div\n (click)=\"_onActionClicked(iconAction.actionKey, item, $event)\"\n class=\"flex items-center justify-center h-[36px] w-[36px] cursor-pointer rounded-full hover:bg-neutral-100\">\n <!-- <app-svg-icon class=\"text-neutral-500\"-->\n <!-- [matTooltip]=\"iconAction.label\"-->\n <!-- matTooltipClass=\"mt-2\"-->\n <!-- [src]=\"iconAction.iconPath\"-->\n <!-- [size]=\"20\"></app-svg-icon>-->\n <app-svg-icon class=\"text-neutral-500\"\n [src]=\"iconAction.iconPath\"\n [size]=\"20\"></app-svg-icon>\n </div>\n }\n }\n @if (column.actionsConfig?.threeDotMenuActions) {\n <app-context-menu-button (onActionClicked)=\"_onActionClicked($event, item, null)\"\n [actions]=\"getContextMenuActions(column.actionsConfig?.threeDotMenuActions ?? [])\"></app-context-menu-button>\n }\n\n @if (column.actionsConfig?.textMenuActions) {\n @for (textAction of column.actionsConfig?.textMenuActions ?? []; track textAction) {\n <app-text-button-small\n (click)=\"_onActionClicked(textAction.actionKey, item, $event)\">{{ textAction.label }}\n </app-text-button-small>\n }\n }\n\n @if (column.actionsConfig?.components) {\n <div class=\"flex items-center\">\n @for (component of (column.actionsConfig?.components ?? []); track $index) {\n <app-dynamic-renderer\n [component]=\"component\"\n [rowData]=\"item\"\n [data]=\"column.customConfig?.data\"\n [rowPosition]=\"$index + 1\"\n [isLastRow]=\"$last\"\n (actionPerformed)=\"onRowActionPerformed($event)\">\n </app-dynamic-renderer>\n }\n </div>\n }\n\n </div>\n\n }\n\n }\n\n </td>\n }\n\n }\n\n @if (enableColumnsConfig()) {\n <td\n class=\"px-1 py-3 border-b border-gray-100 w-min\">\n </td>\n }\n </tr>\n\n @if (expandableComponent()) {\n @if (i == expandedRowIndex()) {\n <tr class=\"transition-all duration-700\">\n <td colspan=\"100\">\n <div class=\"mx-4 my-4 p-4 bg-neutral-50 rounded-lg\">\n <app-dynamic-renderer\n [component]=\"expandableComponent()\"\n [rowData]=\"item\"\n (actionPerformed)=\"onCellActionPerformed($event)\">\n </app-dynamic-renderer>\n </div>\n\n </td>\n </tr>\n }\n }\n\n }\n\n </tbody>\n }\n\n <tbody class=\"h-full\"></tbody>\n\n\n </table>\n </div>\n\n <app-pagination\n [pageSize]=\"pageSize()\"\n [totalItems]=\"state().response()?.totalCount ?? 0\"\n (pageChange)=\"onPageChange($event)\">\n </app-pagination>\n</div>\n\n<ng-template cdkPortal>\n <div\n class=\"flex flex-col gap-3 px-2 py-2 bg-white rounded-md max-h-[400px] border border-neutral-200 shadow-2\">\n <div class=\"flex flex-col overflow-y-scroll\">\n @for (column of columnDefs(); track column; let index = $index) {\n @if (column.type != 'actions') {\n <div class=\"grow flex items-center min-w-[200px] px-1\">\n @let isColumnVisible = column.visible || column.visible == undefined || false;\n <app-checkbox [title]=\"column.title\" [ngModel]=\"isColumnVisible\"\n (valueChanged)=\"onColumnVisibleOrHide($event, column)\"></app-checkbox>\n </div>\n }\n }\n </div>\n\n <span (click)=\"onSelectAllColumnClicked()\" class=\"px-4 text-overline text-info-500 cursor-pointer\">Select All</span>\n </div>\n</ng-template>\n\n", styles: [""], dependencies: [{ kind: "component", type: PaginationComponent, selector: "app-pagination", inputs: ["totalItems", "pageSizeOptions", "pageSize"], outputs: ["pageChange"] }, { kind: "component", type: NoDataTableComponent, selector: "app-no-data-table", inputs: ["message"] }, { kind: "component", type: ShimmerComponent, selector: "app-shimmer", inputs: ["type", "count"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "component", type: AppSvgIconComponent, selector: "app-svg-icon", inputs: ["src", "stretch", "size", "svgStyle"] }, { kind: "component", type: StatusBadgeComponent, selector: "app-status-badge", inputs: ["status", "backgroundColorClass", "indicatorColor", "textColorClass", "borderColorClass", "isUpperCase"] }, { kind: "directive", type: SortableTableDirective, selector: "[sortableTable]", outputs: ["sortChange"] }, { kind: "directive", type: TableResizableColumnsDirective, selector: "[appTableResizableColumns]", inputs: ["appTableResizableColumns"] }, { kind: "directive", type: CdkPortal, selector: "[cdkPortal]", exportAs: ["cdkPortal"] }, { kind: "component", type: CheckboxComponent, selector: "app-checkbox", inputs: ["title"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: TextInputComponent, selector: "app-text-input", inputs: ["appearance", "type", "viewType", "iconSrc", "actionIcon", "label", "fullWidth", "placeholder", "errorMessages", "showErrorSpace", "mask", "debounceSearchEnabled", "autoFocus"], outputs: ["changeValue", "actionIconClicked"] }, { kind: "component", type: TextButtonSmall, selector: "app-text-button-small" }, { kind: "component", type: DynamicRendererComponent, selector: "app-dynamic-renderer", inputs: ["component", "rowData", "data", "rowPosition", "isLastRow"], outputs: ["actionPerformed"] }, { kind: "component", type: ContextMenuButtonComponent, selector: "app-context-menu-button", inputs: ["actions", "positionPreference"], outputs: ["onActionClicked"] }] });
|
|
2233
3098
|
}
|
|
2234
3099
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: DataTableComponent, decorators: [{
|
|
2235
3100
|
type: Component,
|
|
@@ -2317,7 +3182,7 @@ class ListviewComponent {
|
|
|
2317
3182
|
this.onActionPerformed.emit($event);
|
|
2318
3183
|
}
|
|
2319
3184
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ListviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2320
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.7", type: ListviewComponent, isStandalone: true, selector: "app-listview", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, component: { classPropertyName: "component", publicName: "component", isSignal: true, isRequired: true, transformFunction: null }, enableSearch: { classPropertyName: "enableSearch", publicName: "enableSearch", isSignal: true, isRequired: false, transformFunction: null }, enableSearchFullWidth: { classPropertyName: "enableSearchFullWidth", publicName: "enableSearchFullWidth", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onStateChanged: "onStateChanged", onActionPerformed: "onActionPerformed" }, ngImport: i0, template: "<div class=\"h-full flex flex-col gap-4\">\n\n @if (enableSearch()) {\n <app-text-input\n title=\"Search...\"\n [iconSrc]=\"'assets/icons/search.svg'\"\n placeholder=\"Search...\"\n type=\"search\"\n [fullWidth]=\"enableSearchFullWidth()\"\n (changeValue)=\"onSearchTextChanged($event)\">\n </app-text-input>\n }\n\n @if (state().success() && state().items().length <= 0) {\n <div class=\"flex flex-col justify-center items-center gap-8 px-6 py-8\">\n <app-no-data-table></app-no-data-table>\n </div>\n }\n\n @if (state().items().length > 0) {\n <div class=\"flex flex-col overflow-auto\"\n infiniteScroll\n [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\">\n @for (item of state().items(); track $index) {\n <app-dynamic-renderer\n [component]=\"component()\"\n [rowData]=\"item\"\n [data]=\"data()\"\n [rowPosition]=\"$index\"\n [isLastRow]=\"$last\"\n (actionPerformed)=\"onRowAction($event)\">\n </app-dynamic-renderer>\n }\n </div>\n }\n\n <!-- Shimmer-->\n @if (state().loading()) {\n <div class=\"flex flex-col gap-6 py-4\">\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n </div>\n }\n\n\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }, { kind: "component", type: TextInputComponent, selector: "app-text-input", inputs: ["appearance", "type", "viewType", "iconSrc", "actionIcon", "label", "fullWidth", "placeholder", "errorMessages", "showErrorSpace", "mask", "debounceSearchEnabled"], outputs: ["changeValue", "actionIconClicked"] }, { kind: "component", type: DynamicRendererComponent, selector: "app-dynamic-renderer", inputs: ["component", "rowData", "data", "rowPosition", "isLastRow"], outputs: ["actionPerformed"] }, { kind: "component", type: ShimmerComponent, selector: "app-shimmer", inputs: ["type", "count"] }, { kind: "component", type: NoDataTableComponent, selector: "app-no-data-table", inputs: ["message"] }] });
|
|
3185
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.7", type: ListviewComponent, isStandalone: true, selector: "app-listview", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, component: { classPropertyName: "component", publicName: "component", isSignal: true, isRequired: true, transformFunction: null }, enableSearch: { classPropertyName: "enableSearch", publicName: "enableSearch", isSignal: true, isRequired: false, transformFunction: null }, enableSearchFullWidth: { classPropertyName: "enableSearchFullWidth", publicName: "enableSearchFullWidth", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onStateChanged: "onStateChanged", onActionPerformed: "onActionPerformed" }, ngImport: i0, template: "<div class=\"h-full flex flex-col gap-4\">\n\n @if (enableSearch()) {\n <app-text-input\n title=\"Search...\"\n [iconSrc]=\"'assets/icons/search.svg'\"\n placeholder=\"Search...\"\n type=\"search\"\n [fullWidth]=\"enableSearchFullWidth()\"\n (changeValue)=\"onSearchTextChanged($event)\">\n </app-text-input>\n }\n\n @if (state().success() && state().items().length <= 0) {\n <div class=\"flex flex-col justify-center items-center gap-8 px-6 py-8\">\n <app-no-data-table></app-no-data-table>\n </div>\n }\n\n @if (state().items().length > 0) {\n <div class=\"flex flex-col overflow-auto\"\n infiniteScroll\n [infiniteScrollDistance]=\"2\"\n [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\">\n @for (item of state().items(); track $index) {\n <app-dynamic-renderer\n [component]=\"component()\"\n [rowData]=\"item\"\n [data]=\"data()\"\n [rowPosition]=\"$index\"\n [isLastRow]=\"$last\"\n (actionPerformed)=\"onRowAction($event)\">\n </app-dynamic-renderer>\n }\n </div>\n }\n\n <!-- Shimmer-->\n @if (state().loading()) {\n <div class=\"flex flex-col gap-6 py-4\">\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n <app-shimmer type=\"multiline\"></app-shimmer>\n </div>\n }\n\n\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }, { kind: "component", type: TextInputComponent, selector: "app-text-input", inputs: ["appearance", "type", "viewType", "iconSrc", "actionIcon", "label", "fullWidth", "placeholder", "errorMessages", "showErrorSpace", "mask", "debounceSearchEnabled", "autoFocus"], outputs: ["changeValue", "actionIconClicked"] }, { kind: "component", type: DynamicRendererComponent, selector: "app-dynamic-renderer", inputs: ["component", "rowData", "data", "rowPosition", "isLastRow"], outputs: ["actionPerformed"] }, { kind: "component", type: ShimmerComponent, selector: "app-shimmer", inputs: ["type", "count"] }, { kind: "component", type: NoDataTableComponent, selector: "app-no-data-table", inputs: ["message"] }] });
|
|
2321
3186
|
}
|
|
2322
3187
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: ListviewComponent, decorators: [{
|
|
2323
3188
|
type: Component,
|
|
@@ -5604,5 +6469,5 @@ function provideNglConfig(config) {
|
|
|
5604
6469
|
* Generated bundle index. Do not edit.
|
|
5605
6470
|
*/
|
|
5606
6471
|
|
|
5607
|
-
export { AlertDialogComponent, AppErrorComponent, AppSvgIconComponent, BaseApiService, BaseControlValueAccessor, BaseControlValueAccessorV2, BaseControlValueAccessorV3, BaseInputComponent, BaseOverlayComponent, BaseTableComponent, BreadcrumbComponent, ButtonComponent, CheckboxComponent, ClickOutsideDirective, CloseButtonComponent, ContextMenuButtonComponent, ContextMenuIconComponent, DataTableComponent, DateInputComponent, DatePickerComponent, DatePickerOverlayComponent, DateRangePickerComponent, DateUtils, DropdownComponent, DynamicRendererComponent, EnvBannerComponent, FORM_ERRORS, FileUploaderComponent, FormValidationUtils, HumanizeFormMessagesPipe, InputDateFormat, InvalidControlScrollContainerDirective, InvalidControlScrollDirective, InvalidTokenError, ListviewComponent, LoaderComponent, LoaderService, MultiSelectDropdownAppearance, MultiSelectDropdownComponent, MultiSelectionFieldComponent, NGL_CONFIG, NetworkImageComponent, NglService, NoDataComponent, NoDataTableComponent, NumberInputComponent, OverlayContextMenuComponent, OverlayService, OverlayWizardUtils, PaginationComponent, PaginationState, PhoneNumberInputComponent, RadioButtonComponent, RequestState, ResizableColumnDirective, ResponsiveHelperComponent, SharedConstants, ShimmerComponent, SingleItemPickerInputComponent, SingleSelectionFieldComponent, SortableTableDirective, SpinnerComponent, State, StatusBadgeComponent, SvgUrlIconComponent, SwitchComponent, TableCustomComponent, TableResizableColumnsDirective, TemplateResolverArrayUtil, TemplateResolverFormat, TextAreaInputComponent, TextInputComponent, TimePickerComponent, ToastComponent, ToastService, ToasterComponent, TooltipComponent, UnsavedAwareDirective, arrayToCSV, arrayToSeparator, arrayToSpaceSeparator, deepEqual, defaultErrors, getDynamicTypeStructure, isDynamicType, isValid, jsonEqual, jwtDecode, mmddyyyyDateValidatorAsync, onlyFutureDateValidator, onlyPastDateValidator, openLink, printInvalidFields, provideNglConfig, resolveTemplateWithObject, toSentenceCase };
|
|
6472
|
+
export { AlertDialogComponent, AppErrorComponent, AppSvgIconComponent, BaseApiService, BaseControlValueAccessor, BaseControlValueAccessorV2, BaseControlValueAccessorV3, BaseInputComponent, BaseOverlayComponent, BaseTableComponent, BreadcrumbComponent, ButtonComponent, CheckboxComponent, ClickOutsideDirective, CloseButtonComponent, ColorConverterService, ColorFormats, ColorPickerComponent, ColorPickerDirective, ContextMenuButtonComponent, ContextMenuIconComponent, DataTableComponent, DateInputComponent, DatePickerComponent, DatePickerOverlayComponent, DateRangePickerComponent, DateUtils, DropdownComponent, DynamicRendererComponent, EnvBannerComponent, FORM_ERRORS, FileUploaderComponent, FormValidationUtils, HumanizeFormMessagesPipe, InputDateFormat, InvalidControlScrollContainerDirective, InvalidControlScrollDirective, InvalidTokenError, ListviewComponent, LoaderComponent, LoaderService, MultiSelectDropdownAppearance, MultiSelectDropdownComponent, MultiSelectionFieldComponent, NGL_CONFIG, NetworkImageComponent, NglService, NoDataComponent, NoDataTableComponent, NumberInputComponent, OverlayContextMenuComponent, OverlayService, OverlayWizardUtils, PaginationComponent, PaginationState, PhoneNumberInputComponent, RadioButtonComponent, RequestState, ResizableColumnDirective, ResponsiveHelperComponent, SharedConstants, ShimmerComponent, SingleItemPickerInputComponent, SingleSelectionFieldComponent, SortableTableDirective, SpinnerComponent, State, StatusBadgeComponent, SvgUrlIconComponent, SwitchComponent, TableCustomComponent, TableResizableColumnsDirective, TemplateResolverArrayUtil, TemplateResolverFormat, TextAreaInputComponent, TextInputComponent, TimePickerComponent, ToastComponent, ToastService, ToasterComponent, TooltipComponent, UnsavedAwareDirective, arrayToCSV, arrayToSeparator, arrayToSpaceSeparator, deepEqual, defaultErrors, getDynamicTypeStructure, isDynamicType, isValid, jsonEqual, jwtDecode, mmddyyyyDateValidatorAsync, onlyFutureDateValidator, onlyPastDateValidator, openLink, printInvalidFields, provideNglConfig, resolveTemplateWithObject, toSentenceCase };
|
|
5608
6473
|
//# sourceMappingURL=vallift-ngl.mjs.map
|