intelica-library-ui 0.1.105 → 0.1.107
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.
|
@@ -2674,63 +2674,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
2674
2674
|
}] } });
|
|
2675
2675
|
|
|
2676
2676
|
class TemplateMenuComponent {
|
|
2677
|
-
termPipe;
|
|
2678
2677
|
GlobalTermService = inject(GlobalTermService);
|
|
2679
2678
|
Popover;
|
|
2680
2679
|
MenuButton;
|
|
2681
2680
|
PopoverContainer;
|
|
2682
|
-
|
|
2681
|
+
openPanelEvent = new EventEmitter();
|
|
2682
|
+
closePanelEvent = new EventEmitter();
|
|
2683
2683
|
IsPopoverOpen = false;
|
|
2684
2684
|
IsClickInsideDatepicker = false;
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
* @type {boolean}
|
|
2688
|
-
* @default false
|
|
2689
|
-
*/
|
|
2690
|
-
ShowActionsMenu = false;
|
|
2691
|
-
/**
|
|
2692
|
-
* Indica si la sección de selección de acciones está visible o no.
|
|
2693
|
-
* @type {boolean}
|
|
2694
|
-
* @default false
|
|
2695
|
-
*/
|
|
2696
|
-
ShowSelectActions = false;
|
|
2697
|
-
constructor(termPipe) {
|
|
2698
|
-
this.termPipe = termPipe;
|
|
2699
|
-
}
|
|
2700
|
-
ngOnInit() {
|
|
2701
|
-
// const specificRegex = /local.*filt|filt.*local/i;
|
|
2702
|
-
// const generalRegex = /filt/i;
|
|
2703
|
-
// const specificResults = this.actions.filter(action => specificRegex.test(action.name));
|
|
2704
|
-
// if (specificResults.length === 0) {
|
|
2705
|
-
// const generalResults = this.actions.filter(action => generalRegex.test(action.name));
|
|
2706
|
-
// generalResults.forEach(action => this.showTemplate(action));
|
|
2707
|
-
// } else {
|
|
2708
|
-
// specificResults.forEach(action => this.showTemplate(action));
|
|
2709
|
-
// }
|
|
2710
|
-
}
|
|
2711
|
-
openPopover() {
|
|
2685
|
+
constructor() { }
|
|
2686
|
+
openPanel() {
|
|
2712
2687
|
this.IsPopoverOpen = true;
|
|
2713
|
-
// Cambia el estado de visibilidad del menú de acciones.
|
|
2714
|
-
this.ShowActionsMenu = true;
|
|
2715
|
-
// Muestra u oculta el menú de selección de acciones.
|
|
2716
|
-
this.ShowSelectActions = true;
|
|
2717
2688
|
this.Popover.nativeElement.style.display = "block";
|
|
2718
2689
|
this.MenuButton.nativeElement.classList.add("active");
|
|
2719
2690
|
this.PopoverContainer.nativeElement.classList.add("backdrop-visible");
|
|
2691
|
+
this.openPanelEvent.emit({ open: this.IsPopoverOpen, element: this.Popover.nativeElement });
|
|
2720
2692
|
}
|
|
2721
|
-
|
|
2693
|
+
closePanel() {
|
|
2722
2694
|
this.IsPopoverOpen = false;
|
|
2723
|
-
// Cambia el estado de visibilidad del menú de acciones.
|
|
2724
|
-
this.ShowActionsMenu = false;
|
|
2725
|
-
// Muestra u oculta el menú de selección de acciones.
|
|
2726
|
-
this.ShowSelectActions = true;
|
|
2727
2695
|
this.Popover.nativeElement.style.display = "none";
|
|
2728
2696
|
this.MenuButton.nativeElement.classList.remove("active");
|
|
2729
2697
|
this.PopoverContainer.nativeElement.classList.remove("backdrop-visible");
|
|
2698
|
+
this.closePanelEvent.emit({ open: this.IsPopoverOpen, element: this.Popover.nativeElement });
|
|
2730
2699
|
}
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
this.IsPopoverOpen ? this.
|
|
2700
|
+
togglePanel(event) {
|
|
2701
|
+
console.log("togglePanel", event);
|
|
2702
|
+
this.IsPopoverOpen ? this.closePanel() : this.openPanel();
|
|
2734
2703
|
}
|
|
2735
2704
|
onMouseDown(event) {
|
|
2736
2705
|
const target = event.target;
|
|
@@ -2753,11 +2722,9 @@ class TemplateMenuComponent {
|
|
|
2753
2722
|
if (!event)
|
|
2754
2723
|
return;
|
|
2755
2724
|
const target = event.target;
|
|
2756
|
-
// clases que fuerzan el cierre del popover
|
|
2757
2725
|
const forceCloseClasses = ["closePopoverNow", "closeTemplateMenu"];
|
|
2758
|
-
// Si se da clic en una clase que debe cerrar sí o sí
|
|
2759
2726
|
if (forceCloseClasses.some(className => target.closest(`.${className}`))) {
|
|
2760
|
-
this.
|
|
2727
|
+
this.closePanel();
|
|
2761
2728
|
return;
|
|
2762
2729
|
}
|
|
2763
2730
|
const allowedClasses = [
|
|
@@ -2802,16 +2769,16 @@ class TemplateMenuComponent {
|
|
|
2802
2769
|
return;
|
|
2803
2770
|
}
|
|
2804
2771
|
if (this.Popover && !this.Popover.nativeElement.contains(target) && this.MenuButton && !this.MenuButton.nativeElement.contains(target)) {
|
|
2805
|
-
this.
|
|
2772
|
+
this.closePanel();
|
|
2806
2773
|
}
|
|
2807
2774
|
}
|
|
2808
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TemplateMenuComponent, deps: [
|
|
2809
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: TemplateMenuComponent, isStandalone: true, selector: "intelica-template-menu", host: { listeners: { "mousedown": "onMouseDown($event)", "window:mousedown": "onMouseDownOutsideBody($event)", "mouseup": "onMouseUp($event)", "document:click": "closeAll($event)" } },
|
|
2775
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TemplateMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2776
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: TemplateMenuComponent, isStandalone: true, selector: "intelica-template-menu", outputs: { openPanelEvent: "onOpen", closePanelEvent: "onClose" }, host: { listeners: { "mousedown": "onMouseDown($event)", "window:mousedown": "onMouseDownOutsideBody($event)", "mouseup": "onMouseUp($event)", "document:click": "closeAll($event)" } }, viewQueries: [{ propertyName: "Popover", first: true, predicate: ["popover"], descendants: true }, { propertyName: "MenuButton", first: true, predicate: ["menuButton"], descendants: true }, { propertyName: "PopoverContainer", first: true, predicate: ["popoverContainer"], descendants: true }], ngImport: i0, template: "<div #popoverContainer class=\"grPopoverContainer\">\r\n\t<button #menuButton class=\"grMenuTemplate\" (click)=\"togglePanel($event)\">\r\n\t\t<span class=\"grMenuTemplate__ico\"><i class=\"icon icon-filter-option\"></i></span>\r\n\t\t<span class=\"grMenuTemplate__txt\">{{ \"Filters\" | term : GlobalTermService.languageCode }}</span>\r\n\t</button>\r\n\t<div class=\"grPopover\" #popover>\r\n\t\t<div class=\"grPopoverMenu\" [ngClass]=\"{ hidden: !IsPopoverOpen }\">\r\n\t\t\t<div class=\"grPopoverHeader\">\r\n\t\t\t\t<h3>\r\n\t\t\t\t\t<span>{{ \"Filters\" | term : GlobalTermService.languageCode }}</span>\r\n\t\t\t\t</h3>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"grPopoverBody grPopoverBody--template\">\r\n\t\t\t\t<ng-content></ng-content>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: InputGroupAddonModule }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: RippleModule }, { kind: "pipe", type: TermPipe, name: "term" }] });
|
|
2810
2777
|
}
|
|
2811
2778
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TemplateMenuComponent, decorators: [{
|
|
2812
2779
|
type: Component,
|
|
2813
|
-
args: [{ selector: "intelica-template-menu", imports: [ButtonModule, InputGroupAddonModule, CommonModule, RippleModule, TermPipe], template: "<div #popoverContainer class=\"grPopoverContainer\">\r\n\t<button #menuButton class=\"grMenuTemplate\" (click)=\"
|
|
2814
|
-
}], ctorParameters: () => [
|
|
2780
|
+
args: [{ selector: "intelica-template-menu", imports: [ButtonModule, InputGroupAddonModule, CommonModule, RippleModule, TermPipe], template: "<div #popoverContainer class=\"grPopoverContainer\">\r\n\t<button #menuButton class=\"grMenuTemplate\" (click)=\"togglePanel($event)\">\r\n\t\t<span class=\"grMenuTemplate__ico\"><i class=\"icon icon-filter-option\"></i></span>\r\n\t\t<span class=\"grMenuTemplate__txt\">{{ \"Filters\" | term : GlobalTermService.languageCode }}</span>\r\n\t</button>\r\n\t<div class=\"grPopover\" #popover>\r\n\t\t<div class=\"grPopoverMenu\" [ngClass]=\"{ hidden: !IsPopoverOpen }\">\r\n\t\t\t<div class=\"grPopoverHeader\">\r\n\t\t\t\t<h3>\r\n\t\t\t\t\t<span>{{ \"Filters\" | term : GlobalTermService.languageCode }}</span>\r\n\t\t\t\t</h3>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"grPopoverBody grPopoverBody--template\">\r\n\t\t\t\t<ng-content></ng-content>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n</div>\r\n" }]
|
|
2781
|
+
}], ctorParameters: () => [], propDecorators: { Popover: [{
|
|
2815
2782
|
type: ViewChild,
|
|
2816
2783
|
args: ["popover"]
|
|
2817
2784
|
}], MenuButton: [{
|
|
@@ -2820,9 +2787,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
2820
2787
|
}], PopoverContainer: [{
|
|
2821
2788
|
type: ViewChild,
|
|
2822
2789
|
args: ["popoverContainer"]
|
|
2823
|
-
}],
|
|
2824
|
-
type:
|
|
2825
|
-
args: ["
|
|
2790
|
+
}], openPanelEvent: [{
|
|
2791
|
+
type: Output,
|
|
2792
|
+
args: ["onOpen"]
|
|
2793
|
+
}], closePanelEvent: [{
|
|
2794
|
+
type: Output,
|
|
2795
|
+
args: ["onClose"]
|
|
2826
2796
|
}], onMouseDown: [{
|
|
2827
2797
|
type: HostListener,
|
|
2828
2798
|
args: ["mousedown", ["$event"]]
|
|
@@ -3480,10 +3450,14 @@ class EchartService {
|
|
|
3480
3450
|
* @returns - Tooltip HTML string
|
|
3481
3451
|
*/
|
|
3482
3452
|
getTooltipFormatter(color, title, body) {
|
|
3483
|
-
|
|
3484
|
-
|
|
3453
|
+
const titleHtml = title.length > 0
|
|
3454
|
+
? `
|
|
3485
3455
|
<b style=" font-size: 13px;">${title} </b><br>
|
|
3486
|
-
<hr style="border: 1px solid ${color}; margin: 4px 0;"
|
|
3456
|
+
<hr style="border: 1px solid ${color}; margin: 4px 0;">`
|
|
3457
|
+
: "";
|
|
3458
|
+
return `
|
|
3459
|
+
<div style="font-size: 12px; boder-color: ${color}; color: ${color}; border-radius: 6px; min-width: 120px; text-align: center;">
|
|
3460
|
+
${titleHtml}
|
|
3487
3461
|
${body}
|
|
3488
3462
|
</div>
|
|
3489
3463
|
`;
|
|
@@ -3509,7 +3483,7 @@ class EchartService {
|
|
|
3509
3483
|
name: item.name,
|
|
3510
3484
|
itemStyle: { color: item.color },
|
|
3511
3485
|
data: item.value,
|
|
3512
|
-
barWidth: "
|
|
3486
|
+
// barWidth: "33%",
|
|
3513
3487
|
barGap: "0%",
|
|
3514
3488
|
label: {
|
|
3515
3489
|
show: true,
|
|
@@ -3543,8 +3517,8 @@ class EchartService {
|
|
|
3543
3517
|
getBarChartStackOptions(categories, series, labelConfig, tooltipConfig, showLegend = false) {
|
|
3544
3518
|
let barBase = this.getBarChartOptions(categories, series, labelConfig, tooltipConfig, showLegend);
|
|
3545
3519
|
barBase.series.forEach((serie, index) => {
|
|
3546
|
-
serie.barWidth = "50%";
|
|
3547
|
-
serie.barGap = "0%";
|
|
3520
|
+
// serie.barWidth = "50%";
|
|
3521
|
+
// serie.barGap = "0%";
|
|
3548
3522
|
serie.barCategoryGap = "10%";
|
|
3549
3523
|
serie.stack = "total";
|
|
3550
3524
|
if (index < series.length - 1) {
|
|
@@ -3591,8 +3565,8 @@ class EchartService {
|
|
|
3591
3565
|
getBarChartHorizontalStackOptions(categories, series, labelConfig, tooltipConfig, showLegend = false) {
|
|
3592
3566
|
let barBase = this.getBarChartHorizontalOptions(categories, series, labelConfig, tooltipConfig, showLegend);
|
|
3593
3567
|
barBase.series.forEach((serie, index) => {
|
|
3594
|
-
serie.barWidth = "50%";
|
|
3595
|
-
serie.barGap = "0%";
|
|
3568
|
+
// serie.barWidth = "50%";
|
|
3569
|
+
// serie.barGap = "0%";
|
|
3596
3570
|
serie.barCategoryGap = "10%";
|
|
3597
3571
|
serie.stack = "total";
|
|
3598
3572
|
if (serie.label) {
|
|
@@ -3638,7 +3612,7 @@ class EchartService {
|
|
|
3638
3612
|
barBase.grid.containLabel = true;
|
|
3639
3613
|
}
|
|
3640
3614
|
barBase.series.forEach((serie, index) => {
|
|
3641
|
-
serie.barWidth = "75%";
|
|
3615
|
+
// serie.barWidth = "75%";
|
|
3642
3616
|
});
|
|
3643
3617
|
return barBase;
|
|
3644
3618
|
}
|