@alfresco/adf-core 8.4.0-19129264781 → 8.4.0-19133056716
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/custom-theme/material-theme.scss +13 -13
- package/custom-theme/theme/custom-palette-creator.scss +25 -23
- package/custom-theme/theme/custom-theme-palettes.scss +7 -7
- package/custom-theme/theme/theme-data.scss +13 -13
- package/custom-theme/theme/typography.scss +5 -5
- package/fesm2022/adf-core.mjs +105 -11
- package/fesm2022/adf-core.mjs.map +1 -1
- package/lib/form/components/widgets/amount/amount.widget.d.ts +43 -4
- package/lib/mock/translation.service.mock.d.ts +1 -0
- package/lib/testing/noop-translate.module.d.ts +1 -0
- package/lib/translation/translation.service.d.ts +6 -0
- package/package.json +3 -3
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '@angular/material' as mat;
|
|
3
|
-
@
|
|
3
|
+
@import './theme/theme-data';
|
|
4
4
|
|
|
5
5
|
$custom-theme: mat.m2-define-light-theme(
|
|
6
6
|
(
|
|
7
7
|
color: (
|
|
8
|
-
primary: map.get(
|
|
9
|
-
accent: map.get(
|
|
10
|
-
warn: map.get(
|
|
8
|
+
primary: map.get($palettes, primary),
|
|
9
|
+
accent: map.get($palettes, accent),
|
|
10
|
+
warn: map.get($palettes, warning)
|
|
11
11
|
),
|
|
12
|
-
typography:
|
|
12
|
+
typography: $app-typography
|
|
13
13
|
)
|
|
14
14
|
);
|
|
15
15
|
|
|
16
|
-
@if
|
|
17
|
-
$custom-theme:
|
|
16
|
+
@if $background-color {
|
|
17
|
+
$custom-theme: get-custom-background-color($background-color, $custom-theme);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
@if
|
|
21
|
-
$custom-theme:
|
|
20
|
+
@if $text-color {
|
|
21
|
+
$custom-theme: get-custom-text-color($text-color, $custom-theme);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
@if
|
|
24
|
+
@if $base-font-size {
|
|
25
25
|
body,
|
|
26
26
|
html {
|
|
27
|
-
font-size:
|
|
27
|
+
font-size: $base-font-size;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
@if
|
|
31
|
+
@if $font-family {
|
|
32
32
|
body,
|
|
33
33
|
html {
|
|
34
|
-
font-family:
|
|
34
|
+
font-family: $font-family;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
$colors: (
|
|
16
16
|
red: color.red($color),
|
|
17
17
|
green: color.green($color),
|
|
18
|
-
blue: color.blue($color)
|
|
18
|
+
blue: color.blue($color),
|
|
19
19
|
);
|
|
20
20
|
|
|
21
21
|
@each $name, $value in $colors {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
$colors: map.merge(
|
|
33
33
|
$colors,
|
|
34
34
|
(
|
|
35
|
-
$name: $value
|
|
35
|
+
$name: $value,
|
|
36
36
|
)
|
|
37
37
|
);
|
|
38
38
|
}
|
|
@@ -91,10 +91,10 @@
|
|
|
91
91
|
$color900: color.mix($dark, $color, 75%);
|
|
92
92
|
|
|
93
93
|
/* stylelint-disable scss/dollar-variable-pattern */
|
|
94
|
-
$colorA100: color.adjust(
|
|
95
|
-
$colorA200: color.adjust(
|
|
96
|
-
$colorA400: color.adjust(
|
|
97
|
-
$colorA700: color.adjust(
|
|
94
|
+
$colorA100: color.adjust(saturate(color.mix($dark, $color, 15%), 80%), $lightness: 45.6%);
|
|
95
|
+
$colorA200: color.adjust(saturate(color.mix($dark, $color, 15%), 80%), $lightness: 35.6%);
|
|
96
|
+
$colorA400: color.adjust(saturate(color.mix($dark, $color, 15%), 100%), $lightness: 25.6%);
|
|
97
|
+
$colorA700: color.adjust(saturate(color.mix($dark, $color, 15%), 100%), $lightness: 20.5%);
|
|
98
98
|
/* stylelint-enable scss/dollar-variable-pattern */
|
|
99
99
|
|
|
100
100
|
$contrast50: create-text-color($color50, $colorType);
|
|
@@ -126,28 +126,30 @@
|
|
|
126
126
|
700: $color700,
|
|
127
127
|
800: $color800,
|
|
128
128
|
900: $color900,
|
|
129
|
-
/* stylelint-disable value-keyword-case */
|
|
129
|
+
/* stylelint-disable value-keyword-case */
|
|
130
|
+
A100: $colorA100,
|
|
130
131
|
A200: $colorA200,
|
|
131
132
|
A400: $colorA400,
|
|
132
133
|
A700: $colorA700,
|
|
133
134
|
/* stylelint-enable value-keyword-case */
|
|
134
135
|
contrast: (
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
136
|
+
50: $contrast50,
|
|
137
|
+
100: $contrast100,
|
|
138
|
+
200: $contrast200,
|
|
139
|
+
300: $contrast300,
|
|
140
|
+
400: $contrast400,
|
|
141
|
+
500: $contrast500,
|
|
142
|
+
600: $contrast600,
|
|
143
|
+
700: $contrast700,
|
|
144
|
+
800: $contrast800,
|
|
145
|
+
900: $contrast900,
|
|
146
|
+
/* stylelint-disable value-keyword-case */
|
|
147
|
+
A100: $contrastA100,
|
|
148
|
+
A200: $contrastA200,
|
|
149
|
+
A400: $contrastA400,
|
|
150
|
+
A700: $contrastA700,
|
|
151
|
+
/* stylelint-enable value-keyword-case */
|
|
152
|
+
),
|
|
151
153
|
);
|
|
152
154
|
|
|
153
155
|
@return $palette;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
@use '@angular/material' as mat;
|
|
2
|
-
@
|
|
3
|
-
@
|
|
2
|
+
@import './default-colors';
|
|
3
|
+
@import './custom-palette-creator';
|
|
4
4
|
|
|
5
5
|
@function get-mat-palettes($primary-color, $accent-color) {
|
|
6
6
|
$mat-primary-palette: null;
|
|
7
7
|
|
|
8
8
|
@if ($primary-color) {
|
|
9
|
-
$custom-theme-primary-palette:
|
|
9
|
+
$custom-theme-primary-palette: create-color-palette($primary-color, 'primary');
|
|
10
10
|
$mat-primary-palette: mat.m2-define-palette($custom-theme-primary-palette, 500);
|
|
11
11
|
} @else {
|
|
12
|
-
$mat-primary-palette: mat.m2-define-palette(default-
|
|
12
|
+
$mat-primary-palette: mat.m2-define-palette($default-primary, A100);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
$mat-accent-palette: null;
|
|
16
16
|
|
|
17
17
|
@if ($accent-color) {
|
|
18
|
-
$custom-theme-accent-palette:
|
|
18
|
+
$custom-theme-accent-palette: create-color-palette($accent-color, 'accent');
|
|
19
19
|
$mat-accent-palette: mat.m2-define-palette($custom-theme-accent-palette, 500);
|
|
20
20
|
} @else {
|
|
21
|
-
$mat-accent-palette: mat.m2-define-palette(default-
|
|
21
|
+
$mat-accent-palette: mat.m2-define-palette($default-accent);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
$mat-warn-palette: mat.m2-define-palette(default-
|
|
24
|
+
$mat-warn-palette: mat.m2-define-palette($default-warn, A100);
|
|
25
25
|
|
|
26
26
|
@return (primary: $mat-primary-palette, accent: $mat-accent-palette, warning: $mat-warn-palette);
|
|
27
27
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@
|
|
3
|
-
@
|
|
4
|
-
@
|
|
5
|
-
@
|
|
6
|
-
@
|
|
2
|
+
@import './theme-configuration';
|
|
3
|
+
@import './typography';
|
|
4
|
+
@import './custom-theme-palettes';
|
|
5
|
+
@import './custom-background-color';
|
|
6
|
+
@import './custom-text-color';
|
|
7
7
|
|
|
8
|
-
$primary-color: map.get(theme-
|
|
9
|
-
$accent-color: map.get(theme-
|
|
10
|
-
$background-color: map.get(theme-
|
|
8
|
+
$primary-color: map.get($theme-config, 'primaryColor');
|
|
9
|
+
$accent-color: map.get($theme-config, 'accentColor');
|
|
10
|
+
$background-color: map.get($theme-config, 'backgroundColor');
|
|
11
11
|
|
|
12
|
-
$text-color: map.get(theme-
|
|
13
|
-
$base-font-size: map.get(theme-
|
|
14
|
-
$font-family: map.get(theme-
|
|
12
|
+
$text-color: map.get($theme-config, 'textColor');
|
|
13
|
+
$base-font-size: map.get($theme-config, 'baseFontSize');
|
|
14
|
+
$font-family: map.get($theme-config, 'fontFamily');
|
|
15
15
|
|
|
16
|
-
$app-typography:
|
|
16
|
+
$app-typography: get-mat-typography($base-font-size, $font-family);
|
|
17
17
|
|
|
18
|
-
$palettes:
|
|
18
|
+
$palettes: get-mat-palettes($primary-color, $accent-color);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '@angular/material' as mat;
|
|
3
|
-
@
|
|
4
|
-
@use '../variables/font-family';
|
|
3
|
+
@import '../variables/font-family';
|
|
5
4
|
|
|
6
5
|
@function get-mat-typography($base-font-size, $font-family) {
|
|
7
6
|
$custom-typography: mat.m2-define-typography-config(
|
|
@@ -17,7 +16,8 @@
|
|
|
17
16
|
$subtitle-2: mat.m2-define-typography-level(14px, 24px, 500),
|
|
18
17
|
$body-2: mat.m2-define-typography-level(14px, 20px, 400),
|
|
19
18
|
$caption: mat.m2-define-typography-level(12px, 20px, 400),
|
|
20
|
-
$button: mat.m2-define-typography-level(14px, 14px, 500)
|
|
19
|
+
$button: mat.m2-define-typography-level(14px, 14px, 500),
|
|
20
|
+
// Line-height must be unit-less fraction of the font-size.
|
|
21
21
|
);
|
|
22
22
|
|
|
23
23
|
@if $base-font-size {
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
$body-2: mat.m2-define-typography-level(1rem, 1.42rem, 400),
|
|
35
35
|
$caption: mat.m2-define-typography-level(0.86rem, 1.42rem, 400),
|
|
36
36
|
$button: mat.m2-define-typography-level(1rem, 1rem, 500),
|
|
37
|
-
$font-family:
|
|
37
|
+
$font-family: $default-font-family
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
@if $font-family {
|
|
42
42
|
@each $key, $level in $custom-typography {
|
|
43
43
|
/* stylelint-disable-next-line scss/no-global-function-names */
|
|
44
|
-
@if
|
|
44
|
+
@if type-of($level) == 'map' {
|
|
45
45
|
$new-level: map.merge(
|
|
46
46
|
$level,
|
|
47
47
|
(
|
package/fesm2022/adf-core.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Input, ChangeDetectionStrategy, ViewEncapsulation, Component, inject, Injectable, TemplateRef, ContentChild, Directive, ContentChildren, RendererFactory2, Optional, Inject, NgModule, HostBinding, Pipe, InjectionToken, provideAppInitializer, EventEmitter, HostListener, ViewChild, Output, ViewChildren, DestroyRef, QueryList, DEFAULT_CURRENCY_CODE, SecurityContext, ElementRef, ViewContainerRef, forwardRef, Compiler, ChangeDetectorRef, Injector } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
|
-
import { CommonModule, DOCUMENT, NgIf, NgClass, NgForOf, AsyncPipe, NgTemplateOutlet, NgStyle, DecimalPipe, DatePipe, NgFor } from '@angular/common';
|
|
4
|
+
import { CommonModule, DOCUMENT, NgIf, NgClass, NgForOf, AsyncPipe, NgTemplateOutlet, NgStyle, DecimalPipe, DatePipe, CurrencyPipe, NgFor } from '@angular/common';
|
|
5
5
|
import * as i2 from '@angular/material/table';
|
|
6
6
|
import { MatTableModule, MatTableDataSource } from '@angular/material/table';
|
|
7
7
|
import * as i1$1 from '@ngx-translate/core';
|
|
8
8
|
import { TranslatePipe, provideTranslateService, TranslateLoader } from '@ngx-translate/core';
|
|
9
9
|
import * as i1$8 from '@angular/common/http';
|
|
10
10
|
import { HttpClient, HttpHeaders, HttpResponse, provideHttpClient, HTTP_INTERCEPTORS, withInterceptorsFromDi, withXsrfConfiguration } from '@angular/common/http';
|
|
11
|
-
import { ReplaySubject, BehaviorSubject, of, Subject, switchMap as switchMap$1, from, fromEvent, Observable, throwError, firstValueFrom, combineLatest, defer, EMPTY, race, forkJoin, merge } from 'rxjs';
|
|
11
|
+
import { ReplaySubject, BehaviorSubject, of, Subject, switchMap as switchMap$1, from, fromEvent, Observable, throwError, firstValueFrom, combineLatest, defer, EMPTY, race, forkJoin, merge, isObservable, filter as filter$1 } from 'rxjs';
|
|
12
12
|
import { map, distinctUntilChanged, take, switchMap, delay, catchError, skipWhile, filter, first, timeout, shareReplay, mergeMap, tap, retry, takeUntil, debounceTime, share, pairwise, buffer } from 'rxjs/operators';
|
|
13
13
|
import * as i1$4 from '@alfresco/adf-extensions';
|
|
14
14
|
import { ExtensionService, mergeObjects, ExtensionsModule, PreviewExtensionComponent } from '@alfresco/adf-extensions';
|
|
@@ -3186,6 +3186,21 @@ class TranslationService {
|
|
|
3186
3186
|
get(key, interpolateParams) {
|
|
3187
3187
|
return this.translate.get(key, interpolateParams);
|
|
3188
3188
|
}
|
|
3189
|
+
/**
|
|
3190
|
+
* Determines the preferred locale for the current user.
|
|
3191
|
+
*
|
|
3192
|
+
* @returns Locale identifier resolved from the browser or the default translation locale
|
|
3193
|
+
*/
|
|
3194
|
+
getLocale() {
|
|
3195
|
+
const defaultLocale = this.userLang || this.defaultLang;
|
|
3196
|
+
if (typeof window?.navigator === 'undefined') {
|
|
3197
|
+
return defaultLocale;
|
|
3198
|
+
}
|
|
3199
|
+
const wn = window.navigator;
|
|
3200
|
+
let lang = wn.languages ? wn.languages[0] : defaultLocale;
|
|
3201
|
+
lang = lang || wn.language;
|
|
3202
|
+
return lang;
|
|
3203
|
+
}
|
|
3189
3204
|
/**
|
|
3190
3205
|
* Directly returns the translation for the supplied key.
|
|
3191
3206
|
*
|
|
@@ -22732,25 +22747,102 @@ class AmountWidgetComponent extends WidgetComponent {
|
|
|
22732
22747
|
get placeholder() {
|
|
22733
22748
|
return this.showPlaceholder ? this.field.placeholder : '';
|
|
22734
22749
|
}
|
|
22735
|
-
constructor(formService, settings) {
|
|
22750
|
+
constructor(formService, settings, currencyPipe, translationService) {
|
|
22736
22751
|
super(formService);
|
|
22737
22752
|
this.formService = formService;
|
|
22738
|
-
this.
|
|
22753
|
+
this.currencyPipe = currencyPipe;
|
|
22754
|
+
this.translationService = translationService;
|
|
22739
22755
|
this.showPlaceholder = true;
|
|
22756
|
+
this.destroyRef = inject(DestroyRef);
|
|
22740
22757
|
this.currency = AmountWidgetComponent.DEFAULT_CURRENCY;
|
|
22758
|
+
this.currencyDisplay = 'symbol';
|
|
22759
|
+
this.isInputInFocus = false;
|
|
22760
|
+
this.notShowDecimalDigits = '1.0-0';
|
|
22761
|
+
this.showDecimalDigits = '1.2-2';
|
|
22762
|
+
if (isObservable(settings)) {
|
|
22763
|
+
settings.pipe(takeUntilDestroyed()).subscribe((data) => {
|
|
22764
|
+
this.updateSettingsBasedProperties(data);
|
|
22765
|
+
});
|
|
22766
|
+
}
|
|
22767
|
+
else {
|
|
22768
|
+
this.updateSettingsBasedProperties(settings);
|
|
22769
|
+
}
|
|
22741
22770
|
}
|
|
22742
22771
|
ngOnInit() {
|
|
22743
22772
|
if (this.field) {
|
|
22744
22773
|
if (this.field.currency) {
|
|
22745
22774
|
this.currency = this.field.currency;
|
|
22746
22775
|
}
|
|
22776
|
+
else {
|
|
22777
|
+
if (this.enableDisplayBasedOnLocale) {
|
|
22778
|
+
this.currency = '';
|
|
22779
|
+
this.currencyDisplay = '';
|
|
22780
|
+
}
|
|
22781
|
+
}
|
|
22747
22782
|
if (this.field.readOnly) {
|
|
22748
|
-
this.showPlaceholder = this.
|
|
22783
|
+
this.showPlaceholder = this.showReadonlyPlaceholder;
|
|
22784
|
+
}
|
|
22785
|
+
this.subscribeToFieldChanges();
|
|
22786
|
+
this.setInitialValues();
|
|
22787
|
+
}
|
|
22788
|
+
}
|
|
22789
|
+
amountWidgetOnBlur() {
|
|
22790
|
+
this.isInputInFocus = false;
|
|
22791
|
+
if (this.enableDisplayBasedOnLocale) {
|
|
22792
|
+
if (this.amountWidgetValue) {
|
|
22793
|
+
this.valueAsNumber = parseFloat(this.amountWidgetValue);
|
|
22794
|
+
this.amountWidgetValue = this.currencyPipe.transform(this.amountWidgetValue, this.currency, this.currencyDisplay, this.decimalProperty);
|
|
22795
|
+
}
|
|
22796
|
+
else {
|
|
22797
|
+
this.valueAsNumber = null;
|
|
22798
|
+
this.amountWidgetValue = null;
|
|
22749
22799
|
}
|
|
22750
22800
|
}
|
|
22801
|
+
this.markAsTouched();
|
|
22802
|
+
}
|
|
22803
|
+
amountWidgetOnFocus() {
|
|
22804
|
+
this.isInputInFocus = true;
|
|
22805
|
+
if (this.enableDisplayBasedOnLocale) {
|
|
22806
|
+
const hasValue = this.valueAsNumber === 0 || this.valueAsNumber;
|
|
22807
|
+
this.amountWidgetValue = hasValue ? this.valueAsNumber.toString() : null;
|
|
22808
|
+
}
|
|
22809
|
+
}
|
|
22810
|
+
onFieldChangedAmountWidget() {
|
|
22811
|
+
this.field.value = this.amountWidgetValue;
|
|
22812
|
+
super.onFieldChanged(this.field);
|
|
22813
|
+
}
|
|
22814
|
+
setInitialValues() {
|
|
22815
|
+
if (this.enableDisplayBasedOnLocale) {
|
|
22816
|
+
this.decimalProperty = this.field.enableFractions ? this.showDecimalDigits : this.notShowDecimalDigits;
|
|
22817
|
+
this.locale = this.translationService.getLocale();
|
|
22818
|
+
this.updateValue(this.field.value);
|
|
22819
|
+
}
|
|
22820
|
+
else {
|
|
22821
|
+
this.amountWidgetValue = this.field.value;
|
|
22822
|
+
}
|
|
22751
22823
|
}
|
|
22752
|
-
|
|
22753
|
-
|
|
22824
|
+
subscribeToFieldChanges() {
|
|
22825
|
+
this.formService.formFieldValueChanged
|
|
22826
|
+
.pipe(filter$1((ev) => ev.field.id === this.field.id), takeUntilDestroyed(this.destroyRef))
|
|
22827
|
+
.subscribe((ev) => {
|
|
22828
|
+
if (!this.isInputInFocus && this.enableDisplayBasedOnLocale) {
|
|
22829
|
+
this.updateValue(ev.field.value);
|
|
22830
|
+
}
|
|
22831
|
+
else if (!this.isInputInFocus) {
|
|
22832
|
+
this.amountWidgetValue = ev.field.value;
|
|
22833
|
+
}
|
|
22834
|
+
});
|
|
22835
|
+
}
|
|
22836
|
+
updateValue(value) {
|
|
22837
|
+
this.valueAsNumber = value;
|
|
22838
|
+
this.amountWidgetValue = this.currencyPipe.transform(value, this.currency, this.currencyDisplay, this.decimalProperty, this.locale);
|
|
22839
|
+
}
|
|
22840
|
+
updateSettingsBasedProperties(data) {
|
|
22841
|
+
this.enableDisplayBasedOnLocale = data?.enableDisplayBasedOnLocale ?? false;
|
|
22842
|
+
this.showReadonlyPlaceholder = data?.showReadonlyPlaceholder;
|
|
22843
|
+
}
|
|
22844
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: AmountWidgetComponent, deps: [{ token: FormService }, { token: ADF_AMOUNT_SETTINGS, optional: true }, { token: i1.CurrencyPipe }, { token: TranslationService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
22845
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: AmountWidgetComponent, isStandalone: true, selector: "amount-widget", host: { listeners: { "click": "event($event)", "blur": "event($event)", "change": "event($event)", "focus": "event($event)", "focusin": "event($event)", "focusout": "event($event)", "input": "event($event)", "invalid": "event($event)", "select": "event($event)" } }, providers: [CurrencyPipe], usesInheritance: true, ngImport: i0, template: "<div\n class=\"adf-amount-widget__container adf-amount-widget {{field.className}}\"\n [class.adf-invalid]=\"!field.isValid && isTouched()\"\n [class.adf-readonly]=\"field.readOnly\"\n [class.adf-left-label-input-container]=\"field.leftLabels\"\n>\n <div *ngIf=\"field.leftLabels\">\n <label class=\"adf-label adf-left-label\" [attr.for]=\"field.id\"\n >{{field.name | translate }}<span class=\"adf-asterisk\" [style.visibility]=\"isRequired() ? 'visible' : 'hidden'\">*</span></label\n >\n </div>\n <div class=\"adf-amount-widget-container\">\n <mat-form-field class=\"adf-amount-widget__input adf-form-field-input\" [floatLabel]=\"placeholder ? 'always' : null\">\n @if ( (field.name || field?.required) && !field.leftLabels) { <mat-label class=\"adf-label\" [attr.for]=\"field.id\">{{field.name | translate }}</mat-label> }\n @if(!enableDisplayBasedOnLocale) {\n <span matTextPrefix class=\"adf-amount-widget__prefix-spacing\">{{ currency }} </span>\n }\n <input\n matInput\n [title]=\"field.tooltip\"\n class=\"adf-input\"\n type=\"text\"\n [id]=\"field.id\"\n [required]=\"field.required && field.isVisible\"\n [placeholder]=\"placeholder\"\n [value]=\"amountWidgetValue\"\n [(ngModel)]=\"amountWidgetValue\"\n (ngModelChange)=\"onFieldChangedAmountWidget()\"\n [disabled]=\"field.readOnly\"\n (focus)=\"amountWidgetOnFocus()\"\n (blur)=\"amountWidgetOnBlur()\"\n />\n </mat-form-field>\n <div class=\"adf-error-messages-container\">\n <error-widget [error]=\"field.validationSummary\" />\n <error-widget\n *ngIf=\"isInvalidFieldRequired() && isTouched()\"\n required=\"{{ 'FORM.FIELD.REQUIRED' | translate }}\"\n />\n </div>\n </div>\n</div>\n", styles: [".adf-amount-widget{width:100%}.adf-amount-widget .adf-left-label{line-height:36px}.adf-amount-widget-container{display:grid;align-items:flex-start}.adf-amount-widget__input .mat-focused{transition:none}.adf-amount-widget__input .adf-input{margin-top:3px}.adf-amount-widget__input:not(.mat-focused):not(.mat-form-field-invalid) .adf-amount-widget__prefix-spacing{color:var(--adf-theme-foreground-secondary-text-color)}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$4.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ErrorWidgetComponent, selector: "error-widget", inputs: ["error", "required"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
22754
22846
|
}
|
|
22755
22847
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: AmountWidgetComponent, decorators: [{
|
|
22756
22848
|
type: Component,
|
|
@@ -22764,13 +22856,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
|
|
|
22764
22856
|
'(input)': 'event($event)',
|
|
22765
22857
|
'(invalid)': 'event($event)',
|
|
22766
22858
|
'(select)': 'event($event)'
|
|
22767
|
-
}, imports: [MatFormFieldModule, MatInputModule, FormsModule, ErrorWidgetComponent, TranslatePipe, NgIf], encapsulation: ViewEncapsulation.None, template: "<div\n class=\"adf-amount-widget__container adf-amount-widget {{field.className}}\"\n [class.adf-invalid]=\"!field.isValid && isTouched()\"\n [class.adf-readonly]=\"field.readOnly\"\n [class.adf-left-label-input-container]=\"field.leftLabels\"\n>\n <div *ngIf=\"field.leftLabels\">\n <label class=\"adf-label adf-left-label\" [attr.for]=\"field.id\"\n >{{field.name | translate }}<span class=\"adf-asterisk\" [style.visibility]=\"isRequired() ? 'visible' : 'hidden'\">*</span></label\n >\n </div>\n <div class=\"adf-amount-widget-container\">\n <mat-form-field class=\"adf-amount-widget__input adf-form-field-input\" [floatLabel]=\"placeholder ? 'always' : null\">\n @if ( (field.name || field?.required) && !field.leftLabels) { <mat-label class=\"adf-label\" [attr.for]=\"field.id\">{{field.name | translate }}</mat-label> }\n <span matTextPrefix class=\"adf-amount-widget__prefix-spacing\">{{ currency }} </span>\n <input\n matInput\n [title]=\"field.tooltip\"\n class=\"adf-input\"\n type=\"text\"\n [id]=\"field.id\"\n [required]=\"field.required && field.isVisible\"\n [placeholder]=\"placeholder\"\n [value]=\"
|
|
22859
|
+
}, imports: [MatFormFieldModule, MatInputModule, FormsModule, ErrorWidgetComponent, TranslatePipe, NgIf], providers: [CurrencyPipe], encapsulation: ViewEncapsulation.None, template: "<div\n class=\"adf-amount-widget__container adf-amount-widget {{field.className}}\"\n [class.adf-invalid]=\"!field.isValid && isTouched()\"\n [class.adf-readonly]=\"field.readOnly\"\n [class.adf-left-label-input-container]=\"field.leftLabels\"\n>\n <div *ngIf=\"field.leftLabels\">\n <label class=\"adf-label adf-left-label\" [attr.for]=\"field.id\"\n >{{field.name | translate }}<span class=\"adf-asterisk\" [style.visibility]=\"isRequired() ? 'visible' : 'hidden'\">*</span></label\n >\n </div>\n <div class=\"adf-amount-widget-container\">\n <mat-form-field class=\"adf-amount-widget__input adf-form-field-input\" [floatLabel]=\"placeholder ? 'always' : null\">\n @if ( (field.name || field?.required) && !field.leftLabels) { <mat-label class=\"adf-label\" [attr.for]=\"field.id\">{{field.name | translate }}</mat-label> }\n @if(!enableDisplayBasedOnLocale) {\n <span matTextPrefix class=\"adf-amount-widget__prefix-spacing\">{{ currency }} </span>\n }\n <input\n matInput\n [title]=\"field.tooltip\"\n class=\"adf-input\"\n type=\"text\"\n [id]=\"field.id\"\n [required]=\"field.required && field.isVisible\"\n [placeholder]=\"placeholder\"\n [value]=\"amountWidgetValue\"\n [(ngModel)]=\"amountWidgetValue\"\n (ngModelChange)=\"onFieldChangedAmountWidget()\"\n [disabled]=\"field.readOnly\"\n (focus)=\"amountWidgetOnFocus()\"\n (blur)=\"amountWidgetOnBlur()\"\n />\n </mat-form-field>\n <div class=\"adf-error-messages-container\">\n <error-widget [error]=\"field.validationSummary\" />\n <error-widget\n *ngIf=\"isInvalidFieldRequired() && isTouched()\"\n required=\"{{ 'FORM.FIELD.REQUIRED' | translate }}\"\n />\n </div>\n </div>\n</div>\n", styles: [".adf-amount-widget{width:100%}.adf-amount-widget .adf-left-label{line-height:36px}.adf-amount-widget-container{display:grid;align-items:flex-start}.adf-amount-widget__input .mat-focused{transition:none}.adf-amount-widget__input .adf-input{margin-top:3px}.adf-amount-widget__input:not(.mat-focused):not(.mat-form-field-invalid) .adf-amount-widget__prefix-spacing{color:var(--adf-theme-foreground-secondary-text-color)}\n"] }]
|
|
22768
22860
|
}], ctorParameters: () => [{ type: FormService }, { type: undefined, decorators: [{
|
|
22861
|
+
type: Optional
|
|
22862
|
+
}, {
|
|
22769
22863
|
type: Inject,
|
|
22770
22864
|
args: [ADF_AMOUNT_SETTINGS]
|
|
22771
|
-
}, {
|
|
22772
|
-
type: Optional
|
|
22773
|
-
}] }] });
|
|
22865
|
+
}] }, { type: i1.CurrencyPipe }, { type: TranslationService }] });
|
|
22774
22866
|
|
|
22775
22867
|
/*!
|
|
22776
22868
|
* @license
|
|
@@ -28524,6 +28616,7 @@ class TranslationMock {
|
|
|
28524
28616
|
get(key) {
|
|
28525
28617
|
return of(key);
|
|
28526
28618
|
}
|
|
28619
|
+
getLocale() { }
|
|
28527
28620
|
instant(key) {
|
|
28528
28621
|
return key;
|
|
28529
28622
|
}
|
|
@@ -30674,6 +30767,7 @@ class NoopTranslationService {
|
|
|
30674
30767
|
get(key) {
|
|
30675
30768
|
return of(key);
|
|
30676
30769
|
}
|
|
30770
|
+
getLocale() { }
|
|
30677
30771
|
instant(key) {
|
|
30678
30772
|
return key;
|
|
30679
30773
|
}
|