@nettyapps/ntybase 21.1.37 → 21.1.38

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nettyapps/ntybase",
3
- "version": "21.1.37",
3
+ "version": "21.1.38",
4
4
  "description": "This library provides foundational services and components for NettyApps Angular applications.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -276,6 +276,9 @@
276
276
  "@maxLengthError": "Please enter at most {{value}} characters",
277
277
  "@dateCannotBeBeforeStart": "Selected date cannot be earlier than the start date",
278
278
  "@dateCannotBeAfterEnd": "Selected date cannot be later than the end date",
279
+ "@selectFile": "Select File",
280
+ "@uploadFile": "Upload File",
281
+ "@displayLogs": "Display Logs",
279
282
  "@EXCEL_PARSER": {
280
283
  "noFileChosen": "Please select a file",
281
284
  "errorLoadingFile": "Error loading file",
@@ -285,7 +288,8 @@
285
288
  "defaultValueSet": "'{{prop}}' field is empty, default value assigned.",
286
289
  "requiredFieldMissing": "'{{prop}}' is required but its value is empty.",
287
290
  "conversionError": "Could not convert type of data '{{value}}' for field '{{prop}}'.",
288
- "rowSkipped": "This row was skipped due to errors."
291
+ "rowSkipped": "This row was skipped due to errors.",
292
+ "sampleFile": "Sample File"
289
293
  },
290
294
  "@EXCEL_PARSER_LOG": {
291
295
  "all": "All",
@@ -276,6 +276,9 @@
276
276
  "@maxLengthError": "En fazla {{value}} karakter girebilirsiniz",
277
277
  "@dateCannotBeBeforeStart": "Seçilen tarih, başlangıç tarihinden önce olamaz",
278
278
  "@dateCannotBeAfterEnd": "Seçilen tarih, bitiş tarihinden sonra olamaz",
279
+ "@selectFile": "Dosya Seç",
280
+ "@uploadFile": "Dosya Yükle",
281
+ "@displayLogs": "Logları Görüntüle",
279
282
  "@EXCEL_PARSER": {
280
283
  "noFileChosen": "Lütfen bir dosya seçin",
281
284
  "errorLoadingFile": "Dosya yüklenirken hata oluştu",
@@ -285,7 +288,8 @@
285
288
  "defaultValueSet": "'{{prop}}' alanı boş olduğu için varsayılan değer atandı.",
286
289
  "requiredFieldMissing": "'{{prop}}' zorunlu bir alan ancak değeri boş.",
287
290
  "conversionError": "'{{prop}}' alanı için '{{value}}' verisinin tipi dönüştürülemedi.",
288
- "rowSkipped": "Bu satır hatalardan dolayı atlandı."
291
+ "rowSkipped": "Bu satır hatalardan dolayı atlandı.",
292
+ "sampleFile": "Örnek Dosya"
289
293
  },
290
294
  "@EXCEL_PARSER_LOG": {
291
295
  "all": "Tümü",
@@ -12,7 +12,6 @@ import { HttpClient, HttpInterceptor, HttpRequest, HttpHandler, HttpEvent, HttpI
12
12
  import { Theme, GridApi, GridOptions, StatusPanelDef, GridReadyEvent } from 'ag-grid-enterprise';
13
13
  import { ActivatedRoute, Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, CanDeactivate } from '@angular/router';
14
14
  import { NgForm, FormGroup } from '@angular/forms';
15
- import * as XLSX from 'xlsx';
16
15
  import { ICellRendererAngularComp, IFilterAngularComp } from 'ag-grid-angular';
17
16
  import { I18nService } from '@nettyapps/ntyi18n';
18
17
 
@@ -608,18 +607,66 @@ declare abstract class NettyAgGridSaveBase<T extends NettyEntityInterface<T>> ex
608
607
  static ɵcmp: i0.ɵɵComponentDeclaration<NettyAgGridSaveBase<any>, "ntybase-ag-grid-save-base", never, { "parameters": { "alias": "parameters"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
609
608
  }
610
609
 
611
- type AOA = string[][];
612
- declare abstract class ExcelImportBase extends NettyAgGridListBase<any> {
613
- protected dataList: AOA;
614
- protected wopts: XLSX.WritingOptions;
615
- protected fileName: string;
616
- protected isDataValidated: boolean;
617
- /*******************************
618
- *** EXCEL UPLOAD FUNCTIONS ***
619
- *******************************/
620
- onFileChange(evt: any): void;
621
- static ɵfac: i0.ɵɵFactoryDeclaration<ExcelImportBase, never>;
622
- static ɵcmp: i0.ɵɵComponentDeclaration<ExcelImportBase, "ntybase-excel-import-base", never, {}, {}, never, never, true, never>;
610
+ declare class ParseLog implements NettyEntityInterface<ParseLog> {
611
+ rowIndex: number;
612
+ message: string;
613
+ level: 'INFO' | 'WARN' | 'ERROR';
614
+ messageKey?: string;
615
+ messageParams?: any;
616
+ init(): void;
617
+ compare(other: ParseLog): ParseLog;
618
+ getPK(): number;
619
+ setPK(pk: any): void;
620
+ }
621
+
622
+ type ConverterFn = (value: any) => any;
623
+ interface ColumnMapping<T> {
624
+ index: number;
625
+ prop: keyof T;
626
+ headerName?: string;
627
+ required?: boolean;
628
+ defaultValue?: any;
629
+ converter?: ConverterFn;
630
+ sampleValue?: any | ((index: number) => any);
631
+ }
632
+ interface ExcelParserOptions {
633
+ sheetIndex?: number;
634
+ headerRowIndex?: number;
635
+ }
636
+ interface ExcelSampleOptions {
637
+ sampleCount?: number;
638
+ fileName?: string;
639
+ sheetName?: string;
640
+ }
641
+ declare class ExcelParserError extends Error {
642
+ key: string;
643
+ params?: any | undefined;
644
+ constructor(key: string, params?: any | undefined);
645
+ }
646
+ declare class ExcelParser<T> {
647
+ private mappings;
648
+ constructor(mappings: ColumnMapping<T>[]);
649
+ parse(file: File, options?: ExcelParserOptions): Promise<{
650
+ data: T[];
651
+ logs: ParseLog[];
652
+ }>;
653
+ generateSampleExcel(options?: ExcelSampleOptions): Promise<void>;
654
+ }
655
+
656
+ declare abstract class ExcelImportBase<T> extends NettyAgGridListBase<any> {
657
+ protected isFileSelectionHidden: i0.WritableSignal<boolean>;
658
+ protected isFileValid: i0.WritableSignal<boolean>;
659
+ protected logs: i0.WritableSignal<ParseLog[]>;
660
+ protected hasLogs: i0.Signal<boolean>;
661
+ protected logDialog: MatDialog;
662
+ protected parser: ExcelParser<T>;
663
+ onBtnClick(e: any): void;
664
+ loadData(): void;
665
+ onFilesSelected(evt: any): void;
666
+ downloadSampleExcel(): void;
667
+ showLogs(): void;
668
+ static ɵfac: i0.ɵɵFactoryDeclaration<ExcelImportBase<any>, never>;
669
+ static ɵcmp: i0.ɵɵComponentDeclaration<ExcelImportBase<any>, "ntybase-excel-import-base", never, {}, {}, never, never, true, never>;
623
670
  }
624
671
 
625
672
  declare class ButtonRenderer implements ICellRendererAngularComp {
@@ -1146,52 +1193,6 @@ declare abstract class NettyAppsFilterBase<Trecord, Tfilter> extends NettyAppsBa
1146
1193
  static ɵcmp: i0.ɵɵComponentDeclaration<NettyAppsFilterBase<any, any>, "ntybase-netty-apps-base", never, { "isFilterExpanded": { "alias": "isFilterExpanded"; "required": false; "isSignal": true; }; "refresh": { "alias": "refresh"; "required": false; "isSignal": true; }; "fileName": { "alias": "fileName"; "required": false; "isSignal": true; }; }, { "isFilterExpanded": "isFilterExpandedChange"; "filteredRecords": "filteredRecords"; "filterSelectionChanged": "filterSelectionChanged"; }, never, never, true, never>;
1147
1194
  }
1148
1195
 
1149
- declare class ParseLog implements NettyEntityInterface<ParseLog> {
1150
- rowIndex: number;
1151
- message: string;
1152
- level: 'INFO' | 'WARN' | 'ERROR';
1153
- messageKey?: string;
1154
- messageParams?: any;
1155
- init(): void;
1156
- compare(other: ParseLog): ParseLog;
1157
- getPK(): number;
1158
- setPK(pk: any): void;
1159
- }
1160
-
1161
- type ConverterFn = (value: any) => any;
1162
- interface ColumnMapping<T> {
1163
- index: number;
1164
- prop: keyof T;
1165
- headerName?: string;
1166
- required?: boolean;
1167
- defaultValue?: any;
1168
- converter?: ConverterFn;
1169
- sampleValue?: any | ((index: number) => any);
1170
- }
1171
- interface ExcelParserOptions {
1172
- sheetIndex?: number;
1173
- headerRowIndex?: number;
1174
- }
1175
- interface ExcelSampleOptions {
1176
- sampleCount?: number;
1177
- fileName?: string;
1178
- sheetName?: string;
1179
- }
1180
- declare class ExcelParserError extends Error {
1181
- key: string;
1182
- params?: any | undefined;
1183
- constructor(key: string, params?: any | undefined);
1184
- }
1185
- declare class ExcelParser<T> {
1186
- private mappings;
1187
- constructor(mappings: ColumnMapping<T>[]);
1188
- parse(file: File, options?: ExcelParserOptions): Promise<{
1189
- data: T[];
1190
- logs: ParseLog[];
1191
- }>;
1192
- generateSampleExcel(options?: ExcelSampleOptions): Promise<void>;
1193
- }
1194
-
1195
1196
  declare const toNumber: (v: any) => number | null;
1196
1197
  declare const toDate: (v: any) => Date | null;
1197
1198
  declare const toBoolean: (v: any) => boolean | null;