cat-qw-lib 2.3.33 → 2.3.35

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,12 @@ class WidgetHeaderComponent {
5439
5439
  subHeaderStyle = {};
5440
5440
  headerIconStyle = {};
5441
5441
  headerIconClass;
5442
+ processedBadges = [];
5443
+ widgetStatusIconClass;
5444
+ widgetStatusIconClassExpression;
5445
+ widgetStatusIconStyle = {};
5446
+ widgetStatusIconStyleExpression = {};
5447
+ mergedWidgetStatusIconStyle = {};
5442
5448
  constructor(styleBulderService) {
5443
5449
  this.styleBulderService = styleBulderService;
5444
5450
  }
@@ -5452,13 +5458,97 @@ class WidgetHeaderComponent {
5452
5458
  this.headerIconStyle = this.styleBulderService.getItemStyle(parsedHeaderIconStyle);
5453
5459
  this.headerIconClass = this.widget.style.headerIconClass;
5454
5460
  }
5461
+ // Process widget status icon
5462
+ this.processWidgetStatusIcon();
5463
+ // Process badges
5464
+ this.processBadges();
5465
+ }
5466
+ processWidgetStatusIcon() {
5467
+ // Process widget status icon class (static)
5468
+ this.widgetStatusIconClass = this.widget?.widgetStatusIconClass || '';
5469
+ // Process widget status icon class expression (dynamic)
5470
+ this.widgetStatusIconClassExpression = this.widget?.widgetStatusIconClassExpression
5471
+ ? this.widget.widgetStatusIconClassExpression.replace(/^['"]+|['"]+$/g, '')
5472
+ : '';
5473
+ // Process widget status icon style (static)
5474
+ if (this.widget?.widgetStatusIconStyle) {
5475
+ const parsedWidgetStatusIconStyle = this.styleBulderService.parseStyleObject(this.widget.widgetStatusIconStyle);
5476
+ this.widgetStatusIconStyle = this.styleBulderService.getItemStyle(parsedWidgetStatusIconStyle);
5477
+ }
5478
+ else {
5479
+ this.widgetStatusIconStyle = {};
5480
+ }
5481
+ // Process widget status icon style expression (dynamic)
5482
+ if (this.widget?.widgetStatusIconStyleExpression) {
5483
+ const parsedWidgetStatusIconStyleExpression = this.styleBulderService.parseStyleObject(this.widget.widgetStatusIconStyleExpression);
5484
+ this.widgetStatusIconStyleExpression = this.styleBulderService.getItemStyle(parsedWidgetStatusIconStyleExpression);
5485
+ }
5486
+ else {
5487
+ this.widgetStatusIconStyleExpression = {};
5488
+ }
5489
+ // Merge icon styles
5490
+ this.mergedWidgetStatusIconStyle = {
5491
+ ...this.widgetStatusIconStyle,
5492
+ ...this.widgetStatusIconStyleExpression
5493
+ };
5494
+ }
5495
+ processBadges() {
5496
+ this.processedBadges = [];
5497
+ if (this.widget && this.widget.badges && Array.isArray(this.widget.badges)) {
5498
+ this.processedBadges = this.widget.badges.map((badge) => {
5499
+ const badgeStyle = badge.style || {};
5500
+ const processedBadge = {
5501
+ value: badge.value || '',
5502
+ valueClass: badgeStyle.valueClass || '',
5503
+ badgeStyle: {},
5504
+ valueIconClass: badgeStyle.valueIconClass,
5505
+ valueIconStyle: {},
5506
+ valueIconClassExpression: badgeStyle.valueIconClassExpression,
5507
+ valueIconStyleExpression: {},
5508
+ mergedValueIconStyle: {}
5509
+ };
5510
+ // Parse and apply badge styles
5511
+ if (badgeStyle.value) {
5512
+ const parsedValueStyle = this.styleBulderService.parseStyleObject(badgeStyle.value);
5513
+ processedBadge.badgeStyle = this.styleBulderService.getItemStyle(parsedValueStyle);
5514
+ }
5515
+ // Parse style expression if present
5516
+ if (badgeStyle.styleExpression) {
5517
+ const parsedStyleExpression = this.styleBulderService.parseStyleObject(badgeStyle.styleExpression);
5518
+ const styleExpressionObj = this.styleBulderService.getItemStyle(parsedStyleExpression);
5519
+ processedBadge.badgeStyle = { ...processedBadge.badgeStyle, ...styleExpressionObj };
5520
+ }
5521
+ // Parse item style if present
5522
+ if (badgeStyle.itemStyle) {
5523
+ const parsedItemStyle = this.styleBulderService.parseStyleObject(badgeStyle.itemStyle);
5524
+ const itemStyleObj = this.styleBulderService.getItemStyle(parsedItemStyle);
5525
+ processedBadge.badgeStyle = { ...processedBadge.badgeStyle, ...itemStyleObj };
5526
+ }
5527
+ // Parse value icon style
5528
+ if (badgeStyle.valueIconStyle) {
5529
+ const parsedValueIconStyle = this.styleBulderService.parseStyleObject(badgeStyle.valueIconStyle);
5530
+ processedBadge.valueIconStyle = this.styleBulderService.getItemStyle(parsedValueIconStyle);
5531
+ }
5532
+ // Parse value icon style expression
5533
+ if (badgeStyle.valueIconStyleExpression) {
5534
+ const parsedValueIconStyleExpression = this.styleBulderService.parseStyleObject(badgeStyle.valueIconStyleExpression);
5535
+ processedBadge.valueIconStyleExpression = this.styleBulderService.getItemStyle(parsedValueIconStyleExpression);
5536
+ }
5537
+ // Merge icon styles
5538
+ processedBadge.mergedValueIconStyle = {
5539
+ ...processedBadge.valueIconStyle,
5540
+ ...processedBadge.valueIconStyleExpression
5541
+ };
5542
+ return processedBadge;
5543
+ });
5544
+ }
5455
5545
  }
5456
5546
  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"] }] });
5547
+ 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 justify-content-between\">\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\r\n <!-- Widget Status Icon -->\r\n <div class=\"flex align-items-center\">\r\n <i *ngIf=\"widgetStatusIconClass\" [ngClass]=\"widgetStatusIconClass\" [ngStyle]=\"mergedWidgetStatusIconStyle\"></i>\r\n <i *ngIf=\"widgetStatusIconClassExpression\" [ngClass]=\"widgetStatusIconClassExpression\" [ngStyle]=\"mergedWidgetStatusIconStyle\"></i>\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
5548
  }
5459
5549
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WidgetHeaderComponent, decorators: [{
5460
5550
  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"] }]
5551
+ 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 justify-content-between\">\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\r\n <!-- Widget Status Icon -->\r\n <div class=\"flex align-items-center\">\r\n <i *ngIf=\"widgetStatusIconClass\" [ngClass]=\"widgetStatusIconClass\" [ngStyle]=\"mergedWidgetStatusIconStyle\"></i>\r\n <i *ngIf=\"widgetStatusIconClassExpression\" [ngClass]=\"widgetStatusIconClassExpression\" [ngStyle]=\"mergedWidgetStatusIconStyle\"></i>\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
5552
  }], ctorParameters: () => [{ type: StyleBuilderService }], propDecorators: { widget: [{
5463
5553
  type: Input
5464
5554
  }] } });