@seniorsistemas/angular-components 17.5.1 → 17.5.2

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.
Files changed (42) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +710 -554
  2. package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
  4. package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
  5. package/components/bignumber-input/number-input.directive.d.ts +5 -1
  6. package/components/dynamic-form/components/fields/bignumber/number-field.component.d.ts +4 -0
  7. package/components/dynamic-form/components/fields/currency/currency-field.component.d.ts +7 -1
  8. package/components/dynamic-form/components/fields/number/number-field.component.d.ts +4 -0
  9. package/components/dynamic-form/dynamic-form.d.ts +0 -1
  10. package/components/locale/locale.service.d.ts +3 -1
  11. package/components/localized-number-input/localized-number-input.directive.d.ts +3 -1
  12. package/components/number-input/number-input.directive.d.ts +5 -1
  13. package/esm2015/components/bignumber-input/number-input.directive.js +24 -6
  14. package/esm2015/components/dynamic-form/components/fields/bignumber/number-field.component.js +40 -13
  15. package/esm2015/components/dynamic-form/components/fields/currency/currency-field.component.js +40 -1
  16. package/esm2015/components/dynamic-form/components/fields/number/number-field.component.js +37 -4
  17. package/esm2015/components/dynamic-form/configurations/fields/bignumber-field.js +2 -3
  18. package/esm2015/components/dynamic-form/configurations/fields/currency-field.js +2 -3
  19. package/esm2015/components/dynamic-form/configurations/fields/decimal-field.js +2 -3
  20. package/esm2015/components/dynamic-form/configurations/fields/number-field.js +2 -3
  21. package/esm2015/components/dynamic-form/dynamic-form.js +1 -7
  22. package/esm2015/components/locale/locale.service.js +26 -5
  23. package/esm2015/components/localized-number-input/localized-number-input.directive.js +17 -4
  24. package/esm2015/components/number-input/number-input.directive.js +24 -7
  25. package/esm5/components/bignumber-input/number-input.directive.js +25 -6
  26. package/esm5/components/dynamic-form/components/fields/bignumber/number-field.component.js +42 -14
  27. package/esm5/components/dynamic-form/components/fields/currency/currency-field.component.js +42 -4
  28. package/esm5/components/dynamic-form/components/fields/number/number-field.component.js +39 -5
  29. package/esm5/components/dynamic-form/configurations/fields/bignumber-field.js +2 -3
  30. package/esm5/components/dynamic-form/configurations/fields/currency-field.js +2 -3
  31. package/esm5/components/dynamic-form/configurations/fields/decimal-field.js +2 -3
  32. package/esm5/components/dynamic-form/configurations/fields/number-field.js +2 -3
  33. package/esm5/components/dynamic-form/dynamic-form.js +1 -7
  34. package/esm5/components/locale/locale.service.js +25 -4
  35. package/esm5/components/localized-number-input/localized-number-input.directive.js +18 -4
  36. package/esm5/components/number-input/number-input.directive.js +25 -7
  37. package/fesm2015/seniorsistemas-angular-components.js +653 -501
  38. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  39. package/fesm5/seniorsistemas-angular-components.js +707 -551
  40. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  41. package/package.json +1 -1
  42. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -1,11 +1,15 @@
1
1
  import { __decorate, __awaiter, __param, __rest } from 'tslib';
2
- import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Directive, HostBinding, Renderer2, TemplateRef, InjectionToken, Inject, Pipe, ViewEncapsulation, ViewContainerRef, ChangeDetectorRef, Optional, ContentChild } from '@angular/core';
2
+ import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Directive, KeyValueDiffers, HostBinding, Renderer2, TemplateRef, InjectionToken, Inject, ViewEncapsulation, Pipe, ViewContainerRef, ChangeDetectorRef, Optional, ContentChild } from '@angular/core';
3
3
  import { trigger, transition, style as style$7, animate, state, group, query, animateChild } from '@angular/animations';
4
- import { Subject, ReplaySubject, of, from, throwError, forkJoin } from 'rxjs';
5
- import { takeUntil, filter, take, tap, map, switchMap, catchError, delay, debounceTime, repeat, first, finalize } from 'rxjs/operators';
4
+ import { Subject, of, from, ReplaySubject, throwError, forkJoin } from 'rxjs';
5
+ import { takeUntil, tap, map, switchMap, catchError, first, filter, take, delay, debounceTime, repeat, finalize } from 'rxjs/operators';
6
6
  import { CommonModule } from '@angular/common';
7
7
  import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule, FormControl, FormGroup, NG_VALIDATORS, FormBuilder, Validators, FormArray, ControlContainer } from '@angular/forms';
8
8
  import { RouterModule, NavigationEnd, PRIMARY_OUTLET, ActivatedRoute, Router } from '@angular/router';
9
+ import { HttpClient, HttpClientModule, HttpEventType } from '@angular/common/http';
10
+ import { user, service } from '@seniorsistemas/senior-platform-data';
11
+ import * as moment_ from 'moment';
12
+ import { CookieService } from 'ngx-cookie-service';
9
13
  import { CurrencyMaskDirective, AlignmentOptions, applyMask } from '@seniorsistemas/ng2-currency-mask';
10
14
  import { BreadcrumbModule as BreadcrumbModule$1 } from 'primeng/breadcrumb';
11
15
  import { TieredMenu, TieredMenuModule as TieredMenuModule$1 } from 'primeng/tieredmenu';
@@ -19,19 +23,15 @@ import { LRLanguage, LanguageSupport } from '@codemirror/language';
19
23
  import { buildParser } from '@lezer/generator';
20
24
  import { styleTags, tags, HighlightStyle } from '@codemirror/highlight';
21
25
  import { autocompletion, pickedCompletion, startCompletion } from '@codemirror/autocomplete';
22
- import { service, user } from '@seniorsistemas/senior-platform-data';
23
26
  import { TranslateService, TranslateModule } from '@ngx-translate/core';
24
27
  import { showTooltip } from '@codemirror/tooltip';
25
28
  import { lineNumbers } from '@codemirror/gutter';
26
29
  import { NgxMaskModule } from 'ngx-mask';
27
- import { HttpClient, HttpClientModule, HttpEventType } from '@angular/common/http';
28
30
  import { Hotkey, HotkeysService, HotkeyModule } from 'angular2-hotkeys';
29
31
  import BigNumber, { BigNumber as BigNumber$1 } from 'bignumber.js';
30
32
  import { AutoComplete, AutoCompleteModule } from 'primeng/autocomplete';
31
33
  import { Dialog, DialogModule } from 'primeng/dialog';
32
34
  import { Table, RowToggler, TableService, TableModule as TableModule$1 } from 'primeng/table';
33
- import * as moment_ from 'moment';
34
- import { CookieService } from 'ngx-cookie-service';
35
35
  import { CurrencyMaskDirective as CurrencyMaskDirective$1 } from 'ng2-currency-mask';
36
36
  import { ButtonModule as ButtonModule$1 } from 'primeng/button';
37
37
  import { CheckboxModule } from 'primeng/checkbox';
@@ -823,15 +823,145 @@ BadgeModule = __decorate([
823
823
  })
824
824
  ], BadgeModule);
825
825
 
826
+ class CalendarLocaleOptions {
827
+ constructor(config = {}) {
828
+ this.hourFormat = "24";
829
+ this.dateFormat = "dd/mm/yy";
830
+ this.firstDayOfWeek = 0;
831
+ this.today = "Hoje";
832
+ this.clear = "Limpar";
833
+ this.dayNames = ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"];
834
+ this.dayNamesShort = ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"];
835
+ this.dayNamesMin = ["D", "S", "T", "Q", "Q", "S", "S"];
836
+ this.monthNamesShort = ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"];
837
+ this.monthNames = [
838
+ "Janeiro",
839
+ "Fevereiro",
840
+ "Março",
841
+ "Abril",
842
+ "Maio",
843
+ "Junho",
844
+ "Julho",
845
+ "Agosto",
846
+ "Setembro",
847
+ "Outubro",
848
+ "Novembro",
849
+ "Dezembro",
850
+ ];
851
+ Object.keys(config).forEach(key => (this[key] = config[key] || this[key]));
852
+ }
853
+ }
854
+
855
+ class NumberLocaleOptions {
856
+ constructor(config = {}) {
857
+ this.thousandsSeparator = ".";
858
+ this.decimalSeparator = ",";
859
+ this.currencySymbol = "R$";
860
+ Object.assign(this, config);
861
+ }
862
+ }
863
+
864
+ class LocaleOptions {
865
+ constructor(config = {}) {
866
+ this.calendar = new CalendarLocaleOptions();
867
+ this.number = new NumberLocaleOptions();
868
+ Object.keys(config).forEach(key => (this[key] = config[key] || this[key]));
869
+ }
870
+ }
871
+ /**
872
+ * @deprecated
873
+ */
874
+ const DEFAULT_CALENDAR_LOCALE_OPTIONS = new CalendarLocaleOptions();
875
+ /**
876
+ * @deprecated
877
+ */
878
+ const DEFAULT_NUMBER_LOCALE_OPTIONS = new NumberLocaleOptions();
879
+ /**
880
+ * @deprecated
881
+ */
882
+ const DEFAULT_LOCALE_OPTIONS = new LocaleOptions();
883
+
884
+ const moment = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
885
+ let LocaleService = class LocaleService {
886
+ constructor(http, cookieService) {
887
+ this.http = http;
888
+ this.cookieService = cookieService;
889
+ this.localeOptionsAddress = "https://cdn.senior.com.br/primeng/locales";
890
+ this.localeOptionsVersion = "3.0.0";
891
+ }
892
+ get() {
893
+ return this.localeOptions
894
+ ? of(this.localeOptions)
895
+ : this.getLocaleConfig().pipe(tap((localeOptions) => (this.localeOptions = localeOptions)));
896
+ }
897
+ getLocale() {
898
+ return this.locale
899
+ ? of(this.locale)
900
+ : from(this.getUserData()).pipe(map((userData) => {
901
+ this.locale = userData.locale || userData.tenantLocale || "pt-BR";
902
+ return this.locale;
903
+ }));
904
+ }
905
+ getUserData() {
906
+ try {
907
+ return of(JSON.parse(this.cookieService.get("com.senior.token")));
908
+ }
909
+ catch (ex) {
910
+ console.warn("Unable to obtain user locale from cookie, calling getUser");
911
+ return user.getUserData();
912
+ }
913
+ }
914
+ getLocaleConfig() {
915
+ return this.getLocale().pipe(switchMap((locale) => {
916
+ moment.locale(locale);
917
+ return this.http
918
+ .get(`${this.localeOptionsAddress}/${this.localeOptionsVersion}/${locale}.json`)
919
+ .pipe(map((response) => new LocaleOptions(response)));
920
+ }), catchError((err) => {
921
+ console.warn(`Error getting locale configuration. Using fallback.`, err);
922
+ return of(new LocaleOptions());
923
+ }));
924
+ }
925
+ getGroupingSeparator() {
926
+ var _a;
927
+ const numberFormat = new Intl.NumberFormat(this.locale, {
928
+ style: "decimal",
929
+ minimumFractionDigits: 5,
930
+ maximumFractionDigits: 5,
931
+ });
932
+ // The default groupingSeparator for 'fr' is the character code 8239. We need it to be the regular space.
933
+ if (this.locale.includes("fr"))
934
+ return " ";
935
+ return (_a = numberFormat.formatToParts(1000).find((part) => part.type === "group")) === null || _a === void 0 ? void 0 : _a.value;
936
+ }
937
+ getDecimalSeparator() {
938
+ var _a;
939
+ const numberFormat = new Intl.NumberFormat(this.locale, {
940
+ style: "decimal",
941
+ minimumFractionDigits: 5,
942
+ maximumFractionDigits: 5,
943
+ });
944
+ return (_a = numberFormat.formatToParts(1.2).find((part) => part.type === "decimal")) === null || _a === void 0 ? void 0 : _a.value;
945
+ }
946
+ };
947
+ LocaleService.ctorParameters = () => [
948
+ { type: HttpClient },
949
+ { type: CookieService }
950
+ ];
951
+ LocaleService = __decorate([
952
+ Injectable()
953
+ ], LocaleService);
954
+
826
955
  var BignumberInputDirective_1;
827
956
  let BignumberInputDirective = BignumberInputDirective_1 = class BignumberInputDirective extends CurrencyMaskDirective {
828
- constructor() {
829
- super(...arguments);
957
+ constructor(_elementRef, _keyValueDiffers, localeService) {
958
+ super(null, _elementRef, _keyValueDiffers);
959
+ this.localeService = localeService;
830
960
  this.precision = 15;
831
961
  this.scale = 0;
832
- this.decimalSeparator = ",";
833
962
  this.alignTo = AlignmentOptions.LEFT;
834
963
  this.allowNegative = true;
964
+ this.onLocaleService();
835
965
  }
836
966
  ngOnInit() {
837
967
  this.updateVariables();
@@ -874,7 +1004,7 @@ let BignumberInputDirective = BignumberInputDirective_1 = class BignumberInputDi
874
1004
  scale: this.scale || 0,
875
1005
  prefix: "",
876
1006
  suffix: "",
877
- allowNegative: this.allowNegative
1007
+ allowNegative: this.allowNegative,
878
1008
  };
879
1009
  this.calculateMaxLength();
880
1010
  }
@@ -890,7 +1020,22 @@ let BignumberInputDirective = BignumberInputDirective_1 = class BignumberInputDi
890
1020
  this._maxLength = maxLength;
891
1021
  this.maxLength = maxLength;
892
1022
  }
1023
+ onLocaleService() {
1024
+ this.localeService
1025
+ .getLocale()
1026
+ .pipe(first())
1027
+ .subscribe(() => {
1028
+ var _a, _b;
1029
+ this.decimalSeparator = (_a = this.decimalSeparator) !== null && _a !== void 0 ? _a : this.localeService.getDecimalSeparator();
1030
+ this.thousandsSeparator = (_b = this.thousandsSeparator) !== null && _b !== void 0 ? _b : this.localeService.getGroupingSeparator();
1031
+ });
1032
+ }
893
1033
  };
1034
+ BignumberInputDirective.ctorParameters = () => [
1035
+ { type: ElementRef },
1036
+ { type: KeyValueDiffers },
1037
+ { type: LocaleService }
1038
+ ];
894
1039
  __decorate([
895
1040
  Input()
896
1041
  ], BignumberInputDirective.prototype, "precision", void 0);
@@ -3920,35 +4065,6 @@ CountryPhonePickerModule = __decorate([
3920
4065
  })
3921
4066
  ], CountryPhonePickerModule);
3922
4067
 
3923
- class CalendarLocaleOptions {
3924
- constructor(config = {}) {
3925
- this.hourFormat = "24";
3926
- this.dateFormat = "dd/mm/yy";
3927
- this.firstDayOfWeek = 0;
3928
- this.today = "Hoje";
3929
- this.clear = "Limpar";
3930
- this.dayNames = ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"];
3931
- this.dayNamesShort = ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"];
3932
- this.dayNamesMin = ["D", "S", "T", "Q", "Q", "S", "S"];
3933
- this.monthNamesShort = ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"];
3934
- this.monthNames = [
3935
- "Janeiro",
3936
- "Fevereiro",
3937
- "Março",
3938
- "Abril",
3939
- "Maio",
3940
- "Junho",
3941
- "Julho",
3942
- "Agosto",
3943
- "Setembro",
3944
- "Outubro",
3945
- "Novembro",
3946
- "Dezembro",
3947
- ];
3948
- Object.keys(config).forEach(key => (this[key] = config[key] || this[key]));
3949
- }
3950
- }
3951
-
3952
4068
  var FieldType;
3953
4069
  (function (FieldType) {
3954
4070
  FieldType["Autocomplete"] = "Autocomplete";
@@ -4023,377 +4139,62 @@ class AutocompleteField extends Field {
4023
4139
  }
4024
4140
  }
4025
4141
 
4026
- class NumberLocaleOptions {
4027
- constructor(config = {}) {
4028
- this.thousandsSeparator = ".";
4029
- this.decimalSeparator = ",";
4030
- this.currencySymbol = "R$";
4031
- Object.assign(this, config);
4142
+ class BignumberField extends Field {
4143
+ constructor(config) {
4144
+ var _a, _b, _c;
4145
+ super(config);
4146
+ this.allowNegative = (_a = config.allowNegative) !== null && _a !== void 0 ? _a : true;
4147
+ this.numberLocaleOptions = config.numberLocaleOptions;
4148
+ this.browserAutocomplete = config.browserAutocomplete;
4149
+ this.precision = config.precision;
4150
+ this.scale = (_b = config.scale) !== null && _b !== void 0 ? _b : 2;
4151
+ this.alignTo = this.scale ? AlignmentOptions.RIGHT : AlignmentOptions.LEFT;
4152
+ this.mask = config.mask;
4153
+ this.leftAddon = config.leftAddon;
4154
+ this.rightAddon = config.rightAddon;
4155
+ this.onBlur = config.onBlur;
4156
+ this.onFocus = config.onFocus;
4157
+ this.onComplete = config.onComplete;
4158
+ this.onInput = config.onInput;
4159
+ this.autoClear = (_c = config.autoClear) !== null && _c !== void 0 ? _c : true;
4032
4160
  }
4033
4161
  }
4034
4162
 
4035
- class LocaleOptions {
4036
- constructor(config = {}) {
4037
- this.calendar = new CalendarLocaleOptions();
4038
- this.number = new NumberLocaleOptions();
4039
- Object.keys(config).forEach(key => (this[key] = config[key] || this[key]));
4163
+ class BlobField extends Field {
4164
+ constructor(config) {
4165
+ super(config);
4166
+ this.accept = config.accept;
4167
+ this.files = config.files || [];
4168
+ this.chooseLabel = config.chooseLabel;
4169
+ this.removeLabel = config.removeLabel;
4170
+ this.cancelLabel = config.cancelLabel;
4171
+ this.successTooltip = config.successTooltip;
4172
+ this.multiple = config.multiple;
4173
+ this.onUploadFile = config.onUploadFile;
4174
+ this.onRemoveFile = config.onRemoveFile;
4175
+ this.onCancelUpload = config.onCancelUpload;
4176
+ this.onDownloadFile = config.onDownloadFile;
4177
+ this.showFileUploadDate = config.showFileUploadDate;
4040
4178
  }
4041
4179
  }
4042
- /**
4043
- * @deprecated
4044
- */
4045
- const DEFAULT_CALENDAR_LOCALE_OPTIONS = new CalendarLocaleOptions();
4046
- /**
4047
- * @deprecated
4048
- */
4049
- const DEFAULT_NUMBER_LOCALE_OPTIONS = new NumberLocaleOptions();
4050
- /**
4051
- * @deprecated
4052
- */
4053
- const DEFAULT_LOCALE_OPTIONS = new LocaleOptions();
4054
4180
 
4055
- const moment = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
4056
- let LocaleService = class LocaleService {
4057
- constructor(http, cookieService) {
4058
- this.http = http;
4059
- this.cookieService = cookieService;
4060
- this.localeOptionsAddress = "https://cdn.senior.com.br/primeng/locales";
4061
- this.localeOptionsVersion = "3.0.0";
4062
- }
4063
- get() {
4064
- return this.localeOptions
4065
- ? of(this.localeOptions)
4066
- : this.getLocaleConfig().pipe(tap((localeOptions) => (this.localeOptions = localeOptions)));
4181
+ class BooleanOptionsLabel {
4182
+ constructor(config) {
4183
+ this.true = config.true;
4184
+ this.false = config.false;
4185
+ this.empty = config.empty;
4186
+ this.clear = config.clear;
4067
4187
  }
4068
- getLocale() {
4069
- return this.locale
4070
- ? of(this.locale)
4071
- : from(this.getUserData()).pipe(map((userData) => {
4072
- this.locale = userData.locale || userData.tenantLocale || "pt-BR";
4073
- return this.locale;
4074
- }));
4075
- }
4076
- getUserData() {
4077
- try {
4078
- return of(JSON.parse(this.cookieService.get('com.senior.token')));
4079
- }
4080
- catch (ex) {
4081
- console.warn('Unable to obtain user locale from cookie, calling getUser');
4082
- return user.getUserData();
4083
- }
4084
- }
4085
- getLocaleConfig() {
4086
- return this.getLocale().pipe(switchMap((locale) => {
4087
- moment.locale(locale);
4088
- return this.http
4089
- .get(`${this.localeOptionsAddress}/${this.localeOptionsVersion}/${locale}.json`)
4090
- .pipe(map(response => new LocaleOptions(response)));
4091
- }), catchError((err) => {
4092
- console.warn(`Error getting locale configuration. Using fallback.`, err);
4093
- return of(new LocaleOptions());
4094
- }));
4095
- }
4096
- };
4097
- LocaleService.ctorParameters = () => [
4098
- { type: HttpClient },
4099
- { type: CookieService }
4100
- ];
4101
- LocaleService = __decorate([
4102
- Injectable()
4103
- ], LocaleService);
4104
-
4105
- let LocalizedBignumberPipe = class LocalizedBignumberPipe {
4106
- constructor(localeService) {
4107
- this.localeService = localeService;
4108
- }
4109
- transform(value, options) {
4110
- return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);
4111
- }
4112
- applyMask(value, options) {
4113
- return this.localeService.get().pipe(map(localeConfig => {
4114
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
4115
- const configs = {
4116
- prefix: (_c = (_a = options === null || options === void 0 ? void 0 : options.prefix) !== null && _a !== void 0 ? _a : (_b = localeConfig === null || localeConfig === void 0 ? void 0 : localeConfig.number) === null || _b === void 0 ? void 0 : _b.currencySymbol) !== null && _c !== void 0 ? _c : "R$",
4117
- thousandsSeparator: (_f = (_d = options === null || options === void 0 ? void 0 : options.thousandsSeparator) !== null && _d !== void 0 ? _d : (_e = localeConfig === null || localeConfig === void 0 ? void 0 : localeConfig.number) === null || _e === void 0 ? void 0 : _e.thousandsSeparator) !== null && _f !== void 0 ? _f : ".",
4118
- decimalSeparator: (_j = (_g = options === null || options === void 0 ? void 0 : options.decimalSeparator) !== null && _g !== void 0 ? _g : (_h = localeConfig === null || localeConfig === void 0 ? void 0 : localeConfig.number) === null || _h === void 0 ? void 0 : _h.decimalSeparator) !== null && _j !== void 0 ? _j : ",",
4119
- scale: (_k = options === null || options === void 0 ? void 0 : options.scale) !== null && _k !== void 0 ? _k : 2,
4120
- allowNegative: (_l = options === null || options === void 0 ? void 0 : options.allowNegative) !== null && _l !== void 0 ? _l : true
4121
- };
4122
- const isNumber = !(new BigNumber(value).isNaN());
4123
- return applyMask(value, configs, isNumber);
4124
- }));
4125
- }
4126
- };
4127
- LocalizedBignumberPipe.ctorParameters = () => [
4128
- { type: LocaleService }
4129
- ];
4130
- LocalizedBignumberPipe = __decorate([
4131
- Pipe({
4132
- name: "localizedBignumber",
4133
- })
4134
- ], LocalizedBignumberPipe);
4135
-
4136
- let LocalizedBignumberImpurePipe = class LocalizedBignumberImpurePipe extends LocalizedBignumberPipe {
4137
- transform(value, options) {
4138
- return super.transform(value, options);
4139
- }
4140
- };
4141
- LocalizedBignumberImpurePipe = __decorate([
4142
- Pipe({
4143
- name: "localizedBignumberImpure",
4144
- pure: false,
4145
- })
4146
- ], LocalizedBignumberImpurePipe);
4147
-
4148
- class LocalizedCurrencyPipeOptions extends NumberLocaleOptions {
4149
- constructor(config = {}) {
4150
- super(config);
4151
- this.scale = 2;
4152
- }
4153
- }
4154
- /**
4155
- * @deprecated Should use localizedBignumberPipe instead
4156
- */
4157
- let LocalizedCurrencyPipe = class LocalizedCurrencyPipe {
4158
- constructor(localeService) {
4159
- this.localeService = localeService;
4160
- }
4161
- transform(value, options) {
4162
- if (!options) {
4163
- options = new LocalizedCurrencyPipeOptions();
4164
- }
4165
- return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);
4166
- }
4167
- applyMask(value, options) {
4168
- return this.localeService.get().pipe(map(localeConfig => {
4169
- const config = Object.assign(Object.assign({}, localeConfig.number), options);
4170
- const { scale, currencySymbol, thousandsSeparator, decimalSeparator } = config;
4171
- const rawValue = Number(value).toFixed(scale);
4172
- const onlyNumbers = rawValue.replace(/[^0-9]/g, ``);
4173
- const integerPart = onlyNumbers
4174
- .slice(0, onlyNumbers.length - scale)
4175
- .replace(/^0*/g, ``)
4176
- .replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSeparator) || `0`;
4177
- const decimalPart = onlyNumbers.slice(onlyNumbers.length - scale);
4178
- const newValue = scale ? integerPart + decimalSeparator + decimalPart : integerPart;
4179
- const isZero = !Number(onlyNumbers);
4180
- const operator = rawValue.includes("-") && !isZero ? "-" : "";
4181
- return `${operator}${currencySymbol}${newValue}`;
4182
- }));
4183
- }
4184
- };
4185
- LocalizedCurrencyPipe.ctorParameters = () => [
4186
- { type: LocaleService }
4187
- ];
4188
- LocalizedCurrencyPipe = __decorate([
4189
- Pipe({
4190
- name: "localizedCurrency",
4191
- })
4192
- ], LocalizedCurrencyPipe);
4193
-
4194
- /**
4195
- * @deprecated Should use localizedBignumberPipe instead
4196
- */
4197
- let LocalizedCurrencyImpurePipe = class LocalizedCurrencyImpurePipe extends LocalizedCurrencyPipe {
4198
- transform(value, options = new LocalizedCurrencyPipeOptions()) {
4199
- return super.transform(value, options);
4200
- }
4201
- };
4202
- LocalizedCurrencyImpurePipe = __decorate([
4203
- Pipe({
4204
- name: "localizedCurrencyImpure",
4205
- pure: false,
4206
- })
4207
- ], LocalizedCurrencyImpurePipe);
4208
-
4209
- const moment$1 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
4210
- let LocalizedDatePipe = class LocalizedDatePipe {
4211
- constructor(localeService) {
4212
- this.localeService = localeService;
4213
- }
4214
- transform(value, format = "L LTS") {
4215
- return this.localeService.get().pipe(map(() => (value ? moment$1(value).format(format) : value)));
4216
- }
4217
- };
4218
- LocalizedDatePipe.ctorParameters = () => [
4219
- { type: LocaleService }
4220
- ];
4221
- LocalizedDatePipe = __decorate([
4222
- Pipe({
4223
- name: "localizedDate",
4224
- })
4225
- ], LocalizedDatePipe);
4226
-
4227
- let LocalizedDateImpurePipe = class LocalizedDateImpurePipe extends LocalizedDatePipe {
4228
- };
4229
- LocalizedDateImpurePipe = __decorate([
4230
- Pipe({
4231
- name: "localizedDateImpure",
4232
- pure: false,
4233
- })
4234
- ], LocalizedDateImpurePipe);
4235
-
4236
- /**
4237
- * @deprecated Should use localizedBignumberPipe instead
4238
- */
4239
- let LocalizedNumberPipe = class LocalizedNumberPipe {
4240
- constructor(localeService) {
4241
- this.localeService = localeService;
4242
- }
4243
- transform(value, minimumFractionDigits) {
4244
- return from(this.localeService.getLocale()).pipe(map((locale) => {
4245
- const numericValue = Number(value);
4246
- if (!value && isNaN(numericValue))
4247
- return;
4248
- return new Intl.NumberFormat(locale, {
4249
- minimumFractionDigits: minimumFractionDigits || 0,
4250
- }).format(Number(value));
4251
- }));
4252
- }
4253
- };
4254
- LocalizedNumberPipe.ctorParameters = () => [
4255
- { type: LocaleService }
4256
- ];
4257
- LocalizedNumberPipe = __decorate([
4258
- Pipe({ name: "localizedNumber" })
4259
- ], LocalizedNumberPipe);
4260
-
4261
- const moment$2 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
4262
- let LocalizedTimePipe = class LocalizedTimePipe {
4263
- constructor(localeService) {
4264
- this.localeService = localeService;
4265
- }
4266
- transform(value, format = "LTS") {
4267
- return this.localeService.get().pipe(map(() => (value ? moment$2(value, "HH:mm:ss").format(format) : value)));
4268
- }
4269
- };
4270
- LocalizedTimePipe.ctorParameters = () => [
4271
- { type: LocaleService }
4272
- ];
4273
- LocalizedTimePipe = __decorate([
4274
- Pipe({
4275
- name: "localizedTime",
4276
- })
4277
- ], LocalizedTimePipe);
4278
-
4279
- let LocalizedTimeImpurePipe = class LocalizedTimeImpurePipe extends LocalizedTimePipe {
4280
- };
4281
- LocalizedTimeImpurePipe = __decorate([
4282
- Pipe({
4283
- name: "localizedTimeImpure",
4284
- pure: false,
4285
- })
4286
- ], LocalizedTimeImpurePipe);
4287
-
4288
- var LocaleModule_1;
4289
- let LocaleModule = LocaleModule_1 = class LocaleModule {
4290
- static forRoot() {
4291
- return {
4292
- ngModule: LocaleModule_1,
4293
- providers: [
4294
- LocaleService,
4295
- LocalizedCurrencyPipe,
4296
- LocalizedDatePipe,
4297
- LocalizedTimePipe,
4298
- LocalizedNumberPipe,
4299
- LocalizedCurrencyImpurePipe,
4300
- LocalizedDateImpurePipe,
4301
- LocalizedTimeImpurePipe,
4302
- LocalizedBignumberPipe,
4303
- LocalizedBignumberImpurePipe
4304
- ],
4305
- };
4306
- }
4307
- static forChild() {
4308
- return {
4309
- ngModule: LocaleModule_1,
4310
- };
4311
- }
4312
- };
4313
- LocaleModule = LocaleModule_1 = __decorate([
4314
- NgModule({
4315
- imports: [CommonModule],
4316
- exports: [
4317
- LocalizedCurrencyPipe,
4318
- LocalizedDatePipe,
4319
- LocalizedTimePipe,
4320
- LocalizedNumberPipe,
4321
- LocalizedCurrencyImpurePipe,
4322
- LocalizedDateImpurePipe,
4323
- LocalizedTimeImpurePipe,
4324
- LocalizedBignumberPipe,
4325
- LocalizedBignumberImpurePipe
4326
- ],
4327
- declarations: [
4328
- LocalizedCurrencyPipe,
4329
- LocalizedDatePipe,
4330
- LocalizedTimePipe,
4331
- LocalizedNumberPipe,
4332
- LocalizedCurrencyImpurePipe,
4333
- LocalizedDateImpurePipe,
4334
- LocalizedTimeImpurePipe,
4335
- LocalizedBignumberPipe,
4336
- LocalizedBignumberImpurePipe
4337
- ],
4338
- })
4339
- ], LocaleModule);
4340
-
4341
- class BignumberField extends Field {
4342
- constructor(config) {
4343
- var _a, _b, _c;
4344
- super(config);
4345
- this.allowNegative = (_a = config.allowNegative) !== null && _a !== void 0 ? _a : true;
4346
- this.numberLocaleOptions = config.numberLocaleOptions || new NumberLocaleOptions();
4347
- this.browserAutocomplete = config.browserAutocomplete;
4348
- this.precision = config.precision;
4349
- this.scale = (_b = config.scale) !== null && _b !== void 0 ? _b : 2;
4350
- this.alignTo = this.scale ? AlignmentOptions.RIGHT : AlignmentOptions.LEFT;
4351
- this.mask = config.mask;
4352
- this.leftAddon = config.leftAddon;
4353
- this.rightAddon = config.rightAddon;
4354
- this.onBlur = config.onBlur;
4355
- this.onFocus = config.onFocus;
4356
- this.onComplete = config.onComplete;
4357
- this.onInput = config.onInput;
4358
- this.autoClear = (_c = config.autoClear) !== null && _c !== void 0 ? _c : true;
4359
- }
4360
- }
4361
-
4362
- class BlobField extends Field {
4363
- constructor(config) {
4364
- super(config);
4365
- this.accept = config.accept;
4366
- this.files = config.files || [];
4367
- this.chooseLabel = config.chooseLabel;
4368
- this.removeLabel = config.removeLabel;
4369
- this.cancelLabel = config.cancelLabel;
4370
- this.successTooltip = config.successTooltip;
4371
- this.multiple = config.multiple;
4372
- this.onUploadFile = config.onUploadFile;
4373
- this.onRemoveFile = config.onRemoveFile;
4374
- this.onCancelUpload = config.onCancelUpload;
4375
- this.onDownloadFile = config.onDownloadFile;
4376
- this.showFileUploadDate = config.showFileUploadDate;
4377
- }
4378
- }
4379
-
4380
- class BooleanOptionsLabel {
4381
- constructor(config) {
4382
- this.true = config.true;
4383
- this.false = config.false;
4384
- this.empty = config.empty;
4385
- this.clear = config.clear;
4386
- }
4387
- }
4388
- class BooleanField extends Field {
4389
- constructor(config) {
4390
- super(config);
4391
- this.verticalAlignment = config.verticalAlignment;
4392
- this.optionsLabel = new BooleanOptionsLabel(config.optionsLabel);
4393
- this.representedBy = "radio";
4394
- this.onBlur = config.onBlur;
4395
- this.onFocus = config.onFocus;
4396
- this.onClick = config.onClick;
4188
+ }
4189
+ class BooleanField extends Field {
4190
+ constructor(config) {
4191
+ super(config);
4192
+ this.verticalAlignment = config.verticalAlignment;
4193
+ this.optionsLabel = new BooleanOptionsLabel(config.optionsLabel);
4194
+ this.representedBy = "radio";
4195
+ this.onBlur = config.onBlur;
4196
+ this.onFocus = config.onFocus;
4197
+ this.onClick = config.onClick;
4397
4198
  }
4398
4199
  }
4399
4200
 
@@ -4472,15 +4273,15 @@ var NumberAlignmentOption;
4472
4273
  * @deprecated Should use BigNumberInput directive instead
4473
4274
  */
4474
4275
  let NumberInputDirective = NumberInputDirective_1 = class NumberInputDirective extends CurrencyMaskDirective$1 {
4475
- constructor() {
4476
- super(...arguments);
4276
+ constructor(_elementRef, _keyValueDiffers, localeService) {
4277
+ super(null, _elementRef, _keyValueDiffers);
4278
+ this.localeService = localeService;
4477
4279
  this.precision = 15;
4478
4280
  this.scale = 0;
4479
- this.decimalSeparator = ",";
4480
- this.thousandsSeparator = ".";
4481
4281
  this.alignTo = NumberAlignmentOption.LEFT;
4482
4282
  this.allowNegative = true;
4483
4283
  this.regex = /\d/;
4284
+ this.onLocaleService();
4484
4285
  }
4485
4286
  ngOnInit() {
4486
4287
  this.updateVariables();
@@ -4510,7 +4311,7 @@ let NumberInputDirective = NumberInputDirective_1 = class NumberInputDirective e
4510
4311
  precision: this.scale || 0,
4511
4312
  prefix: "",
4512
4313
  suffix: "",
4513
- allowNegative: this.allowNegative
4314
+ allowNegative: this.allowNegative,
4514
4315
  };
4515
4316
  this.calculateMaxLength();
4516
4317
  }
@@ -4540,7 +4341,22 @@ let NumberInputDirective = NumberInputDirective_1 = class NumberInputDirective e
4540
4341
  else
4541
4342
  event.preventDefault();
4542
4343
  }
4344
+ onLocaleService() {
4345
+ this.localeService
4346
+ .getLocale()
4347
+ .pipe(first())
4348
+ .subscribe(() => {
4349
+ var _a, _b;
4350
+ this.decimalSeparator = (_a = this.decimalSeparator) !== null && _a !== void 0 ? _a : this.localeService.getDecimalSeparator();
4351
+ this.thousandsSeparator = (_b = this.thousandsSeparator) !== null && _b !== void 0 ? _b : this.localeService.getGroupingSeparator();
4352
+ });
4353
+ }
4543
4354
  };
4355
+ NumberInputDirective.ctorParameters = () => [
4356
+ { type: ElementRef },
4357
+ { type: KeyValueDiffers },
4358
+ { type: LocaleService }
4359
+ ];
4544
4360
  __decorate([
4545
4361
  Input()
4546
4362
  ], NumberInputDirective.prototype, "precision", void 0);
@@ -4598,7 +4414,7 @@ NumberInputModule = __decorate([
4598
4414
  class NumberField extends Field {
4599
4415
  constructor(config) {
4600
4416
  super(config);
4601
- this.numberLocaleOptions = config.numberLocaleOptions || new NumberLocaleOptions();
4417
+ this.numberLocaleOptions = config.numberLocaleOptions;
4602
4418
  this.browserAutocomplete = config.browserAutocomplete;
4603
4419
  this.precision = config.precision;
4604
4420
  this.alignTo = config.alignTo || NumberAlignmentOption.LEFT;
@@ -4618,7 +4434,7 @@ class NumberField extends Field {
4618
4434
  class DecimalField extends NumberField {
4619
4435
  constructor(config) {
4620
4436
  super(config);
4621
- this.numberLocaleOptions = config.numberLocaleOptions || new NumberLocaleOptions();
4437
+ this.numberLocaleOptions = config.numberLocaleOptions;
4622
4438
  this.alignTo = config.alignTo || NumberAlignmentOption.RIGHT;
4623
4439
  this.scale = config.scale || config.scale === 0 ? config.scale : 2;
4624
4440
  }
@@ -4630,7 +4446,7 @@ class DecimalField extends NumberField {
4630
4446
  class CurrencyField extends DecimalField {
4631
4447
  constructor(config) {
4632
4448
  super(config);
4633
- this.numberLocaleOptions = config.numberLocaleOptions || new NumberLocaleOptions();
4449
+ this.numberLocaleOptions = config.numberLocaleOptions;
4634
4450
  }
4635
4451
  }
4636
4452
 
@@ -5879,94 +5695,330 @@ ProgressBarComponent = __decorate([
5879
5695
  template: "<ng-container *ngIf=\"mode === 'determinate'; then pbDeterminateTemplate else pbIndeterminateTemplate\"></ng-container>\n\n<ng-template #pbDeterminateTemplate>\n <s-progressbar-determinate\n [value]=\"value\"\n [numberFormatOptions]=\"numberFormatOptions\"\n [targetValue]=\"targetValue\"\n [targetLabel]=\"targetLabel\"\n [activeColor]=\"activeColor\"\n [showValue]=\"showValue\">\n </s-progressbar-determinate>\n</ng-template>\n\n<ng-template #pbIndeterminateTemplate>\n <s-progressbar-indeterminate\n [activeColor]=\"activeColor\"\n [label]=\"label\">\n </s-progressbar-indeterminate>\n</ng-template>",
5880
5696
  styles: [".progress-bar{position:relative}.progress-bar .progress-bar-all{background-color:#d8d8d8;border-radius:4px;height:24px;overflow:hidden;width:100%}.progress-bar .progress-bar-all .progress-bar-active{-ms-flex-align:center;align-items:center;color:#fff;display:-ms-flexbox;display:flex;font-family:\"Open Sans\",sans-serif;font-size:14px;height:100%;-ms-flex-pack:center;justify-content:center;line-height:150%;-webkit-user-select:none;-ms-user-select:none;user-select:none;width:80%}.progress-bar .progress-bar-all .progress-bar-active--blue{background-color:#428bca}.progress-bar .progress-bar-all .progress-bar-active--green{background-color:#0c9348}.progress-bar .progress-bar-all .progress-bar-active--red{background-color:#c13018}.progress-bar .progress-bar-all .progress-bar-active--yellow{background-color:#fcbf10}.progress-bar .target{-ms-flex-align:start;align-items:flex-start;bottom:-38px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:absolute}.progress-bar .target .target-line{background-color:#333;height:40px;margin:8px 0;width:1px}.progress-bar .target .target-label{background-color:#426e78;border-radius:10px;color:#e5eaea;font-family:\"Open Sans\",sans-serif;font-size:12px;line-height:150%;padding:2px 12px}"]
5881
5697
  })
5882
- ], ProgressBarComponent);
5698
+ ], ProgressBarComponent);
5699
+
5700
+ let ProgressBarDeterminateComponent = class ProgressBarDeterminateComponent {
5701
+ constructor(localeService) {
5702
+ this.localeService = localeService;
5703
+ this.showValue = true;
5704
+ }
5705
+ ngOnInit() {
5706
+ this.validateValues();
5707
+ this.onGetLocale();
5708
+ }
5709
+ onGetLocale() {
5710
+ this.localeService.getLocale().subscribe({
5711
+ next: (locale) => {
5712
+ this.numberFormat = new Intl.NumberFormat(locale !== null && locale !== void 0 ? locale : "pt-BR", this.numberFormatOptions);
5713
+ },
5714
+ error: () => {
5715
+ this.numberFormat = new Intl.NumberFormat("pt-BR", this.numberFormatOptions);
5716
+ },
5717
+ });
5718
+ }
5719
+ validateValues() {
5720
+ if (this.value < 0 || this.value > 100) {
5721
+ throw new Error("Invalid value for value");
5722
+ }
5723
+ if (this.targetValue < 0 || this.targetValue > 100) {
5724
+ throw new Error("Invalid value for targetValue");
5725
+ }
5726
+ }
5727
+ };
5728
+ ProgressBarDeterminateComponent.ctorParameters = () => [
5729
+ { type: LocaleService }
5730
+ ];
5731
+ __decorate([
5732
+ Input()
5733
+ ], ProgressBarDeterminateComponent.prototype, "value", void 0);
5734
+ __decorate([
5735
+ Input()
5736
+ ], ProgressBarDeterminateComponent.prototype, "numberFormatOptions", void 0);
5737
+ __decorate([
5738
+ Input()
5739
+ ], ProgressBarDeterminateComponent.prototype, "targetValue", void 0);
5740
+ __decorate([
5741
+ Input()
5742
+ ], ProgressBarDeterminateComponent.prototype, "targetLabel", void 0);
5743
+ __decorate([
5744
+ Input()
5745
+ ], ProgressBarDeterminateComponent.prototype, "activeColor", void 0);
5746
+ __decorate([
5747
+ Input()
5748
+ ], ProgressBarDeterminateComponent.prototype, "showValue", void 0);
5749
+ ProgressBarDeterminateComponent = __decorate([
5750
+ Component({
5751
+ selector: "s-progressbar-determinate",
5752
+ template: "<div class=\"progressbar-determinate\">\n <div class=\"progressbar-container\">\n <div\n class=\"progressbar-active\"\n [ngClass]=\"{\n 'progressbar-active--blue' : activeColor === 'blue',\n 'progressbar-active--green': activeColor === 'green',\n 'progressbar-active--red': activeColor === 'red',\n 'progressbar-active--yellow': activeColor === 'yellow'\n }\"\n [ngStyle]=\"{ 'width': value + '%' }\">\n\n {{ showValue && value ? numberFormat.format(value) + '%' : '' }}\n </div>\n </div>\n <div\n *ngIf=\"targetValue\"\n class=\"target\"\n [ngStyle]=\"{\n 'left': targetValue <= 50 ? targetValue + '%' : 'unset',\n 'right': targetValue > 50 ? 100 - targetValue + '%' : 'unset',\n 'align-items': targetValue > 50 ? 'flex-end' : 'flex-start'\n }\">\n <span class=\"target-line\"></span>\n <span class=\"target-label\">\n {{ targetLabel || numberFormat.format(value) + '%' }}\n </span>\n </div>\n </div>\n",
5753
+ styles: [".progressbar-determinate{position:relative}.progressbar-determinate .progressbar-container{background-color:#d8d8d8;border-radius:4px;height:24px;overflow:hidden;width:100%}.progressbar-determinate .progressbar-container .progressbar-active{-ms-flex-align:center;align-items:center;color:#fff;display:-ms-flexbox;display:flex;font-family:\"Open Sans\",sans-serif;font-size:14px;height:100%;-ms-flex-pack:center;justify-content:center;line-height:150%;-webkit-user-select:none;-ms-user-select:none;user-select:none;width:80%}.progressbar-determinate .progressbar-container .progressbar-active--blue{background-color:#428bca}.progressbar-determinate .progressbar-container .progressbar-active--green{background-color:#0c9348}.progressbar-determinate .progressbar-container .progressbar-active--red{background-color:#c13018}.progressbar-determinate .progressbar-container .progressbar-active--yellow{background-color:#fcbf10;color:#212533}.progressbar-determinate .target{-ms-flex-align:start;align-items:flex-start;bottom:-38px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:absolute}.progressbar-determinate .target .target-line{background-color:#333;height:40px;margin:8px 0;width:1px}.progressbar-determinate .target .target-label{background-color:#426e78;border-radius:10px;color:#e5eaea;font-family:\"Open Sans\",sans-serif;font-size:12px;line-height:150%;padding:2px 12px}"]
5754
+ })
5755
+ ], ProgressBarDeterminateComponent);
5756
+
5757
+ let ProgressBarIndeterminateComponent = class ProgressBarIndeterminateComponent {
5758
+ };
5759
+ __decorate([
5760
+ Input()
5761
+ ], ProgressBarIndeterminateComponent.prototype, "activeColor", void 0);
5762
+ __decorate([
5763
+ Input()
5764
+ ], ProgressBarIndeterminateComponent.prototype, "label", void 0);
5765
+ ProgressBarIndeterminateComponent = __decorate([
5766
+ Component({
5767
+ selector: "s-progressbar-indeterminate",
5768
+ template: "<div class=\"progressbar-indeterminate\">\n <div class=\"progressbar-container\">\n <div class=\"indeterminate-bar\" [ngClass]=\"{\n 'indeterminate-bar--blue': activeColor === 'blue',\n 'indeterminate-bar--green': activeColor === 'green',\n 'indeterminate-bar--red': activeColor === 'red',\n 'indeterminate-bar--yellow': activeColor === 'yellow'\n }\"></div>\n </div>\n\n <span *ngIf=\"label\" class=\"progressbar-label\">{{ label }}</span>\n</div>\n",
5769
+ styles: [".progressbar-indeterminate{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.progressbar-indeterminate .progressbar-container{background-color:#d8d8d8;border-radius:4px;height:24px;margin:8px 0;overflow:hidden;width:100%}.progressbar-indeterminate .indeterminate-bar{animation:5s infinite indeterminate-progress;background-color:#428bca;height:100%;width:40%}.progressbar-indeterminate .indeterminate-bar--blue{background-color:#428bca}.progressbar-indeterminate .indeterminate-bar--green{background-color:#0c9348}.progressbar-indeterminate .indeterminate-bar--red{background-color:#c13018}.progressbar-indeterminate .indeterminate-bar--yellow{background-color:#fcbf10}.progressbar-indeterminate .progressbar-label{font-family:\"Open Sans\" sans-serif;font-size:12px;line-height:150%;color:#212533}@keyframes indeterminate-progress{0%{transform:translateX(-250%)}100%{transform:translateX(250%)}}"]
5770
+ })
5771
+ ], ProgressBarIndeterminateComponent);
5772
+
5773
+ let ProgressBarModule = class ProgressBarModule {
5774
+ };
5775
+ ProgressBarModule = __decorate([
5776
+ NgModule({
5777
+ imports: [CommonModule],
5778
+ declarations: [
5779
+ ProgressBarComponent,
5780
+ ProgressBarDeterminateComponent,
5781
+ ProgressBarIndeterminateComponent,
5782
+ ],
5783
+ exports: [ProgressBarComponent],
5784
+ })
5785
+ ], ProgressBarModule);
5786
+
5787
+ let LocalizedBignumberPipe = class LocalizedBignumberPipe {
5788
+ constructor(localeService) {
5789
+ this.localeService = localeService;
5790
+ }
5791
+ transform(value, options) {
5792
+ return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);
5793
+ }
5794
+ applyMask(value, options) {
5795
+ return this.localeService.get().pipe(map(localeConfig => {
5796
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
5797
+ const configs = {
5798
+ prefix: (_c = (_a = options === null || options === void 0 ? void 0 : options.prefix) !== null && _a !== void 0 ? _a : (_b = localeConfig === null || localeConfig === void 0 ? void 0 : localeConfig.number) === null || _b === void 0 ? void 0 : _b.currencySymbol) !== null && _c !== void 0 ? _c : "R$",
5799
+ thousandsSeparator: (_f = (_d = options === null || options === void 0 ? void 0 : options.thousandsSeparator) !== null && _d !== void 0 ? _d : (_e = localeConfig === null || localeConfig === void 0 ? void 0 : localeConfig.number) === null || _e === void 0 ? void 0 : _e.thousandsSeparator) !== null && _f !== void 0 ? _f : ".",
5800
+ decimalSeparator: (_j = (_g = options === null || options === void 0 ? void 0 : options.decimalSeparator) !== null && _g !== void 0 ? _g : (_h = localeConfig === null || localeConfig === void 0 ? void 0 : localeConfig.number) === null || _h === void 0 ? void 0 : _h.decimalSeparator) !== null && _j !== void 0 ? _j : ",",
5801
+ scale: (_k = options === null || options === void 0 ? void 0 : options.scale) !== null && _k !== void 0 ? _k : 2,
5802
+ allowNegative: (_l = options === null || options === void 0 ? void 0 : options.allowNegative) !== null && _l !== void 0 ? _l : true
5803
+ };
5804
+ const isNumber = !(new BigNumber(value).isNaN());
5805
+ return applyMask(value, configs, isNumber);
5806
+ }));
5807
+ }
5808
+ };
5809
+ LocalizedBignumberPipe.ctorParameters = () => [
5810
+ { type: LocaleService }
5811
+ ];
5812
+ LocalizedBignumberPipe = __decorate([
5813
+ Pipe({
5814
+ name: "localizedBignumber",
5815
+ })
5816
+ ], LocalizedBignumberPipe);
5817
+
5818
+ let LocalizedBignumberImpurePipe = class LocalizedBignumberImpurePipe extends LocalizedBignumberPipe {
5819
+ transform(value, options) {
5820
+ return super.transform(value, options);
5821
+ }
5822
+ };
5823
+ LocalizedBignumberImpurePipe = __decorate([
5824
+ Pipe({
5825
+ name: "localizedBignumberImpure",
5826
+ pure: false,
5827
+ })
5828
+ ], LocalizedBignumberImpurePipe);
5829
+
5830
+ class LocalizedCurrencyPipeOptions extends NumberLocaleOptions {
5831
+ constructor(config = {}) {
5832
+ super(config);
5833
+ this.scale = 2;
5834
+ }
5835
+ }
5836
+ /**
5837
+ * @deprecated Should use localizedBignumberPipe instead
5838
+ */
5839
+ let LocalizedCurrencyPipe = class LocalizedCurrencyPipe {
5840
+ constructor(localeService) {
5841
+ this.localeService = localeService;
5842
+ }
5843
+ transform(value, options) {
5844
+ if (!options) {
5845
+ options = new LocalizedCurrencyPipeOptions();
5846
+ }
5847
+ return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);
5848
+ }
5849
+ applyMask(value, options) {
5850
+ return this.localeService.get().pipe(map(localeConfig => {
5851
+ const config = Object.assign(Object.assign({}, localeConfig.number), options);
5852
+ const { scale, currencySymbol, thousandsSeparator, decimalSeparator } = config;
5853
+ const rawValue = Number(value).toFixed(scale);
5854
+ const onlyNumbers = rawValue.replace(/[^0-9]/g, ``);
5855
+ const integerPart = onlyNumbers
5856
+ .slice(0, onlyNumbers.length - scale)
5857
+ .replace(/^0*/g, ``)
5858
+ .replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSeparator) || `0`;
5859
+ const decimalPart = onlyNumbers.slice(onlyNumbers.length - scale);
5860
+ const newValue = scale ? integerPart + decimalSeparator + decimalPart : integerPart;
5861
+ const isZero = !Number(onlyNumbers);
5862
+ const operator = rawValue.includes("-") && !isZero ? "-" : "";
5863
+ return `${operator}${currencySymbol}${newValue}`;
5864
+ }));
5865
+ }
5866
+ };
5867
+ LocalizedCurrencyPipe.ctorParameters = () => [
5868
+ { type: LocaleService }
5869
+ ];
5870
+ LocalizedCurrencyPipe = __decorate([
5871
+ Pipe({
5872
+ name: "localizedCurrency",
5873
+ })
5874
+ ], LocalizedCurrencyPipe);
5875
+
5876
+ /**
5877
+ * @deprecated Should use localizedBignumberPipe instead
5878
+ */
5879
+ let LocalizedCurrencyImpurePipe = class LocalizedCurrencyImpurePipe extends LocalizedCurrencyPipe {
5880
+ transform(value, options = new LocalizedCurrencyPipeOptions()) {
5881
+ return super.transform(value, options);
5882
+ }
5883
+ };
5884
+ LocalizedCurrencyImpurePipe = __decorate([
5885
+ Pipe({
5886
+ name: "localizedCurrencyImpure",
5887
+ pure: false,
5888
+ })
5889
+ ], LocalizedCurrencyImpurePipe);
5890
+
5891
+ const moment$1 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
5892
+ let LocalizedDatePipe = class LocalizedDatePipe {
5893
+ constructor(localeService) {
5894
+ this.localeService = localeService;
5895
+ }
5896
+ transform(value, format = "L LTS") {
5897
+ return this.localeService.get().pipe(map(() => (value ? moment$1(value).format(format) : value)));
5898
+ }
5899
+ };
5900
+ LocalizedDatePipe.ctorParameters = () => [
5901
+ { type: LocaleService }
5902
+ ];
5903
+ LocalizedDatePipe = __decorate([
5904
+ Pipe({
5905
+ name: "localizedDate",
5906
+ })
5907
+ ], LocalizedDatePipe);
5883
5908
 
5884
- let ProgressBarDeterminateComponent = class ProgressBarDeterminateComponent {
5909
+ let LocalizedDateImpurePipe = class LocalizedDateImpurePipe extends LocalizedDatePipe {
5910
+ };
5911
+ LocalizedDateImpurePipe = __decorate([
5912
+ Pipe({
5913
+ name: "localizedDateImpure",
5914
+ pure: false,
5915
+ })
5916
+ ], LocalizedDateImpurePipe);
5917
+
5918
+ /**
5919
+ * @deprecated Should use localizedBignumberPipe instead
5920
+ */
5921
+ let LocalizedNumberPipe = class LocalizedNumberPipe {
5885
5922
  constructor(localeService) {
5886
5923
  this.localeService = localeService;
5887
- this.showValue = true;
5888
5924
  }
5889
- ngOnInit() {
5890
- this.validateValues();
5891
- this.onGetLocale();
5925
+ transform(value, minimumFractionDigits) {
5926
+ return from(this.localeService.getLocale()).pipe(map((locale) => {
5927
+ const numericValue = Number(value);
5928
+ if (!value && isNaN(numericValue))
5929
+ return;
5930
+ return new Intl.NumberFormat(locale, {
5931
+ minimumFractionDigits: minimumFractionDigits || 0,
5932
+ }).format(Number(value));
5933
+ }));
5892
5934
  }
5893
- onGetLocale() {
5894
- this.localeService.getLocale().subscribe({
5895
- next: (locale) => {
5896
- this.numberFormat = new Intl.NumberFormat(locale !== null && locale !== void 0 ? locale : "pt-BR", this.numberFormatOptions);
5897
- },
5898
- error: () => {
5899
- this.numberFormat = new Intl.NumberFormat("pt-BR", this.numberFormatOptions);
5900
- },
5901
- });
5935
+ };
5936
+ LocalizedNumberPipe.ctorParameters = () => [
5937
+ { type: LocaleService }
5938
+ ];
5939
+ LocalizedNumberPipe = __decorate([
5940
+ Pipe({ name: "localizedNumber" })
5941
+ ], LocalizedNumberPipe);
5942
+
5943
+ const moment$2 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
5944
+ let LocalizedTimePipe = class LocalizedTimePipe {
5945
+ constructor(localeService) {
5946
+ this.localeService = localeService;
5902
5947
  }
5903
- validateValues() {
5904
- if (this.value < 0 || this.value > 100) {
5905
- throw new Error("Invalid value for value");
5906
- }
5907
- if (this.targetValue < 0 || this.targetValue > 100) {
5908
- throw new Error("Invalid value for targetValue");
5909
- }
5948
+ transform(value, format = "LTS") {
5949
+ return this.localeService.get().pipe(map(() => (value ? moment$2(value, "HH:mm:ss").format(format) : value)));
5910
5950
  }
5911
5951
  };
5912
- ProgressBarDeterminateComponent.ctorParameters = () => [
5952
+ LocalizedTimePipe.ctorParameters = () => [
5913
5953
  { type: LocaleService }
5914
5954
  ];
5915
- __decorate([
5916
- Input()
5917
- ], ProgressBarDeterminateComponent.prototype, "value", void 0);
5918
- __decorate([
5919
- Input()
5920
- ], ProgressBarDeterminateComponent.prototype, "numberFormatOptions", void 0);
5921
- __decorate([
5922
- Input()
5923
- ], ProgressBarDeterminateComponent.prototype, "targetValue", void 0);
5924
- __decorate([
5925
- Input()
5926
- ], ProgressBarDeterminateComponent.prototype, "targetLabel", void 0);
5927
- __decorate([
5928
- Input()
5929
- ], ProgressBarDeterminateComponent.prototype, "activeColor", void 0);
5930
- __decorate([
5931
- Input()
5932
- ], ProgressBarDeterminateComponent.prototype, "showValue", void 0);
5933
- ProgressBarDeterminateComponent = __decorate([
5934
- Component({
5935
- selector: "s-progressbar-determinate",
5936
- template: "<div class=\"progressbar-determinate\">\n <div class=\"progressbar-container\">\n <div\n class=\"progressbar-active\"\n [ngClass]=\"{\n 'progressbar-active--blue' : activeColor === 'blue',\n 'progressbar-active--green': activeColor === 'green',\n 'progressbar-active--red': activeColor === 'red',\n 'progressbar-active--yellow': activeColor === 'yellow'\n }\"\n [ngStyle]=\"{ 'width': value + '%' }\">\n\n {{ showValue && value ? numberFormat.format(value) + '%' : '' }}\n </div>\n </div>\n <div\n *ngIf=\"targetValue\"\n class=\"target\"\n [ngStyle]=\"{\n 'left': targetValue <= 50 ? targetValue + '%' : 'unset',\n 'right': targetValue > 50 ? 100 - targetValue + '%' : 'unset',\n 'align-items': targetValue > 50 ? 'flex-end' : 'flex-start'\n }\">\n <span class=\"target-line\"></span>\n <span class=\"target-label\">\n {{ targetLabel || numberFormat.format(value) + '%' }}\n </span>\n </div>\n </div>\n",
5937
- styles: [".progressbar-determinate{position:relative}.progressbar-determinate .progressbar-container{background-color:#d8d8d8;border-radius:4px;height:24px;overflow:hidden;width:100%}.progressbar-determinate .progressbar-container .progressbar-active{-ms-flex-align:center;align-items:center;color:#fff;display:-ms-flexbox;display:flex;font-family:\"Open Sans\",sans-serif;font-size:14px;height:100%;-ms-flex-pack:center;justify-content:center;line-height:150%;-webkit-user-select:none;-ms-user-select:none;user-select:none;width:80%}.progressbar-determinate .progressbar-container .progressbar-active--blue{background-color:#428bca}.progressbar-determinate .progressbar-container .progressbar-active--green{background-color:#0c9348}.progressbar-determinate .progressbar-container .progressbar-active--red{background-color:#c13018}.progressbar-determinate .progressbar-container .progressbar-active--yellow{background-color:#fcbf10;color:#212533}.progressbar-determinate .target{-ms-flex-align:start;align-items:flex-start;bottom:-38px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:absolute}.progressbar-determinate .target .target-line{background-color:#333;height:40px;margin:8px 0;width:1px}.progressbar-determinate .target .target-label{background-color:#426e78;border-radius:10px;color:#e5eaea;font-family:\"Open Sans\",sans-serif;font-size:12px;line-height:150%;padding:2px 12px}"]
5955
+ LocalizedTimePipe = __decorate([
5956
+ Pipe({
5957
+ name: "localizedTime",
5938
5958
  })
5939
- ], ProgressBarDeterminateComponent);
5959
+ ], LocalizedTimePipe);
5940
5960
 
5941
- let ProgressBarIndeterminateComponent = class ProgressBarIndeterminateComponent {
5961
+ let LocalizedTimeImpurePipe = class LocalizedTimeImpurePipe extends LocalizedTimePipe {
5942
5962
  };
5943
- __decorate([
5944
- Input()
5945
- ], ProgressBarIndeterminateComponent.prototype, "activeColor", void 0);
5946
- __decorate([
5947
- Input()
5948
- ], ProgressBarIndeterminateComponent.prototype, "label", void 0);
5949
- ProgressBarIndeterminateComponent = __decorate([
5950
- Component({
5951
- selector: "s-progressbar-indeterminate",
5952
- template: "<div class=\"progressbar-indeterminate\">\n <div class=\"progressbar-container\">\n <div class=\"indeterminate-bar\" [ngClass]=\"{\n 'indeterminate-bar--blue': activeColor === 'blue',\n 'indeterminate-bar--green': activeColor === 'green',\n 'indeterminate-bar--red': activeColor === 'red',\n 'indeterminate-bar--yellow': activeColor === 'yellow'\n }\"></div>\n </div>\n\n <span *ngIf=\"label\" class=\"progressbar-label\">{{ label }}</span>\n</div>\n",
5953
- styles: [".progressbar-indeterminate{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.progressbar-indeterminate .progressbar-container{background-color:#d8d8d8;border-radius:4px;height:24px;margin:8px 0;overflow:hidden;width:100%}.progressbar-indeterminate .indeterminate-bar{animation:5s infinite indeterminate-progress;background-color:#428bca;height:100%;width:40%}.progressbar-indeterminate .indeterminate-bar--blue{background-color:#428bca}.progressbar-indeterminate .indeterminate-bar--green{background-color:#0c9348}.progressbar-indeterminate .indeterminate-bar--red{background-color:#c13018}.progressbar-indeterminate .indeterminate-bar--yellow{background-color:#fcbf10}.progressbar-indeterminate .progressbar-label{font-family:\"Open Sans\" sans-serif;font-size:12px;line-height:150%;color:#212533}@keyframes indeterminate-progress{0%{transform:translateX(-250%)}100%{transform:translateX(250%)}}"]
5963
+ LocalizedTimeImpurePipe = __decorate([
5964
+ Pipe({
5965
+ name: "localizedTimeImpure",
5966
+ pure: false,
5954
5967
  })
5955
- ], ProgressBarIndeterminateComponent);
5968
+ ], LocalizedTimeImpurePipe);
5956
5969
 
5957
- let ProgressBarModule = class ProgressBarModule {
5970
+ var LocaleModule_1;
5971
+ let LocaleModule = LocaleModule_1 = class LocaleModule {
5972
+ static forRoot() {
5973
+ return {
5974
+ ngModule: LocaleModule_1,
5975
+ providers: [
5976
+ LocaleService,
5977
+ LocalizedCurrencyPipe,
5978
+ LocalizedDatePipe,
5979
+ LocalizedTimePipe,
5980
+ LocalizedNumberPipe,
5981
+ LocalizedCurrencyImpurePipe,
5982
+ LocalizedDateImpurePipe,
5983
+ LocalizedTimeImpurePipe,
5984
+ LocalizedBignumberPipe,
5985
+ LocalizedBignumberImpurePipe
5986
+ ],
5987
+ };
5988
+ }
5989
+ static forChild() {
5990
+ return {
5991
+ ngModule: LocaleModule_1,
5992
+ };
5993
+ }
5958
5994
  };
5959
- ProgressBarModule = __decorate([
5995
+ LocaleModule = LocaleModule_1 = __decorate([
5960
5996
  NgModule({
5961
5997
  imports: [CommonModule],
5998
+ exports: [
5999
+ LocalizedCurrencyPipe,
6000
+ LocalizedDatePipe,
6001
+ LocalizedTimePipe,
6002
+ LocalizedNumberPipe,
6003
+ LocalizedCurrencyImpurePipe,
6004
+ LocalizedDateImpurePipe,
6005
+ LocalizedTimeImpurePipe,
6006
+ LocalizedBignumberPipe,
6007
+ LocalizedBignumberImpurePipe
6008
+ ],
5962
6009
  declarations: [
5963
- ProgressBarComponent,
5964
- ProgressBarDeterminateComponent,
5965
- ProgressBarIndeterminateComponent,
6010
+ LocalizedCurrencyPipe,
6011
+ LocalizedDatePipe,
6012
+ LocalizedTimePipe,
6013
+ LocalizedNumberPipe,
6014
+ LocalizedCurrencyImpurePipe,
6015
+ LocalizedDateImpurePipe,
6016
+ LocalizedTimeImpurePipe,
6017
+ LocalizedBignumberPipe,
6018
+ LocalizedBignumberImpurePipe
5966
6019
  ],
5967
- exports: [ProgressBarComponent],
5968
6020
  })
5969
- ], ProgressBarModule);
6021
+ ], LocaleModule);
5970
6022
 
5971
6023
  const Breakpoints = {
5972
6024
  SM_MIN: 0,
@@ -6830,9 +6882,8 @@ LoadingStateModule = __decorate([
6830
6882
 
6831
6883
  var LocalizedNumberInputDirective_1;
6832
6884
  let LocalizedNumberInputDirective = LocalizedNumberInputDirective_1 = class LocalizedNumberInputDirective {
6833
- constructor() {
6834
- this.decimalSeparator = ",";
6835
- this.thousandsSeparator = ".";
6885
+ constructor(localeService) {
6886
+ this.localeService = localeService;
6836
6887
  this.precision = 2;
6837
6888
  }
6838
6889
  ngOnInit() {
@@ -6840,6 +6891,15 @@ let LocalizedNumberInputDirective = LocalizedNumberInputDirective_1 = class Loca
6840
6891
  // Exemplo: /^(\+?)(\-?)([0-9]{0,3})*((\,[0-9]{3,3})|((\,[0-9]{3,3})+(\,[0-9]{3,3}))|((\,[0-9]{3,3})+(\.[0-9]{1,10})))?$/g
6841
6892
  // tslint:disable-next-line: max-line-length
6842
6893
  this.numberRegex = `^((\\+?)|(-?))([0-9]{1,3})+((\\${this.thousandsSeparator}[0-9]{3,3})|((\\${this.thousandsSeparator}[0-9]{3,3})+(\\${this.thousandsSeparator}[0-9]{3,3}))|((\\${this.thousandsSeparator}[0-9]{3,3})+(\\${this.decimalSeparator}[0-9]{1,2}))|(\\${this.decimalSeparator}[0-9]{1,${this.precision}}))?$`;
6894
+ this.localeService
6895
+ .getLocale()
6896
+ .pipe(first())
6897
+ .subscribe(() => {
6898
+ var _a, _b;
6899
+ this.decimalSeparator = (_a = this.decimalSeparator) !== null && _a !== void 0 ? _a : this.localeService.getDecimalSeparator();
6900
+ this.thousandsSeparator = (_b = this.thousandsSeparator) !== null && _b !== void 0 ? _b : this.localeService.getGroupingSeparator();
6901
+ this.numberRegex = `^((\\+?)|(-?))([0-9]{1,3})+((\\${this.thousandsSeparator}[0-9]{3,3})|((\\${this.thousandsSeparator}[0-9]{3,3})+(\\${this.thousandsSeparator}[0-9]{3,3}))|((\\${this.thousandsSeparator}[0-9]{3,3})+(\\${this.decimalSeparator}[0-9]{1,2}))|(\\${this.decimalSeparator}[0-9]{1,${this.precision}}))?$`;
6902
+ });
6843
6903
  }
6844
6904
  validate(control) {
6845
6905
  if (control.value && !String(control.value).match(new RegExp(this.numberRegex, "g")))
@@ -6847,6 +6907,9 @@ let LocalizedNumberInputDirective = LocalizedNumberInputDirective_1 = class Loca
6847
6907
  return null;
6848
6908
  }
6849
6909
  };
6910
+ LocalizedNumberInputDirective.ctorParameters = () => [
6911
+ { type: LocaleService }
6912
+ ];
6850
6913
  __decorate([
6851
6914
  Input()
6852
6915
  ], LocalizedNumberInputDirective.prototype, "decimalSeparator", void 0);
@@ -8375,31 +8438,27 @@ AutocompleteFieldComponent = __decorate([
8375
8438
  ], AutocompleteFieldComponent);
8376
8439
 
8377
8440
  let BignumberFieldComponent = class BignumberFieldComponent extends BaseFieldComponent {
8378
- constructor() {
8379
- super(...arguments);
8441
+ constructor(localeService) {
8442
+ super();
8443
+ this.localeService = localeService;
8380
8444
  this.onInput = new EventEmitter();
8381
8445
  this.onFocus = new EventEmitter();
8382
8446
  this.onComplete = new EventEmitter();
8383
8447
  this.ngUnsubscribe = new Subject();
8384
8448
  }
8385
8449
  ngOnInit() {
8386
- this.onFocus
8387
- .pipe(takeUntil(this.ngUnsubscribe))
8388
- .subscribe((event) => {
8450
+ this.onLocaleService();
8451
+ this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
8389
8452
  if (this.field.onFocus) {
8390
8453
  this.field.onFocus(event);
8391
8454
  }
8392
8455
  });
8393
- this.onInput
8394
- .pipe(takeUntil(this.ngUnsubscribe))
8395
- .subscribe((event) => {
8456
+ this.onInput.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
8396
8457
  if (this.field.onInput) {
8397
8458
  this.field.onInput(event);
8398
8459
  }
8399
8460
  });
8400
- this.onComplete
8401
- .pipe(takeUntil(this.ngUnsubscribe))
8402
- .subscribe((event) => {
8461
+ this.onComplete.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
8403
8462
  if (this.field.onComplete) {
8404
8463
  this.field.onComplete(event);
8405
8464
  }
@@ -8412,7 +8471,37 @@ let BignumberFieldComponent = class BignumberFieldComponent extends BaseFieldCom
8412
8471
  get fieldType() {
8413
8472
  return FieldType;
8414
8473
  }
8474
+ onLocaleService() {
8475
+ this.localeService
8476
+ .getLocale()
8477
+ .pipe(first())
8478
+ .subscribe({
8479
+ next: () => {
8480
+ var _a, _b, _c;
8481
+ if (!((_a = this.field.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator)) {
8482
+ this.field.numberLocaleOptions = Object.assign(Object.assign({}, this.field.numberLocaleOptions), { decimalSeparator: this.localeService.getDecimalSeparator() });
8483
+ }
8484
+ if (!((_b = this.field.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator)) {
8485
+ this.field.numberLocaleOptions = Object.assign(Object.assign({}, this.field.numberLocaleOptions), { thousandsSeparator: this.localeService.getGroupingSeparator() });
8486
+ }
8487
+ if (!((_c = this.field.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol)) {
8488
+ this.field.numberLocaleOptions = Object.assign(Object.assign({}, this.field.numberLocaleOptions), { currencySymbol: this.field.type === FieldType.Integer || this.field.type === FieldType.Double ? "" : "R$" });
8489
+ }
8490
+ },
8491
+ error: () => {
8492
+ var _a;
8493
+ return (this.field.numberLocaleOptions = (_a = this.field.numberLocaleOptions) !== null && _a !== void 0 ? _a : {
8494
+ thousandsSeparator: ".",
8495
+ decimalSeparator: ",",
8496
+ currencySymbol: this.field.type === FieldType.Integer || this.field.type === FieldType.Double ? "" : "R$",
8497
+ });
8498
+ },
8499
+ });
8500
+ }
8415
8501
  };
8502
+ BignumberFieldComponent.ctorParameters = () => [
8503
+ { type: LocaleService }
8504
+ ];
8416
8505
  __decorate([
8417
8506
  Input()
8418
8507
  ], BignumberFieldComponent.prototype, "field", void 0);
@@ -8611,7 +8700,44 @@ CountryPhonePickerFieldComponent = __decorate([
8611
8700
  * @deprecated Should use bignumber instead
8612
8701
  */
8613
8702
  let CurrencyFieldComponent = class CurrencyFieldComponent extends BaseFieldComponent {
8703
+ constructor(localeService) {
8704
+ super();
8705
+ this.localeService = localeService;
8706
+ }
8707
+ ngOnInit() {
8708
+ this.onLocaleService();
8709
+ }
8710
+ onLocaleService() {
8711
+ this.localeService
8712
+ .getLocale()
8713
+ .pipe(first())
8714
+ .subscribe({
8715
+ next: () => {
8716
+ var _a, _b, _c;
8717
+ if (!((_a = this.field.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator)) {
8718
+ this.field.numberLocaleOptions = Object.assign(Object.assign({}, this.field.numberLocaleOptions), { decimalSeparator: this.localeService.getDecimalSeparator() });
8719
+ }
8720
+ if (!((_b = this.field.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator)) {
8721
+ this.field.numberLocaleOptions = Object.assign(Object.assign({}, this.field.numberLocaleOptions), { thousandsSeparator: this.localeService.getGroupingSeparator() });
8722
+ }
8723
+ if (!((_c = this.field.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol)) {
8724
+ this.field.numberLocaleOptions = Object.assign(Object.assign({}, this.field.numberLocaleOptions), { currencySymbol: "R$" });
8725
+ }
8726
+ },
8727
+ error: () => {
8728
+ var _a;
8729
+ return (this.field.numberLocaleOptions = (_a = this.field.numberLocaleOptions) !== null && _a !== void 0 ? _a : {
8730
+ thousandsSeparator: ".",
8731
+ decimalSeparator: ",",
8732
+ currencySymbol: "R$",
8733
+ });
8734
+ },
8735
+ });
8736
+ }
8614
8737
  };
8738
+ CurrencyFieldComponent.ctorParameters = () => [
8739
+ { type: LocaleService }
8740
+ ];
8615
8741
  __decorate([
8616
8742
  Input()
8617
8743
  ], CurrencyFieldComponent.prototype, "field", void 0);
@@ -8682,14 +8808,16 @@ LookupFieldComponent = __decorate([
8682
8808
  ], LookupFieldComponent);
8683
8809
 
8684
8810
  let NumberFieldComponent = class NumberFieldComponent extends BaseFieldComponent {
8685
- constructor() {
8686
- super(...arguments);
8811
+ constructor(localeService) {
8812
+ super();
8813
+ this.localeService = localeService;
8687
8814
  this.onInput = new EventEmitter();
8688
8815
  this.onFocus = new EventEmitter();
8689
8816
  this.onComplete = new EventEmitter();
8690
8817
  this.ngUnsubscribe = new Subject();
8691
8818
  }
8692
8819
  ngOnInit() {
8820
+ this.onLocaleService();
8693
8821
  this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe((event) => {
8694
8822
  if (this.field.onFocus)
8695
8823
  this.field.onFocus(event);
@@ -8713,7 +8841,37 @@ let NumberFieldComponent = class NumberFieldComponent extends BaseFieldComponent
8713
8841
  get fieldType() {
8714
8842
  return FieldType;
8715
8843
  }
8844
+ onLocaleService() {
8845
+ this.localeService
8846
+ .getLocale()
8847
+ .pipe(first())
8848
+ .subscribe({
8849
+ next: () => {
8850
+ var _a, _b, _c;
8851
+ if (!((_a = this.field.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator)) {
8852
+ this.field.numberLocaleOptions = Object.assign(Object.assign({}, this.field.numberLocaleOptions), { decimalSeparator: this.localeService.getDecimalSeparator() });
8853
+ }
8854
+ if (!((_b = this.field.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator)) {
8855
+ this.field.numberLocaleOptions = Object.assign(Object.assign({}, this.field.numberLocaleOptions), { thousandsSeparator: this.localeService.getGroupingSeparator() });
8856
+ }
8857
+ if (!((_c = this.field.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol)) {
8858
+ this.field.numberLocaleOptions = Object.assign(Object.assign({}, this.field.numberLocaleOptions), { currencySymbol: "R$" });
8859
+ }
8860
+ },
8861
+ error: () => {
8862
+ var _a;
8863
+ return (this.field.numberLocaleOptions = (_a = this.field.numberLocaleOptions) !== null && _a !== void 0 ? _a : {
8864
+ thousandsSeparator: ".",
8865
+ decimalSeparator: ",",
8866
+ currencySymbol: "R$",
8867
+ });
8868
+ },
8869
+ });
8870
+ }
8716
8871
  };
8872
+ NumberFieldComponent.ctorParameters = () => [
8873
+ { type: LocaleService }
8874
+ ];
8717
8875
  __decorate([
8718
8876
  Input()
8719
8877
  ], NumberFieldComponent.prototype, "field", void 0);
@@ -9255,12 +9413,6 @@ class DynamicField extends DynamicForm {
9255
9413
  errorMessages,
9256
9414
  });
9257
9415
  this.field = field;
9258
- this.setFieldPropertiesByType();
9259
- }
9260
- setFieldPropertiesByType() {
9261
- if (this.field.type === FieldType.Integer || this.field.type === FieldType.Double) {
9262
- this.field.numberLocaleOptions.currencySymbol = "";
9263
- }
9264
9416
  }
9265
9417
  createComponent(resolver, container) {
9266
9418
  const componentFactory = resolver.resolveComponentFactory(this.getComponent());