@seniorsistemas/angular-components 17.5.1 → 17.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +710 -554
  2. package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
  4. package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
  5. package/components/bignumber-input/number-input.directive.d.ts +5 -1
  6. package/components/dynamic-form/components/fields/bignumber/number-field.component.d.ts +4 -0
  7. package/components/dynamic-form/components/fields/currency/currency-field.component.d.ts +7 -1
  8. package/components/dynamic-form/components/fields/number/number-field.component.d.ts +4 -0
  9. package/components/dynamic-form/dynamic-form.d.ts +0 -1
  10. package/components/locale/locale.service.d.ts +3 -1
  11. package/components/localized-number-input/localized-number-input.directive.d.ts +3 -1
  12. package/components/number-input/number-input.directive.d.ts +5 -1
  13. package/esm2015/components/bignumber-input/number-input.directive.js +24 -6
  14. package/esm2015/components/dynamic-form/components/fields/bignumber/number-field.component.js +40 -13
  15. package/esm2015/components/dynamic-form/components/fields/currency/currency-field.component.js +40 -1
  16. package/esm2015/components/dynamic-form/components/fields/number/number-field.component.js +37 -4
  17. package/esm2015/components/dynamic-form/configurations/fields/bignumber-field.js +2 -3
  18. package/esm2015/components/dynamic-form/configurations/fields/currency-field.js +2 -3
  19. package/esm2015/components/dynamic-form/configurations/fields/decimal-field.js +2 -3
  20. package/esm2015/components/dynamic-form/configurations/fields/number-field.js +2 -3
  21. package/esm2015/components/dynamic-form/dynamic-form.js +1 -7
  22. package/esm2015/components/locale/locale.service.js +26 -5
  23. package/esm2015/components/localized-number-input/localized-number-input.directive.js +17 -4
  24. package/esm2015/components/number-input/number-input.directive.js +24 -7
  25. package/esm5/components/bignumber-input/number-input.directive.js +25 -6
  26. package/esm5/components/dynamic-form/components/fields/bignumber/number-field.component.js +42 -14
  27. package/esm5/components/dynamic-form/components/fields/currency/currency-field.component.js +42 -4
  28. package/esm5/components/dynamic-form/components/fields/number/number-field.component.js +39 -5
  29. package/esm5/components/dynamic-form/configurations/fields/bignumber-field.js +2 -3
  30. package/esm5/components/dynamic-form/configurations/fields/currency-field.js +2 -3
  31. package/esm5/components/dynamic-form/configurations/fields/decimal-field.js +2 -3
  32. package/esm5/components/dynamic-form/configurations/fields/number-field.js +2 -3
  33. package/esm5/components/dynamic-form/dynamic-form.js +1 -7
  34. package/esm5/components/locale/locale.service.js +25 -4
  35. package/esm5/components/localized-number-input/localized-number-input.directive.js +18 -4
  36. package/esm5/components/number-input/number-input.directive.js +25 -7
  37. package/fesm2015/seniorsistemas-angular-components.js +653 -501
  38. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  39. package/fesm5/seniorsistemas-angular-components.js +707 -551
  40. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  41. package/package.json +1 -1
  42. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/animations'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('@seniorsistemas/ng2-currency-mask'), require('primeng/breadcrumb'), require('primeng/tieredmenu'), require('primeng/tooltip'), require('primeng/dom'), require('primeng/calendar'), require('@codemirror/view'), require('@codemirror/state'), require('@codemirror/lint'), require('@codemirror/language'), require('@lezer/generator'), require('@codemirror/highlight'), require('@codemirror/autocomplete'), require('@seniorsistemas/senior-platform-data'), require('@ngx-translate/core'), require('@codemirror/tooltip'), require('@codemirror/gutter'), require('ngx-mask'), require('@angular/common/http'), require('angular2-hotkeys'), require('bignumber.js'), require('primeng/autocomplete'), require('primeng/dialog'), require('primeng/table'), require('moment'), require('ngx-cookie-service'), require('ng2-currency-mask'), require('primeng/button'), require('primeng/checkbox'), require('primeng/chips'), require('primeng/dropdown'), require('primeng/fieldset'), require('primeng/inputmask'), require('primeng/inputtext'), require('primeng/inputtextarea'), require('primeng/keyfilter'), require('primeng/multiselect'), require('primeng/panel'), require('primeng/radiobutton'), require('primeng/slider'), require('primeng/api'), require('@angular/platform-browser'), require('@angular/cdk/clipboard'), require('cropperjs'), require('@angular/cdk/drag-drop'), require('element-resize-detector'), require('primeng/confirmdialog'), require('@angular/cdk/a11y'), require('primeng/scrollpanel'), require('primeng/sidebar')) :
3
- typeof define === 'function' && define.amd ? define('@seniorsistemas/angular-components', ['exports', '@angular/core', '@angular/animations', 'rxjs', 'rxjs/operators', '@angular/common', '@angular/forms', '@angular/router', '@seniorsistemas/ng2-currency-mask', 'primeng/breadcrumb', 'primeng/tieredmenu', 'primeng/tooltip', 'primeng/dom', 'primeng/calendar', '@codemirror/view', '@codemirror/state', '@codemirror/lint', '@codemirror/language', '@lezer/generator', '@codemirror/highlight', '@codemirror/autocomplete', '@seniorsistemas/senior-platform-data', '@ngx-translate/core', '@codemirror/tooltip', '@codemirror/gutter', 'ngx-mask', '@angular/common/http', 'angular2-hotkeys', 'bignumber.js', 'primeng/autocomplete', 'primeng/dialog', 'primeng/table', 'moment', 'ngx-cookie-service', 'ng2-currency-mask', 'primeng/button', 'primeng/checkbox', 'primeng/chips', 'primeng/dropdown', 'primeng/fieldset', 'primeng/inputmask', 'primeng/inputtext', 'primeng/inputtextarea', 'primeng/keyfilter', 'primeng/multiselect', 'primeng/panel', 'primeng/radiobutton', 'primeng/slider', 'primeng/api', '@angular/platform-browser', '@angular/cdk/clipboard', 'cropperjs', '@angular/cdk/drag-drop', 'element-resize-detector', 'primeng/confirmdialog', '@angular/cdk/a11y', 'primeng/scrollpanel', 'primeng/sidebar'], factory) :
4
- (global = global || self, factory((global.seniorsistemas = global.seniorsistemas || {}, global.seniorsistemas['angular-components'] = {}), global.ng.core, global.ng.animations, global.rxjs, global.rxjs.operators, global.ng.common, global.ng.forms, global.ng.router, global.ng2CurrencyMask, global.breadcrumb, global.tieredmenu, global.tooltip, global.dom, global.calendar, global.view, global.state, global.lint, global.language, global.generator, global.highlight, global.autocomplete$1, global.seniorPlatformData, global.core$1, global.tooltip$1, global.gutter, global.ngxMask, global.ng.common.http, global.angular2Hotkeys, global.BigNumber, global.autocomplete$2, global.dialog, global.table, global.moment_, global.ngxCookieService, global.ng2CurrencyMask$1, global.button, global.checkbox, global.chips, global.dropdown, global.fieldset, global.inputmask, global.inputtext, global.inputtextarea, global.keyfilter, global.multiselect, global.panel, global.radiobutton, global.slider, global.api, global.ng.platformBrowser, global.ng.cdk.clipboard, global.Cropper, global.ng.cdk['drag-drop'], global.elementResizeDetectorMaker_, global.confirmdialog, global.ng.cdk.a11y, global.scrollpanel, global.sidebar));
5
- }(this, (function (exports, core, animations, rxjs, operators, common, forms, router, ng2CurrencyMask, breadcrumb, tieredmenu, tooltip, dom, calendar, view, state, lint, language, generator, highlight, autocomplete$1, seniorPlatformData, core$1, tooltip$1, gutter, ngxMask, http, angular2Hotkeys, BigNumber, autocomplete$2, dialog, table, moment_, ngxCookieService, ng2CurrencyMask$1, button, checkbox, chips, dropdown, fieldset, inputmask, inputtext, inputtextarea, keyfilter, multiselect, panel, radiobutton, slider, api, platformBrowser, clipboard, Cropper, dragDrop, elementResizeDetectorMaker_, confirmdialog, a11y, scrollpanel, sidebar) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/animations'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('@angular/forms'), require('@angular/router'), require('@angular/common/http'), require('@seniorsistemas/senior-platform-data'), require('moment'), require('ngx-cookie-service'), require('@seniorsistemas/ng2-currency-mask'), require('primeng/breadcrumb'), require('primeng/tieredmenu'), require('primeng/tooltip'), require('primeng/dom'), require('primeng/calendar'), require('@codemirror/view'), require('@codemirror/state'), require('@codemirror/lint'), require('@codemirror/language'), require('@lezer/generator'), require('@codemirror/highlight'), require('@codemirror/autocomplete'), require('@ngx-translate/core'), require('@codemirror/tooltip'), require('@codemirror/gutter'), require('ngx-mask'), require('angular2-hotkeys'), require('bignumber.js'), require('primeng/autocomplete'), require('primeng/dialog'), require('primeng/table'), require('ng2-currency-mask'), require('primeng/button'), require('primeng/checkbox'), require('primeng/chips'), require('primeng/dropdown'), require('primeng/fieldset'), require('primeng/inputmask'), require('primeng/inputtext'), require('primeng/inputtextarea'), require('primeng/keyfilter'), require('primeng/multiselect'), require('primeng/panel'), require('primeng/radiobutton'), require('primeng/slider'), require('primeng/api'), require('@angular/platform-browser'), require('@angular/cdk/clipboard'), require('cropperjs'), require('@angular/cdk/drag-drop'), require('element-resize-detector'), require('primeng/confirmdialog'), require('@angular/cdk/a11y'), require('primeng/scrollpanel'), require('primeng/sidebar')) :
3
+ typeof define === 'function' && define.amd ? define('@seniorsistemas/angular-components', ['exports', '@angular/core', '@angular/animations', 'rxjs', 'rxjs/operators', '@angular/common', '@angular/forms', '@angular/router', '@angular/common/http', '@seniorsistemas/senior-platform-data', 'moment', 'ngx-cookie-service', '@seniorsistemas/ng2-currency-mask', 'primeng/breadcrumb', 'primeng/tieredmenu', 'primeng/tooltip', 'primeng/dom', 'primeng/calendar', '@codemirror/view', '@codemirror/state', '@codemirror/lint', '@codemirror/language', '@lezer/generator', '@codemirror/highlight', '@codemirror/autocomplete', '@ngx-translate/core', '@codemirror/tooltip', '@codemirror/gutter', 'ngx-mask', 'angular2-hotkeys', 'bignumber.js', 'primeng/autocomplete', 'primeng/dialog', 'primeng/table', 'ng2-currency-mask', 'primeng/button', 'primeng/checkbox', 'primeng/chips', 'primeng/dropdown', 'primeng/fieldset', 'primeng/inputmask', 'primeng/inputtext', 'primeng/inputtextarea', 'primeng/keyfilter', 'primeng/multiselect', 'primeng/panel', 'primeng/radiobutton', 'primeng/slider', 'primeng/api', '@angular/platform-browser', '@angular/cdk/clipboard', 'cropperjs', '@angular/cdk/drag-drop', 'element-resize-detector', 'primeng/confirmdialog', '@angular/cdk/a11y', 'primeng/scrollpanel', 'primeng/sidebar'], factory) :
4
+ (global = global || self, factory((global.seniorsistemas = global.seniorsistemas || {}, global.seniorsistemas['angular-components'] = {}), global.ng.core, global.ng.animations, global.rxjs, global.rxjs.operators, global.ng.common, global.ng.forms, global.ng.router, global.ng.common.http, global.seniorPlatformData, global.moment_, global.ngxCookieService, global.ng2CurrencyMask, global.breadcrumb, global.tieredmenu, global.tooltip, global.dom, global.calendar, global.view, global.state, global.lint, global.language, global.generator, global.highlight, global.autocomplete$1, global.core$1, global.tooltip$1, global.gutter, global.ngxMask, global.angular2Hotkeys, global.BigNumber, global.autocomplete$2, global.dialog, global.table, global.ng2CurrencyMask$1, global.button, global.checkbox, global.chips, global.dropdown, global.fieldset, global.inputmask, global.inputtext, global.inputtextarea, global.keyfilter, global.multiselect, global.panel, global.radiobutton, global.slider, global.api, global.ng.platformBrowser, global.ng.cdk.clipboard, global.Cropper, global.ng.cdk['drag-drop'], global.elementResizeDetectorMaker_, global.confirmdialog, global.ng.cdk.a11y, global.scrollpanel, global.sidebar));
5
+ }(this, (function (exports, core, animations, rxjs, operators, common, forms, router, http, seniorPlatformData, moment_, ngxCookieService, ng2CurrencyMask, breadcrumb, tieredmenu, tooltip, dom, calendar, view, state, lint, language, generator, highlight, autocomplete$1, core$1, tooltip$1, gutter, ngxMask, angular2Hotkeys, BigNumber, autocomplete$2, dialog, table, ng2CurrencyMask$1, button, checkbox, chips, dropdown, fieldset, inputmask, inputtext, inputtextarea, keyfilter, multiselect, panel, radiobutton, slider, api, platformBrowser, clipboard, Cropper, dragDrop, elementResizeDetectorMaker_, confirmdialog, a11y, scrollpanel, sidebar) { 'use strict';
6
6
 
7
7
  var BigNumber__default = 'default' in BigNumber ? BigNumber['default'] : BigNumber;
8
8
  Cropper = Cropper && Cropper.hasOwnProperty('default') ? Cropper['default'] : Cropper;
@@ -1012,15 +1012,157 @@
1012
1012
  return BadgeModule;
1013
1013
  }());
1014
1014
 
1015
+ var CalendarLocaleOptions = /** @class */ (function () {
1016
+ function CalendarLocaleOptions(config) {
1017
+ var _this = this;
1018
+ if (config === void 0) { config = {}; }
1019
+ this.hourFormat = "24";
1020
+ this.dateFormat = "dd/mm/yy";
1021
+ this.firstDayOfWeek = 0;
1022
+ this.today = "Hoje";
1023
+ this.clear = "Limpar";
1024
+ this.dayNames = ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"];
1025
+ this.dayNamesShort = ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"];
1026
+ this.dayNamesMin = ["D", "S", "T", "Q", "Q", "S", "S"];
1027
+ this.monthNamesShort = ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"];
1028
+ this.monthNames = [
1029
+ "Janeiro",
1030
+ "Fevereiro",
1031
+ "Março",
1032
+ "Abril",
1033
+ "Maio",
1034
+ "Junho",
1035
+ "Julho",
1036
+ "Agosto",
1037
+ "Setembro",
1038
+ "Outubro",
1039
+ "Novembro",
1040
+ "Dezembro",
1041
+ ];
1042
+ Object.keys(config).forEach(function (key) { return (_this[key] = config[key] || _this[key]); });
1043
+ }
1044
+ return CalendarLocaleOptions;
1045
+ }());
1046
+
1047
+ var NumberLocaleOptions = /** @class */ (function () {
1048
+ function NumberLocaleOptions(config) {
1049
+ if (config === void 0) { config = {}; }
1050
+ this.thousandsSeparator = ".";
1051
+ this.decimalSeparator = ",";
1052
+ this.currencySymbol = "R$";
1053
+ Object.assign(this, config);
1054
+ }
1055
+ return NumberLocaleOptions;
1056
+ }());
1057
+
1058
+ var LocaleOptions = /** @class */ (function () {
1059
+ function LocaleOptions(config) {
1060
+ var _this = this;
1061
+ if (config === void 0) { config = {}; }
1062
+ this.calendar = new CalendarLocaleOptions();
1063
+ this.number = new NumberLocaleOptions();
1064
+ Object.keys(config).forEach(function (key) { return (_this[key] = config[key] || _this[key]); });
1065
+ }
1066
+ return LocaleOptions;
1067
+ }());
1068
+ /**
1069
+ * @deprecated
1070
+ */
1071
+ var DEFAULT_CALENDAR_LOCALE_OPTIONS = new CalendarLocaleOptions();
1072
+ /**
1073
+ * @deprecated
1074
+ */
1075
+ var DEFAULT_NUMBER_LOCALE_OPTIONS = new NumberLocaleOptions();
1076
+ /**
1077
+ * @deprecated
1078
+ */
1079
+ var DEFAULT_LOCALE_OPTIONS = new LocaleOptions();
1080
+
1081
+ var moment = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
1082
+ var LocaleService = /** @class */ (function () {
1083
+ function LocaleService(http, cookieService) {
1084
+ this.http = http;
1085
+ this.cookieService = cookieService;
1086
+ this.localeOptionsAddress = "https://cdn.senior.com.br/primeng/locales";
1087
+ this.localeOptionsVersion = "3.0.0";
1088
+ }
1089
+ LocaleService.prototype.get = function () {
1090
+ var _this = this;
1091
+ return this.localeOptions
1092
+ ? rxjs.of(this.localeOptions)
1093
+ : this.getLocaleConfig().pipe(operators.tap(function (localeOptions) { return (_this.localeOptions = localeOptions); }));
1094
+ };
1095
+ LocaleService.prototype.getLocale = function () {
1096
+ var _this = this;
1097
+ return this.locale
1098
+ ? rxjs.of(this.locale)
1099
+ : rxjs.from(this.getUserData()).pipe(operators.map(function (userData) {
1100
+ _this.locale = userData.locale || userData.tenantLocale || "pt-BR";
1101
+ return _this.locale;
1102
+ }));
1103
+ };
1104
+ LocaleService.prototype.getUserData = function () {
1105
+ try {
1106
+ return rxjs.of(JSON.parse(this.cookieService.get("com.senior.token")));
1107
+ }
1108
+ catch (ex) {
1109
+ console.warn("Unable to obtain user locale from cookie, calling getUser");
1110
+ return seniorPlatformData.user.getUserData();
1111
+ }
1112
+ };
1113
+ LocaleService.prototype.getLocaleConfig = function () {
1114
+ var _this = this;
1115
+ return this.getLocale().pipe(operators.switchMap(function (locale) {
1116
+ moment.locale(locale);
1117
+ return _this.http
1118
+ .get(_this.localeOptionsAddress + "/" + _this.localeOptionsVersion + "/" + locale + ".json")
1119
+ .pipe(operators.map(function (response) { return new LocaleOptions(response); }));
1120
+ }), operators.catchError(function (err) {
1121
+ console.warn("Error getting locale configuration. Using fallback.", err);
1122
+ return rxjs.of(new LocaleOptions());
1123
+ }));
1124
+ };
1125
+ LocaleService.prototype.getGroupingSeparator = function () {
1126
+ var _a;
1127
+ var numberFormat = new Intl.NumberFormat(this.locale, {
1128
+ style: "decimal",
1129
+ minimumFractionDigits: 5,
1130
+ maximumFractionDigits: 5,
1131
+ });
1132
+ // The default groupingSeparator for 'fr' is the character code 8239. We need it to be the regular space.
1133
+ if (this.locale.includes("fr"))
1134
+ return " ";
1135
+ return (_a = numberFormat.formatToParts(1000).find(function (part) { return part.type === "group"; })) === null || _a === void 0 ? void 0 : _a.value;
1136
+ };
1137
+ LocaleService.prototype.getDecimalSeparator = function () {
1138
+ var _a;
1139
+ var numberFormat = new Intl.NumberFormat(this.locale, {
1140
+ style: "decimal",
1141
+ minimumFractionDigits: 5,
1142
+ maximumFractionDigits: 5,
1143
+ });
1144
+ return (_a = numberFormat.formatToParts(1.2).find(function (part) { return part.type === "decimal"; })) === null || _a === void 0 ? void 0 : _a.value;
1145
+ };
1146
+ LocaleService.ctorParameters = function () { return [
1147
+ { type: http.HttpClient },
1148
+ { type: ngxCookieService.CookieService }
1149
+ ]; };
1150
+ LocaleService = __decorate([
1151
+ core.Injectable()
1152
+ ], LocaleService);
1153
+ return LocaleService;
1154
+ }());
1155
+
1015
1156
  var BignumberInputDirective = /** @class */ (function (_super) {
1016
1157
  __extends(BignumberInputDirective, _super);
1017
- function BignumberInputDirective() {
1018
- var _this = _super !== null && _super.apply(this, arguments) || this;
1158
+ function BignumberInputDirective(_elementRef, _keyValueDiffers, localeService) {
1159
+ var _this = _super.call(this, null, _elementRef, _keyValueDiffers) || this;
1160
+ _this.localeService = localeService;
1019
1161
  _this.precision = 15;
1020
1162
  _this.scale = 0;
1021
- _this.decimalSeparator = ",";
1022
1163
  _this.alignTo = ng2CurrencyMask.AlignmentOptions.LEFT;
1023
1164
  _this.allowNegative = true;
1165
+ _this.onLocaleService();
1024
1166
  return _this;
1025
1167
  }
1026
1168
  BignumberInputDirective_1 = BignumberInputDirective;
@@ -1065,7 +1207,7 @@
1065
1207
  scale: this.scale || 0,
1066
1208
  prefix: "",
1067
1209
  suffix: "",
1068
- allowNegative: this.allowNegative
1210
+ allowNegative: this.allowNegative,
1069
1211
  };
1070
1212
  this.calculateMaxLength();
1071
1213
  };
@@ -1081,7 +1223,23 @@
1081
1223
  this._maxLength = maxLength;
1082
1224
  this.maxLength = maxLength;
1083
1225
  };
1226
+ BignumberInputDirective.prototype.onLocaleService = function () {
1227
+ var _this = this;
1228
+ this.localeService
1229
+ .getLocale()
1230
+ .pipe(operators.first())
1231
+ .subscribe(function () {
1232
+ var _a, _b;
1233
+ _this.decimalSeparator = (_a = _this.decimalSeparator) !== null && _a !== void 0 ? _a : _this.localeService.getDecimalSeparator();
1234
+ _this.thousandsSeparator = (_b = _this.thousandsSeparator) !== null && _b !== void 0 ? _b : _this.localeService.getGroupingSeparator();
1235
+ });
1236
+ };
1084
1237
  var BignumberInputDirective_1;
1238
+ BignumberInputDirective.ctorParameters = function () { return [
1239
+ { type: core.ElementRef },
1240
+ { type: core.KeyValueDiffers },
1241
+ { type: LocaleService }
1242
+ ]; };
1085
1243
  __decorate([
1086
1244
  core.Input()
1087
1245
  ], BignumberInputDirective.prototype, "precision", void 0);
@@ -4299,38 +4457,6 @@
4299
4457
  return CountryPhonePickerModule;
4300
4458
  }());
4301
4459
 
4302
- var CalendarLocaleOptions = /** @class */ (function () {
4303
- function CalendarLocaleOptions(config) {
4304
- var _this = this;
4305
- if (config === void 0) { config = {}; }
4306
- this.hourFormat = "24";
4307
- this.dateFormat = "dd/mm/yy";
4308
- this.firstDayOfWeek = 0;
4309
- this.today = "Hoje";
4310
- this.clear = "Limpar";
4311
- this.dayNames = ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"];
4312
- this.dayNamesShort = ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"];
4313
- this.dayNamesMin = ["D", "S", "T", "Q", "Q", "S", "S"];
4314
- this.monthNamesShort = ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"];
4315
- this.monthNames = [
4316
- "Janeiro",
4317
- "Fevereiro",
4318
- "Março",
4319
- "Abril",
4320
- "Maio",
4321
- "Junho",
4322
- "Julho",
4323
- "Agosto",
4324
- "Setembro",
4325
- "Outubro",
4326
- "Novembro",
4327
- "Dezembro",
4328
- ];
4329
- Object.keys(config).forEach(function (key) { return (_this[key] = config[key] || _this[key]); });
4330
- }
4331
- return CalendarLocaleOptions;
4332
- }());
4333
-
4334
4460
 
4335
4461
  (function (FieldType) {
4336
4462
  FieldType["Autocomplete"] = "Autocomplete";
@@ -4412,417 +4538,57 @@
4412
4538
  return AutocompleteField;
4413
4539
  }(Field));
4414
4540
 
4415
- var NumberLocaleOptions = /** @class */ (function () {
4416
- function NumberLocaleOptions(config) {
4417
- if (config === void 0) { config = {}; }
4418
- this.thousandsSeparator = ".";
4419
- this.decimalSeparator = ",";
4420
- this.currencySymbol = "R$";
4421
- Object.assign(this, config);
4541
+ var BignumberField = /** @class */ (function (_super) {
4542
+ __extends(BignumberField, _super);
4543
+ function BignumberField(config) {
4544
+ var _a, _b, _c;
4545
+ var _this = _super.call(this, config) || this;
4546
+ _this.allowNegative = (_a = config.allowNegative) !== null && _a !== void 0 ? _a : true;
4547
+ _this.numberLocaleOptions = config.numberLocaleOptions;
4548
+ _this.browserAutocomplete = config.browserAutocomplete;
4549
+ _this.precision = config.precision;
4550
+ _this.scale = (_b = config.scale) !== null && _b !== void 0 ? _b : 2;
4551
+ _this.alignTo = _this.scale ? ng2CurrencyMask.AlignmentOptions.RIGHT : ng2CurrencyMask.AlignmentOptions.LEFT;
4552
+ _this.mask = config.mask;
4553
+ _this.leftAddon = config.leftAddon;
4554
+ _this.rightAddon = config.rightAddon;
4555
+ _this.onBlur = config.onBlur;
4556
+ _this.onFocus = config.onFocus;
4557
+ _this.onComplete = config.onComplete;
4558
+ _this.onInput = config.onInput;
4559
+ _this.autoClear = (_c = config.autoClear) !== null && _c !== void 0 ? _c : true;
4560
+ return _this;
4422
4561
  }
4423
- return NumberLocaleOptions;
4424
- }());
4562
+ return BignumberField;
4563
+ }(Field));
4425
4564
 
4426
- var LocaleOptions = /** @class */ (function () {
4427
- function LocaleOptions(config) {
4428
- var _this = this;
4429
- if (config === void 0) { config = {}; }
4430
- this.calendar = new CalendarLocaleOptions();
4431
- this.number = new NumberLocaleOptions();
4432
- Object.keys(config).forEach(function (key) { return (_this[key] = config[key] || _this[key]); });
4565
+ var BlobField = /** @class */ (function (_super) {
4566
+ __extends(BlobField, _super);
4567
+ function BlobField(config) {
4568
+ var _this = _super.call(this, config) || this;
4569
+ _this.accept = config.accept;
4570
+ _this.files = config.files || [];
4571
+ _this.chooseLabel = config.chooseLabel;
4572
+ _this.removeLabel = config.removeLabel;
4573
+ _this.cancelLabel = config.cancelLabel;
4574
+ _this.successTooltip = config.successTooltip;
4575
+ _this.multiple = config.multiple;
4576
+ _this.onUploadFile = config.onUploadFile;
4577
+ _this.onRemoveFile = config.onRemoveFile;
4578
+ _this.onCancelUpload = config.onCancelUpload;
4579
+ _this.onDownloadFile = config.onDownloadFile;
4580
+ _this.showFileUploadDate = config.showFileUploadDate;
4581
+ return _this;
4433
4582
  }
4434
- return LocaleOptions;
4435
- }());
4436
- /**
4437
- * @deprecated
4438
- */
4439
- var DEFAULT_CALENDAR_LOCALE_OPTIONS = new CalendarLocaleOptions();
4440
- /**
4441
- * @deprecated
4442
- */
4443
- var DEFAULT_NUMBER_LOCALE_OPTIONS = new NumberLocaleOptions();
4444
- /**
4445
- * @deprecated
4446
- */
4447
- var DEFAULT_LOCALE_OPTIONS = new LocaleOptions();
4583
+ return BlobField;
4584
+ }(Field));
4448
4585
 
4449
- var moment = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
4450
- var LocaleService = /** @class */ (function () {
4451
- function LocaleService(http, cookieService) {
4452
- this.http = http;
4453
- this.cookieService = cookieService;
4454
- this.localeOptionsAddress = "https://cdn.senior.com.br/primeng/locales";
4455
- this.localeOptionsVersion = "3.0.0";
4456
- }
4457
- LocaleService.prototype.get = function () {
4458
- var _this = this;
4459
- return this.localeOptions
4460
- ? rxjs.of(this.localeOptions)
4461
- : this.getLocaleConfig().pipe(operators.tap(function (localeOptions) { return (_this.localeOptions = localeOptions); }));
4462
- };
4463
- LocaleService.prototype.getLocale = function () {
4464
- var _this = this;
4465
- return this.locale
4466
- ? rxjs.of(this.locale)
4467
- : rxjs.from(this.getUserData()).pipe(operators.map(function (userData) {
4468
- _this.locale = userData.locale || userData.tenantLocale || "pt-BR";
4469
- return _this.locale;
4470
- }));
4471
- };
4472
- LocaleService.prototype.getUserData = function () {
4473
- try {
4474
- return rxjs.of(JSON.parse(this.cookieService.get('com.senior.token')));
4475
- }
4476
- catch (ex) {
4477
- console.warn('Unable to obtain user locale from cookie, calling getUser');
4478
- return seniorPlatformData.user.getUserData();
4479
- }
4480
- };
4481
- LocaleService.prototype.getLocaleConfig = function () {
4482
- var _this = this;
4483
- return this.getLocale().pipe(operators.switchMap(function (locale) {
4484
- moment.locale(locale);
4485
- return _this.http
4486
- .get(_this.localeOptionsAddress + "/" + _this.localeOptionsVersion + "/" + locale + ".json")
4487
- .pipe(operators.map(function (response) { return new LocaleOptions(response); }));
4488
- }), operators.catchError(function (err) {
4489
- console.warn("Error getting locale configuration. Using fallback.", err);
4490
- return rxjs.of(new LocaleOptions());
4491
- }));
4492
- };
4493
- LocaleService.ctorParameters = function () { return [
4494
- { type: http.HttpClient },
4495
- { type: ngxCookieService.CookieService }
4496
- ]; };
4497
- LocaleService = __decorate([
4498
- core.Injectable()
4499
- ], LocaleService);
4500
- return LocaleService;
4501
- }());
4502
-
4503
- var LocalizedBignumberPipe = /** @class */ (function () {
4504
- function LocalizedBignumberPipe(localeService) {
4505
- this.localeService = localeService;
4506
- }
4507
- LocalizedBignumberPipe.prototype.transform = function (value, options) {
4508
- return value !== undefined && value !== null ? this.applyMask(value, options) : rxjs.of(value);
4509
- };
4510
- LocalizedBignumberPipe.prototype.applyMask = function (value, options) {
4511
- return this.localeService.get().pipe(operators.map(function (localeConfig) {
4512
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
4513
- var configs = {
4514
- 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$",
4515
- 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 : ".",
4516
- 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 : ",",
4517
- scale: (_k = options === null || options === void 0 ? void 0 : options.scale) !== null && _k !== void 0 ? _k : 2,
4518
- allowNegative: (_l = options === null || options === void 0 ? void 0 : options.allowNegative) !== null && _l !== void 0 ? _l : true
4519
- };
4520
- var isNumber = !(new BigNumber__default(value).isNaN());
4521
- return ng2CurrencyMask.applyMask(value, configs, isNumber);
4522
- }));
4523
- };
4524
- LocalizedBignumberPipe.ctorParameters = function () { return [
4525
- { type: LocaleService }
4526
- ]; };
4527
- LocalizedBignumberPipe = __decorate([
4528
- core.Pipe({
4529
- name: "localizedBignumber",
4530
- })
4531
- ], LocalizedBignumberPipe);
4532
- return LocalizedBignumberPipe;
4533
- }());
4534
-
4535
- var LocalizedBignumberImpurePipe = /** @class */ (function (_super) {
4536
- __extends(LocalizedBignumberImpurePipe, _super);
4537
- function LocalizedBignumberImpurePipe() {
4538
- return _super !== null && _super.apply(this, arguments) || this;
4539
- }
4540
- LocalizedBignumberImpurePipe.prototype.transform = function (value, options) {
4541
- return _super.prototype.transform.call(this, value, options);
4542
- };
4543
- LocalizedBignumberImpurePipe = __decorate([
4544
- core.Pipe({
4545
- name: "localizedBignumberImpure",
4546
- pure: false,
4547
- })
4548
- ], LocalizedBignumberImpurePipe);
4549
- return LocalizedBignumberImpurePipe;
4550
- }(LocalizedBignumberPipe));
4551
-
4552
- var LocalizedCurrencyPipeOptions = /** @class */ (function (_super) {
4553
- __extends(LocalizedCurrencyPipeOptions, _super);
4554
- function LocalizedCurrencyPipeOptions(config) {
4555
- if (config === void 0) { config = {}; }
4556
- var _this = _super.call(this, config) || this;
4557
- _this.scale = 2;
4558
- return _this;
4559
- }
4560
- return LocalizedCurrencyPipeOptions;
4561
- }(NumberLocaleOptions));
4562
- /**
4563
- * @deprecated Should use localizedBignumberPipe instead
4564
- */
4565
- var LocalizedCurrencyPipe = /** @class */ (function () {
4566
- function LocalizedCurrencyPipe(localeService) {
4567
- this.localeService = localeService;
4568
- }
4569
- LocalizedCurrencyPipe.prototype.transform = function (value, options) {
4570
- if (!options) {
4571
- options = new LocalizedCurrencyPipeOptions();
4572
- }
4573
- return value !== undefined && value !== null ? this.applyMask(value, options) : rxjs.of(value);
4574
- };
4575
- LocalizedCurrencyPipe.prototype.applyMask = function (value, options) {
4576
- return this.localeService.get().pipe(operators.map(function (localeConfig) {
4577
- var config = __assign(__assign({}, localeConfig.number), options);
4578
- var scale = config.scale, currencySymbol = config.currencySymbol, thousandsSeparator = config.thousandsSeparator, decimalSeparator = config.decimalSeparator;
4579
- var rawValue = Number(value).toFixed(scale);
4580
- var onlyNumbers = rawValue.replace(/[^0-9]/g, "");
4581
- var integerPart = onlyNumbers
4582
- .slice(0, onlyNumbers.length - scale)
4583
- .replace(/^0*/g, "")
4584
- .replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSeparator) || "0";
4585
- var decimalPart = onlyNumbers.slice(onlyNumbers.length - scale);
4586
- var newValue = scale ? integerPart + decimalSeparator + decimalPart : integerPart;
4587
- var isZero = !Number(onlyNumbers);
4588
- var operator = rawValue.includes("-") && !isZero ? "-" : "";
4589
- return "" + operator + currencySymbol + newValue;
4590
- }));
4591
- };
4592
- LocalizedCurrencyPipe.ctorParameters = function () { return [
4593
- { type: LocaleService }
4594
- ]; };
4595
- LocalizedCurrencyPipe = __decorate([
4596
- core.Pipe({
4597
- name: "localizedCurrency",
4598
- })
4599
- ], LocalizedCurrencyPipe);
4600
- return LocalizedCurrencyPipe;
4601
- }());
4602
-
4603
- /**
4604
- * @deprecated Should use localizedBignumberPipe instead
4605
- */
4606
- var LocalizedCurrencyImpurePipe = /** @class */ (function (_super) {
4607
- __extends(LocalizedCurrencyImpurePipe, _super);
4608
- function LocalizedCurrencyImpurePipe() {
4609
- return _super !== null && _super.apply(this, arguments) || this;
4610
- }
4611
- LocalizedCurrencyImpurePipe.prototype.transform = function (value, options) {
4612
- if (options === void 0) { options = new LocalizedCurrencyPipeOptions(); }
4613
- return _super.prototype.transform.call(this, value, options);
4614
- };
4615
- LocalizedCurrencyImpurePipe = __decorate([
4616
- core.Pipe({
4617
- name: "localizedCurrencyImpure",
4618
- pure: false,
4619
- })
4620
- ], LocalizedCurrencyImpurePipe);
4621
- return LocalizedCurrencyImpurePipe;
4622
- }(LocalizedCurrencyPipe));
4623
-
4624
- var moment$1 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
4625
- var LocalizedDatePipe = /** @class */ (function () {
4626
- function LocalizedDatePipe(localeService) {
4627
- this.localeService = localeService;
4628
- }
4629
- LocalizedDatePipe.prototype.transform = function (value, format) {
4630
- if (format === void 0) { format = "L LTS"; }
4631
- return this.localeService.get().pipe(operators.map(function () { return (value ? moment$1(value).format(format) : value); }));
4632
- };
4633
- LocalizedDatePipe.ctorParameters = function () { return [
4634
- { type: LocaleService }
4635
- ]; };
4636
- LocalizedDatePipe = __decorate([
4637
- core.Pipe({
4638
- name: "localizedDate",
4639
- })
4640
- ], LocalizedDatePipe);
4641
- return LocalizedDatePipe;
4642
- }());
4643
-
4644
- var LocalizedDateImpurePipe = /** @class */ (function (_super) {
4645
- __extends(LocalizedDateImpurePipe, _super);
4646
- function LocalizedDateImpurePipe() {
4647
- return _super !== null && _super.apply(this, arguments) || this;
4648
- }
4649
- LocalizedDateImpurePipe = __decorate([
4650
- core.Pipe({
4651
- name: "localizedDateImpure",
4652
- pure: false,
4653
- })
4654
- ], LocalizedDateImpurePipe);
4655
- return LocalizedDateImpurePipe;
4656
- }(LocalizedDatePipe));
4657
-
4658
- /**
4659
- * @deprecated Should use localizedBignumberPipe instead
4660
- */
4661
- var LocalizedNumberPipe = /** @class */ (function () {
4662
- function LocalizedNumberPipe(localeService) {
4663
- this.localeService = localeService;
4664
- }
4665
- LocalizedNumberPipe.prototype.transform = function (value, minimumFractionDigits) {
4666
- return rxjs.from(this.localeService.getLocale()).pipe(operators.map(function (locale) {
4667
- var numericValue = Number(value);
4668
- if (!value && isNaN(numericValue))
4669
- return;
4670
- return new Intl.NumberFormat(locale, {
4671
- minimumFractionDigits: minimumFractionDigits || 0,
4672
- }).format(Number(value));
4673
- }));
4674
- };
4675
- LocalizedNumberPipe.ctorParameters = function () { return [
4676
- { type: LocaleService }
4677
- ]; };
4678
- LocalizedNumberPipe = __decorate([
4679
- core.Pipe({ name: "localizedNumber" })
4680
- ], LocalizedNumberPipe);
4681
- return LocalizedNumberPipe;
4682
- }());
4683
-
4684
- var moment$2 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
4685
- var LocalizedTimePipe = /** @class */ (function () {
4686
- function LocalizedTimePipe(localeService) {
4687
- this.localeService = localeService;
4688
- }
4689
- LocalizedTimePipe.prototype.transform = function (value, format) {
4690
- if (format === void 0) { format = "LTS"; }
4691
- return this.localeService.get().pipe(operators.map(function () { return (value ? moment$2(value, "HH:mm:ss").format(format) : value); }));
4692
- };
4693
- LocalizedTimePipe.ctorParameters = function () { return [
4694
- { type: LocaleService }
4695
- ]; };
4696
- LocalizedTimePipe = __decorate([
4697
- core.Pipe({
4698
- name: "localizedTime",
4699
- })
4700
- ], LocalizedTimePipe);
4701
- return LocalizedTimePipe;
4702
- }());
4703
-
4704
- var LocalizedTimeImpurePipe = /** @class */ (function (_super) {
4705
- __extends(LocalizedTimeImpurePipe, _super);
4706
- function LocalizedTimeImpurePipe() {
4707
- return _super !== null && _super.apply(this, arguments) || this;
4708
- }
4709
- LocalizedTimeImpurePipe = __decorate([
4710
- core.Pipe({
4711
- name: "localizedTimeImpure",
4712
- pure: false,
4713
- })
4714
- ], LocalizedTimeImpurePipe);
4715
- return LocalizedTimeImpurePipe;
4716
- }(LocalizedTimePipe));
4717
-
4718
- var LocaleModule = /** @class */ (function () {
4719
- function LocaleModule() {
4720
- }
4721
- LocaleModule_1 = LocaleModule;
4722
- LocaleModule.forRoot = function () {
4723
- return {
4724
- ngModule: LocaleModule_1,
4725
- providers: [
4726
- LocaleService,
4727
- LocalizedCurrencyPipe,
4728
- LocalizedDatePipe,
4729
- LocalizedTimePipe,
4730
- LocalizedNumberPipe,
4731
- LocalizedCurrencyImpurePipe,
4732
- LocalizedDateImpurePipe,
4733
- LocalizedTimeImpurePipe,
4734
- LocalizedBignumberPipe,
4735
- LocalizedBignumberImpurePipe
4736
- ],
4737
- };
4738
- };
4739
- LocaleModule.forChild = function () {
4740
- return {
4741
- ngModule: LocaleModule_1,
4742
- };
4743
- };
4744
- var LocaleModule_1;
4745
- LocaleModule = LocaleModule_1 = __decorate([
4746
- core.NgModule({
4747
- imports: [common.CommonModule],
4748
- exports: [
4749
- LocalizedCurrencyPipe,
4750
- LocalizedDatePipe,
4751
- LocalizedTimePipe,
4752
- LocalizedNumberPipe,
4753
- LocalizedCurrencyImpurePipe,
4754
- LocalizedDateImpurePipe,
4755
- LocalizedTimeImpurePipe,
4756
- LocalizedBignumberPipe,
4757
- LocalizedBignumberImpurePipe
4758
- ],
4759
- declarations: [
4760
- LocalizedCurrencyPipe,
4761
- LocalizedDatePipe,
4762
- LocalizedTimePipe,
4763
- LocalizedNumberPipe,
4764
- LocalizedCurrencyImpurePipe,
4765
- LocalizedDateImpurePipe,
4766
- LocalizedTimeImpurePipe,
4767
- LocalizedBignumberPipe,
4768
- LocalizedBignumberImpurePipe
4769
- ],
4770
- })
4771
- ], LocaleModule);
4772
- return LocaleModule;
4773
- }());
4774
-
4775
- var BignumberField = /** @class */ (function (_super) {
4776
- __extends(BignumberField, _super);
4777
- function BignumberField(config) {
4778
- var _a, _b, _c;
4779
- var _this = _super.call(this, config) || this;
4780
- _this.allowNegative = (_a = config.allowNegative) !== null && _a !== void 0 ? _a : true;
4781
- _this.numberLocaleOptions = config.numberLocaleOptions || new NumberLocaleOptions();
4782
- _this.browserAutocomplete = config.browserAutocomplete;
4783
- _this.precision = config.precision;
4784
- _this.scale = (_b = config.scale) !== null && _b !== void 0 ? _b : 2;
4785
- _this.alignTo = _this.scale ? ng2CurrencyMask.AlignmentOptions.RIGHT : ng2CurrencyMask.AlignmentOptions.LEFT;
4786
- _this.mask = config.mask;
4787
- _this.leftAddon = config.leftAddon;
4788
- _this.rightAddon = config.rightAddon;
4789
- _this.onBlur = config.onBlur;
4790
- _this.onFocus = config.onFocus;
4791
- _this.onComplete = config.onComplete;
4792
- _this.onInput = config.onInput;
4793
- _this.autoClear = (_c = config.autoClear) !== null && _c !== void 0 ? _c : true;
4794
- return _this;
4795
- }
4796
- return BignumberField;
4797
- }(Field));
4798
-
4799
- var BlobField = /** @class */ (function (_super) {
4800
- __extends(BlobField, _super);
4801
- function BlobField(config) {
4802
- var _this = _super.call(this, config) || this;
4803
- _this.accept = config.accept;
4804
- _this.files = config.files || [];
4805
- _this.chooseLabel = config.chooseLabel;
4806
- _this.removeLabel = config.removeLabel;
4807
- _this.cancelLabel = config.cancelLabel;
4808
- _this.successTooltip = config.successTooltip;
4809
- _this.multiple = config.multiple;
4810
- _this.onUploadFile = config.onUploadFile;
4811
- _this.onRemoveFile = config.onRemoveFile;
4812
- _this.onCancelUpload = config.onCancelUpload;
4813
- _this.onDownloadFile = config.onDownloadFile;
4814
- _this.showFileUploadDate = config.showFileUploadDate;
4815
- return _this;
4816
- }
4817
- return BlobField;
4818
- }(Field));
4819
-
4820
- var BooleanOptionsLabel = /** @class */ (function () {
4821
- function BooleanOptionsLabel(config) {
4822
- this.true = config.true;
4823
- this.false = config.false;
4824
- this.empty = config.empty;
4825
- this.clear = config.clear;
4586
+ var BooleanOptionsLabel = /** @class */ (function () {
4587
+ function BooleanOptionsLabel(config) {
4588
+ this.true = config.true;
4589
+ this.false = config.false;
4590
+ this.empty = config.empty;
4591
+ this.clear = config.clear;
4826
4592
  }
4827
4593
  return BooleanOptionsLabel;
4828
4594
  }());
@@ -4925,15 +4691,15 @@
4925
4691
  */
4926
4692
  var NumberInputDirective = /** @class */ (function (_super) {
4927
4693
  __extends(NumberInputDirective, _super);
4928
- function NumberInputDirective() {
4929
- var _this = _super !== null && _super.apply(this, arguments) || this;
4694
+ function NumberInputDirective(_elementRef, _keyValueDiffers, localeService) {
4695
+ var _this = _super.call(this, null, _elementRef, _keyValueDiffers) || this;
4696
+ _this.localeService = localeService;
4930
4697
  _this.precision = 15;
4931
4698
  _this.scale = 0;
4932
- _this.decimalSeparator = ",";
4933
- _this.thousandsSeparator = ".";
4934
4699
  _this.alignTo = exports.NumberAlignmentOption.LEFT;
4935
4700
  _this.allowNegative = true;
4936
4701
  _this.regex = /\d/;
4702
+ _this.onLocaleService();
4937
4703
  return _this;
4938
4704
  }
4939
4705
  NumberInputDirective_1 = NumberInputDirective;
@@ -4965,7 +4731,7 @@
4965
4731
  precision: this.scale || 0,
4966
4732
  prefix: "",
4967
4733
  suffix: "",
4968
- allowNegative: this.allowNegative
4734
+ allowNegative: this.allowNegative,
4969
4735
  };
4970
4736
  this.calculateMaxLength();
4971
4737
  };
@@ -4995,7 +4761,23 @@
4995
4761
  else
4996
4762
  event.preventDefault();
4997
4763
  };
4764
+ NumberInputDirective.prototype.onLocaleService = function () {
4765
+ var _this = this;
4766
+ this.localeService
4767
+ .getLocale()
4768
+ .pipe(operators.first())
4769
+ .subscribe(function () {
4770
+ var _a, _b;
4771
+ _this.decimalSeparator = (_a = _this.decimalSeparator) !== null && _a !== void 0 ? _a : _this.localeService.getDecimalSeparator();
4772
+ _this.thousandsSeparator = (_b = _this.thousandsSeparator) !== null && _b !== void 0 ? _b : _this.localeService.getGroupingSeparator();
4773
+ });
4774
+ };
4998
4775
  var NumberInputDirective_1;
4776
+ NumberInputDirective.ctorParameters = function () { return [
4777
+ { type: core.ElementRef },
4778
+ { type: core.KeyValueDiffers },
4779
+ { type: LocaleService }
4780
+ ]; };
4999
4781
  __decorate([
5000
4782
  core.Input()
5001
4783
  ], NumberInputDirective.prototype, "precision", void 0);
@@ -5059,7 +4841,7 @@
5059
4841
  __extends(NumberField, _super);
5060
4842
  function NumberField(config) {
5061
4843
  var _this = _super.call(this, config) || this;
5062
- _this.numberLocaleOptions = config.numberLocaleOptions || new NumberLocaleOptions();
4844
+ _this.numberLocaleOptions = config.numberLocaleOptions;
5063
4845
  _this.browserAutocomplete = config.browserAutocomplete;
5064
4846
  _this.precision = config.precision;
5065
4847
  _this.alignTo = config.alignTo || exports.NumberAlignmentOption.LEFT;
@@ -5082,7 +4864,7 @@
5082
4864
  __extends(DecimalField, _super);
5083
4865
  function DecimalField(config) {
5084
4866
  var _this = _super.call(this, config) || this;
5085
- _this.numberLocaleOptions = config.numberLocaleOptions || new NumberLocaleOptions();
4867
+ _this.numberLocaleOptions = config.numberLocaleOptions;
5086
4868
  _this.alignTo = config.alignTo || exports.NumberAlignmentOption.RIGHT;
5087
4869
  _this.scale = config.scale || config.scale === 0 ? config.scale : 2;
5088
4870
  return _this;
@@ -5097,7 +4879,7 @@
5097
4879
  __extends(CurrencyField, _super);
5098
4880
  function CurrencyField(config) {
5099
4881
  var _this = _super.call(this, config) || this;
5100
- _this.numberLocaleOptions = config.numberLocaleOptions || new NumberLocaleOptions();
4882
+ _this.numberLocaleOptions = config.numberLocaleOptions;
5101
4883
  return _this;
5102
4884
  }
5103
4885
  return CurrencyField;
@@ -6418,99 +6200,371 @@
6418
6200
  return ProgressBarComponent;
6419
6201
  }());
6420
6202
 
6421
- var ProgressBarDeterminateComponent = /** @class */ (function () {
6422
- function ProgressBarDeterminateComponent(localeService) {
6203
+ var ProgressBarDeterminateComponent = /** @class */ (function () {
6204
+ function ProgressBarDeterminateComponent(localeService) {
6205
+ this.localeService = localeService;
6206
+ this.showValue = true;
6207
+ }
6208
+ ProgressBarDeterminateComponent.prototype.ngOnInit = function () {
6209
+ this.validateValues();
6210
+ this.onGetLocale();
6211
+ };
6212
+ ProgressBarDeterminateComponent.prototype.onGetLocale = function () {
6213
+ var _this = this;
6214
+ this.localeService.getLocale().subscribe({
6215
+ next: function (locale) {
6216
+ _this.numberFormat = new Intl.NumberFormat(locale !== null && locale !== void 0 ? locale : "pt-BR", _this.numberFormatOptions);
6217
+ },
6218
+ error: function () {
6219
+ _this.numberFormat = new Intl.NumberFormat("pt-BR", _this.numberFormatOptions);
6220
+ },
6221
+ });
6222
+ };
6223
+ ProgressBarDeterminateComponent.prototype.validateValues = function () {
6224
+ if (this.value < 0 || this.value > 100) {
6225
+ throw new Error("Invalid value for value");
6226
+ }
6227
+ if (this.targetValue < 0 || this.targetValue > 100) {
6228
+ throw new Error("Invalid value for targetValue");
6229
+ }
6230
+ };
6231
+ ProgressBarDeterminateComponent.ctorParameters = function () { return [
6232
+ { type: LocaleService }
6233
+ ]; };
6234
+ __decorate([
6235
+ core.Input()
6236
+ ], ProgressBarDeterminateComponent.prototype, "value", void 0);
6237
+ __decorate([
6238
+ core.Input()
6239
+ ], ProgressBarDeterminateComponent.prototype, "numberFormatOptions", void 0);
6240
+ __decorate([
6241
+ core.Input()
6242
+ ], ProgressBarDeterminateComponent.prototype, "targetValue", void 0);
6243
+ __decorate([
6244
+ core.Input()
6245
+ ], ProgressBarDeterminateComponent.prototype, "targetLabel", void 0);
6246
+ __decorate([
6247
+ core.Input()
6248
+ ], ProgressBarDeterminateComponent.prototype, "activeColor", void 0);
6249
+ __decorate([
6250
+ core.Input()
6251
+ ], ProgressBarDeterminateComponent.prototype, "showValue", void 0);
6252
+ ProgressBarDeterminateComponent = __decorate([
6253
+ core.Component({
6254
+ selector: "s-progressbar-determinate",
6255
+ 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",
6256
+ 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}"]
6257
+ })
6258
+ ], ProgressBarDeterminateComponent);
6259
+ return ProgressBarDeterminateComponent;
6260
+ }());
6261
+
6262
+ var ProgressBarIndeterminateComponent = /** @class */ (function () {
6263
+ function ProgressBarIndeterminateComponent() {
6264
+ }
6265
+ __decorate([
6266
+ core.Input()
6267
+ ], ProgressBarIndeterminateComponent.prototype, "activeColor", void 0);
6268
+ __decorate([
6269
+ core.Input()
6270
+ ], ProgressBarIndeterminateComponent.prototype, "label", void 0);
6271
+ ProgressBarIndeterminateComponent = __decorate([
6272
+ core.Component({
6273
+ selector: "s-progressbar-indeterminate",
6274
+ 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",
6275
+ 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%)}}"]
6276
+ })
6277
+ ], ProgressBarIndeterminateComponent);
6278
+ return ProgressBarIndeterminateComponent;
6279
+ }());
6280
+
6281
+ var ProgressBarModule = /** @class */ (function () {
6282
+ function ProgressBarModule() {
6283
+ }
6284
+ ProgressBarModule = __decorate([
6285
+ core.NgModule({
6286
+ imports: [common.CommonModule],
6287
+ declarations: [
6288
+ ProgressBarComponent,
6289
+ ProgressBarDeterminateComponent,
6290
+ ProgressBarIndeterminateComponent,
6291
+ ],
6292
+ exports: [ProgressBarComponent],
6293
+ })
6294
+ ], ProgressBarModule);
6295
+ return ProgressBarModule;
6296
+ }());
6297
+
6298
+ var LocalizedBignumberPipe = /** @class */ (function () {
6299
+ function LocalizedBignumberPipe(localeService) {
6300
+ this.localeService = localeService;
6301
+ }
6302
+ LocalizedBignumberPipe.prototype.transform = function (value, options) {
6303
+ return value !== undefined && value !== null ? this.applyMask(value, options) : rxjs.of(value);
6304
+ };
6305
+ LocalizedBignumberPipe.prototype.applyMask = function (value, options) {
6306
+ return this.localeService.get().pipe(operators.map(function (localeConfig) {
6307
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
6308
+ var configs = {
6309
+ 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$",
6310
+ 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 : ".",
6311
+ 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 : ",",
6312
+ scale: (_k = options === null || options === void 0 ? void 0 : options.scale) !== null && _k !== void 0 ? _k : 2,
6313
+ allowNegative: (_l = options === null || options === void 0 ? void 0 : options.allowNegative) !== null && _l !== void 0 ? _l : true
6314
+ };
6315
+ var isNumber = !(new BigNumber__default(value).isNaN());
6316
+ return ng2CurrencyMask.applyMask(value, configs, isNumber);
6317
+ }));
6318
+ };
6319
+ LocalizedBignumberPipe.ctorParameters = function () { return [
6320
+ { type: LocaleService }
6321
+ ]; };
6322
+ LocalizedBignumberPipe = __decorate([
6323
+ core.Pipe({
6324
+ name: "localizedBignumber",
6325
+ })
6326
+ ], LocalizedBignumberPipe);
6327
+ return LocalizedBignumberPipe;
6328
+ }());
6329
+
6330
+ var LocalizedBignumberImpurePipe = /** @class */ (function (_super) {
6331
+ __extends(LocalizedBignumberImpurePipe, _super);
6332
+ function LocalizedBignumberImpurePipe() {
6333
+ return _super !== null && _super.apply(this, arguments) || this;
6334
+ }
6335
+ LocalizedBignumberImpurePipe.prototype.transform = function (value, options) {
6336
+ return _super.prototype.transform.call(this, value, options);
6337
+ };
6338
+ LocalizedBignumberImpurePipe = __decorate([
6339
+ core.Pipe({
6340
+ name: "localizedBignumberImpure",
6341
+ pure: false,
6342
+ })
6343
+ ], LocalizedBignumberImpurePipe);
6344
+ return LocalizedBignumberImpurePipe;
6345
+ }(LocalizedBignumberPipe));
6346
+
6347
+ var LocalizedCurrencyPipeOptions = /** @class */ (function (_super) {
6348
+ __extends(LocalizedCurrencyPipeOptions, _super);
6349
+ function LocalizedCurrencyPipeOptions(config) {
6350
+ if (config === void 0) { config = {}; }
6351
+ var _this = _super.call(this, config) || this;
6352
+ _this.scale = 2;
6353
+ return _this;
6354
+ }
6355
+ return LocalizedCurrencyPipeOptions;
6356
+ }(NumberLocaleOptions));
6357
+ /**
6358
+ * @deprecated Should use localizedBignumberPipe instead
6359
+ */
6360
+ var LocalizedCurrencyPipe = /** @class */ (function () {
6361
+ function LocalizedCurrencyPipe(localeService) {
6362
+ this.localeService = localeService;
6363
+ }
6364
+ LocalizedCurrencyPipe.prototype.transform = function (value, options) {
6365
+ if (!options) {
6366
+ options = new LocalizedCurrencyPipeOptions();
6367
+ }
6368
+ return value !== undefined && value !== null ? this.applyMask(value, options) : rxjs.of(value);
6369
+ };
6370
+ LocalizedCurrencyPipe.prototype.applyMask = function (value, options) {
6371
+ return this.localeService.get().pipe(operators.map(function (localeConfig) {
6372
+ var config = __assign(__assign({}, localeConfig.number), options);
6373
+ var scale = config.scale, currencySymbol = config.currencySymbol, thousandsSeparator = config.thousandsSeparator, decimalSeparator = config.decimalSeparator;
6374
+ var rawValue = Number(value).toFixed(scale);
6375
+ var onlyNumbers = rawValue.replace(/[^0-9]/g, "");
6376
+ var integerPart = onlyNumbers
6377
+ .slice(0, onlyNumbers.length - scale)
6378
+ .replace(/^0*/g, "")
6379
+ .replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSeparator) || "0";
6380
+ var decimalPart = onlyNumbers.slice(onlyNumbers.length - scale);
6381
+ var newValue = scale ? integerPart + decimalSeparator + decimalPart : integerPart;
6382
+ var isZero = !Number(onlyNumbers);
6383
+ var operator = rawValue.includes("-") && !isZero ? "-" : "";
6384
+ return "" + operator + currencySymbol + newValue;
6385
+ }));
6386
+ };
6387
+ LocalizedCurrencyPipe.ctorParameters = function () { return [
6388
+ { type: LocaleService }
6389
+ ]; };
6390
+ LocalizedCurrencyPipe = __decorate([
6391
+ core.Pipe({
6392
+ name: "localizedCurrency",
6393
+ })
6394
+ ], LocalizedCurrencyPipe);
6395
+ return LocalizedCurrencyPipe;
6396
+ }());
6397
+
6398
+ /**
6399
+ * @deprecated Should use localizedBignumberPipe instead
6400
+ */
6401
+ var LocalizedCurrencyImpurePipe = /** @class */ (function (_super) {
6402
+ __extends(LocalizedCurrencyImpurePipe, _super);
6403
+ function LocalizedCurrencyImpurePipe() {
6404
+ return _super !== null && _super.apply(this, arguments) || this;
6405
+ }
6406
+ LocalizedCurrencyImpurePipe.prototype.transform = function (value, options) {
6407
+ if (options === void 0) { options = new LocalizedCurrencyPipeOptions(); }
6408
+ return _super.prototype.transform.call(this, value, options);
6409
+ };
6410
+ LocalizedCurrencyImpurePipe = __decorate([
6411
+ core.Pipe({
6412
+ name: "localizedCurrencyImpure",
6413
+ pure: false,
6414
+ })
6415
+ ], LocalizedCurrencyImpurePipe);
6416
+ return LocalizedCurrencyImpurePipe;
6417
+ }(LocalizedCurrencyPipe));
6418
+
6419
+ var moment$1 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
6420
+ var LocalizedDatePipe = /** @class */ (function () {
6421
+ function LocalizedDatePipe(localeService) {
6422
+ this.localeService = localeService;
6423
+ }
6424
+ LocalizedDatePipe.prototype.transform = function (value, format) {
6425
+ if (format === void 0) { format = "L LTS"; }
6426
+ return this.localeService.get().pipe(operators.map(function () { return (value ? moment$1(value).format(format) : value); }));
6427
+ };
6428
+ LocalizedDatePipe.ctorParameters = function () { return [
6429
+ { type: LocaleService }
6430
+ ]; };
6431
+ LocalizedDatePipe = __decorate([
6432
+ core.Pipe({
6433
+ name: "localizedDate",
6434
+ })
6435
+ ], LocalizedDatePipe);
6436
+ return LocalizedDatePipe;
6437
+ }());
6438
+
6439
+ var LocalizedDateImpurePipe = /** @class */ (function (_super) {
6440
+ __extends(LocalizedDateImpurePipe, _super);
6441
+ function LocalizedDateImpurePipe() {
6442
+ return _super !== null && _super.apply(this, arguments) || this;
6443
+ }
6444
+ LocalizedDateImpurePipe = __decorate([
6445
+ core.Pipe({
6446
+ name: "localizedDateImpure",
6447
+ pure: false,
6448
+ })
6449
+ ], LocalizedDateImpurePipe);
6450
+ return LocalizedDateImpurePipe;
6451
+ }(LocalizedDatePipe));
6452
+
6453
+ /**
6454
+ * @deprecated Should use localizedBignumberPipe instead
6455
+ */
6456
+ var LocalizedNumberPipe = /** @class */ (function () {
6457
+ function LocalizedNumberPipe(localeService) {
6423
6458
  this.localeService = localeService;
6424
- this.showValue = true;
6425
6459
  }
6426
- ProgressBarDeterminateComponent.prototype.ngOnInit = function () {
6427
- this.validateValues();
6428
- this.onGetLocale();
6429
- };
6430
- ProgressBarDeterminateComponent.prototype.onGetLocale = function () {
6431
- var _this = this;
6432
- this.localeService.getLocale().subscribe({
6433
- next: function (locale) {
6434
- _this.numberFormat = new Intl.NumberFormat(locale !== null && locale !== void 0 ? locale : "pt-BR", _this.numberFormatOptions);
6435
- },
6436
- error: function () {
6437
- _this.numberFormat = new Intl.NumberFormat("pt-BR", _this.numberFormatOptions);
6438
- },
6439
- });
6460
+ LocalizedNumberPipe.prototype.transform = function (value, minimumFractionDigits) {
6461
+ return rxjs.from(this.localeService.getLocale()).pipe(operators.map(function (locale) {
6462
+ var numericValue = Number(value);
6463
+ if (!value && isNaN(numericValue))
6464
+ return;
6465
+ return new Intl.NumberFormat(locale, {
6466
+ minimumFractionDigits: minimumFractionDigits || 0,
6467
+ }).format(Number(value));
6468
+ }));
6440
6469
  };
6441
- ProgressBarDeterminateComponent.prototype.validateValues = function () {
6442
- if (this.value < 0 || this.value > 100) {
6443
- throw new Error("Invalid value for value");
6444
- }
6445
- if (this.targetValue < 0 || this.targetValue > 100) {
6446
- throw new Error("Invalid value for targetValue");
6447
- }
6470
+ LocalizedNumberPipe.ctorParameters = function () { return [
6471
+ { type: LocaleService }
6472
+ ]; };
6473
+ LocalizedNumberPipe = __decorate([
6474
+ core.Pipe({ name: "localizedNumber" })
6475
+ ], LocalizedNumberPipe);
6476
+ return LocalizedNumberPipe;
6477
+ }());
6478
+
6479
+ var moment$2 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
6480
+ var LocalizedTimePipe = /** @class */ (function () {
6481
+ function LocalizedTimePipe(localeService) {
6482
+ this.localeService = localeService;
6483
+ }
6484
+ LocalizedTimePipe.prototype.transform = function (value, format) {
6485
+ if (format === void 0) { format = "LTS"; }
6486
+ return this.localeService.get().pipe(operators.map(function () { return (value ? moment$2(value, "HH:mm:ss").format(format) : value); }));
6448
6487
  };
6449
- ProgressBarDeterminateComponent.ctorParameters = function () { return [
6488
+ LocalizedTimePipe.ctorParameters = function () { return [
6450
6489
  { type: LocaleService }
6451
6490
  ]; };
6452
- __decorate([
6453
- core.Input()
6454
- ], ProgressBarDeterminateComponent.prototype, "value", void 0);
6455
- __decorate([
6456
- core.Input()
6457
- ], ProgressBarDeterminateComponent.prototype, "numberFormatOptions", void 0);
6458
- __decorate([
6459
- core.Input()
6460
- ], ProgressBarDeterminateComponent.prototype, "targetValue", void 0);
6461
- __decorate([
6462
- core.Input()
6463
- ], ProgressBarDeterminateComponent.prototype, "targetLabel", void 0);
6464
- __decorate([
6465
- core.Input()
6466
- ], ProgressBarDeterminateComponent.prototype, "activeColor", void 0);
6467
- __decorate([
6468
- core.Input()
6469
- ], ProgressBarDeterminateComponent.prototype, "showValue", void 0);
6470
- ProgressBarDeterminateComponent = __decorate([
6471
- core.Component({
6472
- selector: "s-progressbar-determinate",
6473
- 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",
6474
- 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}"]
6491
+ LocalizedTimePipe = __decorate([
6492
+ core.Pipe({
6493
+ name: "localizedTime",
6475
6494
  })
6476
- ], ProgressBarDeterminateComponent);
6477
- return ProgressBarDeterminateComponent;
6495
+ ], LocalizedTimePipe);
6496
+ return LocalizedTimePipe;
6478
6497
  }());
6479
6498
 
6480
- var ProgressBarIndeterminateComponent = /** @class */ (function () {
6481
- function ProgressBarIndeterminateComponent() {
6499
+ var LocalizedTimeImpurePipe = /** @class */ (function (_super) {
6500
+ __extends(LocalizedTimeImpurePipe, _super);
6501
+ function LocalizedTimeImpurePipe() {
6502
+ return _super !== null && _super.apply(this, arguments) || this;
6482
6503
  }
6483
- __decorate([
6484
- core.Input()
6485
- ], ProgressBarIndeterminateComponent.prototype, "activeColor", void 0);
6486
- __decorate([
6487
- core.Input()
6488
- ], ProgressBarIndeterminateComponent.prototype, "label", void 0);
6489
- ProgressBarIndeterminateComponent = __decorate([
6490
- core.Component({
6491
- selector: "s-progressbar-indeterminate",
6492
- 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",
6493
- 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%)}}"]
6504
+ LocalizedTimeImpurePipe = __decorate([
6505
+ core.Pipe({
6506
+ name: "localizedTimeImpure",
6507
+ pure: false,
6494
6508
  })
6495
- ], ProgressBarIndeterminateComponent);
6496
- return ProgressBarIndeterminateComponent;
6497
- }());
6509
+ ], LocalizedTimeImpurePipe);
6510
+ return LocalizedTimeImpurePipe;
6511
+ }(LocalizedTimePipe));
6498
6512
 
6499
- var ProgressBarModule = /** @class */ (function () {
6500
- function ProgressBarModule() {
6513
+ var LocaleModule = /** @class */ (function () {
6514
+ function LocaleModule() {
6501
6515
  }
6502
- ProgressBarModule = __decorate([
6516
+ LocaleModule_1 = LocaleModule;
6517
+ LocaleModule.forRoot = function () {
6518
+ return {
6519
+ ngModule: LocaleModule_1,
6520
+ providers: [
6521
+ LocaleService,
6522
+ LocalizedCurrencyPipe,
6523
+ LocalizedDatePipe,
6524
+ LocalizedTimePipe,
6525
+ LocalizedNumberPipe,
6526
+ LocalizedCurrencyImpurePipe,
6527
+ LocalizedDateImpurePipe,
6528
+ LocalizedTimeImpurePipe,
6529
+ LocalizedBignumberPipe,
6530
+ LocalizedBignumberImpurePipe
6531
+ ],
6532
+ };
6533
+ };
6534
+ LocaleModule.forChild = function () {
6535
+ return {
6536
+ ngModule: LocaleModule_1,
6537
+ };
6538
+ };
6539
+ var LocaleModule_1;
6540
+ LocaleModule = LocaleModule_1 = __decorate([
6503
6541
  core.NgModule({
6504
6542
  imports: [common.CommonModule],
6543
+ exports: [
6544
+ LocalizedCurrencyPipe,
6545
+ LocalizedDatePipe,
6546
+ LocalizedTimePipe,
6547
+ LocalizedNumberPipe,
6548
+ LocalizedCurrencyImpurePipe,
6549
+ LocalizedDateImpurePipe,
6550
+ LocalizedTimeImpurePipe,
6551
+ LocalizedBignumberPipe,
6552
+ LocalizedBignumberImpurePipe
6553
+ ],
6505
6554
  declarations: [
6506
- ProgressBarComponent,
6507
- ProgressBarDeterminateComponent,
6508
- ProgressBarIndeterminateComponent,
6555
+ LocalizedCurrencyPipe,
6556
+ LocalizedDatePipe,
6557
+ LocalizedTimePipe,
6558
+ LocalizedNumberPipe,
6559
+ LocalizedCurrencyImpurePipe,
6560
+ LocalizedDateImpurePipe,
6561
+ LocalizedTimeImpurePipe,
6562
+ LocalizedBignumberPipe,
6563
+ LocalizedBignumberImpurePipe
6509
6564
  ],
6510
- exports: [ProgressBarComponent],
6511
6565
  })
6512
- ], ProgressBarModule);
6513
- return ProgressBarModule;
6566
+ ], LocaleModule);
6567
+ return LocaleModule;
6514
6568
  }());
6515
6569
 
6516
6570
  var Breakpoints = {
@@ -7450,17 +7504,26 @@
7450
7504
  }());
7451
7505
 
7452
7506
  var LocalizedNumberInputDirective = /** @class */ (function () {
7453
- function LocalizedNumberInputDirective() {
7454
- this.decimalSeparator = ",";
7455
- this.thousandsSeparator = ".";
7507
+ function LocalizedNumberInputDirective(localeService) {
7508
+ this.localeService = localeService;
7456
7509
  this.precision = 2;
7457
7510
  }
7458
7511
  LocalizedNumberInputDirective_1 = LocalizedNumberInputDirective;
7459
7512
  LocalizedNumberInputDirective.prototype.ngOnInit = function () {
7513
+ var _this = this;
7460
7514
  // Gera a expressão regular para validar números de acordo com os separadores decimais e de milhares.
7461
7515
  // 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
7462
7516
  // tslint:disable-next-line: max-line-length
7463
7517
  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 + "}))?$";
7518
+ this.localeService
7519
+ .getLocale()
7520
+ .pipe(operators.first())
7521
+ .subscribe(function () {
7522
+ var _a, _b;
7523
+ _this.decimalSeparator = (_a = _this.decimalSeparator) !== null && _a !== void 0 ? _a : _this.localeService.getDecimalSeparator();
7524
+ _this.thousandsSeparator = (_b = _this.thousandsSeparator) !== null && _b !== void 0 ? _b : _this.localeService.getGroupingSeparator();
7525
+ _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 + "}))?$";
7526
+ });
7464
7527
  };
7465
7528
  LocalizedNumberInputDirective.prototype.validate = function (control) {
7466
7529
  if (control.value && !String(control.value).match(new RegExp(this.numberRegex, "g")))
@@ -7468,6 +7531,9 @@
7468
7531
  return null;
7469
7532
  };
7470
7533
  var LocalizedNumberInputDirective_1;
7534
+ LocalizedNumberInputDirective.ctorParameters = function () { return [
7535
+ { type: LocaleService }
7536
+ ]; };
7471
7537
  __decorate([
7472
7538
  core.Input()
7473
7539
  ], LocalizedNumberInputDirective.prototype, "decimalSeparator", void 0);
@@ -9116,8 +9182,9 @@
9116
9182
 
9117
9183
  var BignumberFieldComponent = /** @class */ (function (_super) {
9118
9184
  __extends(BignumberFieldComponent, _super);
9119
- function BignumberFieldComponent() {
9120
- var _this = _super !== null && _super.apply(this, arguments) || this;
9185
+ function BignumberFieldComponent(localeService) {
9186
+ var _this = _super.call(this) || this;
9187
+ _this.localeService = localeService;
9121
9188
  _this.onInput = new core.EventEmitter();
9122
9189
  _this.onFocus = new core.EventEmitter();
9123
9190
  _this.onComplete = new core.EventEmitter();
@@ -9126,23 +9193,18 @@
9126
9193
  }
9127
9194
  BignumberFieldComponent.prototype.ngOnInit = function () {
9128
9195
  var _this = this;
9129
- this.onFocus
9130
- .pipe(operators.takeUntil(this.ngUnsubscribe))
9131
- .subscribe(function (event) {
9196
+ this.onLocaleService();
9197
+ this.onFocus.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
9132
9198
  if (_this.field.onFocus) {
9133
9199
  _this.field.onFocus(event);
9134
9200
  }
9135
9201
  });
9136
- this.onInput
9137
- .pipe(operators.takeUntil(this.ngUnsubscribe))
9138
- .subscribe(function (event) {
9202
+ this.onInput.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
9139
9203
  if (_this.field.onInput) {
9140
9204
  _this.field.onInput(event);
9141
9205
  }
9142
9206
  });
9143
- this.onComplete
9144
- .pipe(operators.takeUntil(this.ngUnsubscribe))
9145
- .subscribe(function (event) {
9207
+ this.onComplete.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
9146
9208
  if (_this.field.onComplete) {
9147
9209
  _this.field.onComplete(event);
9148
9210
  }
@@ -9159,6 +9221,37 @@
9159
9221
  enumerable: true,
9160
9222
  configurable: true
9161
9223
  });
9224
+ BignumberFieldComponent.prototype.onLocaleService = function () {
9225
+ var _this = this;
9226
+ this.localeService
9227
+ .getLocale()
9228
+ .pipe(operators.first())
9229
+ .subscribe({
9230
+ next: function () {
9231
+ var _a, _b, _c;
9232
+ if (!((_a = _this.field.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator)) {
9233
+ _this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { decimalSeparator: _this.localeService.getDecimalSeparator() });
9234
+ }
9235
+ if (!((_b = _this.field.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator)) {
9236
+ _this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { thousandsSeparator: _this.localeService.getGroupingSeparator() });
9237
+ }
9238
+ if (!((_c = _this.field.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol)) {
9239
+ _this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { currencySymbol: _this.field.type === exports.FieldType.Integer || _this.field.type === exports.FieldType.Double ? "" : "R$" });
9240
+ }
9241
+ },
9242
+ error: function () {
9243
+ var _a;
9244
+ return (_this.field.numberLocaleOptions = (_a = _this.field.numberLocaleOptions) !== null && _a !== void 0 ? _a : {
9245
+ thousandsSeparator: ".",
9246
+ decimalSeparator: ",",
9247
+ currencySymbol: _this.field.type === exports.FieldType.Integer || _this.field.type === exports.FieldType.Double ? "" : "R$",
9248
+ });
9249
+ },
9250
+ });
9251
+ };
9252
+ BignumberFieldComponent.ctorParameters = function () { return [
9253
+ { type: LocaleService }
9254
+ ]; };
9162
9255
  __decorate([
9163
9256
  core.Input()
9164
9257
  ], BignumberFieldComponent.prototype, "field", void 0);
@@ -9372,9 +9465,45 @@
9372
9465
  */
9373
9466
  var CurrencyFieldComponent = /** @class */ (function (_super) {
9374
9467
  __extends(CurrencyFieldComponent, _super);
9375
- function CurrencyFieldComponent() {
9376
- return _super !== null && _super.apply(this, arguments) || this;
9468
+ function CurrencyFieldComponent(localeService) {
9469
+ var _this = _super.call(this) || this;
9470
+ _this.localeService = localeService;
9471
+ return _this;
9377
9472
  }
9473
+ CurrencyFieldComponent.prototype.ngOnInit = function () {
9474
+ this.onLocaleService();
9475
+ };
9476
+ CurrencyFieldComponent.prototype.onLocaleService = function () {
9477
+ var _this = this;
9478
+ this.localeService
9479
+ .getLocale()
9480
+ .pipe(operators.first())
9481
+ .subscribe({
9482
+ next: function () {
9483
+ var _a, _b, _c;
9484
+ if (!((_a = _this.field.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator)) {
9485
+ _this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { decimalSeparator: _this.localeService.getDecimalSeparator() });
9486
+ }
9487
+ if (!((_b = _this.field.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator)) {
9488
+ _this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { thousandsSeparator: _this.localeService.getGroupingSeparator() });
9489
+ }
9490
+ if (!((_c = _this.field.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol)) {
9491
+ _this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { currencySymbol: "R$" });
9492
+ }
9493
+ },
9494
+ error: function () {
9495
+ var _a;
9496
+ return (_this.field.numberLocaleOptions = (_a = _this.field.numberLocaleOptions) !== null && _a !== void 0 ? _a : {
9497
+ thousandsSeparator: ".",
9498
+ decimalSeparator: ",",
9499
+ currencySymbol: "R$",
9500
+ });
9501
+ },
9502
+ });
9503
+ };
9504
+ CurrencyFieldComponent.ctorParameters = function () { return [
9505
+ { type: LocaleService }
9506
+ ]; };
9378
9507
  __decorate([
9379
9508
  core.Input()
9380
9509
  ], CurrencyFieldComponent.prototype, "field", void 0);
@@ -9451,8 +9580,9 @@
9451
9580
 
9452
9581
  var NumberFieldComponent = /** @class */ (function (_super) {
9453
9582
  __extends(NumberFieldComponent, _super);
9454
- function NumberFieldComponent() {
9455
- var _this = _super !== null && _super.apply(this, arguments) || this;
9583
+ function NumberFieldComponent(localeService) {
9584
+ var _this = _super.call(this) || this;
9585
+ _this.localeService = localeService;
9456
9586
  _this.onInput = new core.EventEmitter();
9457
9587
  _this.onFocus = new core.EventEmitter();
9458
9588
  _this.onComplete = new core.EventEmitter();
@@ -9461,6 +9591,7 @@
9461
9591
  }
9462
9592
  NumberFieldComponent.prototype.ngOnInit = function () {
9463
9593
  var _this = this;
9594
+ this.onLocaleService();
9464
9595
  this.onFocus.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (event) {
9465
9596
  if (_this.field.onFocus)
9466
9597
  _this.field.onFocus(event);
@@ -9492,6 +9623,37 @@
9492
9623
  enumerable: true,
9493
9624
  configurable: true
9494
9625
  });
9626
+ NumberFieldComponent.prototype.onLocaleService = function () {
9627
+ var _this = this;
9628
+ this.localeService
9629
+ .getLocale()
9630
+ .pipe(operators.first())
9631
+ .subscribe({
9632
+ next: function () {
9633
+ var _a, _b, _c;
9634
+ if (!((_a = _this.field.numberLocaleOptions) === null || _a === void 0 ? void 0 : _a.decimalSeparator)) {
9635
+ _this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { decimalSeparator: _this.localeService.getDecimalSeparator() });
9636
+ }
9637
+ if (!((_b = _this.field.numberLocaleOptions) === null || _b === void 0 ? void 0 : _b.thousandsSeparator)) {
9638
+ _this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { thousandsSeparator: _this.localeService.getGroupingSeparator() });
9639
+ }
9640
+ if (!((_c = _this.field.numberLocaleOptions) === null || _c === void 0 ? void 0 : _c.currencySymbol)) {
9641
+ _this.field.numberLocaleOptions = __assign(__assign({}, _this.field.numberLocaleOptions), { currencySymbol: "R$" });
9642
+ }
9643
+ },
9644
+ error: function () {
9645
+ var _a;
9646
+ return (_this.field.numberLocaleOptions = (_a = _this.field.numberLocaleOptions) !== null && _a !== void 0 ? _a : {
9647
+ thousandsSeparator: ".",
9648
+ decimalSeparator: ",",
9649
+ currencySymbol: "R$",
9650
+ });
9651
+ },
9652
+ });
9653
+ };
9654
+ NumberFieldComponent.ctorParameters = function () { return [
9655
+ { type: LocaleService }
9656
+ ]; };
9495
9657
  __decorate([
9496
9658
  core.Input()
9497
9659
  ], NumberFieldComponent.prototype, "field", void 0);
@@ -10025,14 +10187,8 @@
10025
10187
  errorMessages: errorMessages,
10026
10188
  }) || this;
10027
10189
  _this.field = field;
10028
- _this.setFieldPropertiesByType();
10029
10190
  return _this;
10030
10191
  }
10031
- DynamicField.prototype.setFieldPropertiesByType = function () {
10032
- if (this.field.type === exports.FieldType.Integer || this.field.type === exports.FieldType.Double) {
10033
- this.field.numberLocaleOptions.currencySymbol = "";
10034
- }
10035
- };
10036
10192
  DynamicField.prototype.createComponent = function (resolver, container) {
10037
10193
  var componentFactory = resolver.resolveComponentFactory(this.getComponent());
10038
10194
  var component = container.createComponent(componentFactory);