intelica-library-ui 0.1.186 → 0.1.188
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.
|
@@ -4809,19 +4809,13 @@ class TemplateMenuComponent {
|
|
|
4809
4809
|
}
|
|
4810
4810
|
onMouseDown(event) {
|
|
4811
4811
|
const target = event.target;
|
|
4812
|
-
if (target.closest(".p-datepicker") ||
|
|
4813
|
-
target.closest(".p-inputtext") ||
|
|
4814
|
-
target.closest(".p-select-panel") ||
|
|
4815
|
-
target.closest(".p-multiselect-panel")) {
|
|
4812
|
+
if (target.closest(".p-datepicker") || target.closest(".p-inputtext") || target.closest(".p-select-panel") || target.closest(".p-multiselect-panel")) {
|
|
4816
4813
|
this.IsClickInsideDatepicker = true;
|
|
4817
4814
|
}
|
|
4818
4815
|
}
|
|
4819
4816
|
onMouseDownOutsideBody(event) {
|
|
4820
4817
|
const target = event.target;
|
|
4821
|
-
if (target.closest(".p-datepicker") ||
|
|
4822
|
-
target.closest(".p-inputtext") ||
|
|
4823
|
-
target.closest(".p-select-panel") ||
|
|
4824
|
-
target.closest(".p-multiselect-panel")) {
|
|
4818
|
+
if (target.closest(".p-datepicker") || target.closest(".p-inputtext") || target.closest(".p-select-panel") || target.closest(".p-multiselect-panel") || target.closest(".swal2-container")) {
|
|
4825
4819
|
this.IsClickInsideDatepicker = true;
|
|
4826
4820
|
}
|
|
4827
4821
|
}
|
|
@@ -4839,9 +4833,7 @@ class TemplateMenuComponent {
|
|
|
4839
4833
|
// this.closePanel();
|
|
4840
4834
|
// return;
|
|
4841
4835
|
// }
|
|
4842
|
-
if (this.IsPopoverOpen &&
|
|
4843
|
-
this.PopoverContainer &&
|
|
4844
|
-
target === this.PopoverContainer.nativeElement) {
|
|
4836
|
+
if (this.IsPopoverOpen && this.PopoverContainer && target === this.PopoverContainer.nativeElement) {
|
|
4845
4837
|
this.closePanel();
|
|
4846
4838
|
return;
|
|
4847
4839
|
}
|
|
@@ -4883,13 +4875,10 @@ class TemplateMenuComponent {
|
|
|
4883
4875
|
if (this.IsClickInsideDatepicker) {
|
|
4884
4876
|
return;
|
|
4885
4877
|
}
|
|
4886
|
-
if (allowedClasses.some(
|
|
4878
|
+
if (allowedClasses.some(className => target.closest(`.${className}`))) {
|
|
4887
4879
|
return;
|
|
4888
4880
|
}
|
|
4889
|
-
if (this.Popover &&
|
|
4890
|
-
!this.Popover.nativeElement.contains(target) &&
|
|
4891
|
-
this.MenuButton &&
|
|
4892
|
-
!this.MenuButton.nativeElement.contains(target)) {
|
|
4881
|
+
if (this.Popover && !this.Popover.nativeElement.contains(target) && this.MenuButton && !this.MenuButton.nativeElement.contains(target)) {
|
|
4893
4882
|
this.closePanel();
|
|
4894
4883
|
}
|
|
4895
4884
|
}
|
|
@@ -4898,13 +4887,7 @@ class TemplateMenuComponent {
|
|
|
4898
4887
|
}
|
|
4899
4888
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: TemplateMenuComponent, decorators: [{
|
|
4900
4889
|
type: Component,
|
|
4901
|
-
args: [{ selector: "intelica-template-menu", imports: [
|
|
4902
|
-
ButtonModule,
|
|
4903
|
-
InputGroupAddonModule,
|
|
4904
|
-
CommonModule,
|
|
4905
|
-
RippleModule,
|
|
4906
|
-
TermPipe,
|
|
4907
|
-
], 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" }]
|
|
4890
|
+
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" }]
|
|
4908
4891
|
}], ctorParameters: () => [], propDecorators: { Popover: [{
|
|
4909
4892
|
type: ViewChild,
|
|
4910
4893
|
args: ["popover"]
|
|
@@ -6240,6 +6223,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
6240
6223
|
}]
|
|
6241
6224
|
}] });
|
|
6242
6225
|
|
|
6226
|
+
function darkenColor(input, amount = 0.2) {
|
|
6227
|
+
const clamp = (v) => Math.max(0, Math.min(255, v));
|
|
6228
|
+
const toHex = (v) => v.toString(16).padStart(2, '0');
|
|
6229
|
+
if (input.startsWith('#')) {
|
|
6230
|
+
const r = parseInt(input.slice(1, 3), 16);
|
|
6231
|
+
const g = parseInt(input.slice(3, 5), 16);
|
|
6232
|
+
const b = parseInt(input.slice(5, 7), 16);
|
|
6233
|
+
return `#${toHex(clamp(Math.round(r * (1 - amount))))}${toHex(clamp(Math.round(g * (1 - amount))))}${toHex(clamp(Math.round(b * (1 - amount))))}`;
|
|
6234
|
+
}
|
|
6235
|
+
const m = input.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/i);
|
|
6236
|
+
if (m) {
|
|
6237
|
+
const r = clamp(Math.round(+m[1] * (1 - amount)));
|
|
6238
|
+
const g = clamp(Math.round(+m[2] * (1 - amount)));
|
|
6239
|
+
const b = clamp(Math.round(+m[3] * (1 - amount)));
|
|
6240
|
+
const a = m[4] !== undefined ? `, ${m[4]}` : '';
|
|
6241
|
+
return `rgba(${r}, ${g}, ${b}${a})`;
|
|
6242
|
+
}
|
|
6243
|
+
return input;
|
|
6244
|
+
}
|
|
6245
|
+
|
|
6243
6246
|
class EchartService {
|
|
6244
6247
|
_sharedService = inject(SharedService);
|
|
6245
6248
|
/// Chart Generals
|
|
@@ -6393,14 +6396,33 @@ class EchartService {
|
|
|
6393
6396
|
* @param showLegend - Optional flag to show the legend
|
|
6394
6397
|
* @returns - EChartsOption - Configuration object for the bar chart
|
|
6395
6398
|
*/
|
|
6396
|
-
getBarChartHorizontalOptions(categories, series, labelConfig, tooltipConfig, showLegend = false
|
|
6399
|
+
getBarChartHorizontalOptions(categories, series, labelConfig, tooltipConfig, showLegend = false, enableSelectStyle = false // 👈 nuevo
|
|
6400
|
+
) {
|
|
6397
6401
|
let barBase = this.getBarChartOptions(categories, series, labelConfig, tooltipConfig, showLegend);
|
|
6398
6402
|
barBase.xAxis = this.getValueAxisConfiguration();
|
|
6399
6403
|
barBase.yAxis = this.getCategoryAxisConfiguration(categories);
|
|
6400
|
-
barBase.series.forEach(serie => {
|
|
6404
|
+
barBase.series.forEach((serie, idx) => {
|
|
6401
6405
|
if (serie.label) {
|
|
6402
6406
|
serie.label.position = "right";
|
|
6403
6407
|
}
|
|
6408
|
+
const baseColor = serie.itemStyle?.color ??
|
|
6409
|
+
(series[idx] && series[idx].color) ??
|
|
6410
|
+
'#FF8A00';
|
|
6411
|
+
serie.itemStyle = {
|
|
6412
|
+
...(serie.itemStyle || {}),
|
|
6413
|
+
color: baseColor,
|
|
6414
|
+
borderWidth: 0,
|
|
6415
|
+
};
|
|
6416
|
+
if (enableSelectStyle) {
|
|
6417
|
+
serie.selectedMode = 'single';
|
|
6418
|
+
const selectedColor = darkenColor(String(baseColor), 0.38);
|
|
6419
|
+
serie.select = {
|
|
6420
|
+
itemStyle: {
|
|
6421
|
+
color: selectedColor,
|
|
6422
|
+
borderWidth: 0,
|
|
6423
|
+
},
|
|
6424
|
+
};
|
|
6425
|
+
}
|
|
6404
6426
|
});
|
|
6405
6427
|
if (barBase.grid) {
|
|
6406
6428
|
barBase.grid.left = "10%";
|
|
@@ -6451,7 +6473,7 @@ class EchartService {
|
|
|
6451
6473
|
* @returns - EChartsOption - Configuration object for the bar chart
|
|
6452
6474
|
*/
|
|
6453
6475
|
getBarChartTopOptions(categories, series, categoryWidth = 240, labelConfig, tooltipConfig, showLegend = false, categoryFormatter) {
|
|
6454
|
-
const barBase = this.getBarChartHorizontalOptions(categories, series, labelConfig, tooltipConfig, showLegend);
|
|
6476
|
+
const barBase = this.getBarChartHorizontalOptions(categories, series, labelConfig, tooltipConfig, showLegend, true);
|
|
6455
6477
|
if (barBase.yAxis) {
|
|
6456
6478
|
const y = barBase.yAxis;
|
|
6457
6479
|
const gr = barBase.grid;
|