@one-paragon/angular-utilities 2.2.5 → 2.2.7

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": "@one-paragon/angular-utilities",
3
- "version": "2.2.5",
3
+ "version": "2.2.7",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "19.2.1",
6
6
  "@angular/core": "19.2.1",
@@ -6,6 +6,9 @@ export interface TableBuilderConfig {
6
6
  defaultTableSettings: Partial<Omit<TableBuilderSettings, 'injector'>> & {
7
7
  pageSize?: number;
8
8
  };
9
+ /**
10
+ * @deprecated use `defaultTableSettings.tableSettings.exportSettings`.
11
+ */
9
12
  export?: TableBuilderExport;
10
13
  dateFormats?: DefaultSettings;
11
14
  arrayDefaults?: ArrayAdditional;
@@ -16,8 +19,13 @@ export interface TableBuilderConfig {
16
19
  export interface TableBuilderExport {
17
20
  dateFormat?: string;
18
21
  dateTimeFormat?: string;
19
- onSave?: (event?: any) => void;
20
22
  prepend?: string;
23
+ mapEnumToString?: boolean;
24
+ mapLinkOptions?: {
25
+ mapLinkToString?: boolean;
26
+ excellStyle?: boolean;
27
+ domainPrefix?: string;
28
+ };
21
29
  }
22
30
  export declare const TableBuilderConfigToken: InjectionToken<TableBuilderConfig>;
23
31
  export declare function provideTableBuilder(config?: TableBuilderConfig): EnvironmentProviders;
@@ -1,6 +1,7 @@
1
1
  import { Predicate } from "@angular/core";
2
2
  import { Dictionary } from "../interfaces/dictionary";
3
3
  import { StylerStyle } from "../../utilities/directives/styler";
4
+ import { TableBuilderExport } from "./TableBuilderConfig";
4
5
  export interface TableBuilderSettings<T = any> {
5
6
  headerSettings?: Partial<TableWrapperHeaderSettings>;
6
7
  footerSettings?: Partial<TableWrapperFooterSettings>;
@@ -51,6 +52,7 @@ export declare class TableSettings<T = any> {
51
52
  rowClasses: Dictionary<Predicate<T> | true> | undefined;
52
53
  rowStyles: StylerStyle<T> | undefined;
53
54
  rowClick: ((row: T, event?: MouseEvent) => void) | undefined;
55
+ exportSettings: TableBuilderExport | undefined;
54
56
  }
55
57
  export declare class PersistedTableSettings {
56
58
  constructor(tableSettings?: NonFunctionProperties<PersistedTableSettings>);
@@ -79,6 +81,7 @@ export declare class NotPersistedTableSettings {
79
81
  rowClasses?: Dictionary<Predicate<any> | true> | undefined;
80
82
  rowStyles?: StylerStyle | undefined;
81
83
  rowClick?: ((row: any, event?: MouseEvent) => void) | undefined;
84
+ exportSettings: TableBuilderExport | undefined;
82
85
  }
83
86
  export declare class VirtualScrollOptions {
84
87
  rowHeight: TbSize;
@@ -154,7 +154,7 @@ interface BaseAdditional<T = any> {
154
154
  queryParamsHandling?: QueryParamsHandling;
155
155
  };
156
156
  };
157
- export?: TableBuilderExport;
157
+ export?: MetaDataExport<T>;
158
158
  dateFormat?: string;
159
159
  dateTimeOptions?: DateTimeOptions;
160
160
  styles?: StylerStyle<T>;
@@ -215,6 +215,12 @@ export interface ArrayAdditional<T = any> extends Additional<T> {
215
215
  limit?: number;
216
216
  arrayStyle?: ArrayStyle;
217
217
  }
218
+ interface MetaDataExport<T> extends TableBuilderExport {
219
+ /**
220
+ * This will supersede all other mappings when exporting.
221
+ */
222
+ mapForExport?: (t: T) => string;
223
+ }
218
224
  export declare function metaDataArrToDict<T = MetaData>(arr: MetaData[], transform?: (m: MetaData) => T): Dictionary<T>;
219
225
  export interface CustomCellMeta extends Pick<MetaData, 'key' | 'displayName' | 'preSort' | 'fieldType' | 'order' | 'width'> {
220
226
  customCell: true;
@@ -1,14 +1,22 @@
1
1
  import { TableStore } from '../classes/table-store';
2
+ import { TableBuilderExport } from '../classes/TableBuilderConfig';
2
3
  import { MetaData } from '../interfaces/report-def';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class ExportToCsvService<T> {
5
6
  state: TableStore;
6
7
  private config;
7
8
  private datePipe;
9
+ $exportSettings: import("@angular/core").Signal<TableBuilderExport & {
10
+ mapLinkToString?: boolean;
11
+ excellStyle?: boolean;
12
+ domainPrefix?: string;
13
+ }>;
8
14
  exportToCsv: (data: T[]) => void;
9
15
  csvData: (data: Array<T>, metaData: MetaData<T>[]) => string;
10
16
  metaToField: (meta: MetaData<T>, row: T) => any;
11
- private transform;
17
+ private stringByType;
18
+ cleanValForCsv(val: any): any;
19
+ private transformDate;
12
20
  static ɵfac: i0.ɵɵFactoryDeclaration<ExportToCsvService<any>, never>;
13
21
  static ɵprov: i0.ɵɵInjectableDeclaration<ExportToCsvService<any>>;
14
22
  }