@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, __awaiter, __param, __rest } 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';
@@ -415,12 +415,13 @@ var TooltipEvent;
415
415
  })(TooltipEvent || (TooltipEvent = {}));
416
416
 
417
417
  let TooltipDirective = class TooltipDirective {
418
- constructor(elementRef, appRef, componentFactoryResolver, injector, debounceUtils) {
418
+ constructor(elementRef, appRef, componentFactoryResolver, injector, debounceUtils, renderer) {
419
419
  this.elementRef = elementRef;
420
420
  this.appRef = appRef;
421
421
  this.componentFactoryResolver = componentFactoryResolver;
422
422
  this.injector = injector;
423
423
  this.debounceUtils = debounceUtils;
424
+ this.renderer = renderer;
424
425
  this.position = TooltipPosition.Top;
425
426
  this.showDelay = 500;
426
427
  this.tooltipEvent = TooltipEvent.Hover;
@@ -433,6 +434,7 @@ let TooltipDirective = class TooltipDirective {
433
434
  }
434
435
  ngOnInit() {
435
436
  this.validatePosition();
437
+ this.updateTooltipVisibilityWhenFocusOnInput();
436
438
  }
437
439
  ngOnDestroy() {
438
440
  this.destroy();
@@ -456,6 +458,58 @@ let TooltipDirective = class TooltipDirective {
456
458
  isMousePositionOutsideOfElement(mouseX, mouseY, elementArea) {
457
459
  return mouseX < elementArea.left || mouseX >= elementArea.right || mouseY < elementArea.top || mouseY >= elementArea.bottom;
458
460
  }
461
+ /**
462
+ * Manipula a visibilidade do tooltip quando houver uma referência de input.
463
+ */
464
+ updateTooltipVisibilityWhenFocusOnInput() {
465
+ if (this.focusedInputRef) {
466
+ const inputFocus = this.focusedInputRef;
467
+ const icon = this.getIconFromFocusedInput(inputFocus);
468
+ this.renderer.listen(inputFocus, 'focus', () => {
469
+ if (icon && this.isMatchingTooltip(icon)) {
470
+ this.createTootipByFocus(icon);
471
+ }
472
+ });
473
+ this.renderer.listen(inputFocus, 'blur', () => {
474
+ if (icon && this.isMatchingTooltip(icon)) {
475
+ this.removeTooltip(icon);
476
+ this.destroy();
477
+ }
478
+ });
479
+ }
480
+ }
481
+ /**
482
+ * Obtém o elemento do ícone associado ao label do input em focus.
483
+ * @param focusedInput O input em focus.
484
+ * @returns O ícone do input em focus ou null.
485
+ */
486
+ getIconFromFocusedInput(focusedInput) {
487
+ const label = document.querySelector(`label[for='${focusedInput.id}']`);
488
+ if (label) {
489
+ const icon = label.nextElementSibling;
490
+ return (icon === null || icon === void 0 ? void 0 : icon.classList.contains('info-sign__icon')) ? icon : null;
491
+ }
492
+ return null;
493
+ }
494
+ /**
495
+ * Verifica se o ícone tem o tooltip correspondente ao atual.
496
+ * @param icon O ícone do input em focus.
497
+ * @returns true se o tooltip corresponde; caso contrário, false.
498
+ */
499
+ isMatchingTooltip(icon) {
500
+ const tooltipText = icon.getAttribute('ng-reflect-tooltip');
501
+ return this.tooltip === tooltipText;
502
+ }
503
+ /**
504
+ * Remove o tooltip associado ao ícone do input em focus.
505
+ * @param icon O ícone do input em focus.
506
+ */
507
+ removeTooltip(icon) {
508
+ const tooltip = icon.querySelector('.tooltip');
509
+ if (tooltip) {
510
+ tooltip.remove();
511
+ }
512
+ }
459
513
  // whenever the component with the tooltip is clicked I destroy the tooltip.
460
514
  // whenever a key is pressed on the component with the tooltip I destroy the tooltip.
461
515
  onClick() {
@@ -520,10 +574,7 @@ let TooltipDirective = class TooltipDirective {
520
574
  createTootip() {
521
575
  var _a;
522
576
  if (this.componentRef === null && ((_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.length)) {
523
- const componentFactory = this.componentFactoryResolver.resolveComponentFactory(TooltipComponent);
524
- this.componentRef = componentFactory.create(this.injector);
525
- this.appRef.attachView(this.componentRef.hostView);
526
- const domElem = this.componentRef.hostView.rootNodes[0];
577
+ const domElem = this.getDomElement();
527
578
  document.body.appendChild(domElem);
528
579
  this.setTooltipComponentProperties();
529
580
  this.showTimeout = window.setTimeout(this.showTooltip.bind(this), this.showDelay);
@@ -533,6 +584,27 @@ let TooltipDirective = class TooltipDirective {
533
584
  }
534
585
  }
535
586
  }
587
+ getDomElement() {
588
+ const componentFactory = this.componentFactoryResolver.resolveComponentFactory(TooltipComponent);
589
+ this.componentRef = componentFactory.create(this.injector);
590
+ this.appRef.attachView(this.componentRef.hostView);
591
+ return this.componentRef.hostView.rootNodes[0];
592
+ }
593
+ /**
594
+ * Cria um tooltip para o icone do input em focus.
595
+ *
596
+ * @param icon O ícone do input em focus.
597
+ */
598
+ createTootipByFocus(icon) {
599
+ var _a;
600
+ if (this.componentRef === null && ((_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.length)) {
601
+ const domElem = this.getDomElement();
602
+ const tooltip = domElem.querySelector('.tooltip');
603
+ icon.appendChild(tooltip);
604
+ this.setTooltipComponentProperties();
605
+ setTimeout(() => tooltip.classList.add("tooltip--visible"), 0);
606
+ }
607
+ }
536
608
  showTooltip() {
537
609
  if (this.componentRef !== null) {
538
610
  this.componentRef.instance.visible = this.visible;
@@ -651,7 +723,8 @@ TooltipDirective.ctorParameters = () => [
651
723
  { type: ApplicationRef },
652
724
  { type: ComponentFactoryResolver },
653
725
  { type: Injector },
654
- { type: DebounceUtils }
726
+ { type: DebounceUtils },
727
+ { type: Renderer2 }
655
728
  ];
656
729
  __decorate([
657
730
  Input("sTooltip")
@@ -677,6 +750,9 @@ __decorate([
677
750
  __decorate([
678
751
  Input()
679
752
  ], TooltipDirective.prototype, "mobileBehavior", void 0);
753
+ __decorate([
754
+ Input()
755
+ ], TooltipDirective.prototype, "focusedInputRef", void 0);
680
756
  __decorate([
681
757
  HostListener("click"),
682
758
  HostListener("keydown")
@@ -6174,7 +6250,7 @@ let InfoSignComponent = class InfoSignComponent {
6174
6250
  InfoSignComponent = __decorate([
6175
6251
  Component({
6176
6252
  selector: "s-info-sign-component",
6177
- 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>",
6253
+ 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",
6178
6254
  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}"]
6179
6255
  })
6180
6256
  ], InfoSignComponent);
@@ -6194,6 +6270,7 @@ let InfoSignDirective = class InfoSignDirective {
6194
6270
  this.componentRef.instance.templateRef = this.templateRef;
6195
6271
  this.componentRef.instance.tooltip = this.sInfoSign;
6196
6272
  this.componentRef.instance.displayTime = this.displayTime;
6273
+ this.componentRef.instance.focusedInputRef = this.focusedInputRef;
6197
6274
  }
6198
6275
  else if (this.componentRef && this.sInfoSign) {
6199
6276
  this.componentRef.instance.tooltip = this.sInfoSign;
@@ -6220,6 +6297,9 @@ __decorate([
6220
6297
  __decorate([
6221
6298
  Input('sInfoSignDisplayTime')
6222
6299
  ], InfoSignDirective.prototype, "displayTime", void 0);
6300
+ __decorate([
6301
+ Input('sInfoSignFocusedInputRef')
6302
+ ], InfoSignDirective.prototype, "focusedInputRef", void 0);
6223
6303
  InfoSignDirective = __decorate([
6224
6304
  Directive({
6225
6305
  selector: "[sInfoSign]",
@@ -6691,14 +6771,17 @@ let NumericService = class NumericService {
6691
6771
  * Documentation is available at {@link https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat Intl.NumberFormatOptions}.
6692
6772
  *
6693
6773
  * @param {number | string | BigNumber} value The value to be formatted.
6694
- * @param {Intl.NumberFormatOptions} options Options that overwrites the default Intl.NumberFormatOptions.
6774
+ * @param options Locale and numberFormatOptions that overwrites the default Intl.NumberFormatOptions.
6695
6775
  * @return `string` The formatted value.
6696
6776
  */
6697
6777
  instant(value, options) {
6698
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
6699
- 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", options: Object.assign(Object.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 }) });
6778
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
6779
+ 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"
6780
+ ? ((_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")
6781
+ : 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 }) });
6782
+ options.numberFormatOptions["trailingZeroDisplay"] = "stripIfInteger";
6700
6783
  // From https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
6701
- return new Intl.NumberFormat(options.locale, options.options).format(this.getType(value) === "number" || this.getType(value) === "string" ? value : value.toString());
6784
+ return new Intl.NumberFormat(options.locale, options.numberFormatOptions).format(this.getType(value) === "number" || this.getType(value) === "string" ? value : value.toString());
6702
6785
  }
6703
6786
  getType(value) {
6704
6787
  // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof
@@ -6750,7 +6833,7 @@ let NumericPipe = class NumericPipe {
6750
6833
  return (options === null || options === void 0 ? void 0 : options.locale) ? of(this.numericService.instant(value, options))
6751
6834
  : this.localeService.getLocale().pipe(map((locale) => this.numericService.instant(value, {
6752
6835
  locale,
6753
- options: options === null || options === void 0 ? void 0 : options.options,
6836
+ numberFormatOptions: options === null || options === void 0 ? void 0 : options.numberFormatOptions,
6754
6837
  })));
6755
6838
  }
6756
6839
  };
@@ -7640,14 +7723,15 @@ var EnumBadgeColors;
7640
7723
 
7641
7724
  const moment$4 = moment_;
7642
7725
  let TableColumnsComponent = class TableColumnsComponent {
7643
- constructor(localeService, viewContainerRef, translate, hostProjectConfigs) {
7726
+ constructor(localeService, viewContainerRef, translate, numericService, hostProjectConfigs) {
7644
7727
  this.localeService = localeService;
7645
7728
  this.viewContainerRef = viewContainerRef;
7646
7729
  this.translate = translate;
7730
+ this.numericService = numericService;
7647
7731
  this.hostProjectConfigs = hostProjectConfigs;
7648
7732
  this.locale = {
7649
7733
  calendar: Object.assign(Object.assign({}, this.localeService.getLocaleOptions().calendar), { dateFormat: convertToMomentDateFormat(this.localeService.getLocaleOptions().calendar.dateFormat) }),
7650
- number: Object.assign(Object.assign({}, this.localeService.getLocaleOptions().number), { scale: 0 })
7734
+ number: Object.assign(Object.assign({}, this.localeService.getLocaleOptions().number), { scale: 0 }),
7651
7735
  };
7652
7736
  this.formattedColumns = [];
7653
7737
  }
@@ -7670,7 +7754,7 @@ let TableColumnsComponent = class TableColumnsComponent {
7670
7754
  return {
7671
7755
  value: string,
7672
7756
  isUninformed: string === uninformed,
7673
- separator: !isLastIndex ? separator : ""
7757
+ separator: !isLastIndex ? separator : "",
7674
7758
  };
7675
7759
  });
7676
7760
  }
@@ -7702,29 +7786,25 @@ let TableColumnsComponent = class TableColumnsComponent {
7702
7786
  return column.prefix ? column.prefix : `${this.hostProjectConfigs.domain}.${this.hostProjectConfigs.service}.`;
7703
7787
  }
7704
7788
  isAttributeValueInvalid(attributeValue) {
7705
- return attributeValue === null ||
7789
+ return (attributeValue === null ||
7706
7790
  attributeValue === undefined ||
7707
7791
  (this.isArray(attributeValue) && !attributeValue.length) ||
7708
- (typeof attributeValue === 'string' && attributeValue.trim() === '');
7792
+ (typeof attributeValue === "string" && attributeValue.trim() === ""));
7709
7793
  }
7710
7794
  getFormattedColumnValue(column, columnValue, unifiedColumnValues, uninformedText, uninformedNumber) {
7711
7795
  if (uninformedNumber === column.attributes.length) {
7712
7796
  return uninformedText;
7713
7797
  }
7714
7798
  if (column.type === EnumColumnFieldType.TOKENS) {
7715
- return [].concat.apply([], columnValue.filter(values => values !== uninformedText));
7799
+ return [].concat.apply([], columnValue.filter((values) => values !== uninformedText));
7716
7800
  }
7717
7801
  return unifiedColumnValues;
7718
7802
  }
7719
7803
  getAttributeValue(attribute, rowValue) {
7720
7804
  let attributeValue;
7721
- attribute
7722
- .split("/")
7723
- .forEach((value) => {
7805
+ attribute.split("/").forEach((value) => {
7724
7806
  if (!attributeValue) {
7725
- value
7726
- .split(".")
7727
- .forEach((val, i) => {
7807
+ value.split(".").forEach((val, i) => {
7728
7808
  if (!rowValue) {
7729
7809
  return;
7730
7810
  }
@@ -7742,9 +7822,7 @@ let TableColumnsComponent = class TableColumnsComponent {
7742
7822
  return attributeValue;
7743
7823
  }
7744
7824
  getNumberConfigs(column) {
7745
- return Object.assign(Object.assign({}, this.locale.number), { scale: column.scale !== null && column.scale !== undefined
7746
- ? this.getColumnScale(column.scale)
7747
- : this.locale.number.scale, prefix: `${this.locale.number.currencySymbol} ` });
7825
+ return Object.assign(Object.assign({}, this.locale.number), { scale: column.scale !== null && column.scale !== undefined ? this.getColumnScale(column.scale) : this.locale.number.scale, prefix: `${this.locale.number.currencySymbol} ` });
7748
7826
  }
7749
7827
  getDateFormat(column, locale) {
7750
7828
  return column.dateFormat ? column.dateFormat : locale.calendar.dateFormat;
@@ -7755,8 +7833,8 @@ let TableColumnsComponent = class TableColumnsComponent {
7755
7833
  const separator = this.getColumnSeparator(column);
7756
7834
  const uninformed = this.translate.instant(prefix + "empty_label");
7757
7835
  const style = column.style;
7758
- const columnValue = column.attributes
7759
- .map((attribute) => {
7836
+ const columnValue = column.attributes.map((attribute) => {
7837
+ var _a, _b;
7760
7838
  const attributeValue = this.getAttributeValue(attribute, rowValue);
7761
7839
  if (this.isAttributeValueInvalid(attributeValue)) {
7762
7840
  return uninformed;
@@ -7766,7 +7844,10 @@ let TableColumnsComponent = class TableColumnsComponent {
7766
7844
  case EnumColumnFieldType.ENUM:
7767
7845
  return this.translate.instant(column.enumPrefix + attributeValue.toString().toLowerCase());
7768
7846
  case EnumColumnFieldType.CURRENCY:
7769
- return applyMask(attributeValue, numberConfigs, this.isNumber(attributeValue));
7847
+ return ((_a = attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.options) === null || _a === void 0 ? void 0 : _a.numberFormatOptions) ? this.numericService.instant(attributeValue.value, {
7848
+ numberFormatOptions: attributeValue.options.numberFormatOptions,
7849
+ })
7850
+ : applyMask(attributeValue, numberConfigs, this.isNumber(attributeValue));
7770
7851
  case EnumColumnFieldType.DATE:
7771
7852
  const dateFormat = this.getDateFormat(column, locale);
7772
7853
  return moment$4(attributeValue).format(dateFormat);
@@ -7775,7 +7856,14 @@ let TableColumnsComponent = class TableColumnsComponent {
7775
7856
  return this.translate.instant(prefix + value);
7776
7857
  case EnumColumnFieldType.NUMBER:
7777
7858
  numberConfigs.prefix = "";
7778
- return applyMask(attributeValue, numberConfigs, this.isNumber(attributeValue));
7859
+ return ((_b = attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.options) === null || _b === void 0 ? void 0 : _b.numberFormatOptions) ? this.numericService.instant(attributeValue.value, {
7860
+ numberFormatOptions: attributeValue.options.numberFormatOptions,
7861
+ })
7862
+ : column.numberFormatOptions
7863
+ ? this.numericService.instant(attributeValue, {
7864
+ numberFormatOptions: column.numberFormatOptions,
7865
+ })
7866
+ : applyMask(attributeValue, numberConfigs, this.isNumber(attributeValue));
7779
7867
  case EnumColumnFieldType.TOKENS:
7780
7868
  return this.getTokens(attributeValue);
7781
7869
  default:
@@ -7783,9 +7871,7 @@ let TableColumnsComponent = class TableColumnsComponent {
7783
7871
  }
7784
7872
  });
7785
7873
  const unifiedColumnValues = columnValue.join(separator);
7786
- const uninformedNumber = unifiedColumnValues
7787
- .split(separator)
7788
- .filter(value => value === uninformed).length;
7874
+ const uninformedNumber = unifiedColumnValues.split(separator).filter((value) => value === uninformed).length;
7789
7875
  const formattedColumnValue = this.getFormattedColumnValue(column, columnValue, unifiedColumnValues, uninformed, uninformedNumber);
7790
7876
  return {
7791
7877
  style,
@@ -7797,7 +7883,7 @@ let TableColumnsComponent = class TableColumnsComponent {
7797
7883
  tooltip: this.getColumnTooltip(column.tooltip),
7798
7884
  infoSign: this.getColumnInfoSign(column.infoSign),
7799
7885
  onLinkClick: column.onLinkClick,
7800
- onColumnClick: column.onColumnClick
7886
+ onColumnClick: column.onColumnClick,
7801
7887
  };
7802
7888
  }
7803
7889
  getColumnScale(scale) {
@@ -7825,7 +7911,7 @@ let TableColumnsComponent = class TableColumnsComponent {
7825
7911
  return "";
7826
7912
  }
7827
7913
  isNumber(value) {
7828
- return !(new BigNumber(value).isNaN());
7914
+ return !new BigNumber(value).isNaN();
7829
7915
  }
7830
7916
  getTokens(values) {
7831
7917
  if (!this.isArray(values)) {
@@ -7842,7 +7928,7 @@ let TableColumnsComponent = class TableColumnsComponent {
7842
7928
  .map((value) => {
7843
7929
  const label = typeof value === "symbol" ? value.toString() : `${value}`;
7844
7930
  return {
7845
- label
7931
+ label,
7846
7932
  };
7847
7933
  });
7848
7934
  }
@@ -7850,10 +7936,10 @@ let TableColumnsComponent = class TableColumnsComponent {
7850
7936
  return this.isPrimitiveValuesArray(values) || this.isLabelObjectArray(values);
7851
7937
  }
7852
7938
  isPrimitiveValuesArray(values) {
7853
- return values.filter(value => value !== Object(value)).length === values.length;
7939
+ return values.filter((value) => value !== Object(value)).length === values.length;
7854
7940
  }
7855
7941
  isLabelObjectArray(values) {
7856
- return values.filter(value => (value === null || value === void 0 ? void 0 : value.label) !== null && (value === null || value === void 0 ? void 0 : value.label) !== undefined).length === values.length;
7942
+ return values.filter((value) => (value === null || value === void 0 ? void 0 : value.label) !== null && (value === null || value === void 0 ? void 0 : value.label) !== undefined).length === values.length;
7857
7943
  }
7858
7944
  sortColumnsBySequence(columns) {
7859
7945
  return columns.sort((a, b) => a.sequence - b.sequence);
@@ -7863,6 +7949,7 @@ TableColumnsComponent.ctorParameters = () => [
7863
7949
  { type: LocaleService },
7864
7950
  { type: ViewContainerRef },
7865
7951
  { type: TranslateService },
7952
+ { type: NumericService },
7866
7953
  { type: undefined, decorators: [{ type: Inject, args: [HostProjectConfigsInjectionToken,] }] }
7867
7954
  ];
7868
7955
  __decorate([
@@ -7883,7 +7970,7 @@ TableColumnsComponent = __decorate([
7883
7970
  selector: "s-table-columns",
7884
7971
  styles: [":host{display:none}"]
7885
7972
  }),
7886
- __param(3, Inject(HostProjectConfigsInjectionToken))
7973
+ __param(4, Inject(HostProjectConfigsInjectionToken))
7887
7974
  ], TableColumnsComponent);
7888
7975
 
7889
7976
  var TokenListComponent_1;
@@ -16728,6 +16815,29 @@ WorkspaceSwitchModule = __decorate([
16728
16815
  })
16729
16816
  ], WorkspaceSwitchModule);
16730
16817
 
16818
+ let CurrencyService = class CurrencyService {
16819
+ constructor(localeService) {
16820
+ this.localeService = localeService;
16821
+ }
16822
+ getCurrencySymbol({ currency }) {
16823
+ var _a, _b;
16824
+ const numberFormat = new Intl.NumberFormat(this.localeService.getLocaleOptions().locale, {
16825
+ style: "currency",
16826
+ currency: currency !== null && currency !== void 0 ? currency : "BRL",
16827
+ currencyDisplay: 'narrowSymbol',
16828
+ maximumFractionDigits: 5,
16829
+ });
16830
+ return (_b = (_a = numberFormat.formatToParts(1).find((x) => x.type === "currency")) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "";
16831
+ }
16832
+ };
16833
+ CurrencyService.ctorParameters = () => [
16834
+ { type: LocaleService }
16835
+ ];
16836
+ CurrencyService.ɵprov = ɵɵdefineInjectable({ factory: function CurrencyService_Factory() { return new CurrencyService(ɵɵinject(LocaleService)); }, token: CurrencyService, providedIn: "root" });
16837
+ CurrencyService = __decorate([
16838
+ Injectable({ providedIn: "root" })
16839
+ ], CurrencyService);
16840
+
16731
16841
  const fallback = {
16732
16842
  "platform.angular_components.drag_your_photo_or": "Arraste sua foto ou",
16733
16843
  "platform.angular_components.select_a_file": "selecione um arquivo",
@@ -17047,5 +17157,5 @@ const fallback = {
17047
17157
  * Generated bundle index. Do not edit.
17048
17158
  */
17049
17159
 
17050
- 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 };
17160
+ 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 };
17051
17161
  //# sourceMappingURL=seniorsistemas-angular-components.js.map