cat-qw-lib 2.3.33 → 2.3.34

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.
@@ -5439,6 +5439,7 @@ class WidgetHeaderComponent {
5439
5439
  subHeaderStyle = {};
5440
5440
  headerIconStyle = {};
5441
5441
  headerIconClass;
5442
+ processedBadges = [];
5442
5443
  constructor(styleBulderService) {
5443
5444
  this.styleBulderService = styleBulderService;
5444
5445
  }
@@ -5452,13 +5453,66 @@ class WidgetHeaderComponent {
5452
5453
  this.headerIconStyle = this.styleBulderService.getItemStyle(parsedHeaderIconStyle);
5453
5454
  this.headerIconClass = this.widget.style.headerIconClass;
5454
5455
  }
5456
+ // Process badges
5457
+ this.processBadges();
5458
+ }
5459
+ processBadges() {
5460
+ this.processedBadges = [];
5461
+ if (this.widget && this.widget.badges && Array.isArray(this.widget.badges)) {
5462
+ this.processedBadges = this.widget.badges.map((badge) => {
5463
+ const badgeStyle = badge.style || {};
5464
+ const processedBadge = {
5465
+ value: badge.value || '',
5466
+ valueClass: badgeStyle.valueClass || '',
5467
+ badgeStyle: {},
5468
+ valueIconClass: badgeStyle.valueIconClass,
5469
+ valueIconStyle: {},
5470
+ valueIconClassExpression: badgeStyle.valueIconClassExpression,
5471
+ valueIconStyleExpression: {},
5472
+ mergedValueIconStyle: {}
5473
+ };
5474
+ // Parse and apply badge styles
5475
+ if (badgeStyle.value) {
5476
+ const parsedValueStyle = this.styleBulderService.parseStyleObject(badgeStyle.value);
5477
+ processedBadge.badgeStyle = this.styleBulderService.getItemStyle(parsedValueStyle);
5478
+ }
5479
+ // Parse style expression if present
5480
+ if (badgeStyle.styleExpression) {
5481
+ const parsedStyleExpression = this.styleBulderService.parseStyleObject(badgeStyle.styleExpression);
5482
+ const styleExpressionObj = this.styleBulderService.getItemStyle(parsedStyleExpression);
5483
+ processedBadge.badgeStyle = { ...processedBadge.badgeStyle, ...styleExpressionObj };
5484
+ }
5485
+ // Parse item style if present
5486
+ if (badgeStyle.itemStyle) {
5487
+ const parsedItemStyle = this.styleBulderService.parseStyleObject(badgeStyle.itemStyle);
5488
+ const itemStyleObj = this.styleBulderService.getItemStyle(parsedItemStyle);
5489
+ processedBadge.badgeStyle = { ...processedBadge.badgeStyle, ...itemStyleObj };
5490
+ }
5491
+ // Parse value icon style
5492
+ if (badgeStyle.valueIconStyle) {
5493
+ const parsedValueIconStyle = this.styleBulderService.parseStyleObject(badgeStyle.valueIconStyle);
5494
+ processedBadge.valueIconStyle = this.styleBulderService.getItemStyle(parsedValueIconStyle);
5495
+ }
5496
+ // Parse value icon style expression
5497
+ if (badgeStyle.valueIconStyleExpression) {
5498
+ const parsedValueIconStyleExpression = this.styleBulderService.parseStyleObject(badgeStyle.valueIconStyleExpression);
5499
+ processedBadge.valueIconStyleExpression = this.styleBulderService.getItemStyle(parsedValueIconStyleExpression);
5500
+ }
5501
+ // Merge icon styles
5502
+ processedBadge.mergedValueIconStyle = {
5503
+ ...processedBadge.valueIconStyle,
5504
+ ...processedBadge.valueIconStyleExpression
5505
+ };
5506
+ return processedBadge;
5507
+ });
5508
+ }
5455
5509
  }
5456
5510
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WidgetHeaderComponent, deps: [{ token: StyleBuilderService }], target: i0.ɵɵFactoryTarget.Component });
5457
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: WidgetHeaderComponent, isStandalone: false, selector: "lib-widget-header", inputs: { widget: "widget" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"widget.header || widget.subHeader\" class=\"grid m-0 align-items-center justify-content-between px-3 pt-3\">\r\n <div class=\"col-12 p-0\">\r\n <div class=\"flex align-items-center\">\r\n <i [class]=\"headerIconClass\" [ngStyle]=\"headerIconStyle\"></i>\r\n <h3 [ngStyle]=\"headerStyle\" class=\"m-0 application-title-wrapper\">\r\n {{ (widget.header) }}\r\n </h3>\r\n </div>\r\n <div *ngIf=\"widget?.subHeader\" class=\"flex align-items-center mt-2\">\r\n <span [ngStyle]=\"subHeaderStyle\" class=\"mr-3 font-semibold\">{{ widget.subHeader }}</span>\r\n </div>\r\n </div>\r\n</div>", styles: ["::ng-deep .badge-wrapper .p-button{padding:4px 8px}.application-title-wrapper{font-size:16px;font-weight:600}.chart-container{display:flex;flex-direction:column;align-items:center;justify-content:center}@media screen and (min-width: 1200px) and (max-width: 1800px){.application-title-wrapper{font-size:14px}}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
5511
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: WidgetHeaderComponent, isStandalone: false, selector: "lib-widget-header", inputs: { widget: "widget" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"widget.header || widget.subHeader\" class=\"grid m-0 align-items-center justify-content-between px-3 pt-3\">\r\n <div class=\"col-12 p-0\">\r\n <div class=\"flex align-items-center\">\r\n <i [class]=\"headerIconClass\" [ngStyle]=\"headerIconStyle\"></i>\r\n <h3 [ngStyle]=\"headerStyle\" class=\"m-0 application-title-wrapper\">\r\n {{ (widget.header) }}\r\n </h3>\r\n\r\n <!-- Badges -->\r\n <div *ngIf=\"processedBadges && processedBadges.length > 0\" class=\"flex align-items-center ml-2\">\r\n <span *ngFor=\"let badge of processedBadges\" \r\n class=\"px-2 py-1 rounded font-semibold badge ml-2\"\r\n [ngClass]=\"badge.valueClass\"\r\n [ngStyle]=\"badge.badgeStyle\">\r\n <i *ngIf=\"badge.valueIconClass\" \r\n [ngClass]=\"badge.valueIconClass\" \r\n [ngStyle]=\"badge.mergedValueIconStyle\"\r\n class=\"mr-1\"></i>\r\n <i *ngIf=\"badge.valueIconClassExpression\" \r\n [ngClass]=\"badge.valueIconClassExpression\" \r\n [ngStyle]=\"badge.mergedValueIconStyle\"\r\n class=\"mr-1\"></i>\r\n {{ badge.value !== 'null' ? badge.value : '' }}\r\n </span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"widget?.subHeader\" class=\"flex align-items-center mt-2\">\r\n <span [ngStyle]=\"subHeaderStyle\" class=\"mr-3 font-semibold\">{{ widget.subHeader }}</span>\r\n </div>\r\n </div>\r\n</div>", styles: ["::ng-deep .badge-wrapper .p-button{padding:4px 8px}.application-title-wrapper{font-size:16px;font-weight:600}.chart-container{display:flex;flex-direction:column;align-items:center;justify-content:center}@media screen and (min-width: 1200px) and (max-width: 1800px){.application-title-wrapper{font-size:14px}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
5458
5512
  }
5459
5513
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WidgetHeaderComponent, decorators: [{
5460
5514
  type: Component,
5461
- args: [{ selector: 'lib-widget-header', standalone: false, template: "<div *ngIf=\"widget.header || widget.subHeader\" class=\"grid m-0 align-items-center justify-content-between px-3 pt-3\">\r\n <div class=\"col-12 p-0\">\r\n <div class=\"flex align-items-center\">\r\n <i [class]=\"headerIconClass\" [ngStyle]=\"headerIconStyle\"></i>\r\n <h3 [ngStyle]=\"headerStyle\" class=\"m-0 application-title-wrapper\">\r\n {{ (widget.header) }}\r\n </h3>\r\n </div>\r\n <div *ngIf=\"widget?.subHeader\" class=\"flex align-items-center mt-2\">\r\n <span [ngStyle]=\"subHeaderStyle\" class=\"mr-3 font-semibold\">{{ widget.subHeader }}</span>\r\n </div>\r\n </div>\r\n</div>", styles: ["::ng-deep .badge-wrapper .p-button{padding:4px 8px}.application-title-wrapper{font-size:16px;font-weight:600}.chart-container{display:flex;flex-direction:column;align-items:center;justify-content:center}@media screen and (min-width: 1200px) and (max-width: 1800px){.application-title-wrapper{font-size:14px}}\n"] }]
5515
+ args: [{ selector: 'lib-widget-header', standalone: false, template: "<div *ngIf=\"widget.header || widget.subHeader\" class=\"grid m-0 align-items-center justify-content-between px-3 pt-3\">\r\n <div class=\"col-12 p-0\">\r\n <div class=\"flex align-items-center\">\r\n <i [class]=\"headerIconClass\" [ngStyle]=\"headerIconStyle\"></i>\r\n <h3 [ngStyle]=\"headerStyle\" class=\"m-0 application-title-wrapper\">\r\n {{ (widget.header) }}\r\n </h3>\r\n\r\n <!-- Badges -->\r\n <div *ngIf=\"processedBadges && processedBadges.length > 0\" class=\"flex align-items-center ml-2\">\r\n <span *ngFor=\"let badge of processedBadges\" \r\n class=\"px-2 py-1 rounded font-semibold badge ml-2\"\r\n [ngClass]=\"badge.valueClass\"\r\n [ngStyle]=\"badge.badgeStyle\">\r\n <i *ngIf=\"badge.valueIconClass\" \r\n [ngClass]=\"badge.valueIconClass\" \r\n [ngStyle]=\"badge.mergedValueIconStyle\"\r\n class=\"mr-1\"></i>\r\n <i *ngIf=\"badge.valueIconClassExpression\" \r\n [ngClass]=\"badge.valueIconClassExpression\" \r\n [ngStyle]=\"badge.mergedValueIconStyle\"\r\n class=\"mr-1\"></i>\r\n {{ badge.value !== 'null' ? badge.value : '' }}\r\n </span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"widget?.subHeader\" class=\"flex align-items-center mt-2\">\r\n <span [ngStyle]=\"subHeaderStyle\" class=\"mr-3 font-semibold\">{{ widget.subHeader }}</span>\r\n </div>\r\n </div>\r\n</div>", styles: ["::ng-deep .badge-wrapper .p-button{padding:4px 8px}.application-title-wrapper{font-size:16px;font-weight:600}.chart-container{display:flex;flex-direction:column;align-items:center;justify-content:center}@media screen and (min-width: 1200px) and (max-width: 1800px){.application-title-wrapper{font-size:14px}}\n"] }]
5462
5516
  }], ctorParameters: () => [{ type: StyleBuilderService }], propDecorators: { widget: [{
5463
5517
  type: Input
5464
5518
  }] } });