lib-portal-angular 0.0.77 → 0.0.79

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.
@@ -1742,10 +1742,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1742
1742
  class InputComponent {
1743
1743
  constructor(authService) {
1744
1744
  this.authService = authService;
1745
- this.label = 'Default Label';
1746
- this.placeholder = '';
1747
- this.id = 'inputId';
1748
- this.type = 'text';
1745
+ this.label = "Default Label";
1746
+ this.placeholder = "";
1747
+ this.id = "inputId";
1748
+ this.type = "text";
1749
1749
  this.disabled = false;
1750
1750
  this.readonly = false;
1751
1751
  this.maxlength = null;
@@ -1760,8 +1760,10 @@ class InputComponent {
1760
1760
  this.validateInput = false;
1761
1761
  this.labelFontWeight = 400;
1762
1762
  this.useMoneyMask = false; // Para ativar/desativar a máscara de moeda
1763
- this.currencyCode = 'BRL'; // Código da moeda
1763
+ this.currencyCode = "BRL"; // Código da moeda
1764
1764
  this.displayCurrencySymbol = true; // Exibir ou não o símbolo da moeda
1765
+ this.prependText = "";
1766
+ this.buttonText = null;
1765
1767
  this.inputEvent = new EventEmitter();
1766
1768
  this.changeEvent = new EventEmitter();
1767
1769
  this.focusEvent = new EventEmitter();
@@ -1769,39 +1771,51 @@ class InputComponent {
1769
1771
  this.keyupEvent = new EventEmitter();
1770
1772
  this.keydownEvent = new EventEmitter();
1771
1773
  this.keypressEvent = new EventEmitter();
1774
+ this.buttonClick = new EventEmitter();
1772
1775
  this.onChangeCallback = () => { };
1773
1776
  this.onTouchedCallback = () => { };
1774
- this.value = '';
1777
+ this.ButtonClasses = ButtonClasses;
1778
+ this.value = "";
1775
1779
  this.showErrorModal = false;
1776
- this.errorMessage = '';
1780
+ this.errorMessage = "";
1777
1781
  this.subscriptions = [];
1778
1782
  }
1779
1783
  getInputType() {
1780
- return this.onlyNumbers ? 'tel' : this.type;
1784
+ return this.onlyNumbers ? "tel" : this.type;
1781
1785
  }
1782
1786
  onInput(event) {
1783
1787
  const inputElement = event.target;
1784
1788
  let inputValue = inputElement.value;
1785
1789
  // Aplica máscara de números se necessário
1786
- if (this.onlyNumbers && !(this.useCpfMask || this.useCnpjMask || this.useCepMask || this.useMoneyMask)) {
1787
- inputValue = inputValue.replace(/\D/g, ''); // Remove todos os não numéricos
1790
+ if (this.onlyNumbers &&
1791
+ !(this.useCpfMask ||
1792
+ this.useCnpjMask ||
1793
+ this.useCepMask ||
1794
+ this.useMoneyMask)) {
1795
+ inputValue = inputValue.replace(/\D/g, ""); // Remove todos os não numéricos
1788
1796
  }
1789
1797
  // Validação imediata para CPF, CNPJ ou CEP
1790
- const numericValue = inputValue.replace(/\D/g, ''); // Remove todos os caracteres não numéricos
1798
+ const numericValue = inputValue.replace(/\D/g, ""); // Remove todos os caracteres não numéricos
1791
1799
  if (this.validateInput) {
1792
- if (this.useCpfMask && numericValue.length === 11 && !this.validateCpf(numericValue)) {
1793
- this.clearAndShowValidationError('CPF inválido. Por favor, insira um CPF correto.');
1800
+ if (this.useCpfMask &&
1801
+ numericValue.length === 11 &&
1802
+ !this.validateCpf(numericValue)) {
1803
+ this.clearAndShowValidationError("CPF inválido. Por favor, insira um CPF correto.");
1794
1804
  }
1795
- else if (this.useCnpjMask && numericValue.length === 14 && !this.validateCnpj(numericValue)) {
1796
- this.clearAndShowValidationError('CNPJ inválido. Por favor, insira um CNPJ correto.');
1805
+ else if (this.useCnpjMask &&
1806
+ numericValue.length === 14 &&
1807
+ !this.validateCnpj(numericValue)) {
1808
+ this.clearAndShowValidationError("CNPJ inválido. Por favor, insira um CNPJ correto.");
1797
1809
  }
1798
- else if (this.useCepMask && numericValue.length === 8 && !this.validateCep(numericValue)) {
1799
- this.clearAndShowValidationError('CEP inválido. Por favor, insira um CEP correto.');
1810
+ else if (this.useCepMask &&
1811
+ numericValue.length === 8 &&
1812
+ !this.validateCep(numericValue)) {
1813
+ this.clearAndShowValidationError("CEP inválido. Por favor, insira um CEP correto.");
1800
1814
  }
1801
1815
  }
1802
1816
  // Máscara de moeda
1803
1817
  if (this.useMoneyMask) {
1804
- const numericValue = inputValue.replace(/\D/g, ''); // Remove todos os não numéricos
1818
+ const numericValue = inputValue.replace(/\D/g, ""); // Remove todos os não numéricos
1805
1819
  const formattedValue = this.formatMoney(numericValue); // Formata como dinheiro ou número decimal
1806
1820
  inputElement.value = formattedValue;
1807
1821
  this.value = formattedValue;
@@ -1815,42 +1829,46 @@ class InputComponent {
1815
1829
  }
1816
1830
  formatMoney(value) {
1817
1831
  if (!value)
1818
- return ''; // Se o valor estiver vazio, retorna uma string vazia
1832
+ return ""; // Se o valor estiver vazio, retorna uma string vazia
1819
1833
  const numericValue = parseFloat(value) / 100;
1820
1834
  // Verifica se deve exibir o símbolo da moeda ou não
1821
1835
  if (this.displayCurrencySymbol) {
1822
1836
  // Formata como moeda
1823
- return new Intl.NumberFormat('pt-BR', {
1824
- style: 'currency',
1825
- currency: this.currencyCode
1837
+ return new Intl.NumberFormat("pt-BR", {
1838
+ style: "currency",
1839
+ currency: this.currencyCode,
1826
1840
  }).format(numericValue);
1827
1841
  }
1828
1842
  else {
1829
1843
  // Formata como número decimal, sem o símbolo da moeda
1830
- return new Intl.NumberFormat('pt-BR', {
1831
- style: 'decimal',
1844
+ return new Intl.NumberFormat("pt-BR", {
1845
+ style: "decimal",
1832
1846
  minimumFractionDigits: 2,
1833
- maximumFractionDigits: 2
1847
+ maximumFractionDigits: 2,
1834
1848
  }).format(numericValue);
1835
1849
  }
1836
1850
  }
1837
1851
  onKeyDown(event) {
1838
- if (this.onlyNumbers && !/^\d$/.test(event.key) && event.key !== 'Backspace' && event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') {
1852
+ if (this.onlyNumbers &&
1853
+ !/^\d$/.test(event.key) &&
1854
+ event.key !== "Backspace" &&
1855
+ event.key !== "ArrowLeft" &&
1856
+ event.key !== "ArrowRight") {
1839
1857
  event.preventDefault();
1840
1858
  }
1841
1859
  }
1842
1860
  onChange(event) {
1843
- const numericValue = this.value.replace(/\D/g, ''); // Remove todos os caracteres não numéricos
1861
+ const numericValue = this.value.replace(/\D/g, ""); // Remove todos os caracteres não numéricos
1844
1862
  // Validação também ocorre no blur para casos onde o input não está completo
1845
1863
  if (this.validateInput) {
1846
1864
  if (this.useCpfMask && !this.validateCpf(numericValue)) {
1847
- this.clearAndShowValidationError('CPF inválido. Por favor, insira um CPF correto.');
1865
+ this.clearAndShowValidationError("CPF inválido. Por favor, insira um CPF correto.");
1848
1866
  }
1849
1867
  else if (this.useCnpjMask && !this.validateCnpj(numericValue)) {
1850
- this.clearAndShowValidationError('CNPJ inválido. Por favor, insira um CNPJ correto.');
1868
+ this.clearAndShowValidationError("CNPJ inválido. Por favor, insira um CNPJ correto.");
1851
1869
  }
1852
1870
  else if (this.useCepMask && !this.validateCep(numericValue)) {
1853
- this.clearAndShowValidationError('CEP inválido. Por favor, insira um CEP correto.');
1871
+ this.clearAndShowValidationError("CEP inválido. Por favor, insira um CEP correto.");
1854
1872
  }
1855
1873
  }
1856
1874
  this.changeEvent.emit(event);
@@ -1886,7 +1904,7 @@ class InputComponent {
1886
1904
  if (pos < 2)
1887
1905
  pos = 9;
1888
1906
  }
1889
- let result = sum % 11 < 2 ? 0 : 11 - sum % 11;
1907
+ let result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
1890
1908
  if (result !== parseInt(digits.charAt(0)))
1891
1909
  return false;
1892
1910
  length = length + 1;
@@ -1898,21 +1916,21 @@ class InputComponent {
1898
1916
  if (pos < 2)
1899
1917
  pos = 9;
1900
1918
  }
1901
- result = sum % 11 < 2 ? 0 : 11 - sum % 11;
1919
+ result = sum % 11 < 2 ? 0 : 11 - (sum % 11);
1902
1920
  return result === parseInt(digits.charAt(1));
1903
1921
  }
1904
1922
  validateCep(cep) {
1905
1923
  return /^\d{8}$/.test(cep); // Valida apenas números, sem considerar a máscara
1906
1924
  }
1907
1925
  clearAndShowValidationError(message) {
1908
- this.value = ''; // Limpa o valor do ngModel
1926
+ this.value = ""; // Limpa o valor do ngModel
1909
1927
  this.onChangeCallback(this.value); // Atualiza o ngModel com o valor limpo
1910
1928
  this.errorMessage = message;
1911
1929
  this.showErrorModal = true;
1912
1930
  }
1913
1931
  closeModal() {
1914
1932
  this.showErrorModal = false;
1915
- this.errorMessage = '';
1933
+ this.errorMessage = "";
1916
1934
  }
1917
1935
  onFocus(event) {
1918
1936
  this.focusEvent.emit(event);
@@ -1942,35 +1960,38 @@ class InputComponent {
1942
1960
  }
1943
1961
  catch (error) {
1944
1962
  if (error instanceof Error) {
1945
- console.error('Permission error:', error.message);
1963
+ console.error("Permission error:", error.message);
1946
1964
  }
1947
1965
  else {
1948
- console.error('Unknown error occurred during permission check');
1966
+ console.error("Unknown error occurred during permission check");
1949
1967
  }
1950
1968
  return true;
1951
1969
  }
1952
1970
  }
1971
+ onButtonClick() {
1972
+ this.buttonClick.emit();
1973
+ }
1953
1974
  ngOnDestroy() {
1954
- this.subscriptions.forEach(sub => sub.unsubscribe());
1975
+ this.subscriptions.forEach((sub) => sub.unsubscribe());
1955
1976
  }
1956
1977
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputComponent, deps: [{ token: AuthService }], target: i0.ɵɵFactoryTarget.Component }); }
1957
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: InputComponent, selector: "argenta-custom-input", inputs: { label: "label", placeholder: "placeholder", id: "id", type: "type", disabled: "disabled", readonly: "readonly", maxlength: "maxlength", minlength: "minlength", required: "required", pattern: "pattern", autofocus: "autofocus", useCpfMask: "useCpfMask", useCnpjMask: "useCnpjMask", useCepMask: "useCepMask", onlyNumbers: "onlyNumbers", validateInput: "validateInput", labelFontWeight: "labelFontWeight", permissions: "permissions", useMoneyMask: "useMoneyMask", currencyCode: "currencyCode", displayCurrencySymbol: "displayCurrencySymbol" }, outputs: { inputEvent: "inputEvent", changeEvent: "changeEvent", focusEvent: "focusEvent", blurEvent: "blurEvent", keyupEvent: "keyupEvent", keydownEvent: "keydownEvent", keypressEvent: "keypressEvent" }, providers: [
1978
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: InputComponent, selector: "argenta-custom-input", inputs: { label: "label", placeholder: "placeholder", id: "id", type: "type", disabled: "disabled", readonly: "readonly", maxlength: "maxlength", minlength: "minlength", required: "required", pattern: "pattern", autofocus: "autofocus", useCpfMask: "useCpfMask", useCnpjMask: "useCnpjMask", useCepMask: "useCepMask", onlyNumbers: "onlyNumbers", validateInput: "validateInput", labelFontWeight: "labelFontWeight", permissions: "permissions", useMoneyMask: "useMoneyMask", currencyCode: "currencyCode", displayCurrencySymbol: "displayCurrencySymbol", prependText: "prependText", buttonText: "buttonText" }, outputs: { inputEvent: "inputEvent", changeEvent: "changeEvent", focusEvent: "focusEvent", blurEvent: "blurEvent", keyupEvent: "keyupEvent", keydownEvent: "keydownEvent", keypressEvent: "keypressEvent", buttonClick: "buttonClick" }, providers: [
1958
1979
  {
1959
1980
  provide: NG_VALUE_ACCESSOR,
1960
1981
  useExisting: forwardRef(() => InputComponent),
1961
- multi: true
1962
- }
1963
- ], ngImport: i0, template: "<div *ngIf=\"hasPermission()\" class=\"form-group\">\n <label [for]=\"id\" [ngClass]=\"'label-styles'\">{{ label }}</label>\n <input [type]=\"getInputType()\"\n class=\"form-control custom-input\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n [(ngModel)]=\"value\"\n (input)=\"onInput($event)\"\n (change)=\"onChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (keyup)=\"keyupEvent.emit($event)\"\n (keydown)=\"onKeyDown($event)\"\n (keypress)=\"keypressEvent.emit($event)\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [required]=\"required\"\n [attr.pattern]=\"pattern\"\n [autofocus]=\"autofocus\"\n [cpfMask]=\"useCpfMask\" \n [cnpjMask]=\"useCnpjMask\" \n [cepMask]=\"useCepMask\">\n\n <!-- Modal para exibir mensagens de erro -->\n <div class=\"modal-overlay\" *ngIf=\"showErrorModal\">\n <div class=\"modal-content\">\n <span class=\"close\" (click)=\"closeModal()\">&times;</span>\n <p>{{ errorMessage }}</p>\n <button class=\"btn-ok\" (click)=\"closeModal()\">OK</button>\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";.form-group{font-family:var(--font-family);font-size:1rem;font-weight:700}.form-check-input{font-family:var(--font-family);color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:var(--font-family);font-size:16px;line-height:19.36px;text-align:left}.custom-input{font-family:var(--font-family);color:#333;font-size:.9rem;height:46px}.custom-input::placeholder{font-size:14px;color:#d3d3d3}.form-label{font-family:var(--font-family);color:#333;font-size:1rem;font-weight:700}.label-styles{font-weight:400;font-family:var(--font-family);font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#0009;display:flex;align-items:center;justify-content:center;z-index:1000}.modal-content{background:#fff;padding:25px 30px;border-radius:8px;width:360px;text-align:center;position:relative;box-shadow:0 4px 12px #0003}.close{position:absolute;top:10px;right:15px;cursor:pointer;font-size:20px;color:#555;transition:color .3s}.close:hover{color:#f44336}.btn-ok{margin-top:20px;padding:8px 20px;border:none;background-color:#00444c;color:#fff;border-radius:4px;cursor:pointer;font-size:14px;transition:background-color .3s,transform .2s}.btn-ok:hover{background-color:#00363d;transform:scale(1.05)}.btn-ok:active{transform:scale(.98)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: CepMaskDirective, selector: "[cepMask]", inputs: ["cepMask"] }, { kind: "directive", type: CnpjMaskDirective, selector: "[cnpjMask]", inputs: ["cnpjMask"] }, { kind: "directive", type: CpfMaskDirective, selector: "[cpfMask]", inputs: ["cpfMask"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1982
+ multi: true,
1983
+ },
1984
+ ], ngImport: i0, template: "<div *ngIf=\"hasPermission()\" class=\"form-group\">\n <label [for]=\"id\" [ngClass]=\"'label-styles'\">{{ label }}</label>\n <div class=\"input-group\">\n <div *ngIf=\"prependText\" class=\"input-group-prepend\">\n <span\n class=\"input-group-text custom-input-group-text\"\n id=\"basic-addon3\"\n >{{ prependText }}</span\n >\n </div>\n <input\n [type]=\"getInputType()\"\n class=\"form-control custom-input\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n [(ngModel)]=\"value\"\n (input)=\"onInput($event)\"\n (change)=\"onChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (keyup)=\"keyupEvent.emit($event)\"\n (keydown)=\"onKeyDown($event)\"\n (keypress)=\"keypressEvent.emit($event)\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [required]=\"required\"\n [attr.pattern]=\"pattern\"\n [autofocus]=\"autofocus\"\n [cpfMask]=\"useCpfMask\"\n [cnpjMask]=\"useCnpjMask\"\n [cepMask]=\"useCepMask\"\n />\n\n <div class=\"input-group-append\" *ngIf=\"buttonText\">\n <button type=\"button\" class=\"btn-group-append\" (click)=\"onButtonClick()\">\n {{ buttonText }}\n </button>\n </div>\n\n <!-- Modal para exibir mensagens de erro -->\n <div class=\"modal-overlay\" *ngIf=\"showErrorModal\">\n <div class=\"modal-content\">\n <span class=\"close\" (click)=\"closeModal()\">&times;</span>\n <p>{{ errorMessage }}</p>\n <button class=\"btn-ok\" (click)=\"closeModal()\">OK</button>\n </div>\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";.form-group{font-family:var(--font-family);font-size:1rem;font-weight:700}.form-check-input{font-family:var(--font-family);color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:var(--font-family);font-size:16px;line-height:19.36px;text-align:left}.custom-input{font-family:var(--font-family);color:#333;font-size:.9rem;height:46px}.custom-input::placeholder{font-size:14px;color:#d3d3d3}.form-label{font-family:var(--font-family);color:#333;font-size:1rem;font-weight:700}.label-styles{font-weight:400;font-family:var(--font-family);font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#0009;display:flex;align-items:center;justify-content:center;z-index:1000}.modal-content{background:#fff;padding:25px 30px;border-radius:8px;width:360px;text-align:center;position:relative;box-shadow:0 4px 12px #0003}.close{position:absolute;top:10px;right:15px;cursor:pointer;font-size:20px;color:#555;transition:color .3s}.close:hover{color:#f44336}.btn-ok{margin-top:20px;padding:8px 20px;border:none;background-color:#00444c;color:#fff;border-radius:4px;cursor:pointer;font-size:14px;transition:background-color .3s,transform .2s}.btn-ok:hover{background-color:#00363d;transform:scale(1.05)}.btn-ok:active{transform:scale(.98)}.input-group-text{padding:.64rem .75rem;font-family:var(--font-family);color:#6e6e6e;font-size:14px}.btn-group-append{padding:.69rem;font-family:var(--font-family);background-color:var(--secondary-color);border:0rem solid;color:var(--text-color);transition:border-width .2s,transform .1s;font-size:1rem;border-top-right-radius:6px;border-bottom-right-radius:6px}.btn-group-append:hover{background-color:var(--primary-color)}.custom-input-group-text{border-top-right-radius:0;border-bottom-right-radius:0;padding:.71rem .75rem;background-color:#e7e7e7;border:1px solid #dbdbdb}.btn-group-append:active{animation:blink .3s}@keyframes blink{0%{background-color:var(--primary-color);border-color:var(--primary-color)}50%{background-color:var(--secondary-color);border-color:var(--secondary-color)}to{background-color:var(--primary-color);border-color:var(--primary-color)}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: CepMaskDirective, selector: "[cepMask]", inputs: ["cepMask"] }, { kind: "directive", type: CnpjMaskDirective, selector: "[cnpjMask]", inputs: ["cnpjMask"] }, { kind: "directive", type: CpfMaskDirective, selector: "[cpfMask]", inputs: ["cpfMask"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1964
1985
  }
1965
1986
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputComponent, decorators: [{
1966
1987
  type: Component,
1967
- args: [{ selector: 'argenta-custom-input', providers: [
1988
+ args: [{ selector: "argenta-custom-input", providers: [
1968
1989
  {
1969
1990
  provide: NG_VALUE_ACCESSOR,
1970
1991
  useExisting: forwardRef(() => InputComponent),
1971
- multi: true
1972
- }
1973
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"hasPermission()\" class=\"form-group\">\n <label [for]=\"id\" [ngClass]=\"'label-styles'\">{{ label }}</label>\n <input [type]=\"getInputType()\"\n class=\"form-control custom-input\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n [(ngModel)]=\"value\"\n (input)=\"onInput($event)\"\n (change)=\"onChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (keyup)=\"keyupEvent.emit($event)\"\n (keydown)=\"onKeyDown($event)\"\n (keypress)=\"keypressEvent.emit($event)\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [required]=\"required\"\n [attr.pattern]=\"pattern\"\n [autofocus]=\"autofocus\"\n [cpfMask]=\"useCpfMask\" \n [cnpjMask]=\"useCnpjMask\" \n [cepMask]=\"useCepMask\">\n\n <!-- Modal para exibir mensagens de erro -->\n <div class=\"modal-overlay\" *ngIf=\"showErrorModal\">\n <div class=\"modal-content\">\n <span class=\"close\" (click)=\"closeModal()\">&times;</span>\n <p>{{ errorMessage }}</p>\n <button class=\"btn-ok\" (click)=\"closeModal()\">OK</button>\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";.form-group{font-family:var(--font-family);font-size:1rem;font-weight:700}.form-check-input{font-family:var(--font-family);color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:var(--font-family);font-size:16px;line-height:19.36px;text-align:left}.custom-input{font-family:var(--font-family);color:#333;font-size:.9rem;height:46px}.custom-input::placeholder{font-size:14px;color:#d3d3d3}.form-label{font-family:var(--font-family);color:#333;font-size:1rem;font-weight:700}.label-styles{font-weight:400;font-family:var(--font-family);font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#0009;display:flex;align-items:center;justify-content:center;z-index:1000}.modal-content{background:#fff;padding:25px 30px;border-radius:8px;width:360px;text-align:center;position:relative;box-shadow:0 4px 12px #0003}.close{position:absolute;top:10px;right:15px;cursor:pointer;font-size:20px;color:#555;transition:color .3s}.close:hover{color:#f44336}.btn-ok{margin-top:20px;padding:8px 20px;border:none;background-color:#00444c;color:#fff;border-radius:4px;cursor:pointer;font-size:14px;transition:background-color .3s,transform .2s}.btn-ok:hover{background-color:#00363d;transform:scale(1.05)}.btn-ok:active{transform:scale(.98)}\n"] }]
1992
+ multi: true,
1993
+ },
1994
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"hasPermission()\" class=\"form-group\">\n <label [for]=\"id\" [ngClass]=\"'label-styles'\">{{ label }}</label>\n <div class=\"input-group\">\n <div *ngIf=\"prependText\" class=\"input-group-prepend\">\n <span\n class=\"input-group-text custom-input-group-text\"\n id=\"basic-addon3\"\n >{{ prependText }}</span\n >\n </div>\n <input\n [type]=\"getInputType()\"\n class=\"form-control custom-input\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n [(ngModel)]=\"value\"\n (input)=\"onInput($event)\"\n (change)=\"onChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (keyup)=\"keyupEvent.emit($event)\"\n (keydown)=\"onKeyDown($event)\"\n (keypress)=\"keypressEvent.emit($event)\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [required]=\"required\"\n [attr.pattern]=\"pattern\"\n [autofocus]=\"autofocus\"\n [cpfMask]=\"useCpfMask\"\n [cnpjMask]=\"useCnpjMask\"\n [cepMask]=\"useCepMask\"\n />\n\n <div class=\"input-group-append\" *ngIf=\"buttonText\">\n <button type=\"button\" class=\"btn-group-append\" (click)=\"onButtonClick()\">\n {{ buttonText }}\n </button>\n </div>\n\n <!-- Modal para exibir mensagens de erro -->\n <div class=\"modal-overlay\" *ngIf=\"showErrorModal\">\n <div class=\"modal-content\">\n <span class=\"close\" (click)=\"closeModal()\">&times;</span>\n <p>{{ errorMessage }}</p>\n <button class=\"btn-ok\" (click)=\"closeModal()\">OK</button>\n </div>\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";.form-group{font-family:var(--font-family);font-size:1rem;font-weight:700}.form-check-input{font-family:var(--font-family);color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:var(--font-family);font-size:16px;line-height:19.36px;text-align:left}.custom-input{font-family:var(--font-family);color:#333;font-size:.9rem;height:46px}.custom-input::placeholder{font-size:14px;color:#d3d3d3}.form-label{font-family:var(--font-family);color:#333;font-size:1rem;font-weight:700}.label-styles{font-weight:400;font-family:var(--font-family);font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#0009;display:flex;align-items:center;justify-content:center;z-index:1000}.modal-content{background:#fff;padding:25px 30px;border-radius:8px;width:360px;text-align:center;position:relative;box-shadow:0 4px 12px #0003}.close{position:absolute;top:10px;right:15px;cursor:pointer;font-size:20px;color:#555;transition:color .3s}.close:hover{color:#f44336}.btn-ok{margin-top:20px;padding:8px 20px;border:none;background-color:#00444c;color:#fff;border-radius:4px;cursor:pointer;font-size:14px;transition:background-color .3s,transform .2s}.btn-ok:hover{background-color:#00363d;transform:scale(1.05)}.btn-ok:active{transform:scale(.98)}.input-group-text{padding:.64rem .75rem;font-family:var(--font-family);color:#6e6e6e;font-size:14px}.btn-group-append{padding:.69rem;font-family:var(--font-family);background-color:var(--secondary-color);border:0rem solid;color:var(--text-color);transition:border-width .2s,transform .1s;font-size:1rem;border-top-right-radius:6px;border-bottom-right-radius:6px}.btn-group-append:hover{background-color:var(--primary-color)}.custom-input-group-text{border-top-right-radius:0;border-bottom-right-radius:0;padding:.71rem .75rem;background-color:#e7e7e7;border:1px solid #dbdbdb}.btn-group-append:active{animation:blink .3s}@keyframes blink{0%{background-color:var(--primary-color);border-color:var(--primary-color)}50%{background-color:var(--secondary-color);border-color:var(--secondary-color)}to{background-color:var(--primary-color);border-color:var(--primary-color)}}\n"] }]
1974
1995
  }], ctorParameters: function () { return [{ type: AuthService }]; }, propDecorators: { label: [{
1975
1996
  type: Input
1976
1997
  }], placeholder: [{
@@ -2013,6 +2034,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2013
2034
  type: Input
2014
2035
  }], displayCurrencySymbol: [{
2015
2036
  type: Input
2037
+ }], prependText: [{
2038
+ type: Input
2039
+ }], buttonText: [{
2040
+ type: Input
2016
2041
  }], inputEvent: [{
2017
2042
  type: Output
2018
2043
  }], changeEvent: [{
@@ -2027,6 +2052,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2027
2052
  type: Output
2028
2053
  }], keypressEvent: [{
2029
2054
  type: Output
2055
+ }], buttonClick: [{
2056
+ type: Output
2030
2057
  }] } });
2031
2058
 
2032
2059
  class MultiSelectComponent {
@@ -2770,45 +2797,67 @@ class DataTableComponent {
2770
2797
  this.columns = [];
2771
2798
  this.hiddenColumns = [];
2772
2799
  this.defaultItemsPerPage = 10;
2773
- this.itemsPerPageLabel = 'Items per page:';
2800
+ this.itemsPerPageLabel = "Items per page:";
2774
2801
  this.showActionColumn = false;
2775
- this.actionColumnLabel = 'Actions';
2802
+ this.actionColumnLabel = "Actions";
2776
2803
  this.totalItems = 0;
2777
2804
  this.fetchDataFunction = () => {
2778
- return new Observable(subscriber => subscriber.error('Implement the fetchDataFunction to fetch paginated data from the back-end.'));
2805
+ return new Observable((subscriber) => subscriber.error("Implement the fetchDataFunction to fetch paginated data from the back-end."));
2779
2806
  };
2780
2807
  this.editPermissions = [];
2781
2808
  this.deletePermissions = [];
2782
2809
  this.viewPermissions = [];
2783
2810
  this.showPageInfo = true;
2784
- this.pageText = 'Page';
2785
- this.ofText = 'of';
2786
- this.filterDescription = '';
2787
- this.buttonLabel = ''; // Adicionando o Input para o label do botão
2788
- this.sortChange = new EventEmitter();
2811
+ this.pageText = "Page";
2812
+ this.ofText = "of";
2813
+ this.filterDescription = "";
2814
+ this.buttonLabel = "";
2815
+ this.pagedData = [];
2816
+ this.initialFilterField = null;
2789
2817
  this.pageChange = new EventEmitter();
2790
2818
  this.itemsPerPageChange = new EventEmitter();
2791
2819
  this.onEditTable = new EventEmitter();
2792
2820
  this.onDeleteTable = new EventEmitter();
2793
2821
  this.onViewTable = new EventEmitter();
2794
- this.onButtonClick = new EventEmitter(); // Novo evento
2822
+ this.onButtonClick = new EventEmitter();
2823
+ this.filterFieldChange = new EventEmitter();
2795
2824
  this.itemsPerPageOptions = [5, 10, 15, 25];
2796
2825
  this.currentPage = 1;
2797
- this.sortColumn = '';
2798
- this.sortDirection = 'asc';
2799
- this.pagedData = [];
2826
+ this.sortColumn = "";
2827
+ this.sortDirection = "asc";
2828
+ this.selectedSearchField = "";
2800
2829
  this.isLoading = false;
2801
2830
  this.destroy$ = new Subject();
2802
2831
  this.isInitialized = false; // Flag para evitar chamadas duplas
2803
2832
  this.ButtonClasses = ButtonClasses;
2804
2833
  this.labelStyle = {
2805
- 'font-family': 'Inter, Arial, sans-serif',
2806
- 'font-size': '14px',
2807
- 'color': '#000'
2834
+ "font-family": "Inter, Arial, sans-serif",
2835
+ "font-size": "14px",
2836
+ color: "#000",
2808
2837
  };
2809
2838
  }
2810
2839
  ngOnInit() {
2811
- this.fetchData();
2840
+ if (this.initialFilterField) {
2841
+ // Se o usuário definir o initialFilterField, ele será usado como o campo inicial
2842
+ this.selectedSearchField = this.initialFilterField;
2843
+ this.sortColumn = this.initialFilterField;
2844
+ this.sortDirection = "asc";
2845
+ this.columns = this.columns.map((column) => ({
2846
+ ...column,
2847
+ isSearchSelected: column.prop === this.initialFilterField,
2848
+ }));
2849
+ }
2850
+ else if (this.columns.length > 0) {
2851
+ // Caso contrário, usa a primeira coluna como padrão
2852
+ this.selectedSearchField = this.columns[0].prop;
2853
+ this.sortColumn = this.columns[0].prop;
2854
+ this.sortDirection = "asc";
2855
+ this.columns = this.columns.map((column) => ({
2856
+ ...column,
2857
+ isSearchSelected: column.prop === this.selectedSearchField,
2858
+ }));
2859
+ }
2860
+ //this.fetchData();
2812
2861
  this.refreshService.refresh$
2813
2862
  .pipe(takeUntil(this.destroy$))
2814
2863
  .subscribe(() => {
@@ -2818,29 +2867,38 @@ class DataTableComponent {
2818
2867
  });
2819
2868
  this.isInitialized = true;
2820
2869
  }
2821
- ngOnChanges(changes) {
2822
- if (changes['totalItems'] || changes['defaultItemsPerPage'] || changes['currentPage'] || changes['fetchDataFunction'] || changes['filterDescription']) {
2823
- this.fetchData();
2824
- }
2825
- }
2870
+ // ngOnChanges(changes: SimpleChanges) {
2871
+ // if (
2872
+ // changes["totalItems"] ||
2873
+ // changes["defaultItemsPerPage"] ||
2874
+ // changes["currentPage"] ||
2875
+ // changes["fetchDataFunction"] ||
2876
+ // changes["filterDescription"]
2877
+ // ) {
2878
+ // this.fetchData();
2879
+ // }
2880
+ // }
2826
2881
  ngOnDestroy() {
2827
2882
  this.destroy$.next();
2828
2883
  this.destroy$.complete();
2829
2884
  }
2830
2885
  getNestedProperty(obj, path) {
2831
- return path.split('.').reduce((acc, part) => acc && acc[part], obj);
2886
+ return path.split(".").reduce((acc, part) => acc && acc[part], obj);
2832
2887
  }
2833
2888
  fetchData() {
2834
2889
  if (this.fetchDataFunction) {
2835
2890
  this.isLoading = true;
2836
2891
  const params = {
2837
2892
  filterDescription: this.filterDescription,
2838
- pageNumber: this.currentPage,
2839
- pageSize: this.defaultItemsPerPage,
2893
+ filterField: this.selectedSearchField,
2894
+ pageNumber: this.currentPage ?? 1,
2895
+ pageSize: this.defaultItemsPerPage ?? 10,
2840
2896
  sortColumn: this.sortColumn,
2841
- sortDirection: this.sortDirection
2897
+ sortDirection: this.sortDirection,
2842
2898
  };
2843
- this.fetchDataFunction(params).pipe(takeUntil(this.destroy$)).subscribe({
2899
+ this.fetchDataFunction(params)
2900
+ .pipe(takeUntil(this.destroy$))
2901
+ .subscribe({
2844
2902
  next: (result) => {
2845
2903
  this.pagedData = result.items;
2846
2904
  this.totalItems = result.totalItems;
@@ -2848,21 +2906,15 @@ class DataTableComponent {
2848
2906
  this.cdr.markForCheck();
2849
2907
  },
2850
2908
  error: (error) => {
2851
- console.error('Error fetching data:', error);
2909
+ console.error("Error fetching data:", error);
2852
2910
  this.isLoading = false;
2853
- }
2911
+ },
2854
2912
  });
2855
2913
  }
2856
2914
  }
2857
2915
  refreshData() {
2858
2916
  this.fetchData();
2859
2917
  }
2860
- onSort(column) {
2861
- this.sortColumn = column;
2862
- this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';
2863
- this.sortChange.emit({ column, direction: this.sortDirection });
2864
- this.fetchData();
2865
- }
2866
2918
  onPageChange(page) {
2867
2919
  this.currentPage = page;
2868
2920
  this.pageChange.emit(page);
@@ -2873,19 +2925,53 @@ class DataTableComponent {
2873
2925
  this.itemsPerPageChange.emit(this.defaultItemsPerPage);
2874
2926
  this.fetchData();
2875
2927
  }
2928
+ onSelectSearchField(columnProp) {
2929
+ if (this.sortColumn === columnProp) {
2930
+ this.sortDirection = this.sortDirection === "asc" ? "desc" : "asc";
2931
+ }
2932
+ else {
2933
+ this.sortDirection = "asc";
2934
+ }
2935
+ this.selectedSearchField = columnProp;
2936
+ this.sortColumn = columnProp;
2937
+ this.columns = this.columns.map((column) => ({
2938
+ ...column,
2939
+ isSearchSelected: column.prop === columnProp,
2940
+ }));
2941
+ this.filterFieldChange.emit(this.selectedSearchField);
2942
+ if (this.fetchDataFunction) {
2943
+ this.fetchDataFunction({
2944
+ filterDescription: this.filterDescription,
2945
+ filterField: this.selectedSearchField,
2946
+ pageNumber: this.currentPage,
2947
+ pageSize: this.defaultItemsPerPage,
2948
+ sortColumn: this.sortColumn,
2949
+ sortDirection: this.sortDirection,
2950
+ }).subscribe({
2951
+ next: (result) => {
2952
+ this.pagedData = result.items;
2953
+ this.totalItems = result.totalItems;
2954
+ this.cdr.markForCheck();
2955
+ },
2956
+ error: (error) => {
2957
+ console.error("Erro ao buscar dados:", error);
2958
+ },
2959
+ });
2960
+ }
2961
+ }
2876
2962
  handleAction(action, item, index) {
2877
2963
  switch (action) {
2878
- case 'edit':
2964
+ case "edit":
2879
2965
  if (this.hasPermission(this.editPermissions)) {
2880
2966
  this.onEditTable.emit({ item, index });
2881
2967
  }
2882
2968
  break;
2883
- case 'delete':
2969
+ case "delete":
2884
2970
  if (this.hasPermission(this.deletePermissions)) {
2885
2971
  this.onDeleteTable.emit({ item, index });
2886
2972
  }
2887
2973
  break;
2888
- case 'view':
2974
+ case "view":
2889
2975
  if (this.hasPermission(this.viewPermissions)) {
2890
2976
  this.onViewTable.emit({ item, index });
2891
2977
  }
@@ -2901,10 +2987,10 @@ class DataTableComponent {
2901
2987
  }
2902
2988
  catch (error) {
2903
2989
  if (error instanceof Error) {
2904
- console.error('Permission error:', error.message);
2990
+ console.error("Permission error:", error.message);
2905
2991
  }
2906
2992
  else {
2907
- console.error('Unknown error occurred during permission check');
2993
+ console.error("Unknown error occurred during permission check");
2908
2994
  }
2909
2995
  return true;
2910
2996
  }
@@ -2921,11 +3007,11 @@ class DataTableComponent {
2921
3007
  this.onButtonClick.emit(); // Emitindo o evento
2922
3008
  }
2923
3009
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataTableComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: AuthService }, { token: RefreshService }], target: i0.ɵɵFactoryTarget.Component }); }
2924
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DataTableComponent, selector: "argenta-list-data-table", inputs: { columns: "columns", hiddenColumns: "hiddenColumns", defaultItemsPerPage: "defaultItemsPerPage", itemsPerPageLabel: "itemsPerPageLabel", showActionColumn: "showActionColumn", actionColumnLabel: "actionColumnLabel", totalItems: "totalItems", fetchDataFunction: "fetchDataFunction", editPermissions: "editPermissions", deletePermissions: "deletePermissions", viewPermissions: "viewPermissions", showPageInfo: "showPageInfo", pageText: "pageText", ofText: "ofText", filterDescription: "filterDescription", buttonLabel: "buttonLabel" }, outputs: { sortChange: "sortChange", pageChange: "pageChange", itemsPerPageChange: "itemsPerPageChange", onEditTable: "onEditTable", onDeleteTable: "onDeleteTable", onViewTable: "onViewTable", onButtonClick: "onButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"data-table-header\" style=\"margin-top: 2.5rem;\">\n <div class=\"left-section\">\n <div class=\"form-group\">\n <label for=\"itemsPerPageSelect\" class=\"items-per-page-label\">{{ itemsPerPageLabel }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto custom-select\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange()\">\n <option *ngFor=\"let option of itemsPerPageOptions\" [value]=\"option\">{{ option }}</option>\n </select>\n </div>\n </div>\n <div *ngIf=\"buttonLabel && buttonLabel.length > 0\" class=\"right-section\">\n <button class=\"custom-button\" (click)=\"onNewButtonClick()\">\n <lucide-icon name=\"plus\" [size]=\"28\" [strokeWidth]=\"1.75\"></lucide-icon>\n {{ buttonLabel }}\n </button>\n </div>\n</div>\n\n<div class=\"search-input-container\">\n <argenta-search-input id=\"search\" label=\"\" placeholder=\"Buscar\" [(ngModel)]=\"filterDescription\" (search)=\"onSearch($event)\"></argenta-search-input>\n</div>\n\n<div class=\"table-responsive\" style=\"margin-top: 1rem;\">\n <table class=\"table table-hover\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let column of columns\">\n <th *ngIf=\"!isColumnHidden(column.prop)\" (click)=\"onSort(column.prop)\">\n {{ column.label }}\n </th>\n </ng-container>\n <th *ngIf=\"showActionColumn\" class=\"text-end\" style=\"padding-right: 6.3rem;\">{{ actionColumnLabel }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of pagedData; let i = index\">\n <ng-container *ngFor=\"let column of columns\">\n <td *ngIf=\"!isColumnHidden(column.prop)\">\n {{ getNestedProperty(item, column.prop) }}\n </td>\n </ng-container>\n <td *ngIf=\"showActionColumn\" class=\"text-end\">\n <div class=\"d-flex justify-content-end\">\n <div *ngIf=\"hasPermission(editPermissions) && onEditTable.observers.length > 0\" (click)=\"handleAction('edit', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <lucide-icon name=\"square-pen\" [size]=\"20\" color=\"#2CA58D\" [strokeWidth]=\"1.75\"></lucide-icon>\n </div>\n <div *ngIf=\"hasPermission(viewPermissions) && onViewTable.observers.length > 0\" (click)=\"handleAction('view', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <lucide-icon name=\"user-round\" [size]=\"20\" color=\"#2CA58D\" [strokeWidth]=\"1.75\"></lucide-icon>\n </div>\n <div *ngIf=\"hasPermission(deletePermissions) && onDeleteTable.observers.length > 0\" (click)=\"handleAction('delete', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <i-lucide name=\"trash-2\" [size]=\"20\" color=\"#F26E6E\" [strokeWidth]=\"1.75\"></i-lucide>\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"text-center pagination-controls\">\n <custom-pagination\n [totalItems]=\"totalItems\"\n [itemsPerPage]=\"defaultItemsPerPage\"\n [currentPage]=\"currentPage\"\n [showPageInfo]=\"showPageInfo\"\n (pageChange)=\"onPageChange($event)\">\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";.clickable-icon{cursor:pointer}:host{font-family:var(--font-family)}.data-table-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:-.2rem}.left-section,.right-section{display:flex;align-items:center}.search-input-container{display:flex;justify-content:flex-start}.left-section .form-group{display:flex;align-items:center}.items-per-page-label{font-family:var(--font-family);font-size:14px;color:#666;margin-right:.2rem}.custom-select{font-family:var(--font-family);font-size:14px;color:#666;background:#fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"#666\" d=\"M2 0L0 2h4L2 0zM2 5l2-2H0l2 2z\"/></svg>') no-repeat right .75rem center/8px 10px;border:1px solid #ccc;border-radius:.25rem;padding:.375rem 1.75rem .375rem .75rem;appearance:none;-webkit-appearance:none;-moz-appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem #007bff40}.table{font-family:var(--font-family);font-size:var(--table-font-size, 14px);color:var(--table-font-color, #737b7b);border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden}.table thead tr{height:60px}.table thead th{background-color:var(--primary-color);color:var(--text-color);font-family:var(--font-family);font-size:14px;font-weight:600;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center;line-height:2.5}.table thead th:first-child{text-align:left;padding-left:1.4rem}.table tbody td{font-family:var(--font-family);font-size:14px;color:#737b7b;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center}.table tbody td:first-child{text-align:left;padding-left:1.4rem}.table tbody tr:last-child td{border-bottom:.1rem solid #dcdcdc}.table tbody td{border-right:none;border-left:none}.table thead th:first-child{border-top-left-radius:0}.table thead th:last-child{border-top-right-radius:0}.table tbody tr:last-child td:first-child{border-bottom-left-radius:0}.table tbody tr:last-child td:last-child{border-bottom-right-radius:0}.btn-icon{width:24px;height:24px;background-size:cover;display:inline-block;cursor:pointer;margin-right:16px}.pagination-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem}.custom-button{display:flex;align-items:center;padding:.5rem 1rem .5rem .5rem;border-radius:.25rem;transition:background-color .3s,border-color .3s,filter .3s;font-family:var(--font-family);font-size:16px;font-weight:600;height:40px;letter-spacing:.005em;text-align:left;color:#fff;background-color:var(--secondary-color);border:none;cursor:pointer}.custom-button lucide-icon{margin-right:.5rem}.custom-button:hover{box-shadow:0 0 0 .15rem var(--secondary-color)}.custom-button:active{background-color:var(--secondary-color)}.custom-button:focus{outline:none;box-shadow:0 0 0 .15rem var(--secondary-color)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.LucideAngularComponent, selector: "lucide-angular, lucide-icon, i-lucide, span-lucide", inputs: ["class", "name", "img", "color", "absoluteStrokeWidth", "size", "strokeWidth"] }, { kind: "component", type: CustomPaginationComponent, selector: "custom-pagination", inputs: ["totalItems", "itemsPerPage", "currentPage", "showPageInfo"], outputs: ["pageChange"] }, { kind: "component", type: SearchInputComponent, selector: "argenta-search-input", inputs: ["id", "label", "type", "placeholder", "value", "disabled", "readonly", "autofocus", "maxlength", "minlength", "required", "pattern", "debounceTime"], outputs: ["search", "inputChange", "change", "focus", "blur", "keyup", "keydown", "keypress"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3010
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DataTableComponent, selector: "argenta-list-data-table", inputs: { columns: "columns", hiddenColumns: "hiddenColumns", defaultItemsPerPage: "defaultItemsPerPage", itemsPerPageLabel: "itemsPerPageLabel", showActionColumn: "showActionColumn", actionColumnLabel: "actionColumnLabel", totalItems: "totalItems", fetchDataFunction: "fetchDataFunction", editPermissions: "editPermissions", deletePermissions: "deletePermissions", viewPermissions: "viewPermissions", showPageInfo: "showPageInfo", pageText: "pageText", ofText: "ofText", filterDescription: "filterDescription", buttonLabel: "buttonLabel", pagedData: "pagedData", initialFilterField: "initialFilterField" }, outputs: { pageChange: "pageChange", itemsPerPageChange: "itemsPerPageChange", onEditTable: "onEditTable", onDeleteTable: "onDeleteTable", onViewTable: "onViewTable", onButtonClick: "onButtonClick", filterFieldChange: "filterFieldChange" }, ngImport: i0, template: "<div class=\"data-table-header\" style=\"margin-top: 2.5rem\">\n <div class=\"left-section\">\n <div class=\"form-group\">\n <label for=\"itemsPerPageSelect\" class=\"items-per-page-label\">{{\n itemsPerPageLabel\n }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto custom-select\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange()\"\n >\n <option *ngFor=\"let option of itemsPerPageOptions\" [value]=\"option\">\n {{ option }}\n </option>\n </select>\n </div>\n </div>\n <div *ngIf=\"buttonLabel && buttonLabel.length > 0\" class=\"right-section\">\n <button class=\"custom-button\" (click)=\"onNewButtonClick()\">\n <lucide-icon name=\"plus\" [size]=\"28\" [strokeWidth]=\"1.75\"></lucide-icon>\n {{ buttonLabel }}\n </button>\n </div>\n</div>\n\n<div class=\"search-input-container\">\n <argenta-search-input\n id=\"search\"\n label=\"\"\n placeholder=\"Buscar\"\n [(ngModel)]=\"filterDescription\"\n (search)=\"onSearch($event)\"\n ></argenta-search-input>\n</div>\n\n<div class=\"table-responsive\" style=\"margin-top: 1rem\">\n <table class=\"table table-hover\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let column of columns\">\n <th\n *ngIf=\"!isColumnHidden(column.prop)\"\n (click)=\"onSelectSearchField(column.prop)\"\n >\n {{ column.label }}\n <span>\n <i-lucide\n name=\"arrow-up\"\n [size]=\"14\"\n [class.selected]=\"\n column.isSearchSelected && sortDirection === 'asc'\n \"\n ></i-lucide>\n <i-lucide\n name=\"arrow-down\"\n [size]=\"14\"\n [class.selected]=\"\n column.isSearchSelected && sortDirection === 'desc'\n \"\n ></i-lucide>\n </span>\n </th>\n </ng-container>\n <th\n *ngIf=\"showActionColumn\"\n class=\"text-end\"\n style=\"padding-right: 6.3rem\"\n >\n {{ actionColumnLabel }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of pagedData; let i = index\">\n <ng-container *ngFor=\"let column of columns\">\n <td *ngIf=\"!isColumnHidden(column.prop)\">\n {{ getNestedProperty(item, column.prop) }}\n </td>\n </ng-container>\n <td *ngIf=\"showActionColumn\" class=\"text-end\">\n <div class=\"d-flex justify-content-end\">\n <div\n *ngIf=\"\n hasPermission(editPermissions) &&\n onEditTable.observers.length > 0\n \"\n (click)=\"handleAction('edit', item, i)\"\n class=\"clickable-icon\"\n style=\"margin-right: 1.5rem\"\n >\n <lucide-icon\n name=\"square-pen\"\n [size]=\"20\"\n color=\"#2CA58D\"\n [strokeWidth]=\"1.75\"\n ></lucide-icon>\n </div>\n <div\n *ngIf=\"\n hasPermission(viewPermissions) &&\n onViewTable.observers.length > 0\n \"\n (click)=\"handleAction('view', item, i)\"\n class=\"clickable-icon\"\n style=\"margin-right: 1.5rem\"\n >\n <lucide-icon\n name=\"user-round\"\n [size]=\"20\"\n color=\"#2CA58D\"\n [strokeWidth]=\"1.75\"\n ></lucide-icon>\n </div>\n <div\n *ngIf=\"\n hasPermission(deletePermissions) &&\n onDeleteTable.observers.length > 0\n \"\n (click)=\"handleAction('delete', item, i)\"\n class=\"clickable-icon\"\n style=\"margin-right: 1.5rem\"\n >\n <i-lucide\n name=\"trash-2\"\n [size]=\"20\"\n color=\"#F26E6E\"\n [strokeWidth]=\"1.75\"\n ></i-lucide>\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"text-center pagination-controls\">\n <custom-pagination\n [totalItems]=\"totalItems\"\n [itemsPerPage]=\"defaultItemsPerPage\"\n [currentPage]=\"currentPage\"\n [showPageInfo]=\"showPageInfo\"\n (pageChange)=\"onPageChange($event)\"\n >\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";.clickable-icon{cursor:pointer}:host{font-family:var(--font-family)}.data-table-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:-.2rem}.left-section,.right-section{display:flex;align-items:center}.search-input-container{display:flex;justify-content:flex-start}.left-section .form-group{display:flex;align-items:center}.items-per-page-label{font-family:var(--font-family);font-size:14px;color:#666;margin-right:.2rem}.custom-select{font-family:var(--font-family);font-size:14px;color:#666;background:#fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"#666\" d=\"M2 0L0 2h4L2 0zM2 5l2-2H0l2 2z\"/></svg>') no-repeat right .75rem center/8px 10px;border:1px solid #ccc;border-radius:.25rem;padding:.375rem 1.75rem .375rem .75rem;appearance:none;-webkit-appearance:none;-moz-appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem #007bff40}.table{font-family:var(--font-family);font-size:var(--table-font-size, 14px);color:var(--table-font-color, #737b7b);border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden}.table thead tr{height:60px}.table thead th{background-color:var(--primary-color);color:var(--text-color);font-family:var(--font-family);font-size:14px;font-weight:600;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center;line-height:2.5}.table thead th:first-child{text-align:left;padding-left:1.4rem}.table tbody td{font-family:var(--font-family);font-size:14px;color:#737b7b;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center}.table tbody td:first-child{text-align:left;padding-left:1.4rem}.table tbody tr:last-child td{border-bottom:.1rem solid #dcdcdc}.table tbody td{border-right:none;border-left:none}.table thead th:first-child{border-top-left-radius:0}.table thead th:last-child{border-top-right-radius:0}.table tbody tr:last-child td:first-child{border-bottom-left-radius:0}.table tbody tr:last-child td:last-child{border-bottom-right-radius:0}.btn-icon{width:24px;height:24px;background-size:cover;display:inline-block;cursor:pointer;margin-right:16px}.pagination-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem}.custom-button{display:flex;align-items:center;padding:.5rem 1rem .5rem .5rem;border-radius:.25rem;transition:background-color .3s,border-color .3s,filter .3s;font-family:var(--font-family);font-size:16px;font-weight:600;height:40px;letter-spacing:.005em;text-align:left;color:#fff;background-color:var(--secondary-color);border:none;cursor:pointer}.custom-button lucide-icon{margin-right:.5rem}.custom-button:hover{box-shadow:0 0 0 .15rem var(--secondary-color)}.custom-button:active{background-color:var(--secondary-color)}.custom-button:focus{outline:none;box-shadow:0 0 0 .15rem var(--secondary-color)}.selected{color:var(--secondary-color);stroke-width:8}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.LucideAngularComponent, selector: "lucide-angular, lucide-icon, i-lucide, span-lucide", inputs: ["class", "name", "img", "color", "absoluteStrokeWidth", "size", "strokeWidth"] }, { kind: "component", type: CustomPaginationComponent, selector: "custom-pagination", inputs: ["totalItems", "itemsPerPage", "currentPage", "showPageInfo"], outputs: ["pageChange"] }, { kind: "component", type: SearchInputComponent, selector: "argenta-search-input", inputs: ["id", "label", "type", "placeholder", "value", "disabled", "readonly", "autofocus", "maxlength", "minlength", "required", "pattern", "debounceTime"], outputs: ["search", "inputChange", "change", "focus", "blur", "keyup", "keydown", "keypress"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2925
3011
  }
2926
3012
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataTableComponent, decorators: [{
2927
3013
  type: Component,
2928
- args: [{ selector: 'argenta-list-data-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"data-table-header\" style=\"margin-top: 2.5rem;\">\n <div class=\"left-section\">\n <div class=\"form-group\">\n <label for=\"itemsPerPageSelect\" class=\"items-per-page-label\">{{ itemsPerPageLabel }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto custom-select\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange()\">\n <option *ngFor=\"let option of itemsPerPageOptions\" [value]=\"option\">{{ option }}</option>\n </select>\n </div>\n </div>\n <div *ngIf=\"buttonLabel && buttonLabel.length > 0\" class=\"right-section\">\n <button class=\"custom-button\" (click)=\"onNewButtonClick()\">\n <lucide-icon name=\"plus\" [size]=\"28\" [strokeWidth]=\"1.75\"></lucide-icon>\n {{ buttonLabel }}\n </button>\n </div>\n</div>\n\n<div class=\"search-input-container\">\n <argenta-search-input id=\"search\" label=\"\" placeholder=\"Buscar\" [(ngModel)]=\"filterDescription\" (search)=\"onSearch($event)\"></argenta-search-input>\n</div>\n\n<div class=\"table-responsive\" style=\"margin-top: 1rem;\">\n <table class=\"table table-hover\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let column of columns\">\n <th *ngIf=\"!isColumnHidden(column.prop)\" (click)=\"onSort(column.prop)\">\n {{ column.label }}\n </th>\n </ng-container>\n <th *ngIf=\"showActionColumn\" class=\"text-end\" style=\"padding-right: 6.3rem;\">{{ actionColumnLabel }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of pagedData; let i = index\">\n <ng-container *ngFor=\"let column of columns\">\n <td *ngIf=\"!isColumnHidden(column.prop)\">\n {{ getNestedProperty(item, column.prop) }}\n </td>\n </ng-container>\n <td *ngIf=\"showActionColumn\" class=\"text-end\">\n <div class=\"d-flex justify-content-end\">\n <div *ngIf=\"hasPermission(editPermissions) && onEditTable.observers.length > 0\" (click)=\"handleAction('edit', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <lucide-icon name=\"square-pen\" [size]=\"20\" color=\"#2CA58D\" [strokeWidth]=\"1.75\"></lucide-icon>\n </div>\n <div *ngIf=\"hasPermission(viewPermissions) && onViewTable.observers.length > 0\" (click)=\"handleAction('view', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <lucide-icon name=\"user-round\" [size]=\"20\" color=\"#2CA58D\" [strokeWidth]=\"1.75\"></lucide-icon>\n </div>\n <div *ngIf=\"hasPermission(deletePermissions) && onDeleteTable.observers.length > 0\" (click)=\"handleAction('delete', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <i-lucide name=\"trash-2\" [size]=\"20\" color=\"#F26E6E\" [strokeWidth]=\"1.75\"></i-lucide>\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"text-center pagination-controls\">\n <custom-pagination\n [totalItems]=\"totalItems\"\n [itemsPerPage]=\"defaultItemsPerPage\"\n [currentPage]=\"currentPage\"\n [showPageInfo]=\"showPageInfo\"\n (pageChange)=\"onPageChange($event)\">\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";.clickable-icon{cursor:pointer}:host{font-family:var(--font-family)}.data-table-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:-.2rem}.left-section,.right-section{display:flex;align-items:center}.search-input-container{display:flex;justify-content:flex-start}.left-section .form-group{display:flex;align-items:center}.items-per-page-label{font-family:var(--font-family);font-size:14px;color:#666;margin-right:.2rem}.custom-select{font-family:var(--font-family);font-size:14px;color:#666;background:#fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"#666\" d=\"M2 0L0 2h4L2 0zM2 5l2-2H0l2 2z\"/></svg>') no-repeat right .75rem center/8px 10px;border:1px solid #ccc;border-radius:.25rem;padding:.375rem 1.75rem .375rem .75rem;appearance:none;-webkit-appearance:none;-moz-appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem #007bff40}.table{font-family:var(--font-family);font-size:var(--table-font-size, 14px);color:var(--table-font-color, #737b7b);border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden}.table thead tr{height:60px}.table thead th{background-color:var(--primary-color);color:var(--text-color);font-family:var(--font-family);font-size:14px;font-weight:600;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center;line-height:2.5}.table thead th:first-child{text-align:left;padding-left:1.4rem}.table tbody td{font-family:var(--font-family);font-size:14px;color:#737b7b;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center}.table tbody td:first-child{text-align:left;padding-left:1.4rem}.table tbody tr:last-child td{border-bottom:.1rem solid #dcdcdc}.table tbody td{border-right:none;border-left:none}.table thead th:first-child{border-top-left-radius:0}.table thead th:last-child{border-top-right-radius:0}.table tbody tr:last-child td:first-child{border-bottom-left-radius:0}.table tbody tr:last-child td:last-child{border-bottom-right-radius:0}.btn-icon{width:24px;height:24px;background-size:cover;display:inline-block;cursor:pointer;margin-right:16px}.pagination-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem}.custom-button{display:flex;align-items:center;padding:.5rem 1rem .5rem .5rem;border-radius:.25rem;transition:background-color .3s,border-color .3s,filter .3s;font-family:var(--font-family);font-size:16px;font-weight:600;height:40px;letter-spacing:.005em;text-align:left;color:#fff;background-color:var(--secondary-color);border:none;cursor:pointer}.custom-button lucide-icon{margin-right:.5rem}.custom-button:hover{box-shadow:0 0 0 .15rem var(--secondary-color)}.custom-button:active{background-color:var(--secondary-color)}.custom-button:focus{outline:none;box-shadow:0 0 0 .15rem var(--secondary-color)}\n"] }]
3014
+ args: [{ selector: "argenta-list-data-table", changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"data-table-header\" style=\"margin-top: 2.5rem\">\n <div class=\"left-section\">\n <div class=\"form-group\">\n <label for=\"itemsPerPageSelect\" class=\"items-per-page-label\">{{\n itemsPerPageLabel\n }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto custom-select\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange()\"\n >\n <option *ngFor=\"let option of itemsPerPageOptions\" [value]=\"option\">\n {{ option }}\n </option>\n </select>\n </div>\n </div>\n <div *ngIf=\"buttonLabel && buttonLabel.length > 0\" class=\"right-section\">\n <button class=\"custom-button\" (click)=\"onNewButtonClick()\">\n <lucide-icon name=\"plus\" [size]=\"28\" [strokeWidth]=\"1.75\"></lucide-icon>\n {{ buttonLabel }}\n </button>\n </div>\n</div>\n\n<div class=\"search-input-container\">\n <argenta-search-input\n id=\"search\"\n label=\"\"\n placeholder=\"Buscar\"\n [(ngModel)]=\"filterDescription\"\n (search)=\"onSearch($event)\"\n ></argenta-search-input>\n</div>\n\n<div class=\"table-responsive\" style=\"margin-top: 1rem\">\n <table class=\"table table-hover\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let column of columns\">\n <th\n *ngIf=\"!isColumnHidden(column.prop)\"\n (click)=\"onSelectSearchField(column.prop)\"\n >\n {{ column.label }}\n <span>\n <i-lucide\n name=\"arrow-up\"\n [size]=\"14\"\n [class.selected]=\"\n column.isSearchSelected && sortDirection === 'asc'\n \"\n ></i-lucide>\n <i-lucide\n name=\"arrow-down\"\n [size]=\"14\"\n [class.selected]=\"\n column.isSearchSelected && sortDirection === 'desc'\n \"\n ></i-lucide>\n </span>\n </th>\n </ng-container>\n <th\n *ngIf=\"showActionColumn\"\n class=\"text-end\"\n style=\"padding-right: 6.3rem\"\n >\n {{ actionColumnLabel }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of pagedData; let i = index\">\n <ng-container *ngFor=\"let column of columns\">\n <td *ngIf=\"!isColumnHidden(column.prop)\">\n {{ getNestedProperty(item, column.prop) }}\n </td>\n </ng-container>\n <td *ngIf=\"showActionColumn\" class=\"text-end\">\n <div class=\"d-flex justify-content-end\">\n <div\n *ngIf=\"\n hasPermission(editPermissions) &&\n onEditTable.observers.length > 0\n \"\n (click)=\"handleAction('edit', item, i)\"\n class=\"clickable-icon\"\n style=\"margin-right: 1.5rem\"\n >\n <lucide-icon\n name=\"square-pen\"\n [size]=\"20\"\n color=\"#2CA58D\"\n [strokeWidth]=\"1.75\"\n ></lucide-icon>\n </div>\n <div\n *ngIf=\"\n hasPermission(viewPermissions) &&\n onViewTable.observers.length > 0\n \"\n (click)=\"handleAction('view', item, i)\"\n class=\"clickable-icon\"\n style=\"margin-right: 1.5rem\"\n >\n <lucide-icon\n name=\"user-round\"\n [size]=\"20\"\n color=\"#2CA58D\"\n [strokeWidth]=\"1.75\"\n ></lucide-icon>\n </div>\n <div\n *ngIf=\"\n hasPermission(deletePermissions) &&\n onDeleteTable.observers.length > 0\n \"\n (click)=\"handleAction('delete', item, i)\"\n class=\"clickable-icon\"\n style=\"margin-right: 1.5rem\"\n >\n <i-lucide\n name=\"trash-2\"\n [size]=\"20\"\n color=\"#F26E6E\"\n [strokeWidth]=\"1.75\"\n ></i-lucide>\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"text-center pagination-controls\">\n <custom-pagination\n [totalItems]=\"totalItems\"\n [itemsPerPage]=\"defaultItemsPerPage\"\n [currentPage]=\"currentPage\"\n [showPageInfo]=\"showPageInfo\"\n (pageChange)=\"onPageChange($event)\"\n >\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";.clickable-icon{cursor:pointer}:host{font-family:var(--font-family)}.data-table-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:-.2rem}.left-section,.right-section{display:flex;align-items:center}.search-input-container{display:flex;justify-content:flex-start}.left-section .form-group{display:flex;align-items:center}.items-per-page-label{font-family:var(--font-family);font-size:14px;color:#666;margin-right:.2rem}.custom-select{font-family:var(--font-family);font-size:14px;color:#666;background:#fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"#666\" d=\"M2 0L0 2h4L2 0zM2 5l2-2H0l2 2z\"/></svg>') no-repeat right .75rem center/8px 10px;border:1px solid #ccc;border-radius:.25rem;padding:.375rem 1.75rem .375rem .75rem;appearance:none;-webkit-appearance:none;-moz-appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem #007bff40}.table{font-family:var(--font-family);font-size:var(--table-font-size, 14px);color:var(--table-font-color, #737b7b);border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden}.table thead tr{height:60px}.table thead th{background-color:var(--primary-color);color:var(--text-color);font-family:var(--font-family);font-size:14px;font-weight:600;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center;line-height:2.5}.table thead th:first-child{text-align:left;padding-left:1.4rem}.table tbody td{font-family:var(--font-family);font-size:14px;color:#737b7b;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center}.table tbody td:first-child{text-align:left;padding-left:1.4rem}.table tbody tr:last-child td{border-bottom:.1rem solid #dcdcdc}.table tbody td{border-right:none;border-left:none}.table thead th:first-child{border-top-left-radius:0}.table thead th:last-child{border-top-right-radius:0}.table tbody tr:last-child td:first-child{border-bottom-left-radius:0}.table tbody tr:last-child td:last-child{border-bottom-right-radius:0}.btn-icon{width:24px;height:24px;background-size:cover;display:inline-block;cursor:pointer;margin-right:16px}.pagination-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem}.custom-button{display:flex;align-items:center;padding:.5rem 1rem .5rem .5rem;border-radius:.25rem;transition:background-color .3s,border-color .3s,filter .3s;font-family:var(--font-family);font-size:16px;font-weight:600;height:40px;letter-spacing:.005em;text-align:left;color:#fff;background-color:var(--secondary-color);border:none;cursor:pointer}.custom-button lucide-icon{margin-right:.5rem}.custom-button:hover{box-shadow:0 0 0 .15rem var(--secondary-color)}.custom-button:active{background-color:var(--secondary-color)}.custom-button:focus{outline:none;box-shadow:0 0 0 .15rem var(--secondary-color)}.selected{color:var(--secondary-color);stroke-width:8}\n"] }]
2929
3015
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: AuthService }, { type: RefreshService }]; }, propDecorators: { columns: [{
2930
3016
  type: Input
2931
3017
  }], hiddenColumns: [{
@@ -2958,8 +3044,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2958
3044
  type: Input
2959
3045
  }], buttonLabel: [{
2960
3046
  type: Input
2961
- }], sortChange: [{
2962
- type: Output
3047
+ }], pagedData: [{
3048
+ type: Input
3049
+ }], initialFilterField: [{
3050
+ type: Input
2963
3051
  }], pageChange: [{
2964
3052
  type: Output
2965
3053
  }], itemsPerPageChange: [{
@@ -2972,6 +3060,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2972
3060
  type: Output
2973
3061
  }], onButtonClick: [{
2974
3062
  type: Output
3063
+ }], filterFieldChange: [{
3064
+ type: Output
2975
3065
  }] } });
2976
3066
 
2977
3067
  class TextareaComponent {
@@ -3554,29 +3644,34 @@ class DataPaginateService {
3554
3644
  }
3555
3645
  fetchData(url, params) {
3556
3646
  let httpParams = new HttpParams()
3557
- .set('page', params.pageNumber.toString())
3558
- .set('limit', params.pageSize.toString())
3559
- .set('sort', params.sortColumn)
3560
- .set('order', params.sortDirection);
3647
+ .set("page", params.pageNumber.toString())
3648
+ .set("limit", params.pageSize.toString())
3649
+ .set("sort", params.sortColumn)
3650
+ .set("order", params.sortDirection);
3561
3651
  if (params.filterDescription) {
3562
- httpParams = httpParams.set('description', params.filterDescription);
3652
+ httpParams = httpParams.set("description", params.filterDescription);
3563
3653
  }
3564
- return this.http.get(url, { params: httpParams }).pipe(map(response => {
3654
+ if (params.filterField) {
3655
+ httpParams = httpParams.set("filterField", params.filterField);
3656
+ }
3657
+ return this.http
3658
+ .get(url, { params: httpParams })
3659
+ .pipe(map((response) => {
3565
3660
  const items = response.data || [];
3566
3661
  const totalItems = response.meta.total || 0;
3567
3662
  return {
3568
3663
  items,
3569
- totalItems
3664
+ totalItems,
3570
3665
  };
3571
3666
  }));
3572
3667
  }
3573
3668
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataPaginateService, deps: [{ token: i2$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
3574
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataPaginateService, providedIn: 'root' }); }
3669
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataPaginateService, providedIn: "root" }); }
3575
3670
  }
3576
3671
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataPaginateService, decorators: [{
3577
3672
  type: Injectable,
3578
3673
  args: [{
3579
- providedIn: 'root'
3674
+ providedIn: "root",
3580
3675
  }]
3581
3676
  }], ctorParameters: function () { return [{ type: i2$1.HttpClient }]; } });
3582
3677
 
@@ -3670,6 +3765,10 @@ function setThemeColors(config) {
3670
3765
  }
3671
3766
  }
3672
3767
 
3768
+ function convertToSnakeCase(input) {
3769
+ return input.replace(/([A-Z])/g, "_$1").toLowerCase();
3770
+ }
3771
+
3673
3772
  /*
3674
3773
  * Public API Surface of sim-lib
3675
3774
  *
@@ -3682,5 +3781,5 @@ function setThemeColors(config) {
3682
3781
  * Generated bundle index. Do not edit.
3683
3782
  */
3684
3783
 
3685
- export { AccordionArgentaComponent, AlertComponent, AppBackgroundComponent, AutofocusDirective, BadgeComponent, BasicRegistrationComponent, ButtonClasses, ButtonComponent, CalendarArgentaComponent, CardComponent, CepMaskDirective, CheckboxComponent, CnpjMaskDirective, CodeHighlightComponent, ComponentsModule, ConfirmationComponent, ConfirmationService, CpfMaskDirective, CustomPaginationComponent, CustomSwitchComponent, DataPaginateService, DataTableComponent, FileUploadComponent, InputComponent, JsonViewerComponent, LibPortalAngularModule, LucideIconsModule, ModalComponent, MultiSelectCategoryComponent, MultiSelectComponent, NotificationService, RadioComponent, RefreshService, RouterParameterService, SearchCustomerComponent, SearchInputComponent, SelectComponent, TabComponent, TextareaComponent, TreeNodeComponent, setThemeColors };
3784
+ export { AccordionArgentaComponent, AlertComponent, AppBackgroundComponent, AutofocusDirective, BadgeComponent, BasicRegistrationComponent, ButtonClasses, ButtonComponent, CalendarArgentaComponent, CardComponent, CepMaskDirective, CheckboxComponent, CnpjMaskDirective, CodeHighlightComponent, ComponentsModule, ConfirmationComponent, ConfirmationService, CpfMaskDirective, CustomPaginationComponent, CustomSwitchComponent, DataPaginateService, DataTableComponent, FileUploadComponent, InputComponent, JsonViewerComponent, LibPortalAngularModule, LucideIconsModule, ModalComponent, MultiSelectCategoryComponent, MultiSelectComponent, NotificationService, RadioComponent, RefreshService, RouterParameterService, SearchCustomerComponent, SearchInputComponent, SelectComponent, TabComponent, TextareaComponent, TreeNodeComponent, convertToSnakeCase, setThemeColors };
3686
3785
  //# sourceMappingURL=lib-portal-angular.mjs.map