@seniorsistemas/angular-components 17.5.1 → 17.5.3
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/bundles/seniorsistemas-angular-components.umd.js +711 -555
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/bignumber-input/number-input.directive.d.ts +5 -1
- package/components/dynamic-form/components/fields/bignumber/number-field.component.d.ts +4 -0
- package/components/dynamic-form/components/fields/currency/currency-field.component.d.ts +7 -1
- package/components/dynamic-form/components/fields/number/number-field.component.d.ts +4 -0
- package/components/dynamic-form/dynamic-form.d.ts +0 -1
- package/components/locale/locale.service.d.ts +3 -1
- package/components/localized-number-input/localized-number-input.directive.d.ts +3 -1
- package/components/number-input/number-input.directive.d.ts +5 -1
- package/esm2015/components/bignumber-input/number-input.directive.js +24 -6
- package/esm2015/components/dynamic-form/components/fields/bignumber/number-field.component.js +40 -13
- package/esm2015/components/dynamic-form/components/fields/currency/currency-field.component.js +40 -1
- package/esm2015/components/dynamic-form/components/fields/number/number-field.component.js +37 -4
- package/esm2015/components/dynamic-form/components/lookup/lookup.component.js +2 -2
- package/esm2015/components/dynamic-form/configurations/fields/bignumber-field.js +2 -3
- package/esm2015/components/dynamic-form/configurations/fields/currency-field.js +2 -3
- package/esm2015/components/dynamic-form/configurations/fields/decimal-field.js +2 -3
- package/esm2015/components/dynamic-form/configurations/fields/number-field.js +2 -3
- package/esm2015/components/dynamic-form/dynamic-form.js +1 -7
- package/esm2015/components/locale/locale.service.js +26 -5
- package/esm2015/components/localized-number-input/localized-number-input.directive.js +17 -4
- package/esm2015/components/number-input/number-input.directive.js +24 -7
- package/esm5/components/bignumber-input/number-input.directive.js +25 -6
- package/esm5/components/dynamic-form/components/fields/bignumber/number-field.component.js +42 -14
- package/esm5/components/dynamic-form/components/fields/currency/currency-field.component.js +42 -4
- package/esm5/components/dynamic-form/components/fields/number/number-field.component.js +39 -5
- package/esm5/components/dynamic-form/components/lookup/lookup.component.js +2 -2
- package/esm5/components/dynamic-form/configurations/fields/bignumber-field.js +2 -3
- package/esm5/components/dynamic-form/configurations/fields/currency-field.js +2 -3
- package/esm5/components/dynamic-form/configurations/fields/decimal-field.js +2 -3
- package/esm5/components/dynamic-form/configurations/fields/number-field.js +2 -3
- package/esm5/components/dynamic-form/dynamic-form.js +1 -7
- package/esm5/components/locale/locale.service.js +25 -4
- package/esm5/components/localized-number-input/localized-number-input.directive.js +18 -4
- package/esm5/components/number-input/number-input.directive.js +25 -7
- package/fesm2015/seniorsistemas-angular-components.js +654 -502
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +708 -552
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { __decorate, __extends, __spread, __assign, __awaiter, __generator, __param, __values, __rest, __read } 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,
|
|
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,
|
|
5
|
-
import { takeUntil,
|
|
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 { AlignmentOptions, CurrencyMaskDirective, 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 { user, service } 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';
|
|
@@ -865,15 +865,157 @@ var BadgeModule = /** @class */ (function () {
|
|
|
865
865
|
return BadgeModule;
|
|
866
866
|
}());
|
|
867
867
|
|
|
868
|
+
var CalendarLocaleOptions = /** @class */ (function () {
|
|
869
|
+
function CalendarLocaleOptions(config) {
|
|
870
|
+
var _this = this;
|
|
871
|
+
if (config === void 0) { config = {}; }
|
|
872
|
+
this.hourFormat = "24";
|
|
873
|
+
this.dateFormat = "dd/mm/yy";
|
|
874
|
+
this.firstDayOfWeek = 0;
|
|
875
|
+
this.today = "Hoje";
|
|
876
|
+
this.clear = "Limpar";
|
|
877
|
+
this.dayNames = ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"];
|
|
878
|
+
this.dayNamesShort = ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"];
|
|
879
|
+
this.dayNamesMin = ["D", "S", "T", "Q", "Q", "S", "S"];
|
|
880
|
+
this.monthNamesShort = ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"];
|
|
881
|
+
this.monthNames = [
|
|
882
|
+
"Janeiro",
|
|
883
|
+
"Fevereiro",
|
|
884
|
+
"Março",
|
|
885
|
+
"Abril",
|
|
886
|
+
"Maio",
|
|
887
|
+
"Junho",
|
|
888
|
+
"Julho",
|
|
889
|
+
"Agosto",
|
|
890
|
+
"Setembro",
|
|
891
|
+
"Outubro",
|
|
892
|
+
"Novembro",
|
|
893
|
+
"Dezembro",
|
|
894
|
+
];
|
|
895
|
+
Object.keys(config).forEach(function (key) { return (_this[key] = config[key] || _this[key]); });
|
|
896
|
+
}
|
|
897
|
+
return CalendarLocaleOptions;
|
|
898
|
+
}());
|
|
899
|
+
|
|
900
|
+
var NumberLocaleOptions = /** @class */ (function () {
|
|
901
|
+
function NumberLocaleOptions(config) {
|
|
902
|
+
if (config === void 0) { config = {}; }
|
|
903
|
+
this.thousandsSeparator = ".";
|
|
904
|
+
this.decimalSeparator = ",";
|
|
905
|
+
this.currencySymbol = "R$";
|
|
906
|
+
Object.assign(this, config);
|
|
907
|
+
}
|
|
908
|
+
return NumberLocaleOptions;
|
|
909
|
+
}());
|
|
910
|
+
|
|
911
|
+
var LocaleOptions = /** @class */ (function () {
|
|
912
|
+
function LocaleOptions(config) {
|
|
913
|
+
var _this = this;
|
|
914
|
+
if (config === void 0) { config = {}; }
|
|
915
|
+
this.calendar = new CalendarLocaleOptions();
|
|
916
|
+
this.number = new NumberLocaleOptions();
|
|
917
|
+
Object.keys(config).forEach(function (key) { return (_this[key] = config[key] || _this[key]); });
|
|
918
|
+
}
|
|
919
|
+
return LocaleOptions;
|
|
920
|
+
}());
|
|
921
|
+
/**
|
|
922
|
+
* @deprecated
|
|
923
|
+
*/
|
|
924
|
+
var DEFAULT_CALENDAR_LOCALE_OPTIONS = new CalendarLocaleOptions();
|
|
925
|
+
/**
|
|
926
|
+
* @deprecated
|
|
927
|
+
*/
|
|
928
|
+
var DEFAULT_NUMBER_LOCALE_OPTIONS = new NumberLocaleOptions();
|
|
929
|
+
/**
|
|
930
|
+
* @deprecated
|
|
931
|
+
*/
|
|
932
|
+
var DEFAULT_LOCALE_OPTIONS = new LocaleOptions();
|
|
933
|
+
|
|
934
|
+
var moment = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
935
|
+
var LocaleService = /** @class */ (function () {
|
|
936
|
+
function LocaleService(http, cookieService) {
|
|
937
|
+
this.http = http;
|
|
938
|
+
this.cookieService = cookieService;
|
|
939
|
+
this.localeOptionsAddress = "https://cdn.senior.com.br/primeng/locales";
|
|
940
|
+
this.localeOptionsVersion = "3.0.0";
|
|
941
|
+
}
|
|
942
|
+
LocaleService.prototype.get = function () {
|
|
943
|
+
var _this = this;
|
|
944
|
+
return this.localeOptions
|
|
945
|
+
? of(this.localeOptions)
|
|
946
|
+
: this.getLocaleConfig().pipe(tap(function (localeOptions) { return (_this.localeOptions = localeOptions); }));
|
|
947
|
+
};
|
|
948
|
+
LocaleService.prototype.getLocale = function () {
|
|
949
|
+
var _this = this;
|
|
950
|
+
return this.locale
|
|
951
|
+
? of(this.locale)
|
|
952
|
+
: from(this.getUserData()).pipe(map(function (userData) {
|
|
953
|
+
_this.locale = userData.locale || userData.tenantLocale || "pt-BR";
|
|
954
|
+
return _this.locale;
|
|
955
|
+
}));
|
|
956
|
+
};
|
|
957
|
+
LocaleService.prototype.getUserData = function () {
|
|
958
|
+
try {
|
|
959
|
+
return of(JSON.parse(this.cookieService.get("com.senior.token")));
|
|
960
|
+
}
|
|
961
|
+
catch (ex) {
|
|
962
|
+
console.warn("Unable to obtain user locale from cookie, calling getUser");
|
|
963
|
+
return user.getUserData();
|
|
964
|
+
}
|
|
965
|
+
};
|
|
966
|
+
LocaleService.prototype.getLocaleConfig = function () {
|
|
967
|
+
var _this = this;
|
|
968
|
+
return this.getLocale().pipe(switchMap(function (locale) {
|
|
969
|
+
moment.locale(locale);
|
|
970
|
+
return _this.http
|
|
971
|
+
.get(_this.localeOptionsAddress + "/" + _this.localeOptionsVersion + "/" + locale + ".json")
|
|
972
|
+
.pipe(map(function (response) { return new LocaleOptions(response); }));
|
|
973
|
+
}), catchError(function (err) {
|
|
974
|
+
console.warn("Error getting locale configuration. Using fallback.", err);
|
|
975
|
+
return of(new LocaleOptions());
|
|
976
|
+
}));
|
|
977
|
+
};
|
|
978
|
+
LocaleService.prototype.getGroupingSeparator = function () {
|
|
979
|
+
var _a;
|
|
980
|
+
var numberFormat = new Intl.NumberFormat(this.locale, {
|
|
981
|
+
style: "decimal",
|
|
982
|
+
minimumFractionDigits: 5,
|
|
983
|
+
maximumFractionDigits: 5,
|
|
984
|
+
});
|
|
985
|
+
// The default groupingSeparator for 'fr' is the character code 8239. We need it to be the regular space.
|
|
986
|
+
if (this.locale.includes("fr"))
|
|
987
|
+
return " ";
|
|
988
|
+
return (_a = numberFormat.formatToParts(1000).find(function (part) { return part.type === "group"; })) === null || _a === void 0 ? void 0 : _a.value;
|
|
989
|
+
};
|
|
990
|
+
LocaleService.prototype.getDecimalSeparator = function () {
|
|
991
|
+
var _a;
|
|
992
|
+
var numberFormat = new Intl.NumberFormat(this.locale, {
|
|
993
|
+
style: "decimal",
|
|
994
|
+
minimumFractionDigits: 5,
|
|
995
|
+
maximumFractionDigits: 5,
|
|
996
|
+
});
|
|
997
|
+
return (_a = numberFormat.formatToParts(1.2).find(function (part) { return part.type === "decimal"; })) === null || _a === void 0 ? void 0 : _a.value;
|
|
998
|
+
};
|
|
999
|
+
LocaleService.ctorParameters = function () { return [
|
|
1000
|
+
{ type: HttpClient },
|
|
1001
|
+
{ type: CookieService }
|
|
1002
|
+
]; };
|
|
1003
|
+
LocaleService = __decorate([
|
|
1004
|
+
Injectable()
|
|
1005
|
+
], LocaleService);
|
|
1006
|
+
return LocaleService;
|
|
1007
|
+
}());
|
|
1008
|
+
|
|
868
1009
|
var BignumberInputDirective = /** @class */ (function (_super) {
|
|
869
1010
|
__extends(BignumberInputDirective, _super);
|
|
870
|
-
function BignumberInputDirective() {
|
|
871
|
-
var _this = _super
|
|
1011
|
+
function BignumberInputDirective(_elementRef, _keyValueDiffers, localeService) {
|
|
1012
|
+
var _this = _super.call(this, null, _elementRef, _keyValueDiffers) || this;
|
|
1013
|
+
_this.localeService = localeService;
|
|
872
1014
|
_this.precision = 15;
|
|
873
1015
|
_this.scale = 0;
|
|
874
|
-
_this.decimalSeparator = ",";
|
|
875
1016
|
_this.alignTo = AlignmentOptions.LEFT;
|
|
876
1017
|
_this.allowNegative = true;
|
|
1018
|
+
_this.onLocaleService();
|
|
877
1019
|
return _this;
|
|
878
1020
|
}
|
|
879
1021
|
BignumberInputDirective_1 = BignumberInputDirective;
|
|
@@ -918,7 +1060,7 @@ var BignumberInputDirective = /** @class */ (function (_super) {
|
|
|
918
1060
|
scale: this.scale || 0,
|
|
919
1061
|
prefix: "",
|
|
920
1062
|
suffix: "",
|
|
921
|
-
allowNegative: this.allowNegative
|
|
1063
|
+
allowNegative: this.allowNegative,
|
|
922
1064
|
};
|
|
923
1065
|
this.calculateMaxLength();
|
|
924
1066
|
};
|
|
@@ -934,7 +1076,23 @@ var BignumberInputDirective = /** @class */ (function (_super) {
|
|
|
934
1076
|
this._maxLength = maxLength;
|
|
935
1077
|
this.maxLength = maxLength;
|
|
936
1078
|
};
|
|
1079
|
+
BignumberInputDirective.prototype.onLocaleService = function () {
|
|
1080
|
+
var _this = this;
|
|
1081
|
+
this.localeService
|
|
1082
|
+
.getLocale()
|
|
1083
|
+
.pipe(first())
|
|
1084
|
+
.subscribe(function () {
|
|
1085
|
+
var _a, _b;
|
|
1086
|
+
_this.decimalSeparator = (_a = _this.decimalSeparator) !== null && _a !== void 0 ? _a : _this.localeService.getDecimalSeparator();
|
|
1087
|
+
_this.thousandsSeparator = (_b = _this.thousandsSeparator) !== null && _b !== void 0 ? _b : _this.localeService.getGroupingSeparator();
|
|
1088
|
+
});
|
|
1089
|
+
};
|
|
937
1090
|
var BignumberInputDirective_1;
|
|
1091
|
+
BignumberInputDirective.ctorParameters = function () { return [
|
|
1092
|
+
{ type: ElementRef },
|
|
1093
|
+
{ type: KeyValueDiffers },
|
|
1094
|
+
{ type: LocaleService }
|
|
1095
|
+
]; };
|
|
938
1096
|
__decorate([
|
|
939
1097
|
Input()
|
|
940
1098
|
], BignumberInputDirective.prototype, "precision", void 0);
|
|
@@ -4152,38 +4310,6 @@ var CountryPhonePickerModule = /** @class */ (function () {
|
|
|
4152
4310
|
return CountryPhonePickerModule;
|
|
4153
4311
|
}());
|
|
4154
4312
|
|
|
4155
|
-
var CalendarLocaleOptions = /** @class */ (function () {
|
|
4156
|
-
function CalendarLocaleOptions(config) {
|
|
4157
|
-
var _this = this;
|
|
4158
|
-
if (config === void 0) { config = {}; }
|
|
4159
|
-
this.hourFormat = "24";
|
|
4160
|
-
this.dateFormat = "dd/mm/yy";
|
|
4161
|
-
this.firstDayOfWeek = 0;
|
|
4162
|
-
this.today = "Hoje";
|
|
4163
|
-
this.clear = "Limpar";
|
|
4164
|
-
this.dayNames = ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"];
|
|
4165
|
-
this.dayNamesShort = ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"];
|
|
4166
|
-
this.dayNamesMin = ["D", "S", "T", "Q", "Q", "S", "S"];
|
|
4167
|
-
this.monthNamesShort = ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"];
|
|
4168
|
-
this.monthNames = [
|
|
4169
|
-
"Janeiro",
|
|
4170
|
-
"Fevereiro",
|
|
4171
|
-
"Março",
|
|
4172
|
-
"Abril",
|
|
4173
|
-
"Maio",
|
|
4174
|
-
"Junho",
|
|
4175
|
-
"Julho",
|
|
4176
|
-
"Agosto",
|
|
4177
|
-
"Setembro",
|
|
4178
|
-
"Outubro",
|
|
4179
|
-
"Novembro",
|
|
4180
|
-
"Dezembro",
|
|
4181
|
-
];
|
|
4182
|
-
Object.keys(config).forEach(function (key) { return (_this[key] = config[key] || _this[key]); });
|
|
4183
|
-
}
|
|
4184
|
-
return CalendarLocaleOptions;
|
|
4185
|
-
}());
|
|
4186
|
-
|
|
4187
4313
|
var FieldType;
|
|
4188
4314
|
(function (FieldType) {
|
|
4189
4315
|
FieldType["Autocomplete"] = "Autocomplete";
|
|
@@ -4265,410 +4391,50 @@ var AutocompleteField = /** @class */ (function (_super) {
|
|
|
4265
4391
|
return AutocompleteField;
|
|
4266
4392
|
}(Field));
|
|
4267
4393
|
|
|
4268
|
-
var
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4394
|
+
var BignumberField = /** @class */ (function (_super) {
|
|
4395
|
+
__extends(BignumberField, _super);
|
|
4396
|
+
function BignumberField(config) {
|
|
4397
|
+
var _a, _b, _c;
|
|
4398
|
+
var _this = _super.call(this, config) || this;
|
|
4399
|
+
_this.allowNegative = (_a = config.allowNegative) !== null && _a !== void 0 ? _a : true;
|
|
4400
|
+
_this.numberLocaleOptions = config.numberLocaleOptions;
|
|
4401
|
+
_this.browserAutocomplete = config.browserAutocomplete;
|
|
4402
|
+
_this.precision = config.precision;
|
|
4403
|
+
_this.scale = (_b = config.scale) !== null && _b !== void 0 ? _b : 2;
|
|
4404
|
+
_this.alignTo = _this.scale ? AlignmentOptions.RIGHT : AlignmentOptions.LEFT;
|
|
4405
|
+
_this.mask = config.mask;
|
|
4406
|
+
_this.leftAddon = config.leftAddon;
|
|
4407
|
+
_this.rightAddon = config.rightAddon;
|
|
4408
|
+
_this.onBlur = config.onBlur;
|
|
4409
|
+
_this.onFocus = config.onFocus;
|
|
4410
|
+
_this.onComplete = config.onComplete;
|
|
4411
|
+
_this.onInput = config.onInput;
|
|
4412
|
+
_this.autoClear = (_c = config.autoClear) !== null && _c !== void 0 ? _c : true;
|
|
4413
|
+
return _this;
|
|
4275
4414
|
}
|
|
4276
|
-
return
|
|
4277
|
-
}());
|
|
4415
|
+
return BignumberField;
|
|
4416
|
+
}(Field));
|
|
4278
4417
|
|
|
4279
|
-
var
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4418
|
+
var BlobField = /** @class */ (function (_super) {
|
|
4419
|
+
__extends(BlobField, _super);
|
|
4420
|
+
function BlobField(config) {
|
|
4421
|
+
var _this = _super.call(this, config) || this;
|
|
4422
|
+
_this.accept = config.accept;
|
|
4423
|
+
_this.files = config.files || [];
|
|
4424
|
+
_this.chooseLabel = config.chooseLabel;
|
|
4425
|
+
_this.removeLabel = config.removeLabel;
|
|
4426
|
+
_this.cancelLabel = config.cancelLabel;
|
|
4427
|
+
_this.successTooltip = config.successTooltip;
|
|
4428
|
+
_this.multiple = config.multiple;
|
|
4429
|
+
_this.onUploadFile = config.onUploadFile;
|
|
4430
|
+
_this.onRemoveFile = config.onRemoveFile;
|
|
4431
|
+
_this.onCancelUpload = config.onCancelUpload;
|
|
4432
|
+
_this.onDownloadFile = config.onDownloadFile;
|
|
4433
|
+
_this.showFileUploadDate = config.showFileUploadDate;
|
|
4434
|
+
return _this;
|
|
4286
4435
|
}
|
|
4287
|
-
return
|
|
4288
|
-
}());
|
|
4289
|
-
/**
|
|
4290
|
-
* @deprecated
|
|
4291
|
-
*/
|
|
4292
|
-
var DEFAULT_CALENDAR_LOCALE_OPTIONS = new CalendarLocaleOptions();
|
|
4293
|
-
/**
|
|
4294
|
-
* @deprecated
|
|
4295
|
-
*/
|
|
4296
|
-
var DEFAULT_NUMBER_LOCALE_OPTIONS = new NumberLocaleOptions();
|
|
4297
|
-
/**
|
|
4298
|
-
* @deprecated
|
|
4299
|
-
*/
|
|
4300
|
-
var DEFAULT_LOCALE_OPTIONS = new LocaleOptions();
|
|
4301
|
-
|
|
4302
|
-
var moment = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
4303
|
-
var LocaleService = /** @class */ (function () {
|
|
4304
|
-
function LocaleService(http, cookieService) {
|
|
4305
|
-
this.http = http;
|
|
4306
|
-
this.cookieService = cookieService;
|
|
4307
|
-
this.localeOptionsAddress = "https://cdn.senior.com.br/primeng/locales";
|
|
4308
|
-
this.localeOptionsVersion = "3.0.0";
|
|
4309
|
-
}
|
|
4310
|
-
LocaleService.prototype.get = function () {
|
|
4311
|
-
var _this = this;
|
|
4312
|
-
return this.localeOptions
|
|
4313
|
-
? of(this.localeOptions)
|
|
4314
|
-
: this.getLocaleConfig().pipe(tap(function (localeOptions) { return (_this.localeOptions = localeOptions); }));
|
|
4315
|
-
};
|
|
4316
|
-
LocaleService.prototype.getLocale = function () {
|
|
4317
|
-
var _this = this;
|
|
4318
|
-
return this.locale
|
|
4319
|
-
? of(this.locale)
|
|
4320
|
-
: from(this.getUserData()).pipe(map(function (userData) {
|
|
4321
|
-
_this.locale = userData.locale || userData.tenantLocale || "pt-BR";
|
|
4322
|
-
return _this.locale;
|
|
4323
|
-
}));
|
|
4324
|
-
};
|
|
4325
|
-
LocaleService.prototype.getUserData = function () {
|
|
4326
|
-
try {
|
|
4327
|
-
return of(JSON.parse(this.cookieService.get('com.senior.token')));
|
|
4328
|
-
}
|
|
4329
|
-
catch (ex) {
|
|
4330
|
-
console.warn('Unable to obtain user locale from cookie, calling getUser');
|
|
4331
|
-
return user.getUserData();
|
|
4332
|
-
}
|
|
4333
|
-
};
|
|
4334
|
-
LocaleService.prototype.getLocaleConfig = function () {
|
|
4335
|
-
var _this = this;
|
|
4336
|
-
return this.getLocale().pipe(switchMap(function (locale) {
|
|
4337
|
-
moment.locale(locale);
|
|
4338
|
-
return _this.http
|
|
4339
|
-
.get(_this.localeOptionsAddress + "/" + _this.localeOptionsVersion + "/" + locale + ".json")
|
|
4340
|
-
.pipe(map(function (response) { return new LocaleOptions(response); }));
|
|
4341
|
-
}), catchError(function (err) {
|
|
4342
|
-
console.warn("Error getting locale configuration. Using fallback.", err);
|
|
4343
|
-
return of(new LocaleOptions());
|
|
4344
|
-
}));
|
|
4345
|
-
};
|
|
4346
|
-
LocaleService.ctorParameters = function () { return [
|
|
4347
|
-
{ type: HttpClient },
|
|
4348
|
-
{ type: CookieService }
|
|
4349
|
-
]; };
|
|
4350
|
-
LocaleService = __decorate([
|
|
4351
|
-
Injectable()
|
|
4352
|
-
], LocaleService);
|
|
4353
|
-
return LocaleService;
|
|
4354
|
-
}());
|
|
4355
|
-
|
|
4356
|
-
var LocalizedBignumberPipe = /** @class */ (function () {
|
|
4357
|
-
function LocalizedBignumberPipe(localeService) {
|
|
4358
|
-
this.localeService = localeService;
|
|
4359
|
-
}
|
|
4360
|
-
LocalizedBignumberPipe.prototype.transform = function (value, options) {
|
|
4361
|
-
return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);
|
|
4362
|
-
};
|
|
4363
|
-
LocalizedBignumberPipe.prototype.applyMask = function (value, options) {
|
|
4364
|
-
return this.localeService.get().pipe(map(function (localeConfig) {
|
|
4365
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
4366
|
-
var configs = {
|
|
4367
|
-
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$",
|
|
4368
|
-
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 : ".",
|
|
4369
|
-
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 : ",",
|
|
4370
|
-
scale: (_k = options === null || options === void 0 ? void 0 : options.scale) !== null && _k !== void 0 ? _k : 2,
|
|
4371
|
-
allowNegative: (_l = options === null || options === void 0 ? void 0 : options.allowNegative) !== null && _l !== void 0 ? _l : true
|
|
4372
|
-
};
|
|
4373
|
-
var isNumber = !(new BigNumber(value).isNaN());
|
|
4374
|
-
return applyMask(value, configs, isNumber);
|
|
4375
|
-
}));
|
|
4376
|
-
};
|
|
4377
|
-
LocalizedBignumberPipe.ctorParameters = function () { return [
|
|
4378
|
-
{ type: LocaleService }
|
|
4379
|
-
]; };
|
|
4380
|
-
LocalizedBignumberPipe = __decorate([
|
|
4381
|
-
Pipe({
|
|
4382
|
-
name: "localizedBignumber",
|
|
4383
|
-
})
|
|
4384
|
-
], LocalizedBignumberPipe);
|
|
4385
|
-
return LocalizedBignumberPipe;
|
|
4386
|
-
}());
|
|
4387
|
-
|
|
4388
|
-
var LocalizedBignumberImpurePipe = /** @class */ (function (_super) {
|
|
4389
|
-
__extends(LocalizedBignumberImpurePipe, _super);
|
|
4390
|
-
function LocalizedBignumberImpurePipe() {
|
|
4391
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
4392
|
-
}
|
|
4393
|
-
LocalizedBignumberImpurePipe.prototype.transform = function (value, options) {
|
|
4394
|
-
return _super.prototype.transform.call(this, value, options);
|
|
4395
|
-
};
|
|
4396
|
-
LocalizedBignumberImpurePipe = __decorate([
|
|
4397
|
-
Pipe({
|
|
4398
|
-
name: "localizedBignumberImpure",
|
|
4399
|
-
pure: false,
|
|
4400
|
-
})
|
|
4401
|
-
], LocalizedBignumberImpurePipe);
|
|
4402
|
-
return LocalizedBignumberImpurePipe;
|
|
4403
|
-
}(LocalizedBignumberPipe));
|
|
4404
|
-
|
|
4405
|
-
var LocalizedCurrencyPipeOptions = /** @class */ (function (_super) {
|
|
4406
|
-
__extends(LocalizedCurrencyPipeOptions, _super);
|
|
4407
|
-
function LocalizedCurrencyPipeOptions(config) {
|
|
4408
|
-
if (config === void 0) { config = {}; }
|
|
4409
|
-
var _this = _super.call(this, config) || this;
|
|
4410
|
-
_this.scale = 2;
|
|
4411
|
-
return _this;
|
|
4412
|
-
}
|
|
4413
|
-
return LocalizedCurrencyPipeOptions;
|
|
4414
|
-
}(NumberLocaleOptions));
|
|
4415
|
-
/**
|
|
4416
|
-
* @deprecated Should use localizedBignumberPipe instead
|
|
4417
|
-
*/
|
|
4418
|
-
var LocalizedCurrencyPipe = /** @class */ (function () {
|
|
4419
|
-
function LocalizedCurrencyPipe(localeService) {
|
|
4420
|
-
this.localeService = localeService;
|
|
4421
|
-
}
|
|
4422
|
-
LocalizedCurrencyPipe.prototype.transform = function (value, options) {
|
|
4423
|
-
if (!options) {
|
|
4424
|
-
options = new LocalizedCurrencyPipeOptions();
|
|
4425
|
-
}
|
|
4426
|
-
return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);
|
|
4427
|
-
};
|
|
4428
|
-
LocalizedCurrencyPipe.prototype.applyMask = function (value, options) {
|
|
4429
|
-
return this.localeService.get().pipe(map(function (localeConfig) {
|
|
4430
|
-
var config = __assign(__assign({}, localeConfig.number), options);
|
|
4431
|
-
var scale = config.scale, currencySymbol = config.currencySymbol, thousandsSeparator = config.thousandsSeparator, decimalSeparator = config.decimalSeparator;
|
|
4432
|
-
var rawValue = Number(value).toFixed(scale);
|
|
4433
|
-
var onlyNumbers = rawValue.replace(/[^0-9]/g, "");
|
|
4434
|
-
var integerPart = onlyNumbers
|
|
4435
|
-
.slice(0, onlyNumbers.length - scale)
|
|
4436
|
-
.replace(/^0*/g, "")
|
|
4437
|
-
.replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSeparator) || "0";
|
|
4438
|
-
var decimalPart = onlyNumbers.slice(onlyNumbers.length - scale);
|
|
4439
|
-
var newValue = scale ? integerPart + decimalSeparator + decimalPart : integerPart;
|
|
4440
|
-
var isZero = !Number(onlyNumbers);
|
|
4441
|
-
var operator = rawValue.includes("-") && !isZero ? "-" : "";
|
|
4442
|
-
return "" + operator + currencySymbol + newValue;
|
|
4443
|
-
}));
|
|
4444
|
-
};
|
|
4445
|
-
LocalizedCurrencyPipe.ctorParameters = function () { return [
|
|
4446
|
-
{ type: LocaleService }
|
|
4447
|
-
]; };
|
|
4448
|
-
LocalizedCurrencyPipe = __decorate([
|
|
4449
|
-
Pipe({
|
|
4450
|
-
name: "localizedCurrency",
|
|
4451
|
-
})
|
|
4452
|
-
], LocalizedCurrencyPipe);
|
|
4453
|
-
return LocalizedCurrencyPipe;
|
|
4454
|
-
}());
|
|
4455
|
-
|
|
4456
|
-
/**
|
|
4457
|
-
* @deprecated Should use localizedBignumberPipe instead
|
|
4458
|
-
*/
|
|
4459
|
-
var LocalizedCurrencyImpurePipe = /** @class */ (function (_super) {
|
|
4460
|
-
__extends(LocalizedCurrencyImpurePipe, _super);
|
|
4461
|
-
function LocalizedCurrencyImpurePipe() {
|
|
4462
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
4463
|
-
}
|
|
4464
|
-
LocalizedCurrencyImpurePipe.prototype.transform = function (value, options) {
|
|
4465
|
-
if (options === void 0) { options = new LocalizedCurrencyPipeOptions(); }
|
|
4466
|
-
return _super.prototype.transform.call(this, value, options);
|
|
4467
|
-
};
|
|
4468
|
-
LocalizedCurrencyImpurePipe = __decorate([
|
|
4469
|
-
Pipe({
|
|
4470
|
-
name: "localizedCurrencyImpure",
|
|
4471
|
-
pure: false,
|
|
4472
|
-
})
|
|
4473
|
-
], LocalizedCurrencyImpurePipe);
|
|
4474
|
-
return LocalizedCurrencyImpurePipe;
|
|
4475
|
-
}(LocalizedCurrencyPipe));
|
|
4476
|
-
|
|
4477
|
-
var moment$1 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
4478
|
-
var LocalizedDatePipe = /** @class */ (function () {
|
|
4479
|
-
function LocalizedDatePipe(localeService) {
|
|
4480
|
-
this.localeService = localeService;
|
|
4481
|
-
}
|
|
4482
|
-
LocalizedDatePipe.prototype.transform = function (value, format) {
|
|
4483
|
-
if (format === void 0) { format = "L LTS"; }
|
|
4484
|
-
return this.localeService.get().pipe(map(function () { return (value ? moment$1(value).format(format) : value); }));
|
|
4485
|
-
};
|
|
4486
|
-
LocalizedDatePipe.ctorParameters = function () { return [
|
|
4487
|
-
{ type: LocaleService }
|
|
4488
|
-
]; };
|
|
4489
|
-
LocalizedDatePipe = __decorate([
|
|
4490
|
-
Pipe({
|
|
4491
|
-
name: "localizedDate",
|
|
4492
|
-
})
|
|
4493
|
-
], LocalizedDatePipe);
|
|
4494
|
-
return LocalizedDatePipe;
|
|
4495
|
-
}());
|
|
4496
|
-
|
|
4497
|
-
var LocalizedDateImpurePipe = /** @class */ (function (_super) {
|
|
4498
|
-
__extends(LocalizedDateImpurePipe, _super);
|
|
4499
|
-
function LocalizedDateImpurePipe() {
|
|
4500
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
4501
|
-
}
|
|
4502
|
-
LocalizedDateImpurePipe = __decorate([
|
|
4503
|
-
Pipe({
|
|
4504
|
-
name: "localizedDateImpure",
|
|
4505
|
-
pure: false,
|
|
4506
|
-
})
|
|
4507
|
-
], LocalizedDateImpurePipe);
|
|
4508
|
-
return LocalizedDateImpurePipe;
|
|
4509
|
-
}(LocalizedDatePipe));
|
|
4510
|
-
|
|
4511
|
-
/**
|
|
4512
|
-
* @deprecated Should use localizedBignumberPipe instead
|
|
4513
|
-
*/
|
|
4514
|
-
var LocalizedNumberPipe = /** @class */ (function () {
|
|
4515
|
-
function LocalizedNumberPipe(localeService) {
|
|
4516
|
-
this.localeService = localeService;
|
|
4517
|
-
}
|
|
4518
|
-
LocalizedNumberPipe.prototype.transform = function (value, minimumFractionDigits) {
|
|
4519
|
-
return from(this.localeService.getLocale()).pipe(map(function (locale) {
|
|
4520
|
-
var numericValue = Number(value);
|
|
4521
|
-
if (!value && isNaN(numericValue))
|
|
4522
|
-
return;
|
|
4523
|
-
return new Intl.NumberFormat(locale, {
|
|
4524
|
-
minimumFractionDigits: minimumFractionDigits || 0,
|
|
4525
|
-
}).format(Number(value));
|
|
4526
|
-
}));
|
|
4527
|
-
};
|
|
4528
|
-
LocalizedNumberPipe.ctorParameters = function () { return [
|
|
4529
|
-
{ type: LocaleService }
|
|
4530
|
-
]; };
|
|
4531
|
-
LocalizedNumberPipe = __decorate([
|
|
4532
|
-
Pipe({ name: "localizedNumber" })
|
|
4533
|
-
], LocalizedNumberPipe);
|
|
4534
|
-
return LocalizedNumberPipe;
|
|
4535
|
-
}());
|
|
4536
|
-
|
|
4537
|
-
var moment$2 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
4538
|
-
var LocalizedTimePipe = /** @class */ (function () {
|
|
4539
|
-
function LocalizedTimePipe(localeService) {
|
|
4540
|
-
this.localeService = localeService;
|
|
4541
|
-
}
|
|
4542
|
-
LocalizedTimePipe.prototype.transform = function (value, format) {
|
|
4543
|
-
if (format === void 0) { format = "LTS"; }
|
|
4544
|
-
return this.localeService.get().pipe(map(function () { return (value ? moment$2(value, "HH:mm:ss").format(format) : value); }));
|
|
4545
|
-
};
|
|
4546
|
-
LocalizedTimePipe.ctorParameters = function () { return [
|
|
4547
|
-
{ type: LocaleService }
|
|
4548
|
-
]; };
|
|
4549
|
-
LocalizedTimePipe = __decorate([
|
|
4550
|
-
Pipe({
|
|
4551
|
-
name: "localizedTime",
|
|
4552
|
-
})
|
|
4553
|
-
], LocalizedTimePipe);
|
|
4554
|
-
return LocalizedTimePipe;
|
|
4555
|
-
}());
|
|
4556
|
-
|
|
4557
|
-
var LocalizedTimeImpurePipe = /** @class */ (function (_super) {
|
|
4558
|
-
__extends(LocalizedTimeImpurePipe, _super);
|
|
4559
|
-
function LocalizedTimeImpurePipe() {
|
|
4560
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
4561
|
-
}
|
|
4562
|
-
LocalizedTimeImpurePipe = __decorate([
|
|
4563
|
-
Pipe({
|
|
4564
|
-
name: "localizedTimeImpure",
|
|
4565
|
-
pure: false,
|
|
4566
|
-
})
|
|
4567
|
-
], LocalizedTimeImpurePipe);
|
|
4568
|
-
return LocalizedTimeImpurePipe;
|
|
4569
|
-
}(LocalizedTimePipe));
|
|
4570
|
-
|
|
4571
|
-
var LocaleModule = /** @class */ (function () {
|
|
4572
|
-
function LocaleModule() {
|
|
4573
|
-
}
|
|
4574
|
-
LocaleModule_1 = LocaleModule;
|
|
4575
|
-
LocaleModule.forRoot = function () {
|
|
4576
|
-
return {
|
|
4577
|
-
ngModule: LocaleModule_1,
|
|
4578
|
-
providers: [
|
|
4579
|
-
LocaleService,
|
|
4580
|
-
LocalizedCurrencyPipe,
|
|
4581
|
-
LocalizedDatePipe,
|
|
4582
|
-
LocalizedTimePipe,
|
|
4583
|
-
LocalizedNumberPipe,
|
|
4584
|
-
LocalizedCurrencyImpurePipe,
|
|
4585
|
-
LocalizedDateImpurePipe,
|
|
4586
|
-
LocalizedTimeImpurePipe,
|
|
4587
|
-
LocalizedBignumberPipe,
|
|
4588
|
-
LocalizedBignumberImpurePipe
|
|
4589
|
-
],
|
|
4590
|
-
};
|
|
4591
|
-
};
|
|
4592
|
-
LocaleModule.forChild = function () {
|
|
4593
|
-
return {
|
|
4594
|
-
ngModule: LocaleModule_1,
|
|
4595
|
-
};
|
|
4596
|
-
};
|
|
4597
|
-
var LocaleModule_1;
|
|
4598
|
-
LocaleModule = LocaleModule_1 = __decorate([
|
|
4599
|
-
NgModule({
|
|
4600
|
-
imports: [CommonModule],
|
|
4601
|
-
exports: [
|
|
4602
|
-
LocalizedCurrencyPipe,
|
|
4603
|
-
LocalizedDatePipe,
|
|
4604
|
-
LocalizedTimePipe,
|
|
4605
|
-
LocalizedNumberPipe,
|
|
4606
|
-
LocalizedCurrencyImpurePipe,
|
|
4607
|
-
LocalizedDateImpurePipe,
|
|
4608
|
-
LocalizedTimeImpurePipe,
|
|
4609
|
-
LocalizedBignumberPipe,
|
|
4610
|
-
LocalizedBignumberImpurePipe
|
|
4611
|
-
],
|
|
4612
|
-
declarations: [
|
|
4613
|
-
LocalizedCurrencyPipe,
|
|
4614
|
-
LocalizedDatePipe,
|
|
4615
|
-
LocalizedTimePipe,
|
|
4616
|
-
LocalizedNumberPipe,
|
|
4617
|
-
LocalizedCurrencyImpurePipe,
|
|
4618
|
-
LocalizedDateImpurePipe,
|
|
4619
|
-
LocalizedTimeImpurePipe,
|
|
4620
|
-
LocalizedBignumberPipe,
|
|
4621
|
-
LocalizedBignumberImpurePipe
|
|
4622
|
-
],
|
|
4623
|
-
})
|
|
4624
|
-
], LocaleModule);
|
|
4625
|
-
return LocaleModule;
|
|
4626
|
-
}());
|
|
4627
|
-
|
|
4628
|
-
var BignumberField = /** @class */ (function (_super) {
|
|
4629
|
-
__extends(BignumberField, _super);
|
|
4630
|
-
function BignumberField(config) {
|
|
4631
|
-
var _a, _b, _c;
|
|
4632
|
-
var _this = _super.call(this, config) || this;
|
|
4633
|
-
_this.allowNegative = (_a = config.allowNegative) !== null && _a !== void 0 ? _a : true;
|
|
4634
|
-
_this.numberLocaleOptions = config.numberLocaleOptions || new NumberLocaleOptions();
|
|
4635
|
-
_this.browserAutocomplete = config.browserAutocomplete;
|
|
4636
|
-
_this.precision = config.precision;
|
|
4637
|
-
_this.scale = (_b = config.scale) !== null && _b !== void 0 ? _b : 2;
|
|
4638
|
-
_this.alignTo = _this.scale ? AlignmentOptions.RIGHT : AlignmentOptions.LEFT;
|
|
4639
|
-
_this.mask = config.mask;
|
|
4640
|
-
_this.leftAddon = config.leftAddon;
|
|
4641
|
-
_this.rightAddon = config.rightAddon;
|
|
4642
|
-
_this.onBlur = config.onBlur;
|
|
4643
|
-
_this.onFocus = config.onFocus;
|
|
4644
|
-
_this.onComplete = config.onComplete;
|
|
4645
|
-
_this.onInput = config.onInput;
|
|
4646
|
-
_this.autoClear = (_c = config.autoClear) !== null && _c !== void 0 ? _c : true;
|
|
4647
|
-
return _this;
|
|
4648
|
-
}
|
|
4649
|
-
return BignumberField;
|
|
4650
|
-
}(Field));
|
|
4651
|
-
|
|
4652
|
-
var BlobField = /** @class */ (function (_super) {
|
|
4653
|
-
__extends(BlobField, _super);
|
|
4654
|
-
function BlobField(config) {
|
|
4655
|
-
var _this = _super.call(this, config) || this;
|
|
4656
|
-
_this.accept = config.accept;
|
|
4657
|
-
_this.files = config.files || [];
|
|
4658
|
-
_this.chooseLabel = config.chooseLabel;
|
|
4659
|
-
_this.removeLabel = config.removeLabel;
|
|
4660
|
-
_this.cancelLabel = config.cancelLabel;
|
|
4661
|
-
_this.successTooltip = config.successTooltip;
|
|
4662
|
-
_this.multiple = config.multiple;
|
|
4663
|
-
_this.onUploadFile = config.onUploadFile;
|
|
4664
|
-
_this.onRemoveFile = config.onRemoveFile;
|
|
4665
|
-
_this.onCancelUpload = config.onCancelUpload;
|
|
4666
|
-
_this.onDownloadFile = config.onDownloadFile;
|
|
4667
|
-
_this.showFileUploadDate = config.showFileUploadDate;
|
|
4668
|
-
return _this;
|
|
4669
|
-
}
|
|
4670
|
-
return BlobField;
|
|
4671
|
-
}(Field));
|
|
4436
|
+
return BlobField;
|
|
4437
|
+
}(Field));
|
|
4672
4438
|
|
|
4673
4439
|
var BooleanOptionsLabel = /** @class */ (function () {
|
|
4674
4440
|
function BooleanOptionsLabel(config) {
|
|
@@ -4778,15 +4544,15 @@ var NumberAlignmentOption;
|
|
|
4778
4544
|
*/
|
|
4779
4545
|
var NumberInputDirective = /** @class */ (function (_super) {
|
|
4780
4546
|
__extends(NumberInputDirective, _super);
|
|
4781
|
-
function NumberInputDirective() {
|
|
4782
|
-
var _this = _super
|
|
4547
|
+
function NumberInputDirective(_elementRef, _keyValueDiffers, localeService) {
|
|
4548
|
+
var _this = _super.call(this, null, _elementRef, _keyValueDiffers) || this;
|
|
4549
|
+
_this.localeService = localeService;
|
|
4783
4550
|
_this.precision = 15;
|
|
4784
4551
|
_this.scale = 0;
|
|
4785
|
-
_this.decimalSeparator = ",";
|
|
4786
|
-
_this.thousandsSeparator = ".";
|
|
4787
4552
|
_this.alignTo = NumberAlignmentOption.LEFT;
|
|
4788
4553
|
_this.allowNegative = true;
|
|
4789
4554
|
_this.regex = /\d/;
|
|
4555
|
+
_this.onLocaleService();
|
|
4790
4556
|
return _this;
|
|
4791
4557
|
}
|
|
4792
4558
|
NumberInputDirective_1 = NumberInputDirective;
|
|
@@ -4818,7 +4584,7 @@ var NumberInputDirective = /** @class */ (function (_super) {
|
|
|
4818
4584
|
precision: this.scale || 0,
|
|
4819
4585
|
prefix: "",
|
|
4820
4586
|
suffix: "",
|
|
4821
|
-
allowNegative: this.allowNegative
|
|
4587
|
+
allowNegative: this.allowNegative,
|
|
4822
4588
|
};
|
|
4823
4589
|
this.calculateMaxLength();
|
|
4824
4590
|
};
|
|
@@ -4848,7 +4614,23 @@ var NumberInputDirective = /** @class */ (function (_super) {
|
|
|
4848
4614
|
else
|
|
4849
4615
|
event.preventDefault();
|
|
4850
4616
|
};
|
|
4617
|
+
NumberInputDirective.prototype.onLocaleService = function () {
|
|
4618
|
+
var _this = this;
|
|
4619
|
+
this.localeService
|
|
4620
|
+
.getLocale()
|
|
4621
|
+
.pipe(first())
|
|
4622
|
+
.subscribe(function () {
|
|
4623
|
+
var _a, _b;
|
|
4624
|
+
_this.decimalSeparator = (_a = _this.decimalSeparator) !== null && _a !== void 0 ? _a : _this.localeService.getDecimalSeparator();
|
|
4625
|
+
_this.thousandsSeparator = (_b = _this.thousandsSeparator) !== null && _b !== void 0 ? _b : _this.localeService.getGroupingSeparator();
|
|
4626
|
+
});
|
|
4627
|
+
};
|
|
4851
4628
|
var NumberInputDirective_1;
|
|
4629
|
+
NumberInputDirective.ctorParameters = function () { return [
|
|
4630
|
+
{ type: ElementRef },
|
|
4631
|
+
{ type: KeyValueDiffers },
|
|
4632
|
+
{ type: LocaleService }
|
|
4633
|
+
]; };
|
|
4852
4634
|
__decorate([
|
|
4853
4635
|
Input()
|
|
4854
4636
|
], NumberInputDirective.prototype, "precision", void 0);
|
|
@@ -4912,7 +4694,7 @@ var NumberField = /** @class */ (function (_super) {
|
|
|
4912
4694
|
__extends(NumberField, _super);
|
|
4913
4695
|
function NumberField(config) {
|
|
4914
4696
|
var _this = _super.call(this, config) || this;
|
|
4915
|
-
_this.numberLocaleOptions = config.numberLocaleOptions
|
|
4697
|
+
_this.numberLocaleOptions = config.numberLocaleOptions;
|
|
4916
4698
|
_this.browserAutocomplete = config.browserAutocomplete;
|
|
4917
4699
|
_this.precision = config.precision;
|
|
4918
4700
|
_this.alignTo = config.alignTo || NumberAlignmentOption.LEFT;
|
|
@@ -4935,7 +4717,7 @@ var DecimalField = /** @class */ (function (_super) {
|
|
|
4935
4717
|
__extends(DecimalField, _super);
|
|
4936
4718
|
function DecimalField(config) {
|
|
4937
4719
|
var _this = _super.call(this, config) || this;
|
|
4938
|
-
_this.numberLocaleOptions = config.numberLocaleOptions
|
|
4720
|
+
_this.numberLocaleOptions = config.numberLocaleOptions;
|
|
4939
4721
|
_this.alignTo = config.alignTo || NumberAlignmentOption.RIGHT;
|
|
4940
4722
|
_this.scale = config.scale || config.scale === 0 ? config.scale : 2;
|
|
4941
4723
|
return _this;
|
|
@@ -4950,7 +4732,7 @@ var CurrencyField = /** @class */ (function (_super) {
|
|
|
4950
4732
|
__extends(CurrencyField, _super);
|
|
4951
4733
|
function CurrencyField(config) {
|
|
4952
4734
|
var _this = _super.call(this, config) || this;
|
|
4953
|
-
_this.numberLocaleOptions = config.numberLocaleOptions
|
|
4735
|
+
_this.numberLocaleOptions = config.numberLocaleOptions;
|
|
4954
4736
|
return _this;
|
|
4955
4737
|
}
|
|
4956
4738
|
return CurrencyField;
|
|
@@ -5743,7 +5525,7 @@ var LookupComponent = /** @class */ (function () {
|
|
|
5743
5525
|
Injectable(),
|
|
5744
5526
|
Component({
|
|
5745
5527
|
selector: "s-lookup",
|
|
5746
|
-
template: "<div [ngClass]=\"{ inputgroup: showSearch }\">\n <p-autoComplete\n #autocomplete\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [dataKey]=\"dataKey\"\n [multiple]=\"multiple\"\n [inputId]=\"id + '-autocomplete'\"\n [forceSelection]=\"autocompleteForceSelection\"\n [suggestions]=\"getLookupSuggestions()\"\n (completeMethod)=\"lazyLoadLookup($event)\"\n (onSelect)=\"onSelect.next($event)\"\n (onBlur)=\"onBlur.next($event)\"\n (onFocus)=\"onFocus.next($event)\"\n (onUnselect)=\"onUnselect.next($event)\"\n (onClear)=\"onClear.next($event)\"\n (onKeyUp)=\"onKeyUp.next($event)\"\n [field]=\"lookupDisplayField\"\n [emptyMessage]=\"lookupEmptyMessage\"\n [dropdown]=\"!showSearch\"\n [appendTo]=\"lookupAppendTo\"\n [placeholder]=\"placeholder || ' '\"\n [autoHighlight]=\"true\"\n inputStyleClass=\"mousetrap\">\n <ng-template let-item pTemplate=\"selectedItem\">\n <span\n class=\"ui-autocomplete-token-label ng-tns-c65-43 ng-star-inserted\"\n [sTooltip]=\"lookupDisplayFieldTooltip ? item[lookupDisplayField] : null\"\n tooltipPosition=\"top\">\n {{item[lookupDisplayField]}}\n </span>\n </ng-template>\n </p-autoComplete>\n <button\n *ngIf=\"showSearch\"\n pButton\n type=\"button\"\n icon=\"fa fa-search\"\n class=\"button-addon\"\n [disabled]=\"disabled\"\n (click)=\"showDialog()\">\n </button>\n</div>\n<p-dialog\n appendTo=\"body\"\n styleClass=\"s-lookup-modal\"\n [header]=\"searchTitle || 'platform.angular_components.advanced_search' | translate\"\n [(visible)]=\"dialogVisible\"\n [modal]=\"true\"\n (onHide)=\"hideDialog()\"\n [blockScroll]=\"true\"\n [focusOnShow]=\"true\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n #dialog>\n <div\n *ngIf=\"dialogVisible\"\n class=\"s-lookup-modal-container\">\n <div\n *ngIf=\"searchFields && searchFields.length\"\n class=\"filter\"\n [@collapseContent]=\"collapsed \n ? { value: 'hidden', params: { transitionParams: transitionOptions } }\n : { value: 'visible', params: { transitionParams: transitionOptions } }\"\n (@collapseContent.done)=\"onToggleDone()\">\n <form\n [formGroup]=\"formGroupDialog\"\n novalidate\n autocomplete=\"off\">\n <div\n *ngIf=\"!collapsed\"\n class=\"form-content\"\n [@childCollapseContent]=\"collapsed\n ? { value: ':leave', params: { transitionParams: transitionOptions } }\n : { value: ':enter', params: { transitionParams: transitionOptions } }\">\n <div class=\"filter-title sds-section-title\">\n {{ filterTitle || \"platform.angular_components.filters\" | translate }}\n </div>\n <div class=\"form-fields\">\n <s-dynamic-form\n [fields]=\"searchFields\"\n [form]=\"formGroupDialog\">\n </s-dynamic-form>\n </div>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button\n [id]=\"id + '-filter-button'\"\n type=\"submit\"\n [label]=\"filterLabel || 'platform.angular_components.filter' | translate\"\n (onClick)=\"search()\"\n sTooltip=\"(ALT + SHIFT + F)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n <s-button\n [id]=\"id + '-clear-button'\"\n type=\"button\"\n [label]=\"clearLabel || 'platform.angular_components.clear' | translate\"\n (onClick)=\"clear()\"\n priority=\"link\"\n sTooltip=\"(ALT + SHIFT + L)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n </div>\n </div>\n </div>\n </form>\n </div>\n <div\n *ngIf=\"searchFields && searchFields.length\"\n class=\"filter-toggle\">\n <div class=\"filter-toggle--start-border-mask\"></div>\n <button\n [id]=\"id + '-filter-toggle-button'\"\n type=\"button\"\n (click)=\"filterToggle()\">\n <span\n class=\"fa\"\n [ngClass]=\"{'fa-chevron-left': !collapsed, 'fa-chevron-right': collapsed}\"\n aria-hidden=\"true\">\n </span>\n </button>\n <div class=\"filter-toggle--end-border-mask\"></div>\n </div>\n <div\n class=\"content\"\n [ngClass]=\"{'empty-content': !searchTotalRecords && !loading}\">\n <s-empty-state\n [id]=\"id + '-empty-state'\"\n *ngIf=\"!searchTotalRecords && !loading\"\n [title]=\"searchEmptyTitle || 'platform.angular_components.no_records_found' | translate\"\n [description]=\"searchEmptyDescription\"\n iconClass=\"fa fa-search\">\n </s-empty-state>\n\n <div>\n <s-button\n *ngIf=\"showAddOption\"\n priority=\"default\"\n [label]=\"'platform.angular_components.add' | translate\"\n (onClick)=\"onAdd.emit()\">\n </s-button>\n <s-button\n *ngIf=\"showEditOption\"\n priority=\"default\"\n [label]=\"'platform.angular_components.edit' | translate\"\n [disabled]=\"selected.length !== 1\"\n (onClick)=\"onEdit.emit(this.selected[0])\">\n </s-button>\n <s-button\n *ngIf=\"showRemoveOption\"\n priority=\"default\"\n [label]=\"'platform.angular_components.remove' | translate\"\n [disabled]=\"!selected.length\"\n (onClick)=\"onRemove.emit(this.selected)\">\n </s-button>\n </div>\n\n <p-table\n [dataKey]=\"dataKey\"\n [value]=\"getGridData()\"\n [columns]=\"searchGridFields\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n sortMode=\"multiple\"\n [totalRecords]=\"searchTotalRecords\"\n [rows]=\"10\"\n [selection]=\"selected\"\n (onLazyLoad)=\"lazyLoadGrid($event)\"\n *sLoadingState=\"loading\"\n [multiSortMeta]=\"multiSortMeta\"\n [attr.data-hidden]=\"!searchTotalRecords && !loading\"\n [selectionMode]=\"multiple ? 'multiple' : 'single'\"\n (selectionChange)=\"onSelectionChange($event)\">\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col\n *ngIf=\"multiple\"\n style=\"width: 50px\" />\n <col\n *ngFor=\"let col of columns\"\n [style.width]=\"col.width\" />\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th\n *ngIf=\"multiple\"\n style=\"width: 50px\">\n <s-table-header-checkbox\n [useAllObject]=\"lookupRowProps ? false : true\"\n [rowProps]=\"lookupRowProps\">\n </s-table-header-checkbox>\n </th>\n <th\n [style.width]=\"col.width\"\n *ngFor=\"let col of columns\"\n [pSortableColumn]=\"col.name\"\n [pSortableColumnDisabled]=\"sortableColumnsDisabled?.includes(col.name)\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.label }}</span>\n <p-sortIcon\n [field]=\"col.name\"\n *ngIf=\"!sortableColumnsDisabled?.includes(col.name)\">\n </p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template\n pTemplate=\"body\"\n let-rowData\n let-columns\n let-rowIndex=\"rowIndex\">\n <tr\n sNavigation\n [pSelectableRow]=\"rowData\"\n [pSelectableRowIndex]=\"rowIndex\"\n sDoubleClick (onDoubleClick)=\"onTableRowDoubleClick(rowData)\">\n <td\n *ngIf=\"multiple\"\n style=\"width: 50px\"\n tabindex=\"0\">\n <p-tableCheckbox\n [value]=\"rowData\"\n [pSelectableRow]=\"rowData\">\n </p-tableCheckbox>\n </td>\n <td\n [style.width]=\"col['width']\"\n *ngFor=\"let col of searchGridFields\"\n [ngSwitch]=\"col.type\"\n tabindex=\"0\">\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <ng-container *ngIf=\"isBooleanValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getBooleanLabel(rowData, col.name, col.optionsLabel) }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Date'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate: col.calendarLocaleOptions?.dateFormat || \"L\" | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'LocalDateTime'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Time'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedTime: col.calendarLocaleOptions?.dateFormat || \"LTS\" | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Integer'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getIntegerMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Double'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getDoubleMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Money'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getMoneyMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Number'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getNumberMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Enum'\">\n <ng-container\n *ngIf=\"getLabelForValue(getFieldValue(rowData, col.name), col.options); else emptyTemplate\"\n >\n <span> {{ getLabelForValue(getFieldValue(rowData, col.name), col.options) }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"col.mask && col.mask()\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name))\">\n <span>{{ getFieldValue(rowData, col.name) | sMaskFormatter: col.mask() }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!(col.mask && col.mask())\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name)); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) }}</span>\n </ng-container>\n </ng-container>\n </ng-container>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span [attr.data-hidden]=\"loading\">\n {{ printRecordTotalizer() }}\n </span>\n </ng-template>\n </p-table>\n </div>\n </div>\n <p-footer>\n <s-button\n [id]=\"id + '-select-button'\"\n type=\"button\"\n [label]=\"selectLabel || 'platform.angular_components.select' | translate\"\n (onClick)=\"select()\"\n sTooltip=\"(ALT + SHIFT + S)\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [disabled]=\"!selected?.length\">\n </s-button>\n <s-button\n [id]=\"id + '-cancel-button'\"\n type=\"button\"\n priority=\"link\"\n [label]=\"cancelLabel || 'platform.angular_components.cancel' | translate\"\n (onClick)=\"hideDialog()\"\n sTooltip=\"(ALT + SHIFT + C)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n </p-footer>\n</p-dialog>\n<ng-template #emptyTemplate>\n <span [ngClass]=\"'sds-empty-value'\">\n {{ emptyFieldLabel || 'platform.angular_components.not_informed' | translate }}\n </span>\n</ng-template>\n",
|
|
5528
|
+
template: "<div [ngClass]=\"{ inputgroup: showSearch }\">\n <p-autoComplete\n #autocomplete\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [dataKey]=\"dataKey\"\n [multiple]=\"multiple\"\n [inputId]=\"id + '-autocomplete'\"\n [forceSelection]=\"autocompleteForceSelection\"\n [suggestions]=\"getLookupSuggestions()\"\n (completeMethod)=\"lazyLoadLookup($event)\"\n (onSelect)=\"onSelect.next($event)\"\n (onBlur)=\"onBlur.next($event)\"\n (onFocus)=\"onFocus.next($event)\"\n (onUnselect)=\"onUnselect.next($event)\"\n (onClear)=\"onClear.next($event)\"\n (onKeyUp)=\"onKeyUp.next($event)\"\n [field]=\"lookupDisplayField\"\n [emptyMessage]=\"lookupEmptyMessage\"\n [dropdown]=\"!showSearch\"\n [appendTo]=\"lookupAppendTo\"\n [placeholder]=\"placeholder || ' '\"\n [autoHighlight]=\"true\"\n inputStyleClass=\"mousetrap\">\n <ng-template let-item pTemplate=\"selectedItem\">\n <span\n class=\"ui-autocomplete-token-label ng-tns-c65-43 ng-star-inserted\"\n [sTooltip]=\"lookupDisplayFieldTooltip ? item[lookupDisplayField] : null\"\n tooltipPosition=\"top\">\n {{item[lookupDisplayField]}}\n </span>\n </ng-template>\n </p-autoComplete>\n <button\n *ngIf=\"showSearch\"\n pButton\n type=\"button\"\n icon=\"fa fa-search\"\n class=\"button-addon\"\n [disabled]=\"disabled\"\n (click)=\"showDialog()\">\n </button>\n</div>\n<p-dialog\n appendTo=\"body\"\n styleClass=\"s-lookup-modal\"\n [header]=\"searchTitle || 'platform.angular_components.advanced_search' | translate\"\n [(visible)]=\"dialogVisible\"\n [modal]=\"true\"\n (onHide)=\"hideDialog()\"\n [blockScroll]=\"true\"\n [focusOnShow]=\"true\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n #dialog>\n <div\n *ngIf=\"dialogVisible\"\n class=\"s-lookup-modal-container\">\n <div\n *ngIf=\"searchFields && searchFields.length\"\n class=\"filter\"\n [@collapseContent]=\"collapsed \n ? { value: 'hidden', params: { transitionParams: transitionOptions } }\n : { value: 'visible', params: { transitionParams: transitionOptions } }\"\n (@collapseContent.done)=\"onToggleDone()\">\n <form\n [formGroup]=\"formGroupDialog\"\n novalidate\n autocomplete=\"off\">\n <div\n *ngIf=\"!collapsed\"\n class=\"form-content\"\n [@childCollapseContent]=\"collapsed\n ? { value: ':leave', params: { transitionParams: transitionOptions } }\n : { value: ':enter', params: { transitionParams: transitionOptions } }\">\n <div class=\"filter-title sds-section-title\">\n {{ filterTitle || \"platform.angular_components.filters\" | translate }}\n </div>\n <div class=\"form-fields\">\n <s-dynamic-form\n [fields]=\"searchFields\"\n [form]=\"formGroupDialog\">\n </s-dynamic-form>\n </div>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button\n [id]=\"id + '-filter-button'\"\n type=\"submit\"\n [label]=\"filterLabel || 'platform.angular_components.filter' | translate\"\n (onClick)=\"search()\"\n sTooltip=\"(ALT + SHIFT + F)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n <s-button\n [id]=\"id + '-clear-button'\"\n type=\"button\"\n [label]=\"clearLabel || 'platform.angular_components.clear' | translate\"\n (onClick)=\"clear()\"\n priority=\"link\"\n sTooltip=\"(ALT + SHIFT + L)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n </div>\n </div>\n </div>\n </form>\n </div>\n <div\n *ngIf=\"searchFields && searchFields.length\"\n class=\"filter-toggle\">\n <div class=\"filter-toggle--start-border-mask\"></div>\n <button\n [id]=\"id + '-filter-toggle-button'\"\n type=\"button\"\n (click)=\"filterToggle()\">\n <span\n class=\"fa\"\n [ngClass]=\"{'fa-chevron-left': !collapsed, 'fa-chevron-right': collapsed}\"\n aria-hidden=\"true\">\n </span>\n </button>\n <div class=\"filter-toggle--end-border-mask\"></div>\n </div>\n <div\n class=\"content\"\n [ngClass]=\"{'empty-content': !searchTotalRecords && !loading}\">\n <s-empty-state\n [id]=\"id + '-empty-state'\"\n *ngIf=\"!searchTotalRecords && !loading\"\n [title]=\"searchEmptyTitle || 'platform.angular_components.no_records_found' | translate\"\n [description]=\"searchEmptyDescription\"\n iconClass=\"fa fa-search\">\n </s-empty-state>\n\n <div>\n <s-button\n *ngIf=\"showAddOption\"\n priority=\"default\"\n [label]=\"'platform.angular_components.add' | translate\"\n (onClick)=\"onAdd.emit()\">\n </s-button>\n <s-button\n *ngIf=\"showEditOption\"\n priority=\"default\"\n [label]=\"'platform.angular_components.edit' | translate\"\n [disabled]=\"selected.length !== 1\"\n (onClick)=\"onEdit.emit(this.selected[0])\">\n </s-button>\n <s-button\n *ngIf=\"showRemoveOption\"\n priority=\"default\"\n [label]=\"'platform.angular_components.remove' | translate\"\n [disabled]=\"!selected.length\"\n (onClick)=\"onRemove.emit(this.selected)\">\n </s-button>\n </div>\n\n <p-table\n [dataKey]=\"dataKey\"\n [value]=\"getGridData()\"\n [columns]=\"searchGridFields\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n sortMode=\"multiple\"\n [totalRecords]=\"searchTotalRecords\"\n [rows]=\"10\"\n [selection]=\"selected\"\n (onLazyLoad)=\"lazyLoadGrid($event)\"\n *sLoadingState=\"{ loading: true, indicator: 'logo' }\"\n [multiSortMeta]=\"multiSortMeta\"\n [attr.data-hidden]=\"!searchTotalRecords && !loading\"\n [selectionMode]=\"multiple ? 'multiple' : 'single'\"\n (selectionChange)=\"onSelectionChange($event)\">\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col\n *ngIf=\"multiple\"\n style=\"width: 50px\" />\n <col\n *ngFor=\"let col of columns\"\n [style.width]=\"col.width\" />\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th\n *ngIf=\"multiple\"\n style=\"width: 50px\">\n <s-table-header-checkbox\n [useAllObject]=\"lookupRowProps ? false : true\"\n [rowProps]=\"lookupRowProps\">\n </s-table-header-checkbox>\n </th>\n <th\n [style.width]=\"col.width\"\n *ngFor=\"let col of columns\"\n [pSortableColumn]=\"col.name\"\n [pSortableColumnDisabled]=\"sortableColumnsDisabled?.includes(col.name)\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.label }}</span>\n <p-sortIcon\n [field]=\"col.name\"\n *ngIf=\"!sortableColumnsDisabled?.includes(col.name)\">\n </p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template\n pTemplate=\"body\"\n let-rowData\n let-columns\n let-rowIndex=\"rowIndex\">\n <tr\n sNavigation\n [pSelectableRow]=\"rowData\"\n [pSelectableRowIndex]=\"rowIndex\"\n sDoubleClick (onDoubleClick)=\"onTableRowDoubleClick(rowData)\">\n <td\n *ngIf=\"multiple\"\n style=\"width: 50px\"\n tabindex=\"0\">\n <p-tableCheckbox\n [value]=\"rowData\"\n [pSelectableRow]=\"rowData\">\n </p-tableCheckbox>\n </td>\n <td\n [style.width]=\"col['width']\"\n *ngFor=\"let col of searchGridFields\"\n [ngSwitch]=\"col.type\"\n tabindex=\"0\">\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <ng-container *ngIf=\"isBooleanValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getBooleanLabel(rowData, col.name, col.optionsLabel) }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Date'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate: col.calendarLocaleOptions?.dateFormat || \"L\" | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'LocalDateTime'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Time'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedTime: col.calendarLocaleOptions?.dateFormat || \"LTS\" | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Integer'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getIntegerMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Double'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getDoubleMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Money'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getMoneyMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Number'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getNumberMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Enum'\">\n <ng-container\n *ngIf=\"getLabelForValue(getFieldValue(rowData, col.name), col.options); else emptyTemplate\"\n >\n <span> {{ getLabelForValue(getFieldValue(rowData, col.name), col.options) }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"col.mask && col.mask()\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name))\">\n <span>{{ getFieldValue(rowData, col.name) | sMaskFormatter: col.mask() }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!(col.mask && col.mask())\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name)); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) }}</span>\n </ng-container>\n </ng-container>\n </ng-container>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span [attr.data-hidden]=\"loading\">\n {{ printRecordTotalizer() }}\n </span>\n </ng-template>\n </p-table>\n </div>\n </div>\n <p-footer>\n <s-button\n [id]=\"id + '-select-button'\"\n type=\"button\"\n [label]=\"selectLabel || 'platform.angular_components.select' | translate\"\n (onClick)=\"select()\"\n sTooltip=\"(ALT + SHIFT + S)\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [disabled]=\"!selected?.length\">\n </s-button>\n <s-button\n [id]=\"id + '-cancel-button'\"\n type=\"button\"\n priority=\"link\"\n [label]=\"cancelLabel || 'platform.angular_components.cancel' | translate\"\n (onClick)=\"hideDialog()\"\n sTooltip=\"(ALT + SHIFT + C)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n </p-footer>\n</p-dialog>\n<ng-template #emptyTemplate>\n <span [ngClass]=\"'sds-empty-value'\">\n {{ emptyFieldLabel || 'platform.angular_components.not_informed' | translate }}\n </span>\n</ng-template>\n",
|
|
5747
5529
|
providers: [
|
|
5748
5530
|
{
|
|
5749
5531
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -6271,99 +6053,371 @@ var ProgressBarComponent = /** @class */ (function () {
|
|
|
6271
6053
|
return ProgressBarComponent;
|
|
6272
6054
|
}());
|
|
6273
6055
|
|
|
6274
|
-
var ProgressBarDeterminateComponent = /** @class */ (function () {
|
|
6275
|
-
function ProgressBarDeterminateComponent(localeService) {
|
|
6056
|
+
var ProgressBarDeterminateComponent = /** @class */ (function () {
|
|
6057
|
+
function ProgressBarDeterminateComponent(localeService) {
|
|
6058
|
+
this.localeService = localeService;
|
|
6059
|
+
this.showValue = true;
|
|
6060
|
+
}
|
|
6061
|
+
ProgressBarDeterminateComponent.prototype.ngOnInit = function () {
|
|
6062
|
+
this.validateValues();
|
|
6063
|
+
this.onGetLocale();
|
|
6064
|
+
};
|
|
6065
|
+
ProgressBarDeterminateComponent.prototype.onGetLocale = function () {
|
|
6066
|
+
var _this = this;
|
|
6067
|
+
this.localeService.getLocale().subscribe({
|
|
6068
|
+
next: function (locale) {
|
|
6069
|
+
_this.numberFormat = new Intl.NumberFormat(locale !== null && locale !== void 0 ? locale : "pt-BR", _this.numberFormatOptions);
|
|
6070
|
+
},
|
|
6071
|
+
error: function () {
|
|
6072
|
+
_this.numberFormat = new Intl.NumberFormat("pt-BR", _this.numberFormatOptions);
|
|
6073
|
+
},
|
|
6074
|
+
});
|
|
6075
|
+
};
|
|
6076
|
+
ProgressBarDeterminateComponent.prototype.validateValues = function () {
|
|
6077
|
+
if (this.value < 0 || this.value > 100) {
|
|
6078
|
+
throw new Error("Invalid value for value");
|
|
6079
|
+
}
|
|
6080
|
+
if (this.targetValue < 0 || this.targetValue > 100) {
|
|
6081
|
+
throw new Error("Invalid value for targetValue");
|
|
6082
|
+
}
|
|
6083
|
+
};
|
|
6084
|
+
ProgressBarDeterminateComponent.ctorParameters = function () { return [
|
|
6085
|
+
{ type: LocaleService }
|
|
6086
|
+
]; };
|
|
6087
|
+
__decorate([
|
|
6088
|
+
Input()
|
|
6089
|
+
], ProgressBarDeterminateComponent.prototype, "value", void 0);
|
|
6090
|
+
__decorate([
|
|
6091
|
+
Input()
|
|
6092
|
+
], ProgressBarDeterminateComponent.prototype, "numberFormatOptions", void 0);
|
|
6093
|
+
__decorate([
|
|
6094
|
+
Input()
|
|
6095
|
+
], ProgressBarDeterminateComponent.prototype, "targetValue", void 0);
|
|
6096
|
+
__decorate([
|
|
6097
|
+
Input()
|
|
6098
|
+
], ProgressBarDeterminateComponent.prototype, "targetLabel", void 0);
|
|
6099
|
+
__decorate([
|
|
6100
|
+
Input()
|
|
6101
|
+
], ProgressBarDeterminateComponent.prototype, "activeColor", void 0);
|
|
6102
|
+
__decorate([
|
|
6103
|
+
Input()
|
|
6104
|
+
], ProgressBarDeterminateComponent.prototype, "showValue", void 0);
|
|
6105
|
+
ProgressBarDeterminateComponent = __decorate([
|
|
6106
|
+
Component({
|
|
6107
|
+
selector: "s-progressbar-determinate",
|
|
6108
|
+
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",
|
|
6109
|
+
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}"]
|
|
6110
|
+
})
|
|
6111
|
+
], ProgressBarDeterminateComponent);
|
|
6112
|
+
return ProgressBarDeterminateComponent;
|
|
6113
|
+
}());
|
|
6114
|
+
|
|
6115
|
+
var ProgressBarIndeterminateComponent = /** @class */ (function () {
|
|
6116
|
+
function ProgressBarIndeterminateComponent() {
|
|
6117
|
+
}
|
|
6118
|
+
__decorate([
|
|
6119
|
+
Input()
|
|
6120
|
+
], ProgressBarIndeterminateComponent.prototype, "activeColor", void 0);
|
|
6121
|
+
__decorate([
|
|
6122
|
+
Input()
|
|
6123
|
+
], ProgressBarIndeterminateComponent.prototype, "label", void 0);
|
|
6124
|
+
ProgressBarIndeterminateComponent = __decorate([
|
|
6125
|
+
Component({
|
|
6126
|
+
selector: "s-progressbar-indeterminate",
|
|
6127
|
+
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",
|
|
6128
|
+
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%)}}"]
|
|
6129
|
+
})
|
|
6130
|
+
], ProgressBarIndeterminateComponent);
|
|
6131
|
+
return ProgressBarIndeterminateComponent;
|
|
6132
|
+
}());
|
|
6133
|
+
|
|
6134
|
+
var ProgressBarModule = /** @class */ (function () {
|
|
6135
|
+
function ProgressBarModule() {
|
|
6136
|
+
}
|
|
6137
|
+
ProgressBarModule = __decorate([
|
|
6138
|
+
NgModule({
|
|
6139
|
+
imports: [CommonModule],
|
|
6140
|
+
declarations: [
|
|
6141
|
+
ProgressBarComponent,
|
|
6142
|
+
ProgressBarDeterminateComponent,
|
|
6143
|
+
ProgressBarIndeterminateComponent,
|
|
6144
|
+
],
|
|
6145
|
+
exports: [ProgressBarComponent],
|
|
6146
|
+
})
|
|
6147
|
+
], ProgressBarModule);
|
|
6148
|
+
return ProgressBarModule;
|
|
6149
|
+
}());
|
|
6150
|
+
|
|
6151
|
+
var LocalizedBignumberPipe = /** @class */ (function () {
|
|
6152
|
+
function LocalizedBignumberPipe(localeService) {
|
|
6153
|
+
this.localeService = localeService;
|
|
6154
|
+
}
|
|
6155
|
+
LocalizedBignumberPipe.prototype.transform = function (value, options) {
|
|
6156
|
+
return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);
|
|
6157
|
+
};
|
|
6158
|
+
LocalizedBignumberPipe.prototype.applyMask = function (value, options) {
|
|
6159
|
+
return this.localeService.get().pipe(map(function (localeConfig) {
|
|
6160
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
6161
|
+
var configs = {
|
|
6162
|
+
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$",
|
|
6163
|
+
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 : ".",
|
|
6164
|
+
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 : ",",
|
|
6165
|
+
scale: (_k = options === null || options === void 0 ? void 0 : options.scale) !== null && _k !== void 0 ? _k : 2,
|
|
6166
|
+
allowNegative: (_l = options === null || options === void 0 ? void 0 : options.allowNegative) !== null && _l !== void 0 ? _l : true
|
|
6167
|
+
};
|
|
6168
|
+
var isNumber = !(new BigNumber(value).isNaN());
|
|
6169
|
+
return applyMask(value, configs, isNumber);
|
|
6170
|
+
}));
|
|
6171
|
+
};
|
|
6172
|
+
LocalizedBignumberPipe.ctorParameters = function () { return [
|
|
6173
|
+
{ type: LocaleService }
|
|
6174
|
+
]; };
|
|
6175
|
+
LocalizedBignumberPipe = __decorate([
|
|
6176
|
+
Pipe({
|
|
6177
|
+
name: "localizedBignumber",
|
|
6178
|
+
})
|
|
6179
|
+
], LocalizedBignumberPipe);
|
|
6180
|
+
return LocalizedBignumberPipe;
|
|
6181
|
+
}());
|
|
6182
|
+
|
|
6183
|
+
var LocalizedBignumberImpurePipe = /** @class */ (function (_super) {
|
|
6184
|
+
__extends(LocalizedBignumberImpurePipe, _super);
|
|
6185
|
+
function LocalizedBignumberImpurePipe() {
|
|
6186
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
6187
|
+
}
|
|
6188
|
+
LocalizedBignumberImpurePipe.prototype.transform = function (value, options) {
|
|
6189
|
+
return _super.prototype.transform.call(this, value, options);
|
|
6190
|
+
};
|
|
6191
|
+
LocalizedBignumberImpurePipe = __decorate([
|
|
6192
|
+
Pipe({
|
|
6193
|
+
name: "localizedBignumberImpure",
|
|
6194
|
+
pure: false,
|
|
6195
|
+
})
|
|
6196
|
+
], LocalizedBignumberImpurePipe);
|
|
6197
|
+
return LocalizedBignumberImpurePipe;
|
|
6198
|
+
}(LocalizedBignumberPipe));
|
|
6199
|
+
|
|
6200
|
+
var LocalizedCurrencyPipeOptions = /** @class */ (function (_super) {
|
|
6201
|
+
__extends(LocalizedCurrencyPipeOptions, _super);
|
|
6202
|
+
function LocalizedCurrencyPipeOptions(config) {
|
|
6203
|
+
if (config === void 0) { config = {}; }
|
|
6204
|
+
var _this = _super.call(this, config) || this;
|
|
6205
|
+
_this.scale = 2;
|
|
6206
|
+
return _this;
|
|
6207
|
+
}
|
|
6208
|
+
return LocalizedCurrencyPipeOptions;
|
|
6209
|
+
}(NumberLocaleOptions));
|
|
6210
|
+
/**
|
|
6211
|
+
* @deprecated Should use localizedBignumberPipe instead
|
|
6212
|
+
*/
|
|
6213
|
+
var LocalizedCurrencyPipe = /** @class */ (function () {
|
|
6214
|
+
function LocalizedCurrencyPipe(localeService) {
|
|
6215
|
+
this.localeService = localeService;
|
|
6216
|
+
}
|
|
6217
|
+
LocalizedCurrencyPipe.prototype.transform = function (value, options) {
|
|
6218
|
+
if (!options) {
|
|
6219
|
+
options = new LocalizedCurrencyPipeOptions();
|
|
6220
|
+
}
|
|
6221
|
+
return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);
|
|
6222
|
+
};
|
|
6223
|
+
LocalizedCurrencyPipe.prototype.applyMask = function (value, options) {
|
|
6224
|
+
return this.localeService.get().pipe(map(function (localeConfig) {
|
|
6225
|
+
var config = __assign(__assign({}, localeConfig.number), options);
|
|
6226
|
+
var scale = config.scale, currencySymbol = config.currencySymbol, thousandsSeparator = config.thousandsSeparator, decimalSeparator = config.decimalSeparator;
|
|
6227
|
+
var rawValue = Number(value).toFixed(scale);
|
|
6228
|
+
var onlyNumbers = rawValue.replace(/[^0-9]/g, "");
|
|
6229
|
+
var integerPart = onlyNumbers
|
|
6230
|
+
.slice(0, onlyNumbers.length - scale)
|
|
6231
|
+
.replace(/^0*/g, "")
|
|
6232
|
+
.replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSeparator) || "0";
|
|
6233
|
+
var decimalPart = onlyNumbers.slice(onlyNumbers.length - scale);
|
|
6234
|
+
var newValue = scale ? integerPart + decimalSeparator + decimalPart : integerPart;
|
|
6235
|
+
var isZero = !Number(onlyNumbers);
|
|
6236
|
+
var operator = rawValue.includes("-") && !isZero ? "-" : "";
|
|
6237
|
+
return "" + operator + currencySymbol + newValue;
|
|
6238
|
+
}));
|
|
6239
|
+
};
|
|
6240
|
+
LocalizedCurrencyPipe.ctorParameters = function () { return [
|
|
6241
|
+
{ type: LocaleService }
|
|
6242
|
+
]; };
|
|
6243
|
+
LocalizedCurrencyPipe = __decorate([
|
|
6244
|
+
Pipe({
|
|
6245
|
+
name: "localizedCurrency",
|
|
6246
|
+
})
|
|
6247
|
+
], LocalizedCurrencyPipe);
|
|
6248
|
+
return LocalizedCurrencyPipe;
|
|
6249
|
+
}());
|
|
6250
|
+
|
|
6251
|
+
/**
|
|
6252
|
+
* @deprecated Should use localizedBignumberPipe instead
|
|
6253
|
+
*/
|
|
6254
|
+
var LocalizedCurrencyImpurePipe = /** @class */ (function (_super) {
|
|
6255
|
+
__extends(LocalizedCurrencyImpurePipe, _super);
|
|
6256
|
+
function LocalizedCurrencyImpurePipe() {
|
|
6257
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
6258
|
+
}
|
|
6259
|
+
LocalizedCurrencyImpurePipe.prototype.transform = function (value, options) {
|
|
6260
|
+
if (options === void 0) { options = new LocalizedCurrencyPipeOptions(); }
|
|
6261
|
+
return _super.prototype.transform.call(this, value, options);
|
|
6262
|
+
};
|
|
6263
|
+
LocalizedCurrencyImpurePipe = __decorate([
|
|
6264
|
+
Pipe({
|
|
6265
|
+
name: "localizedCurrencyImpure",
|
|
6266
|
+
pure: false,
|
|
6267
|
+
})
|
|
6268
|
+
], LocalizedCurrencyImpurePipe);
|
|
6269
|
+
return LocalizedCurrencyImpurePipe;
|
|
6270
|
+
}(LocalizedCurrencyPipe));
|
|
6271
|
+
|
|
6272
|
+
var moment$1 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
6273
|
+
var LocalizedDatePipe = /** @class */ (function () {
|
|
6274
|
+
function LocalizedDatePipe(localeService) {
|
|
6275
|
+
this.localeService = localeService;
|
|
6276
|
+
}
|
|
6277
|
+
LocalizedDatePipe.prototype.transform = function (value, format) {
|
|
6278
|
+
if (format === void 0) { format = "L LTS"; }
|
|
6279
|
+
return this.localeService.get().pipe(map(function () { return (value ? moment$1(value).format(format) : value); }));
|
|
6280
|
+
};
|
|
6281
|
+
LocalizedDatePipe.ctorParameters = function () { return [
|
|
6282
|
+
{ type: LocaleService }
|
|
6283
|
+
]; };
|
|
6284
|
+
LocalizedDatePipe = __decorate([
|
|
6285
|
+
Pipe({
|
|
6286
|
+
name: "localizedDate",
|
|
6287
|
+
})
|
|
6288
|
+
], LocalizedDatePipe);
|
|
6289
|
+
return LocalizedDatePipe;
|
|
6290
|
+
}());
|
|
6291
|
+
|
|
6292
|
+
var LocalizedDateImpurePipe = /** @class */ (function (_super) {
|
|
6293
|
+
__extends(LocalizedDateImpurePipe, _super);
|
|
6294
|
+
function LocalizedDateImpurePipe() {
|
|
6295
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
6296
|
+
}
|
|
6297
|
+
LocalizedDateImpurePipe = __decorate([
|
|
6298
|
+
Pipe({
|
|
6299
|
+
name: "localizedDateImpure",
|
|
6300
|
+
pure: false,
|
|
6301
|
+
})
|
|
6302
|
+
], LocalizedDateImpurePipe);
|
|
6303
|
+
return LocalizedDateImpurePipe;
|
|
6304
|
+
}(LocalizedDatePipe));
|
|
6305
|
+
|
|
6306
|
+
/**
|
|
6307
|
+
* @deprecated Should use localizedBignumberPipe instead
|
|
6308
|
+
*/
|
|
6309
|
+
var LocalizedNumberPipe = /** @class */ (function () {
|
|
6310
|
+
function LocalizedNumberPipe(localeService) {
|
|
6276
6311
|
this.localeService = localeService;
|
|
6277
|
-
this.showValue = true;
|
|
6278
6312
|
}
|
|
6279
|
-
|
|
6280
|
-
this.
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
},
|
|
6289
|
-
error: function () {
|
|
6290
|
-
_this.numberFormat = new Intl.NumberFormat("pt-BR", _this.numberFormatOptions);
|
|
6291
|
-
},
|
|
6292
|
-
});
|
|
6313
|
+
LocalizedNumberPipe.prototype.transform = function (value, minimumFractionDigits) {
|
|
6314
|
+
return from(this.localeService.getLocale()).pipe(map(function (locale) {
|
|
6315
|
+
var numericValue = Number(value);
|
|
6316
|
+
if (!value && isNaN(numericValue))
|
|
6317
|
+
return;
|
|
6318
|
+
return new Intl.NumberFormat(locale, {
|
|
6319
|
+
minimumFractionDigits: minimumFractionDigits || 0,
|
|
6320
|
+
}).format(Number(value));
|
|
6321
|
+
}));
|
|
6293
6322
|
};
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6323
|
+
LocalizedNumberPipe.ctorParameters = function () { return [
|
|
6324
|
+
{ type: LocaleService }
|
|
6325
|
+
]; };
|
|
6326
|
+
LocalizedNumberPipe = __decorate([
|
|
6327
|
+
Pipe({ name: "localizedNumber" })
|
|
6328
|
+
], LocalizedNumberPipe);
|
|
6329
|
+
return LocalizedNumberPipe;
|
|
6330
|
+
}());
|
|
6331
|
+
|
|
6332
|
+
var moment$2 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
6333
|
+
var LocalizedTimePipe = /** @class */ (function () {
|
|
6334
|
+
function LocalizedTimePipe(localeService) {
|
|
6335
|
+
this.localeService = localeService;
|
|
6336
|
+
}
|
|
6337
|
+
LocalizedTimePipe.prototype.transform = function (value, format) {
|
|
6338
|
+
if (format === void 0) { format = "LTS"; }
|
|
6339
|
+
return this.localeService.get().pipe(map(function () { return (value ? moment$2(value, "HH:mm:ss").format(format) : value); }));
|
|
6301
6340
|
};
|
|
6302
|
-
|
|
6341
|
+
LocalizedTimePipe.ctorParameters = function () { return [
|
|
6303
6342
|
{ type: LocaleService }
|
|
6304
6343
|
]; };
|
|
6305
|
-
__decorate([
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
__decorate([
|
|
6309
|
-
Input()
|
|
6310
|
-
], ProgressBarDeterminateComponent.prototype, "numberFormatOptions", void 0);
|
|
6311
|
-
__decorate([
|
|
6312
|
-
Input()
|
|
6313
|
-
], ProgressBarDeterminateComponent.prototype, "targetValue", void 0);
|
|
6314
|
-
__decorate([
|
|
6315
|
-
Input()
|
|
6316
|
-
], ProgressBarDeterminateComponent.prototype, "targetLabel", void 0);
|
|
6317
|
-
__decorate([
|
|
6318
|
-
Input()
|
|
6319
|
-
], ProgressBarDeterminateComponent.prototype, "activeColor", void 0);
|
|
6320
|
-
__decorate([
|
|
6321
|
-
Input()
|
|
6322
|
-
], ProgressBarDeterminateComponent.prototype, "showValue", void 0);
|
|
6323
|
-
ProgressBarDeterminateComponent = __decorate([
|
|
6324
|
-
Component({
|
|
6325
|
-
selector: "s-progressbar-determinate",
|
|
6326
|
-
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",
|
|
6327
|
-
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}"]
|
|
6344
|
+
LocalizedTimePipe = __decorate([
|
|
6345
|
+
Pipe({
|
|
6346
|
+
name: "localizedTime",
|
|
6328
6347
|
})
|
|
6329
|
-
],
|
|
6330
|
-
return
|
|
6348
|
+
], LocalizedTimePipe);
|
|
6349
|
+
return LocalizedTimePipe;
|
|
6331
6350
|
}());
|
|
6332
6351
|
|
|
6333
|
-
var
|
|
6334
|
-
|
|
6352
|
+
var LocalizedTimeImpurePipe = /** @class */ (function (_super) {
|
|
6353
|
+
__extends(LocalizedTimeImpurePipe, _super);
|
|
6354
|
+
function LocalizedTimeImpurePipe() {
|
|
6355
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
6335
6356
|
}
|
|
6336
|
-
__decorate([
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
Input()
|
|
6341
|
-
], ProgressBarIndeterminateComponent.prototype, "label", void 0);
|
|
6342
|
-
ProgressBarIndeterminateComponent = __decorate([
|
|
6343
|
-
Component({
|
|
6344
|
-
selector: "s-progressbar-indeterminate",
|
|
6345
|
-
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",
|
|
6346
|
-
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%)}}"]
|
|
6357
|
+
LocalizedTimeImpurePipe = __decorate([
|
|
6358
|
+
Pipe({
|
|
6359
|
+
name: "localizedTimeImpure",
|
|
6360
|
+
pure: false,
|
|
6347
6361
|
})
|
|
6348
|
-
],
|
|
6349
|
-
return
|
|
6350
|
-
}());
|
|
6362
|
+
], LocalizedTimeImpurePipe);
|
|
6363
|
+
return LocalizedTimeImpurePipe;
|
|
6364
|
+
}(LocalizedTimePipe));
|
|
6351
6365
|
|
|
6352
|
-
var
|
|
6353
|
-
function
|
|
6366
|
+
var LocaleModule = /** @class */ (function () {
|
|
6367
|
+
function LocaleModule() {
|
|
6354
6368
|
}
|
|
6355
|
-
|
|
6369
|
+
LocaleModule_1 = LocaleModule;
|
|
6370
|
+
LocaleModule.forRoot = function () {
|
|
6371
|
+
return {
|
|
6372
|
+
ngModule: LocaleModule_1,
|
|
6373
|
+
providers: [
|
|
6374
|
+
LocaleService,
|
|
6375
|
+
LocalizedCurrencyPipe,
|
|
6376
|
+
LocalizedDatePipe,
|
|
6377
|
+
LocalizedTimePipe,
|
|
6378
|
+
LocalizedNumberPipe,
|
|
6379
|
+
LocalizedCurrencyImpurePipe,
|
|
6380
|
+
LocalizedDateImpurePipe,
|
|
6381
|
+
LocalizedTimeImpurePipe,
|
|
6382
|
+
LocalizedBignumberPipe,
|
|
6383
|
+
LocalizedBignumberImpurePipe
|
|
6384
|
+
],
|
|
6385
|
+
};
|
|
6386
|
+
};
|
|
6387
|
+
LocaleModule.forChild = function () {
|
|
6388
|
+
return {
|
|
6389
|
+
ngModule: LocaleModule_1,
|
|
6390
|
+
};
|
|
6391
|
+
};
|
|
6392
|
+
var LocaleModule_1;
|
|
6393
|
+
LocaleModule = LocaleModule_1 = __decorate([
|
|
6356
6394
|
NgModule({
|
|
6357
6395
|
imports: [CommonModule],
|
|
6396
|
+
exports: [
|
|
6397
|
+
LocalizedCurrencyPipe,
|
|
6398
|
+
LocalizedDatePipe,
|
|
6399
|
+
LocalizedTimePipe,
|
|
6400
|
+
LocalizedNumberPipe,
|
|
6401
|
+
LocalizedCurrencyImpurePipe,
|
|
6402
|
+
LocalizedDateImpurePipe,
|
|
6403
|
+
LocalizedTimeImpurePipe,
|
|
6404
|
+
LocalizedBignumberPipe,
|
|
6405
|
+
LocalizedBignumberImpurePipe
|
|
6406
|
+
],
|
|
6358
6407
|
declarations: [
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6408
|
+
LocalizedCurrencyPipe,
|
|
6409
|
+
LocalizedDatePipe,
|
|
6410
|
+
LocalizedTimePipe,
|
|
6411
|
+
LocalizedNumberPipe,
|
|
6412
|
+
LocalizedCurrencyImpurePipe,
|
|
6413
|
+
LocalizedDateImpurePipe,
|
|
6414
|
+
LocalizedTimeImpurePipe,
|
|
6415
|
+
LocalizedBignumberPipe,
|
|
6416
|
+
LocalizedBignumberImpurePipe
|
|
6362
6417
|
],
|
|
6363
|
-
exports: [ProgressBarComponent],
|
|
6364
6418
|
})
|
|
6365
|
-
],
|
|
6366
|
-
return
|
|
6419
|
+
], LocaleModule);
|
|
6420
|
+
return LocaleModule;
|
|
6367
6421
|
}());
|
|
6368
6422
|
|
|
6369
6423
|
var Breakpoints = {
|
|
@@ -7303,17 +7357,26 @@ var LoadingStateModule = /** @class */ (function () {
|
|
|
7303
7357
|
}());
|
|
7304
7358
|
|
|
7305
7359
|
var LocalizedNumberInputDirective = /** @class */ (function () {
|
|
7306
|
-
function LocalizedNumberInputDirective() {
|
|
7307
|
-
this.
|
|
7308
|
-
this.thousandsSeparator = ".";
|
|
7360
|
+
function LocalizedNumberInputDirective(localeService) {
|
|
7361
|
+
this.localeService = localeService;
|
|
7309
7362
|
this.precision = 2;
|
|
7310
7363
|
}
|
|
7311
7364
|
LocalizedNumberInputDirective_1 = LocalizedNumberInputDirective;
|
|
7312
7365
|
LocalizedNumberInputDirective.prototype.ngOnInit = function () {
|
|
7366
|
+
var _this = this;
|
|
7313
7367
|
// Gera a expressão regular para validar números de acordo com os separadores decimais e de milhares.
|
|
7314
7368
|
// 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
|
|
7315
7369
|
// tslint:disable-next-line: max-line-length
|
|
7316
7370
|
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 + "}))?$";
|
|
7371
|
+
this.localeService
|
|
7372
|
+
.getLocale()
|
|
7373
|
+
.pipe(first())
|
|
7374
|
+
.subscribe(function () {
|
|
7375
|
+
var _a, _b;
|
|
7376
|
+
_this.decimalSeparator = (_a = _this.decimalSeparator) !== null && _a !== void 0 ? _a : _this.localeService.getDecimalSeparator();
|
|
7377
|
+
_this.thousandsSeparator = (_b = _this.thousandsSeparator) !== null && _b !== void 0 ? _b : _this.localeService.getGroupingSeparator();
|
|
7378
|
+
_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 + "}))?$";
|
|
7379
|
+
});
|
|
7317
7380
|
};
|
|
7318
7381
|
LocalizedNumberInputDirective.prototype.validate = function (control) {
|
|
7319
7382
|
if (control.value && !String(control.value).match(new RegExp(this.numberRegex, "g")))
|
|
@@ -7321,6 +7384,9 @@ var LocalizedNumberInputDirective = /** @class */ (function () {
|
|
|
7321
7384
|
return null;
|
|
7322
7385
|
};
|
|
7323
7386
|
var LocalizedNumberInputDirective_1;
|
|
7387
|
+
LocalizedNumberInputDirective.ctorParameters = function () { return [
|
|
7388
|
+
{ type: LocaleService }
|
|
7389
|
+
]; };
|
|
7324
7390
|
__decorate([
|
|
7325
7391
|
Input()
|
|
7326
7392
|
], LocalizedNumberInputDirective.prototype, "decimalSeparator", void 0);
|
|
@@ -8969,8 +9035,9 @@ var AutocompleteFieldComponent = /** @class */ (function () {
|
|
|
8969
9035
|
|
|
8970
9036
|
var BignumberFieldComponent = /** @class */ (function (_super) {
|
|
8971
9037
|
__extends(BignumberFieldComponent, _super);
|
|
8972
|
-
function BignumberFieldComponent() {
|
|
8973
|
-
var _this = _super
|
|
9038
|
+
function BignumberFieldComponent(localeService) {
|
|
9039
|
+
var _this = _super.call(this) || this;
|
|
9040
|
+
_this.localeService = localeService;
|
|
8974
9041
|
_this.onInput = new EventEmitter();
|
|
8975
9042
|
_this.onFocus = new EventEmitter();
|
|
8976
9043
|
_this.onComplete = new EventEmitter();
|
|
@@ -8979,23 +9046,18 @@ var BignumberFieldComponent = /** @class */ (function (_super) {
|
|
|
8979
9046
|
}
|
|
8980
9047
|
BignumberFieldComponent.prototype.ngOnInit = function () {
|
|
8981
9048
|
var _this = this;
|
|
8982
|
-
this.
|
|
8983
|
-
|
|
8984
|
-
.subscribe(function (event) {
|
|
9049
|
+
this.onLocaleService();
|
|
9050
|
+
this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
|
|
8985
9051
|
if (_this.field.onFocus) {
|
|
8986
9052
|
_this.field.onFocus(event);
|
|
8987
9053
|
}
|
|
8988
9054
|
});
|
|
8989
|
-
this.onInput
|
|
8990
|
-
.pipe(takeUntil(this.ngUnsubscribe))
|
|
8991
|
-
.subscribe(function (event) {
|
|
9055
|
+
this.onInput.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
|
|
8992
9056
|
if (_this.field.onInput) {
|
|
8993
9057
|
_this.field.onInput(event);
|
|
8994
9058
|
}
|
|
8995
9059
|
});
|
|
8996
|
-
this.onComplete
|
|
8997
|
-
.pipe(takeUntil(this.ngUnsubscribe))
|
|
8998
|
-
.subscribe(function (event) {
|
|
9060
|
+
this.onComplete.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
|
|
8999
9061
|
if (_this.field.onComplete) {
|
|
9000
9062
|
_this.field.onComplete(event);
|
|
9001
9063
|
}
|
|
@@ -9012,6 +9074,37 @@ var BignumberFieldComponent = /** @class */ (function (_super) {
|
|
|
9012
9074
|
enumerable: true,
|
|
9013
9075
|
configurable: true
|
|
9014
9076
|
});
|
|
9077
|
+
BignumberFieldComponent.prototype.onLocaleService = function () {
|
|
9078
|
+
var _this = this;
|
|
9079
|
+
this.localeService
|
|
9080
|
+
.getLocale()
|
|
9081
|
+
.pipe(first())
|
|
9082
|
+
.subscribe({
|
|
9083
|
+
next: function () {
|
|
9084
|
+
var _a, _b, _c;
|
|
9085
|
+
if (!((_a = _this.field.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator)) {
|
|
9086
|
+
_this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { decimalSeparator: _this.localeService.getDecimalSeparator() });
|
|
9087
|
+
}
|
|
9088
|
+
if (!((_b = _this.field.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator)) {
|
|
9089
|
+
_this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { thousandsSeparator: _this.localeService.getGroupingSeparator() });
|
|
9090
|
+
}
|
|
9091
|
+
if (!((_c = _this.field.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol)) {
|
|
9092
|
+
_this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { currencySymbol: _this.field.type === FieldType.Integer || _this.field.type === FieldType.Double ? "" : "R$" });
|
|
9093
|
+
}
|
|
9094
|
+
},
|
|
9095
|
+
error: function () {
|
|
9096
|
+
var _a;
|
|
9097
|
+
return (_this.field.numberLocaleOptions = (_a = _this.field.numberLocaleOptions) !== null && _a !== void 0 ? _a : {
|
|
9098
|
+
thousandsSeparator: ".",
|
|
9099
|
+
decimalSeparator: ",",
|
|
9100
|
+
currencySymbol: _this.field.type === FieldType.Integer || _this.field.type === FieldType.Double ? "" : "R$",
|
|
9101
|
+
});
|
|
9102
|
+
},
|
|
9103
|
+
});
|
|
9104
|
+
};
|
|
9105
|
+
BignumberFieldComponent.ctorParameters = function () { return [
|
|
9106
|
+
{ type: LocaleService }
|
|
9107
|
+
]; };
|
|
9015
9108
|
__decorate([
|
|
9016
9109
|
Input()
|
|
9017
9110
|
], BignumberFieldComponent.prototype, "field", void 0);
|
|
@@ -9225,9 +9318,45 @@ var CountryPhonePickerFieldComponent = /** @class */ (function () {
|
|
|
9225
9318
|
*/
|
|
9226
9319
|
var CurrencyFieldComponent = /** @class */ (function (_super) {
|
|
9227
9320
|
__extends(CurrencyFieldComponent, _super);
|
|
9228
|
-
function CurrencyFieldComponent() {
|
|
9229
|
-
|
|
9321
|
+
function CurrencyFieldComponent(localeService) {
|
|
9322
|
+
var _this = _super.call(this) || this;
|
|
9323
|
+
_this.localeService = localeService;
|
|
9324
|
+
return _this;
|
|
9230
9325
|
}
|
|
9326
|
+
CurrencyFieldComponent.prototype.ngOnInit = function () {
|
|
9327
|
+
this.onLocaleService();
|
|
9328
|
+
};
|
|
9329
|
+
CurrencyFieldComponent.prototype.onLocaleService = function () {
|
|
9330
|
+
var _this = this;
|
|
9331
|
+
this.localeService
|
|
9332
|
+
.getLocale()
|
|
9333
|
+
.pipe(first())
|
|
9334
|
+
.subscribe({
|
|
9335
|
+
next: function () {
|
|
9336
|
+
var _a, _b, _c;
|
|
9337
|
+
if (!((_a = _this.field.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator)) {
|
|
9338
|
+
_this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { decimalSeparator: _this.localeService.getDecimalSeparator() });
|
|
9339
|
+
}
|
|
9340
|
+
if (!((_b = _this.field.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator)) {
|
|
9341
|
+
_this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { thousandsSeparator: _this.localeService.getGroupingSeparator() });
|
|
9342
|
+
}
|
|
9343
|
+
if (!((_c = _this.field.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol)) {
|
|
9344
|
+
_this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { currencySymbol: "R$" });
|
|
9345
|
+
}
|
|
9346
|
+
},
|
|
9347
|
+
error: function () {
|
|
9348
|
+
var _a;
|
|
9349
|
+
return (_this.field.numberLocaleOptions = (_a = _this.field.numberLocaleOptions) !== null && _a !== void 0 ? _a : {
|
|
9350
|
+
thousandsSeparator: ".",
|
|
9351
|
+
decimalSeparator: ",",
|
|
9352
|
+
currencySymbol: "R$",
|
|
9353
|
+
});
|
|
9354
|
+
},
|
|
9355
|
+
});
|
|
9356
|
+
};
|
|
9357
|
+
CurrencyFieldComponent.ctorParameters = function () { return [
|
|
9358
|
+
{ type: LocaleService }
|
|
9359
|
+
]; };
|
|
9231
9360
|
__decorate([
|
|
9232
9361
|
Input()
|
|
9233
9362
|
], CurrencyFieldComponent.prototype, "field", void 0);
|
|
@@ -9304,8 +9433,9 @@ var LookupFieldComponent = /** @class */ (function () {
|
|
|
9304
9433
|
|
|
9305
9434
|
var NumberFieldComponent = /** @class */ (function (_super) {
|
|
9306
9435
|
__extends(NumberFieldComponent, _super);
|
|
9307
|
-
function NumberFieldComponent() {
|
|
9308
|
-
var _this = _super
|
|
9436
|
+
function NumberFieldComponent(localeService) {
|
|
9437
|
+
var _this = _super.call(this) || this;
|
|
9438
|
+
_this.localeService = localeService;
|
|
9309
9439
|
_this.onInput = new EventEmitter();
|
|
9310
9440
|
_this.onFocus = new EventEmitter();
|
|
9311
9441
|
_this.onComplete = new EventEmitter();
|
|
@@ -9314,6 +9444,7 @@ var NumberFieldComponent = /** @class */ (function (_super) {
|
|
|
9314
9444
|
}
|
|
9315
9445
|
NumberFieldComponent.prototype.ngOnInit = function () {
|
|
9316
9446
|
var _this = this;
|
|
9447
|
+
this.onLocaleService();
|
|
9317
9448
|
this.onFocus.pipe(takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
|
|
9318
9449
|
if (_this.field.onFocus)
|
|
9319
9450
|
_this.field.onFocus(event);
|
|
@@ -9345,6 +9476,37 @@ var NumberFieldComponent = /** @class */ (function (_super) {
|
|
|
9345
9476
|
enumerable: true,
|
|
9346
9477
|
configurable: true
|
|
9347
9478
|
});
|
|
9479
|
+
NumberFieldComponent.prototype.onLocaleService = function () {
|
|
9480
|
+
var _this = this;
|
|
9481
|
+
this.localeService
|
|
9482
|
+
.getLocale()
|
|
9483
|
+
.pipe(first())
|
|
9484
|
+
.subscribe({
|
|
9485
|
+
next: function () {
|
|
9486
|
+
var _a, _b, _c;
|
|
9487
|
+
if (!((_a = _this.field.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator)) {
|
|
9488
|
+
_this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { decimalSeparator: _this.localeService.getDecimalSeparator() });
|
|
9489
|
+
}
|
|
9490
|
+
if (!((_b = _this.field.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator)) {
|
|
9491
|
+
_this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { thousandsSeparator: _this.localeService.getGroupingSeparator() });
|
|
9492
|
+
}
|
|
9493
|
+
if (!((_c = _this.field.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol)) {
|
|
9494
|
+
_this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { currencySymbol: "R$" });
|
|
9495
|
+
}
|
|
9496
|
+
},
|
|
9497
|
+
error: function () {
|
|
9498
|
+
var _a;
|
|
9499
|
+
return (_this.field.numberLocaleOptions = (_a = _this.field.numberLocaleOptions) !== null && _a !== void 0 ? _a : {
|
|
9500
|
+
thousandsSeparator: ".",
|
|
9501
|
+
decimalSeparator: ",",
|
|
9502
|
+
currencySymbol: "R$",
|
|
9503
|
+
});
|
|
9504
|
+
},
|
|
9505
|
+
});
|
|
9506
|
+
};
|
|
9507
|
+
NumberFieldComponent.ctorParameters = function () { return [
|
|
9508
|
+
{ type: LocaleService }
|
|
9509
|
+
]; };
|
|
9348
9510
|
__decorate([
|
|
9349
9511
|
Input()
|
|
9350
9512
|
], NumberFieldComponent.prototype, "field", void 0);
|
|
@@ -9878,14 +10040,8 @@ var DynamicField = /** @class */ (function (_super) {
|
|
|
9878
10040
|
errorMessages: errorMessages,
|
|
9879
10041
|
}) || this;
|
|
9880
10042
|
_this.field = field;
|
|
9881
|
-
_this.setFieldPropertiesByType();
|
|
9882
10043
|
return _this;
|
|
9883
10044
|
}
|
|
9884
|
-
DynamicField.prototype.setFieldPropertiesByType = function () {
|
|
9885
|
-
if (this.field.type === FieldType.Integer || this.field.type === FieldType.Double) {
|
|
9886
|
-
this.field.numberLocaleOptions.currencySymbol = "";
|
|
9887
|
-
}
|
|
9888
|
-
};
|
|
9889
10045
|
DynamicField.prototype.createComponent = function (resolver, container) {
|
|
9890
10046
|
var componentFactory = resolver.resolveComponentFactory(this.getComponent());
|
|
9891
10047
|
var component = container.createComponent(componentFactory);
|