cat-qw-lib 0.59.4 → 0.59.6
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/fesm2022/cat-qw-lib.mjs
CHANGED
|
@@ -2546,12 +2546,15 @@ class WidgetAdminService extends BaseService {
|
|
|
2546
2546
|
*/
|
|
2547
2547
|
sanitizeStyleString(rawStyleStr) {
|
|
2548
2548
|
try {
|
|
2549
|
+
if (!rawStyleStr)
|
|
2550
|
+
return {};
|
|
2549
2551
|
rawStyleStr = rawStyleStr.replace(/""/g, '"');
|
|
2550
2552
|
rawStyleStr = rawStyleStr.replace(/([{,]\s*)([a-zA-Z0-9_]+)\s*:/g, '$1"$2":');
|
|
2551
|
-
|
|
2553
|
+
const parsed = JSON.parse(rawStyleStr);
|
|
2554
|
+
return typeof parsed === 'object' && parsed !== null ? parsed : null;
|
|
2552
2555
|
}
|
|
2553
2556
|
catch (err) {
|
|
2554
|
-
console.error('Failed to
|
|
2557
|
+
console.error('Failed to parse style string:', rawStyleStr, err);
|
|
2555
2558
|
return null;
|
|
2556
2559
|
}
|
|
2557
2560
|
}
|
|
@@ -2731,12 +2734,22 @@ class WidgetAdminFormComponent extends BaseFormComponent {
|
|
|
2731
2734
|
}
|
|
2732
2735
|
}
|
|
2733
2736
|
handleSubmit() {
|
|
2734
|
-
|
|
2737
|
+
if (typeof this.record.style === 'string') {
|
|
2738
|
+
const parsedStyle = this.service.sanitizeStyleString(this.record.style);
|
|
2739
|
+
this.record.style = parsedStyle ? parsedStyle : {};
|
|
2740
|
+
}
|
|
2735
2741
|
this.record.dataItems = this.record.dataItems.map((item) => {
|
|
2736
|
-
|
|
2742
|
+
if (typeof item.style === 'string') {
|
|
2743
|
+
const parsed = this.service.sanitizeStyleString(item.style);
|
|
2744
|
+
item.style = parsed ? parsed : {};
|
|
2745
|
+
}
|
|
2737
2746
|
return item;
|
|
2738
2747
|
});
|
|
2739
|
-
|
|
2748
|
+
// this.record.style = this.service.sanitizeStyleString(typeof this.record.style === 'string' ? this.record.style : SHARED.EMPTY) as unknown as string;
|
|
2749
|
+
// this.record.dataItems = this.record.dataItems.map((item) => {
|
|
2750
|
+
// item.style = this.service.sanitizeStyleString(typeof item.style === 'string' ? item.style : SHARED.EMPTY) as unknown as string;
|
|
2751
|
+
// return item;
|
|
2752
|
+
// });
|
|
2740
2753
|
super.handleSubmit();
|
|
2741
2754
|
}
|
|
2742
2755
|
ngOnDestroy() {
|
|
@@ -4358,11 +4371,11 @@ class WidgetItemComponent {
|
|
|
4358
4371
|
this.widgetStore.setOnWidgetItemClick(updatedItem);
|
|
4359
4372
|
}
|
|
4360
4373
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: WidgetItemComponent, deps: [{ token: StyleBuilderService }, { token: WidgetStore }, { token: WidgetQuery }], target: i0.ɵɵFactoryTarget.Component });
|
|
4361
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.4", type: WidgetItemComponent, isStandalone: false, selector: "lib-widget-item", inputs: { widgetItem: "widgetItem", widget: "widget", application: "application" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"widget-container\" [class.border-bottom]=\"hasSeparator\">\r\n <div class=\"widget-content\"\r\n [ngClass]=\"{\r\n 'layout-row': widget.layoutType === 'row',\r\n 'layout-tile m-0': widget.layoutType === 'tile'\r\n }\">\r\n <div class=\"flex align-items-center justify-content-between\">\r\n <div class=\"w-full\">\r\n <i *ngIf=\"keyIconClass\" classs=\"keyIconClass\" [ngStyle]=\"keyIconStyle\"></i>\r\n <p *ngIf=\"!isMenu\" [ngStyle]=\"fieldKeyStyle\" class=\"mb-0 text-color-secondary mr-3 key-field-wrapper
|
|
4374
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.4", type: WidgetItemComponent, isStandalone: false, selector: "lib-widget-item", inputs: { widgetItem: "widgetItem", widget: "widget", application: "application" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"widget-container\" [class.border-bottom]=\"hasSeparator\">\r\n <div class=\"widget-content\"\r\n [ngClass]=\"{\r\n 'layout-row': widget.layoutType === 'row',\r\n 'layout-tile m-0': widget.layoutType === 'tile'\r\n }\">\r\n <div class=\"flex align-items-center justify-content-between\" [ngClass]=\"widget.style.width !== 'col-12' ? 'w-50' : 'w-full'\">\r\n <div class=\"w-full\">\r\n <i *ngIf=\"keyIconClass\" classs=\"keyIconClass\" [ngStyle]=\"keyIconStyle\"></i>\r\n <p *ngIf=\"!isMenu\" [ngStyle]=\"fieldKeyStyle\" class=\"mb-0 text-color-secondary mr-3 key-field-wrapper\">{{ widgetItem?.key }}</p>\r\n <p *ngIf=\"isMenu\" [ngStyle]=\"fieldKeyStyle\" (click)=\"handleDynamicEvent(widget.recordId)\"\r\n class=\"mb-0 text-color-secondary mr-3 key-field-wrapper w-50\">{{ widgetItem?.key }}</p>\r\n </div>\r\n <div *ngIf=\"isConfirmed\">\r\n <i class=\"pi pi-check check-icon-wrapper\"></i>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mb-0 text-color font-semibold text-value-wrapper w-50\"\r\n [ngClass]=\"{\r\n 'flex align-items-center justify-content-end': widget.layoutType === 'row',\r\n 'w-50': widget.style.width !== 'col-12',\r\n 'w-full': widget.style.width === 'col-12'\r\n }\">\r\n <i *ngIf=\"valueIconClass\" classs=\"valueIconClass\" [ngStyle]=\"valueIconStyle\"></i>\r\n <p class=\"key-field-wrapper\">\r\n <ng-container *ngIf=\"widgetItem.isEvent; else notEvent\">\r\n <a\r\n class=\"cursor-pointer\"\r\n [ngStyle]=\"fieldValueStyle\"\r\n (click)=\"handleDynamicEvent(widget.recordId)\"\r\n >\r\n {{ widgetItem.value !== 'null' ? widgetItem.value : '' }}\r\n </a>\r\n </ng-container>\r\n\r\n <ng-template #notEvent>\r\n <ng-container *ngIf=\"widgetItem.isLink; else plainText\">\r\n <a\r\n class=\"cursor-pointer\"\r\n [ngStyle]=\"fieldValueStyle\"\r\n (click)=\"handleWidgetItemClick(widgetItem)\"\r\n >\r\n {{ widgetItem.value !== 'null' ? widgetItem.value : '' }}\r\n </a>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #plainText>\r\n <span [ngStyle]=\"fieldValueStyle\">\r\n {{ widgetItem.value !== 'null' ? widgetItem.value : '' }}\r\n </span>\r\n </ng-template>\r\n </p>\r\n </div>\r\n </div>\r\n</div>", styles: [".text-value-wrapper{-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;max-width:100%}.key-field-wrapper{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.w-50{width:50%!important}.map-icon-wrapper{font-size:16px;padding:13px;border-radius:30px;border:1px solid rgba(76,98,146,.1);background:#4c62920a}.address-title-wrapper{width:80%;word-break:break-word;margin-top:-12px}.border-bottom{border-bottom:1px solid rgba(76,98,146,.1)}.check-icon-wrapper{border-radius:50%;background:#22c55e;padding:8px}.widget-content.layout-row{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:.5rem}.widget-content.layout-tile{display:grid;grid-template-columns:1fr;grid-auto-rows:auto;row-gap:.5rem;align-items:start;margin:0}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
4362
4375
|
}
|
|
4363
4376
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: WidgetItemComponent, decorators: [{
|
|
4364
4377
|
type: Component,
|
|
4365
|
-
args: [{ selector: 'lib-widget-item', standalone: false, template: "<div class=\"widget-container\" [class.border-bottom]=\"hasSeparator\">\r\n <div class=\"widget-content\"\r\n [ngClass]=\"{\r\n 'layout-row': widget.layoutType === 'row',\r\n 'layout-tile m-0': widget.layoutType === 'tile'\r\n }\">\r\n <div class=\"flex align-items-center justify-content-between\">\r\n <div class=\"w-full\">\r\n <i *ngIf=\"keyIconClass\" classs=\"keyIconClass\" [ngStyle]=\"keyIconStyle\"></i>\r\n <p *ngIf=\"!isMenu\" [ngStyle]=\"fieldKeyStyle\" class=\"mb-0 text-color-secondary mr-3 key-field-wrapper
|
|
4378
|
+
args: [{ selector: 'lib-widget-item', standalone: false, template: "<div class=\"widget-container\" [class.border-bottom]=\"hasSeparator\">\r\n <div class=\"widget-content\"\r\n [ngClass]=\"{\r\n 'layout-row': widget.layoutType === 'row',\r\n 'layout-tile m-0': widget.layoutType === 'tile'\r\n }\">\r\n <div class=\"flex align-items-center justify-content-between\" [ngClass]=\"widget.style.width !== 'col-12' ? 'w-50' : 'w-full'\">\r\n <div class=\"w-full\">\r\n <i *ngIf=\"keyIconClass\" classs=\"keyIconClass\" [ngStyle]=\"keyIconStyle\"></i>\r\n <p *ngIf=\"!isMenu\" [ngStyle]=\"fieldKeyStyle\" class=\"mb-0 text-color-secondary mr-3 key-field-wrapper\">{{ widgetItem?.key }}</p>\r\n <p *ngIf=\"isMenu\" [ngStyle]=\"fieldKeyStyle\" (click)=\"handleDynamicEvent(widget.recordId)\"\r\n class=\"mb-0 text-color-secondary mr-3 key-field-wrapper w-50\">{{ widgetItem?.key }}</p>\r\n </div>\r\n <div *ngIf=\"isConfirmed\">\r\n <i class=\"pi pi-check check-icon-wrapper\"></i>\r\n </div>\r\n </div>\r\n\r\n <div class=\"mb-0 text-color font-semibold text-value-wrapper w-50\"\r\n [ngClass]=\"{\r\n 'flex align-items-center justify-content-end': widget.layoutType === 'row',\r\n 'w-50': widget.style.width !== 'col-12',\r\n 'w-full': widget.style.width === 'col-12'\r\n }\">\r\n <i *ngIf=\"valueIconClass\" classs=\"valueIconClass\" [ngStyle]=\"valueIconStyle\"></i>\r\n <p class=\"key-field-wrapper\">\r\n <ng-container *ngIf=\"widgetItem.isEvent; else notEvent\">\r\n <a\r\n class=\"cursor-pointer\"\r\n [ngStyle]=\"fieldValueStyle\"\r\n (click)=\"handleDynamicEvent(widget.recordId)\"\r\n >\r\n {{ widgetItem.value !== 'null' ? widgetItem.value : '' }}\r\n </a>\r\n </ng-container>\r\n\r\n <ng-template #notEvent>\r\n <ng-container *ngIf=\"widgetItem.isLink; else plainText\">\r\n <a\r\n class=\"cursor-pointer\"\r\n [ngStyle]=\"fieldValueStyle\"\r\n (click)=\"handleWidgetItemClick(widgetItem)\"\r\n >\r\n {{ widgetItem.value !== 'null' ? widgetItem.value : '' }}\r\n </a>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #plainText>\r\n <span [ngStyle]=\"fieldValueStyle\">\r\n {{ widgetItem.value !== 'null' ? widgetItem.value : '' }}\r\n </span>\r\n </ng-template>\r\n </p>\r\n </div>\r\n </div>\r\n</div>", styles: [".text-value-wrapper{-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;max-width:100%}.key-field-wrapper{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.w-50{width:50%!important}.map-icon-wrapper{font-size:16px;padding:13px;border-radius:30px;border:1px solid rgba(76,98,146,.1);background:#4c62920a}.address-title-wrapper{width:80%;word-break:break-word;margin-top:-12px}.border-bottom{border-bottom:1px solid rgba(76,98,146,.1)}.check-icon-wrapper{border-radius:50%;background:#22c55e;padding:8px}.widget-content.layout-row{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:.5rem}.widget-content.layout-tile{display:grid;grid-template-columns:1fr;grid-auto-rows:auto;row-gap:.5rem;align-items:start;margin:0}\n"] }]
|
|
4366
4379
|
}], ctorParameters: () => [{ type: StyleBuilderService }, { type: WidgetStore }, { type: WidgetQuery }], propDecorators: { widgetItem: [{
|
|
4367
4380
|
type: Input
|
|
4368
4381
|
}], widget: [{
|
|
@@ -4393,18 +4406,22 @@ class WidgetBodyComponent {
|
|
|
4393
4406
|
computeStylesForAll() {
|
|
4394
4407
|
if (!this.widget?.dataItems)
|
|
4395
4408
|
return;
|
|
4396
|
-
this.widget.dataItems.forEach((item) => {
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4409
|
+
// this.widget.dataItems.forEach((item: WidgetItem) => {
|
|
4410
|
+
// const base = this.styleBulderService.parseStyleObject(
|
|
4411
|
+
// typeof item.style.itemStyle === 'string' ? item.style.itemStyle : undefined
|
|
4412
|
+
// );
|
|
4413
|
+
// const expr = this.styleBulderService.parseStyleObject(
|
|
4414
|
+
// typeof item.style.styleExpression === 'string' ? item.style.styleExpression : undefined
|
|
4415
|
+
// );
|
|
4416
|
+
// item.style.computedStyle = { ...base, ...expr };
|
|
4417
|
+
// });
|
|
4401
4418
|
}
|
|
4402
4419
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: WidgetBodyComponent, deps: [{ token: StyleBuilderService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4403
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: WidgetBodyComponent, isStandalone: false, selector: "lib-widget-body", inputs: { widget: "widget" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"widget-body-container grid m-0\">\r\n <div *ngFor=\"let dataItem of widget?.dataItems || []; let i = index\" [ngClass]=\"widget.style.width\">\r\n @if(!dataItem.isHidden){\r\n <div [
|
|
4420
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: WidgetBodyComponent, isStandalone: false, selector: "lib-widget-body", inputs: { widget: "widget" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"widget-body-container grid m-0\">\r\n <div *ngFor=\"let dataItem of widget?.dataItems || []; let i = index\" [ngClass]=\"widget.style.width\">\r\n @if(!dataItem.isHidden){\r\n <div [ngClass]=\"{'widget-item-wrapper': (i !== ((widget.dataItems || []).length - 1)) && dataItem.style?.hasSeparator}\">\r\n <div [ngClass]=\"\r\n dataItem?.key === 'Vulnerability' && widget.predefinedName === 'ApplicantWidget'\r\n ? 'vulnerability-title-wrapper'\r\n : ( i !== ((widget.dataItems || []).length - 1) ? 'widget-wrapper' : 'widget-last-wrapper' )\r\n \" class=\"px-3\">\r\n <lib-widget-item [widgetItem]=\"dataItem\" [widget]=\"widget\"></lib-widget-item>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>", styles: [".widget-item-wrapper{border-bottom:1px solid rgba(68,72,109,.1)}.widget-wrapper{padding:10px 0}.widget-last-wrapper{padding:10px 0 0}.vulnerability-title-wrapper{background:#fb392d36}\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: "component", type: WidgetItemComponent, selector: "lib-widget-item", inputs: ["widgetItem", "widget", "application"] }] });
|
|
4404
4421
|
}
|
|
4405
4422
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: WidgetBodyComponent, decorators: [{
|
|
4406
4423
|
type: Component,
|
|
4407
|
-
args: [{ selector: 'lib-widget-body', standalone: false, template: "<div class=\"widget-body-container grid m-0\">\r\n <div *ngFor=\"let dataItem of widget?.dataItems || []; let i = index\" [ngClass]=\"widget.style.width\">\r\n @if(!dataItem.isHidden){\r\n <div [
|
|
4424
|
+
args: [{ selector: 'lib-widget-body', standalone: false, template: "<div class=\"widget-body-container grid m-0\">\r\n <div *ngFor=\"let dataItem of widget?.dataItems || []; let i = index\" [ngClass]=\"widget.style.width\">\r\n @if(!dataItem.isHidden){\r\n <div [ngClass]=\"{'widget-item-wrapper': (i !== ((widget.dataItems || []).length - 1)) && dataItem.style?.hasSeparator}\">\r\n <div [ngClass]=\"\r\n dataItem?.key === 'Vulnerability' && widget.predefinedName === 'ApplicantWidget'\r\n ? 'vulnerability-title-wrapper'\r\n : ( i !== ((widget.dataItems || []).length - 1) ? 'widget-wrapper' : 'widget-last-wrapper' )\r\n \" class=\"px-3\">\r\n <lib-widget-item [widgetItem]=\"dataItem\" [widget]=\"widget\"></lib-widget-item>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>", styles: [".widget-item-wrapper{border-bottom:1px solid rgba(68,72,109,.1)}.widget-wrapper{padding:10px 0}.widget-last-wrapper{padding:10px 0 0}.vulnerability-title-wrapper{background:#fb392d36}\n"] }]
|
|
4408
4425
|
}], ctorParameters: () => [{ type: StyleBuilderService }], propDecorators: { widget: [{
|
|
4409
4426
|
type: Input
|
|
4410
4427
|
}] } });
|