@seniorsistemas/angular-components 17.8.15 → 17.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +151 -37
  2. package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
  4. package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
  5. package/components/info-sign/info-sign.component.d.ts +1 -0
  6. package/components/info-sign/info-sign.directive.d.ts +1 -0
  7. package/components/locale/pipes/numeric.pipe.d.ts +1 -1
  8. package/components/locale/services/numeric.service.d.ts +2 -2
  9. package/components/table/table-column/models/column.interface.d.ts +1 -0
  10. package/components/table/table-column/table-columns.component.d.ts +3 -1
  11. package/components/tooltip/tooltip.directive.d.ts +32 -2
  12. package/esm2015/components/info-sign/info-sign.component.js +2 -2
  13. package/esm2015/components/info-sign/info-sign.directive.js +5 -1
  14. package/esm2015/components/locale/pipes/numeric.pipe.js +2 -2
  15. package/esm2015/components/locale/services/numeric.service.js +8 -5
  16. package/esm2015/components/table/table-column/models/column.interface.js +1 -1
  17. package/esm2015/components/table/table-column/table-columns.component.js +34 -29
  18. package/esm2015/components/tooltip/tooltip.directive.js +84 -8
  19. package/esm2015/utils/currency/currency.service.js +29 -0
  20. package/esm2015/utils/currency/index.js +2 -0
  21. package/esm2015/utils/index.js +2 -1
  22. package/esm5/components/info-sign/info-sign.component.js +2 -2
  23. package/esm5/components/info-sign/info-sign.directive.js +5 -1
  24. package/esm5/components/locale/pipes/numeric.pipe.js +2 -2
  25. package/esm5/components/locale/services/numeric.service.js +8 -5
  26. package/esm5/components/table/table-column/models/column.interface.js +1 -1
  27. package/esm5/components/table/table-column/table-columns.component.js +31 -26
  28. package/esm5/components/tooltip/tooltip.directive.js +85 -8
  29. package/esm5/utils/currency/currency.service.js +31 -0
  30. package/esm5/utils/currency/index.js +2 -0
  31. package/esm5/utils/index.js +2 -1
  32. package/fesm2015/seniorsistemas-angular-components.js +152 -42
  33. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  34. package/fesm5/seniorsistemas-angular-components.js +152 -39
  35. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  36. package/package.json +1 -1
  37. package/seniorsistemas-angular-components.metadata.json +1 -1
  38. package/utils/currency/currency.service.d.ts +8 -0
  39. package/utils/currency/index.d.ts +1 -0
  40. package/utils/index.d.ts +1 -0
@@ -1,5 +1,5 @@
1
1
  import { __decorate, __assign, __extends, __spread, __awaiter, __generator, __param, __values, __rest, __read } from 'tslib';
2
- import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Directive, KeyValueDiffers, HostBinding, Renderer2, TemplateRef, InjectionToken, Inject, ViewEncapsulation, ViewContainerRef, ChangeDetectorRef, Pipe, ɵɵinject, ContentChild, Optional, ViewChildren } from '@angular/core';
2
+ import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Renderer2, Directive, KeyValueDiffers, HostBinding, TemplateRef, InjectionToken, Inject, ViewEncapsulation, ViewContainerRef, ChangeDetectorRef, 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, forkJoin } from 'rxjs';
5
5
  import { takeUntil, tap, map, switchMap, catchError, first, filter, take, delay, debounceTime, repeat, finalize } from 'rxjs/operators';
@@ -445,13 +445,14 @@ var TooltipEvent;
445
445
  })(TooltipEvent || (TooltipEvent = {}));
446
446
 
447
447
  var TooltipDirective = /** @class */ (function () {
448
- function TooltipDirective(elementRef, appRef, componentFactoryResolver, injector, debounceUtils) {
448
+ function TooltipDirective(elementRef, appRef, componentFactoryResolver, injector, debounceUtils, renderer) {
449
449
  var _this = this;
450
450
  this.elementRef = elementRef;
451
451
  this.appRef = appRef;
452
452
  this.componentFactoryResolver = componentFactoryResolver;
453
453
  this.injector = injector;
454
454
  this.debounceUtils = debounceUtils;
455
+ this.renderer = renderer;
455
456
  this.position = TooltipPosition.Top;
456
457
  this.showDelay = 500;
457
458
  this.tooltipEvent = TooltipEvent.Hover;
@@ -464,6 +465,7 @@ var TooltipDirective = /** @class */ (function () {
464
465
  }
465
466
  TooltipDirective.prototype.ngOnInit = function () {
466
467
  this.validatePosition();
468
+ this.updateTooltipVisibilityWhenFocusOnInput();
467
469
  };
468
470
  TooltipDirective.prototype.ngOnDestroy = function () {
469
471
  this.destroy();
@@ -487,6 +489,59 @@ var TooltipDirective = /** @class */ (function () {
487
489
  TooltipDirective.prototype.isMousePositionOutsideOfElement = function (mouseX, mouseY, elementArea) {
488
490
  return mouseX < elementArea.left || mouseX >= elementArea.right || mouseY < elementArea.top || mouseY >= elementArea.bottom;
489
491
  };
492
+ /**
493
+ * Manipula a visibilidade do tooltip quando houver uma referência de input.
494
+ */
495
+ TooltipDirective.prototype.updateTooltipVisibilityWhenFocusOnInput = function () {
496
+ var _this = this;
497
+ if (this.focusedInputRef) {
498
+ var inputFocus = this.focusedInputRef;
499
+ var icon_1 = this.getIconFromFocusedInput(inputFocus);
500
+ this.renderer.listen(inputFocus, 'focus', function () {
501
+ if (icon_1 && _this.isMatchingTooltip(icon_1)) {
502
+ _this.createTootipByFocus(icon_1);
503
+ }
504
+ });
505
+ this.renderer.listen(inputFocus, 'blur', function () {
506
+ if (icon_1 && _this.isMatchingTooltip(icon_1)) {
507
+ _this.removeTooltip(icon_1);
508
+ _this.destroy();
509
+ }
510
+ });
511
+ }
512
+ };
513
+ /**
514
+ * Obtém o elemento do ícone associado ao label do input em focus.
515
+ * @param focusedInput O input em focus.
516
+ * @returns O ícone do input em focus ou null.
517
+ */
518
+ TooltipDirective.prototype.getIconFromFocusedInput = function (focusedInput) {
519
+ var label = document.querySelector("label[for='" + focusedInput.id + "']");
520
+ if (label) {
521
+ var icon = label.nextElementSibling;
522
+ return (icon === null || icon === void 0 ? void 0 : icon.classList.contains('info-sign__icon')) ? icon : null;
523
+ }
524
+ return null;
525
+ };
526
+ /**
527
+ * Verifica se o ícone tem o tooltip correspondente ao atual.
528
+ * @param icon O ícone do input em focus.
529
+ * @returns true se o tooltip corresponde; caso contrário, false.
530
+ */
531
+ TooltipDirective.prototype.isMatchingTooltip = function (icon) {
532
+ var tooltipText = icon.getAttribute('ng-reflect-tooltip');
533
+ return this.tooltip === tooltipText;
534
+ };
535
+ /**
536
+ * Remove o tooltip associado ao ícone do input em focus.
537
+ * @param icon O ícone do input em focus.
538
+ */
539
+ TooltipDirective.prototype.removeTooltip = function (icon) {
540
+ var tooltip = icon.querySelector('.tooltip');
541
+ if (tooltip) {
542
+ tooltip.remove();
543
+ }
544
+ };
490
545
  // whenever the component with the tooltip is clicked I destroy the tooltip.
491
546
  // whenever a key is pressed on the component with the tooltip I destroy the tooltip.
492
547
  TooltipDirective.prototype.onClick = function () {
@@ -551,10 +606,7 @@ var TooltipDirective = /** @class */ (function () {
551
606
  TooltipDirective.prototype.createTootip = function () {
552
607
  var _a;
553
608
  if (this.componentRef === null && ((_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.length)) {
554
- var componentFactory = this.componentFactoryResolver.resolveComponentFactory(TooltipComponent);
555
- this.componentRef = componentFactory.create(this.injector);
556
- this.appRef.attachView(this.componentRef.hostView);
557
- var domElem = this.componentRef.hostView.rootNodes[0];
609
+ var domElem = this.getDomElement();
558
610
  document.body.appendChild(domElem);
559
611
  this.setTooltipComponentProperties();
560
612
  this.showTimeout = window.setTimeout(this.showTooltip.bind(this), this.showDelay);
@@ -564,6 +616,27 @@ var TooltipDirective = /** @class */ (function () {
564
616
  }
565
617
  }
566
618
  };
619
+ TooltipDirective.prototype.getDomElement = function () {
620
+ var componentFactory = this.componentFactoryResolver.resolveComponentFactory(TooltipComponent);
621
+ this.componentRef = componentFactory.create(this.injector);
622
+ this.appRef.attachView(this.componentRef.hostView);
623
+ return this.componentRef.hostView.rootNodes[0];
624
+ };
625
+ /**
626
+ * Cria um tooltip para o icone do input em focus.
627
+ *
628
+ * @param icon O ícone do input em focus.
629
+ */
630
+ TooltipDirective.prototype.createTootipByFocus = function (icon) {
631
+ var _a;
632
+ if (this.componentRef === null && ((_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.length)) {
633
+ var domElem = this.getDomElement();
634
+ var tooltip_1 = domElem.querySelector('.tooltip');
635
+ icon.appendChild(tooltip_1);
636
+ this.setTooltipComponentProperties();
637
+ setTimeout(function () { return tooltip_1.classList.add("tooltip--visible"); }, 0);
638
+ }
639
+ };
567
640
  TooltipDirective.prototype.showTooltip = function () {
568
641
  if (this.componentRef !== null) {
569
642
  this.componentRef.instance.visible = this.visible;
@@ -681,7 +754,8 @@ var TooltipDirective = /** @class */ (function () {
681
754
  { type: ApplicationRef },
682
755
  { type: ComponentFactoryResolver },
683
756
  { type: Injector },
684
- { type: DebounceUtils }
757
+ { type: DebounceUtils },
758
+ { type: Renderer2 }
685
759
  ]; };
686
760
  __decorate([
687
761
  Input("sTooltip")
@@ -707,6 +781,9 @@ var TooltipDirective = /** @class */ (function () {
707
781
  __decorate([
708
782
  Input()
709
783
  ], TooltipDirective.prototype, "mobileBehavior", void 0);
784
+ __decorate([
785
+ Input()
786
+ ], TooltipDirective.prototype, "focusedInputRef", void 0);
710
787
  __decorate([
711
788
  HostListener("click"),
712
789
  HostListener("keydown")
@@ -6572,7 +6649,7 @@ var InfoSignComponent = /** @class */ (function () {
6572
6649
  InfoSignComponent = __decorate([
6573
6650
  Component({
6574
6651
  selector: "s-info-sign-component",
6575
- template: "<span class=\"info-sign\">\n <span *ngTemplateOutlet=\"templateRef\"></span>\n <i\n class=\"info-sign__icon fa fa-info-circle\"\n aria-hidden=\"true\"\n [sTooltip]=\"tooltip\"\n [escape]=\"false\"\n tooltipPosition=\"top\"\n [displayTime]=\"displayTime\"\n mobileBehavior=\"tap\"\n showDelay=\"0\">\n </i>\n</span>",
6652
+ template: "<span class=\"info-sign\">\n <span *ngTemplateOutlet=\"templateRef\"></span>\n <i\n class=\"info-sign__icon fa fa-info-circle\"\n aria-hidden=\"true\"\n [sTooltip]=\"tooltip\"\n [escape]=\"false\"\n tooltipPosition=\"top\"\n [displayTime]=\"displayTime\"\n mobileBehavior=\"tap\"\n showDelay=\"0\"\n [focusedInputRef]=\"focusedInputRef\">\n </i>\n</span>\n",
6576
6653
  styles: [".info-sign{-ms-flex-align:baseline;align-items:baseline;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:start;justify-content:flex-start}.info-sign .info-sign__icon{padding:0 12px}"]
6577
6654
  })
6578
6655
  ], InfoSignComponent);
@@ -6594,6 +6671,7 @@ var InfoSignDirective = /** @class */ (function () {
6594
6671
  this.componentRef.instance.templateRef = this.templateRef;
6595
6672
  this.componentRef.instance.tooltip = this.sInfoSign;
6596
6673
  this.componentRef.instance.displayTime = this.displayTime;
6674
+ this.componentRef.instance.focusedInputRef = this.focusedInputRef;
6597
6675
  }
6598
6676
  else if (this.componentRef && this.sInfoSign) {
6599
6677
  this.componentRef.instance.tooltip = this.sInfoSign;
@@ -6619,6 +6697,9 @@ var InfoSignDirective = /** @class */ (function () {
6619
6697
  __decorate([
6620
6698
  Input('sInfoSignDisplayTime')
6621
6699
  ], InfoSignDirective.prototype, "displayTime", void 0);
6700
+ __decorate([
6701
+ Input('sInfoSignFocusedInputRef')
6702
+ ], InfoSignDirective.prototype, "focusedInputRef", void 0);
6622
6703
  InfoSignDirective = __decorate([
6623
6704
  Directive({
6624
6705
  selector: "[sInfoSign]",
@@ -7163,14 +7244,17 @@ var NumericService = /** @class */ (function () {
7163
7244
  * Documentation is available at {@link https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat Intl.NumberFormatOptions}.
7164
7245
  *
7165
7246
  * @param {number | string | BigNumber} value The value to be formatted.
7166
- * @param {Intl.NumberFormatOptions} options Options that overwrites the default Intl.NumberFormatOptions.
7247
+ * @param options Locale and numberFormatOptions that overwrites the default Intl.NumberFormatOptions.
7167
7248
  * @return `string` The formatted value.
7168
7249
  */
7169
7250
  NumericService.prototype.instant = function (value, options) {
7170
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
7171
- options = __assign(__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", options: __assign(__assign({}, options === null || options === void 0 ? void 0 : options.options), { currency: ((_d = options === null || options === void 0 ? void 0 : options.options) === null || _d === void 0 ? void 0 : _d.style) === "currency" ? (_f = (_e = options === null || options === void 0 ? void 0 : options.options) === 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.options) === null || _g === void 0 ? void 0 : _g.style) === "currency" ? (_j = (_h = options === null || options === void 0 ? void 0 : options.options) === null || _h === void 0 ? void 0 : _h.currencyDisplay) !== null && _j !== void 0 ? _j : "narrowSymbol" : undefined, minimumFractionDigits: (_l = (_k = options === null || options === void 0 ? void 0 : options.options) === null || _k === void 0 ? void 0 : _k.minimumFractionDigits) !== null && _l !== void 0 ? _l : 0 }) });
7251
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
7252
+ options = __assign(__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: __assign(__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"
7253
+ ? ((_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")
7254
+ : 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 : 2, maximumFractionDigits: (_o = (_m = options === null || options === void 0 ? void 0 : options.numberFormatOptions) === null || _m === void 0 ? void 0 : _m.maximumFractionDigits) !== null && _o !== void 0 ? _o : 2 }) });
7255
+ options.numberFormatOptions["trailingZeroDisplay"] = "stripIfInteger";
7172
7256
  // From https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
7173
- return new Intl.NumberFormat(options.locale, options.options).format(this.getType(value) === "number" || this.getType(value) === "string" ? value : value.toString());
7257
+ return new Intl.NumberFormat(options.locale, options.numberFormatOptions).format(this.getType(value) === "number" || this.getType(value) === "string" ? value : value.toString());
7174
7258
  };
7175
7259
  NumericService.prototype.getType = function (value) {
7176
7260
  // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof
@@ -7225,7 +7309,7 @@ var NumericPipe = /** @class */ (function () {
7225
7309
  : this.localeService.getLocale().pipe(map(function (locale) {
7226
7310
  return _this.numericService.instant(value, {
7227
7311
  locale: locale,
7228
- options: options === null || options === void 0 ? void 0 : options.options,
7312
+ numberFormatOptions: options === null || options === void 0 ? void 0 : options.numberFormatOptions,
7229
7313
  });
7230
7314
  }));
7231
7315
  };
@@ -8195,14 +8279,15 @@ var EnumBadgeColors;
8195
8279
 
8196
8280
  var moment$4 = moment_;
8197
8281
  var TableColumnsComponent = /** @class */ (function () {
8198
- function TableColumnsComponent(localeService, viewContainerRef, translate, hostProjectConfigs) {
8282
+ function TableColumnsComponent(localeService, viewContainerRef, translate, numericService, hostProjectConfigs) {
8199
8283
  this.localeService = localeService;
8200
8284
  this.viewContainerRef = viewContainerRef;
8201
8285
  this.translate = translate;
8286
+ this.numericService = numericService;
8202
8287
  this.hostProjectConfigs = hostProjectConfigs;
8203
8288
  this.locale = {
8204
8289
  calendar: __assign(__assign({}, this.localeService.getLocaleOptions().calendar), { dateFormat: convertToMomentDateFormat(this.localeService.getLocaleOptions().calendar.dateFormat) }),
8205
- number: __assign(__assign({}, this.localeService.getLocaleOptions().number), { scale: 0 })
8290
+ number: __assign(__assign({}, this.localeService.getLocaleOptions().number), { scale: 0 }),
8206
8291
  };
8207
8292
  this.formattedColumns = [];
8208
8293
  }
@@ -8225,7 +8310,7 @@ var TableColumnsComponent = /** @class */ (function () {
8225
8310
  return {
8226
8311
  value: string,
8227
8312
  isUninformed: string === uninformed,
8228
- separator: !isLastIndex ? separator : ""
8313
+ separator: !isLastIndex ? separator : "",
8229
8314
  };
8230
8315
  });
8231
8316
  }
@@ -8258,10 +8343,10 @@ var TableColumnsComponent = /** @class */ (function () {
8258
8343
  return column.prefix ? column.prefix : this.hostProjectConfigs.domain + "." + this.hostProjectConfigs.service + ".";
8259
8344
  };
8260
8345
  TableColumnsComponent.prototype.isAttributeValueInvalid = function (attributeValue) {
8261
- return attributeValue === null ||
8346
+ return (attributeValue === null ||
8262
8347
  attributeValue === undefined ||
8263
8348
  (this.isArray(attributeValue) && !attributeValue.length) ||
8264
- (typeof attributeValue === 'string' && attributeValue.trim() === '');
8349
+ (typeof attributeValue === "string" && attributeValue.trim() === ""));
8265
8350
  };
8266
8351
  TableColumnsComponent.prototype.getFormattedColumnValue = function (column, columnValue, unifiedColumnValues, uninformedText, uninformedNumber) {
8267
8352
  if (uninformedNumber === column.attributes.length) {
@@ -8274,13 +8359,9 @@ var TableColumnsComponent = /** @class */ (function () {
8274
8359
  };
8275
8360
  TableColumnsComponent.prototype.getAttributeValue = function (attribute, rowValue) {
8276
8361
  var attributeValue;
8277
- attribute
8278
- .split("/")
8279
- .forEach(function (value) {
8362
+ attribute.split("/").forEach(function (value) {
8280
8363
  if (!attributeValue) {
8281
- value
8282
- .split(".")
8283
- .forEach(function (val, i) {
8364
+ value.split(".").forEach(function (val, i) {
8284
8365
  if (!rowValue) {
8285
8366
  return;
8286
8367
  }
@@ -8298,9 +8379,7 @@ var TableColumnsComponent = /** @class */ (function () {
8298
8379
  return attributeValue;
8299
8380
  };
8300
8381
  TableColumnsComponent.prototype.getNumberConfigs = function (column) {
8301
- return __assign(__assign({}, this.locale.number), { scale: column.scale !== null && column.scale !== undefined
8302
- ? this.getColumnScale(column.scale)
8303
- : this.locale.number.scale, prefix: this.locale.number.currencySymbol + " " });
8382
+ return __assign(__assign({}, this.locale.number), { scale: column.scale !== null && column.scale !== undefined ? this.getColumnScale(column.scale) : this.locale.number.scale, prefix: this.locale.number.currencySymbol + " " });
8304
8383
  };
8305
8384
  TableColumnsComponent.prototype.getDateFormat = function (column, locale) {
8306
8385
  return column.dateFormat ? column.dateFormat : locale.calendar.dateFormat;
@@ -8312,8 +8391,8 @@ var TableColumnsComponent = /** @class */ (function () {
8312
8391
  var separator = this.getColumnSeparator(column);
8313
8392
  var uninformed = this.translate.instant(prefix + "empty_label");
8314
8393
  var style = column.style;
8315
- var columnValue = column.attributes
8316
- .map(function (attribute) {
8394
+ var columnValue = column.attributes.map(function (attribute) {
8395
+ var _a, _b;
8317
8396
  var attributeValue = _this.getAttributeValue(attribute, rowValue);
8318
8397
  if (_this.isAttributeValueInvalid(attributeValue)) {
8319
8398
  return uninformed;
@@ -8323,7 +8402,10 @@ var TableColumnsComponent = /** @class */ (function () {
8323
8402
  case EnumColumnFieldType.ENUM:
8324
8403
  return _this.translate.instant(column.enumPrefix + attributeValue.toString().toLowerCase());
8325
8404
  case EnumColumnFieldType.CURRENCY:
8326
- return applyMask(attributeValue, numberConfigs, _this.isNumber(attributeValue));
8405
+ return ((_a = attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.options) === null || _a === void 0 ? void 0 : _a.numberFormatOptions) ? _this.numericService.instant(attributeValue.value, {
8406
+ numberFormatOptions: attributeValue.options.numberFormatOptions,
8407
+ })
8408
+ : applyMask(attributeValue, numberConfigs, _this.isNumber(attributeValue));
8327
8409
  case EnumColumnFieldType.DATE:
8328
8410
  var dateFormat = _this.getDateFormat(column, locale);
8329
8411
  return moment$4(attributeValue).format(dateFormat);
@@ -8332,7 +8414,14 @@ var TableColumnsComponent = /** @class */ (function () {
8332
8414
  return _this.translate.instant(prefix + value);
8333
8415
  case EnumColumnFieldType.NUMBER:
8334
8416
  numberConfigs.prefix = "";
8335
- return applyMask(attributeValue, numberConfigs, _this.isNumber(attributeValue));
8417
+ return ((_b = attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.options) === null || _b === void 0 ? void 0 : _b.numberFormatOptions) ? _this.numericService.instant(attributeValue.value, {
8418
+ numberFormatOptions: attributeValue.options.numberFormatOptions,
8419
+ })
8420
+ : column.numberFormatOptions
8421
+ ? _this.numericService.instant(attributeValue, {
8422
+ numberFormatOptions: column.numberFormatOptions,
8423
+ })
8424
+ : applyMask(attributeValue, numberConfigs, _this.isNumber(attributeValue));
8336
8425
  case EnumColumnFieldType.TOKENS:
8337
8426
  return _this.getTokens(attributeValue);
8338
8427
  default:
@@ -8340,9 +8429,7 @@ var TableColumnsComponent = /** @class */ (function () {
8340
8429
  }
8341
8430
  });
8342
8431
  var unifiedColumnValues = columnValue.join(separator);
8343
- var uninformedNumber = unifiedColumnValues
8344
- .split(separator)
8345
- .filter(function (value) { return value === uninformed; }).length;
8432
+ var uninformedNumber = unifiedColumnValues.split(separator).filter(function (value) { return value === uninformed; }).length;
8346
8433
  var formattedColumnValue = this.getFormattedColumnValue(column, columnValue, unifiedColumnValues, uninformed, uninformedNumber);
8347
8434
  return {
8348
8435
  style: style,
@@ -8354,7 +8441,7 @@ var TableColumnsComponent = /** @class */ (function () {
8354
8441
  tooltip: this.getColumnTooltip(column.tooltip),
8355
8442
  infoSign: this.getColumnInfoSign(column.infoSign),
8356
8443
  onLinkClick: column.onLinkClick,
8357
- onColumnClick: column.onColumnClick
8444
+ onColumnClick: column.onColumnClick,
8358
8445
  };
8359
8446
  };
8360
8447
  TableColumnsComponent.prototype.getColumnScale = function (scale) {
@@ -8382,7 +8469,7 @@ var TableColumnsComponent = /** @class */ (function () {
8382
8469
  return "";
8383
8470
  };
8384
8471
  TableColumnsComponent.prototype.isNumber = function (value) {
8385
- return !(new BigNumber(value).isNaN());
8472
+ return !new BigNumber(value).isNaN();
8386
8473
  };
8387
8474
  TableColumnsComponent.prototype.getTokens = function (values) {
8388
8475
  if (!this.isArray(values)) {
@@ -8399,7 +8486,7 @@ var TableColumnsComponent = /** @class */ (function () {
8399
8486
  .map(function (value) {
8400
8487
  var label = typeof value === "symbol" ? value.toString() : "" + value;
8401
8488
  return {
8402
- label: label
8489
+ label: label,
8403
8490
  };
8404
8491
  });
8405
8492
  };
@@ -8419,6 +8506,7 @@ var TableColumnsComponent = /** @class */ (function () {
8419
8506
  { type: LocaleService },
8420
8507
  { type: ViewContainerRef },
8421
8508
  { type: TranslateService },
8509
+ { type: NumericService },
8422
8510
  { type: undefined, decorators: [{ type: Inject, args: [HostProjectConfigsInjectionToken,] }] }
8423
8511
  ]; };
8424
8512
  __decorate([
@@ -8439,7 +8527,7 @@ var TableColumnsComponent = /** @class */ (function () {
8439
8527
  selector: "s-table-columns",
8440
8528
  styles: [":host{display:none}"]
8441
8529
  }),
8442
- __param(3, Inject(HostProjectConfigsInjectionToken))
8530
+ __param(4, Inject(HostProjectConfigsInjectionToken))
8443
8531
  ], TableColumnsComponent);
8444
8532
  return TableColumnsComponent;
8445
8533
  }());
@@ -17860,6 +17948,31 @@ var WorkspaceSwitchModule = /** @class */ (function () {
17860
17948
  return WorkspaceSwitchModule;
17861
17949
  }());
17862
17950
 
17951
+ var CurrencyService = /** @class */ (function () {
17952
+ function CurrencyService(localeService) {
17953
+ this.localeService = localeService;
17954
+ }
17955
+ CurrencyService.prototype.getCurrencySymbol = function (_a) {
17956
+ var currency = _a.currency;
17957
+ var _b, _c;
17958
+ var numberFormat = new Intl.NumberFormat(this.localeService.getLocaleOptions().locale, {
17959
+ style: "currency",
17960
+ currency: currency !== null && currency !== void 0 ? currency : "BRL",
17961
+ currencyDisplay: 'narrowSymbol',
17962
+ maximumFractionDigits: 5,
17963
+ });
17964
+ return (_c = (_b = numberFormat.formatToParts(1).find(function (x) { return x.type === "currency"; })) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : "";
17965
+ };
17966
+ CurrencyService.ctorParameters = function () { return [
17967
+ { type: LocaleService }
17968
+ ]; };
17969
+ CurrencyService.ɵprov = ɵɵdefineInjectable({ factory: function CurrencyService_Factory() { return new CurrencyService(ɵɵinject(LocaleService)); }, token: CurrencyService, providedIn: "root" });
17970
+ CurrencyService = __decorate([
17971
+ Injectable({ providedIn: "root" })
17972
+ ], CurrencyService);
17973
+ return CurrencyService;
17974
+ }());
17975
+
17863
17976
  var fallback = {
17864
17977
  "platform.angular_components.drag_your_photo_or": "Arraste sua foto ou",
17865
17978
  "platform.angular_components.select_a_file": "selecione um arquivo",
@@ -18179,5 +18292,5 @@ var fallback = {
18179
18292
  * Generated bundle index. Do not edit.
18180
18293
  */
18181
18294
 
18182
- export { AccordionComponent, AccordionModule, AccordionPanelComponent, AlertComponent, AlertModule, AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, CardComponent, CardModule, CardTemplateTypes, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CountryPhonePickerComponent, CountryPhonePickerModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DebounceUtils, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, EnumSeverity, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FileUploadPermissions, FileValidation, FormField, GanttComponent, GanttModule, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, IAInsightComponent, IAInsightModule, IAInsightTemplateTypes, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, KanbanComponent, KanbanModule, KanbanTemplateTypes, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationButtonComponent, NavigationButtonModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, Ordination, PanelComponent, PanelModule, PasswordField, PasswordStrengthComponent, PasswordStrengthDirective, PasswordStrengthModule, PasswordStrengthPositions, PasswordStrengths, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, ProgressBarColors, ProgressBarComponent, ProgressBarModule, RadioButtonField, RatingScaleComponent, RatingScaleModule, RationButtonOption, RowTogllerDirective, SVGFactoryDirective, SVGFactoryModule, Section, SelectButtonComponent, SelectButtonModule, SelectField, SelectOption, SidebarComponent, SidebarModule, SlidePanelComponent, SlidePanelModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, SwitchComponent, SwitchModule, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TieredMenuDirective, TieredMenuModule, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, ViewMode, WorkspaceSwitchComponent, WorkspaceSwitchModule, convertToMomentDateFormat, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb, TextFieldComponent as ɵba, NumberFieldModule as ɵbb, LocalizedNumberInputModule as ɵbc, NumberInputModule as ɵbd, NumberFieldComponent as ɵbe, CurrencyFieldModule as ɵbf, CurrencyFieldComponent as ɵbg, NumberFieldModule$1 as ɵbh, BignumberInputModule as ɵbi, BignumberFieldComponent as ɵbj, ProfilePictureModule as ɵbk, ThumbnailService as ɵbl, StructureModule as ɵbm, HeaderComponent as ɵbn, FooterComponent as ɵbo, ProfilePictureFieldComponent as ɵbp, AutocompleteFieldComponent as ɵbq, BooleanFieldComponent as ɵbr, BooleanSwitchFieldComponent as ɵbs, CalendarFieldComponent as ɵbt, ChipsFieldComponent as ɵbu, CountryPhonePickerFieldComponent as ɵbv, DynamicFieldComponent as ɵbw, DynamicFormDirective as ɵbx, FieldsetComponent as ɵby, FileUploadComponent$1 as ɵbz, TemplateDirective as ɵc, LookupFieldComponent as ɵca, RadioButtonComponent as ɵcb, RowComponent as ɵcc, SectionComponent as ɵcd, SelectFieldComponent as ɵce, SliderFieldComponent as ɵcf, TextAreaFieldComponent as ɵcg, TextAreaIAFieldComponent as ɵch, IAssistService as ɵci, DecimalField as ɵck, SideTableComponent as ɵcl, InfiniteScrollModule as ɵcm, InfiniteScrollDirective as ɵcn, IAInsightSidebarComponent as ɵco, IAInsightCardComponent as ɵcp, IAInsightCardLoaderComponent as ɵcq, KanbanEventService as ɵcr, KanbanItemComponent as ɵcs, KanbanColumnComponent as ɵct, KanbanItemDraggingComponent as ɵcu, NumberLocaleOptions as ɵcv, TieredMenuEventService as ɵcw, TieredMenuService as ɵcx, TieredMenuGlobalService as ɵcy, TieredMenuComponent as ɵcz, TemplateModule as ɵd, TieredMenuNestedComponent as ɵda, TieredMenuItemComponent as ɵdb, TieredMenuDividerComponent as ɵdc, BorderButtonModule as ɵdd, BorderButtonComponent as ɵde, ProgressBarDeterminateComponent as ɵdf, ProgressBarIndeterminateComponent as ɵdg, SelectButtonItemComponent as ɵdh, SlidePanelService as ɵdi, TimelineItemModule as ɵdj, TimelineIconItemComponent as ɵdk, HorizontalTimelineModule as ɵdl, HorizontalTimelineComponent as ɵdm, VerticalTimelineModule as ɵdn, VerticalTimelineComponent as ɵdo, RangeLineComponent as ɵdp, CollapseOptionComponent as ɵdq, CollapsedItemsComponent as ɵdr, VerticalItemsComponent as ɵds, CustomTranslationsModule as ɵe, CodeEditorComponent as ɵf, CoreFacade as ɵg, CodeMirror6Core as ɵh, CountryPhonePickerService as ɵi, LocalizedCurrencyImpurePipe as ɵj, LocalizedBignumberPipe as ɵk, LocalizedBignumberImpurePipe as ɵl, NumericPipe as ɵm, NumericService as ɵn, EmptyStateGoBackComponent as ɵo, IAssistIconComponent as ɵp, SeniorIconComponent as ɵq, DotsIndicatorComponent as ɵr, LoadingIndicatorComponent as ɵs, FileUploadService as ɵt, InfoSignComponent as ɵu, TableColumnsComponent as ɵv, TablePagingComponent as ɵw, PasswordFieldModule as ɵx, PasswordFieldComponent as ɵy, TextFieldModule as ɵz };
18295
+ export { AccordionComponent, AccordionModule, AccordionPanelComponent, AlertComponent, AlertModule, AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, CardComponent, CardModule, CardTemplateTypes, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CountryPhonePickerComponent, CountryPhonePickerModule, CurrencyField, CurrencyService, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DebounceUtils, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, EnumSeverity, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FileUploadPermissions, FileValidation, FormField, GanttComponent, GanttModule, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, IAInsightComponent, IAInsightModule, IAInsightTemplateTypes, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, KanbanComponent, KanbanModule, KanbanTemplateTypes, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationButtonComponent, NavigationButtonModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, Ordination, PanelComponent, PanelModule, PasswordField, PasswordStrengthComponent, PasswordStrengthDirective, PasswordStrengthModule, PasswordStrengthPositions, PasswordStrengths, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, ProgressBarColors, ProgressBarComponent, ProgressBarModule, RadioButtonField, RatingScaleComponent, RatingScaleModule, RationButtonOption, RowTogllerDirective, SVGFactoryDirective, SVGFactoryModule, Section, SelectButtonComponent, SelectButtonModule, SelectField, SelectOption, SidebarComponent, SidebarModule, SlidePanelComponent, SlidePanelModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, SwitchComponent, SwitchModule, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TieredMenuDirective, TieredMenuModule, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, ViewMode, WorkspaceSwitchComponent, WorkspaceSwitchModule, convertToMomentDateFormat, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb, TextFieldComponent as ɵba, NumberFieldModule as ɵbb, LocalizedNumberInputModule as ɵbc, NumberInputModule as ɵbd, NumberFieldComponent as ɵbe, CurrencyFieldModule as ɵbf, CurrencyFieldComponent as ɵbg, NumberFieldModule$1 as ɵbh, BignumberInputModule as ɵbi, BignumberFieldComponent as ɵbj, ProfilePictureModule as ɵbk, ThumbnailService as ɵbl, StructureModule as ɵbm, HeaderComponent as ɵbn, FooterComponent as ɵbo, ProfilePictureFieldComponent as ɵbp, AutocompleteFieldComponent as ɵbq, BooleanFieldComponent as ɵbr, BooleanSwitchFieldComponent as ɵbs, CalendarFieldComponent as ɵbt, ChipsFieldComponent as ɵbu, CountryPhonePickerFieldComponent as ɵbv, DynamicFieldComponent as ɵbw, DynamicFormDirective as ɵbx, FieldsetComponent as ɵby, FileUploadComponent$1 as ɵbz, TemplateDirective as ɵc, LookupFieldComponent as ɵca, RadioButtonComponent as ɵcb, RowComponent as ɵcc, SectionComponent as ɵcd, SelectFieldComponent as ɵce, SliderFieldComponent as ɵcf, TextAreaFieldComponent as ɵcg, TextAreaIAFieldComponent as ɵch, IAssistService as ɵci, DecimalField as ɵck, SideTableComponent as ɵcl, InfiniteScrollModule as ɵcm, InfiniteScrollDirective as ɵcn, IAInsightSidebarComponent as ɵco, IAInsightCardComponent as ɵcp, IAInsightCardLoaderComponent as ɵcq, KanbanEventService as ɵcr, KanbanItemComponent as ɵcs, KanbanColumnComponent as ɵct, KanbanItemDraggingComponent as ɵcu, NumberLocaleOptions as ɵcv, TieredMenuEventService as ɵcw, TieredMenuService as ɵcx, TieredMenuGlobalService as ɵcy, TieredMenuComponent as ɵcz, TemplateModule as ɵd, TieredMenuNestedComponent as ɵda, TieredMenuItemComponent as ɵdb, TieredMenuDividerComponent as ɵdc, BorderButtonModule as ɵdd, BorderButtonComponent as ɵde, ProgressBarDeterminateComponent as ɵdf, ProgressBarIndeterminateComponent as ɵdg, SelectButtonItemComponent as ɵdh, SlidePanelService as ɵdi, TimelineItemModule as ɵdj, TimelineIconItemComponent as ɵdk, HorizontalTimelineModule as ɵdl, HorizontalTimelineComponent as ɵdm, VerticalTimelineModule as ɵdn, VerticalTimelineComponent as ɵdo, RangeLineComponent as ɵdp, CollapseOptionComponent as ɵdq, CollapsedItemsComponent as ɵdr, VerticalItemsComponent as ɵds, CustomTranslationsModule as ɵe, CodeEditorComponent as ɵf, CoreFacade as ɵg, CodeMirror6Core as ɵh, CountryPhonePickerService as ɵi, LocalizedCurrencyImpurePipe as ɵj, LocalizedBignumberPipe as ɵk, LocalizedBignumberImpurePipe as ɵl, NumericPipe as ɵm, NumericService as ɵn, EmptyStateGoBackComponent as ɵo, IAssistIconComponent as ɵp, SeniorIconComponent as ɵq, DotsIndicatorComponent as ɵr, LoadingIndicatorComponent as ɵs, FileUploadService as ɵt, InfoSignComponent as ɵu, TableColumnsComponent as ɵv, TablePagingComponent as ɵw, PasswordFieldModule as ɵx, PasswordFieldComponent as ɵy, TextFieldModule as ɵz };
18183
18296
  //# sourceMappingURL=seniorsistemas-angular-components.js.map