@nettyapps/ntybase 0.1.1 → 0.1.3

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.
@@ -9,7 +9,7 @@ import { Router, ActivatedRoute, RouterLink, RouterModule } from '@angular/route
9
9
  import * as i2$1 from '@nettyapps/ntycontract';
10
10
  import { EnvironmentProxy } from '@nettyapps/ntycontract';
11
11
  import * as i2$2 from '@angular/common';
12
- import { DatePipe, Location, CommonModule, TitleCasePipe } from '@angular/common';
12
+ import { DatePipe, Location, DecimalPipe, CommonModule, TitleCasePipe } from '@angular/common';
13
13
  import * as i3$1 from '@ngx-translate/core';
14
14
  import { TranslateModule, TranslateService } from '@ngx-translate/core';
15
15
  import { Buffer } from 'buffer';
@@ -499,6 +499,7 @@ class CommonService {
499
499
  router = inject(Router);
500
500
  location = inject(Location);
501
501
  datePipe = inject(DatePipe);
502
+ decimalPipe = inject(DecimalPipe);
502
503
  alertService = inject(AlertService);
503
504
  dialog = inject(MatDialog);
504
505
  // Right sidenav
@@ -650,6 +651,20 @@ class CommonService {
650
651
  return -1;
651
652
  }
652
653
  }
654
+ /** Format the given number into correct display
655
+ *
656
+ * @param numberValue number to format
657
+ * @param min minimum decimal digits
658
+ * @param max max decimal digits
659
+ * @returns formatted number
660
+ */
661
+ numberFormatter(numberValue, min = 2, max = 2) {
662
+ if (max < min) {
663
+ max = min;
664
+ }
665
+ let format = '1.' + min + '-' + max;
666
+ return this.decimalPipe.transform(numberValue, format) ?? '';
667
+ }
653
668
  /** Format date into 'dd-MM-yyyy' format for grids
654
669
  *
655
670
  * @param dateValue
@@ -1173,7 +1188,7 @@ const myTheme = themeQuartz.withParams({
1173
1188
  backgroundColor: 'black',
1174
1189
  browserColorScheme: 'dark',
1175
1190
  }, 'dark');
1176
- class AgGridBase {
1191
+ class NettyAgGridBase {
1177
1192
  // Input signals
1178
1193
  readOnly = input(false, ...(ngDevMode ? [{ debugName: "readOnly" }] : []));
1179
1194
  popupFilterValid = input(false, ...(ngDevMode ? [{ debugName: "popupFilterValid" }] : []));
@@ -1705,15 +1720,15 @@ class AgGridBase {
1705
1720
  this.accessRightsProcessed.set(true);
1706
1721
  return true;
1707
1722
  }
1708
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: AgGridBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
1709
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.7", type: AgGridBase, isStandalone: true, selector: "ntybase-ag-grid-base", inputs: { readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, popupFilterValid: { classPropertyName: "popupFilterValid", publicName: "popupFilterValid", isSignal: true, isRequired: false, transformFunction: null }, popupValid: { classPropertyName: "popupValid", publicName: "popupValid", isSignal: true, isRequired: false, transformFunction: null }, params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: false, transformFunction: null }, parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, isEmbedded: { classPropertyName: "isEmbedded", publicName: "isEmbedded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedElement: "selectedElement" }, usesOnChanges: true, ngImport: i0, template: "<p>ag-grid-base works!</p>\n", styles: [""] });
1723
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: NettyAgGridBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
1724
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.7", type: NettyAgGridBase, isStandalone: true, selector: "ntybase-ag-grid-base", inputs: { readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, popupFilterValid: { classPropertyName: "popupFilterValid", publicName: "popupFilterValid", isSignal: true, isRequired: false, transformFunction: null }, popupValid: { classPropertyName: "popupValid", publicName: "popupValid", isSignal: true, isRequired: false, transformFunction: null }, params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: false, transformFunction: null }, parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, isEmbedded: { classPropertyName: "isEmbedded", publicName: "isEmbedded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedElement: "selectedElement" }, usesOnChanges: true, ngImport: i0, template: "<p>ag-grid-base works!</p>\n", styles: [""] });
1710
1725
  }
1711
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: AgGridBase, decorators: [{
1726
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: NettyAgGridBase, decorators: [{
1712
1727
  type: Component,
1713
1728
  args: [{ selector: 'ntybase-ag-grid-base', imports: [], template: "<p>ag-grid-base works!</p>\n" }]
1714
1729
  }], ctorParameters: () => [] });
1715
1730
 
1716
- class AgGridSaveBase {
1731
+ class NettyAgGridSaveBase {
1717
1732
  // Services
1718
1733
  router = inject(Router);
1719
1734
  route = inject(ActivatedRoute);
@@ -1859,10 +1874,10 @@ class AgGridSaveBase {
1859
1874
  }
1860
1875
  return true;
1861
1876
  }
1862
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: AgGridSaveBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
1863
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.7", type: AgGridSaveBase, isStandalone: true, selector: "ntybase-ag-grid-save-base", inputs: { parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, embedded: { classPropertyName: "embedded", publicName: "embedded", isSignal: true, isRequired: false, transformFunction: null }, closeAfterSave: { classPropertyName: "closeAfterSave", publicName: "closeAfterSave", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closeAfterSave: "closeAfterSaveChange" }, viewQueries: [{ propertyName: "saveForm", first: true, predicate: ["saveForm"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<p>ag-grid-save-base works!</p>\n", styles: [""] });
1877
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: NettyAgGridSaveBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
1878
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.7", type: NettyAgGridSaveBase, isStandalone: true, selector: "ntybase-ag-grid-save-base", inputs: { parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, embedded: { classPropertyName: "embedded", publicName: "embedded", isSignal: true, isRequired: false, transformFunction: null }, closeAfterSave: { classPropertyName: "closeAfterSave", publicName: "closeAfterSave", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closeAfterSave: "closeAfterSaveChange" }, viewQueries: [{ propertyName: "saveForm", first: true, predicate: ["saveForm"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<p>ag-grid-save-base works!</p>\n", styles: [""] });
1864
1879
  }
1865
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: AgGridSaveBase, decorators: [{
1880
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: NettyAgGridSaveBase, decorators: [{
1866
1881
  type: Component,
1867
1882
  args: [{ selector: 'ntybase-ag-grid-save-base', imports: [], template: "<p>ag-grid-save-base works!</p>\n" }]
1868
1883
  }], propDecorators: { saveForm: [{
@@ -1870,7 +1885,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
1870
1885
  args: ['saveForm']
1871
1886
  }] } });
1872
1887
 
1873
- class ExcelImportBase extends AgGridBase {
1888
+ class ExcelImportBase extends NettyAgGridBase {
1874
1889
  dataList = [];
1875
1890
  wopts = { bookType: 'xlsx', type: 'array' };
1876
1891
  fileName = 'PayrollJournalTrans.xlsx';
@@ -3515,7 +3530,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
3515
3530
  args: ['autoCompleteInput']
3516
3531
  }] } });
3517
3532
 
3518
- class Filter {
3533
+ class NettyFilter {
3519
3534
  value;
3520
3535
  text;
3521
3536
  }
@@ -3528,5 +3543,5 @@ class Filter {
3528
3543
  * Generated bundle index. Do not edit.
3529
3544
  */
3530
3545
 
3531
- export { AgGridBase, AgGridSaveBase, AlertService, AuthenticationGuard, AuthenticationInterceptor, AuthenticationService, AutoComplete, ButtonRenderer, CanDeactivateGuard, CheckboxRenderer, ColorPalette, CommonService, ConfirmDialog, CredentialsService, CurrentUserPreference, ExcelImportBase, Filter, ForgotPassword, Guid, HttpError403, HttpError404, LeftSidenav, Login, LoginDto, MFACodeDto, MfaLogin, NettyAgGridService, NettyHelper, NettyMenuService, Ntybase, NtybaseModule, SelectionItem, Theme, Toolbar, UrlHelperService };
3546
+ export { AlertService, AuthenticationGuard, AuthenticationInterceptor, AuthenticationService, AutoComplete, ButtonRenderer, CanDeactivateGuard, CheckboxRenderer, ColorPalette, CommonService, ConfirmDialog, CredentialsService, CurrentUserPreference, ExcelImportBase, ForgotPassword, Guid, HttpError403, HttpError404, LeftSidenav, Login, LoginDto, MFACodeDto, MfaLogin, NettyAgGridBase, NettyAgGridSaveBase, NettyAgGridService, NettyFilter, NettyHelper, NettyMenuService, Ntybase, NtybaseModule, SelectionItem, Theme, Toolbar, UrlHelperService };
3532
3547
  //# sourceMappingURL=nettyapps-ntybase.mjs.map