@ngx-stoui/core 12.1.4 → 13.0.0
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/esm2020/index.mjs +18 -0
- package/esm2020/lib/abstract-and-interfaces/keyPress.enum.mjs +140 -0
- package/esm2020/lib/sto-directives/context-menu.directive.mjs +35 -0
- package/esm2020/lib/sto-directives/date-form-field-click.directive.mjs +45 -0
- package/esm2020/lib/sto-directives/directives.module.mjs +56 -0
- package/esm2020/lib/sto-directives/index.mjs +7 -0
- package/esm2020/lib/sto-directives/menu-overlay.directive.mjs +47 -0
- package/esm2020/lib/sto-directives/quick-keys.directive.mjs +78 -0
- package/esm2020/lib/sto-directives/sto-grid.directive.mjs +106 -0
- package/esm2020/lib/sto-directives/sto-select-text-on-focus.directive.mjs +58 -0
- package/esm2020/lib/sto-pipes/currency-format.pipe.mjs +35 -0
- package/esm2020/lib/sto-pipes/date-format.pipe.mjs +47 -0
- package/esm2020/lib/sto-pipes/keys.pipe.mjs +27 -0
- package/esm2020/lib/sto-pipes/number-format.pipe.mjs +78 -0
- package/esm2020/lib/sto-pipes/sto-pipes.module.mjs +51 -0
- package/esm2020/lib/sto-pipes/with-unit.mjs +43 -0
- package/esm2020/lib/sto-pipes/yes-no.mjs +21 -0
- package/esm2020/lib/sto-user-preference/sto-user-preference.component.mjs +45 -0
- package/esm2020/lib/sto-user-preference/sto-user-preference.module.mjs +27 -0
- package/esm2020/lib/sto-user-preference/sto-user-preference.service.mjs +39 -0
- package/esm2020/ngx-stoui-core.mjs +5 -0
- package/fesm2015/ngx-stoui-core.mjs +926 -0
- package/fesm2015/ngx-stoui-core.mjs.map +1 -0
- package/{fesm2015/ngx-stoui-core.js → fesm2020/ngx-stoui-core.mjs} +69 -72
- package/fesm2020/ngx-stoui-core.mjs.map +1 -0
- package/ngx-datatable.css +1 -1
- package/ngx-stoui.css +138 -137
- package/package.json +21 -8
- package/style/datatable/_ngx-datatable-form.scss +1 -1
- package/style/form/sto-form.scss +2 -2
- package/style/sto-dialog.scss +1 -1
- package/style/theme/_appheader.scss +1 -1
- package/style/theme/_card.scss +1 -1
- package/style/theme/_colors.scss +1 -1
- package/style/theme/_datatable.scss +1 -1
- package/style/theme/_drawer.scss +1 -1
- package/style/theme/_filterpanel.scss +1 -1
- package/style/theme/_input-overrides.scss +1 -1
- package/style/theme/_message-panel.scss +1 -1
- package/style/theme/_sto-indicators.scss +1 -1
- package/style/theme/_theme-variables.scss +1 -1
- package/style/theme/_theme.scss +1 -1
- package/style/theme/_typography.scss +1 -1
- package/style/theme.scss +1 -1
- package/bundles/ngx-stoui-core.umd.js +0 -1350
- package/bundles/ngx-stoui-core.umd.js.map +0 -1
- package/esm2015/index.js +0 -18
- package/esm2015/index.js.map +0 -1
- package/esm2015/lib/abstract-and-interfaces/keyPress.enum.js +0 -140
- package/esm2015/lib/abstract-and-interfaces/keyPress.enum.js.map +0 -1
- package/esm2015/lib/sto-directives/context-menu.directive.js +0 -35
- package/esm2015/lib/sto-directives/context-menu.directive.js.map +0 -1
- package/esm2015/lib/sto-directives/date-form-field-click.directive.js +0 -45
- package/esm2015/lib/sto-directives/date-form-field-click.directive.js.map +0 -1
- package/esm2015/lib/sto-directives/directives.module.js +0 -56
- package/esm2015/lib/sto-directives/directives.module.js.map +0 -1
- package/esm2015/lib/sto-directives/index.js +0 -7
- package/esm2015/lib/sto-directives/index.js.map +0 -1
- package/esm2015/lib/sto-directives/menu-overlay.directive.js +0 -47
- package/esm2015/lib/sto-directives/menu-overlay.directive.js.map +0 -1
- package/esm2015/lib/sto-directives/quick-keys.directive.js +0 -78
- package/esm2015/lib/sto-directives/quick-keys.directive.js.map +0 -1
- package/esm2015/lib/sto-directives/sto-grid.directive.js +0 -106
- package/esm2015/lib/sto-directives/sto-grid.directive.js.map +0 -1
- package/esm2015/lib/sto-directives/sto-select-text-on-focus.directive.js +0 -58
- package/esm2015/lib/sto-directives/sto-select-text-on-focus.directive.js.map +0 -1
- package/esm2015/lib/sto-pipes/currency-format.pipe.js +0 -35
- package/esm2015/lib/sto-pipes/currency-format.pipe.js.map +0 -1
- package/esm2015/lib/sto-pipes/date-format.pipe.js +0 -47
- package/esm2015/lib/sto-pipes/date-format.pipe.js.map +0 -1
- package/esm2015/lib/sto-pipes/keys.pipe.js +0 -27
- package/esm2015/lib/sto-pipes/keys.pipe.js.map +0 -1
- package/esm2015/lib/sto-pipes/number-format.pipe.js +0 -78
- package/esm2015/lib/sto-pipes/number-format.pipe.js.map +0 -1
- package/esm2015/lib/sto-pipes/sto-pipes.module.js +0 -51
- package/esm2015/lib/sto-pipes/sto-pipes.module.js.map +0 -1
- package/esm2015/lib/sto-pipes/with-unit.js +0 -43
- package/esm2015/lib/sto-pipes/with-unit.js.map +0 -1
- package/esm2015/lib/sto-pipes/yes-no.js +0 -21
- package/esm2015/lib/sto-pipes/yes-no.js.map +0 -1
- package/esm2015/lib/sto-user-preference/sto-user-preference.component.js +0 -48
- package/esm2015/lib/sto-user-preference/sto-user-preference.component.js.map +0 -1
- package/esm2015/lib/sto-user-preference/sto-user-preference.module.js +0 -27
- package/esm2015/lib/sto-user-preference/sto-user-preference.module.js.map +0 -1
- package/esm2015/lib/sto-user-preference/sto-user-preference.service.js +0 -39
- package/esm2015/lib/sto-user-preference/sto-user-preference.service.js.map +0 -1
- package/esm2015/ngx-stoui-core.js +0 -5
- package/esm2015/ngx-stoui-core.js.map +0 -1
- package/fesm2015/ngx-stoui-core.js.map +0 -1
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { Directive, EventEmitter, HostListener, Input, Output } from '@angular/core';
|
|
2
|
-
import { FormGroup } from '@angular/forms';
|
|
3
|
-
import { Key } from '../abstract-and-interfaces/keyPress.enum';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
/**
|
|
6
|
-
* QuickKeysDirective is used to implement shortcut keys on DOM elements, e.g to submit or reset a form on enter/escape
|
|
7
|
-
* <form quickKeys (quickSubmit)="save()" (quickCancel)="reset()">
|
|
8
|
-
*/
|
|
9
|
-
export class QuickKeysDirective {
|
|
10
|
-
constructor() {
|
|
11
|
-
/**
|
|
12
|
-
* Emits when ctrl + enter is clicked in combination
|
|
13
|
-
* <form (quickSubmit)="save()">
|
|
14
|
-
*/
|
|
15
|
-
this.quickSubmit = new EventEmitter();
|
|
16
|
-
/**
|
|
17
|
-
* Emits when escape is clicked
|
|
18
|
-
* <form (quickCancel)="cancel()">
|
|
19
|
-
*/
|
|
20
|
-
this.quickCancel = new EventEmitter();
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Listens on the host element for any keyup events
|
|
24
|
-
* @param e
|
|
25
|
-
*/
|
|
26
|
-
onKeyUp(e) {
|
|
27
|
-
if (this.formGroup) {
|
|
28
|
-
this.handleFormKeys(e);
|
|
29
|
-
}
|
|
30
|
-
this.handleGenericKeydown(e);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Handler for generic keydowns, such as cancel events to close drawers
|
|
34
|
-
* @param e
|
|
35
|
-
* void
|
|
36
|
-
*/
|
|
37
|
-
handleGenericKeydown(e) {
|
|
38
|
-
// Shortcuts that are useful outside of forms
|
|
39
|
-
if (e.keyCode === Key.Escape) {
|
|
40
|
-
this.quickCancel.emit();
|
|
41
|
-
}
|
|
42
|
-
if (!this.formGroup && e.keyCode === Key.Enter && e.ctrlKey) {
|
|
43
|
-
this.quickSubmit.emit();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Handler for form specific shortcuts, such as saving the form
|
|
48
|
-
* @param e
|
|
49
|
-
*/
|
|
50
|
-
handleFormKeys(e) {
|
|
51
|
-
if (this.formGroup.pristine) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (e.keyCode === Key.Enter && e.ctrlKey) {
|
|
55
|
-
this.quickSubmit.emit();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
QuickKeysDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QuickKeysDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
60
|
-
QuickKeysDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.0", type: QuickKeysDirective, selector: "[stoQuickKeys]", inputs: { quickKeys: "quickKeys", formGroup: "formGroup" }, outputs: { quickSubmit: "quickSubmit", quickCancel: "quickCancel" }, host: { listeners: { "keyup": "onKeyUp($event)" } }, ngImport: i0 });
|
|
61
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: QuickKeysDirective, decorators: [{
|
|
62
|
-
type: Directive,
|
|
63
|
-
args: [{
|
|
64
|
-
selector: '[stoQuickKeys]'
|
|
65
|
-
}]
|
|
66
|
-
}], propDecorators: { quickKeys: [{
|
|
67
|
-
type: Input
|
|
68
|
-
}], formGroup: [{
|
|
69
|
-
type: Input
|
|
70
|
-
}], quickSubmit: [{
|
|
71
|
-
type: Output
|
|
72
|
-
}], quickCancel: [{
|
|
73
|
-
type: Output
|
|
74
|
-
}], onKeyUp: [{
|
|
75
|
-
type: HostListener,
|
|
76
|
-
args: ['keyup', ['$event']]
|
|
77
|
-
}] } });
|
|
78
|
-
//# sourceMappingURL=quick-keys.directive.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quick-keys.directive.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/sto-directives/quick-keys.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,0CAA0C,CAAC;;AAE/D;;;GAGG;AAKH,MAAM,OAAO,kBAAkB;IAH/B;QASE;;;WAGG;QACO,gBAAW,GAAG,IAAI,YAAY,EAAQ,CAAC;QACjD;;;WAGG;QACO,gBAAW,GAAG,IAAI,YAAY,EAAQ,CAAC;KAyClD;IAvCC;;;OAGG;IAEH,OAAO,CAAC,CAAgB;QACtB,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;SACxB;QACD,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACK,oBAAoB,CAAC,CAAgB;QAC3C,6CAA6C;QAC7C,IAAI,CAAC,CAAC,OAAO,KAAK,GAAG,CAAC,MAAM,EAAE;YAC5B,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;SACzB;QACD,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,OAAO,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE;YAC3D,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;SACzB;IACH,CAAC;IAED;;;OAGG;IACK,cAAc,CAAC,CAAgB;QACrC,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE;YAC3B,OAAO;SACR;QACD,IAAI,CAAC,CAAC,OAAO,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE;YACxC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;SACzB;IACH,CAAC;;+GAvDU,kBAAkB;mGAAlB,kBAAkB;2FAAlB,kBAAkB;kBAH9B,SAAS;mBAAC;oBACT,QAAQ,EAAE,gBAAgB;iBAC3B;8BAEU,SAAS;sBAAjB,KAAK;gBAIG,SAAS;sBAAjB,KAAK;gBAKI,WAAW;sBAApB,MAAM;gBAKG,WAAW;sBAApB,MAAM;gBAOP,OAAO;sBADN,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import { Directive, EventEmitter, HostListener, Input, Output } from '@angular/core';\nimport { FormGroup } from '@angular/forms';\nimport { Key } from '../abstract-and-interfaces/keyPress.enum';\n\n/**\n * QuickKeysDirective is used to implement shortcut keys on DOM elements, e.g to submit or reset a form on enter/escape\n * <form quickKeys (quickSubmit)=\"save()\" (quickCancel)=\"reset()\">\n */\n\n@Directive({\n selector: '[stoQuickKeys]'\n})\nexport class QuickKeysDirective {\n @Input() quickKeys: unknown;\n /**\n * Optional formGroup input, when used in combination with a reactive form\n */\n @Input() formGroup: FormGroup;\n /**\n * Emits when ctrl + enter is clicked in combination\n * <form (quickSubmit)=\"save()\">\n */\n @Output() quickSubmit = new EventEmitter<void>();\n /**\n * Emits when escape is clicked\n * <form (quickCancel)=\"cancel()\">\n */\n @Output() quickCancel = new EventEmitter<void>();\n\n /**\n * Listens on the host element for any keyup events\n * @param e\n */\n @HostListener('keyup', ['$event'])\n onKeyUp(e: KeyboardEvent) {\n if (this.formGroup) {\n this.handleFormKeys(e);\n }\n this.handleGenericKeydown(e);\n }\n\n /**\n * Handler for generic keydowns, such as cancel events to close drawers\n * @param e\n * void\n */\n private handleGenericKeydown(e: KeyboardEvent) {\n // Shortcuts that are useful outside of forms\n if (e.keyCode === Key.Escape) {\n this.quickCancel.emit();\n }\n if (!this.formGroup && e.keyCode === Key.Enter && e.ctrlKey) {\n this.quickSubmit.emit();\n }\n }\n\n /**\n * Handler for form specific shortcuts, such as saving the form\n * @param e\n */\n private handleFormKeys(e: KeyboardEvent) {\n if (this.formGroup.pristine) {\n return;\n }\n if (e.keyCode === Key.Enter && e.ctrlKey) {\n this.quickSubmit.emit();\n }\n }\n}\n"]}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { ContentChildren, Directive, ElementRef, HostBinding, Input, QueryList } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
const getClass = (width, small = 400, large = 800) => {
|
|
4
|
-
let cols = 1;
|
|
5
|
-
if (width > small) {
|
|
6
|
-
cols += 1;
|
|
7
|
-
}
|
|
8
|
-
if (width > large) {
|
|
9
|
-
cols += 2;
|
|
10
|
-
}
|
|
11
|
-
return `sto-f-grid--${cols}`;
|
|
12
|
-
};
|
|
13
|
-
const ALL_GRIDS = ['sto-f-grid--1', 'sto-f-grid--2', 'sto-f-grid--4', 'sto-f-grid--6'];
|
|
14
|
-
export class StoGridSpacerDirective {
|
|
15
|
-
constructor() {
|
|
16
|
-
this.useClass = true;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
StoGridSpacerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: StoGridSpacerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
20
|
-
StoGridSpacerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.0", type: StoGridSpacerDirective, selector: "[stoGridSpacer]", host: { properties: { "class.sto-f-grid__col": "this.useClass", "class.sto-f-grid__col--spacer": "this.useClass" } }, ngImport: i0 });
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: StoGridSpacerDirective, decorators: [{
|
|
22
|
-
type: Directive,
|
|
23
|
-
args: [{ selector: '[stoGridSpacer]' }]
|
|
24
|
-
}], propDecorators: { useClass: [{
|
|
25
|
-
type: HostBinding,
|
|
26
|
-
args: ['class.sto-f-grid__col']
|
|
27
|
-
}, {
|
|
28
|
-
type: HostBinding,
|
|
29
|
-
args: ['class.sto-f-grid__col--spacer']
|
|
30
|
-
}] } });
|
|
31
|
-
export class StoGridColumnDirective {
|
|
32
|
-
constructor() {
|
|
33
|
-
this.useClass = true;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
StoGridColumnDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: StoGridColumnDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
37
|
-
StoGridColumnDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.0", type: StoGridColumnDirective, selector: "[stoGridColumn]", inputs: { stoGridColumnDouble: "stoGridColumnDouble" }, host: { properties: { "class.sto-f-grid__col": "this.useClass", "class.sto-f-grid__col--2": "this.stoGridColumnDouble" } }, ngImport: i0 });
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: StoGridColumnDirective, decorators: [{
|
|
39
|
-
type: Directive,
|
|
40
|
-
args: [{ selector: '[stoGridColumn]' }]
|
|
41
|
-
}], propDecorators: { useClass: [{
|
|
42
|
-
type: HostBinding,
|
|
43
|
-
args: ['class.sto-f-grid__col']
|
|
44
|
-
}], stoGridColumnDouble: [{
|
|
45
|
-
type: HostBinding,
|
|
46
|
-
args: ['class.sto-f-grid__col--2']
|
|
47
|
-
}, {
|
|
48
|
-
type: Input
|
|
49
|
-
}] } });
|
|
50
|
-
export class StoGridDirective {
|
|
51
|
-
constructor(elRef) {
|
|
52
|
-
this.elRef = elRef;
|
|
53
|
-
this.maxWidth = 1000;
|
|
54
|
-
this.minWidth = 250;
|
|
55
|
-
this.baseClass = true;
|
|
56
|
-
}
|
|
57
|
-
ngAfterViewInit() {
|
|
58
|
-
const el = this.elRef.nativeElement;
|
|
59
|
-
this.observer = new ResizeObserver(entries => {
|
|
60
|
-
for (const entry of entries) {
|
|
61
|
-
const cr = entry.contentRect;
|
|
62
|
-
const { width } = cr;
|
|
63
|
-
const breakpoints = this.breakpoints || { 2: 400, 4: 800 };
|
|
64
|
-
const gridType = getClass(width, breakpoints[2], breakpoints[4]);
|
|
65
|
-
if (!el.classList.contains(gridType)) {
|
|
66
|
-
el.classList.remove(...ALL_GRIDS);
|
|
67
|
-
el.classList.add(gridType);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
this.observer.observe(this.elRef.nativeElement);
|
|
72
|
-
}
|
|
73
|
-
ngOnDestroy() {
|
|
74
|
-
if (this.observer) {
|
|
75
|
-
this.observer.disconnect();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
StoGridDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: StoGridDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
80
|
-
StoGridDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.0", type: StoGridDirective, selector: "[stoGrid]", inputs: { maxWidth: "maxWidth", minWidth: "minWidth", breakpoints: "breakpoints" }, host: { properties: { "style.max-width.px": "this.maxWidth", "style.min-width.px": "this.minWidth", "class.sto-f-grid": "this.baseClass" } }, queries: [{ propertyName: "columns", predicate: StoGridColumnDirective, read: ElementRef }], exportAs: ["stoGrid"], ngImport: i0 });
|
|
81
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: StoGridDirective, decorators: [{
|
|
82
|
-
type: Directive,
|
|
83
|
-
args: [{
|
|
84
|
-
selector: '[stoGrid]',
|
|
85
|
-
exportAs: 'stoGrid'
|
|
86
|
-
}]
|
|
87
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { maxWidth: [{
|
|
88
|
-
type: HostBinding,
|
|
89
|
-
args: ['style.max-width.px']
|
|
90
|
-
}, {
|
|
91
|
-
type: Input
|
|
92
|
-
}], minWidth: [{
|
|
93
|
-
type: HostBinding,
|
|
94
|
-
args: ['style.min-width.px']
|
|
95
|
-
}, {
|
|
96
|
-
type: Input
|
|
97
|
-
}], baseClass: [{
|
|
98
|
-
type: HostBinding,
|
|
99
|
-
args: ['class.sto-f-grid']
|
|
100
|
-
}], columns: [{
|
|
101
|
-
type: ContentChildren,
|
|
102
|
-
args: [StoGridColumnDirective, { read: ElementRef }]
|
|
103
|
-
}], breakpoints: [{
|
|
104
|
-
type: Input
|
|
105
|
-
}] } });
|
|
106
|
-
//# sourceMappingURL=sto-grid.directive.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sto-grid.directive.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/sto-directives/sto-grid.directive.ts"],"names":[],"mappings":"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","sourcesContent":["import { AfterViewInit, ContentChildren, Directive, ElementRef, HostBinding, Input, OnDestroy, QueryList } from '@angular/core';\n\ninterface BreakpointConfig {\n 2: number;\n 4: number;\n}\n\nconst getClass = (width: number, small = 400, large = 800) => {\n let cols = 1;\n if ( width > small ) {\n cols += 1;\n }\n if ( width > large ) {\n cols += 2;\n }\n return `sto-f-grid--${cols}`;\n};\n\nconst ALL_GRIDS = [ 'sto-f-grid--1', 'sto-f-grid--2', 'sto-f-grid--4', 'sto-f-grid--6' ];\n\n@Directive({ selector: '[stoGridSpacer]' })\nexport class StoGridSpacerDirective {\n @HostBinding('class.sto-f-grid__col')\n @HostBinding('class.sto-f-grid__col--spacer')\n useClass = true;\n}\n\n@Directive({ selector: '[stoGridColumn]' })\nexport class StoGridColumnDirective {\n @HostBinding('class.sto-f-grid__col')\n useClass = true;\n @HostBinding('class.sto-f-grid__col--2')\n @Input()\n stoGridColumnDouble: boolean;\n\n}\n\n@Directive({\n selector: '[stoGrid]',\n exportAs: 'stoGrid'\n})\nexport class StoGridDirective implements AfterViewInit, OnDestroy {\n @HostBinding('style.max-width.px')\n @Input()\n maxWidth = 1000;\n @HostBinding('style.min-width.px')\n @Input()\n minWidth = 250;\n @HostBinding('class.sto-f-grid')\n baseClass = true;\n @ContentChildren(StoGridColumnDirective, { read: ElementRef })\n columns: QueryList<ElementRef<HTMLElement>>;\n @Input()\n breakpoints: BreakpointConfig;\n\n private observer: ResizeObserver;\n\n constructor(\n private elRef: ElementRef<HTMLElement>,\n ) {\n }\n\n ngAfterViewInit() {\n const el = this.elRef.nativeElement as HTMLElement;\n this.observer = new ResizeObserver(entries => {\n for ( const entry of entries ) {\n const cr = entry.contentRect;\n const { width } = cr;\n const breakpoints = this.breakpoints || { 2: 400, 4: 800 };\n const gridType = getClass(width, breakpoints[ 2 ], breakpoints[ 4 ]);\n if ( !el.classList.contains(gridType) ) {\n el.classList.remove(...ALL_GRIDS);\n el.classList.add(gridType);\n }\n }\n });\n this.observer.observe(this.elRef.nativeElement);\n }\n\n ngOnDestroy() {\n if ( this.observer ) {\n this.observer.disconnect();\n }\n }\n\n}\n\n"]}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Directive, ElementRef, HostListener, Optional } from '@angular/core';
|
|
2
|
-
import { Subject } from 'rxjs';
|
|
3
|
-
import { StoUserPreferenceService } from '../sto-user-preference/sto-user-preference.service';
|
|
4
|
-
import { takeUntil } from 'rxjs/operators';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
import * as i1 from "../sto-user-preference/sto-user-preference.service";
|
|
7
|
-
/**
|
|
8
|
-
* stoSelectTextOnFocus listens for input focus events, and selects the contents of the input
|
|
9
|
-
* A user service is established in {@link StoUserPreferenceService} that allows a user to toggle this feature
|
|
10
|
-
*/
|
|
11
|
-
export class StoSelectTextOnFocusDirective {
|
|
12
|
-
constructor(elementRef, userPreferenceService) {
|
|
13
|
-
this.elementRef = elementRef;
|
|
14
|
-
this.userPreferenceService = userPreferenceService;
|
|
15
|
-
this.destroyed$ = new Subject();
|
|
16
|
-
this._el = this.elementRef.nativeElement;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Listens for focus events on the host (input) element, and focuses if applicable
|
|
20
|
-
*/
|
|
21
|
-
onFocus() {
|
|
22
|
-
if (this._hasSelectTextOnFocusEnabled && this._el.readOnly === false) {
|
|
23
|
-
this._el.select();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Subscribes to changes in {@link StoUserPreferenceService}, and binds the variable accordingly.
|
|
28
|
-
*/
|
|
29
|
-
ngOnInit() {
|
|
30
|
-
if (this.userPreferenceService) {
|
|
31
|
-
this.userPreferenceService.hasSelectTextOnFocusEnabled
|
|
32
|
-
.pipe(takeUntil(this.destroyed$)).subscribe((hasSelectTextOnFocusEnabled) => {
|
|
33
|
-
this._hasSelectTextOnFocusEnabled = hasSelectTextOnFocusEnabled;
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
ngOnDestroy() {
|
|
38
|
-
this.destroyed$.next(true);
|
|
39
|
-
this.destroyed$.complete();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
StoSelectTextOnFocusDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: StoSelectTextOnFocusDirective, deps: [{ token: i0.ElementRef }, { token: i1.StoUserPreferenceService, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
43
|
-
StoSelectTextOnFocusDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.0", type: StoSelectTextOnFocusDirective, selector: "[stoSelectTextOnFocus]", host: { listeners: { "focus": "onFocus()", "dblclick": "onFocus()" } }, ngImport: i0 });
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: StoSelectTextOnFocusDirective, decorators: [{
|
|
45
|
-
type: Directive,
|
|
46
|
-
args: [{
|
|
47
|
-
selector: '[stoSelectTextOnFocus]'
|
|
48
|
-
}]
|
|
49
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.StoUserPreferenceService, decorators: [{
|
|
50
|
-
type: Optional
|
|
51
|
-
}] }]; }, propDecorators: { onFocus: [{
|
|
52
|
-
type: HostListener,
|
|
53
|
-
args: ['focus']
|
|
54
|
-
}, {
|
|
55
|
-
type: HostListener,
|
|
56
|
-
args: ['dblclick']
|
|
57
|
-
}] } });
|
|
58
|
-
//# sourceMappingURL=sto-select-text-on-focus.directive.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sto-select-text-on-focus.directive.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/sto-directives/sto-select-text-on-focus.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAqB,QAAQ,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAC9F,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;;;AAE3C;;;GAGG;AAIH,MAAM,OAAO,6BAA6B;IAOxC,YAAoB,UAAsB,EAAsB,qBAA+C;QAA3F,eAAU,GAAV,UAAU,CAAY;QAAsB,0BAAqB,GAArB,qBAAqB,CAA0B;QALvG,eAAU,GAAG,IAAI,OAAO,EAAW,CAAC;QAM1C,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;IAC3C,CAAC;IAED;;OAEG;IAGH,OAAO;QACL,IAAK,IAAI,CAAC,4BAA4B,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,KAAK,KAAK,EAAG;YACtE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;SACnB;IAEH,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,IAAK,IAAI,CAAC,qBAAqB,EAAG;YAChC,IAAI,CAAC,qBAAqB,CAAC,2BAA2B;iBACnD,IAAI,CACH,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAC3B,CAAC,SAAS,CAAC,CAAC,2BAA2B,EAAE,EAAE;gBAC5C,IAAI,CAAC,4BAA4B,GAAG,2BAA2B,CAAC;YAClE,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IAED,WAAW;QACT,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;;0HAxCU,6BAA6B;8GAA7B,6BAA6B;2FAA7B,6BAA6B;kBAHzC,SAAS;mBAAC;oBACT,QAAQ,EAAE,wBAAwB;iBACnC;;0BAQ8C,QAAQ;4CASrD,OAAO;sBAFN,YAAY;uBAAC,OAAO;;sBACpB,YAAY;uBAAC,UAAU","sourcesContent":["import { Directive, ElementRef, HostListener, OnDestroy, OnInit, Optional } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { StoUserPreferenceService } from '../sto-user-preference/sto-user-preference.service';\nimport { takeUntil } from 'rxjs/operators';\n\n/**\n * stoSelectTextOnFocus listens for input focus events, and selects the contents of the input\n * A user service is established in {@link StoUserPreferenceService} that allows a user to toggle this feature\n */\n@Directive({\n selector: '[stoSelectTextOnFocus]'\n})\nexport class StoSelectTextOnFocusDirective implements OnInit, OnDestroy {\n\n private destroyed$ = new Subject<boolean>();\n\n private _hasSelectTextOnFocusEnabled: boolean;\n private _el: HTMLInputElement;\n\n constructor(private elementRef: ElementRef, @Optional() private userPreferenceService: StoUserPreferenceService) {\n this._el = this.elementRef.nativeElement;\n }\n\n /**\n * Listens for focus events on the host (input) element, and focuses if applicable\n */\n @HostListener('focus')\n @HostListener('dblclick')\n onFocus() {\n if ( this._hasSelectTextOnFocusEnabled && this._el.readOnly === false ) {\n this._el.select();\n }\n\n }\n\n /**\n * Subscribes to changes in {@link StoUserPreferenceService}, and binds the variable accordingly.\n */\n ngOnInit() {\n if ( this.userPreferenceService ) {\n this.userPreferenceService.hasSelectTextOnFocusEnabled\n .pipe(\n takeUntil(this.destroyed$)\n ).subscribe((hasSelectTextOnFocusEnabled) => {\n this._hasSelectTextOnFocusEnabled = hasSelectTextOnFocusEnabled;\n });\n }\n }\n\n ngOnDestroy() {\n this.destroyed$.next(true);\n this.destroyed$.complete();\n }\n\n}\n"]}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Pipe } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
/**
|
|
4
|
-
* Pipe used to transform numbers to a currency format
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
*
|
|
8
|
-
* <span>{{ 5000.5824 | currentFormat:'$':3 }}</span>
|
|
9
|
-
* Results in
|
|
10
|
-
* <span>5 000,582 $</span>
|
|
11
|
-
*/
|
|
12
|
-
export class CurrencyFormatPipe {
|
|
13
|
-
transform(value, unit = '', maximumFractionDigits = 3) {
|
|
14
|
-
if (!value) {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
if (typeof value === 'string') {
|
|
18
|
-
value = parseFloat(value);
|
|
19
|
-
if (isNaN(value)) {
|
|
20
|
-
return '';
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
const intl = new Intl.NumberFormat('en-US', { maximumFractionDigits }).format(value);
|
|
24
|
-
return intl.replace(/,/g, ' ').replace('.', ',') + ` ${unit}`;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
CurrencyFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: CurrencyFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
28
|
-
CurrencyFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: CurrencyFormatPipe, name: "currencyFormat" });
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: CurrencyFormatPipe, decorators: [{
|
|
30
|
-
type: Pipe,
|
|
31
|
-
args: [{
|
|
32
|
-
name: 'currencyFormat'
|
|
33
|
-
}]
|
|
34
|
-
}] });
|
|
35
|
-
//# sourceMappingURL=currency-format.pipe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"currency-format.pipe.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/sto-pipes/currency-format.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,MAAM,eAAe,CAAC;;AAEpD;;;;;;;;IAQI;AAIJ,MAAM,OAAO,kBAAkB;IAC7B,SAAS,CAAC,KAAa,EAAE,OAAe,EAAE,EAAE,qBAAqB,GAAG,CAAC;QACnE,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,IAAI,CAAC;SACb;QACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;YAC1B,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE;gBAChB,OAAO,EAAE,CAAC;aACX;SACF;QAED,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAC,qBAAqB,EAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;IAChE,CAAC;;+GAdU,kBAAkB;6GAAlB,kBAAkB;2FAAlB,kBAAkB;kBAH9B,IAAI;mBAAC;oBACJ,IAAI,EAAE,gBAAgB;iBACvB","sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Pipe used to transform numbers to a currency format\n *\n * @example\n *\n * <span>{{ 5000.5824 | currentFormat:'$':3 }}</span>\n * Results in\n * <span>5 000,582 $</span>\n */\n@Pipe({\n name: 'currencyFormat'\n})\nexport class CurrencyFormatPipe implements PipeTransform {\n transform(value: number, unit: string = '', maximumFractionDigits = 3): string | null {\n if (!value) {\n return null;\n }\n if (typeof value === 'string') {\n value = parseFloat(value);\n if (isNaN(value)) {\n return '';\n }\n }\n\n const intl = new Intl.NumberFormat('en-US', {maximumFractionDigits}).format(value);\n return intl.replace(/,/g, ' ').replace('.', ',') + ` ${unit}`;\n }\n}\n\n"]}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Pipe } from '@angular/core';
|
|
2
|
-
import { format as formatDate } from 'date-fns';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
/**
|
|
5
|
-
* Pipe used to transform dates, based on our default formats.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
*
|
|
9
|
-
* public date = "2018-08-27 14:00:30"
|
|
10
|
-
* <span>{{ date | dateFormat }}</span> -> Aug 27, 2018
|
|
11
|
-
* <span>{{ date | dateFormat:'long' }}</span> -> Monday Aug 27, 2018
|
|
12
|
-
*/
|
|
13
|
-
export class DateFormatPipe {
|
|
14
|
-
transform(value, format) {
|
|
15
|
-
if (!value) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
if (typeof value === 'string') {
|
|
19
|
-
value = new Date(value);
|
|
20
|
-
}
|
|
21
|
-
switch (format) {
|
|
22
|
-
case 'long':
|
|
23
|
-
return formatDate(value, 'EEEE MMM d, yyyy');
|
|
24
|
-
case 'short':
|
|
25
|
-
return formatDate(value, 'yyyy-MM-dd');
|
|
26
|
-
case 'datetime':
|
|
27
|
-
return formatDate(value, 'MMM d, yyyy, HH:mm');
|
|
28
|
-
case 'datetimezone':
|
|
29
|
-
return formatDate(value, `MMM d, yyyy, HH:mm:ss ('UTC'xxx)`);
|
|
30
|
-
case 'datetime-long':
|
|
31
|
-
return formatDate(value, 'EEEE MMM dd, yyyy, HH:mm');
|
|
32
|
-
case 'datetime-short':
|
|
33
|
-
return formatDate(value, 'yyyy-MM-dd, HH:mm');
|
|
34
|
-
default:
|
|
35
|
-
return formatDate(value, 'MMM d, yyyy');
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
DateFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: DateFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
40
|
-
DateFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: DateFormatPipe, name: "formatDate" });
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: DateFormatPipe, decorators: [{
|
|
42
|
-
type: Pipe,
|
|
43
|
-
args: [{
|
|
44
|
-
name: 'formatDate'
|
|
45
|
-
}]
|
|
46
|
-
}] });
|
|
47
|
-
//# sourceMappingURL=date-format.pipe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-format.pipe.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/sto-pipes/date-format.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;;AAEhD;;;;;;;;GAQG;AAKH,MAAM,OAAO,cAAc;IAEzB,SAAS,CAAC,KAAoC,EAAE,MAAe;QAC7D,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,IAAI,CAAC;SACb;QACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;SACzB;QACD,QAAQ,MAAM,EAAE;YACd,KAAK,MAAM;gBACT,OAAO,UAAU,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;YAC/C,KAAK,OAAO;gBACV,OAAO,UAAU,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;YACzC,KAAK,UAAU;gBACb,OAAO,UAAU,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAC;YACjD,KAAK,cAAc;gBACjB,OAAO,UAAU,CAAC,KAAK,EAAE,kCAAkC,CAAC,CAAC;YAC/D,KAAK,eAAe;gBAClB,OAAO,UAAU,CAAC,KAAK,EAAE,0BAA0B,CAAC,CAAC;YACvD,KAAK,gBAAgB;gBACnB,OAAO,UAAU,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;YAChD;gBACE,OAAO,UAAU,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;SAC3C;IACH,CAAC;;2GAzBU,cAAc;yGAAd,cAAc;2FAAd,cAAc;kBAH1B,IAAI;mBAAC;oBACJ,IAAI,EAAE,YAAY;iBACnB","sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\nimport { format as formatDate } from 'date-fns';\n\n/**\n * Pipe used to transform dates, based on our default formats.\n *\n * @example\n *\n * public date = \"2018-08-27 14:00:30\"\n * <span>{{ date | dateFormat }}</span> -> Aug 27, 2018\n * <span>{{ date | dateFormat:'long' }}</span> -> Monday Aug 27, 2018\n */\n\n@Pipe({\n name: 'formatDate'\n})\nexport class DateFormatPipe implements PipeTransform {\n\n transform(value: string | number | Date | null, format?: string): string | null {\n if (!value) {\n return null;\n }\n if (typeof value === 'string') {\n value = new Date(value);\n }\n switch (format) {\n case 'long':\n return formatDate(value, 'EEEE MMM d, yyyy');\n case 'short':\n return formatDate(value, 'yyyy-MM-dd');\n case 'datetime':\n return formatDate(value, 'MMM d, yyyy, HH:mm');\n case 'datetimezone':\n return formatDate(value, `MMM d, yyyy, HH:mm:ss ('UTC'xxx)`);\n case 'datetime-long':\n return formatDate(value, 'EEEE MMM dd, yyyy, HH:mm');\n case 'datetime-short':\n return formatDate(value, 'yyyy-MM-dd, HH:mm');\n default:\n return formatDate(value, 'MMM d, yyyy');\n }\n }\n\n}\n"]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Pipe } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
/**
|
|
4
|
-
* Transforms an Object to an Array.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
*
|
|
8
|
-
* public obj = {a: 1, b: 2, c: 3};
|
|
9
|
-
* <span *ngFor="let key of obj | keys "> {{ obj[key] }}, </span> -> 1, 2, 3,
|
|
10
|
-
*/
|
|
11
|
-
export class KeysPipe {
|
|
12
|
-
transform(value) {
|
|
13
|
-
if (value) {
|
|
14
|
-
return Object.keys(value);
|
|
15
|
-
}
|
|
16
|
-
return [];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
KeysPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: KeysPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
20
|
-
KeysPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: KeysPipe, name: "keys" });
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: KeysPipe, decorators: [{
|
|
22
|
-
type: Pipe,
|
|
23
|
-
args: [{
|
|
24
|
-
name: 'keys'
|
|
25
|
-
}]
|
|
26
|
-
}] });
|
|
27
|
-
//# sourceMappingURL=keys.pipe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keys.pipe.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/sto-pipes/keys.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,MAAM,eAAe,CAAC;;AAEpD;;;;;;;GAOG;AAKH,MAAM,OAAO,QAAQ;IAEnB,SAAS,CAAC,KAA8B;QACtC,IAAI,KAAK,EAAE;YACT,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC3B;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;;qGAPU,QAAQ;mGAAR,QAAQ;2FAAR,QAAQ;kBAHpB,IAAI;mBAAC;oBACJ,IAAI,EAAE,MAAM;iBACb","sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Transforms an Object to an Array.\n *\n * @example\n *\n * public obj = {a: 1, b: 2, c: 3};\n * <span *ngFor=\"let key of obj | keys \"> {{ obj[key] }}, </span> -> 1, 2, 3,\n */\n\n@Pipe({\n name: 'keys'\n})\nexport class KeysPipe implements PipeTransform {\n\n transform(value: Record<string, unknown>): Array<string> {\n if (value) {\n return Object.keys(value);\n }\n return [];\n }\n\n}\n"]}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { Pipe } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
/**
|
|
4
|
-
* Formats numbers to use our standard formatting (d ddd,ddd)
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
*
|
|
8
|
-
* {{ 1234,32 | numberFormat }} -> 1 234,320
|
|
9
|
-
* {{ 1234,32 | numberFormat:'M3' }} -> 1 234,320 M3
|
|
10
|
-
* {{ -1234,32 | numberFormat:'M3':true }} -> 1 234,320 M3
|
|
11
|
-
* {{ 1234,32 | numberFormat:'M3':false:false }} -> 1 234 M3
|
|
12
|
-
* {{ 1234,32 | numberFormat:'M3':false:true:5 }} -> 1 234,32000 M3
|
|
13
|
-
*/
|
|
14
|
-
export class NumberFormatPipe {
|
|
15
|
-
transform(value, unit = '', abs, appendDecimals = true, numberOfDecimals = 3) {
|
|
16
|
-
if (value !== 0 && !value) {
|
|
17
|
-
return '';
|
|
18
|
-
}
|
|
19
|
-
if (typeof value === 'string') {
|
|
20
|
-
const newValue = parseFloat(value);
|
|
21
|
-
if (isNaN(newValue)) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
value = newValue;
|
|
25
|
-
}
|
|
26
|
-
if (abs) {
|
|
27
|
-
value = Math.abs(value);
|
|
28
|
-
}
|
|
29
|
-
// We absolute the value to ensure that the rounding rules is always away from zero.
|
|
30
|
-
// 1.5 => 2 and -1.5 => -2
|
|
31
|
-
const isNegativeNumber = value < 0;
|
|
32
|
-
value = Math.abs(value);
|
|
33
|
-
if (!appendDecimals) {
|
|
34
|
-
value = Math.round(value);
|
|
35
|
-
}
|
|
36
|
-
if (!isNaN(value) && appendDecimals) {
|
|
37
|
-
value = parseFloat(this.toFixed(value, numberOfDecimals));
|
|
38
|
-
}
|
|
39
|
-
// Turn negative numbers back, but only if value is not -0
|
|
40
|
-
// eslint-disable-next-line no-compare-neg-zero
|
|
41
|
-
if (isNegativeNumber && value !== -0) {
|
|
42
|
-
value = value * -1;
|
|
43
|
-
}
|
|
44
|
-
const localized = this.prettyPrintValue(value, appendDecimals, numberOfDecimals);
|
|
45
|
-
return localized.replace(/,/g, ' ').replace('.', ',') + `${unit ? ' ' + unit : ''}`;
|
|
46
|
-
}
|
|
47
|
-
prettyPrintValue(value, appendDecimals, numberOfDecimals) {
|
|
48
|
-
const intlOptions = { minimumFractionDigits: numberOfDecimals, maximumFractionDigits: numberOfDecimals };
|
|
49
|
-
const intl = new Intl.NumberFormat('en-US', intlOptions).format(value);
|
|
50
|
-
const split = intl.split('.');
|
|
51
|
-
let localized = split[0];
|
|
52
|
-
if (appendDecimals) {
|
|
53
|
-
const decimals = split.length === 2 ? split[1] : '';
|
|
54
|
-
split[1] = decimals.padEnd(numberOfDecimals, '0');
|
|
55
|
-
localized = split.join('.');
|
|
56
|
-
}
|
|
57
|
-
return localized;
|
|
58
|
-
}
|
|
59
|
-
// Normal toFixed has some issues: https://stackoverflow.com/questions/10015027/javascript-tofixed-not-rounding
|
|
60
|
-
toFixed(num, precision) {
|
|
61
|
-
// This method also has some issues - namely, it's unable to parse negative numbers with huge floating points
|
|
62
|
-
// -8.185452315956354e-12 becomes NaN
|
|
63
|
-
let returnValue = (+(Math.round(+(num + 'e' + precision)) + 'e' + -precision));
|
|
64
|
-
if (isNaN(returnValue)) {
|
|
65
|
-
returnValue = parseFloat(num.toFixed(precision));
|
|
66
|
-
}
|
|
67
|
-
return returnValue.toFixed(precision);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
NumberFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NumberFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
71
|
-
NumberFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NumberFormatPipe, name: "numberFormat" });
|
|
72
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: NumberFormatPipe, decorators: [{
|
|
73
|
-
type: Pipe,
|
|
74
|
-
args: [{
|
|
75
|
-
name: 'numberFormat'
|
|
76
|
-
}]
|
|
77
|
-
}] });
|
|
78
|
-
//# sourceMappingURL=number-format.pipe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number-format.pipe.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/sto-pipes/number-format.pipe.ts"],"names":[],"mappings":"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","sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Formats numbers to use our standard formatting (d ddd,ddd)\n *\n * @example\n *\n * {{ 1234,32 | numberFormat }} -> 1 234,320\n * {{ 1234,32 | numberFormat:'M3' }} -> 1 234,320 M3\n * {{ -1234,32 | numberFormat:'M3':true }} -> 1 234,320 M3\n * {{ 1234,32 | numberFormat:'M3':false:false }} -> 1 234 M3\n * {{ 1234,32 | numberFormat:'M3':false:true:5 }} -> 1 234,32000 M3\n */\n@Pipe({\n name: 'numberFormat'\n})\nexport class NumberFormatPipe implements PipeTransform {\n\n transform(value: number | string, unit: string = '', abs?: boolean, appendDecimals = true, numberOfDecimals = 3): string | null {\n if ( value !== 0 && !value ) {\n return '';\n }\n if ( typeof value === 'string' ) {\n const newValue = parseFloat(value);\n if ( isNaN(newValue) ) {\n return null;\n }\n value = newValue;\n }\n if ( abs ) {\n value = Math.abs(value);\n }\n // We absolute the value to ensure that the rounding rules is always away from zero.\n // 1.5 => 2 and -1.5 => -2\n const isNegativeNumber = value < 0;\n value = Math.abs(value);\n\n if ( !appendDecimals ) {\n value = Math.round(value);\n }\n if ( !isNaN(value) && appendDecimals ) {\n value = parseFloat(this.toFixed(value, numberOfDecimals));\n }\n // Turn negative numbers back, but only if value is not -0\n // eslint-disable-next-line no-compare-neg-zero\n if ( isNegativeNumber && value !== -0 ) {\n value = value * -1;\n }\n const localized = this.prettyPrintValue(value, appendDecimals, numberOfDecimals);\n return localized.replace(/,/g, ' ').replace('.', ',') + `${unit ? ' ' + unit : ''}`;\n }\n\n private prettyPrintValue(value: number, appendDecimals: boolean, numberOfDecimals: number) {\n const intlOptions = { minimumFractionDigits: numberOfDecimals, maximumFractionDigits: numberOfDecimals };\n const intl = new Intl.NumberFormat('en-US', intlOptions).format(value);\n const split = intl.split('.');\n let localized = split[ 0 ];\n\n if ( appendDecimals ) {\n const decimals = split.length === 2 ? split[ 1 ] : '';\n split[ 1 ] = decimals.padEnd(numberOfDecimals, '0');\n localized = split.join('.');\n }\n return localized;\n }\n\n // Normal toFixed has some issues: https://stackoverflow.com/questions/10015027/javascript-tofixed-not-rounding\n private toFixed(num: number, precision: number) {\n // This method also has some issues - namely, it's unable to parse negative numbers with huge floating points\n // -8.185452315956354e-12 becomes NaN\n let returnValue = ( +( Math.round(+( num + 'e' + precision )) + 'e' + -precision ) );\n if ( isNaN(returnValue) ) {\n returnValue = parseFloat(num.toFixed(precision));\n }\n return returnValue.toFixed(precision);\n }\n}\n"]}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { NumberFormatPipe } from './number-format.pipe';
|
|
4
|
-
import { CurrencyFormatPipe } from './currency-format.pipe';
|
|
5
|
-
import { KeysPipe } from './keys.pipe';
|
|
6
|
-
import { DateFormatPipe } from './date-format.pipe';
|
|
7
|
-
import { ExcludeUnit, GetUnit } from './with-unit';
|
|
8
|
-
import { YesNoPipe } from './yes-no';
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
|
-
export class StoPipesModule {
|
|
11
|
-
}
|
|
12
|
-
StoPipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: StoPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
13
|
-
StoPipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: StoPipesModule, declarations: [DateFormatPipe,
|
|
14
|
-
KeysPipe,
|
|
15
|
-
NumberFormatPipe,
|
|
16
|
-
CurrencyFormatPipe,
|
|
17
|
-
GetUnit,
|
|
18
|
-
ExcludeUnit,
|
|
19
|
-
YesNoPipe], imports: [CommonModule], exports: [DateFormatPipe,
|
|
20
|
-
KeysPipe,
|
|
21
|
-
NumberFormatPipe,
|
|
22
|
-
CurrencyFormatPipe,
|
|
23
|
-
GetUnit,
|
|
24
|
-
ExcludeUnit,
|
|
25
|
-
YesNoPipe] });
|
|
26
|
-
StoPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: StoPipesModule, imports: [[CommonModule]] });
|
|
27
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: StoPipesModule, decorators: [{
|
|
28
|
-
type: NgModule,
|
|
29
|
-
args: [{
|
|
30
|
-
imports: [CommonModule],
|
|
31
|
-
declarations: [
|
|
32
|
-
DateFormatPipe,
|
|
33
|
-
KeysPipe,
|
|
34
|
-
NumberFormatPipe,
|
|
35
|
-
CurrencyFormatPipe,
|
|
36
|
-
GetUnit,
|
|
37
|
-
ExcludeUnit,
|
|
38
|
-
YesNoPipe
|
|
39
|
-
],
|
|
40
|
-
exports: [
|
|
41
|
-
DateFormatPipe,
|
|
42
|
-
KeysPipe,
|
|
43
|
-
NumberFormatPipe,
|
|
44
|
-
CurrencyFormatPipe,
|
|
45
|
-
GetUnit,
|
|
46
|
-
ExcludeUnit,
|
|
47
|
-
YesNoPipe
|
|
48
|
-
]
|
|
49
|
-
}]
|
|
50
|
-
}] });
|
|
51
|
-
//# sourceMappingURL=sto-pipes.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sto-pipes.module.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/sto-pipes/sto-pipes.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;;AAuBrC,MAAM,OAAO,cAAc;;2GAAd,cAAc;4GAAd,cAAc,iBAlBvB,cAAc;QACd,QAAQ;QACR,gBAAgB;QAChB,kBAAkB;QAClB,OAAO;QACP,WAAW;QACX,SAAS,aARD,YAAY,aAWpB,cAAc;QACd,QAAQ;QACR,gBAAgB;QAChB,kBAAkB;QAClB,OAAO;QACP,WAAW;QACX,SAAS;4GAGA,cAAc,YApBhB,CAAC,YAAY,CAAC;2FAoBZ,cAAc;kBArB1B,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE;wBACZ,cAAc;wBACd,QAAQ;wBACR,gBAAgB;wBAChB,kBAAkB;wBAClB,OAAO;wBACP,WAAW;wBACX,SAAS;qBACV;oBACD,OAAO,EAAE;wBACP,cAAc;wBACd,QAAQ;wBACR,gBAAgB;wBAChB,kBAAkB;wBAClB,OAAO;wBACP,WAAW;wBACX,SAAS;qBACV;iBACF","sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { NumberFormatPipe } from './number-format.pipe';\nimport { CurrencyFormatPipe } from './currency-format.pipe';\nimport { KeysPipe } from './keys.pipe';\nimport { DateFormatPipe } from './date-format.pipe';\nimport { ExcludeUnit, GetUnit } from './with-unit';\nimport { YesNoPipe } from './yes-no';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [\n DateFormatPipe,\n KeysPipe,\n NumberFormatPipe,\n CurrencyFormatPipe,\n GetUnit,\n ExcludeUnit,\n YesNoPipe\n ],\n exports: [\n DateFormatPipe,\n KeysPipe,\n NumberFormatPipe,\n CurrencyFormatPipe,\n GetUnit,\n ExcludeUnit,\n YesNoPipe\n ]\n})\nexport class StoPipesModule {\n}\n"]}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Pipe } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export class GetUnit {
|
|
4
|
-
transform(value, withParens) {
|
|
5
|
-
if (value) {
|
|
6
|
-
const arr = value.split('(');
|
|
7
|
-
if (arr.length > 0) {
|
|
8
|
-
if (withParens) {
|
|
9
|
-
value = '(' + arr[1];
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
arr[1].slice(0, -1);
|
|
13
|
-
value = arr[1].slice(0, -1);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return value;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
GetUnit.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: GetUnit, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
21
|
-
GetUnit.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: GetUnit, name: "getUnit" });
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: GetUnit, decorators: [{
|
|
23
|
-
type: Pipe,
|
|
24
|
-
args: [{ name: 'getUnit' }]
|
|
25
|
-
}] });
|
|
26
|
-
export class ExcludeUnit {
|
|
27
|
-
transform(value) {
|
|
28
|
-
if (value) {
|
|
29
|
-
const arr = value.split('(');
|
|
30
|
-
if (arr.length > 0) {
|
|
31
|
-
value = arr[0];
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return value;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
ExcludeUnit.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: ExcludeUnit, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
38
|
-
ExcludeUnit.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: ExcludeUnit, name: "excludeUnit" });
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: ExcludeUnit, decorators: [{
|
|
40
|
-
type: Pipe,
|
|
41
|
-
args: [{ name: 'excludeUnit' }]
|
|
42
|
-
}] });
|
|
43
|
-
//# sourceMappingURL=with-unit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"with-unit.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/sto-pipes/with-unit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,MAAM,eAAe,CAAC;;AAGpD,MAAM,OAAO,OAAO;IAClB,SAAS,CAAC,KAAa,EAAE,UAAoB;QAC3C,IAAI,KAAK,EAAE;YACT,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,EAAG;gBACnB,IAAI,UAAU,EAAE;oBACd,KAAK,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;iBACtB;qBAAM;oBACL,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;oBACpB,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;iBAC7B;aACF;SACF;QACD,OAAO,KAAK,CAAC;IACf,CAAC;;oGAdU,OAAO;kGAAP,OAAO;2FAAP,OAAO;kBADnB,IAAI;mBAAC,EAAC,IAAI,EAAE,SAAS,EAAC;;AAkBvB,MAAM,OAAO,WAAW;IACtB,SAAS,CAAC,KAAa;QACrB,IAAI,KAAK,EAAE;YACT,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE;gBAClB,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;aAChB;SACF;QACD,OAAO,KAAK,CAAC;IACf,CAAC;;wGATU,WAAW;sGAAX,WAAW;2FAAX,WAAW;kBADvB,IAAI;mBAAC,EAAC,IAAI,EAAE,aAAa,EAAC","sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({name: 'getUnit'})\nexport class GetUnit implements PipeTransform {\n transform(value: string, withParens?: boolean): string {\n if (value) {\n const arr = value.split('(');\n if (arr.length > 0 ) {\n if (withParens) {\n value = '(' + arr[1];\n } else {\n arr[1].slice(0, -1);\n value = arr[1].slice(0, -1);\n }\n }\n }\n return value;\n }\n}\n@Pipe({name: 'excludeUnit'})\nexport class ExcludeUnit implements PipeTransform {\n transform(value: string): string {\n if (value) {\n const arr = value.split('(');\n if (arr.length > 0) {\n value = arr[0];\n }\n }\n return value;\n }\n}\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Pipe } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export class YesNoPipe {
|
|
4
|
-
transform(value, ignoreNulls = false) {
|
|
5
|
-
let valueStr = '';
|
|
6
|
-
if (ignoreNulls) {
|
|
7
|
-
valueStr = value ? 'Yes' : value === false ? 'No' : '';
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
valueStr = value ? 'Yes' : 'No';
|
|
11
|
-
}
|
|
12
|
-
return valueStr;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
YesNoPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: YesNoPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
16
|
-
YesNoPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: YesNoPipe, name: "yesNo" });
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.0", ngImport: i0, type: YesNoPipe, decorators: [{
|
|
18
|
-
type: Pipe,
|
|
19
|
-
args: [{ name: 'yesNo' }]
|
|
20
|
-
}] });
|
|
21
|
-
//# sourceMappingURL=yes-no.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"yes-no.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/sto-pipes/yes-no.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,MAAM,eAAe,CAAC;;AAEpD,MAAM,OAAO,SAAS;IACpB,SAAS,CAAC,KAAc,EAAE,WAAW,GAAG,KAAK;QAC3C,IAAI,QAAQ,GAAG,EAAE,CAAC;QAClB,IAAI,WAAW,EAAE;YACf,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;SACxD;aAAM;YACL,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;SACjC;QACD,OAAO,QAAQ,CAAC;IAElB,CAAC;;sGAVU,SAAS;oGAAT,SAAS;2FAAT,SAAS;kBADrB,IAAI;mBAAC,EAAC,IAAI,EAAE,OAAO,EAAC","sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n@Pipe({name: 'yesNo'})\nexport class YesNoPipe implements PipeTransform {\n transform(value: boolean, ignoreNulls = false): string {\n let valueStr = '';\n if (ignoreNulls) {\n valueStr = value ? 'Yes' : value === false ? 'No' : '';\n } else {\n valueStr = value ? 'Yes' : 'No';\n }\n return valueStr;\n\n }\n}\n"]}
|