@one-paragon/angular-utilities 0.1.32-beta → 0.1.32
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/action-state/action-state-spinner/action-state-spinner.component.d.ts +12 -12
- package/action-state/action-state-ui/action-state-ui.module.d.ts +9 -9
- package/action-state/index.d.ts +4 -4
- package/action-state/ngrx-ext/ngrx-ext.module.d.ts +8 -8
- package/action-state/ngrx.d.ts +31 -31
- package/esm2020/action-state/action-state-spinner/action-state-spinner.component.mjs +23 -23
- package/esm2020/action-state/action-state-ui/action-state-ui.module.mjs +28 -28
- package/esm2020/action-state/index.mjs +8 -8
- package/esm2020/action-state/ngrx-ext/ngrx-ext.module.mjs +23 -23
- package/esm2020/action-state/ngrx.mjs +42 -42
- package/esm2020/http-request-state/HttpRequestStateFactory.mjs +26 -26
- package/esm2020/http-request-state/HttpRequestStateStore.mjs +96 -96
- package/esm2020/http-request-state/directives/HttpStateDirectiveBase.mjs +33 -33
- package/esm2020/http-request-state/directives/http-error-state-directive.mjs +28 -28
- package/esm2020/http-request-state/directives/http-inProgress-state-directive.mjs +28 -28
- package/esm2020/http-request-state/directives/http-notStarted-state-directive.mjs +28 -28
- package/esm2020/http-request-state/directives/http-success-state-directive.mjs +33 -33
- package/esm2020/http-request-state/directives/index.mjs +5 -5
- package/esm2020/http-request-state/directives/request-state-directive.mjs +59 -59
- package/esm2020/http-request-state/helpers.mjs +21 -21
- package/esm2020/http-request-state/http-request-state.mjs +38 -38
- package/esm2020/http-request-state/http-state-module.mjs +40 -40
- package/esm2020/http-request-state/index.mjs +6 -6
- package/esm2020/http-request-state/rxjs/getRequestorBody.mjs +3 -3
- package/esm2020/http-request-state/rxjs/getRequestorState.mjs +2 -2
- package/esm2020/http-request-state/rxjs/index.mjs +4 -4
- package/esm2020/http-request-state/rxjs/tapError.mjs +11 -11
- package/esm2020/http-request-state/rxjs/tapSuccess.mjs +11 -11
- package/esm2020/http-request-state/types.mjs +15 -15
- package/esm2020/ngrx/actionable-selector.mjs +75 -75
- package/esm2020/ngrx/index.mjs +1 -1
- package/esm2020/one-paragon-angular-utilities.mjs +4 -4
- package/esm2020/public-api.mjs +19 -19
- package/esm2020/rxjs/defaultShareReplay.mjs +6 -6
- package/esm2020/rxjs/index.mjs +5 -5
- package/esm2020/rxjs/mapError.mjs +7 -7
- package/esm2020/rxjs/rxjs-operators.mjs +91 -91
- package/esm2020/rxjs/subjectifier.mjs +15 -15
- package/esm2020/table-builder/classes/DefaultSettings.mjs +6 -6
- package/esm2020/table-builder/classes/GenericTableDataSource.mjs +13 -13
- package/esm2020/table-builder/classes/MatTableObservableDataSource.mjs +21 -41
- package/esm2020/table-builder/classes/TableBuilderConfig.mjs +3 -3
- package/esm2020/table-builder/classes/TableState.mjs +31 -31
- package/esm2020/table-builder/classes/data-filter.mjs +26 -26
- package/esm2020/table-builder/classes/display-col.mjs +1 -1
- package/esm2020/table-builder/classes/filter-info.mjs +73 -73
- package/esm2020/table-builder/classes/table-builder-general-settings.mjs +67 -67
- package/esm2020/table-builder/classes/table-builder.mjs +76 -76
- package/esm2020/table-builder/classes/table-store.mjs +292 -292
- package/esm2020/table-builder/components/array-column.component.mjs +32 -32
- package/esm2020/table-builder/components/column-builder/column-builder.component.mjs +112 -112
- package/esm2020/table-builder/components/date-filter/date-filter.component.mjs +25 -25
- package/esm2020/table-builder/components/date-time-filter/date-time-filter.component.mjs +22 -22
- package/esm2020/table-builder/components/filter/filter.component.mjs +54 -54
- package/esm2020/table-builder/components/filter/in-list/in-list-filter.component.mjs +79 -79
- package/esm2020/table-builder/components/gen-col-displayer/gen-col-displayer.component.mjs +45 -45
- package/esm2020/table-builder/components/generic-table/generic-table.component.mjs +202 -204
- package/esm2020/table-builder/components/generic-table/paginator.component.mjs +60 -60
- package/esm2020/table-builder/components/group-by-list/group-by-list.component.mjs +22 -22
- package/esm2020/table-builder/components/header-menu/header-menu.component.mjs +90 -90
- package/esm2020/table-builder/components/in-filter/in-filter.component.mjs +63 -63
- package/esm2020/table-builder/components/index.mjs +10 -10
- package/esm2020/table-builder/components/initialization-component/initialization-component.mjs +33 -33
- package/esm2020/table-builder/components/link-column.component.mjs +30 -30
- package/esm2020/table-builder/components/number-filter/number-filter.component.mjs +26 -26
- package/esm2020/table-builder/components/sort-menu/sort-menu.component-store.mjs +41 -41
- package/esm2020/table-builder/components/sort-menu/sort-menu.component.mjs +75 -75
- package/esm2020/table-builder/components/table-container/table-container.mjs +322 -322
- package/esm2020/table-builder/components/table-container-filter/filter-list/filter-list.component.mjs +42 -42
- package/esm2020/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.mjs +30 -30
- package/esm2020/table-builder/components/table-container-filter/table-wrapper-filter-store.mjs +24 -24
- package/esm2020/table-builder/directives/custom-cell-directive.mjs +58 -58
- package/esm2020/table-builder/directives/index.mjs +6 -6
- package/esm2020/table-builder/directives/multi-sort.directive.mjs +42 -42
- package/esm2020/table-builder/directives/resize-column.directive.mjs +85 -85
- package/esm2020/table-builder/directives/table-wrapper.directive.mjs +26 -26
- package/esm2020/table-builder/directives/tb-filter.directive.mjs +403 -403
- package/esm2020/table-builder/enums/filterTypes.mjs +72 -72
- package/esm2020/table-builder/functions/boolean-filter-function.mjs +9 -9
- package/esm2020/table-builder/functions/date-filter-function.mjs +58 -58
- package/esm2020/table-builder/functions/download-data.mjs +11 -11
- package/esm2020/table-builder/functions/null-filter-function.mjs +7 -7
- package/esm2020/table-builder/functions/number-filter-function.mjs +31 -31
- package/esm2020/table-builder/functions/sort-data-function.mjs +4 -4
- package/esm2020/table-builder/functions/string-filter-function.mjs +40 -40
- package/esm2020/table-builder/interfaces/ColumnInfo.mjs +1 -1
- package/esm2020/table-builder/interfaces/dictionary.mjs +1 -1
- package/esm2020/table-builder/interfaces/report-def.mjs +35 -35
- package/esm2020/table-builder/material.module.mjs +207 -207
- package/esm2020/table-builder/ngrx/actions.mjs +4 -4
- package/esm2020/table-builder/ngrx/effects.mjs +47 -47
- package/esm2020/table-builder/ngrx/reducer.mjs +51 -51
- package/esm2020/table-builder/ngrx/selectors.mjs +23 -23
- package/esm2020/table-builder/pipes/column-total.pipe.mjs +19 -19
- package/esm2020/table-builder/pipes/format-filter-type.pipe.mjs +17 -17
- package/esm2020/table-builder/pipes/format-filter-value.pipe.mjs +45 -45
- package/esm2020/table-builder/pipes/key-display.mjs +19 -19
- package/esm2020/table-builder/services/export-to-csv.service.mjs +88 -88
- package/esm2020/table-builder/services/link-creator.service.mjs +42 -42
- package/esm2020/table-builder/services/table-template-service.mjs +44 -44
- package/esm2020/table-builder/services/transform-creator.mjs +75 -75
- package/esm2020/table-builder/table-builder.module.mjs +207 -215
- package/esm2020/utilities/directives/auto-focus.directive.mjs +25 -25
- package/esm2020/utilities/directives/clickEmitterDirective.mjs +20 -20
- package/esm2020/utilities/directives/clickSubject.mjs +26 -26
- package/esm2020/utilities/directives/conditional-classes.directive.mjs +35 -35
- package/esm2020/utilities/directives/dialog-service.mjs +25 -25
- package/esm2020/utilities/directives/dialog.mjs +137 -137
- package/esm2020/utilities/directives/mat-toggle-group-directive.mjs +59 -59
- package/esm2020/utilities/directives/prevent-enter.directive.mjs +18 -18
- package/esm2020/utilities/directives/stop-propagation.directive.mjs +24 -24
- package/esm2020/utilities/directives/styler.mjs +25 -25
- package/esm2020/utilities/directives/trim-whitespace.directive.mjs +29 -29
- package/esm2020/utilities/index.mjs +16 -16
- package/esm2020/utilities/module.mjs +91 -91
- package/esm2020/utilities/pipes/function.pipe.mjs +20 -20
- package/esm2020/utilities/pipes/phone.pipe.mjs +19 -19
- package/esm2020/utilities/pipes/space-case.pipes.mjs +28 -28
- package/fesm2015/one-paragon-angular-utilities.mjs +4413 -4442
- package/fesm2015/one-paragon-angular-utilities.mjs.map +1 -1
- package/fesm2020/one-paragon-angular-utilities.mjs +4393 -4422
- package/fesm2020/one-paragon-angular-utilities.mjs.map +1 -1
- package/http-request-state/HttpRequestStateFactory.d.ts +14 -14
- package/http-request-state/HttpRequestStateStore.d.ts +48 -48
- package/http-request-state/directives/HttpStateDirectiveBase.d.ts +16 -16
- package/http-request-state/directives/http-error-state-directive.d.ts +12 -12
- package/http-request-state/directives/http-inProgress-state-directive.d.ts +12 -12
- package/http-request-state/directives/http-notStarted-state-directive.d.ts +12 -12
- package/http-request-state/directives/http-success-state-directive.d.ts +21 -21
- package/http-request-state/directives/index.d.ts +5 -5
- package/http-request-state/directives/request-state-directive.d.ts +35 -35
- package/http-request-state/helpers.d.ts +9 -9
- package/http-request-state/http-request-state.d.ts +12 -12
- package/http-request-state/http-state-module.d.ts +11 -11
- package/http-request-state/index.d.ts +6 -6
- package/http-request-state/rxjs/getRequestorBody.d.ts +3 -3
- package/http-request-state/rxjs/getRequestorState.d.ts +3 -3
- package/http-request-state/rxjs/index.d.ts +4 -4
- package/http-request-state/rxjs/tapError.d.ts +3 -3
- package/http-request-state/rxjs/tapSuccess.d.ts +3 -3
- package/http-request-state/types.d.ts +36 -36
- package/index.d.ts +5 -5
- package/ngrx/actionable-selector.d.ts +15 -15
- package/ngrx/index.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +15 -15
- package/rxjs/defaultShareReplay.d.ts +2 -2
- package/rxjs/index.d.ts +4 -4
- package/rxjs/mapError.d.ts +2 -2
- package/rxjs/rxjs-operators.d.ts +12 -12
- package/rxjs/subjectifier.d.ts +9 -9
- package/table-builder/classes/DefaultSettings.d.ts +9 -9
- package/table-builder/classes/GenericTableDataSource.d.ts +8 -8
- package/table-builder/classes/MatTableObservableDataSource.d.ts +9 -17
- package/table-builder/classes/TableBuilderConfig.d.ts +20 -20
- package/table-builder/classes/TableState.d.ts +46 -46
- package/table-builder/classes/data-filter.d.ts +9 -9
- package/table-builder/classes/display-col.d.ts +5 -5
- package/table-builder/classes/filter-info.d.ts +40 -40
- package/table-builder/classes/table-builder-general-settings.d.ts +43 -43
- package/table-builder/classes/table-builder.d.ts +14 -14
- package/table-builder/classes/table-store.d.ts +114 -114
- package/table-builder/components/array-column.component.d.ts +14 -14
- package/table-builder/components/column-builder/column-builder.component.d.ts +50 -50
- package/table-builder/components/date-filter/date-filter.component.d.ts +10 -10
- package/table-builder/components/date-time-filter/date-time-filter.component.d.ts +10 -10
- package/table-builder/components/filter/filter.component.d.ts +371 -371
- package/table-builder/components/filter/in-list/in-list-filter.component.d.ts +27 -27
- package/table-builder/components/gen-col-displayer/gen-col-displayer.component.d.ts +16 -16
- package/table-builder/components/generic-table/generic-table.component.d.ts +73 -73
- package/table-builder/components/generic-table/paginator.component.d.ts +28 -28
- package/table-builder/components/group-by-list/group-by-list.component.d.ts +10 -10
- package/table-builder/components/header-menu/header-menu.component.d.ts +25 -25
- package/table-builder/components/in-filter/in-filter.component.d.ts +21 -21
- package/table-builder/components/index.d.ts +9 -9
- package/table-builder/components/initialization-component/initialization-component.d.ts +12 -12
- package/table-builder/components/link-column.component.d.ts +17 -17
- package/table-builder/components/number-filter/number-filter.component.d.ts +12 -12
- package/table-builder/components/sort-menu/sort-menu.component-store.d.ts +24 -24
- package/table-builder/components/sort-menu/sort-menu.component.d.ts +25 -25
- package/table-builder/components/table-container/table-container.d.ts +68 -68
- package/table-builder/components/table-container-filter/filter-list/filter-list.component.d.ts +17 -17
- package/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.d.ts +14 -14
- package/table-builder/components/table-container-filter/table-wrapper-filter-store.d.ts +14 -14
- package/table-builder/directives/custom-cell-directive.d.ts +19 -19
- package/table-builder/directives/index.d.ts +5 -5
- package/table-builder/directives/multi-sort.directive.d.ts +11 -11
- package/table-builder/directives/resize-column.directive.d.ts +43 -43
- package/table-builder/directives/table-wrapper.directive.d.ts +11 -11
- package/table-builder/directives/tb-filter.directive.d.ts +120 -120
- package/table-builder/enums/filterTypes.d.ts +37 -37
- package/table-builder/functions/boolean-filter-function.d.ts +3 -3
- package/table-builder/functions/date-filter-function.d.ts +4 -4
- package/table-builder/functions/download-data.d.ts +1 -1
- package/table-builder/functions/null-filter-function.d.ts +2 -2
- package/table-builder/functions/number-filter-function.d.ts +4 -4
- package/table-builder/functions/sort-data-function.d.ts +3 -3
- package/table-builder/functions/string-filter-function.d.ts +7 -7
- package/table-builder/interfaces/ColumnInfo.d.ts +6 -6
- package/table-builder/interfaces/dictionary.d.ts +3 -3
- package/table-builder/interfaces/report-def.d.ts +142 -142
- package/table-builder/material.module.d.ts +32 -32
- package/table-builder/ngrx/actions.d.ts +23 -23
- package/table-builder/ngrx/effects.d.ts +19 -19
- package/table-builder/ngrx/reducer.d.ts +15 -15
- package/table-builder/ngrx/selectors.d.ts +22 -22
- package/table-builder/pipes/column-total.pipe.d.ts +8 -8
- package/table-builder/pipes/format-filter-type.pipe.d.ts +8 -8
- package/table-builder/pipes/format-filter-value.pipe.d.ts +14 -14
- package/table-builder/pipes/key-display.d.ts +11 -11
- package/table-builder/services/export-to-csv.service.d.ts +22 -22
- package/table-builder/services/link-creator.service.d.ts +12 -12
- package/table-builder/services/table-template-service.d.ts +14 -14
- package/table-builder/services/transform-creator.d.ts +19 -19
- package/table-builder/table-builder.module.d.ts +46 -48
- package/utilities/directives/auto-focus.directive.d.ts +10 -10
- package/utilities/directives/clickEmitterDirective.d.ts +7 -7
- package/utilities/directives/clickSubject.d.ts +9 -9
- package/utilities/directives/conditional-classes.directive.d.ts +14 -14
- package/utilities/directives/dialog-service.d.ts +10 -10
- package/utilities/directives/dialog.d.ts +46 -46
- package/utilities/directives/mat-toggle-group-directive.d.ts +21 -21
- package/utilities/directives/prevent-enter.directive.d.ts +6 -6
- package/utilities/directives/stop-propagation.directive.d.ts +7 -7
- package/utilities/directives/styler.d.ts +9 -9
- package/utilities/directives/trim-whitespace.directive.d.ts +9 -9
- package/utilities/index.d.ts +15 -15
- package/utilities/module.d.ts +19 -19
- package/utilities/pipes/function.pipe.d.ts +7 -7
- package/utilities/pipes/phone.pipe.d.ts +7 -7
- package/utilities/pipes/space-case.pipes.d.ts +17 -17
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import { Inject, Injectable } from '@angular/core';
|
|
2
|
-
import { FieldType } from '../interfaces/report-def';
|
|
3
|
-
import { TableBuilderConfigToken } from '../classes/TableBuilderConfig';
|
|
4
|
-
import { get } from 'lodash';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
import * as i1 from "@angular/common";
|
|
7
|
-
import * as i2 from "../../utilities/pipes/phone.pipe";
|
|
8
|
-
import * as i3 from "../../utilities";
|
|
9
|
-
export function isPipe(o) {
|
|
10
|
-
return typeof (o.transform) === 'function';
|
|
11
|
-
}
|
|
12
|
-
export class TransformCreator {
|
|
13
|
-
constructor(datePipe, currencyPipe, phonePipe, casePipe, config) {
|
|
14
|
-
this.datePipe = datePipe;
|
|
15
|
-
this.currencyPipe = currencyPipe;
|
|
16
|
-
this.phonePipe = phonePipe;
|
|
17
|
-
this.casePipe = casePipe;
|
|
18
|
-
this.config = config;
|
|
19
|
-
}
|
|
20
|
-
createTransformer(metaData) {
|
|
21
|
-
const defaultFunc = (value) => get(value, metaData.key);
|
|
22
|
-
if (metaData.transform) {
|
|
23
|
-
if (isPipe(metaData.transform)) {
|
|
24
|
-
return (value) => metaData.transform.transform(defaultFunc(value));
|
|
25
|
-
}
|
|
26
|
-
return metaData.fieldType === FieldType.Expression ? metaData.transform : (value) => metaData.transform(defaultFunc(value), value);
|
|
27
|
-
}
|
|
28
|
-
if (this.config.transformers && this.config.transformers[metaData.fieldType]) {
|
|
29
|
-
var tranformer = this.config.transformers[metaData.fieldType];
|
|
30
|
-
return (value) => tranformer(defaultFunc(value));
|
|
31
|
-
}
|
|
32
|
-
const defaultDateFormat = this.config.defaultSettings?.dateFormat ?? 'shortDate';
|
|
33
|
-
const defaultDateTimeFormat = this.config.defaultSettings?.dateTimeFormat ?? 'short';
|
|
34
|
-
switch (metaData.fieldType) {
|
|
35
|
-
case FieldType.Date:
|
|
36
|
-
const dateFormat = metaData.additional?.dateFormat ?? defaultDateFormat;
|
|
37
|
-
return (value) => this.datePipe.transform(defaultFunc(value), dateFormat);
|
|
38
|
-
case FieldType.DateTime:
|
|
39
|
-
const dateTimeFormat = metaData.additional?.dateTimeOptions?.format ?? defaultDateTimeFormat;
|
|
40
|
-
return (value) => this.datePipe.transform(defaultFunc(value), dateTimeFormat);
|
|
41
|
-
case FieldType.Currency:
|
|
42
|
-
return (value) => this.currencyPipe.transform(defaultFunc(value));
|
|
43
|
-
case FieldType.PhoneNumber:
|
|
44
|
-
return (value) => this.phonePipe.transform(defaultFunc(value));
|
|
45
|
-
case FieldType.Enum:
|
|
46
|
-
return (value) => this.casePipe.transform(metaData.additional?.enumMap[defaultFunc(value)]);
|
|
47
|
-
case FieldType.Boolean:
|
|
48
|
-
let forTrue = 'check';
|
|
49
|
-
let forFalse = '';
|
|
50
|
-
if (metaData.additional?.boolean?.forTrue) {
|
|
51
|
-
forTrue = metaData?.additional.boolean.forTrue.icon;
|
|
52
|
-
}
|
|
53
|
-
if (metaData.additional?.boolean?.showForFalse === true) {
|
|
54
|
-
forFalse = 'clear';
|
|
55
|
-
}
|
|
56
|
-
else if (metaData.additional?.boolean?.showForFalse?.icon) {
|
|
57
|
-
forFalse = metaData.additional?.boolean?.showForFalse?.icon;
|
|
58
|
-
}
|
|
59
|
-
return (value) => defaultFunc(value) ? forTrue : forFalse;
|
|
60
|
-
}
|
|
61
|
-
return defaultFunc;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
TransformCreator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: TransformCreator, deps: [{ token: i1.DatePipe }, { token: i1.CurrencyPipe }, { token: i2.PhoneNumberPipe }, { token: i3.SpaceCasePipe }, { token: TableBuilderConfigToken }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
65
|
-
TransformCreator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: TransformCreator, providedIn: 'root' });
|
|
66
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: TransformCreator, decorators: [{
|
|
67
|
-
type: Injectable,
|
|
68
|
-
args: [{
|
|
69
|
-
providedIn: 'root',
|
|
70
|
-
}]
|
|
71
|
-
}], ctorParameters: function () { return [{ type: i1.DatePipe }, { type: i1.CurrencyPipe }, { type: i2.PhoneNumberPipe }, { type: i3.SpaceCasePipe }, { type: undefined, decorators: [{
|
|
72
|
-
type: Inject,
|
|
73
|
-
args: [TableBuilderConfigToken]
|
|
74
|
-
}] }]; } });
|
|
75
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { Inject, Injectable } from '@angular/core';
|
|
2
|
+
import { FieldType } from '../interfaces/report-def';
|
|
3
|
+
import { TableBuilderConfigToken } from '../classes/TableBuilderConfig';
|
|
4
|
+
import { get } from 'lodash';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import * as i1 from "@angular/common";
|
|
7
|
+
import * as i2 from "../../utilities/pipes/phone.pipe";
|
|
8
|
+
import * as i3 from "../../utilities";
|
|
9
|
+
export function isPipe(o) {
|
|
10
|
+
return typeof (o.transform) === 'function';
|
|
11
|
+
}
|
|
12
|
+
export class TransformCreator {
|
|
13
|
+
constructor(datePipe, currencyPipe, phonePipe, casePipe, config) {
|
|
14
|
+
this.datePipe = datePipe;
|
|
15
|
+
this.currencyPipe = currencyPipe;
|
|
16
|
+
this.phonePipe = phonePipe;
|
|
17
|
+
this.casePipe = casePipe;
|
|
18
|
+
this.config = config;
|
|
19
|
+
}
|
|
20
|
+
createTransformer(metaData) {
|
|
21
|
+
const defaultFunc = (value) => get(value, metaData.key);
|
|
22
|
+
if (metaData.transform) {
|
|
23
|
+
if (isPipe(metaData.transform)) {
|
|
24
|
+
return (value) => metaData.transform.transform(defaultFunc(value));
|
|
25
|
+
}
|
|
26
|
+
return metaData.fieldType === FieldType.Expression ? metaData.transform : (value) => metaData.transform(defaultFunc(value), value);
|
|
27
|
+
}
|
|
28
|
+
if (this.config.transformers && this.config.transformers[metaData.fieldType]) {
|
|
29
|
+
var tranformer = this.config.transformers[metaData.fieldType];
|
|
30
|
+
return (value) => tranformer(defaultFunc(value));
|
|
31
|
+
}
|
|
32
|
+
const defaultDateFormat = this.config.defaultSettings?.dateFormat ?? 'shortDate';
|
|
33
|
+
const defaultDateTimeFormat = this.config.defaultSettings?.dateTimeFormat ?? 'short';
|
|
34
|
+
switch (metaData.fieldType) {
|
|
35
|
+
case FieldType.Date:
|
|
36
|
+
const dateFormat = metaData.additional?.dateFormat ?? defaultDateFormat;
|
|
37
|
+
return (value) => this.datePipe.transform(defaultFunc(value), dateFormat);
|
|
38
|
+
case FieldType.DateTime:
|
|
39
|
+
const dateTimeFormat = metaData.additional?.dateTimeOptions?.format ?? defaultDateTimeFormat;
|
|
40
|
+
return (value) => this.datePipe.transform(defaultFunc(value), dateTimeFormat);
|
|
41
|
+
case FieldType.Currency:
|
|
42
|
+
return (value) => this.currencyPipe.transform(defaultFunc(value));
|
|
43
|
+
case FieldType.PhoneNumber:
|
|
44
|
+
return (value) => this.phonePipe.transform(defaultFunc(value));
|
|
45
|
+
case FieldType.Enum:
|
|
46
|
+
return (value) => this.casePipe.transform(metaData.additional?.enumMap[defaultFunc(value)]);
|
|
47
|
+
case FieldType.Boolean:
|
|
48
|
+
let forTrue = 'check';
|
|
49
|
+
let forFalse = '';
|
|
50
|
+
if (metaData.additional?.boolean?.forTrue) {
|
|
51
|
+
forTrue = metaData?.additional.boolean.forTrue.icon;
|
|
52
|
+
}
|
|
53
|
+
if (metaData.additional?.boolean?.showForFalse === true) {
|
|
54
|
+
forFalse = 'clear';
|
|
55
|
+
}
|
|
56
|
+
else if (metaData.additional?.boolean?.showForFalse?.icon) {
|
|
57
|
+
forFalse = metaData.additional?.boolean?.showForFalse?.icon;
|
|
58
|
+
}
|
|
59
|
+
return (value) => defaultFunc(value) ? forTrue : forFalse;
|
|
60
|
+
}
|
|
61
|
+
return defaultFunc;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
TransformCreator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: TransformCreator, deps: [{ token: i1.DatePipe }, { token: i1.CurrencyPipe }, { token: i2.PhoneNumberPipe }, { token: i3.SpaceCasePipe }, { token: TableBuilderConfigToken }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
65
|
+
TransformCreator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: TransformCreator, providedIn: 'root' });
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.2", ngImport: i0, type: TransformCreator, decorators: [{
|
|
67
|
+
type: Injectable,
|
|
68
|
+
args: [{
|
|
69
|
+
providedIn: 'root',
|
|
70
|
+
}]
|
|
71
|
+
}], ctorParameters: function () { return [{ type: i1.DatePipe }, { type: i1.CurrencyPipe }, { type: i2.PhoneNumberPipe }, { type: i3.SpaceCasePipe }, { type: undefined, decorators: [{
|
|
72
|
+
type: Inject,
|
|
73
|
+
args: [TableBuilderConfigToken]
|
|
74
|
+
}] }]; } });
|
|
75
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNmb3JtLWNyZWF0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyLXV0aWxpdGllcy9zcmMvdGFibGUtYnVpbGRlci9zZXJ2aWNlcy90cmFuc2Zvcm0tY3JlYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQWlCLE1BQU0sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbEUsT0FBTyxFQUFFLFNBQVMsRUFBWSxNQUFNLDBCQUEwQixDQUFDO0FBRy9ELE9BQU8sRUFBRSx1QkFBdUIsRUFBc0IsTUFBTS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