@seniorsistemas/angular-components 17.16.8 → 17.16.9
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 +1190 -1192
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/dynamic-form/configurations/fields/number-field.d.ts +3 -0
- package/esm2015/components/custom-fields/custom-fields.component.js +1 -1
- package/esm2015/components/dynamic-form/configurations/fields/bignumber-field.js +5 -6
- package/esm2015/components/dynamic-form/configurations/fields/currency-field.js +2 -4
- package/esm2015/components/dynamic-form/configurations/fields/decimal-field.js +2 -4
- package/esm2015/components/dynamic-form/configurations/fields/number-field.js +2 -4
- package/esm2015/components/locale/locale.service.js +2 -1
- package/esm2015/components/locale/services/numeric.service.js +2 -2
- package/esm5/components/custom-fields/custom-fields.component.js +1 -1
- package/esm5/components/dynamic-form/configurations/fields/bignumber-field.js +5 -6
- package/esm5/components/dynamic-form/configurations/fields/currency-field.js +2 -4
- package/esm5/components/dynamic-form/configurations/fields/decimal-field.js +2 -4
- package/esm5/components/dynamic-form/configurations/fields/number-field.js +2 -4
- package/esm5/components/locale/locale.service.js +2 -1
- package/esm5/components/locale/services/numeric.service.js +2 -2
- package/fesm2015/seniorsistemas-angular-components.js +919 -921
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +1191 -1193
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __awaiter, __param, __rest } from 'tslib';
|
|
2
|
-
import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Renderer2, Directive, KeyValueDiffers, HostBinding, ChangeDetectorRef, TemplateRef, InjectionToken, Inject,
|
|
2
|
+
import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Renderer2, Directive, KeyValueDiffers, HostBinding, ChangeDetectorRef, TemplateRef, InjectionToken, Inject, ViewEncapsulation, ViewContainerRef, Pipe, ɵɵinject, ContentChild, Optional, ViewChildren } from '@angular/core';
|
|
3
3
|
import { trigger, transition, style as style$7, animate, state, group, query, animateChild } from '@angular/animations';
|
|
4
4
|
import { Subject, of, from, ReplaySubject, throwError, fromEvent, forkJoin, pipe } from 'rxjs';
|
|
5
5
|
import { takeUntil, tap, map, switchMap, catchError, first, filter, take, delay, debounceTime, repeat, finalize } from 'rxjs/operators';
|
|
@@ -1002,6 +1002,7 @@ let LocaleService = class LocaleService {
|
|
|
1002
1002
|
var _a;
|
|
1003
1003
|
const numberFormat = new Intl.NumberFormat(this.locale, {
|
|
1004
1004
|
style: "decimal",
|
|
1005
|
+
useGrouping: true,
|
|
1005
1006
|
minimumFractionDigits: 5,
|
|
1006
1007
|
maximumFractionDigits: 5,
|
|
1007
1008
|
});
|
|
@@ -5214,688 +5215,166 @@ class AutocompleteField extends Field {
|
|
|
5214
5215
|
}
|
|
5215
5216
|
}
|
|
5216
5217
|
|
|
5217
|
-
|
|
5218
|
-
constructor(
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
return applyMask(value, configs, isNumber);
|
|
5236
|
-
}));
|
|
5218
|
+
class BignumberField extends Field {
|
|
5219
|
+
constructor(config) {
|
|
5220
|
+
var _a, _b, _c;
|
|
5221
|
+
super(config);
|
|
5222
|
+
this.allowNegative = (_a = config.allowNegative) !== null && _a !== void 0 ? _a : true;
|
|
5223
|
+
this.numberLocaleOptions = config.numberLocaleOptions;
|
|
5224
|
+
this.browserAutocomplete = config.browserAutocomplete;
|
|
5225
|
+
this.precision = config.precision;
|
|
5226
|
+
this.scale = (_b = config.scale) !== null && _b !== void 0 ? _b : 2;
|
|
5227
|
+
this.alignTo = this.scale ? AlignmentOptions.RIGHT : AlignmentOptions.LEFT;
|
|
5228
|
+
this.mask = config.mask;
|
|
5229
|
+
this.leftAddon = config.leftAddon;
|
|
5230
|
+
this.rightAddon = config.rightAddon;
|
|
5231
|
+
this.onBlur = config.onBlur;
|
|
5232
|
+
this.onFocus = config.onFocus;
|
|
5233
|
+
this.onComplete = config.onComplete;
|
|
5234
|
+
this.onInput = config.onInput;
|
|
5235
|
+
this.autoClear = (_c = config.autoClear) !== null && _c !== void 0 ? _c : true;
|
|
5237
5236
|
}
|
|
5238
|
-
}
|
|
5239
|
-
LocalizedBignumberPipe.ctorParameters = () => [
|
|
5240
|
-
{ type: LocaleService }
|
|
5241
|
-
];
|
|
5242
|
-
LocalizedBignumberPipe = __decorate([
|
|
5243
|
-
Pipe({
|
|
5244
|
-
name: "localizedBignumber",
|
|
5245
|
-
})
|
|
5246
|
-
], LocalizedBignumberPipe);
|
|
5237
|
+
}
|
|
5247
5238
|
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5239
|
+
class BlobField extends Field {
|
|
5240
|
+
constructor(config) {
|
|
5241
|
+
super(config);
|
|
5242
|
+
this.accept = config.accept;
|
|
5243
|
+
this.files = config.files || [];
|
|
5244
|
+
this.chooseLabel = config.chooseLabel;
|
|
5245
|
+
this.removeLabel = config.removeLabel;
|
|
5246
|
+
this.cancelLabel = config.cancelLabel;
|
|
5247
|
+
this.successTooltip = config.successTooltip;
|
|
5248
|
+
this.multiple = config.multiple;
|
|
5249
|
+
this.onUploadFile = config.onUploadFile;
|
|
5250
|
+
this.onRemoveFile = config.onRemoveFile;
|
|
5251
|
+
this.onCancelUpload = config.onCancelUpload;
|
|
5252
|
+
this.onDownloadFile = config.onDownloadFile;
|
|
5253
|
+
this.showFileUploadDate = config.showFileUploadDate;
|
|
5251
5254
|
}
|
|
5252
|
-
}
|
|
5253
|
-
LocalizedBignumberImpurePipe = __decorate([
|
|
5254
|
-
Pipe({
|
|
5255
|
-
name: "localizedBignumberImpure",
|
|
5256
|
-
pure: false,
|
|
5257
|
-
})
|
|
5258
|
-
], LocalizedBignumberImpurePipe);
|
|
5255
|
+
}
|
|
5259
5256
|
|
|
5260
|
-
class
|
|
5261
|
-
constructor(config
|
|
5262
|
-
|
|
5263
|
-
this.
|
|
5257
|
+
class BooleanOptionsLabel {
|
|
5258
|
+
constructor(config) {
|
|
5259
|
+
this.true = config.true;
|
|
5260
|
+
this.false = config.false;
|
|
5261
|
+
this.empty = config.empty;
|
|
5262
|
+
this.clear = config.clear;
|
|
5264
5263
|
}
|
|
5265
5264
|
}
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
this.
|
|
5265
|
+
class BooleanField extends Field {
|
|
5266
|
+
constructor(config) {
|
|
5267
|
+
super(config);
|
|
5268
|
+
this.verticalAlignment = config.verticalAlignment;
|
|
5269
|
+
this.optionsLabel = new BooleanOptionsLabel(config.optionsLabel);
|
|
5270
|
+
this.representedBy = "radio";
|
|
5271
|
+
this.onBlur = config.onBlur;
|
|
5272
|
+
this.onFocus = config.onFocus;
|
|
5273
|
+
this.onClick = config.onClick;
|
|
5272
5274
|
}
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5275
|
+
}
|
|
5276
|
+
|
|
5277
|
+
class BooleanSwitchField extends Field {
|
|
5278
|
+
constructor(config) {
|
|
5279
|
+
super(config);
|
|
5280
|
+
this.onChange = config.onChange;
|
|
5281
|
+
if (config.optionsLabel) {
|
|
5282
|
+
this.optionsLabel = new BooleanOptionsLabel(config.optionsLabel);
|
|
5276
5283
|
}
|
|
5277
|
-
|
|
5278
|
-
}
|
|
5279
|
-
applyMask(value, options) {
|
|
5280
|
-
return this.localeService.get().pipe(map(localeConfig => {
|
|
5281
|
-
const config = Object.assign(Object.assign({}, localeConfig.number), options);
|
|
5282
|
-
const { scale, currencySymbol, thousandsSeparator, decimalSeparator } = config;
|
|
5283
|
-
const rawValue = Number(value).toFixed(scale);
|
|
5284
|
-
const onlyNumbers = rawValue.replace(/[^0-9]/g, ``);
|
|
5285
|
-
const integerPart = onlyNumbers
|
|
5286
|
-
.slice(0, onlyNumbers.length - scale)
|
|
5287
|
-
.replace(/^0*/g, ``)
|
|
5288
|
-
.replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSeparator) || `0`;
|
|
5289
|
-
const decimalPart = onlyNumbers.slice(onlyNumbers.length - scale);
|
|
5290
|
-
const newValue = scale ? integerPart + decimalSeparator + decimalPart : integerPart;
|
|
5291
|
-
const isZero = !Number(onlyNumbers);
|
|
5292
|
-
const operator = rawValue.includes("-") && !isZero ? "-" : "";
|
|
5293
|
-
return `${operator}${currencySymbol}${newValue}`;
|
|
5294
|
-
}));
|
|
5284
|
+
this.representedBy = "switch";
|
|
5295
5285
|
}
|
|
5296
|
-
}
|
|
5297
|
-
LocalizedCurrencyPipe.ctorParameters = () => [
|
|
5298
|
-
{ type: LocaleService }
|
|
5299
|
-
];
|
|
5300
|
-
LocalizedCurrencyPipe = __decorate([
|
|
5301
|
-
Pipe({
|
|
5302
|
-
name: "localizedCurrency",
|
|
5303
|
-
})
|
|
5304
|
-
], LocalizedCurrencyPipe);
|
|
5286
|
+
}
|
|
5305
5287
|
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5288
|
+
class CalendarField extends Field {
|
|
5289
|
+
constructor(config) {
|
|
5290
|
+
super(config);
|
|
5291
|
+
this.view = config.view || "date";
|
|
5292
|
+
this.minDate = config.minDate;
|
|
5293
|
+
this.maxDate = config.maxDate;
|
|
5294
|
+
this.defaultDate = config.defaultDate;
|
|
5295
|
+
this.appendTo = config.appendTo;
|
|
5296
|
+
this.showOnFocus = typeof config.showOnFocus === "boolean" ? config.showOnFocus : true;
|
|
5297
|
+
this.calendarLocaleOptions = config.calendarLocaleOptions;
|
|
5298
|
+
this.onBlur = config.onBlur;
|
|
5299
|
+
this.onFocus = config.onFocus;
|
|
5300
|
+
this.onSelect = config.onSelect;
|
|
5301
|
+
this.onInput = config.onInput;
|
|
5302
|
+
this.onClose = config.onClose;
|
|
5303
|
+
this.onTodayClick = config.onTodayClick;
|
|
5304
|
+
this.onClearClick = config.onClearClick;
|
|
5305
|
+
this.onMonthChange = config.onMonthChange;
|
|
5306
|
+
this.onYearChange = config.onYearChange;
|
|
5307
|
+
this.selectionMode = config.selectionMode || "single";
|
|
5308
|
+
this.rangeSeparator = config.rangeSeparator || "-";
|
|
5309
|
+
this.showSeconds = config.showSeconds;
|
|
5310
|
+
// Tornando true o padrão para showSeconds.
|
|
5311
|
+
if (this.showSeconds === null || this.showSeconds === undefined) {
|
|
5312
|
+
switch (this.type) {
|
|
5313
|
+
case FieldType.DateTime:
|
|
5314
|
+
case FieldType.LocalDateTime:
|
|
5315
|
+
case FieldType.Time:
|
|
5316
|
+
this.showSeconds = true;
|
|
5317
|
+
break;
|
|
5318
|
+
}
|
|
5319
|
+
}
|
|
5312
5320
|
}
|
|
5313
|
-
}
|
|
5314
|
-
LocalizedCurrencyImpurePipe = __decorate([
|
|
5315
|
-
Pipe({
|
|
5316
|
-
name: "localizedCurrencyImpure",
|
|
5317
|
-
pure: false,
|
|
5318
|
-
})
|
|
5319
|
-
], LocalizedCurrencyImpurePipe);
|
|
5321
|
+
}
|
|
5320
5322
|
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
this.
|
|
5323
|
+
class CheckboxField extends Field {
|
|
5324
|
+
constructor(config) {
|
|
5325
|
+
super(config);
|
|
5326
|
+
this.data = config.data;
|
|
5325
5327
|
}
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
+
}
|
|
5329
|
+
|
|
5330
|
+
class ChipsField extends Field {
|
|
5331
|
+
constructor(config) {
|
|
5332
|
+
super(config);
|
|
5333
|
+
this.showCopyButton = false;
|
|
5334
|
+
this.keyFilter = config.keyFilter;
|
|
5335
|
+
this.showCopyButton = config.showCopyButton;
|
|
5336
|
+
this.separator = config.separator;
|
|
5337
|
+
this.onAdd = config.onAdd;
|
|
5338
|
+
this.onRemove = config.onRemove;
|
|
5339
|
+
this.onChipClick = config.onChipClick;
|
|
5340
|
+
this.onFocus = config.onFocus;
|
|
5341
|
+
this.onBlur = config.onBlur;
|
|
5342
|
+
this.onCopy = config.onCopy;
|
|
5328
5343
|
}
|
|
5329
|
-
}
|
|
5330
|
-
LocalizedDatePipe.ctorParameters = () => [
|
|
5331
|
-
{ type: LocaleService }
|
|
5332
|
-
];
|
|
5333
|
-
LocalizedDatePipe = __decorate([
|
|
5334
|
-
Pipe({
|
|
5335
|
-
name: "localizedDate",
|
|
5336
|
-
})
|
|
5337
|
-
], LocalizedDatePipe);
|
|
5344
|
+
}
|
|
5338
5345
|
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5346
|
+
class CountryPhonePickerField extends Field {
|
|
5347
|
+
constructor(config) {
|
|
5348
|
+
super(config);
|
|
5349
|
+
this.countries = config.countries;
|
|
5350
|
+
this.ordination = config.ordination;
|
|
5351
|
+
this.onSelected = config.onSelected;
|
|
5352
|
+
this.onFocusLost = config.onFocusLost;
|
|
5353
|
+
}
|
|
5354
|
+
}
|
|
5347
5355
|
|
|
5356
|
+
var NumberInputDirective_1;
|
|
5348
5357
|
/**
|
|
5349
|
-
* @deprecated Should use
|
|
5358
|
+
* @deprecated Should use 'AlignmentOptions' from @seniorsistemas/ng2-currency-mask instead
|
|
5350
5359
|
*/
|
|
5351
|
-
|
|
5352
|
-
|
|
5360
|
+
var NumberAlignmentOption;
|
|
5361
|
+
(function (NumberAlignmentOption) {
|
|
5362
|
+
NumberAlignmentOption["RIGHT"] = "right";
|
|
5363
|
+
NumberAlignmentOption["LEFT"] = "left";
|
|
5364
|
+
})(NumberAlignmentOption || (NumberAlignmentOption = {}));
|
|
5365
|
+
/**
|
|
5366
|
+
* @deprecated Should use BigNumberInput directive instead
|
|
5367
|
+
*/
|
|
5368
|
+
let NumberInputDirective = NumberInputDirective_1 = class NumberInputDirective extends CurrencyMaskDirective$1 {
|
|
5369
|
+
constructor(_elementRef, _keyValueDiffers, localeService) {
|
|
5370
|
+
super(null, _elementRef, _keyValueDiffers);
|
|
5353
5371
|
this.localeService = localeService;
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
return new Intl.NumberFormat(locale, {
|
|
5361
|
-
minimumFractionDigits: minimumFractionDigits || 0,
|
|
5362
|
-
}).format(Number(value));
|
|
5363
|
-
}));
|
|
5364
|
-
}
|
|
5365
|
-
};
|
|
5366
|
-
LocalizedNumberPipe.ctorParameters = () => [
|
|
5367
|
-
{ type: LocaleService }
|
|
5368
|
-
];
|
|
5369
|
-
LocalizedNumberPipe = __decorate([
|
|
5370
|
-
Pipe({ name: "localizedNumber" })
|
|
5371
|
-
], LocalizedNumberPipe);
|
|
5372
|
-
|
|
5373
|
-
const moment$2 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
5374
|
-
let LocalizedTimePipe = class LocalizedTimePipe {
|
|
5375
|
-
constructor(localeService) {
|
|
5376
|
-
this.localeService = localeService;
|
|
5377
|
-
}
|
|
5378
|
-
transform(value, format = "LTS") {
|
|
5379
|
-
return this.localeService.get().pipe(map(() => (value ? moment$2(value, "HH:mm:ss").format(format) : value)));
|
|
5380
|
-
}
|
|
5381
|
-
};
|
|
5382
|
-
LocalizedTimePipe.ctorParameters = () => [
|
|
5383
|
-
{ type: LocaleService }
|
|
5384
|
-
];
|
|
5385
|
-
LocalizedTimePipe = __decorate([
|
|
5386
|
-
Pipe({
|
|
5387
|
-
name: "localizedTime",
|
|
5388
|
-
})
|
|
5389
|
-
], LocalizedTimePipe);
|
|
5390
|
-
|
|
5391
|
-
let LocalizedTimeImpurePipe = class LocalizedTimeImpurePipe extends LocalizedTimePipe {
|
|
5392
|
-
};
|
|
5393
|
-
LocalizedTimeImpurePipe = __decorate([
|
|
5394
|
-
Pipe({
|
|
5395
|
-
name: "localizedTimeImpure",
|
|
5396
|
-
pure: false,
|
|
5397
|
-
})
|
|
5398
|
-
], LocalizedTimeImpurePipe);
|
|
5399
|
-
|
|
5400
|
-
let CurrencyService = class CurrencyService {
|
|
5401
|
-
constructor(localeService) {
|
|
5402
|
-
this.localeService = localeService;
|
|
5403
|
-
this.currencies = {
|
|
5404
|
-
KHR: { precision: 12, scale: 2 },
|
|
5405
|
-
SSP: { precision: 12, scale: 2 },
|
|
5406
|
-
XCD: { precision: 12, scale: 2 },
|
|
5407
|
-
EGP: { precision: 12, scale: 2 },
|
|
5408
|
-
KWD: { precision: 12, scale: 3 },
|
|
5409
|
-
YER: { precision: 12, scale: 2 },
|
|
5410
|
-
HUF: { precision: 12, scale: 2 },
|
|
5411
|
-
MXN: { precision: 12, scale: 2 },
|
|
5412
|
-
MYR: { precision: 12, scale: 2 },
|
|
5413
|
-
ZWL: { precision: 12, scale: 2 },
|
|
5414
|
-
MUR: { precision: 12, scale: 2 },
|
|
5415
|
-
DKK: { precision: 12, scale: 2 },
|
|
5416
|
-
NOK: { precision: 12, scale: 2 },
|
|
5417
|
-
DJF: { precision: 12, scale: 0 },
|
|
5418
|
-
CRC: { precision: 12, scale: 2 },
|
|
5419
|
-
BND: { precision: 12, scale: 2 },
|
|
5420
|
-
NAD: { precision: 12, scale: 2 },
|
|
5421
|
-
MKD: { precision: 12, scale: 2 },
|
|
5422
|
-
CDF: { precision: 12, scale: 2 },
|
|
5423
|
-
GNF: { precision: 12, scale: 0 },
|
|
5424
|
-
EUR: { precision: 12, scale: 2 },
|
|
5425
|
-
OMR: { precision: 12, scale: 3 },
|
|
5426
|
-
CLP: { precision: 12, scale: 0 },
|
|
5427
|
-
BSD: { precision: 12, scale: 2 },
|
|
5428
|
-
TOP: { precision: 12, scale: 2 },
|
|
5429
|
-
IRR: { precision: 12, scale: 2 },
|
|
5430
|
-
BGN: { precision: 12, scale: 2 },
|
|
5431
|
-
BZD: { precision: 12, scale: 2 },
|
|
5432
|
-
CNY: { precision: 12, scale: 2 },
|
|
5433
|
-
FJD: { precision: 12, scale: 2 },
|
|
5434
|
-
SRD: { precision: 12, scale: 2 },
|
|
5435
|
-
SOS: { precision: 12, scale: 2 },
|
|
5436
|
-
GYD: { precision: 12, scale: 2 },
|
|
5437
|
-
VUV: { precision: 12, scale: 0 },
|
|
5438
|
-
MWK: { precision: 12, scale: 2 },
|
|
5439
|
-
MRU: { precision: 12, scale: 2 },
|
|
5440
|
-
LSL: { precision: 12, scale: 2 },
|
|
5441
|
-
ERN: { precision: 12, scale: 2 },
|
|
5442
|
-
BMD: { precision: 12, scale: 2 },
|
|
5443
|
-
WST: { precision: 12, scale: 2 },
|
|
5444
|
-
LRD: { precision: 12, scale: 2 },
|
|
5445
|
-
GMD: { precision: 12, scale: 2 },
|
|
5446
|
-
ARS: { precision: 12, scale: 2 },
|
|
5447
|
-
ZAR: { precision: 12, scale: 2 },
|
|
5448
|
-
RSD: { precision: 12, scale: 2 },
|
|
5449
|
-
MDL: { precision: 12, scale: 2 },
|
|
5450
|
-
USD: { precision: 12, scale: 2 },
|
|
5451
|
-
QAR: { precision: 12, scale: 2 },
|
|
5452
|
-
HRK: { precision: 12, scale: 2 },
|
|
5453
|
-
GIP: { precision: 12, scale: 2 },
|
|
5454
|
-
NPR: { precision: 12, scale: 2 },
|
|
5455
|
-
"002": { precision: 9, scale: 4 },
|
|
5456
|
-
PLN: { precision: 12, scale: 2 },
|
|
5457
|
-
MAD: { precision: 12, scale: 2 },
|
|
5458
|
-
BAM: { precision: 12, scale: 2 },
|
|
5459
|
-
BTN: { precision: 12, scale: 2 },
|
|
5460
|
-
BBD: { precision: 12, scale: 2 },
|
|
5461
|
-
SHP: { precision: 12, scale: 2 },
|
|
5462
|
-
LKR: { precision: 12, scale: 2 },
|
|
5463
|
-
KPW: { precision: 12, scale: 2 },
|
|
5464
|
-
LAK: { precision: 12, scale: 2 },
|
|
5465
|
-
SZL: { precision: 12, scale: 2 },
|
|
5466
|
-
PHP: { precision: 12, scale: 2 },
|
|
5467
|
-
RWF: { precision: 12, scale: 0 },
|
|
5468
|
-
ISK: { precision: 12, scale: 0 },
|
|
5469
|
-
XOF: { precision: 12, scale: 0 },
|
|
5470
|
-
AUD: { precision: 12, scale: 2 },
|
|
5471
|
-
NGN: { precision: 12, scale: 2 },
|
|
5472
|
-
KGS: { precision: 12, scale: 2 },
|
|
5473
|
-
KYD: { precision: 12, scale: 2 },
|
|
5474
|
-
PGK: { precision: 12, scale: 2 },
|
|
5475
|
-
DZD: { precision: 12, scale: 2 },
|
|
5476
|
-
XAF: { precision: 12, scale: 0 },
|
|
5477
|
-
PEN: { precision: 12, scale: 2 },
|
|
5478
|
-
JPY: { precision: 12, scale: 0 },
|
|
5479
|
-
SBD: { precision: 12, scale: 2 },
|
|
5480
|
-
UGX: { precision: 12, scale: 0 },
|
|
5481
|
-
AMD: { precision: 12, scale: 2 },
|
|
5482
|
-
AED: { precision: 12, scale: 2 },
|
|
5483
|
-
ALL: { precision: 12, scale: 2 },
|
|
5484
|
-
XPF: { precision: 12, scale: 0 },
|
|
5485
|
-
AFN: { precision: 12, scale: 2 },
|
|
5486
|
-
RON: { precision: 12, scale: 2 },
|
|
5487
|
-
TND: { precision: 12, scale: 3 },
|
|
5488
|
-
NZD: { precision: 12, scale: 2 },
|
|
5489
|
-
JOD: { precision: 12, scale: 3 },
|
|
5490
|
-
VND: { precision: 12, scale: 0 },
|
|
5491
|
-
ETB: { precision: 12, scale: 2 },
|
|
5492
|
-
PYG: { precision: 12, scale: 0 },
|
|
5493
|
-
JMD: { precision: 12, scale: 2 },
|
|
5494
|
-
KES: { precision: 12, scale: 2 },
|
|
5495
|
-
IDR: { precision: 12, scale: 2 },
|
|
5496
|
-
HKD: { precision: 12, scale: 2 },
|
|
5497
|
-
BDT: { precision: 12, scale: 2 },
|
|
5498
|
-
GBP: { precision: 12, scale: 2 },
|
|
5499
|
-
AOA: { precision: 12, scale: 2 },
|
|
5500
|
-
PKR: { precision: 12, scale: 2 },
|
|
5501
|
-
TRY: { precision: 12, scale: 2 },
|
|
5502
|
-
SLL: { precision: 12, scale: 2 },
|
|
5503
|
-
CVE: { precision: 12, scale: 2 },
|
|
5504
|
-
LYD: { precision: 12, scale: 3 },
|
|
5505
|
-
ILS: { precision: 12, scale: 2 },
|
|
5506
|
-
UZS: { precision: 12, scale: 2 },
|
|
5507
|
-
CHF: { precision: 12, scale: 2 },
|
|
5508
|
-
SVC: { precision: 12, scale: 2 },
|
|
5509
|
-
BRL: { precision: 12, scale: 2 },
|
|
5510
|
-
GHS: { precision: 12, scale: 2 },
|
|
5511
|
-
CUP: { precision: 12, scale: 2 },
|
|
5512
|
-
FKP: { precision: 12, scale: 2 },
|
|
5513
|
-
NIO: { precision: 12, scale: 2 },
|
|
5514
|
-
GEL: { precision: 12, scale: 2 },
|
|
5515
|
-
TTD: { precision: 12, scale: 2 },
|
|
5516
|
-
AAA: { precision: 1, scale: 1 },
|
|
5517
|
-
COP: { precision: 12, scale: 2 },
|
|
5518
|
-
MGA: { precision: 12, scale: 2 },
|
|
5519
|
-
INR: { precision: 12, scale: 2 },
|
|
5520
|
-
KRW: { precision: 12, scale: 0 },
|
|
5521
|
-
HNL: { precision: 12, scale: 2 },
|
|
5522
|
-
MMK: { precision: 12, scale: 2 },
|
|
5523
|
-
TZS: { precision: 12, scale: 2 },
|
|
5524
|
-
THB: { precision: 12, scale: 2 },
|
|
5525
|
-
TMT: { precision: 12, scale: 2 },
|
|
5526
|
-
SAR: { precision: 12, scale: 2 },
|
|
5527
|
-
UYU: { precision: 12, scale: 2 },
|
|
5528
|
-
BIF: { precision: 12, scale: 0 },
|
|
5529
|
-
MVR: { precision: 12, scale: 2 },
|
|
5530
|
-
RUB: { precision: 12, scale: 2 },
|
|
5531
|
-
GTQ: { precision: 12, scale: 2 },
|
|
5532
|
-
SCR: { precision: 12, scale: 2 },
|
|
5533
|
-
IQD: { precision: 12, scale: 3 },
|
|
5534
|
-
UAH: { precision: 12, scale: 2 },
|
|
5535
|
-
BYN: { precision: 12, scale: 2 },
|
|
5536
|
-
VES: { precision: 12, scale: 2 },
|
|
5537
|
-
BOB: { precision: 12, scale: 2 },
|
|
5538
|
-
SGD: { precision: 12, scale: 2 },
|
|
5539
|
-
ZMW: { precision: 12, scale: 2 },
|
|
5540
|
-
CZK: { precision: 12, scale: 2 },
|
|
5541
|
-
TJS: { precision: 12, scale: 2 },
|
|
5542
|
-
DOP: { precision: 12, scale: 2 },
|
|
5543
|
-
AZN: { precision: 12, scale: 2 },
|
|
5544
|
-
PAB: { precision: 12, scale: 2 },
|
|
5545
|
-
STN: { precision: 12, scale: 2 },
|
|
5546
|
-
SDG: { precision: 12, scale: 2 },
|
|
5547
|
-
BWP: { precision: 12, scale: 2 },
|
|
5548
|
-
BHD: { precision: 12, scale: 3 },
|
|
5549
|
-
CAD: { precision: 12, scale: 2 },
|
|
5550
|
-
MNT: { precision: 12, scale: 2 },
|
|
5551
|
-
MOP: { precision: 12, scale: 2 },
|
|
5552
|
-
HTG: { precision: 12, scale: 2 },
|
|
5553
|
-
KZT: { precision: 12, scale: 2 },
|
|
5554
|
-
LBP: { precision: 12, scale: 2 },
|
|
5555
|
-
SYP: { precision: 12, scale: 2 },
|
|
5556
|
-
TWD: { precision: 12, scale: 2 },
|
|
5557
|
-
MZN: { precision: 12, scale: 2 },
|
|
5558
|
-
ANG: { precision: 12, scale: 2 },
|
|
5559
|
-
SEK: { precision: 12, scale: 2 },
|
|
5560
|
-
KMF: { precision: 12, scale: 0 },
|
|
5561
|
-
AWG: { precision: 12, scale: 2 },
|
|
5562
|
-
};
|
|
5563
|
-
}
|
|
5564
|
-
getCurrencySymbol({ currency }) {
|
|
5565
|
-
var _a, _b;
|
|
5566
|
-
const numberFormat = new Intl.NumberFormat(this.localeService.getLocaleOptions().locale, {
|
|
5567
|
-
style: "currency",
|
|
5568
|
-
currency: currency !== null && currency !== void 0 ? currency : "BRL",
|
|
5569
|
-
currencyDisplay: "narrowSymbol",
|
|
5570
|
-
maximumFractionDigits: 5,
|
|
5571
|
-
});
|
|
5572
|
-
return (_b = (_a = numberFormat.formatToParts(1).find((x) => x.type === "currency")) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "";
|
|
5573
|
-
}
|
|
5574
|
-
};
|
|
5575
|
-
CurrencyService.ctorParameters = () => [
|
|
5576
|
-
{ type: LocaleService }
|
|
5577
|
-
];
|
|
5578
|
-
CurrencyService.ɵprov = ɵɵdefineInjectable({ factory: function CurrencyService_Factory() { return new CurrencyService(ɵɵinject(LocaleService)); }, token: CurrencyService, providedIn: "root" });
|
|
5579
|
-
CurrencyService = __decorate([
|
|
5580
|
-
Injectable({ providedIn: "root" })
|
|
5581
|
-
], CurrencyService);
|
|
5582
|
-
|
|
5583
|
-
const isNullOrUndefined = (value) => value === null || value === undefined;
|
|
5584
|
-
|
|
5585
|
-
let NumericService = class NumericService {
|
|
5586
|
-
constructor(localeService, currencyService) {
|
|
5587
|
-
this.localeService = localeService;
|
|
5588
|
-
this.currencyService = currencyService;
|
|
5589
|
-
}
|
|
5590
|
-
/**
|
|
5591
|
-
* Wrapper around Intl.NumberFormat that returns the localized value using the user's locale by default(platform's preferential language).
|
|
5592
|
-
*
|
|
5593
|
-
* This method should only be used after the localeService has been initialized by the host application, either by a resolver or a manual call.
|
|
5594
|
-
*
|
|
5595
|
-
* Can be overwritten by the provided Intl.NumberFormatOptions.
|
|
5596
|
-
*
|
|
5597
|
-
* Documentation is available at {@link https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat Intl.NumberFormatOptions}.
|
|
5598
|
-
*
|
|
5599
|
-
* @param {number | string | BigNumber} value The value to be formatted.
|
|
5600
|
-
* @param options Locale and numberFormatOptions that overwrites the default Intl.NumberFormatOptions.
|
|
5601
|
-
* @return `string` The formatted value.
|
|
5602
|
-
*/
|
|
5603
|
-
instant(value, options) {
|
|
5604
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
5605
|
-
if (isNullOrUndefined(value))
|
|
5606
|
-
return null;
|
|
5607
|
-
options = Object.assign(Object.assign({}, options), { locale: (_c = (_a = options === null || options === void 0 ? void 0 : options.locale) !== null && _a !== void 0 ? _a : (_b = this.localeService.getLocaleOptions()) === null || _b === void 0 ? void 0 : _b.locale) !== null && _c !== void 0 ? _c : "pt-BR", numberFormatOptions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.numberFormatOptions), { currency: ((_d = options === null || options === void 0 ? void 0 : options.numberFormatOptions) === null || _d === void 0 ? void 0 : _d.style) === "currency" ? ((_f = (_e = options === null || options === void 0 ? void 0 : options.numberFormatOptions) === null || _e === void 0 ? void 0 : _e.currency) !== null && _f !== void 0 ? _f : "BRL") : undefined, currencyDisplay: ((_g = options === null || options === void 0 ? void 0 : options.numberFormatOptions) === null || _g === void 0 ? void 0 : _g.style) === "currency"
|
|
5608
|
-
? ((_j = (_h = options === null || options === void 0 ? void 0 : options.numberFormatOptions) === null || _h === void 0 ? void 0 : _h.currencyDisplay) !== null && _j !== void 0 ? _j : "narrowSymbol")
|
|
5609
|
-
: undefined, minimumFractionDigits: (_l = (_k = options === null || options === void 0 ? void 0 : options.numberFormatOptions) === null || _k === void 0 ? void 0 : _k.minimumFractionDigits) !== null && _l !== void 0 ? _l : this.getCurrencyMinimumFractionDigits((_m = options === null || options === void 0 ? void 0 : options.numberFormatOptions) === null || _m === void 0 ? void 0 : _m.currency) }) });
|
|
5610
|
-
options.numberFormatOptions["roundingMode"] = "trunc";
|
|
5611
|
-
// From https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
|
|
5612
|
-
return new Intl.NumberFormat(options.locale, options.numberFormatOptions).format(this.getType(value) === "number" || this.getType(value) === "string" ? value : value.toString());
|
|
5613
|
-
}
|
|
5614
|
-
getCurrencyMinimumFractionDigits(currency) {
|
|
5615
|
-
var _a;
|
|
5616
|
-
if (!currency)
|
|
5617
|
-
return null;
|
|
5618
|
-
return (_a = this.currencyService.currencies[currency.toUpperCase()]) === null || _a === void 0 ? void 0 : _a.scale;
|
|
5619
|
-
}
|
|
5620
|
-
getType(value) {
|
|
5621
|
-
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof
|
|
5622
|
-
if (value === null) {
|
|
5623
|
-
return "null";
|
|
5624
|
-
}
|
|
5625
|
-
const baseType = typeof value;
|
|
5626
|
-
// Primitive types
|
|
5627
|
-
if (baseType !== "object" && baseType !== "function") {
|
|
5628
|
-
return baseType;
|
|
5629
|
-
}
|
|
5630
|
-
// Symbol.toStringTag often specifies the "display name" of the
|
|
5631
|
-
// object's class. It's used in Object.prototype.toString().
|
|
5632
|
-
const tag = value[Symbol.toStringTag];
|
|
5633
|
-
if (typeof tag === "string") {
|
|
5634
|
-
return tag;
|
|
5635
|
-
}
|
|
5636
|
-
// If it's a function whose source code starts with the "class" keyword
|
|
5637
|
-
if (baseType === "function" && Function.prototype.toString.call(value).startsWith("class")) {
|
|
5638
|
-
return "class";
|
|
5639
|
-
}
|
|
5640
|
-
// The name of the constructor; for example `Array`, `GeneratorFunction`,
|
|
5641
|
-
// `Number`, `String`, `Boolean` or `MyCustomClass`
|
|
5642
|
-
const className = value.constructor.name;
|
|
5643
|
-
if (typeof className === "string" && className !== "") {
|
|
5644
|
-
return className;
|
|
5645
|
-
}
|
|
5646
|
-
// At this point there's no robust way to get the type of value,
|
|
5647
|
-
// so we use the base implementation.
|
|
5648
|
-
return baseType;
|
|
5649
|
-
}
|
|
5650
|
-
};
|
|
5651
|
-
NumericService.ctorParameters = () => [
|
|
5652
|
-
{ type: LocaleService },
|
|
5653
|
-
{ type: CurrencyService }
|
|
5654
|
-
];
|
|
5655
|
-
NumericService.ɵprov = ɵɵdefineInjectable({ factory: function NumericService_Factory() { return new NumericService(ɵɵinject(LocaleService), ɵɵinject(CurrencyService)); }, token: NumericService, providedIn: "root" });
|
|
5656
|
-
NumericService = __decorate([
|
|
5657
|
-
Injectable({
|
|
5658
|
-
providedIn: "root",
|
|
5659
|
-
})
|
|
5660
|
-
], NumericService);
|
|
5661
|
-
|
|
5662
|
-
let NumericPipe = class NumericPipe {
|
|
5663
|
-
constructor(numericService, localeService) {
|
|
5664
|
-
this.numericService = numericService;
|
|
5665
|
-
this.localeService = localeService;
|
|
5666
|
-
}
|
|
5667
|
-
transform(value, options) {
|
|
5668
|
-
return (options === null || options === void 0 ? void 0 : options.locale) ? of(this.numericService.instant(value, options))
|
|
5669
|
-
: this.localeService.getLocale().pipe(map((locale) => this.numericService.instant(value, {
|
|
5670
|
-
locale,
|
|
5671
|
-
numberFormatOptions: options === null || options === void 0 ? void 0 : options.numberFormatOptions,
|
|
5672
|
-
})));
|
|
5673
|
-
}
|
|
5674
|
-
};
|
|
5675
|
-
NumericPipe.ctorParameters = () => [
|
|
5676
|
-
{ type: NumericService },
|
|
5677
|
-
{ type: LocaleService }
|
|
5678
|
-
];
|
|
5679
|
-
NumericPipe = __decorate([
|
|
5680
|
-
Pipe({ name: "numeric" })
|
|
5681
|
-
], NumericPipe);
|
|
5682
|
-
|
|
5683
|
-
var LocaleModule_1;
|
|
5684
|
-
let LocaleModule = LocaleModule_1 = class LocaleModule {
|
|
5685
|
-
static forRoot() {
|
|
5686
|
-
return {
|
|
5687
|
-
ngModule: LocaleModule_1,
|
|
5688
|
-
providers: [
|
|
5689
|
-
LocaleService,
|
|
5690
|
-
LocalizedCurrencyPipe,
|
|
5691
|
-
LocalizedDatePipe,
|
|
5692
|
-
LocalizedTimePipe,
|
|
5693
|
-
LocalizedNumberPipe,
|
|
5694
|
-
LocalizedCurrencyImpurePipe,
|
|
5695
|
-
LocalizedDateImpurePipe,
|
|
5696
|
-
LocalizedTimeImpurePipe,
|
|
5697
|
-
LocalizedBignumberPipe,
|
|
5698
|
-
LocalizedBignumberImpurePipe,
|
|
5699
|
-
NumericPipe
|
|
5700
|
-
],
|
|
5701
|
-
};
|
|
5702
|
-
}
|
|
5703
|
-
static forChild() {
|
|
5704
|
-
return {
|
|
5705
|
-
ngModule: LocaleModule_1,
|
|
5706
|
-
};
|
|
5707
|
-
}
|
|
5708
|
-
};
|
|
5709
|
-
LocaleModule = LocaleModule_1 = __decorate([
|
|
5710
|
-
NgModule({
|
|
5711
|
-
imports: [CommonModule],
|
|
5712
|
-
exports: [
|
|
5713
|
-
LocalizedCurrencyPipe,
|
|
5714
|
-
LocalizedDatePipe,
|
|
5715
|
-
LocalizedTimePipe,
|
|
5716
|
-
LocalizedNumberPipe,
|
|
5717
|
-
LocalizedCurrencyImpurePipe,
|
|
5718
|
-
LocalizedDateImpurePipe,
|
|
5719
|
-
LocalizedTimeImpurePipe,
|
|
5720
|
-
LocalizedBignumberPipe,
|
|
5721
|
-
LocalizedBignumberImpurePipe,
|
|
5722
|
-
NumericPipe
|
|
5723
|
-
],
|
|
5724
|
-
declarations: [
|
|
5725
|
-
LocalizedCurrencyPipe,
|
|
5726
|
-
LocalizedDatePipe,
|
|
5727
|
-
LocalizedTimePipe,
|
|
5728
|
-
LocalizedNumberPipe,
|
|
5729
|
-
LocalizedCurrencyImpurePipe,
|
|
5730
|
-
LocalizedDateImpurePipe,
|
|
5731
|
-
LocalizedTimeImpurePipe,
|
|
5732
|
-
LocalizedBignumberPipe,
|
|
5733
|
-
LocalizedBignumberImpurePipe,
|
|
5734
|
-
NumericPipe
|
|
5735
|
-
],
|
|
5736
|
-
})
|
|
5737
|
-
], LocaleModule);
|
|
5738
|
-
|
|
5739
|
-
class BignumberField extends Field {
|
|
5740
|
-
constructor(config) {
|
|
5741
|
-
var _a, _b, _c, _d;
|
|
5742
|
-
super(config);
|
|
5743
|
-
this.allowNegative = (_a = config.allowNegative) !== null && _a !== void 0 ? _a : true;
|
|
5744
|
-
this.numberLocaleOptions = (_b = config.numberLocaleOptions) !== null && _b !== void 0 ? _b : new NumberLocaleOptions();
|
|
5745
|
-
this.browserAutocomplete = config.browserAutocomplete;
|
|
5746
|
-
this.precision = config.precision;
|
|
5747
|
-
this.scale = (_c = config.scale) !== null && _c !== void 0 ? _c : 2;
|
|
5748
|
-
this.alignTo = this.scale ? AlignmentOptions.RIGHT : AlignmentOptions.LEFT;
|
|
5749
|
-
this.mask = config.mask;
|
|
5750
|
-
this.leftAddon = config.leftAddon;
|
|
5751
|
-
this.rightAddon = config.rightAddon;
|
|
5752
|
-
this.onBlur = config.onBlur;
|
|
5753
|
-
this.onFocus = config.onFocus;
|
|
5754
|
-
this.onComplete = config.onComplete;
|
|
5755
|
-
this.onInput = config.onInput;
|
|
5756
|
-
this.autoClear = (_d = config.autoClear) !== null && _d !== void 0 ? _d : true;
|
|
5757
|
-
}
|
|
5758
|
-
}
|
|
5759
|
-
|
|
5760
|
-
class BlobField extends Field {
|
|
5761
|
-
constructor(config) {
|
|
5762
|
-
super(config);
|
|
5763
|
-
this.accept = config.accept;
|
|
5764
|
-
this.files = config.files || [];
|
|
5765
|
-
this.chooseLabel = config.chooseLabel;
|
|
5766
|
-
this.removeLabel = config.removeLabel;
|
|
5767
|
-
this.cancelLabel = config.cancelLabel;
|
|
5768
|
-
this.successTooltip = config.successTooltip;
|
|
5769
|
-
this.multiple = config.multiple;
|
|
5770
|
-
this.onUploadFile = config.onUploadFile;
|
|
5771
|
-
this.onRemoveFile = config.onRemoveFile;
|
|
5772
|
-
this.onCancelUpload = config.onCancelUpload;
|
|
5773
|
-
this.onDownloadFile = config.onDownloadFile;
|
|
5774
|
-
this.showFileUploadDate = config.showFileUploadDate;
|
|
5775
|
-
}
|
|
5776
|
-
}
|
|
5777
|
-
|
|
5778
|
-
class BooleanOptionsLabel {
|
|
5779
|
-
constructor(config) {
|
|
5780
|
-
this.true = config.true;
|
|
5781
|
-
this.false = config.false;
|
|
5782
|
-
this.empty = config.empty;
|
|
5783
|
-
this.clear = config.clear;
|
|
5784
|
-
}
|
|
5785
|
-
}
|
|
5786
|
-
class BooleanField extends Field {
|
|
5787
|
-
constructor(config) {
|
|
5788
|
-
super(config);
|
|
5789
|
-
this.verticalAlignment = config.verticalAlignment;
|
|
5790
|
-
this.optionsLabel = new BooleanOptionsLabel(config.optionsLabel);
|
|
5791
|
-
this.representedBy = "radio";
|
|
5792
|
-
this.onBlur = config.onBlur;
|
|
5793
|
-
this.onFocus = config.onFocus;
|
|
5794
|
-
this.onClick = config.onClick;
|
|
5795
|
-
}
|
|
5796
|
-
}
|
|
5797
|
-
|
|
5798
|
-
class BooleanSwitchField extends Field {
|
|
5799
|
-
constructor(config) {
|
|
5800
|
-
super(config);
|
|
5801
|
-
this.onChange = config.onChange;
|
|
5802
|
-
if (config.optionsLabel) {
|
|
5803
|
-
this.optionsLabel = new BooleanOptionsLabel(config.optionsLabel);
|
|
5804
|
-
}
|
|
5805
|
-
this.representedBy = "switch";
|
|
5806
|
-
}
|
|
5807
|
-
}
|
|
5808
|
-
|
|
5809
|
-
class CalendarField extends Field {
|
|
5810
|
-
constructor(config) {
|
|
5811
|
-
super(config);
|
|
5812
|
-
this.view = config.view || "date";
|
|
5813
|
-
this.minDate = config.minDate;
|
|
5814
|
-
this.maxDate = config.maxDate;
|
|
5815
|
-
this.defaultDate = config.defaultDate;
|
|
5816
|
-
this.appendTo = config.appendTo;
|
|
5817
|
-
this.showOnFocus = typeof config.showOnFocus === "boolean" ? config.showOnFocus : true;
|
|
5818
|
-
this.calendarLocaleOptions = config.calendarLocaleOptions;
|
|
5819
|
-
this.onBlur = config.onBlur;
|
|
5820
|
-
this.onFocus = config.onFocus;
|
|
5821
|
-
this.onSelect = config.onSelect;
|
|
5822
|
-
this.onInput = config.onInput;
|
|
5823
|
-
this.onClose = config.onClose;
|
|
5824
|
-
this.onTodayClick = config.onTodayClick;
|
|
5825
|
-
this.onClearClick = config.onClearClick;
|
|
5826
|
-
this.onMonthChange = config.onMonthChange;
|
|
5827
|
-
this.onYearChange = config.onYearChange;
|
|
5828
|
-
this.selectionMode = config.selectionMode || "single";
|
|
5829
|
-
this.rangeSeparator = config.rangeSeparator || "-";
|
|
5830
|
-
this.showSeconds = config.showSeconds;
|
|
5831
|
-
// Tornando true o padrão para showSeconds.
|
|
5832
|
-
if (this.showSeconds === null || this.showSeconds === undefined) {
|
|
5833
|
-
switch (this.type) {
|
|
5834
|
-
case FieldType.DateTime:
|
|
5835
|
-
case FieldType.LocalDateTime:
|
|
5836
|
-
case FieldType.Time:
|
|
5837
|
-
this.showSeconds = true;
|
|
5838
|
-
break;
|
|
5839
|
-
}
|
|
5840
|
-
}
|
|
5841
|
-
}
|
|
5842
|
-
}
|
|
5843
|
-
|
|
5844
|
-
class CheckboxField extends Field {
|
|
5845
|
-
constructor(config) {
|
|
5846
|
-
super(config);
|
|
5847
|
-
this.data = config.data;
|
|
5848
|
-
}
|
|
5849
|
-
}
|
|
5850
|
-
|
|
5851
|
-
class ChipsField extends Field {
|
|
5852
|
-
constructor(config) {
|
|
5853
|
-
super(config);
|
|
5854
|
-
this.showCopyButton = false;
|
|
5855
|
-
this.keyFilter = config.keyFilter;
|
|
5856
|
-
this.showCopyButton = config.showCopyButton;
|
|
5857
|
-
this.separator = config.separator;
|
|
5858
|
-
this.onAdd = config.onAdd;
|
|
5859
|
-
this.onRemove = config.onRemove;
|
|
5860
|
-
this.onChipClick = config.onChipClick;
|
|
5861
|
-
this.onFocus = config.onFocus;
|
|
5862
|
-
this.onBlur = config.onBlur;
|
|
5863
|
-
this.onCopy = config.onCopy;
|
|
5864
|
-
}
|
|
5865
|
-
}
|
|
5866
|
-
|
|
5867
|
-
class CountryPhonePickerField extends Field {
|
|
5868
|
-
constructor(config) {
|
|
5869
|
-
super(config);
|
|
5870
|
-
this.countries = config.countries;
|
|
5871
|
-
this.ordination = config.ordination;
|
|
5872
|
-
this.onSelected = config.onSelected;
|
|
5873
|
-
this.onFocusLost = config.onFocusLost;
|
|
5874
|
-
}
|
|
5875
|
-
}
|
|
5876
|
-
|
|
5877
|
-
var NumberInputDirective_1;
|
|
5878
|
-
/**
|
|
5879
|
-
* @deprecated Should use 'AlignmentOptions' from @seniorsistemas/ng2-currency-mask instead
|
|
5880
|
-
*/
|
|
5881
|
-
var NumberAlignmentOption;
|
|
5882
|
-
(function (NumberAlignmentOption) {
|
|
5883
|
-
NumberAlignmentOption["RIGHT"] = "right";
|
|
5884
|
-
NumberAlignmentOption["LEFT"] = "left";
|
|
5885
|
-
})(NumberAlignmentOption || (NumberAlignmentOption = {}));
|
|
5886
|
-
/**
|
|
5887
|
-
* @deprecated Should use BigNumberInput directive instead
|
|
5888
|
-
*/
|
|
5889
|
-
let NumberInputDirective = NumberInputDirective_1 = class NumberInputDirective extends CurrencyMaskDirective$1 {
|
|
5890
|
-
constructor(_elementRef, _keyValueDiffers, localeService) {
|
|
5891
|
-
super(null, _elementRef, _keyValueDiffers);
|
|
5892
|
-
this.localeService = localeService;
|
|
5893
|
-
this.precision = 15;
|
|
5894
|
-
this.scale = 0;
|
|
5895
|
-
this.alignTo = NumberAlignmentOption.LEFT;
|
|
5896
|
-
this.allowNegative = true;
|
|
5897
|
-
this.regex = /\d/;
|
|
5898
|
-
this.onLocaleService();
|
|
5372
|
+
this.precision = 15;
|
|
5373
|
+
this.scale = 0;
|
|
5374
|
+
this.alignTo = NumberAlignmentOption.LEFT;
|
|
5375
|
+
this.allowNegative = true;
|
|
5376
|
+
this.regex = /\d/;
|
|
5377
|
+
this.onLocaleService();
|
|
5899
5378
|
}
|
|
5900
5379
|
ngOnInit() {
|
|
5901
5380
|
this.updateVariables();
|
|
@@ -6027,9 +5506,8 @@ NumberInputModule = __decorate([
|
|
|
6027
5506
|
*/
|
|
6028
5507
|
class NumberField extends Field {
|
|
6029
5508
|
constructor(config) {
|
|
6030
|
-
var _a;
|
|
6031
5509
|
super(config);
|
|
6032
|
-
this.numberLocaleOptions =
|
|
5510
|
+
this.numberLocaleOptions = config.numberLocaleOptions;
|
|
6033
5511
|
this.browserAutocomplete = config.browserAutocomplete;
|
|
6034
5512
|
this.precision = config.precision;
|
|
6035
5513
|
this.scale = config.scale;
|
|
@@ -6049,9 +5527,8 @@ class NumberField extends Field {
|
|
|
6049
5527
|
*/
|
|
6050
5528
|
class DecimalField extends NumberField {
|
|
6051
5529
|
constructor(config) {
|
|
6052
|
-
var _a;
|
|
6053
5530
|
super(config);
|
|
6054
|
-
this.numberLocaleOptions =
|
|
5531
|
+
this.numberLocaleOptions = config.numberLocaleOptions;
|
|
6055
5532
|
this.alignTo = config.alignTo || NumberAlignmentOption.RIGHT;
|
|
6056
5533
|
this.scale = typeof config.scale === "function" ? config.scale() : config.scale;
|
|
6057
5534
|
}
|
|
@@ -6062,10 +5539,9 @@ class DecimalField extends NumberField {
|
|
|
6062
5539
|
*/
|
|
6063
5540
|
class CurrencyField extends DecimalField {
|
|
6064
5541
|
constructor(config) {
|
|
6065
|
-
var _a;
|
|
6066
5542
|
super(config);
|
|
6067
5543
|
this.currency = config['currency'];
|
|
6068
|
-
this.numberLocaleOptions =
|
|
5544
|
+
this.numberLocaleOptions = config.numberLocaleOptions;
|
|
6069
5545
|
}
|
|
6070
5546
|
}
|
|
6071
5547
|
|
|
@@ -7403,6 +6879,8 @@ const convertToMomentDateFormat = (format) => {
|
|
|
7403
6879
|
.replace(/\byy\b/, "YYYY"); // year (four digits)
|
|
7404
6880
|
};
|
|
7405
6881
|
|
|
6882
|
+
const isNullOrUndefined = (value) => value === null || value === undefined;
|
|
6883
|
+
|
|
7406
6884
|
var ValidateErrors;
|
|
7407
6885
|
(function (ValidateErrors) {
|
|
7408
6886
|
ValidateErrors["MAX_FILE_SIZE"] = "MAX_FILE_SIZE";
|
|
@@ -7424,7 +6902,7 @@ const ALL_PERMISSIONS = [
|
|
|
7424
6902
|
];
|
|
7425
6903
|
|
|
7426
6904
|
var FileUploadComponent_1;
|
|
7427
|
-
const moment$
|
|
6905
|
+
const moment$1 = moment_;
|
|
7428
6906
|
let FileUploadComponent = FileUploadComponent_1 = class FileUploadComponent {
|
|
7429
6907
|
constructor(sanitizer, fileUploadService, translate) {
|
|
7430
6908
|
this.sanitizer = sanitizer;
|
|
@@ -7588,11 +7066,11 @@ let FileUploadComponent = FileUploadComponent_1 = class FileUploadComponent {
|
|
|
7588
7066
|
.then(metadata => this.setModifiedDate(metadata));
|
|
7589
7067
|
}
|
|
7590
7068
|
setModifiedDate(metadata) {
|
|
7591
|
-
const hour = moment$
|
|
7592
|
-
const minutes = moment$
|
|
7593
|
-
const day = moment$
|
|
7594
|
-
const month = moment$
|
|
7595
|
-
const fullYear = moment$
|
|
7069
|
+
const hour = moment$1(metadata.modified).format("HH");
|
|
7070
|
+
const minutes = moment$1(metadata.modified).format("mm");
|
|
7071
|
+
const day = moment$1(metadata.modified).format("DD");
|
|
7072
|
+
const month = moment$1(metadata.modified).format("MM");
|
|
7073
|
+
const fullYear = moment$1(metadata.modified).format("YYYY");
|
|
7596
7074
|
this.modifiedDate = this.translate.instant("platform.angular_components.date_modified_custom_blob", { hour, minutes, day, month, fullYear });
|
|
7597
7075
|
}
|
|
7598
7076
|
};
|
|
@@ -7737,317 +7215,837 @@ let InfoSignDirective = class InfoSignDirective {
|
|
|
7737
7215
|
ngOnInit() {
|
|
7738
7216
|
this.createInfoSign();
|
|
7739
7217
|
}
|
|
7740
|
-
ngOnDestroy() {
|
|
7741
|
-
if (this.componentRef) {
|
|
7742
|
-
this.componentRef.destroy();
|
|
7218
|
+
ngOnDestroy() {
|
|
7219
|
+
if (this.componentRef) {
|
|
7220
|
+
this.componentRef.destroy();
|
|
7221
|
+
}
|
|
7222
|
+
}
|
|
7223
|
+
createInfoSign() {
|
|
7224
|
+
if (!this.componentRef && this.sInfoSign) {
|
|
7225
|
+
this.viewContainer.clear();
|
|
7226
|
+
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(InfoSignComponent);
|
|
7227
|
+
this.componentRef = this.viewContainer.createComponent(componentFactory);
|
|
7228
|
+
this.componentRef.instance.templateRef = this.templateRef;
|
|
7229
|
+
this.componentRef.instance.tooltip = this.sInfoSign;
|
|
7230
|
+
this.componentRef.instance.displayTime = this.displayTime;
|
|
7231
|
+
this.componentRef.instance.focusedInputRef = this.focusedInputRef;
|
|
7232
|
+
}
|
|
7233
|
+
else if (this.componentRef && this.sInfoSign) {
|
|
7234
|
+
this.componentRef.instance.tooltip = this.sInfoSign;
|
|
7235
|
+
}
|
|
7236
|
+
else {
|
|
7237
|
+
this.viewContainer.clear();
|
|
7238
|
+
this.viewContainer.createEmbeddedView(this.templateRef);
|
|
7239
|
+
}
|
|
7240
|
+
}
|
|
7241
|
+
};
|
|
7242
|
+
InfoSignDirective.ctorParameters = () => [
|
|
7243
|
+
{ type: TemplateRef },
|
|
7244
|
+
{ type: ViewContainerRef },
|
|
7245
|
+
{ type: ComponentFactoryResolver }
|
|
7246
|
+
];
|
|
7247
|
+
__decorate([
|
|
7248
|
+
Input()
|
|
7249
|
+
], InfoSignDirective.prototype, "sInfoSign", void 0);
|
|
7250
|
+
__decorate([
|
|
7251
|
+
Input('sInfoSignDisplayTime')
|
|
7252
|
+
], InfoSignDirective.prototype, "displayTime", void 0);
|
|
7253
|
+
__decorate([
|
|
7254
|
+
Input('sInfoSignFocusedInputRef')
|
|
7255
|
+
], InfoSignDirective.prototype, "focusedInputRef", void 0);
|
|
7256
|
+
InfoSignDirective = __decorate([
|
|
7257
|
+
Directive({
|
|
7258
|
+
selector: "[sInfoSign]"
|
|
7259
|
+
})
|
|
7260
|
+
], InfoSignDirective);
|
|
7261
|
+
|
|
7262
|
+
let InfoSignModule = class InfoSignModule {
|
|
7263
|
+
};
|
|
7264
|
+
InfoSignModule = __decorate([
|
|
7265
|
+
NgModule({
|
|
7266
|
+
imports: [
|
|
7267
|
+
TooltipModule,
|
|
7268
|
+
CommonModule,
|
|
7269
|
+
],
|
|
7270
|
+
declarations: [
|
|
7271
|
+
InfoSignDirective,
|
|
7272
|
+
InfoSignComponent,
|
|
7273
|
+
],
|
|
7274
|
+
exports: [InfoSignDirective],
|
|
7275
|
+
entryComponents: [InfoSignComponent],
|
|
7276
|
+
})
|
|
7277
|
+
], InfoSignModule);
|
|
7278
|
+
|
|
7279
|
+
let IAssistIconComponent = class IAssistIconComponent {
|
|
7280
|
+
};
|
|
7281
|
+
IAssistIconComponent = __decorate([
|
|
7282
|
+
Component({
|
|
7283
|
+
template: "<svg style=\"width: 100%; height: 100%;\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5.81451 18.1054L5.99593 17.6059L7.52166 13.4099L7.60877 13.1726L7.61277 13.1614L7.94285 12.2543L8.01159 12.0648L8.05394 11.949L5.2998 8.52426L5.02726 8.18379C5.00569 8.15821 4.9881 8.13104 4.97292 8.10226C4.90099 7.9632 4.85063 7.81294 4.82186 7.6531C4.73075 7.1344 4.90418 6.60771 5.28382 6.24326C5.29421 6.23447 5.3038 6.22567 5.31419 6.21688L5.47164 6.0914L9.3439 3.00238L9.5469 2.84094L9.57088 2.82096L10.4101 2.15041L11.8007 1.04188C11.2181 0.925188 10.6163 0.863647 10.0001 0.863647C4.95374 0.863647 0.863281 4.9541 0.863281 9.99963C0.863281 13.5346 2.87254 16.5989 5.80971 18.1182\" fill=\"#0FA389\"/>\n <path d=\"M14.099 1.83472L13.9495 2.24632L11.997 7.61074L11.9427 7.7594L11.9003 7.87369L14.7448 11.4103C14.7463 11.4127 14.7479 11.4143 14.7495 11.4167L14.9414 11.654C14.9541 11.67 14.9661 11.6868 14.9765 11.7044C15.0764 11.8698 15.1444 12.0505 15.1779 12.2431C15.273 12.7826 15.0812 13.3284 14.676 13.6897C14.656 13.7129 14.6345 13.7344 14.6105 13.7536L11.8563 15.9507L11.6789 16.0922L11.6022 16.1537L10.7406 16.8402V16.841L10.3937 17.1176L9.85747 17.5452L9.39951 17.9112L8.11035 18.9398C8.72016 19.0677 9.35155 19.1364 9.99973 19.1364C15.0461 19.1364 19.1365 15.046 19.1365 9.99964C19.1365 6.42789 17.0857 3.33727 14.099 1.83472Z\" fill=\"#0FA389\"/>\n <path d=\"M14.7287 12.3222C14.7047 12.1832 14.6551 12.0545 14.5864 11.941L14.3954 11.7036C14.3954 11.7036 14.3946 11.7028 14.3938 11.7028L11.3839 7.96005L10.5031 6.86511L10.4256 6.7676L9.03255 5.03487L8.83674 4.79191C8.79278 4.71678 8.75681 4.63446 8.73204 4.54814C8.72085 4.51058 8.71286 4.47222 8.70566 4.43465C8.68568 4.32196 8.68408 4.21007 8.69847 4.10217L8.62334 4.16291L8.44511 4.30438L5.75731 6.44871L5.60066 6.57339C5.34011 6.82275 5.20584 7.19279 5.27218 7.57482C5.29296 7.68751 5.32892 7.79541 5.37927 7.89292C5.37927 7.89292 5.37927 7.89292 5.38007 7.89371L5.6566 8.23818L8.57139 11.8627L8.63293 11.9394L9.53047 13.0559L9.59041 13.1303L9.98363 13.6186L11.0178 14.9046C11.0186 14.9054 11.0194 14.9069 11.0202 14.9077L11.1361 15.0516V15.0524C11.2184 15.1755 11.2768 15.317 11.3048 15.4728C11.3239 15.5807 11.3263 15.6878 11.3143 15.7925L11.3175 15.7965L11.3943 15.735L11.5717 15.5935L14.3266 13.3964L14.3218 13.3908C14.6335 13.1438 14.8022 12.7394 14.7287 12.3222Z\" fill=\"#F3F3F5\"/>\n <path d=\"M10.6822 15.0082C10.6814 15.0074 10.6806 15.0058 10.6806 15.005L10.5672 14.8643L10.3809 14.6325L10.3282 14.567L10.2211 14.4335L9.40028 13.4129L9.32835 13.3242L8.77289 12.6345L8.68098 12.5194L8.44121 12.2205L8.37168 12.4099L8.04159 13.317L8.0376 13.329L7.95128 13.5664L6.42475 17.7623L6.24333 18.2618L5.90605 19.1881L5.73262 19.6645C5.73182 19.6661 5.73102 19.6677 5.73102 19.6685C5.72863 19.6749 5.72703 19.6821 5.72543 19.6885C5.71584 19.7228 5.71424 19.758 5.72063 19.7948C5.74461 19.929 5.87329 20.0193 6.00836 19.9962C6.04112 19.9898 6.07229 19.9778 6.09867 19.9602C6.09867 19.9602 6.09947 19.9602 6.10027 19.9594L6.14103 19.9266L7.39422 18.9268L9.11496 17.5537L9.57292 17.1877L10.1092 16.7601L10.4561 16.4827L10.4537 16.4811C10.7582 16.2382 10.9236 15.8402 10.8509 15.4294C10.8237 15.2735 10.7654 15.1313 10.6822 15.0082Z\" fill=\"#0C847B\"/>\n <path d=\"M9.17644 4.56325C9.2124 4.68713 9.26915 4.80062 9.34268 4.90053C9.34348 4.90053 9.34428 4.90213 9.34428 4.90213L9.40342 4.97645C9.40502 4.97805 9.40582 4.97885 9.40662 4.98045L9.56806 5.17946L9.64878 5.28096L9.67915 5.31932L9.8414 5.51993L10.5559 6.40947L10.7054 6.59569L11.2169 7.23188L11.5142 7.60192L11.5693 7.45247L13.5202 2.08964L14.1596 0.332135C14.1596 0.330536 14.1604 0.328139 14.1612 0.32654C14.174 0.288177 14.1772 0.246617 14.17 0.205058C14.1468 0.0699879 14.0182 -0.0195258 13.8823 0.00365186C13.8407 0.0116442 13.8024 0.028428 13.7712 0.0540033L12.578 1.00589L12.498 1.06982L10.6958 2.50844L9.85658 3.17819L9.8326 3.19737L9.6296 3.35961L9.45297 3.50028C9.2116 3.73925 9.08692 4.08931 9.15006 4.44976C9.15726 4.48813 9.16525 4.52649 9.17644 4.56325Z\" fill=\"#0C847B\"/>\n</svg>"
|
|
7284
|
+
})
|
|
7285
|
+
], IAssistIconComponent);
|
|
7286
|
+
|
|
7287
|
+
let SeniorIconComponent = class SeniorIconComponent {
|
|
7288
|
+
};
|
|
7289
|
+
SeniorIconComponent = __decorate([
|
|
7290
|
+
Component({
|
|
7291
|
+
template: "<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 348 613\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g filter=\"url(#filter0_d_2841_2040)\">\n <path d=\"M174.719 518.932L258.161 439.782C264.546 433.762 269.614 426.603 273.072 418.719C276.53 410.834 278.31 402.378 278.31 393.838C278.31 385.298 276.53 376.843 273.072 368.958C269.614 361.073 264.546 353.915 258.161 347.895L174.719 269.199C168.45 263.304 163.474 256.289 160.077 248.56C156.681 240.83 154.933 232.539 154.933 224.165C154.933 215.792 156.681 207.501 160.077 199.771C163.474 192.042 168.45 185.027 174.719 179.132L303.718 301.496C329.517 326.089 344 359.371 344 394.066C344 428.76 329.517 462.043 303.718 486.635L174.719 609C168.45 603.105 163.474 596.09 160.077 588.36C156.681 580.631 154.933 572.34 154.933 563.966C154.933 555.592 156.681 547.301 160.077 539.572C163.474 531.842 168.45 524.828 174.719 518.932ZM173.76 94.0677L90.3189 173.218C83.9334 179.238 78.8659 186.397 75.408 194.281C71.95 202.166 70.1698 210.622 70.1698 219.162C70.1698 227.702 71.95 236.157 75.408 244.042C78.8659 251.927 83.9334 259.085 90.3189 265.105L173.76 344.256C180.03 350.151 185.006 357.166 188.402 364.895C191.798 372.625 193.547 380.916 193.547 389.289C193.547 397.663 191.798 405.954 188.402 413.684C185.006 421.413 180.03 428.428 173.76 434.323L44.2823 311.504C18.4832 286.911 4 253.629 4 218.934C4 184.24 18.4832 150.957 44.2823 126.365L173.76 4C186.213 16.0129 193.192 32.1861 193.192 49.0338C193.192 65.8815 186.213 82.0547 173.76 94.0677Z\" fill=\"white\" />\n </g>\n <defs>\n <filter id=\"filter0_d_2841_2040\" x=\"0\" y=\"0\" width=\"348\" height=\"613\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\" >\n <feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\" />\n <feColorMatrix in=\"SourceAlpha\" type=\"matrix\" values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\" result=\"hardAlpha\" />\n <feOffset />\n <feGaussianBlur stdDeviation=\"2\" />\n <feComposite in2=\"hardAlpha\" operator=\"out\" />\n <feColorMatrix type=\"matrix\" values=\"0 0 0 0 0.418936 0 0 0 0 1 0 0 0 0 0.930272 0 0 0 0.35 0\" />\n <feBlend mode=\"normal\" in2=\"BackgroundImageFix\" result=\"effect1_dropShadow_2841_2040\" />\n <feBlend mode=\"normal\" in=\"SourceGraphic\" in2=\"effect1_dropShadow_2841_2040\" result=\"shape\" />\n </filter>\n </defs>\n</svg>\n"
|
|
7292
|
+
})
|
|
7293
|
+
], SeniorIconComponent);
|
|
7294
|
+
|
|
7295
|
+
var SVGFactoryIcons;
|
|
7296
|
+
(function (SVGFactoryIcons) {
|
|
7297
|
+
SVGFactoryIcons["IAssist"] = "iassist";
|
|
7298
|
+
SVGFactoryIcons["Senior"] = "senior";
|
|
7299
|
+
})(SVGFactoryIcons || (SVGFactoryIcons = {}));
|
|
7300
|
+
|
|
7301
|
+
let SVGFactoryDirective = class SVGFactoryDirective {
|
|
7302
|
+
constructor(viewContainerRef, componentFactoryResolver, cdr) {
|
|
7303
|
+
this.viewContainerRef = viewContainerRef;
|
|
7304
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
7305
|
+
this.cdr = cdr;
|
|
7306
|
+
this._iconClass = this._getIconClass(SVGFactoryIcons.Senior);
|
|
7307
|
+
}
|
|
7308
|
+
set sSVGFactory(icon) {
|
|
7309
|
+
this._iconClass = this._getIconClass(icon);
|
|
7310
|
+
}
|
|
7311
|
+
ngAfterViewInit() {
|
|
7312
|
+
this._createComponent();
|
|
7313
|
+
}
|
|
7314
|
+
_createComponent() {
|
|
7315
|
+
const factory = this.componentFactoryResolver.resolveComponentFactory(this._iconClass);
|
|
7316
|
+
this.viewContainerRef.clear();
|
|
7317
|
+
this.viewContainerRef.createComponent(factory);
|
|
7318
|
+
this.cdr.detectChanges();
|
|
7319
|
+
}
|
|
7320
|
+
_getIconClass(icon) {
|
|
7321
|
+
switch (icon) {
|
|
7322
|
+
case SVGFactoryIcons.IAssist:
|
|
7323
|
+
return IAssistIconComponent;
|
|
7324
|
+
case SVGFactoryIcons.Senior:
|
|
7325
|
+
default:
|
|
7326
|
+
return SeniorIconComponent;
|
|
7327
|
+
}
|
|
7328
|
+
}
|
|
7329
|
+
};
|
|
7330
|
+
SVGFactoryDirective.ctorParameters = () => [
|
|
7331
|
+
{ type: ViewContainerRef },
|
|
7332
|
+
{ type: ComponentFactoryResolver },
|
|
7333
|
+
{ type: ChangeDetectorRef }
|
|
7334
|
+
];
|
|
7335
|
+
__decorate([
|
|
7336
|
+
Input("sSVGFactory")
|
|
7337
|
+
], SVGFactoryDirective.prototype, "sSVGFactory", null);
|
|
7338
|
+
SVGFactoryDirective = __decorate([
|
|
7339
|
+
Directive({
|
|
7340
|
+
selector: "[sSVGFactory]",
|
|
7341
|
+
})
|
|
7342
|
+
], SVGFactoryDirective);
|
|
7343
|
+
|
|
7344
|
+
let SVGFactoryModule = class SVGFactoryModule {
|
|
7345
|
+
};
|
|
7346
|
+
SVGFactoryModule = __decorate([
|
|
7347
|
+
NgModule({
|
|
7348
|
+
imports: [CommonModule],
|
|
7349
|
+
declarations: [
|
|
7350
|
+
SVGFactoryDirective,
|
|
7351
|
+
IAssistIconComponent,
|
|
7352
|
+
SeniorIconComponent,
|
|
7353
|
+
],
|
|
7354
|
+
exports: [SVGFactoryDirective],
|
|
7355
|
+
})
|
|
7356
|
+
], SVGFactoryModule);
|
|
7357
|
+
|
|
7358
|
+
let DotsIndicatorComponent = class DotsIndicatorComponent {
|
|
7359
|
+
};
|
|
7360
|
+
DotsIndicatorComponent = __decorate([
|
|
7361
|
+
Component({
|
|
7362
|
+
selector: "s-dots-indicator",
|
|
7363
|
+
template: "<div class=\"dots-indicator\">\n <div class=\"bounce bounce--1\"></div>\n <div class=\"bounce bounce--2\"></div>\n <div class=\"bounce bounce--3\"></div>\n</div>\n",
|
|
7364
|
+
styles: [".dots-indicator .bounce{animation:1.2s ease-out infinite bounce;background-color:#333;border-radius:100%;display:inline-block;height:10px;width:10px}.dots-indicator .bounce+.bounce{margin-left:15px}.dots-indicator .bounce.bounce--1{animation-delay:0s}.dots-indicator .bounce.bounce--2{animation-delay:.1s}.dots-indicator .bounce.bounce--3{animation-delay:.2s}@keyframes bounce{100%,80%{transform:scale(1)}90%{transform:scale(1.8)}}"]
|
|
7365
|
+
})
|
|
7366
|
+
], DotsIndicatorComponent);
|
|
7367
|
+
|
|
7368
|
+
let LoadingIndicatorComponent = class LoadingIndicatorComponent {
|
|
7369
|
+
};
|
|
7370
|
+
LoadingIndicatorComponent = __decorate([
|
|
7371
|
+
Component({
|
|
7372
|
+
selector: "s-logo-indicator",
|
|
7373
|
+
template: "<div class=\"logo-indicator\">\n <span *sSVGFactory=\"'senior'\"></span>\n</div>\n",
|
|
7374
|
+
styles: [".logo-indicator{animation:1s infinite pulsar,1s infinite scale;background-color:#00c89a;border-radius:50%;box-shadow:0 0 0 #00c89ab3;height:64px;padding:calc(64px * .16);position:relative;width:64px}@keyframes pulsar{0%{box-shadow:0 0 0 0 #00c89ab3}70%{box-shadow:0 0 0 40px #00c89a00}100%{box-shadow:0 0 0 0 #00c89a00}}@keyframes scale{0%,100%{transform:scale(1)}50%{transform:scale(1.3)}}"]
|
|
7375
|
+
})
|
|
7376
|
+
], LoadingIndicatorComponent);
|
|
7377
|
+
|
|
7378
|
+
var LoadingStateIndicators;
|
|
7379
|
+
(function (LoadingStateIndicators) {
|
|
7380
|
+
LoadingStateIndicators["Dots"] = "dots";
|
|
7381
|
+
LoadingStateIndicators["Logo"] = "logo";
|
|
7382
|
+
})(LoadingStateIndicators || (LoadingStateIndicators = {}));
|
|
7383
|
+
|
|
7384
|
+
var LoadingStateComponent_1;
|
|
7385
|
+
let LoadingStateComponent = LoadingStateComponent_1 = class LoadingStateComponent {
|
|
7386
|
+
constructor() {
|
|
7387
|
+
this.indicator = LoadingStateIndicators.Dots;
|
|
7388
|
+
this.id = `s-loading-state-${LoadingStateComponent_1.nextId++}`;
|
|
7389
|
+
this.BLOCK_TIMEOUT_VALUE = 300;
|
|
7390
|
+
this.UNBLOCK_TIMEOUT_VALUE = 200;
|
|
7391
|
+
}
|
|
7392
|
+
set loading(loading) {
|
|
7393
|
+
this._loading = loading;
|
|
7394
|
+
loading ? this.block() : this.unblock();
|
|
7395
|
+
}
|
|
7396
|
+
get loading() {
|
|
7397
|
+
return this._loading;
|
|
7398
|
+
}
|
|
7399
|
+
block() {
|
|
7400
|
+
if (this.unblockTimeoutId) {
|
|
7401
|
+
clearTimeout(this.unblockTimeoutId);
|
|
7402
|
+
this.unblockTimeoutId = undefined;
|
|
7403
|
+
}
|
|
7404
|
+
if (!this.blockTimeoutId) {
|
|
7405
|
+
this.blockTimeoutId = setTimeout(() => {
|
|
7406
|
+
this.blocking = true;
|
|
7407
|
+
this.blockTimeoutId = undefined;
|
|
7408
|
+
}, this.BLOCK_TIMEOUT_VALUE);
|
|
7409
|
+
}
|
|
7410
|
+
}
|
|
7411
|
+
unblock() {
|
|
7412
|
+
if (this.blockTimeoutId) {
|
|
7413
|
+
clearTimeout(this.blockTimeoutId);
|
|
7414
|
+
this.blockTimeoutId = undefined;
|
|
7415
|
+
}
|
|
7416
|
+
if (!this.unblockTimeoutId) {
|
|
7417
|
+
this.unblockTimeoutId = setTimeout(() => {
|
|
7418
|
+
this.blocking = false;
|
|
7419
|
+
this.unblockTimeoutId = undefined;
|
|
7420
|
+
}, this.UNBLOCK_TIMEOUT_VALUE);
|
|
7421
|
+
}
|
|
7422
|
+
}
|
|
7423
|
+
ngOnDestroy() {
|
|
7424
|
+
if (this.blockTimeoutId) {
|
|
7425
|
+
clearTimeout(this.blockTimeoutId);
|
|
7426
|
+
}
|
|
7427
|
+
if (this.unblockTimeoutId) {
|
|
7428
|
+
clearTimeout(this.unblockTimeoutId);
|
|
7429
|
+
}
|
|
7430
|
+
}
|
|
7431
|
+
};
|
|
7432
|
+
LoadingStateComponent.nextId = 0;
|
|
7433
|
+
__decorate([
|
|
7434
|
+
Input()
|
|
7435
|
+
], LoadingStateComponent.prototype, "indicator", void 0);
|
|
7436
|
+
__decorate([
|
|
7437
|
+
Input()
|
|
7438
|
+
], LoadingStateComponent.prototype, "id", void 0);
|
|
7439
|
+
__decorate([
|
|
7440
|
+
Input()
|
|
7441
|
+
], LoadingStateComponent.prototype, "blockWindow", void 0);
|
|
7442
|
+
__decorate([
|
|
7443
|
+
Input()
|
|
7444
|
+
], LoadingStateComponent.prototype, "loading", null);
|
|
7445
|
+
LoadingStateComponent = LoadingStateComponent_1 = __decorate([
|
|
7446
|
+
Component({
|
|
7447
|
+
selector: "s-loading-state",
|
|
7448
|
+
template: "<div\n [id]=\"id\"\n class=\"s-loading-state-container\"\n [ngClass]=\"{\n 'loading': loading,\n 'blocking': blocking,\n 'fullscreen': blockWindow\n }\">\n <div\n [id]=\"id + '-loader'\"\n class=\"loader\">\n <div\n [id]=\"id + '-spinner'\"\n class=\"spinner\">\n <ng-container [ngSwitch]=\"indicator\">\n <s-logo-indicator *ngSwitchCase=\"'logo'\"></s-logo-indicator>\n <s-dots-indicator *ngSwitchCase=\"'dots'\"></s-dots-indicator>\n </ng-container>\n </div>\n <div\n [id]=\"id + '-overlay'\"\n class=\"overlay\">\n </div>\n </div>\n <div\n [id]=\"id + '-contents'\"\n class=\"contents\">\n <ng-container *ngTemplateOutlet=\"contents || originalContent\"></ng-container>\n <ng-template #originalContent>\n <ng-content></ng-content>\n </ng-template>\n </div>\n</div>",
|
|
7449
|
+
styles: [".s-loading-state-container{position:relative}.s-loading-state-container .loader{opacity:0;position:absolute;transition:opacity .2s ease-out,display .2s ease-out;visibility:hidden;inset:1px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.s-loading-state-container .loader .overlay{background-color:#fff;height:100%;opacity:.8;transition:opacity .2s ease-out,display .2s ease-out;width:100%}.s-loading-state-container .loader .spinner{display:-ms-flexbox;display:flex;position:absolute;z-index:2}.s-loading-state-container.blocking>.loader,.s-loading-state-container.loading>.loader{visibility:visible}.s-loading-state-container.blocking>.loader,.s-loading-state-container.blocking>.loader>.overlay,.s-loading-state-container.loading>.loader,.s-loading-state-container.loading>.loader>.overlay{cursor:wait;z-index:1}.s-loading-state-container.blocking>.contents,.s-loading-state-container.loading>.contents{z-index:0!important}.s-loading-state-container.blocking.loading>.loader{opacity:1}.s-loading-state-container.fullscreen>.loader{left:0;position:fixed;top:0;z-index:1005}::ng-deep .s-loading-state-container.loading.blocking s-loading-state .s-loading-state-container>.loader{opacity:0;visibility:hidden}::ng-deep .s-loading-state-container.loading.blocking s-loading-state .s-loading-state-container>.contents{z-index:0!important}"]
|
|
7450
|
+
})
|
|
7451
|
+
], LoadingStateComponent);
|
|
7452
|
+
|
|
7453
|
+
let LoadingStateDirective = class LoadingStateDirective {
|
|
7454
|
+
constructor(target, template, componentFactoryResolver, cdr) {
|
|
7455
|
+
this.target = target;
|
|
7456
|
+
this.template = template;
|
|
7457
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
7458
|
+
this.cdr = cdr;
|
|
7459
|
+
this._loading = false;
|
|
7460
|
+
this.indicator = LoadingStateIndicators.Dots;
|
|
7461
|
+
}
|
|
7462
|
+
set sLoadingState(value) {
|
|
7463
|
+
if (typeof value === "boolean") {
|
|
7464
|
+
this._loading = value;
|
|
7465
|
+
this.indicator = LoadingStateIndicators.Dots;
|
|
7743
7466
|
}
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
this.viewContainer.clear();
|
|
7748
|
-
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(InfoSignComponent);
|
|
7749
|
-
this.componentRef = this.viewContainer.createComponent(componentFactory);
|
|
7750
|
-
this.componentRef.instance.templateRef = this.templateRef;
|
|
7751
|
-
this.componentRef.instance.tooltip = this.sInfoSign;
|
|
7752
|
-
this.componentRef.instance.displayTime = this.displayTime;
|
|
7753
|
-
this.componentRef.instance.focusedInputRef = this.focusedInputRef;
|
|
7467
|
+
else if (typeof value === "object") {
|
|
7468
|
+
this._loading = value.loading;
|
|
7469
|
+
this.indicator = value.indicator || LoadingStateIndicators.Dots;
|
|
7754
7470
|
}
|
|
7755
|
-
|
|
7756
|
-
this.
|
|
7471
|
+
if (this.loaderComponent) {
|
|
7472
|
+
this.loaderComponent.instance.loading = this._loading;
|
|
7473
|
+
this.loaderComponent.instance.indicator = this.indicator;
|
|
7757
7474
|
}
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7475
|
+
}
|
|
7476
|
+
ngAfterViewInit() {
|
|
7477
|
+
this.createComponent();
|
|
7478
|
+
}
|
|
7479
|
+
createComponent() {
|
|
7480
|
+
const factory = this.componentFactoryResolver.resolveComponentFactory(LoadingStateComponent);
|
|
7481
|
+
this.loaderComponent = this.target.createComponent(factory);
|
|
7482
|
+
this.loaderComponent.instance.contents = this.template;
|
|
7483
|
+
this.loaderComponent.instance.loading = this._loading;
|
|
7484
|
+
this.loaderComponent.instance.indicator = this.indicator;
|
|
7485
|
+
this.cdr.detectChanges();
|
|
7486
|
+
}
|
|
7487
|
+
ngOnDestroy() {
|
|
7488
|
+
if (this.loaderComponent) {
|
|
7489
|
+
this.loaderComponent.destroy();
|
|
7761
7490
|
}
|
|
7762
7491
|
}
|
|
7763
7492
|
};
|
|
7764
|
-
|
|
7765
|
-
{ type: TemplateRef },
|
|
7493
|
+
LoadingStateDirective.ctorParameters = () => [
|
|
7766
7494
|
{ type: ViewContainerRef },
|
|
7767
|
-
{ type:
|
|
7495
|
+
{ type: TemplateRef },
|
|
7496
|
+
{ type: ComponentFactoryResolver },
|
|
7497
|
+
{ type: ChangeDetectorRef }
|
|
7768
7498
|
];
|
|
7769
7499
|
__decorate([
|
|
7770
|
-
Input()
|
|
7771
|
-
],
|
|
7772
|
-
__decorate([
|
|
7773
|
-
Input('sInfoSignDisplayTime')
|
|
7774
|
-
], InfoSignDirective.prototype, "displayTime", void 0);
|
|
7775
|
-
__decorate([
|
|
7776
|
-
Input('sInfoSignFocusedInputRef')
|
|
7777
|
-
], InfoSignDirective.prototype, "focusedInputRef", void 0);
|
|
7778
|
-
InfoSignDirective = __decorate([
|
|
7500
|
+
Input("sLoadingState")
|
|
7501
|
+
], LoadingStateDirective.prototype, "sLoadingState", null);
|
|
7502
|
+
LoadingStateDirective = __decorate([
|
|
7779
7503
|
Directive({
|
|
7780
|
-
selector: "[
|
|
7504
|
+
selector: "[sLoadingState]",
|
|
7781
7505
|
})
|
|
7782
|
-
],
|
|
7506
|
+
], LoadingStateDirective);
|
|
7783
7507
|
|
|
7784
|
-
let
|
|
7508
|
+
let LoadingStateModule = class LoadingStateModule {
|
|
7785
7509
|
};
|
|
7786
|
-
|
|
7510
|
+
LoadingStateModule = __decorate([
|
|
7787
7511
|
NgModule({
|
|
7788
7512
|
imports: [
|
|
7789
|
-
TooltipModule,
|
|
7790
7513
|
CommonModule,
|
|
7514
|
+
SVGFactoryModule,
|
|
7791
7515
|
],
|
|
7792
7516
|
declarations: [
|
|
7793
|
-
|
|
7794
|
-
|
|
7517
|
+
LoadingStateComponent,
|
|
7518
|
+
LoadingStateDirective,
|
|
7519
|
+
DotsIndicatorComponent,
|
|
7520
|
+
LoadingIndicatorComponent,
|
|
7795
7521
|
],
|
|
7796
|
-
exports: [
|
|
7797
|
-
|
|
7522
|
+
exports: [
|
|
7523
|
+
LoadingStateComponent,
|
|
7524
|
+
LoadingStateDirective,
|
|
7525
|
+
],
|
|
7526
|
+
entryComponents: [LoadingStateComponent],
|
|
7798
7527
|
})
|
|
7799
|
-
],
|
|
7528
|
+
], LoadingStateModule);
|
|
7800
7529
|
|
|
7801
|
-
let
|
|
7530
|
+
let LocalizedBignumberPipe = class LocalizedBignumberPipe {
|
|
7531
|
+
constructor(localeService) {
|
|
7532
|
+
this.localeService = localeService;
|
|
7533
|
+
}
|
|
7534
|
+
transform(value, options) {
|
|
7535
|
+
return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);
|
|
7536
|
+
}
|
|
7537
|
+
applyMask(value, options) {
|
|
7538
|
+
return this.localeService.get().pipe(map(localeConfig => {
|
|
7539
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
7540
|
+
const configs = {
|
|
7541
|
+
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$",
|
|
7542
|
+
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 : ".",
|
|
7543
|
+
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 : ",",
|
|
7544
|
+
scale: (_k = options === null || options === void 0 ? void 0 : options.scale) !== null && _k !== void 0 ? _k : 2,
|
|
7545
|
+
allowNegative: (_l = options === null || options === void 0 ? void 0 : options.allowNegative) !== null && _l !== void 0 ? _l : true
|
|
7546
|
+
};
|
|
7547
|
+
const isNumber = !(new BigNumber(value).isNaN());
|
|
7548
|
+
return applyMask(value, configs, isNumber);
|
|
7549
|
+
}));
|
|
7550
|
+
}
|
|
7802
7551
|
};
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7552
|
+
LocalizedBignumberPipe.ctorParameters = () => [
|
|
7553
|
+
{ type: LocaleService }
|
|
7554
|
+
];
|
|
7555
|
+
LocalizedBignumberPipe = __decorate([
|
|
7556
|
+
Pipe({
|
|
7557
|
+
name: "localizedBignumber",
|
|
7806
7558
|
})
|
|
7807
|
-
],
|
|
7559
|
+
], LocalizedBignumberPipe);
|
|
7808
7560
|
|
|
7809
|
-
let
|
|
7561
|
+
let LocalizedBignumberImpurePipe = class LocalizedBignumberImpurePipe extends LocalizedBignumberPipe {
|
|
7562
|
+
transform(value, options) {
|
|
7563
|
+
return super.transform(value, options);
|
|
7564
|
+
}
|
|
7810
7565
|
};
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
|
|
7566
|
+
LocalizedBignumberImpurePipe = __decorate([
|
|
7567
|
+
Pipe({
|
|
7568
|
+
name: "localizedBignumberImpure",
|
|
7569
|
+
pure: false,
|
|
7814
7570
|
})
|
|
7815
|
-
],
|
|
7816
|
-
|
|
7817
|
-
var SVGFactoryIcons;
|
|
7818
|
-
(function (SVGFactoryIcons) {
|
|
7819
|
-
SVGFactoryIcons["IAssist"] = "iassist";
|
|
7820
|
-
SVGFactoryIcons["Senior"] = "senior";
|
|
7821
|
-
})(SVGFactoryIcons || (SVGFactoryIcons = {}));
|
|
7571
|
+
], LocalizedBignumberImpurePipe);
|
|
7822
7572
|
|
|
7823
|
-
|
|
7824
|
-
constructor(
|
|
7825
|
-
|
|
7826
|
-
this.
|
|
7827
|
-
this.cdr = cdr;
|
|
7828
|
-
this._iconClass = this._getIconClass(SVGFactoryIcons.Senior);
|
|
7573
|
+
class LocalizedCurrencyPipeOptions extends NumberLocaleOptions {
|
|
7574
|
+
constructor(config = {}) {
|
|
7575
|
+
super(config);
|
|
7576
|
+
this.scale = 2;
|
|
7829
7577
|
}
|
|
7830
|
-
|
|
7831
|
-
|
|
7578
|
+
}
|
|
7579
|
+
/**
|
|
7580
|
+
* @deprecated Should use localizedBignumberPipe instead
|
|
7581
|
+
*/
|
|
7582
|
+
let LocalizedCurrencyPipe = class LocalizedCurrencyPipe {
|
|
7583
|
+
constructor(localeService) {
|
|
7584
|
+
this.localeService = localeService;
|
|
7832
7585
|
}
|
|
7833
|
-
|
|
7834
|
-
|
|
7586
|
+
transform(value, options) {
|
|
7587
|
+
if (!options) {
|
|
7588
|
+
options = new LocalizedCurrencyPipeOptions();
|
|
7589
|
+
}
|
|
7590
|
+
return value !== undefined && value !== null ? this.applyMask(value, options) : of(value);
|
|
7835
7591
|
}
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7592
|
+
applyMask(value, options) {
|
|
7593
|
+
return this.localeService.get().pipe(map(localeConfig => {
|
|
7594
|
+
const config = Object.assign(Object.assign({}, localeConfig.number), options);
|
|
7595
|
+
const { scale, currencySymbol, thousandsSeparator, decimalSeparator } = config;
|
|
7596
|
+
const rawValue = Number(value).toFixed(scale);
|
|
7597
|
+
const onlyNumbers = rawValue.replace(/[^0-9]/g, ``);
|
|
7598
|
+
const integerPart = onlyNumbers
|
|
7599
|
+
.slice(0, onlyNumbers.length - scale)
|
|
7600
|
+
.replace(/^0*/g, ``)
|
|
7601
|
+
.replace(/\B(?=(\d{3})+(?!\d))/g, thousandsSeparator) || `0`;
|
|
7602
|
+
const decimalPart = onlyNumbers.slice(onlyNumbers.length - scale);
|
|
7603
|
+
const newValue = scale ? integerPart + decimalSeparator + decimalPart : integerPart;
|
|
7604
|
+
const isZero = !Number(onlyNumbers);
|
|
7605
|
+
const operator = rawValue.includes("-") && !isZero ? "-" : "";
|
|
7606
|
+
return `${operator}${currencySymbol}${newValue}`;
|
|
7607
|
+
}));
|
|
7841
7608
|
}
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7609
|
+
};
|
|
7610
|
+
LocalizedCurrencyPipe.ctorParameters = () => [
|
|
7611
|
+
{ type: LocaleService }
|
|
7612
|
+
];
|
|
7613
|
+
LocalizedCurrencyPipe = __decorate([
|
|
7614
|
+
Pipe({
|
|
7615
|
+
name: "localizedCurrency",
|
|
7616
|
+
})
|
|
7617
|
+
], LocalizedCurrencyPipe);
|
|
7618
|
+
|
|
7619
|
+
/**
|
|
7620
|
+
* @deprecated Should use localizedBignumberPipe instead
|
|
7621
|
+
*/
|
|
7622
|
+
let LocalizedCurrencyImpurePipe = class LocalizedCurrencyImpurePipe extends LocalizedCurrencyPipe {
|
|
7623
|
+
transform(value, options = new LocalizedCurrencyPipeOptions()) {
|
|
7624
|
+
return super.transform(value, options);
|
|
7625
|
+
}
|
|
7626
|
+
};
|
|
7627
|
+
LocalizedCurrencyImpurePipe = __decorate([
|
|
7628
|
+
Pipe({
|
|
7629
|
+
name: "localizedCurrencyImpure",
|
|
7630
|
+
pure: false,
|
|
7631
|
+
})
|
|
7632
|
+
], LocalizedCurrencyImpurePipe);
|
|
7633
|
+
|
|
7634
|
+
const moment$2 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
7635
|
+
let LocalizedDatePipe = class LocalizedDatePipe {
|
|
7636
|
+
constructor(localeService) {
|
|
7637
|
+
this.localeService = localeService;
|
|
7638
|
+
}
|
|
7639
|
+
transform(value, format = "L LTS") {
|
|
7640
|
+
return this.localeService.get().pipe(map(() => (value ? moment$2(value).format(format) : value)));
|
|
7641
|
+
}
|
|
7642
|
+
};
|
|
7643
|
+
LocalizedDatePipe.ctorParameters = () => [
|
|
7644
|
+
{ type: LocaleService }
|
|
7645
|
+
];
|
|
7646
|
+
LocalizedDatePipe = __decorate([
|
|
7647
|
+
Pipe({
|
|
7648
|
+
name: "localizedDate",
|
|
7649
|
+
})
|
|
7650
|
+
], LocalizedDatePipe);
|
|
7651
|
+
|
|
7652
|
+
let LocalizedDateImpurePipe = class LocalizedDateImpurePipe extends LocalizedDatePipe {
|
|
7653
|
+
};
|
|
7654
|
+
LocalizedDateImpurePipe = __decorate([
|
|
7655
|
+
Pipe({
|
|
7656
|
+
name: "localizedDateImpure",
|
|
7657
|
+
pure: false,
|
|
7658
|
+
})
|
|
7659
|
+
], LocalizedDateImpurePipe);
|
|
7660
|
+
|
|
7661
|
+
/**
|
|
7662
|
+
* @deprecated Should use localizedBignumberPipe instead
|
|
7663
|
+
*/
|
|
7664
|
+
let LocalizedNumberPipe = class LocalizedNumberPipe {
|
|
7665
|
+
constructor(localeService) {
|
|
7666
|
+
this.localeService = localeService;
|
|
7667
|
+
}
|
|
7668
|
+
transform(value, minimumFractionDigits) {
|
|
7669
|
+
return from(this.localeService.getLocale()).pipe(map((locale) => {
|
|
7670
|
+
const numericValue = Number(value);
|
|
7671
|
+
if (!value && isNaN(numericValue))
|
|
7672
|
+
return;
|
|
7673
|
+
return new Intl.NumberFormat(locale, {
|
|
7674
|
+
minimumFractionDigits: minimumFractionDigits || 0,
|
|
7675
|
+
}).format(Number(value));
|
|
7676
|
+
}));
|
|
7850
7677
|
}
|
|
7851
7678
|
};
|
|
7852
|
-
|
|
7853
|
-
{ type:
|
|
7854
|
-
{ type: ComponentFactoryResolver },
|
|
7855
|
-
{ type: ChangeDetectorRef }
|
|
7679
|
+
LocalizedNumberPipe.ctorParameters = () => [
|
|
7680
|
+
{ type: LocaleService }
|
|
7856
7681
|
];
|
|
7857
|
-
__decorate([
|
|
7858
|
-
|
|
7859
|
-
],
|
|
7860
|
-
SVGFactoryDirective = __decorate([
|
|
7861
|
-
Directive({
|
|
7862
|
-
selector: "[sSVGFactory]",
|
|
7863
|
-
})
|
|
7864
|
-
], SVGFactoryDirective);
|
|
7682
|
+
LocalizedNumberPipe = __decorate([
|
|
7683
|
+
Pipe({ name: "localizedNumber" })
|
|
7684
|
+
], LocalizedNumberPipe);
|
|
7865
7685
|
|
|
7866
|
-
|
|
7686
|
+
const moment$3 = moment_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
|
|
7687
|
+
let LocalizedTimePipe = class LocalizedTimePipe {
|
|
7688
|
+
constructor(localeService) {
|
|
7689
|
+
this.localeService = localeService;
|
|
7690
|
+
}
|
|
7691
|
+
transform(value, format = "LTS") {
|
|
7692
|
+
return this.localeService.get().pipe(map(() => (value ? moment$3(value, "HH:mm:ss").format(format) : value)));
|
|
7693
|
+
}
|
|
7867
7694
|
};
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
SeniorIconComponent,
|
|
7875
|
-
],
|
|
7876
|
-
exports: [SVGFactoryDirective],
|
|
7695
|
+
LocalizedTimePipe.ctorParameters = () => [
|
|
7696
|
+
{ type: LocaleService }
|
|
7697
|
+
];
|
|
7698
|
+
LocalizedTimePipe = __decorate([
|
|
7699
|
+
Pipe({
|
|
7700
|
+
name: "localizedTime",
|
|
7877
7701
|
})
|
|
7878
|
-
],
|
|
7702
|
+
], LocalizedTimePipe);
|
|
7879
7703
|
|
|
7880
|
-
let
|
|
7704
|
+
let LocalizedTimeImpurePipe = class LocalizedTimeImpurePipe extends LocalizedTimePipe {
|
|
7881
7705
|
};
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
styles: [".dots-indicator .bounce{animation:1.2s ease-out infinite bounce;background-color:#333;border-radius:100%;display:inline-block;height:10px;width:10px}.dots-indicator .bounce+.bounce{margin-left:15px}.dots-indicator .bounce.bounce--1{animation-delay:0s}.dots-indicator .bounce.bounce--2{animation-delay:.1s}.dots-indicator .bounce.bounce--3{animation-delay:.2s}@keyframes bounce{100%,80%{transform:scale(1)}90%{transform:scale(1.8)}}"]
|
|
7706
|
+
LocalizedTimeImpurePipe = __decorate([
|
|
7707
|
+
Pipe({
|
|
7708
|
+
name: "localizedTimeImpure",
|
|
7709
|
+
pure: false,
|
|
7887
7710
|
})
|
|
7888
|
-
],
|
|
7711
|
+
], LocalizedTimeImpurePipe);
|
|
7889
7712
|
|
|
7890
|
-
let
|
|
7713
|
+
let CurrencyService = class CurrencyService {
|
|
7714
|
+
constructor(localeService) {
|
|
7715
|
+
this.localeService = localeService;
|
|
7716
|
+
this.currencies = {
|
|
7717
|
+
KHR: { precision: 12, scale: 2 },
|
|
7718
|
+
SSP: { precision: 12, scale: 2 },
|
|
7719
|
+
XCD: { precision: 12, scale: 2 },
|
|
7720
|
+
EGP: { precision: 12, scale: 2 },
|
|
7721
|
+
KWD: { precision: 12, scale: 3 },
|
|
7722
|
+
YER: { precision: 12, scale: 2 },
|
|
7723
|
+
HUF: { precision: 12, scale: 2 },
|
|
7724
|
+
MXN: { precision: 12, scale: 2 },
|
|
7725
|
+
MYR: { precision: 12, scale: 2 },
|
|
7726
|
+
ZWL: { precision: 12, scale: 2 },
|
|
7727
|
+
MUR: { precision: 12, scale: 2 },
|
|
7728
|
+
DKK: { precision: 12, scale: 2 },
|
|
7729
|
+
NOK: { precision: 12, scale: 2 },
|
|
7730
|
+
DJF: { precision: 12, scale: 0 },
|
|
7731
|
+
CRC: { precision: 12, scale: 2 },
|
|
7732
|
+
BND: { precision: 12, scale: 2 },
|
|
7733
|
+
NAD: { precision: 12, scale: 2 },
|
|
7734
|
+
MKD: { precision: 12, scale: 2 },
|
|
7735
|
+
CDF: { precision: 12, scale: 2 },
|
|
7736
|
+
GNF: { precision: 12, scale: 0 },
|
|
7737
|
+
EUR: { precision: 12, scale: 2 },
|
|
7738
|
+
OMR: { precision: 12, scale: 3 },
|
|
7739
|
+
CLP: { precision: 12, scale: 0 },
|
|
7740
|
+
BSD: { precision: 12, scale: 2 },
|
|
7741
|
+
TOP: { precision: 12, scale: 2 },
|
|
7742
|
+
IRR: { precision: 12, scale: 2 },
|
|
7743
|
+
BGN: { precision: 12, scale: 2 },
|
|
7744
|
+
BZD: { precision: 12, scale: 2 },
|
|
7745
|
+
CNY: { precision: 12, scale: 2 },
|
|
7746
|
+
FJD: { precision: 12, scale: 2 },
|
|
7747
|
+
SRD: { precision: 12, scale: 2 },
|
|
7748
|
+
SOS: { precision: 12, scale: 2 },
|
|
7749
|
+
GYD: { precision: 12, scale: 2 },
|
|
7750
|
+
VUV: { precision: 12, scale: 0 },
|
|
7751
|
+
MWK: { precision: 12, scale: 2 },
|
|
7752
|
+
MRU: { precision: 12, scale: 2 },
|
|
7753
|
+
LSL: { precision: 12, scale: 2 },
|
|
7754
|
+
ERN: { precision: 12, scale: 2 },
|
|
7755
|
+
BMD: { precision: 12, scale: 2 },
|
|
7756
|
+
WST: { precision: 12, scale: 2 },
|
|
7757
|
+
LRD: { precision: 12, scale: 2 },
|
|
7758
|
+
GMD: { precision: 12, scale: 2 },
|
|
7759
|
+
ARS: { precision: 12, scale: 2 },
|
|
7760
|
+
ZAR: { precision: 12, scale: 2 },
|
|
7761
|
+
RSD: { precision: 12, scale: 2 },
|
|
7762
|
+
MDL: { precision: 12, scale: 2 },
|
|
7763
|
+
USD: { precision: 12, scale: 2 },
|
|
7764
|
+
QAR: { precision: 12, scale: 2 },
|
|
7765
|
+
HRK: { precision: 12, scale: 2 },
|
|
7766
|
+
GIP: { precision: 12, scale: 2 },
|
|
7767
|
+
NPR: { precision: 12, scale: 2 },
|
|
7768
|
+
"002": { precision: 9, scale: 4 },
|
|
7769
|
+
PLN: { precision: 12, scale: 2 },
|
|
7770
|
+
MAD: { precision: 12, scale: 2 },
|
|
7771
|
+
BAM: { precision: 12, scale: 2 },
|
|
7772
|
+
BTN: { precision: 12, scale: 2 },
|
|
7773
|
+
BBD: { precision: 12, scale: 2 },
|
|
7774
|
+
SHP: { precision: 12, scale: 2 },
|
|
7775
|
+
LKR: { precision: 12, scale: 2 },
|
|
7776
|
+
KPW: { precision: 12, scale: 2 },
|
|
7777
|
+
LAK: { precision: 12, scale: 2 },
|
|
7778
|
+
SZL: { precision: 12, scale: 2 },
|
|
7779
|
+
PHP: { precision: 12, scale: 2 },
|
|
7780
|
+
RWF: { precision: 12, scale: 0 },
|
|
7781
|
+
ISK: { precision: 12, scale: 0 },
|
|
7782
|
+
XOF: { precision: 12, scale: 0 },
|
|
7783
|
+
AUD: { precision: 12, scale: 2 },
|
|
7784
|
+
NGN: { precision: 12, scale: 2 },
|
|
7785
|
+
KGS: { precision: 12, scale: 2 },
|
|
7786
|
+
KYD: { precision: 12, scale: 2 },
|
|
7787
|
+
PGK: { precision: 12, scale: 2 },
|
|
7788
|
+
DZD: { precision: 12, scale: 2 },
|
|
7789
|
+
XAF: { precision: 12, scale: 0 },
|
|
7790
|
+
PEN: { precision: 12, scale: 2 },
|
|
7791
|
+
JPY: { precision: 12, scale: 0 },
|
|
7792
|
+
SBD: { precision: 12, scale: 2 },
|
|
7793
|
+
UGX: { precision: 12, scale: 0 },
|
|
7794
|
+
AMD: { precision: 12, scale: 2 },
|
|
7795
|
+
AED: { precision: 12, scale: 2 },
|
|
7796
|
+
ALL: { precision: 12, scale: 2 },
|
|
7797
|
+
XPF: { precision: 12, scale: 0 },
|
|
7798
|
+
AFN: { precision: 12, scale: 2 },
|
|
7799
|
+
RON: { precision: 12, scale: 2 },
|
|
7800
|
+
TND: { precision: 12, scale: 3 },
|
|
7801
|
+
NZD: { precision: 12, scale: 2 },
|
|
7802
|
+
JOD: { precision: 12, scale: 3 },
|
|
7803
|
+
VND: { precision: 12, scale: 0 },
|
|
7804
|
+
ETB: { precision: 12, scale: 2 },
|
|
7805
|
+
PYG: { precision: 12, scale: 0 },
|
|
7806
|
+
JMD: { precision: 12, scale: 2 },
|
|
7807
|
+
KES: { precision: 12, scale: 2 },
|
|
7808
|
+
IDR: { precision: 12, scale: 2 },
|
|
7809
|
+
HKD: { precision: 12, scale: 2 },
|
|
7810
|
+
BDT: { precision: 12, scale: 2 },
|
|
7811
|
+
GBP: { precision: 12, scale: 2 },
|
|
7812
|
+
AOA: { precision: 12, scale: 2 },
|
|
7813
|
+
PKR: { precision: 12, scale: 2 },
|
|
7814
|
+
TRY: { precision: 12, scale: 2 },
|
|
7815
|
+
SLL: { precision: 12, scale: 2 },
|
|
7816
|
+
CVE: { precision: 12, scale: 2 },
|
|
7817
|
+
LYD: { precision: 12, scale: 3 },
|
|
7818
|
+
ILS: { precision: 12, scale: 2 },
|
|
7819
|
+
UZS: { precision: 12, scale: 2 },
|
|
7820
|
+
CHF: { precision: 12, scale: 2 },
|
|
7821
|
+
SVC: { precision: 12, scale: 2 },
|
|
7822
|
+
BRL: { precision: 12, scale: 2 },
|
|
7823
|
+
GHS: { precision: 12, scale: 2 },
|
|
7824
|
+
CUP: { precision: 12, scale: 2 },
|
|
7825
|
+
FKP: { precision: 12, scale: 2 },
|
|
7826
|
+
NIO: { precision: 12, scale: 2 },
|
|
7827
|
+
GEL: { precision: 12, scale: 2 },
|
|
7828
|
+
TTD: { precision: 12, scale: 2 },
|
|
7829
|
+
AAA: { precision: 1, scale: 1 },
|
|
7830
|
+
COP: { precision: 12, scale: 2 },
|
|
7831
|
+
MGA: { precision: 12, scale: 2 },
|
|
7832
|
+
INR: { precision: 12, scale: 2 },
|
|
7833
|
+
KRW: { precision: 12, scale: 0 },
|
|
7834
|
+
HNL: { precision: 12, scale: 2 },
|
|
7835
|
+
MMK: { precision: 12, scale: 2 },
|
|
7836
|
+
TZS: { precision: 12, scale: 2 },
|
|
7837
|
+
THB: { precision: 12, scale: 2 },
|
|
7838
|
+
TMT: { precision: 12, scale: 2 },
|
|
7839
|
+
SAR: { precision: 12, scale: 2 },
|
|
7840
|
+
UYU: { precision: 12, scale: 2 },
|
|
7841
|
+
BIF: { precision: 12, scale: 0 },
|
|
7842
|
+
MVR: { precision: 12, scale: 2 },
|
|
7843
|
+
RUB: { precision: 12, scale: 2 },
|
|
7844
|
+
GTQ: { precision: 12, scale: 2 },
|
|
7845
|
+
SCR: { precision: 12, scale: 2 },
|
|
7846
|
+
IQD: { precision: 12, scale: 3 },
|
|
7847
|
+
UAH: { precision: 12, scale: 2 },
|
|
7848
|
+
BYN: { precision: 12, scale: 2 },
|
|
7849
|
+
VES: { precision: 12, scale: 2 },
|
|
7850
|
+
BOB: { precision: 12, scale: 2 },
|
|
7851
|
+
SGD: { precision: 12, scale: 2 },
|
|
7852
|
+
ZMW: { precision: 12, scale: 2 },
|
|
7853
|
+
CZK: { precision: 12, scale: 2 },
|
|
7854
|
+
TJS: { precision: 12, scale: 2 },
|
|
7855
|
+
DOP: { precision: 12, scale: 2 },
|
|
7856
|
+
AZN: { precision: 12, scale: 2 },
|
|
7857
|
+
PAB: { precision: 12, scale: 2 },
|
|
7858
|
+
STN: { precision: 12, scale: 2 },
|
|
7859
|
+
SDG: { precision: 12, scale: 2 },
|
|
7860
|
+
BWP: { precision: 12, scale: 2 },
|
|
7861
|
+
BHD: { precision: 12, scale: 3 },
|
|
7862
|
+
CAD: { precision: 12, scale: 2 },
|
|
7863
|
+
MNT: { precision: 12, scale: 2 },
|
|
7864
|
+
MOP: { precision: 12, scale: 2 },
|
|
7865
|
+
HTG: { precision: 12, scale: 2 },
|
|
7866
|
+
KZT: { precision: 12, scale: 2 },
|
|
7867
|
+
LBP: { precision: 12, scale: 2 },
|
|
7868
|
+
SYP: { precision: 12, scale: 2 },
|
|
7869
|
+
TWD: { precision: 12, scale: 2 },
|
|
7870
|
+
MZN: { precision: 12, scale: 2 },
|
|
7871
|
+
ANG: { precision: 12, scale: 2 },
|
|
7872
|
+
SEK: { precision: 12, scale: 2 },
|
|
7873
|
+
KMF: { precision: 12, scale: 0 },
|
|
7874
|
+
AWG: { precision: 12, scale: 2 },
|
|
7875
|
+
};
|
|
7876
|
+
}
|
|
7877
|
+
getCurrencySymbol({ currency }) {
|
|
7878
|
+
var _a, _b;
|
|
7879
|
+
const numberFormat = new Intl.NumberFormat(this.localeService.getLocaleOptions().locale, {
|
|
7880
|
+
style: "currency",
|
|
7881
|
+
currency: currency !== null && currency !== void 0 ? currency : "BRL",
|
|
7882
|
+
currencyDisplay: "narrowSymbol",
|
|
7883
|
+
maximumFractionDigits: 5,
|
|
7884
|
+
});
|
|
7885
|
+
return (_b = (_a = numberFormat.formatToParts(1).find((x) => x.type === "currency")) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "";
|
|
7886
|
+
}
|
|
7891
7887
|
};
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
})
|
|
7898
|
-
],
|
|
7899
|
-
|
|
7900
|
-
var LoadingStateIndicators;
|
|
7901
|
-
(function (LoadingStateIndicators) {
|
|
7902
|
-
LoadingStateIndicators["Dots"] = "dots";
|
|
7903
|
-
LoadingStateIndicators["Logo"] = "logo";
|
|
7904
|
-
})(LoadingStateIndicators || (LoadingStateIndicators = {}));
|
|
7888
|
+
CurrencyService.ctorParameters = () => [
|
|
7889
|
+
{ type: LocaleService }
|
|
7890
|
+
];
|
|
7891
|
+
CurrencyService.ɵprov = ɵɵdefineInjectable({ factory: function CurrencyService_Factory() { return new CurrencyService(ɵɵinject(LocaleService)); }, token: CurrencyService, providedIn: "root" });
|
|
7892
|
+
CurrencyService = __decorate([
|
|
7893
|
+
Injectable({ providedIn: "root" })
|
|
7894
|
+
], CurrencyService);
|
|
7905
7895
|
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
this.
|
|
7910
|
-
this.id = `s-loading-state-${LoadingStateComponent_1.nextId++}`;
|
|
7911
|
-
this.BLOCK_TIMEOUT_VALUE = 300;
|
|
7912
|
-
this.UNBLOCK_TIMEOUT_VALUE = 200;
|
|
7896
|
+
let NumericService = class NumericService {
|
|
7897
|
+
constructor(localeService, currencyService) {
|
|
7898
|
+
this.localeService = localeService;
|
|
7899
|
+
this.currencyService = currencyService;
|
|
7913
7900
|
}
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7901
|
+
/**
|
|
7902
|
+
* Wrapper around Intl.NumberFormat that returns the localized value using the user's locale by default(platform's preferential language).
|
|
7903
|
+
*
|
|
7904
|
+
* This method should only be used after the localeService has been initialized by the host application, either by a resolver or a manual call.
|
|
7905
|
+
*
|
|
7906
|
+
* Can be overwritten by the provided Intl.NumberFormatOptions.
|
|
7907
|
+
*
|
|
7908
|
+
* Documentation is available at {@link https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat Intl.NumberFormatOptions}.
|
|
7909
|
+
*
|
|
7910
|
+
* @param {number | string | BigNumber} value The value to be formatted.
|
|
7911
|
+
* @param options Locale and numberFormatOptions that overwrites the default Intl.NumberFormatOptions.
|
|
7912
|
+
* @return `string` The formatted value.
|
|
7913
|
+
*/
|
|
7914
|
+
instant(value, options) {
|
|
7915
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
7916
|
+
if (isNullOrUndefined(value))
|
|
7917
|
+
return null;
|
|
7918
|
+
options = Object.assign(Object.assign({}, options), { locale: (_c = (_a = options === null || options === void 0 ? void 0 : options.locale) !== null && _a !== void 0 ? _a : (_b = this.localeService.getLocaleOptions()) === null || _b === void 0 ? void 0 : _b.locale) !== null && _c !== void 0 ? _c : "pt-BR", numberFormatOptions: Object.assign(Object.assign({ useGrouping: true }, options === null || options === void 0 ? void 0 : options.numberFormatOptions), { currency: ((_d = options === null || options === void 0 ? void 0 : options.numberFormatOptions) === null || _d === void 0 ? void 0 : _d.style) === "currency" ? ((_f = (_e = options === null || options === void 0 ? void 0 : options.numberFormatOptions) === null || _e === void 0 ? void 0 : _e.currency) !== null && _f !== void 0 ? _f : "BRL") : undefined, currencyDisplay: ((_g = options === null || options === void 0 ? void 0 : options.numberFormatOptions) === null || _g === void 0 ? void 0 : _g.style) === "currency"
|
|
7919
|
+
? ((_j = (_h = options === null || options === void 0 ? void 0 : options.numberFormatOptions) === null || _h === void 0 ? void 0 : _h.currencyDisplay) !== null && _j !== void 0 ? _j : "narrowSymbol")
|
|
7920
|
+
: undefined, minimumFractionDigits: (_l = (_k = options === null || options === void 0 ? void 0 : options.numberFormatOptions) === null || _k === void 0 ? void 0 : _k.minimumFractionDigits) !== null && _l !== void 0 ? _l : this.getCurrencyMinimumFractionDigits((_m = options === null || options === void 0 ? void 0 : options.numberFormatOptions) === null || _m === void 0 ? void 0 : _m.currency) }) });
|
|
7921
|
+
options.numberFormatOptions["roundingMode"] = "trunc";
|
|
7922
|
+
// From https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
|
|
7923
|
+
return new Intl.NumberFormat(options.locale, options.numberFormatOptions).format(this.getType(value) === "number" || this.getType(value) === "string" ? value : value.toString());
|
|
7917
7924
|
}
|
|
7918
|
-
|
|
7919
|
-
|
|
7925
|
+
getCurrencyMinimumFractionDigits(currency) {
|
|
7926
|
+
var _a;
|
|
7927
|
+
if (!currency)
|
|
7928
|
+
return null;
|
|
7929
|
+
return (_a = this.currencyService.currencies[currency.toUpperCase()]) === null || _a === void 0 ? void 0 : _a.scale;
|
|
7920
7930
|
}
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
}
|
|
7926
|
-
if (!this.blockTimeoutId) {
|
|
7927
|
-
this.blockTimeoutId = setTimeout(() => {
|
|
7928
|
-
this.blocking = true;
|
|
7929
|
-
this.blockTimeoutId = undefined;
|
|
7930
|
-
}, this.BLOCK_TIMEOUT_VALUE);
|
|
7931
|
+
getType(value) {
|
|
7932
|
+
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof
|
|
7933
|
+
if (value === null) {
|
|
7934
|
+
return "null";
|
|
7931
7935
|
}
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
if (
|
|
7935
|
-
|
|
7936
|
-
this.blockTimeoutId = undefined;
|
|
7936
|
+
const baseType = typeof value;
|
|
7937
|
+
// Primitive types
|
|
7938
|
+
if (baseType !== "object" && baseType !== "function") {
|
|
7939
|
+
return baseType;
|
|
7937
7940
|
}
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7941
|
+
// Symbol.toStringTag often specifies the "display name" of the
|
|
7942
|
+
// object's class. It's used in Object.prototype.toString().
|
|
7943
|
+
const tag = value[Symbol.toStringTag];
|
|
7944
|
+
if (typeof tag === "string") {
|
|
7945
|
+
return tag;
|
|
7943
7946
|
}
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
clearTimeout(this.blockTimeoutId);
|
|
7947
|
+
// If it's a function whose source code starts with the "class" keyword
|
|
7948
|
+
if (baseType === "function" && Function.prototype.toString.call(value).startsWith("class")) {
|
|
7949
|
+
return "class";
|
|
7948
7950
|
}
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
+
// The name of the constructor; for example `Array`, `GeneratorFunction`,
|
|
7952
|
+
// `Number`, `String`, `Boolean` or `MyCustomClass`
|
|
7953
|
+
const className = value.constructor.name;
|
|
7954
|
+
if (typeof className === "string" && className !== "") {
|
|
7955
|
+
return className;
|
|
7951
7956
|
}
|
|
7957
|
+
// At this point there's no robust way to get the type of value,
|
|
7958
|
+
// so we use the base implementation.
|
|
7959
|
+
return baseType;
|
|
7952
7960
|
}
|
|
7953
7961
|
};
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
]
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
Input()
|
|
7963
|
-
], LoadingStateComponent.prototype, "blockWindow", void 0);
|
|
7964
|
-
__decorate([
|
|
7965
|
-
Input()
|
|
7966
|
-
], LoadingStateComponent.prototype, "loading", null);
|
|
7967
|
-
LoadingStateComponent = LoadingStateComponent_1 = __decorate([
|
|
7968
|
-
Component({
|
|
7969
|
-
selector: "s-loading-state",
|
|
7970
|
-
template: "<div\n [id]=\"id\"\n class=\"s-loading-state-container\"\n [ngClass]=\"{\n 'loading': loading,\n 'blocking': blocking,\n 'fullscreen': blockWindow\n }\">\n <div\n [id]=\"id + '-loader'\"\n class=\"loader\">\n <div\n [id]=\"id + '-spinner'\"\n class=\"spinner\">\n <ng-container [ngSwitch]=\"indicator\">\n <s-logo-indicator *ngSwitchCase=\"'logo'\"></s-logo-indicator>\n <s-dots-indicator *ngSwitchCase=\"'dots'\"></s-dots-indicator>\n </ng-container>\n </div>\n <div\n [id]=\"id + '-overlay'\"\n class=\"overlay\">\n </div>\n </div>\n <div\n [id]=\"id + '-contents'\"\n class=\"contents\">\n <ng-container *ngTemplateOutlet=\"contents || originalContent\"></ng-container>\n <ng-template #originalContent>\n <ng-content></ng-content>\n </ng-template>\n </div>\n</div>",
|
|
7971
|
-
styles: [".s-loading-state-container{position:relative}.s-loading-state-container .loader{opacity:0;position:absolute;transition:opacity .2s ease-out,display .2s ease-out;visibility:hidden;inset:1px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.s-loading-state-container .loader .overlay{background-color:#fff;height:100%;opacity:.8;transition:opacity .2s ease-out,display .2s ease-out;width:100%}.s-loading-state-container .loader .spinner{display:-ms-flexbox;display:flex;position:absolute;z-index:2}.s-loading-state-container.blocking>.loader,.s-loading-state-container.loading>.loader{visibility:visible}.s-loading-state-container.blocking>.loader,.s-loading-state-container.blocking>.loader>.overlay,.s-loading-state-container.loading>.loader,.s-loading-state-container.loading>.loader>.overlay{cursor:wait;z-index:1}.s-loading-state-container.blocking>.contents,.s-loading-state-container.loading>.contents{z-index:0!important}.s-loading-state-container.blocking.loading>.loader{opacity:1}.s-loading-state-container.fullscreen>.loader{left:0;position:fixed;top:0;z-index:1005}::ng-deep .s-loading-state-container.loading.blocking s-loading-state .s-loading-state-container>.loader{opacity:0;visibility:hidden}::ng-deep .s-loading-state-container.loading.blocking s-loading-state .s-loading-state-container>.contents{z-index:0!important}"]
|
|
7962
|
+
NumericService.ctorParameters = () => [
|
|
7963
|
+
{ type: LocaleService },
|
|
7964
|
+
{ type: CurrencyService }
|
|
7965
|
+
];
|
|
7966
|
+
NumericService.ɵprov = ɵɵdefineInjectable({ factory: function NumericService_Factory() { return new NumericService(ɵɵinject(LocaleService), ɵɵinject(CurrencyService)); }, token: NumericService, providedIn: "root" });
|
|
7967
|
+
NumericService = __decorate([
|
|
7968
|
+
Injectable({
|
|
7969
|
+
providedIn: "root",
|
|
7972
7970
|
})
|
|
7973
|
-
],
|
|
7971
|
+
], NumericService);
|
|
7974
7972
|
|
|
7975
|
-
let
|
|
7976
|
-
constructor(
|
|
7977
|
-
this.
|
|
7978
|
-
this.
|
|
7979
|
-
this.componentFactoryResolver = componentFactoryResolver;
|
|
7980
|
-
this.cdr = cdr;
|
|
7981
|
-
this._loading = false;
|
|
7982
|
-
this.indicator = LoadingStateIndicators.Dots;
|
|
7983
|
-
}
|
|
7984
|
-
set sLoadingState(value) {
|
|
7985
|
-
if (typeof value === "boolean") {
|
|
7986
|
-
this._loading = value;
|
|
7987
|
-
this.indicator = LoadingStateIndicators.Dots;
|
|
7988
|
-
}
|
|
7989
|
-
else if (typeof value === "object") {
|
|
7990
|
-
this._loading = value.loading;
|
|
7991
|
-
this.indicator = value.indicator || LoadingStateIndicators.Dots;
|
|
7992
|
-
}
|
|
7993
|
-
if (this.loaderComponent) {
|
|
7994
|
-
this.loaderComponent.instance.loading = this._loading;
|
|
7995
|
-
this.loaderComponent.instance.indicator = this.indicator;
|
|
7996
|
-
}
|
|
7997
|
-
}
|
|
7998
|
-
ngAfterViewInit() {
|
|
7999
|
-
this.createComponent();
|
|
8000
|
-
}
|
|
8001
|
-
createComponent() {
|
|
8002
|
-
const factory = this.componentFactoryResolver.resolveComponentFactory(LoadingStateComponent);
|
|
8003
|
-
this.loaderComponent = this.target.createComponent(factory);
|
|
8004
|
-
this.loaderComponent.instance.contents = this.template;
|
|
8005
|
-
this.loaderComponent.instance.loading = this._loading;
|
|
8006
|
-
this.loaderComponent.instance.indicator = this.indicator;
|
|
8007
|
-
this.cdr.detectChanges();
|
|
7973
|
+
let NumericPipe = class NumericPipe {
|
|
7974
|
+
constructor(numericService, localeService) {
|
|
7975
|
+
this.numericService = numericService;
|
|
7976
|
+
this.localeService = localeService;
|
|
8008
7977
|
}
|
|
8009
|
-
|
|
8010
|
-
|
|
8011
|
-
this.
|
|
8012
|
-
|
|
7978
|
+
transform(value, options) {
|
|
7979
|
+
return (options === null || options === void 0 ? void 0 : options.locale) ? of(this.numericService.instant(value, options))
|
|
7980
|
+
: this.localeService.getLocale().pipe(map((locale) => this.numericService.instant(value, {
|
|
7981
|
+
locale,
|
|
7982
|
+
numberFormatOptions: options === null || options === void 0 ? void 0 : options.numberFormatOptions,
|
|
7983
|
+
})));
|
|
8013
7984
|
}
|
|
8014
7985
|
};
|
|
8015
|
-
|
|
8016
|
-
{ type:
|
|
8017
|
-
{ type:
|
|
8018
|
-
{ type: ComponentFactoryResolver },
|
|
8019
|
-
{ type: ChangeDetectorRef }
|
|
7986
|
+
NumericPipe.ctorParameters = () => [
|
|
7987
|
+
{ type: NumericService },
|
|
7988
|
+
{ type: LocaleService }
|
|
8020
7989
|
];
|
|
8021
|
-
__decorate([
|
|
8022
|
-
|
|
8023
|
-
],
|
|
8024
|
-
LoadingStateDirective = __decorate([
|
|
8025
|
-
Directive({
|
|
8026
|
-
selector: "[sLoadingState]",
|
|
8027
|
-
})
|
|
8028
|
-
], LoadingStateDirective);
|
|
7990
|
+
NumericPipe = __decorate([
|
|
7991
|
+
Pipe({ name: "numeric" })
|
|
7992
|
+
], NumericPipe);
|
|
8029
7993
|
|
|
8030
|
-
|
|
7994
|
+
var LocaleModule_1;
|
|
7995
|
+
let LocaleModule = LocaleModule_1 = class LocaleModule {
|
|
7996
|
+
static forRoot() {
|
|
7997
|
+
return {
|
|
7998
|
+
ngModule: LocaleModule_1,
|
|
7999
|
+
providers: [
|
|
8000
|
+
LocaleService,
|
|
8001
|
+
LocalizedCurrencyPipe,
|
|
8002
|
+
LocalizedDatePipe,
|
|
8003
|
+
LocalizedTimePipe,
|
|
8004
|
+
LocalizedNumberPipe,
|
|
8005
|
+
LocalizedCurrencyImpurePipe,
|
|
8006
|
+
LocalizedDateImpurePipe,
|
|
8007
|
+
LocalizedTimeImpurePipe,
|
|
8008
|
+
LocalizedBignumberPipe,
|
|
8009
|
+
LocalizedBignumberImpurePipe,
|
|
8010
|
+
NumericPipe
|
|
8011
|
+
],
|
|
8012
|
+
};
|
|
8013
|
+
}
|
|
8014
|
+
static forChild() {
|
|
8015
|
+
return {
|
|
8016
|
+
ngModule: LocaleModule_1,
|
|
8017
|
+
};
|
|
8018
|
+
}
|
|
8031
8019
|
};
|
|
8032
|
-
|
|
8020
|
+
LocaleModule = LocaleModule_1 = __decorate([
|
|
8033
8021
|
NgModule({
|
|
8034
|
-
imports: [
|
|
8035
|
-
|
|
8036
|
-
|
|
8022
|
+
imports: [CommonModule],
|
|
8023
|
+
exports: [
|
|
8024
|
+
LocalizedCurrencyPipe,
|
|
8025
|
+
LocalizedDatePipe,
|
|
8026
|
+
LocalizedTimePipe,
|
|
8027
|
+
LocalizedNumberPipe,
|
|
8028
|
+
LocalizedCurrencyImpurePipe,
|
|
8029
|
+
LocalizedDateImpurePipe,
|
|
8030
|
+
LocalizedTimeImpurePipe,
|
|
8031
|
+
LocalizedBignumberPipe,
|
|
8032
|
+
LocalizedBignumberImpurePipe,
|
|
8033
|
+
NumericPipe
|
|
8037
8034
|
],
|
|
8038
8035
|
declarations: [
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
|
|
8045
|
-
|
|
8046
|
-
|
|
8036
|
+
LocalizedCurrencyPipe,
|
|
8037
|
+
LocalizedDatePipe,
|
|
8038
|
+
LocalizedTimePipe,
|
|
8039
|
+
LocalizedNumberPipe,
|
|
8040
|
+
LocalizedCurrencyImpurePipe,
|
|
8041
|
+
LocalizedDateImpurePipe,
|
|
8042
|
+
LocalizedTimeImpurePipe,
|
|
8043
|
+
LocalizedBignumberPipe,
|
|
8044
|
+
LocalizedBignumberImpurePipe,
|
|
8045
|
+
NumericPipe
|
|
8047
8046
|
],
|
|
8048
|
-
entryComponents: [LoadingStateComponent],
|
|
8049
8047
|
})
|
|
8050
|
-
],
|
|
8048
|
+
], LocaleModule);
|
|
8051
8049
|
|
|
8052
8050
|
var LocalizedNumberInputDirective_1;
|
|
8053
8051
|
let LocalizedNumberInputDirective = LocalizedNumberInputDirective_1 = class LocalizedNumberInputDirective {
|