@seniorsistemas/angular-components 17.10.0 → 17.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/seniorsistemas-angular-components.umd.js +85 -143
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/badge/badge.component.d.ts +4 -2
- package/components/dynamic-form/components/lookup/lookup.component.d.ts +25 -3
- package/components/tooltip/tooltip.directive.d.ts +1 -1
- package/esm2015/components/badge/badge.component.js +10 -4
- package/esm2015/components/dynamic-form/components/fields/lookup/lookup-field.component.js +2 -2
- package/esm2015/components/dynamic-form/components/lookup/lookup.component.js +5 -2
- package/esm2015/components/dynamic-form/dynamic-form.module.js +3 -1
- package/esm2015/components/tooltip/tooltip.component.js +3 -3
- package/esm2015/components/tooltip/tooltip.directive.js +59 -138
- package/esm5/components/badge/badge.component.js +10 -4
- package/esm5/components/dynamic-form/components/fields/lookup/lookup-field.component.js +2 -2
- package/esm5/components/dynamic-form/components/lookup/lookup.component.js +5 -2
- package/esm5/components/dynamic-form/dynamic-form.module.js +3 -1
- package/esm5/components/tooltip/tooltip.component.js +3 -3
- package/esm5/components/tooltip/tooltip.directive.js +71 -139
- package/fesm2015/seniorsistemas-angular-components.js +74 -143
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +86 -144
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate, __assign, __extends, __spread, __awaiter, __generator, __param,
|
|
1
|
+
import { __decorate, __values, __assign, __extends, __spread, __awaiter, __generator, __param, __rest, __read } from 'tslib';
|
|
2
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, fromEvent, forkJoin } from 'rxjs';
|
|
@@ -379,8 +379,8 @@ var TooltipComponent = /** @class */ (function () {
|
|
|
379
379
|
}
|
|
380
380
|
TooltipComponent = __decorate([
|
|
381
381
|
Component({
|
|
382
|
-
template: "<div\n class=\"tooltip\"\n [ngClass]=\"['tooltip--' + position]\"\n [class.tooltip--visible]=\"visible\"\n [ngStyle]=\"{\n 'left': left + 'px',\n 'top': top + 'px'\n }\">\n <ng-template\n *ngIf=\"escape;\n then escapeTemplate;\n else noEscapeTemplate\">\n </ng-template> \n</div>\n\n<ng-template #noEscapeTemplate>\n <span\n class=\"tooltip__content\"\n [innerHTML]=\"tooltip\">\n </span>\n</ng-template>\n\n<ng-template #escapeTemplate>\n <span class=\"tooltip__content\">\n {{ tooltip }}\n </span>\n</ng-template>",
|
|
383
|
-
styles: [".tooltip{background-color:#000;border-radius:2px;color:#fff;font-family:\"Open Sans\",sans-serif;font-size:14px;font-weight:400;line-height:21px;margin-top:5px;opacity:0;padding:8px;position:fixed;transform:translateX(-50%);text-align:center;max-width:
|
|
382
|
+
template: "<div\n id=\"tooltip\"\n class=\"tooltip\"\n [ngClass]=\"['tooltip--' + position]\"\n [class.tooltip--visible]=\"visible\"\n [ngStyle]=\"{\n 'left': left + 'px',\n 'top': top + 'px'\n }\">\n <ng-template\n *ngIf=\"escape;\n then escapeTemplate;\n else noEscapeTemplate\">\n </ng-template> \n</div>\n\n<ng-template #noEscapeTemplate>\n <span\n class=\"tooltip__content\"\n [innerHTML]=\"tooltip\">\n </span>\n</ng-template>\n\n<ng-template #escapeTemplate>\n <span class=\"tooltip__content\">\n {{ tooltip }}\n </span>\n</ng-template>",
|
|
383
|
+
styles: [".tooltip{background-color:#000;border-radius:2px;color:#fff;font-family:\"Open Sans\",sans-serif;font-size:14px;font-weight:400;line-height:21px;margin-top:5px;opacity:0;padding:8px;position:fixed;transform:translateX(-50%);text-align:center;max-width:220px;word-wrap:break-word;z-index:99999}.tooltip--visible{opacity:1;transition:opacity .3s}.tooltip::before{content:\"\";height:0;position:absolute;width:0}.tooltip--bottom{margin-top:8px;transform:translateX(-50%)}.tooltip--bottom::before{border:5px solid transparent;border-bottom:5px solid #000;left:calc(50% - 5px);top:-10px}.tooltip--top{margin-bottom:8px;transform:translate(-50%,-100%)}.tooltip--top::before{border:5px solid transparent;border-top:5px solid #000;left:calc(50% - 5px);bottom:-10px}.tooltip--left{margin-right:28px;transform:translate(calc(-100% - 7px),-50%)}.tooltip--left::before{border:5px solid transparent;border-left:5px solid #000;right:-10px;bottom:calc(50% - 5px)}.tooltip--right{margin-left:7px;transform:translateY(-50%)}.tooltip--right::before{border:5px solid transparent;border-right:5px solid #000;left:-10px;bottom:calc(50% - 5px)}"]
|
|
384
384
|
})
|
|
385
385
|
], TooltipComponent);
|
|
386
386
|
return TooltipComponent;
|
|
@@ -480,7 +480,7 @@ var TooltipDirective = /** @class */ (function () {
|
|
|
480
480
|
top: Math.min(elementRect.top, toolTipRect.top),
|
|
481
481
|
right: Math.max(elementRect.right, toolTipRect.right),
|
|
482
482
|
left: Math.min(elementRect.left, toolTipRect.left),
|
|
483
|
-
bottom: Math.max(elementRect.bottom, toolTipRect.bottom)
|
|
483
|
+
bottom: Math.max(elementRect.bottom, toolTipRect.bottom),
|
|
484
484
|
};
|
|
485
485
|
if (this.isMousePositionOutsideOfElement(event.clientX, event.clientY, totalElementArea)) {
|
|
486
486
|
this.destroy();
|
|
@@ -497,12 +497,12 @@ var TooltipDirective = /** @class */ (function () {
|
|
|
497
497
|
if (this.focusedInputRef) {
|
|
498
498
|
var inputFocus = this.focusedInputRef;
|
|
499
499
|
var icon_1 = this.getIconFromFocusedInput();
|
|
500
|
-
this.renderer.listen(this.focusedInputRef,
|
|
500
|
+
this.renderer.listen(this.focusedInputRef, "focus", function () {
|
|
501
501
|
if (icon_1 && _this.isMatchingTooltip(icon_1)) {
|
|
502
502
|
_this.createTootipByFocus(icon_1);
|
|
503
503
|
}
|
|
504
504
|
});
|
|
505
|
-
this.renderer.listen(inputFocus,
|
|
505
|
+
this.renderer.listen(inputFocus, "blur", function () {
|
|
506
506
|
if (icon_1 && _this.isMatchingTooltip(icon_1)) {
|
|
507
507
|
_this.removeTooltip(icon_1);
|
|
508
508
|
_this.destroy();
|
|
@@ -523,7 +523,7 @@ var TooltipDirective = /** @class */ (function () {
|
|
|
523
523
|
* @returns true se o tooltip corresponde; caso contrário, false.
|
|
524
524
|
*/
|
|
525
525
|
TooltipDirective.prototype.isMatchingTooltip = function (icon) {
|
|
526
|
-
var tooltipText = icon.getAttribute(
|
|
526
|
+
var tooltipText = icon.getAttribute("ng-reflect-tooltip");
|
|
527
527
|
return this.tooltip === tooltipText;
|
|
528
528
|
};
|
|
529
529
|
/**
|
|
@@ -531,7 +531,7 @@ var TooltipDirective = /** @class */ (function () {
|
|
|
531
531
|
* @param icon O ícone do input em focus.
|
|
532
532
|
*/
|
|
533
533
|
TooltipDirective.prototype.removeTooltip = function (icon) {
|
|
534
|
-
var tooltip = icon.querySelector(
|
|
534
|
+
var tooltip = icon.querySelector(".tooltip");
|
|
535
535
|
if (tooltip) {
|
|
536
536
|
tooltip.remove();
|
|
537
537
|
}
|
|
@@ -539,9 +539,7 @@ var TooltipDirective = /** @class */ (function () {
|
|
|
539
539
|
// whenever the component with the tooltip is clicked I destroy the tooltip.
|
|
540
540
|
// whenever a key is pressed on the component with the tooltip I destroy the tooltip.
|
|
541
541
|
TooltipDirective.prototype.onClick = function () {
|
|
542
|
-
if (this.tooltipEvent === TooltipEvent.Hover &&
|
|
543
|
-
!navigator.userAgent.match(/Android/i) &&
|
|
544
|
-
!navigator.userAgent.match(/iPhone/i)) {
|
|
542
|
+
if (this.tooltipEvent === TooltipEvent.Hover && !navigator.userAgent.match(/Android/i) && !navigator.userAgent.match(/iPhone/i)) {
|
|
545
543
|
this.destroy();
|
|
546
544
|
}
|
|
547
545
|
};
|
|
@@ -586,12 +584,7 @@ var TooltipDirective = /** @class */ (function () {
|
|
|
586
584
|
}
|
|
587
585
|
};
|
|
588
586
|
TooltipDirective.prototype.validatePosition = function () {
|
|
589
|
-
var containsPosition = [
|
|
590
|
-
TooltipPosition.Top,
|
|
591
|
-
TooltipPosition.Right,
|
|
592
|
-
TooltipPosition.Bottom,
|
|
593
|
-
TooltipPosition.Left,
|
|
594
|
-
].includes(this.position);
|
|
587
|
+
var containsPosition = [TooltipPosition.Top, TooltipPosition.Right, TooltipPosition.Bottom, TooltipPosition.Left].includes(this.position);
|
|
595
588
|
if (!containsPosition) {
|
|
596
589
|
this.position = TooltipPosition.Top;
|
|
597
590
|
throw new Error("Tooltip " + this.position + " position is unexpected");
|
|
@@ -604,7 +597,7 @@ var TooltipDirective = /** @class */ (function () {
|
|
|
604
597
|
document.body.appendChild(domElem);
|
|
605
598
|
this.setTooltipComponentProperties();
|
|
606
599
|
this.showTimeout = window.setTimeout(this.showTooltip.bind(this), this.showDelay);
|
|
607
|
-
this.tooltipDivElement = domElem.querySelector(
|
|
600
|
+
this.tooltipDivElement = domElem.querySelector(".tooltip");
|
|
608
601
|
if (this.displayTime) {
|
|
609
602
|
window.setTimeout(this.destroy.bind(this), this.displayTime);
|
|
610
603
|
}
|
|
@@ -626,142 +619,81 @@ var TooltipDirective = /** @class */ (function () {
|
|
|
626
619
|
var _a;
|
|
627
620
|
if (this.componentRef === null && ((_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
628
621
|
var domElem = this.getDomElement();
|
|
629
|
-
var tooltip_1 = domElem.querySelector(
|
|
622
|
+
var tooltip_1 = domElem.querySelector(".tooltip");
|
|
630
623
|
icon.appendChild(tooltip_1);
|
|
631
624
|
this.setTooltipComponentProperties();
|
|
632
625
|
setTimeout(function () { return tooltip_1.classList.add("tooltip--visible"); }, 0);
|
|
633
|
-
this.renderer.listen(window,
|
|
634
|
-
_this.
|
|
626
|
+
this.renderer.listen(window, "scroll", function () {
|
|
627
|
+
_this.setTooltipPositionProperty();
|
|
635
628
|
});
|
|
636
629
|
}
|
|
637
630
|
};
|
|
638
|
-
TooltipDirective.prototype.updateTooltipPosition = function () {
|
|
639
|
-
if (this.componentRef) {
|
|
640
|
-
var _a = this.elementRef.nativeElement.getBoundingClientRect(), left = _a.left, right = _a.right, top_1 = _a.top, bottom = _a.bottom;
|
|
641
|
-
var tooltipWidth = right - left;
|
|
642
|
-
var tooltipHeight = bottom - top_1;
|
|
643
|
-
switch (this.position) {
|
|
644
|
-
case TooltipPosition.Top:
|
|
645
|
-
this.componentRef.instance.left = Math.round(tooltipWidth / 2 + left);
|
|
646
|
-
this.componentRef.instance.top = Math.round(top_1 - 20 - 5);
|
|
647
|
-
break;
|
|
648
|
-
case TooltipPosition.Bottom:
|
|
649
|
-
this.componentRef.instance.left = Math.round(tooltipWidth / 2 + left);
|
|
650
|
-
this.componentRef.instance.top = Math.round(bottom + 20);
|
|
651
|
-
break;
|
|
652
|
-
case TooltipPosition.Left:
|
|
653
|
-
this.componentRef.instance.left = Math.round(left - 20);
|
|
654
|
-
this.componentRef.instance.top = Math.round(top_1 + tooltipHeight / 2 - 5);
|
|
655
|
-
break;
|
|
656
|
-
case TooltipPosition.Right:
|
|
657
|
-
this.componentRef.instance.left = Math.round(right + 20);
|
|
658
|
-
this.componentRef.instance.top = Math.round(top_1 + tooltipHeight / 2 - 5);
|
|
659
|
-
break;
|
|
660
|
-
default:
|
|
661
|
-
break;
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
};
|
|
665
631
|
TooltipDirective.prototype.showTooltip = function () {
|
|
666
632
|
if (this.componentRef !== null) {
|
|
667
633
|
this.componentRef.instance.visible = this.visible;
|
|
668
|
-
|
|
634
|
+
this.setTooltipPositionProperty();
|
|
635
|
+
window.addEventListener("mousemove", this.boundOnWindowMouseMoveFunction);
|
|
669
636
|
}
|
|
670
637
|
};
|
|
671
|
-
TooltipDirective.prototype.
|
|
638
|
+
TooltipDirective.prototype.setTooltipPositionProperty = function () {
|
|
639
|
+
var e_1, _a;
|
|
672
640
|
var margin = 20;
|
|
673
641
|
var anchorSize = 5;
|
|
642
|
+
var domElem = this.componentRef.hostView.rootNodes[0].querySelector("#tooltip");
|
|
643
|
+
var _b = domElem.getBoundingClientRect(), height = _b.height, width = _b.width;
|
|
644
|
+
var _c = this.elementRef.nativeElement.getBoundingClientRect(), left = _c.left, right = _c.right, top = _c.top, bottom = _c.bottom;
|
|
645
|
+
var positions = [
|
|
646
|
+
{
|
|
647
|
+
pos: TooltipPosition.Top,
|
|
648
|
+
check: function () { return top > height; },
|
|
649
|
+
set: function () { return ({ left: left + (right - left) / 2, top: top - margin - anchorSize }); },
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
pos: TooltipPosition.Bottom,
|
|
653
|
+
check: function () { return document.body.clientHeight - bottom > height; },
|
|
654
|
+
set: function () { return ({ left: left + (right - left) / 2, top: bottom + margin }); },
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
pos: TooltipPosition.Left,
|
|
658
|
+
check: function () { return left > width; },
|
|
659
|
+
set: function () { return ({ left: left - margin, top: top + height / 2 - anchorSize }); },
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
pos: TooltipPosition.Right,
|
|
663
|
+
check: function () { return document.body.clientWidth - right > width; },
|
|
664
|
+
set: function () { return ({ left: right + margin, top: top + height / 2 - anchorSize }); },
|
|
665
|
+
},
|
|
666
|
+
];
|
|
667
|
+
try {
|
|
668
|
+
for (var positions_1 = __values(positions), positions_1_1 = positions_1.next(); !positions_1_1.done; positions_1_1 = positions_1.next()) {
|
|
669
|
+
var _d = positions_1_1.value, pos = _d.pos, check = _d.check, set = _d.set;
|
|
670
|
+
if (check()) {
|
|
671
|
+
this.position = pos;
|
|
672
|
+
var _e = set(), left_1 = _e.left, top_1 = _e.top;
|
|
673
|
+
this.componentRef.instance.left = Math.round(left_1);
|
|
674
|
+
this.componentRef.instance.top = Math.round(top_1);
|
|
675
|
+
this.componentRef.instance.position = this.position;
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
681
|
+
finally {
|
|
682
|
+
try {
|
|
683
|
+
if (positions_1_1 && !positions_1_1.done && (_a = positions_1.return)) _a.call(positions_1);
|
|
684
|
+
}
|
|
685
|
+
finally { if (e_1) throw e_1.error; }
|
|
686
|
+
}
|
|
687
|
+
// Se não conseguir posicionar, mostrar abaixo
|
|
688
|
+
this.position = TooltipPosition.Bottom;
|
|
689
|
+
this.componentRef.instance.left = Math.round(left + (right - left) / 2);
|
|
690
|
+
this.componentRef.instance.top = Math.round(bottom + margin);
|
|
691
|
+
this.componentRef.instance.position = this.position;
|
|
692
|
+
};
|
|
693
|
+
TooltipDirective.prototype.setTooltipComponentProperties = function () {
|
|
674
694
|
if (this.componentRef !== null) {
|
|
675
695
|
this.componentRef.instance.tooltip = this.tooltip;
|
|
676
696
|
this.componentRef.instance.escape = this.escape;
|
|
677
|
-
var _a = this.elementRef.nativeElement.getBoundingClientRect(), left = _a.left, right = _a.right, top_2 = _a.top, bottom = _a.bottom;
|
|
678
|
-
var tooltipHeight = bottom - top_2;
|
|
679
|
-
var tooltipWidth = right - left;
|
|
680
|
-
var safeSpace = 150;
|
|
681
|
-
var positioned = false;
|
|
682
|
-
var invalidOptions = [];
|
|
683
|
-
while (!positioned) {
|
|
684
|
-
if (invalidOptions.includes(TooltipPosition.Top)
|
|
685
|
-
&& invalidOptions.includes(TooltipPosition.Bottom)
|
|
686
|
-
&& invalidOptions.includes(TooltipPosition.Left)
|
|
687
|
-
&& invalidOptions.includes(TooltipPosition.Right)) {
|
|
688
|
-
this.destroy();
|
|
689
|
-
throw new Error("No space to show tooltip");
|
|
690
|
-
}
|
|
691
|
-
switch (this.position) {
|
|
692
|
-
case TooltipPosition.Top: {
|
|
693
|
-
if (invalidOptions.includes(TooltipPosition.Top)) {
|
|
694
|
-
this.position = TooltipPosition.Left;
|
|
695
|
-
break;
|
|
696
|
-
}
|
|
697
|
-
var topShift = top_2;
|
|
698
|
-
if (topShift <= tooltipHeight + safeSpace) {
|
|
699
|
-
this.position = TooltipPosition.Bottom;
|
|
700
|
-
invalidOptions.push(TooltipPosition.Top);
|
|
701
|
-
positioned = false;
|
|
702
|
-
break;
|
|
703
|
-
}
|
|
704
|
-
this.componentRef.instance.left = Math.round(tooltipWidth / 2 + left);
|
|
705
|
-
this.componentRef.instance.top = Math.round(top_2 - margin - anchorSize);
|
|
706
|
-
positioned = true;
|
|
707
|
-
break;
|
|
708
|
-
}
|
|
709
|
-
case TooltipPosition.Bottom: {
|
|
710
|
-
if (invalidOptions.includes(TooltipPosition.Bottom)) {
|
|
711
|
-
this.position = TooltipPosition.Left;
|
|
712
|
-
break;
|
|
713
|
-
}
|
|
714
|
-
var bottomShift = document.body.clientHeight - bottom;
|
|
715
|
-
if (bottomShift <= tooltipHeight + safeSpace) {
|
|
716
|
-
this.position = TooltipPosition.Top;
|
|
717
|
-
invalidOptions.push(TooltipPosition.Bottom);
|
|
718
|
-
break;
|
|
719
|
-
}
|
|
720
|
-
this.componentRef.instance.left = Math.round(tooltipWidth / 2 + left);
|
|
721
|
-
this.componentRef.instance.top = Math.round(bottom + margin);
|
|
722
|
-
positioned = true;
|
|
723
|
-
break;
|
|
724
|
-
}
|
|
725
|
-
case TooltipPosition.Left: {
|
|
726
|
-
if (invalidOptions.includes(TooltipPosition.Left)) {
|
|
727
|
-
this.position = TooltipPosition.Top;
|
|
728
|
-
break;
|
|
729
|
-
}
|
|
730
|
-
var leftShift = left;
|
|
731
|
-
if (leftShift <= tooltipWidth + safeSpace) {
|
|
732
|
-
this.position = TooltipPosition.Right;
|
|
733
|
-
invalidOptions.push(TooltipPosition.Left);
|
|
734
|
-
positioned = false;
|
|
735
|
-
break;
|
|
736
|
-
}
|
|
737
|
-
this.componentRef.instance.left = Math.round(left - margin);
|
|
738
|
-
this.componentRef.instance.top = Math.round(top_2 + tooltipHeight / 2 - anchorSize);
|
|
739
|
-
positioned = true;
|
|
740
|
-
break;
|
|
741
|
-
}
|
|
742
|
-
case TooltipPosition.Right: {
|
|
743
|
-
if (invalidOptions.includes(TooltipPosition.Right)) {
|
|
744
|
-
this.position = TooltipPosition.Top;
|
|
745
|
-
break;
|
|
746
|
-
}
|
|
747
|
-
var rightShift = document.body.clientWidth - right;
|
|
748
|
-
if (rightShift <= tooltipWidth + safeSpace) {
|
|
749
|
-
this.position = TooltipPosition.Left;
|
|
750
|
-
invalidOptions.push(TooltipPosition.Right);
|
|
751
|
-
positioned = false;
|
|
752
|
-
break;
|
|
753
|
-
}
|
|
754
|
-
this.componentRef.instance.left = Math.round(right + margin);
|
|
755
|
-
this.componentRef.instance.top = Math.round(top_2 + tooltipHeight / 2 - anchorSize);
|
|
756
|
-
positioned = true;
|
|
757
|
-
break;
|
|
758
|
-
}
|
|
759
|
-
default: {
|
|
760
|
-
break;
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
this.componentRef.instance.position = this.position;
|
|
764
|
-
}
|
|
765
697
|
}
|
|
766
698
|
};
|
|
767
699
|
TooltipDirective.prototype.destroy = function () {
|
|
@@ -772,7 +704,7 @@ var TooltipDirective = /** @class */ (function () {
|
|
|
772
704
|
this.componentRef = null;
|
|
773
705
|
this.tooltipDivElement = null;
|
|
774
706
|
}
|
|
775
|
-
window.removeEventListener(
|
|
707
|
+
window.removeEventListener("mousemove", this.boundOnWindowMouseMoveFunction);
|
|
776
708
|
};
|
|
777
709
|
TooltipDirective.ctorParameters = function () { return [
|
|
778
710
|
{ type: ElementRef },
|
|
@@ -966,15 +898,21 @@ var BadgeTypes;
|
|
|
966
898
|
|
|
967
899
|
var BadgeComponent = /** @class */ (function () {
|
|
968
900
|
function BadgeComponent() {
|
|
969
|
-
this.type = BadgeTypes.Pill;
|
|
970
|
-
this.color = BadgeColors.Blue;
|
|
971
901
|
this.selectable = false;
|
|
972
|
-
this.iconPosition = "left";
|
|
973
902
|
this.selected = new EventEmitter();
|
|
974
903
|
}
|
|
975
904
|
BadgeComponent.prototype.onClick = function () {
|
|
976
905
|
this.selected.emit(this.text);
|
|
977
906
|
};
|
|
907
|
+
BadgeComponent.prototype.ngOnInit = function () {
|
|
908
|
+
this._setDefaultValues();
|
|
909
|
+
};
|
|
910
|
+
BadgeComponent.prototype._setDefaultValues = function () {
|
|
911
|
+
var _a, _b, _c;
|
|
912
|
+
this.type = (_a = this.type) !== null && _a !== void 0 ? _a : BadgeTypes.Pill;
|
|
913
|
+
this.color = (_b = this.color) !== null && _b !== void 0 ? _b : BadgeColors.Blue;
|
|
914
|
+
this.iconPosition = (_c = this.iconPosition) !== null && _c !== void 0 ? _c : "left";
|
|
915
|
+
};
|
|
978
916
|
__decorate([
|
|
979
917
|
Input()
|
|
980
918
|
], BadgeComponent.prototype, "type", void 0);
|
|
@@ -5443,6 +5381,9 @@ var LookupComponent = /** @class */ (function () {
|
|
|
5443
5381
|
LookupComponent.prototype.getFieldValue = function (obj, path) {
|
|
5444
5382
|
return path.split(".").reduce(function (result, prop) { return (result[prop] === undefined ? "" : result[prop]); }, obj);
|
|
5445
5383
|
};
|
|
5384
|
+
LookupComponent.prototype.getBadgeFromValue = function (value, options) {
|
|
5385
|
+
return options === null || options === void 0 ? void 0 : options.find(function (opt) { return opt.value === value; }).badge;
|
|
5386
|
+
};
|
|
5446
5387
|
LookupComponent.prototype.getLabelForValue = function (value, options) {
|
|
5447
5388
|
if (!options)
|
|
5448
5389
|
return value;
|
|
@@ -5744,7 +5685,7 @@ var LookupComponent = /** @class */ (function () {
|
|
|
5744
5685
|
Injectable(),
|
|
5745
5686
|
Component({
|
|
5746
5687
|
selector: "s-lookup",
|
|
5747
|
-
template: "<div [ngClass]=\"{ inputgroup: showSearch }\">\n <p-autoComplete\n #autocomplete\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [dataKey]=\"dataKey\"\n [multiple]=\"multiple\"\n [inputId]=\"id + '-autocomplete'\"\n [forceSelection]=\"autocompleteForceSelection\"\n [suggestions]=\"getLookupSuggestions()\"\n (completeMethod)=\"lazyLoadLookup($event)\"\n (onSelect)=\"onSelect.next($event)\"\n (onBlur)=\"onBlur.next($event)\"\n (onFocus)=\"onFocus.next($event)\"\n (onUnselect)=\"onUnselect.next($event)\"\n (onClear)=\"onClear.next($event)\"\n (onKeyUp)=\"onKeyUp.next($event)\"\n [field]=\"lookupDisplayField\"\n [emptyMessage]=\"lookupEmptyMessage\"\n [dropdown]=\"!showSearch\"\n [appendTo]=\"lookupAppendTo\"\n [placeholder]=\"placeholder || ' '\"\n [autoHighlight]=\"true\"\n inputStyleClass=\"mousetrap\">\n <ng-template let-item pTemplate=\"selectedItem\">\n <span\n class=\"ui-autocomplete-token-label ng-tns-c65-43 ng-star-inserted\"\n [sTooltip]=\"lookupDisplayFieldTooltip ? item[lookupDisplayField] : null\"\n tooltipPosition=\"top\">\n {{item[lookupDisplayField]}}\n </span>\n </ng-template>\n </p-autoComplete>\n <button\n *ngIf=\"showSearch\"\n pButton\n type=\"button\"\n icon=\"fa fa-search\"\n class=\"button-addon\"\n [disabled]=\"disabled\"\n (click)=\"showDialog()\">\n </button>\n</div>\n<p-dialog\n appendTo=\"body\"\n styleClass=\"s-lookup-modal\"\n [header]=\"searchTitle || 'platform.angular_components.advanced_search' | translate\"\n [(visible)]=\"dialogVisible\"\n [modal]=\"true\"\n (onHide)=\"hideDialog()\"\n [blockScroll]=\"true\"\n [focusOnShow]=\"true\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n #dialog>\n <div\n *ngIf=\"dialogVisible\"\n class=\"s-lookup-modal-container\">\n <div\n *ngIf=\"searchFields && searchFields.length\"\n class=\"filter\"\n [@collapseContent]=\"collapsed\n ? { value: 'hidden', params: { transitionParams: transitionOptions } }\n : { value: 'visible', params: { transitionParams: transitionOptions } }\"\n (@collapseContent.done)=\"onToggleDone()\">\n <form\n [formGroup]=\"formGroupDialog\"\n novalidate\n autocomplete=\"off\">\n <div\n *ngIf=\"!collapsed\"\n class=\"form-content\"\n [@childCollapseContent]=\"collapsed\n ? { value: ':leave', params: { transitionParams: transitionOptions } }\n : { value: ':enter', params: { transitionParams: transitionOptions } }\">\n <div class=\"filter-title sds-section-title\">\n {{ filterTitle || \"platform.angular_components.filters\" | translate }}\n </div>\n <div class=\"form-fields\">\n <s-dynamic-form\n [fields]=\"searchFields\"\n [form]=\"formGroupDialog\">\n </s-dynamic-form>\n </div>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button\n [id]=\"id + '-filter-button'\"\n type=\"submit\"\n [label]=\"filterLabel || 'platform.angular_components.filter' | translate\"\n (onClick)=\"search()\"\n sTooltip=\"(ALT + SHIFT + F)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n <s-button\n [id]=\"id + '-clear-button'\"\n type=\"button\"\n [label]=\"clearLabel || 'platform.angular_components.clear' | translate\"\n (onClick)=\"clear()\"\n priority=\"link\"\n sTooltip=\"(ALT + SHIFT + L)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n </div>\n </div>\n </div>\n </form>\n </div>\n <div\n *ngIf=\"searchFields && searchFields.length\"\n class=\"filter-toggle\">\n <div class=\"filter-toggle--start-border-mask\"></div>\n <button\n [id]=\"id + '-filter-toggle-button'\"\n type=\"button\"\n (click)=\"filterToggle()\">\n <span\n class=\"fa\"\n [ngClass]=\"{'fa-chevron-left': !collapsed, 'fa-chevron-right': collapsed}\"\n aria-hidden=\"true\">\n </span>\n </button>\n <div class=\"filter-toggle--end-border-mask\"></div>\n </div>\n <div\n class=\"content\"\n [ngClass]=\"{'empty-content': !searchTotalRecords && !loading}\">\n <s-empty-state\n [id]=\"id + '-empty-state'\"\n *ngIf=\"!searchTotalRecords && !loading\"\n [title]=\"searchEmptyTitle || 'platform.angular_components.no_records_found' | translate\"\n [description]=\"searchEmptyDescription\"\n iconClass=\"fa fa-search\">\n </s-empty-state>\n\n <div>\n <s-button\n *ngIf=\"showAddOption\"\n priority=\"default\"\n [label]=\"'platform.angular_components.add' | translate\"\n (onClick)=\"onAdd.emit()\">\n </s-button>\n <s-button\n *ngIf=\"showEditOption\"\n priority=\"default\"\n [label]=\"'platform.angular_components.edit' | translate\"\n [disabled]=\"selected.length !== 1\"\n (onClick)=\"onEdit.emit(this.selected[0])\">\n </s-button>\n <s-button\n *ngIf=\"showRemoveOption\"\n priority=\"default\"\n [label]=\"'platform.angular_components.remove' | translate\"\n [disabled]=\"!selected.length\"\n (onClick)=\"onRemove.emit(this.selected)\">\n </s-button>\n </div>\n\n <p-table\n [dataKey]=\"dataKey\"\n [value]=\"getGridData()\"\n [columns]=\"searchGridFields\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n sortMode=\"multiple\"\n [totalRecords]=\"searchTotalRecords\"\n [rows]=\"10\"\n [selection]=\"selected\"\n (onLazyLoad)=\"lazyLoadGrid($event)\"\n *sLoadingState=\"{ loading: loading, indicator: 'logo' }\"\n [multiSortMeta]=\"multiSortMeta\"\n [attr.data-hidden]=\"!searchTotalRecords && !loading\"\n [selectionMode]=\"multiple ? 'multiple' : 'single'\"\n (selectionChange)=\"onSelectionChange($event)\">\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col\n *ngIf=\"multiple\"\n style=\"width: 50px\" />\n <col\n *ngFor=\"let col of columns\"\n [style.width]=\"col.width\" />\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th\n *ngIf=\"multiple\"\n style=\"width: 50px\">\n <s-table-header-checkbox\n [useAllObject]=\"lookupRowProps ? false : true\"\n [rowProps]=\"lookupRowProps\">\n </s-table-header-checkbox>\n </th>\n <th\n [style.width]=\"col.width\"\n *ngFor=\"let col of columns\"\n [pSortableColumn]=\"col.name\"\n [pSortableColumnDisabled]=\"sortableColumnsDisabled?.includes(col.name)\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.label }}</span>\n <p-sortIcon\n [field]=\"col.name\"\n *ngIf=\"!sortableColumnsDisabled?.includes(col.name)\">\n </p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template\n pTemplate=\"body\"\n let-rowData\n let-columns\n let-rowIndex=\"rowIndex\">\n <tr\n sNavigation\n [pSelectableRow]=\"rowData\"\n [pSelectableRowIndex]=\"rowIndex\"\n sDoubleClick (onDoubleClick)=\"onTableRowDoubleClick(rowData)\">\n <td\n *ngIf=\"multiple\"\n style=\"width: 50px\"\n tabindex=\"0\">\n <p-tableCheckbox\n [value]=\"rowData\"\n [pSelectableRow]=\"rowData\">\n </p-tableCheckbox>\n </td>\n <td\n [style.width]=\"col['width']\"\n *ngFor=\"let col of searchGridFields\"\n [ngSwitch]=\"col.type\"\n tabindex=\"0\">\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <ng-container *ngIf=\"isBooleanValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getBooleanLabel(rowData, col.name, col.optionsLabel) }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Date'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate: col.calendarLocaleOptions?.dateFormat || \"L\" | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'LocalDateTime'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Time'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedTime: col.calendarLocaleOptions?.dateFormat || \"LTS\" | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Integer'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getIntegerMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Double'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getDoubleMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Money'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getMoneyMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Number'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getNumberMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Enum'\">\n <ng-container\n *ngIf=\"getLabelForValue(getFieldValue(rowData, col.name), col.options); else emptyTemplate\"\n >\n <span> {{ getLabelForValue(getFieldValue(rowData, col.name), col.options) }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"col.mask && col.mask()\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name))\">\n <span>{{ getFieldValue(rowData, col.name) | sMaskFormatter: col.mask() }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!(col.mask && col.mask())\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name)); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) }}</span>\n </ng-container>\n </ng-container>\n </ng-container>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span [attr.data-hidden]=\"loading\">\n {{ printRecordTotalizer() }}\n </span>\n </ng-template>\n </p-table>\n </div>\n </div>\n <p-footer>\n <s-button\n [id]=\"id + '-select-button'\"\n type=\"button\"\n [label]=\"selectLabel || 'platform.angular_components.select' | translate\"\n (onClick)=\"select()\"\n sTooltip=\"(ALT + SHIFT + S)\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [disabled]=\"!selected?.length\">\n </s-button>\n <s-button\n [id]=\"id + '-cancel-button'\"\n type=\"button\"\n priority=\"link\"\n [label]=\"cancelLabel || 'platform.angular_components.cancel' | translate\"\n (onClick)=\"hideDialog()\"\n sTooltip=\"(ALT + SHIFT + C)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n </p-footer>\n</p-dialog>\n<ng-template #emptyTemplate>\n <span [ngClass]=\"'sds-empty-value'\">\n {{ emptyFieldLabel || 'platform.angular_components.not_informed' | translate }}\n </span>\n</ng-template>\n",
|
|
5688
|
+
template: "<div [ngClass]=\"{ inputgroup: showSearch }\">\n <p-autoComplete\n #autocomplete\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [dataKey]=\"dataKey\"\n [multiple]=\"multiple\"\n [inputId]=\"id + '-autocomplete'\"\n [forceSelection]=\"autocompleteForceSelection\"\n [suggestions]=\"getLookupSuggestions()\"\n (completeMethod)=\"lazyLoadLookup($event)\"\n (onSelect)=\"onSelect.next($event)\"\n (onBlur)=\"onBlur.next($event)\"\n (onFocus)=\"onFocus.next($event)\"\n (onUnselect)=\"onUnselect.next($event)\"\n (onClear)=\"onClear.next($event)\"\n (onKeyUp)=\"onKeyUp.next($event)\"\n [field]=\"lookupDisplayField\"\n [emptyMessage]=\"lookupEmptyMessage\"\n [dropdown]=\"!showSearch\"\n [appendTo]=\"lookupAppendTo\"\n [placeholder]=\"placeholder || ' '\"\n [autoHighlight]=\"true\"\n inputStyleClass=\"mousetrap\">\n <ng-template let-item pTemplate=\"selectedItem\">\n <span\n class=\"ui-autocomplete-token-label ng-tns-c65-43 ng-star-inserted\"\n [sTooltip]=\"lookupDisplayFieldTooltip ? item[lookupDisplayField] : null\"\n tooltipPosition=\"top\">\n {{item[lookupDisplayField]}}\n </span>\n </ng-template>\n </p-autoComplete>\n <button\n *ngIf=\"showSearch\"\n pButton\n type=\"button\"\n icon=\"fa fa-search\"\n class=\"button-addon\"\n [disabled]=\"disabled\"\n (click)=\"showDialog()\">\n </button>\n</div>\n<p-dialog\n appendTo=\"body\"\n styleClass=\"s-lookup-modal\"\n [header]=\"searchTitle || 'platform.angular_components.advanced_search' | translate\"\n [(visible)]=\"dialogVisible\"\n [modal]=\"true\"\n (onHide)=\"hideDialog()\"\n [blockScroll]=\"true\"\n [focusOnShow]=\"true\"\n [draggable]=\"false\"\n [resizable]=\"false\"\n #dialog>\n <div\n *ngIf=\"dialogVisible\"\n class=\"s-lookup-modal-container\">\n <div\n *ngIf=\"searchFields && searchFields.length\"\n class=\"filter\"\n [@collapseContent]=\"collapsed\n ? { value: 'hidden', params: { transitionParams: transitionOptions } }\n : { value: 'visible', params: { transitionParams: transitionOptions } }\"\n (@collapseContent.done)=\"onToggleDone()\">\n <form\n [formGroup]=\"formGroupDialog\"\n novalidate\n autocomplete=\"off\">\n <div\n *ngIf=\"!collapsed\"\n class=\"form-content\"\n [@childCollapseContent]=\"collapsed\n ? { value: ':leave', params: { transitionParams: transitionOptions } }\n : { value: ':enter', params: { transitionParams: transitionOptions } }\">\n <div class=\"filter-title sds-section-title\">\n {{ filterTitle || \"platform.angular_components.filters\" | translate }}\n </div>\n <div class=\"form-fields\">\n <s-dynamic-form\n [fields]=\"searchFields\"\n [form]=\"formGroupDialog\">\n </s-dynamic-form>\n </div>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button\n [id]=\"id + '-filter-button'\"\n type=\"submit\"\n [label]=\"filterLabel || 'platform.angular_components.filter' | translate\"\n (onClick)=\"search()\"\n sTooltip=\"(ALT + SHIFT + F)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n <s-button\n [id]=\"id + '-clear-button'\"\n type=\"button\"\n [label]=\"clearLabel || 'platform.angular_components.clear' | translate\"\n (onClick)=\"clear()\"\n priority=\"link\"\n sTooltip=\"(ALT + SHIFT + L)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n </div>\n </div>\n </div>\n </form>\n </div>\n <div\n *ngIf=\"searchFields && searchFields.length\"\n class=\"filter-toggle\">\n <div class=\"filter-toggle--start-border-mask\"></div>\n <button\n [id]=\"id + '-filter-toggle-button'\"\n type=\"button\"\n (click)=\"filterToggle()\">\n <span\n class=\"fa\"\n [ngClass]=\"{'fa-chevron-left': !collapsed, 'fa-chevron-right': collapsed}\"\n aria-hidden=\"true\">\n </span>\n </button>\n <div class=\"filter-toggle--end-border-mask\"></div>\n </div>\n <div\n class=\"content\"\n [ngClass]=\"{'empty-content': !searchTotalRecords && !loading}\">\n <s-empty-state\n [id]=\"id + '-empty-state'\"\n *ngIf=\"!searchTotalRecords && !loading\"\n [title]=\"searchEmptyTitle || 'platform.angular_components.no_records_found' | translate\"\n [description]=\"searchEmptyDescription\"\n iconClass=\"fa fa-search\">\n </s-empty-state>\n\n <div>\n <s-button\n *ngIf=\"showAddOption\"\n priority=\"default\"\n [label]=\"'platform.angular_components.add' | translate\"\n (onClick)=\"onAdd.emit()\">\n </s-button>\n <s-button\n *ngIf=\"showEditOption\"\n priority=\"default\"\n [label]=\"'platform.angular_components.edit' | translate\"\n [disabled]=\"selected.length !== 1\"\n (onClick)=\"onEdit.emit(this.selected[0])\">\n </s-button>\n <s-button\n *ngIf=\"showRemoveOption\"\n priority=\"default\"\n [label]=\"'platform.angular_components.remove' | translate\"\n [disabled]=\"!selected.length\"\n (onClick)=\"onRemove.emit(this.selected)\">\n </s-button>\n </div>\n\n <p-table\n [dataKey]=\"dataKey\"\n [value]=\"getGridData()\"\n [columns]=\"searchGridFields\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n sortMode=\"multiple\"\n [totalRecords]=\"searchTotalRecords\"\n [rows]=\"10\"\n [selection]=\"selected\"\n (onLazyLoad)=\"lazyLoadGrid($event)\"\n *sLoadingState=\"{ loading: loading, indicator: 'logo' }\"\n [multiSortMeta]=\"multiSortMeta\"\n [attr.data-hidden]=\"!searchTotalRecords && !loading\"\n [selectionMode]=\"multiple ? 'multiple' : 'single'\"\n (selectionChange)=\"onSelectionChange($event)\">\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col\n *ngIf=\"multiple\"\n style=\"width: 50px\" />\n <col\n *ngFor=\"let col of columns\"\n [style.width]=\"col.width\" />\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th\n *ngIf=\"multiple\"\n style=\"width: 50px\">\n <s-table-header-checkbox\n [useAllObject]=\"lookupRowProps ? false : true\"\n [rowProps]=\"lookupRowProps\">\n </s-table-header-checkbox>\n </th>\n <th\n [style.width]=\"col.width\"\n *ngFor=\"let col of columns\"\n [pSortableColumn]=\"col.name\"\n [pSortableColumnDisabled]=\"sortableColumnsDisabled?.includes(col.name)\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.label }}</span>\n <p-sortIcon\n [field]=\"col.name\"\n *ngIf=\"!sortableColumnsDisabled?.includes(col.name)\">\n </p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template\n pTemplate=\"body\"\n let-rowData\n let-columns\n let-rowIndex=\"rowIndex\">\n <tr\n sNavigation\n [pSelectableRow]=\"rowData\"\n [pSelectableRowIndex]=\"rowIndex\"\n sDoubleClick (onDoubleClick)=\"onTableRowDoubleClick(rowData)\">\n <td\n *ngIf=\"multiple\"\n style=\"width: 50px\"\n tabindex=\"0\">\n <p-tableCheckbox\n [value]=\"rowData\"\n [pSelectableRow]=\"rowData\">\n </p-tableCheckbox>\n </td>\n <td\n [style.width]=\"col['width']\"\n *ngFor=\"let col of searchGridFields\"\n [ngSwitch]=\"col.type\"\n tabindex=\"0\">\n <ng-container *ngSwitchCase=\"'Boolean'\">\n <ng-container *ngIf=\"isBooleanValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getBooleanLabel(rowData, col.name, col.optionsLabel) }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Date'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate: col.calendarLocaleOptions?.dateFormat || \"L\" | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'DateTime'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'LocalDateTime'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedDate | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Time'\">\n <ng-container *ngIf=\"getFieldValue(rowData, col.name); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) | localizedTime: col.calendarLocaleOptions?.dateFormat || \"LTS\" | async }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Integer'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getIntegerMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Double'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getDoubleMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Money'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getMoneyMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Number'\">\n <ng-container *ngIf=\"isNumber(rowData, col.name); else emptyTemplate\">\n <span> {{ getFieldValue(rowData, col.name) | localizedBignumber: getNumberMaskConfig(col) | async }} </span>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'Enum'\">\n <ng-container *ngIf=\"getLabelForValue(getFieldValue(rowData, col.name), col.options); else emptyTemplate\">\n <ng-container *ngIf=\"getBadgeFromValue(getFieldValue(rowData, col.name), col.options); then withBadge; else withoutBadge\"></ng-container>\n <ng-template #withBadge>\n <s-badge\n [text]=\"getLabelForValue(getFieldValue(rowData, col.name), col.options)\"\n [color]=\"getBadgeFromValue(getFieldValue(rowData, col.name), col.options).color\"\n [type]=\"getBadgeFromValue(getFieldValue(rowData, col.name), col.options).type\"\n [iconClass]=\"getBadgeFromValue(getFieldValue(rowData, col.name), col.options).iconClass\"\n [iconPosition]=\"getBadgeFromValue(getFieldValue(rowData, col.name), col.options).iconPosition\">\n </s-badge>\n </ng-template>\n <ng-template #withoutBadge>\n <span> {{ getLabelForValue(getFieldValue(rowData, col.name), col.options) }} </span>\n </ng-template>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container *ngIf=\"col.mask && col.mask()\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name))\">\n <span>{{ getFieldValue(rowData, col.name) | sMaskFormatter: col.mask() }}</span>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!(col.mask && col.mask())\">\n <ng-container *ngIf=\"(isNumber(rowData, col.name) || getFieldValue(rowData, col.name)); else emptyTemplate\">\n <span>{{ getFieldValue(rowData, col.name) }}</span>\n </ng-container>\n </ng-container>\n </ng-container>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span [attr.data-hidden]=\"loading\">\n {{ printRecordTotalizer() }}\n </span>\n </ng-template>\n </p-table>\n </div>\n </div>\n <p-footer>\n <s-button\n [id]=\"id + '-select-button'\"\n type=\"button\"\n [label]=\"selectLabel || 'platform.angular_components.select' | translate\"\n (onClick)=\"select()\"\n sTooltip=\"(ALT + SHIFT + S)\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [disabled]=\"!selected?.length\">\n </s-button>\n <s-button\n [id]=\"id + '-cancel-button'\"\n type=\"button\"\n priority=\"link\"\n [label]=\"cancelLabel || 'platform.angular_components.cancel' | translate\"\n (onClick)=\"hideDialog()\"\n sTooltip=\"(ALT + SHIFT + C)\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n </s-button>\n </p-footer>\n</p-dialog>\n<ng-template #emptyTemplate>\n <span [ngClass]=\"'sds-empty-value'\">\n {{ emptyFieldLabel || 'platform.angular_components.not_informed' | translate }}\n </span>\n</ng-template>\n",
|
|
5748
5689
|
providers: [
|
|
5749
5690
|
{
|
|
5750
5691
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -9426,7 +9367,7 @@ var LookupFieldComponent = /** @class */ (function () {
|
|
|
9426
9367
|
], LookupFieldComponent.prototype, "formControl", void 0);
|
|
9427
9368
|
LookupFieldComponent = __decorate([
|
|
9428
9369
|
Component({
|
|
9429
|
-
template: "<s-field-label [field]=\"field\">\n\n<div [sTooltip]=\"field.tooltip\" tooltipPosition=\"top\" [showDelay]=\"500\">\n <s-lookup\n [id]=\"field.id || field.name\"\n [multiple]=\"field.multiple\"\n [formControl]=\"formControl\"\n [lookupSuggestions]=\"field.lookupSuggestions\"\n [dataKey]=\"field.dataKey\"\n [placeholder]=\"field.placeholder\"\n [showSearch]=\"field.showSearch\"\n [searchFields]=\"field.searchFields\"\n [searchGridFields]=\"field.searchGridFields\"\n [searchGridData]=\"field.gridData\"\n (onLookupRequest)=\"field.onLookupRequest($event)\"\n (onSearchRequest)=\"field.onSearchRequest($event)\"\n [lookupDisplayField]=\"field.lookupDisplayField\"\n [searchTotalRecords]=\"field.searchTotalRecords\"\n [searchTotalRecordsLabel]=\"field.searchTotalRecordsLabel\"\n [searchTitle]=\"field.searchTitle\"\n [selectLabel]=\"field.selectLabel\"\n [searchEmptyTitle]=\"field.searchEmptyTitle\"\n [filterLabel]=\"field.filterLabel\"\n [filterTitle]=\"field.filterTitle\"\n [clearLabel]=\"field.clearLabel\"\n [cancelLabel]=\"field.cancelLabel\"\n [emptyFieldLabel]=\"field.emptyFieldLabel\"\n (onSelect)=\"field.onSelect($event)\"\n (onUnselect)=\"field.onUnselect($event)\"\n (onClear)=\"field.onClear ? field.onClear($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [lookupAppendTo]=\"field.appendTo\"\n [lookupEmptyMessage]=\"field.emptyMessage\"\n [recordLabel]=\"field.recordLabel\"\n [recordsLabel]=\"field.recordsLabel\"\n [defaultFilter]=\"field.defaultFilter\"\n [autocompleteForceSelection]=\"field.autocompleteForceSelection\"\n [showAddOption]=\"field.showAddOption\"\n [showEditOption]=\"field.showEditOption\"\n [showRemoveOption]=\"field.showRemoveOption\"\n (onAdd)=\"field.onAdd()\"\n (onEdit)=\"field.onEdit($event)\"\n (onRemove)=\"field.onRemove($event)\"\n >\n </s-lookup>\n</div>\n"
|
|
9370
|
+
template: "<s-field-label [field]=\"field\"></s-field-label>\n\n<div [sTooltip]=\"field.tooltip\" tooltipPosition=\"top\" [showDelay]=\"500\">\n <s-lookup\n [id]=\"field.id || field.name\"\n [multiple]=\"field.multiple\"\n [formControl]=\"formControl\"\n [lookupSuggestions]=\"field.lookupSuggestions\"\n [dataKey]=\"field.dataKey\"\n [placeholder]=\"field.placeholder\"\n [showSearch]=\"field.showSearch\"\n [searchFields]=\"field.searchFields\"\n [searchGridFields]=\"field.searchGridFields\"\n [searchGridData]=\"field.gridData\"\n (onLookupRequest)=\"field.onLookupRequest($event)\"\n (onSearchRequest)=\"field.onSearchRequest($event)\"\n [lookupDisplayField]=\"field.lookupDisplayField\"\n [searchTotalRecords]=\"field.searchTotalRecords\"\n [searchTotalRecordsLabel]=\"field.searchTotalRecordsLabel\"\n [searchTitle]=\"field.searchTitle\"\n [selectLabel]=\"field.selectLabel\"\n [searchEmptyTitle]=\"field.searchEmptyTitle\"\n [filterLabel]=\"field.filterLabel\"\n [filterTitle]=\"field.filterTitle\"\n [clearLabel]=\"field.clearLabel\"\n [cancelLabel]=\"field.cancelLabel\"\n [emptyFieldLabel]=\"field.emptyFieldLabel\"\n (onSelect)=\"field.onSelect($event)\"\n (onUnselect)=\"field.onUnselect($event)\"\n (onClear)=\"field.onClear ? field.onClear($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [lookupAppendTo]=\"field.appendTo\"\n [lookupEmptyMessage]=\"field.emptyMessage\"\n [recordLabel]=\"field.recordLabel\"\n [recordsLabel]=\"field.recordsLabel\"\n [defaultFilter]=\"field.defaultFilter\"\n [autocompleteForceSelection]=\"field.autocompleteForceSelection\"\n [showAddOption]=\"field.showAddOption\"\n [showEditOption]=\"field.showEditOption\"\n [showRemoveOption]=\"field.showRemoveOption\"\n (onAdd)=\"field.onAdd()\"\n (onEdit)=\"field.onEdit($event)\"\n (onRemove)=\"field.onRemove($event)\"\n >\n </s-lookup>\n</div>\n"
|
|
9430
9371
|
})
|
|
9431
9372
|
], LookupFieldComponent);
|
|
9432
9373
|
return LookupFieldComponent;
|
|
@@ -11624,6 +11565,7 @@ var DynamicFormModule = /** @class */ (function () {
|
|
|
11624
11565
|
NgModule({
|
|
11625
11566
|
imports: [
|
|
11626
11567
|
AutoCompleteModule,
|
|
11568
|
+
BadgeModule,
|
|
11627
11569
|
BignumberInputModule,
|
|
11628
11570
|
ButtonModule,
|
|
11629
11571
|
CalendarMaskModule,
|