@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.
- package/bundles/seniorsistemas-angular-components.umd.js +151 -37
- 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/info-sign/info-sign.component.d.ts +1 -0
- package/components/info-sign/info-sign.directive.d.ts +1 -0
- package/components/locale/pipes/numeric.pipe.d.ts +1 -1
- package/components/locale/services/numeric.service.d.ts +2 -2
- package/components/table/table-column/models/column.interface.d.ts +1 -0
- package/components/table/table-column/table-columns.component.d.ts +3 -1
- package/components/tooltip/tooltip.directive.d.ts +32 -2
- package/esm2015/components/info-sign/info-sign.component.js +2 -2
- package/esm2015/components/info-sign/info-sign.directive.js +5 -1
- package/esm2015/components/locale/pipes/numeric.pipe.js +2 -2
- package/esm2015/components/locale/services/numeric.service.js +8 -5
- package/esm2015/components/table/table-column/models/column.interface.js +1 -1
- package/esm2015/components/table/table-column/table-columns.component.js +34 -29
- package/esm2015/components/tooltip/tooltip.directive.js +84 -8
- package/esm2015/utils/currency/currency.service.js +29 -0
- package/esm2015/utils/currency/index.js +2 -0
- package/esm2015/utils/index.js +2 -1
- package/esm5/components/info-sign/info-sign.component.js +2 -2
- package/esm5/components/info-sign/info-sign.directive.js +5 -1
- package/esm5/components/locale/pipes/numeric.pipe.js +2 -2
- package/esm5/components/locale/services/numeric.service.js +8 -5
- package/esm5/components/table/table-column/models/column.interface.js +1 -1
- package/esm5/components/table/table-column/table-columns.component.js +31 -26
- package/esm5/components/tooltip/tooltip.directive.js +85 -8
- package/esm5/utils/currency/currency.service.js +31 -0
- package/esm5/utils/currency/index.js +2 -0
- package/esm5/utils/index.js +2 -1
- package/fesm2015/seniorsistemas-angular-components.js +152 -42
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +152 -39
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
- package/utils/currency/currency.service.d.ts +8 -0
- package/utils/currency/index.d.ts +1 -0
- package/utils/index.d.ts +1 -0
|
@@ -591,13 +591,14 @@
|
|
|
591
591
|
})(TooltipEvent || (TooltipEvent = {}));
|
|
592
592
|
|
|
593
593
|
var TooltipDirective = /** @class */ (function () {
|
|
594
|
-
function TooltipDirective(elementRef, appRef, componentFactoryResolver, injector, debounceUtils) {
|
|
594
|
+
function TooltipDirective(elementRef, appRef, componentFactoryResolver, injector, debounceUtils, renderer) {
|
|
595
595
|
var _this = this;
|
|
596
596
|
this.elementRef = elementRef;
|
|
597
597
|
this.appRef = appRef;
|
|
598
598
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
599
599
|
this.injector = injector;
|
|
600
600
|
this.debounceUtils = debounceUtils;
|
|
601
|
+
this.renderer = renderer;
|
|
601
602
|
this.position = exports.TooltipPosition.Top;
|
|
602
603
|
this.showDelay = 500;
|
|
603
604
|
this.tooltipEvent = TooltipEvent.Hover;
|
|
@@ -610,6 +611,7 @@
|
|
|
610
611
|
}
|
|
611
612
|
TooltipDirective.prototype.ngOnInit = function () {
|
|
612
613
|
this.validatePosition();
|
|
614
|
+
this.updateTooltipVisibilityWhenFocusOnInput();
|
|
613
615
|
};
|
|
614
616
|
TooltipDirective.prototype.ngOnDestroy = function () {
|
|
615
617
|
this.destroy();
|
|
@@ -633,6 +635,59 @@
|
|
|
633
635
|
TooltipDirective.prototype.isMousePositionOutsideOfElement = function (mouseX, mouseY, elementArea) {
|
|
634
636
|
return mouseX < elementArea.left || mouseX >= elementArea.right || mouseY < elementArea.top || mouseY >= elementArea.bottom;
|
|
635
637
|
};
|
|
638
|
+
/**
|
|
639
|
+
* Manipula a visibilidade do tooltip quando houver uma referência de input.
|
|
640
|
+
*/
|
|
641
|
+
TooltipDirective.prototype.updateTooltipVisibilityWhenFocusOnInput = function () {
|
|
642
|
+
var _this = this;
|
|
643
|
+
if (this.focusedInputRef) {
|
|
644
|
+
var inputFocus = this.focusedInputRef;
|
|
645
|
+
var icon_1 = this.getIconFromFocusedInput(inputFocus);
|
|
646
|
+
this.renderer.listen(inputFocus, 'focus', function () {
|
|
647
|
+
if (icon_1 && _this.isMatchingTooltip(icon_1)) {
|
|
648
|
+
_this.createTootipByFocus(icon_1);
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
this.renderer.listen(inputFocus, 'blur', function () {
|
|
652
|
+
if (icon_1 && _this.isMatchingTooltip(icon_1)) {
|
|
653
|
+
_this.removeTooltip(icon_1);
|
|
654
|
+
_this.destroy();
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
};
|
|
659
|
+
/**
|
|
660
|
+
* Obtém o elemento do ícone associado ao label do input em focus.
|
|
661
|
+
* @param focusedInput O input em focus.
|
|
662
|
+
* @returns O ícone do input em focus ou null.
|
|
663
|
+
*/
|
|
664
|
+
TooltipDirective.prototype.getIconFromFocusedInput = function (focusedInput) {
|
|
665
|
+
var label = document.querySelector("label[for='" + focusedInput.id + "']");
|
|
666
|
+
if (label) {
|
|
667
|
+
var icon = label.nextElementSibling;
|
|
668
|
+
return (icon === null || icon === void 0 ? void 0 : icon.classList.contains('info-sign__icon')) ? icon : null;
|
|
669
|
+
}
|
|
670
|
+
return null;
|
|
671
|
+
};
|
|
672
|
+
/**
|
|
673
|
+
* Verifica se o ícone tem o tooltip correspondente ao atual.
|
|
674
|
+
* @param icon O ícone do input em focus.
|
|
675
|
+
* @returns true se o tooltip corresponde; caso contrário, false.
|
|
676
|
+
*/
|
|
677
|
+
TooltipDirective.prototype.isMatchingTooltip = function (icon) {
|
|
678
|
+
var tooltipText = icon.getAttribute('ng-reflect-tooltip');
|
|
679
|
+
return this.tooltip === tooltipText;
|
|
680
|
+
};
|
|
681
|
+
/**
|
|
682
|
+
* Remove o tooltip associado ao ícone do input em focus.
|
|
683
|
+
* @param icon O ícone do input em focus.
|
|
684
|
+
*/
|
|
685
|
+
TooltipDirective.prototype.removeTooltip = function (icon) {
|
|
686
|
+
var tooltip = icon.querySelector('.tooltip');
|
|
687
|
+
if (tooltip) {
|
|
688
|
+
tooltip.remove();
|
|
689
|
+
}
|
|
690
|
+
};
|
|
636
691
|
// whenever the component with the tooltip is clicked I destroy the tooltip.
|
|
637
692
|
// whenever a key is pressed on the component with the tooltip I destroy the tooltip.
|
|
638
693
|
TooltipDirective.prototype.onClick = function () {
|
|
@@ -697,10 +752,7 @@
|
|
|
697
752
|
TooltipDirective.prototype.createTootip = function () {
|
|
698
753
|
var _a;
|
|
699
754
|
if (this.componentRef === null && ((_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
700
|
-
var
|
|
701
|
-
this.componentRef = componentFactory.create(this.injector);
|
|
702
|
-
this.appRef.attachView(this.componentRef.hostView);
|
|
703
|
-
var domElem = this.componentRef.hostView.rootNodes[0];
|
|
755
|
+
var domElem = this.getDomElement();
|
|
704
756
|
document.body.appendChild(domElem);
|
|
705
757
|
this.setTooltipComponentProperties();
|
|
706
758
|
this.showTimeout = window.setTimeout(this.showTooltip.bind(this), this.showDelay);
|
|
@@ -710,6 +762,27 @@
|
|
|
710
762
|
}
|
|
711
763
|
}
|
|
712
764
|
};
|
|
765
|
+
TooltipDirective.prototype.getDomElement = function () {
|
|
766
|
+
var componentFactory = this.componentFactoryResolver.resolveComponentFactory(TooltipComponent);
|
|
767
|
+
this.componentRef = componentFactory.create(this.injector);
|
|
768
|
+
this.appRef.attachView(this.componentRef.hostView);
|
|
769
|
+
return this.componentRef.hostView.rootNodes[0];
|
|
770
|
+
};
|
|
771
|
+
/**
|
|
772
|
+
* Cria um tooltip para o icone do input em focus.
|
|
773
|
+
*
|
|
774
|
+
* @param icon O ícone do input em focus.
|
|
775
|
+
*/
|
|
776
|
+
TooltipDirective.prototype.createTootipByFocus = function (icon) {
|
|
777
|
+
var _a;
|
|
778
|
+
if (this.componentRef === null && ((_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
779
|
+
var domElem = this.getDomElement();
|
|
780
|
+
var tooltip_1 = domElem.querySelector('.tooltip');
|
|
781
|
+
icon.appendChild(tooltip_1);
|
|
782
|
+
this.setTooltipComponentProperties();
|
|
783
|
+
setTimeout(function () { return tooltip_1.classList.add("tooltip--visible"); }, 0);
|
|
784
|
+
}
|
|
785
|
+
};
|
|
713
786
|
TooltipDirective.prototype.showTooltip = function () {
|
|
714
787
|
if (this.componentRef !== null) {
|
|
715
788
|
this.componentRef.instance.visible = this.visible;
|
|
@@ -827,7 +900,8 @@
|
|
|
827
900
|
{ type: core.ApplicationRef },
|
|
828
901
|
{ type: core.ComponentFactoryResolver },
|
|
829
902
|
{ type: core.Injector },
|
|
830
|
-
{ type: DebounceUtils }
|
|
903
|
+
{ type: DebounceUtils },
|
|
904
|
+
{ type: core.Renderer2 }
|
|
831
905
|
]; };
|
|
832
906
|
__decorate([
|
|
833
907
|
core.Input("sTooltip")
|
|
@@ -853,6 +927,9 @@
|
|
|
853
927
|
__decorate([
|
|
854
928
|
core.Input()
|
|
855
929
|
], TooltipDirective.prototype, "mobileBehavior", void 0);
|
|
930
|
+
__decorate([
|
|
931
|
+
core.Input()
|
|
932
|
+
], TooltipDirective.prototype, "focusedInputRef", void 0);
|
|
856
933
|
__decorate([
|
|
857
934
|
core.HostListener("click"),
|
|
858
935
|
core.HostListener("keydown")
|
|
@@ -6718,7 +6795,7 @@
|
|
|
6718
6795
|
InfoSignComponent = __decorate([
|
|
6719
6796
|
core.Component({
|
|
6720
6797
|
selector: "s-info-sign-component",
|
|
6721
|
-
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
|
|
6798
|
+
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",
|
|
6722
6799
|
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}"]
|
|
6723
6800
|
})
|
|
6724
6801
|
], InfoSignComponent);
|
|
@@ -6740,6 +6817,7 @@
|
|
|
6740
6817
|
this.componentRef.instance.templateRef = this.templateRef;
|
|
6741
6818
|
this.componentRef.instance.tooltip = this.sInfoSign;
|
|
6742
6819
|
this.componentRef.instance.displayTime = this.displayTime;
|
|
6820
|
+
this.componentRef.instance.focusedInputRef = this.focusedInputRef;
|
|
6743
6821
|
}
|
|
6744
6822
|
else if (this.componentRef && this.sInfoSign) {
|
|
6745
6823
|
this.componentRef.instance.tooltip = this.sInfoSign;
|
|
@@ -6765,6 +6843,9 @@
|
|
|
6765
6843
|
__decorate([
|
|
6766
6844
|
core.Input('sInfoSignDisplayTime')
|
|
6767
6845
|
], InfoSignDirective.prototype, "displayTime", void 0);
|
|
6846
|
+
__decorate([
|
|
6847
|
+
core.Input('sInfoSignFocusedInputRef')
|
|
6848
|
+
], InfoSignDirective.prototype, "focusedInputRef", void 0);
|
|
6768
6849
|
InfoSignDirective = __decorate([
|
|
6769
6850
|
core.Directive({
|
|
6770
6851
|
selector: "[sInfoSign]",
|
|
@@ -7309,14 +7390,17 @@
|
|
|
7309
7390
|
* Documentation is available at {@link https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat Intl.NumberFormatOptions}.
|
|
7310
7391
|
*
|
|
7311
7392
|
* @param {number | string | BigNumber} value The value to be formatted.
|
|
7312
|
-
* @param
|
|
7393
|
+
* @param options Locale and numberFormatOptions that overwrites the default Intl.NumberFormatOptions.
|
|
7313
7394
|
* @return `string` The formatted value.
|
|
7314
7395
|
*/
|
|
7315
7396
|
NumericService.prototype.instant = function (value, options) {
|
|
7316
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
7317
|
-
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",
|
|
7397
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
7398
|
+
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"
|
|
7399
|
+
? ((_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")
|
|
7400
|
+
: 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 }) });
|
|
7401
|
+
options.numberFormatOptions["trailingZeroDisplay"] = "stripIfInteger";
|
|
7318
7402
|
// From https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
|
|
7319
|
-
return new Intl.NumberFormat(options.locale, options.
|
|
7403
|
+
return new Intl.NumberFormat(options.locale, options.numberFormatOptions).format(this.getType(value) === "number" || this.getType(value) === "string" ? value : value.toString());
|
|
7320
7404
|
};
|
|
7321
7405
|
NumericService.prototype.getType = function (value) {
|
|
7322
7406
|
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof
|
|
@@ -7371,7 +7455,7 @@
|
|
|
7371
7455
|
: this.localeService.getLocale().pipe(operators.map(function (locale) {
|
|
7372
7456
|
return _this.numericService.instant(value, {
|
|
7373
7457
|
locale: locale,
|
|
7374
|
-
|
|
7458
|
+
numberFormatOptions: options === null || options === void 0 ? void 0 : options.numberFormatOptions,
|
|
7375
7459
|
});
|
|
7376
7460
|
}));
|
|
7377
7461
|
};
|
|
@@ -8341,14 +8425,15 @@
|
|
|
8341
8425
|
|
|
8342
8426
|
var moment$4 = moment_;
|
|
8343
8427
|
var TableColumnsComponent = /** @class */ (function () {
|
|
8344
|
-
function TableColumnsComponent(localeService, viewContainerRef, translate, hostProjectConfigs) {
|
|
8428
|
+
function TableColumnsComponent(localeService, viewContainerRef, translate, numericService, hostProjectConfigs) {
|
|
8345
8429
|
this.localeService = localeService;
|
|
8346
8430
|
this.viewContainerRef = viewContainerRef;
|
|
8347
8431
|
this.translate = translate;
|
|
8432
|
+
this.numericService = numericService;
|
|
8348
8433
|
this.hostProjectConfigs = hostProjectConfigs;
|
|
8349
8434
|
this.locale = {
|
|
8350
8435
|
calendar: __assign(__assign({}, this.localeService.getLocaleOptions().calendar), { dateFormat: convertToMomentDateFormat(this.localeService.getLocaleOptions().calendar.dateFormat) }),
|
|
8351
|
-
number: __assign(__assign({}, this.localeService.getLocaleOptions().number), { scale: 0 })
|
|
8436
|
+
number: __assign(__assign({}, this.localeService.getLocaleOptions().number), { scale: 0 }),
|
|
8352
8437
|
};
|
|
8353
8438
|
this.formattedColumns = [];
|
|
8354
8439
|
}
|
|
@@ -8371,7 +8456,7 @@
|
|
|
8371
8456
|
return {
|
|
8372
8457
|
value: string,
|
|
8373
8458
|
isUninformed: string === uninformed,
|
|
8374
|
-
separator: !isLastIndex ? separator : ""
|
|
8459
|
+
separator: !isLastIndex ? separator : "",
|
|
8375
8460
|
};
|
|
8376
8461
|
});
|
|
8377
8462
|
}
|
|
@@ -8404,10 +8489,10 @@
|
|
|
8404
8489
|
return column.prefix ? column.prefix : this.hostProjectConfigs.domain + "." + this.hostProjectConfigs.service + ".";
|
|
8405
8490
|
};
|
|
8406
8491
|
TableColumnsComponent.prototype.isAttributeValueInvalid = function (attributeValue) {
|
|
8407
|
-
return attributeValue === null ||
|
|
8492
|
+
return (attributeValue === null ||
|
|
8408
8493
|
attributeValue === undefined ||
|
|
8409
8494
|
(this.isArray(attributeValue) && !attributeValue.length) ||
|
|
8410
|
-
(typeof attributeValue ===
|
|
8495
|
+
(typeof attributeValue === "string" && attributeValue.trim() === ""));
|
|
8411
8496
|
};
|
|
8412
8497
|
TableColumnsComponent.prototype.getFormattedColumnValue = function (column, columnValue, unifiedColumnValues, uninformedText, uninformedNumber) {
|
|
8413
8498
|
if (uninformedNumber === column.attributes.length) {
|
|
@@ -8420,13 +8505,9 @@
|
|
|
8420
8505
|
};
|
|
8421
8506
|
TableColumnsComponent.prototype.getAttributeValue = function (attribute, rowValue) {
|
|
8422
8507
|
var attributeValue;
|
|
8423
|
-
attribute
|
|
8424
|
-
.split("/")
|
|
8425
|
-
.forEach(function (value) {
|
|
8508
|
+
attribute.split("/").forEach(function (value) {
|
|
8426
8509
|
if (!attributeValue) {
|
|
8427
|
-
value
|
|
8428
|
-
.split(".")
|
|
8429
|
-
.forEach(function (val, i) {
|
|
8510
|
+
value.split(".").forEach(function (val, i) {
|
|
8430
8511
|
if (!rowValue) {
|
|
8431
8512
|
return;
|
|
8432
8513
|
}
|
|
@@ -8444,9 +8525,7 @@
|
|
|
8444
8525
|
return attributeValue;
|
|
8445
8526
|
};
|
|
8446
8527
|
TableColumnsComponent.prototype.getNumberConfigs = function (column) {
|
|
8447
|
-
return __assign(__assign({}, this.locale.number), { scale: column.scale !== null && column.scale !== undefined
|
|
8448
|
-
? this.getColumnScale(column.scale)
|
|
8449
|
-
: this.locale.number.scale, prefix: this.locale.number.currencySymbol + " " });
|
|
8528
|
+
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 + " " });
|
|
8450
8529
|
};
|
|
8451
8530
|
TableColumnsComponent.prototype.getDateFormat = function (column, locale) {
|
|
8452
8531
|
return column.dateFormat ? column.dateFormat : locale.calendar.dateFormat;
|
|
@@ -8458,8 +8537,8 @@
|
|
|
8458
8537
|
var separator = this.getColumnSeparator(column);
|
|
8459
8538
|
var uninformed = this.translate.instant(prefix + "empty_label");
|
|
8460
8539
|
var style = column.style;
|
|
8461
|
-
var columnValue = column.attributes
|
|
8462
|
-
|
|
8540
|
+
var columnValue = column.attributes.map(function (attribute) {
|
|
8541
|
+
var _a, _b;
|
|
8463
8542
|
var attributeValue = _this.getAttributeValue(attribute, rowValue);
|
|
8464
8543
|
if (_this.isAttributeValueInvalid(attributeValue)) {
|
|
8465
8544
|
return uninformed;
|
|
@@ -8469,7 +8548,10 @@
|
|
|
8469
8548
|
case exports.EnumColumnFieldType.ENUM:
|
|
8470
8549
|
return _this.translate.instant(column.enumPrefix + attributeValue.toString().toLowerCase());
|
|
8471
8550
|
case exports.EnumColumnFieldType.CURRENCY:
|
|
8472
|
-
return
|
|
8551
|
+
return ((_a = attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.options) === null || _a === void 0 ? void 0 : _a.numberFormatOptions) ? _this.numericService.instant(attributeValue.value, {
|
|
8552
|
+
numberFormatOptions: attributeValue.options.numberFormatOptions,
|
|
8553
|
+
})
|
|
8554
|
+
: ng2CurrencyMask.applyMask(attributeValue, numberConfigs, _this.isNumber(attributeValue));
|
|
8473
8555
|
case exports.EnumColumnFieldType.DATE:
|
|
8474
8556
|
var dateFormat = _this.getDateFormat(column, locale);
|
|
8475
8557
|
return moment$4(attributeValue).format(dateFormat);
|
|
@@ -8478,7 +8560,14 @@
|
|
|
8478
8560
|
return _this.translate.instant(prefix + value);
|
|
8479
8561
|
case exports.EnumColumnFieldType.NUMBER:
|
|
8480
8562
|
numberConfigs.prefix = "";
|
|
8481
|
-
return
|
|
8563
|
+
return ((_b = attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.options) === null || _b === void 0 ? void 0 : _b.numberFormatOptions) ? _this.numericService.instant(attributeValue.value, {
|
|
8564
|
+
numberFormatOptions: attributeValue.options.numberFormatOptions,
|
|
8565
|
+
})
|
|
8566
|
+
: column.numberFormatOptions
|
|
8567
|
+
? _this.numericService.instant(attributeValue, {
|
|
8568
|
+
numberFormatOptions: column.numberFormatOptions,
|
|
8569
|
+
})
|
|
8570
|
+
: ng2CurrencyMask.applyMask(attributeValue, numberConfigs, _this.isNumber(attributeValue));
|
|
8482
8571
|
case exports.EnumColumnFieldType.TOKENS:
|
|
8483
8572
|
return _this.getTokens(attributeValue);
|
|
8484
8573
|
default:
|
|
@@ -8486,9 +8575,7 @@
|
|
|
8486
8575
|
}
|
|
8487
8576
|
});
|
|
8488
8577
|
var unifiedColumnValues = columnValue.join(separator);
|
|
8489
|
-
var uninformedNumber = unifiedColumnValues
|
|
8490
|
-
.split(separator)
|
|
8491
|
-
.filter(function (value) { return value === uninformed; }).length;
|
|
8578
|
+
var uninformedNumber = unifiedColumnValues.split(separator).filter(function (value) { return value === uninformed; }).length;
|
|
8492
8579
|
var formattedColumnValue = this.getFormattedColumnValue(column, columnValue, unifiedColumnValues, uninformed, uninformedNumber);
|
|
8493
8580
|
return {
|
|
8494
8581
|
style: style,
|
|
@@ -8500,7 +8587,7 @@
|
|
|
8500
8587
|
tooltip: this.getColumnTooltip(column.tooltip),
|
|
8501
8588
|
infoSign: this.getColumnInfoSign(column.infoSign),
|
|
8502
8589
|
onLinkClick: column.onLinkClick,
|
|
8503
|
-
onColumnClick: column.onColumnClick
|
|
8590
|
+
onColumnClick: column.onColumnClick,
|
|
8504
8591
|
};
|
|
8505
8592
|
};
|
|
8506
8593
|
TableColumnsComponent.prototype.getColumnScale = function (scale) {
|
|
@@ -8528,7 +8615,7 @@
|
|
|
8528
8615
|
return "";
|
|
8529
8616
|
};
|
|
8530
8617
|
TableColumnsComponent.prototype.isNumber = function (value) {
|
|
8531
|
-
return !
|
|
8618
|
+
return !new BigNumber__default(value).isNaN();
|
|
8532
8619
|
};
|
|
8533
8620
|
TableColumnsComponent.prototype.getTokens = function (values) {
|
|
8534
8621
|
if (!this.isArray(values)) {
|
|
@@ -8545,7 +8632,7 @@
|
|
|
8545
8632
|
.map(function (value) {
|
|
8546
8633
|
var label = typeof value === "symbol" ? value.toString() : "" + value;
|
|
8547
8634
|
return {
|
|
8548
|
-
label: label
|
|
8635
|
+
label: label,
|
|
8549
8636
|
};
|
|
8550
8637
|
});
|
|
8551
8638
|
};
|
|
@@ -8565,6 +8652,7 @@
|
|
|
8565
8652
|
{ type: LocaleService },
|
|
8566
8653
|
{ type: core.ViewContainerRef },
|
|
8567
8654
|
{ type: core$1.TranslateService },
|
|
8655
|
+
{ type: NumericService },
|
|
8568
8656
|
{ type: undefined, decorators: [{ type: core.Inject, args: [HostProjectConfigsInjectionToken,] }] }
|
|
8569
8657
|
]; };
|
|
8570
8658
|
__decorate([
|
|
@@ -8585,7 +8673,7 @@
|
|
|
8585
8673
|
selector: "s-table-columns",
|
|
8586
8674
|
styles: [":host{display:none}"]
|
|
8587
8675
|
}),
|
|
8588
|
-
__param(
|
|
8676
|
+
__param(4, core.Inject(HostProjectConfigsInjectionToken))
|
|
8589
8677
|
], TableColumnsComponent);
|
|
8590
8678
|
return TableColumnsComponent;
|
|
8591
8679
|
}());
|
|
@@ -18006,6 +18094,31 @@
|
|
|
18006
18094
|
return WorkspaceSwitchModule;
|
|
18007
18095
|
}());
|
|
18008
18096
|
|
|
18097
|
+
var CurrencyService = /** @class */ (function () {
|
|
18098
|
+
function CurrencyService(localeService) {
|
|
18099
|
+
this.localeService = localeService;
|
|
18100
|
+
}
|
|
18101
|
+
CurrencyService.prototype.getCurrencySymbol = function (_a) {
|
|
18102
|
+
var currency = _a.currency;
|
|
18103
|
+
var _b, _c;
|
|
18104
|
+
var numberFormat = new Intl.NumberFormat(this.localeService.getLocaleOptions().locale, {
|
|
18105
|
+
style: "currency",
|
|
18106
|
+
currency: currency !== null && currency !== void 0 ? currency : "BRL",
|
|
18107
|
+
currencyDisplay: 'narrowSymbol',
|
|
18108
|
+
maximumFractionDigits: 5,
|
|
18109
|
+
});
|
|
18110
|
+
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 : "";
|
|
18111
|
+
};
|
|
18112
|
+
CurrencyService.ctorParameters = function () { return [
|
|
18113
|
+
{ type: LocaleService }
|
|
18114
|
+
]; };
|
|
18115
|
+
CurrencyService.ɵprov = core["ɵɵdefineInjectable"]({ factory: function CurrencyService_Factory() { return new CurrencyService(core["ɵɵinject"](LocaleService)); }, token: CurrencyService, providedIn: "root" });
|
|
18116
|
+
CurrencyService = __decorate([
|
|
18117
|
+
core.Injectable({ providedIn: "root" })
|
|
18118
|
+
], CurrencyService);
|
|
18119
|
+
return CurrencyService;
|
|
18120
|
+
}());
|
|
18121
|
+
|
|
18009
18122
|
var fallback = {
|
|
18010
18123
|
"platform.angular_components.drag_your_photo_or": "Arraste sua foto ou",
|
|
18011
18124
|
"platform.angular_components.select_a_file": "selecione um arquivo",
|
|
@@ -18356,6 +18469,7 @@
|
|
|
18356
18469
|
exports.CountryPhonePickerComponent = CountryPhonePickerComponent;
|
|
18357
18470
|
exports.CountryPhonePickerModule = CountryPhonePickerModule;
|
|
18358
18471
|
exports.CurrencyField = CurrencyField;
|
|
18472
|
+
exports.CurrencyService = CurrencyService;
|
|
18359
18473
|
exports.CustomFieldsComponent = CustomFieldsComponent;
|
|
18360
18474
|
exports.CustomFieldsModule = CustomFieldsModule;
|
|
18361
18475
|
exports.CustomFieldsService = CustomFieldsService;
|