cat-qw-lib 2.3.30 → 2.3.31
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
|
@@ -3723,6 +3723,7 @@ class WidgetModel extends BaseModel {
|
|
|
3723
3723
|
name;
|
|
3724
3724
|
apiConfigId;
|
|
3725
3725
|
dataItems = [];
|
|
3726
|
+
badges = [];
|
|
3726
3727
|
order;
|
|
3727
3728
|
headerDictionaryID;
|
|
3728
3729
|
subHeaderDictionaryID;
|
|
@@ -3742,6 +3743,14 @@ class WidgetItemModel extends BaseModel {
|
|
|
3742
3743
|
style;
|
|
3743
3744
|
isActive = true;
|
|
3744
3745
|
}
|
|
3746
|
+
/**
|
|
3747
|
+
* BadgeModel class represents the model of a badge.
|
|
3748
|
+
*/
|
|
3749
|
+
class BadgeModel {
|
|
3750
|
+
dictionaryItemID;
|
|
3751
|
+
dictionaryID;
|
|
3752
|
+
style;
|
|
3753
|
+
}
|
|
3745
3754
|
|
|
3746
3755
|
/**
|
|
3747
3756
|
* Widget Admin Query
|
|
@@ -3778,6 +3787,7 @@ class WidgetAdminFormComponent extends BaseFormComponent {
|
|
|
3778
3787
|
headerDictionaryItems = [];
|
|
3779
3788
|
subHeaderDictionaryItems = [];
|
|
3780
3789
|
dictionaryItemArray = [];
|
|
3790
|
+
badgeDictionaryItemArray = [];
|
|
3781
3791
|
widgetOptionsArray = [];
|
|
3782
3792
|
widgetLayoutTypeList = widgetLayoutTypeList;
|
|
3783
3793
|
constructor(service, validatorService, widgetStore, query, router, activatedRoute, baseStore, baseQuery) {
|
|
@@ -3806,6 +3816,11 @@ class WidgetAdminFormComponent extends BaseFormComponent {
|
|
|
3806
3816
|
this.handleWidgetItemDictionarySelect(item.dictionaryID, index);
|
|
3807
3817
|
});
|
|
3808
3818
|
}
|
|
3819
|
+
if (record?.badges?.length > 0) {
|
|
3820
|
+
record.badges.forEach((badge, index) => {
|
|
3821
|
+
this.handleBadgeDictionarySelect(badge.dictionaryID, index);
|
|
3822
|
+
});
|
|
3823
|
+
}
|
|
3809
3824
|
});
|
|
3810
3825
|
}
|
|
3811
3826
|
handleWidgetItemAddBtnClick() {
|
|
@@ -3851,6 +3866,38 @@ class WidgetAdminFormComponent extends BaseFormComponent {
|
|
|
3851
3866
|
this.dictionaryItemArray[index] = allDictionaryItemRecords?.filter((item) => item.dictionaryID === dictionaryId) || [];
|
|
3852
3867
|
});
|
|
3853
3868
|
}
|
|
3869
|
+
handleBadgeAddBtnClick() {
|
|
3870
|
+
if (!(this.record.name && this.record.apiConfigId))
|
|
3871
|
+
return;
|
|
3872
|
+
if (Array.isArray(this.record.badges)) {
|
|
3873
|
+
const hasEmptyBadge = this.record.badges.some((badge) => {
|
|
3874
|
+
const isDictionaryEmpty = !badge.dictionaryID || badge.dictionaryID.trim() === SHARED.EMPTY;
|
|
3875
|
+
const isDictionaryItemEmpty = !badge.dictionaryItemID || badge.dictionaryItemID.trim() === SHARED.EMPTY;
|
|
3876
|
+
return isDictionaryItemEmpty && isDictionaryEmpty;
|
|
3877
|
+
});
|
|
3878
|
+
if (hasEmptyBadge) {
|
|
3879
|
+
return;
|
|
3880
|
+
}
|
|
3881
|
+
}
|
|
3882
|
+
else {
|
|
3883
|
+
this.record.badges = [];
|
|
3884
|
+
}
|
|
3885
|
+
this.record.badges = [...this.record.badges, new BadgeModel()];
|
|
3886
|
+
}
|
|
3887
|
+
handleBadgeDictionarySelect(dictionaryId, index) {
|
|
3888
|
+
this.query.getLists().subscribe((allLists) => {
|
|
3889
|
+
const allDictionaryItemRecords = allLists.find((list) => list.forProperty === 'dictionaryItemID')?.records;
|
|
3890
|
+
this.badgeDictionaryItemArray[index] = allDictionaryItemRecords?.filter((item) => item.dictionaryID === dictionaryId) || [];
|
|
3891
|
+
});
|
|
3892
|
+
}
|
|
3893
|
+
handleDeleteBadge(index) {
|
|
3894
|
+
if (index >= 0 && index < this.record.badges.length) {
|
|
3895
|
+
this.record.badges = this.record.badges.filter((_, i) => i !== index);
|
|
3896
|
+
}
|
|
3897
|
+
else {
|
|
3898
|
+
console.error(ERROR.INVALID_INDEX, index);
|
|
3899
|
+
}
|
|
3900
|
+
}
|
|
3854
3901
|
handleDeleteRecord(index) {
|
|
3855
3902
|
if (index >= 0 && index < this.record.dataItems.length) {
|
|
3856
3903
|
this.record.dataItems = this.record.dataItems.filter((_, i) => i !== index);
|
|
@@ -3871,6 +3918,15 @@ class WidgetAdminFormComponent extends BaseFormComponent {
|
|
|
3871
3918
|
}
|
|
3872
3919
|
return item;
|
|
3873
3920
|
});
|
|
3921
|
+
if (this.record.badges) {
|
|
3922
|
+
this.record.badges = this.record.badges.map((badge) => {
|
|
3923
|
+
if (typeof badge.style === 'string') {
|
|
3924
|
+
const parsed = this.service.sanitizeStyleString(badge.style);
|
|
3925
|
+
badge.style = parsed ? parsed : {};
|
|
3926
|
+
}
|
|
3927
|
+
return badge;
|
|
3928
|
+
});
|
|
3929
|
+
}
|
|
3874
3930
|
super.handleSubmit();
|
|
3875
3931
|
}
|
|
3876
3932
|
ngOnDestroy() {
|
|
@@ -3878,11 +3934,11 @@ class WidgetAdminFormComponent extends BaseFormComponent {
|
|
|
3878
3934
|
super.ngOnDestroy();
|
|
3879
3935
|
}
|
|
3880
3936
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WidgetAdminFormComponent, deps: [{ token: WidgetAdminService }, { token: ValidatorService }, { token: WidgetAdminStore }, { token: WidgetAdminQuery }, { token: i3$4.Router }, { token: i3$4.ActivatedRoute }, { token: BaseStore }, { token: BaseQuery }], target: i0.ɵɵFactoryTarget.Component });
|
|
3881
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: WidgetAdminFormComponent, isStandalone: false, selector: "lib-widget-admin-form", usesInheritance: true, ngImport: i0, template: "<form-container [record]=\"record\" [showSave]=\"true\" [messages]=\"message\" (onSave)=\"handleSubmit()\"\r\n (onCancel)=\"handleCancel()\">\r\n <div class=\"card p-fluid p-formgrid\">\r\n <h4 class=\"font-bold col-12 md:col-12\">Widget Form</h4>\r\n <div class=\"col-12 md:col-12 mt-2 mb-2 flex\">\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'name',\r\n isRequired: true,\r\n displayText: 'Name',\r\n placeholder: 'Enter Widget Name'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <dropdown [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'apiConfigId',\r\n displayText : 'Select API',\r\n isRequired:true,\r\n }\" (onInput)=\"handleAPIChange($event)\">\r\n </dropdown>\r\n </div>\r\n\r\n <div class=\"col-4 md:col-4 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'style',\r\n isRequired: false,\r\n displayText: 'Style',\r\n placeholder: 'Enter Widget Style'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-2 md:col-2 mt-5\">\r\n <check-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Active',\r\n }\">\r\n </check-box>\r\n </div>\r\n </div>\r\n <div class=\"grid align-items-center m-0\">\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Header Item',\r\n options: headerDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleSubHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select SubHeader Item',\r\n options: subHeaderDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-2 mt-2 mb-2 flex\">\r\n <div class=\"field col-12 pl-2 pb-0 mb-2 md:mr-2 md:col-12\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'layoutType',\r\n listLabelProperty:'name',\r\n listValueProperty:'value',\r\n displayText : 'Select Layout Type',\r\n options: widgetLayoutTypeList\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"field p-0 pr-2 col-12 md:col-2\">\r\n <div class=\"card m-0 p-0 mb-2\">\r\n <div class=\"mt-3 w-full flex\">\r\n <button pButton pRipple routerLinkActive=\"router-link-active\"\r\n icon=\"pi pi-plus font-semibold\"\r\n class=\"py-3 justify-content-center font-semibold w-full border-round\"\r\n (click)=\"handleWidgetItemAddBtnClick()\">\r\n <span class=\"ml-3\">Add Widget Item </span>\r\n </button>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n\r\n <!-- Widget Items -->\r\n <div class=\"feild-card col-12 md:col-12 flex\" *ngFor=\"let widgetItem of record.dataItems; let i = index;\">\r\n <div class=\"field col-2 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'name',\r\n readonly : false,\r\n displayText : 'Item Label',\r\n isRequired : true,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n isRequired:true,\r\n options: dictionaries\r\n }\" (onInput)=\"handleWidgetItemDictionarySelect($event, i)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Properties',\r\n isRequired:true,\r\n options: dictionaryItemArray[i]\r\n }\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-4 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'style',\r\n readonly : false,\r\n displayText : 'Item Style',\r\n isRequired : false,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-4 m-0 flex justify-content-center md:col-2 mt-5\">\r\n <div class=\"m-0\">\r\n <check-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Is Active ?',\r\n }\">\r\n </check-box>\r\n </div>\r\n <div class=\"ml-4 delete-icon-container\">\r\n <i class=\"pi pi-trash trash-icon-wrapper cursor-pointer\" (click)=\"handleDeleteRecord(i)\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</form-container>", styles: [".trash-icon-wrapper{font-size:20px;color:var(--red-500)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: TextBoxComponent, selector: "text-box" }, { kind: "component", type: DropdownComponent, selector: "dropdown", inputs: ["isStaticDropdown"] }, { kind: "component", type: FormContainerComponent, selector: "form-container", inputs: ["messages", "record", "headerText", "showSave", "disableSaveButton"], outputs: ["onSave", "onCancel"] }, { kind: "component", type: CheckBoxComponent, selector: "check-box" }, { kind: "directive", type: i3$3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }] });
|
|
3937
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: WidgetAdminFormComponent, isStandalone: false, selector: "lib-widget-admin-form", usesInheritance: true, ngImport: i0, template: "<form-container [record]=\"record\" [showSave]=\"true\" [messages]=\"message\" (onSave)=\"handleSubmit()\"\r\n (onCancel)=\"handleCancel()\">\r\n <div class=\"card p-fluid p-formgrid\">\r\n <h4 class=\"font-bold col-12 md:col-12\">Widget Form</h4>\r\n <div class=\"col-12 md:col-12 mt-2 mb-2 flex\">\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'name',\r\n isRequired: true,\r\n displayText: 'Name',\r\n placeholder: 'Enter Widget Name'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <dropdown [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'apiConfigId',\r\n displayText : 'Select API',\r\n isRequired:true,\r\n }\" (onInput)=\"handleAPIChange($event)\">\r\n </dropdown>\r\n </div>\r\n\r\n <div class=\"col-4 md:col-4 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'style',\r\n isRequired: false,\r\n displayText: 'Style',\r\n placeholder: 'Enter Widget Style'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-2 md:col-2 mt-5\">\r\n <check-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Active',\r\n }\">\r\n </check-box>\r\n </div>\r\n </div>\r\n <div class=\"grid align-items-center m-0\">\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Header Item',\r\n options: headerDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleSubHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select SubHeader Item',\r\n options: subHeaderDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-2 mt-2 mb-2 flex\">\r\n <div class=\"field col-12 pl-2 pb-0 mb-2 md:mr-2 md:col-12\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'layoutType',\r\n listLabelProperty:'name',\r\n listValueProperty:'value',\r\n displayText : 'Select Layout Type',\r\n options: widgetLayoutTypeList\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"field p-0 pr-2 col-12 md:col-12 flex gap-2\">\r\n <div class=\"col-6 md:col-2\">\r\n <div class=\"card m-0 p-0 mb-2\">\r\n <div class=\"mt-3 w-full flex\">\r\n <button pButton pRipple routerLinkActive=\"router-link-active\"\r\n icon=\"pi pi-plus font-semibold\"\r\n class=\"py-3 justify-content-center font-semibold w-full border-round\"\r\n (click)=\"handleBadgeAddBtnClick()\">\r\n <span class=\"ml-3\">Add Badge </span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-2\">\r\n <div class=\"card m-0 p-0 mb-2\">\r\n <div class=\"mt-3 w-full flex\">\r\n <button pButton pRipple routerLinkActive=\"router-link-active\"\r\n icon=\"pi pi-plus font-semibold\"\r\n class=\"py-3 justify-content-center font-semibold w-full border-round\"\r\n (click)=\"handleWidgetItemAddBtnClick()\">\r\n <span class=\"ml-3\">Add Widget Item </span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Badges Section -->\r\n <div class=\"field p-0 pr-2 col-12 md:col-12 mb-3\">\r\n <h5 *ngIf=\"record.badges.length > 0\" class=\"font-bold col-12 md:col-12 mb-2\">Badges</h5>\r\n <div class=\"feild-card col-12 md:col-12 flex\" *ngFor=\"let badge of record.badges; let i = index;\">\r\n <div class=\"field col-3 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"badge\" [attributeModel]=\"{\r\n name:'dictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n isRequired:true,\r\n options: dictionaries\r\n }\" (onInput)=\"handleBadgeDictionarySelect($event, i)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-3 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"badge\" [attributeModel]=\"{\r\n name:'dictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Properties',\r\n isRequired:true,\r\n options: badgeDictionaryItemArray[i]\r\n }\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-4 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"badge\" [attributeModel]=\"{\r\n name : 'style',\r\n readonly : false,\r\n displayText : 'Style',\r\n isRequired : false,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-2 m-0 flex justify-content-start md:col-2 mt-5\">\r\n <div class=\"ml-4 delete-icon-container\">\r\n <i class=\"pi pi-trash trash-icon-wrapper cursor-pointer\" (click)=\"handleDeleteBadge(i)\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Widget Items -->\r\n <h5 *ngIf=\"record.dataItems.length > 0\" class=\"font-bold col-12 md:col-12 mb-2\">Widget Items</h5>\r\n <div class=\"feild-card col-12 md:col-12 flex\" *ngFor=\"let widgetItem of record.dataItems; let i = index;\">\r\n <div class=\"field col-2 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'name',\r\n readonly : false,\r\n displayText : 'Item Label',\r\n isRequired : true,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n isRequired:true,\r\n options: dictionaries\r\n }\" (onInput)=\"handleWidgetItemDictionarySelect($event, i)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Properties',\r\n isRequired:true,\r\n options: dictionaryItemArray[i]\r\n }\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-4 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'style',\r\n readonly : false,\r\n displayText : 'Item Style',\r\n isRequired : false,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-4 m-0 flex justify-content-center md:col-2 mt-5\">\r\n <div class=\"m-0\">\r\n <check-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Is Active ?',\r\n }\">\r\n </check-box>\r\n </div>\r\n <div class=\"ml-4 delete-icon-container\">\r\n <i class=\"pi pi-trash trash-icon-wrapper cursor-pointer\" (click)=\"handleDeleteRecord(i)\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</form-container>", styles: [".trash-icon-wrapper{font-size:20px;color:var(--red-500)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TextBoxComponent, selector: "text-box" }, { kind: "component", type: DropdownComponent, selector: "dropdown", inputs: ["isStaticDropdown"] }, { kind: "component", type: FormContainerComponent, selector: "form-container", inputs: ["messages", "record", "headerText", "showSave", "disableSaveButton"], outputs: ["onSave", "onCancel"] }, { kind: "component", type: CheckBoxComponent, selector: "check-box" }, { kind: "directive", type: i3$3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }] });
|
|
3882
3938
|
}
|
|
3883
3939
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WidgetAdminFormComponent, decorators: [{
|
|
3884
3940
|
type: Component,
|
|
3885
|
-
args: [{ selector: 'lib-widget-admin-form', standalone: false, template: "<form-container [record]=\"record\" [showSave]=\"true\" [messages]=\"message\" (onSave)=\"handleSubmit()\"\r\n (onCancel)=\"handleCancel()\">\r\n <div class=\"card p-fluid p-formgrid\">\r\n <h4 class=\"font-bold col-12 md:col-12\">Widget Form</h4>\r\n <div class=\"col-12 md:col-12 mt-2 mb-2 flex\">\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'name',\r\n isRequired: true,\r\n displayText: 'Name',\r\n placeholder: 'Enter Widget Name'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <dropdown [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'apiConfigId',\r\n displayText : 'Select API',\r\n isRequired:true,\r\n }\" (onInput)=\"handleAPIChange($event)\">\r\n </dropdown>\r\n </div>\r\n\r\n <div class=\"col-4 md:col-4 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'style',\r\n isRequired: false,\r\n displayText: 'Style',\r\n placeholder: 'Enter Widget Style'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-2 md:col-2 mt-5\">\r\n <check-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Active',\r\n }\">\r\n </check-box>\r\n </div>\r\n </div>\r\n <div class=\"grid align-items-center m-0\">\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Header Item',\r\n options: headerDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleSubHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select SubHeader Item',\r\n options: subHeaderDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-2 mt-2 mb-2 flex\">\r\n <div class=\"field col-12 pl-2 pb-0 mb-2 md:mr-2 md:col-12\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'layoutType',\r\n listLabelProperty:'name',\r\n listValueProperty:'value',\r\n displayText : 'Select Layout Type',\r\n options: widgetLayoutTypeList\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"field p-0 pr-2 col-12 md:col-2\">\r\n <div class=\"card m-0 p-0 mb-2\">\r\n <div class=\"mt-3 w-full flex\">\r\n <button pButton pRipple routerLinkActive=\"router-link-active\"\r\n icon=\"pi pi-plus font-semibold\"\r\n class=\"py-3 justify-content-center font-semibold w-full border-round\"\r\n (click)=\"handleWidgetItemAddBtnClick()\">\r\n <span class=\"ml-3\">Add Widget Item </span>\r\n </button>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n\r\n <!-- Widget Items -->\r\n <div class=\"feild-card col-12 md:col-12 flex\" *ngFor=\"let widgetItem of record.dataItems; let i = index;\">\r\n <div class=\"field col-2 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'name',\r\n readonly : false,\r\n displayText : 'Item Label',\r\n isRequired : true,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n isRequired:true,\r\n options: dictionaries\r\n }\" (onInput)=\"handleWidgetItemDictionarySelect($event, i)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Properties',\r\n isRequired:true,\r\n options: dictionaryItemArray[i]\r\n }\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-4 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'style',\r\n readonly : false,\r\n displayText : 'Item Style',\r\n isRequired : false,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-4 m-0 flex justify-content-center md:col-2 mt-5\">\r\n <div class=\"m-0\">\r\n <check-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Is Active ?',\r\n }\">\r\n </check-box>\r\n </div>\r\n <div class=\"ml-4 delete-icon-container\">\r\n <i class=\"pi pi-trash trash-icon-wrapper cursor-pointer\" (click)=\"handleDeleteRecord(i)\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</form-container>", styles: [".trash-icon-wrapper{font-size:20px;color:var(--red-500)}\n"] }]
|
|
3941
|
+
args: [{ selector: 'lib-widget-admin-form', standalone: false, template: "<form-container [record]=\"record\" [showSave]=\"true\" [messages]=\"message\" (onSave)=\"handleSubmit()\"\r\n (onCancel)=\"handleCancel()\">\r\n <div class=\"card p-fluid p-formgrid\">\r\n <h4 class=\"font-bold col-12 md:col-12\">Widget Form</h4>\r\n <div class=\"col-12 md:col-12 mt-2 mb-2 flex\">\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'name',\r\n isRequired: true,\r\n displayText: 'Name',\r\n placeholder: 'Enter Widget Name'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <dropdown [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'apiConfigId',\r\n displayText : 'Select API',\r\n isRequired:true,\r\n }\" (onInput)=\"handleAPIChange($event)\">\r\n </dropdown>\r\n </div>\r\n\r\n <div class=\"col-4 md:col-4 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'style',\r\n isRequired: false,\r\n displayText: 'Style',\r\n placeholder: 'Enter Widget Style'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-2 md:col-2 mt-5\">\r\n <check-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Active',\r\n }\">\r\n </check-box>\r\n </div>\r\n </div>\r\n <div class=\"grid align-items-center m-0\">\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Header Item',\r\n options: headerDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleSubHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select SubHeader Item',\r\n options: subHeaderDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-2 mt-2 mb-2 flex\">\r\n <div class=\"field col-12 pl-2 pb-0 mb-2 md:mr-2 md:col-12\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'layoutType',\r\n listLabelProperty:'name',\r\n listValueProperty:'value',\r\n displayText : 'Select Layout Type',\r\n options: widgetLayoutTypeList\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"field p-0 pr-2 col-12 md:col-12 flex gap-2\">\r\n <div class=\"col-6 md:col-2\">\r\n <div class=\"card m-0 p-0 mb-2\">\r\n <div class=\"mt-3 w-full flex\">\r\n <button pButton pRipple routerLinkActive=\"router-link-active\"\r\n icon=\"pi pi-plus font-semibold\"\r\n class=\"py-3 justify-content-center font-semibold w-full border-round\"\r\n (click)=\"handleBadgeAddBtnClick()\">\r\n <span class=\"ml-3\">Add Badge </span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-2\">\r\n <div class=\"card m-0 p-0 mb-2\">\r\n <div class=\"mt-3 w-full flex\">\r\n <button pButton pRipple routerLinkActive=\"router-link-active\"\r\n icon=\"pi pi-plus font-semibold\"\r\n class=\"py-3 justify-content-center font-semibold w-full border-round\"\r\n (click)=\"handleWidgetItemAddBtnClick()\">\r\n <span class=\"ml-3\">Add Widget Item </span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Badges Section -->\r\n <div class=\"field p-0 pr-2 col-12 md:col-12 mb-3\">\r\n <h5 *ngIf=\"record.badges.length > 0\" class=\"font-bold col-12 md:col-12 mb-2\">Badges</h5>\r\n <div class=\"feild-card col-12 md:col-12 flex\" *ngFor=\"let badge of record.badges; let i = index;\">\r\n <div class=\"field col-3 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"badge\" [attributeModel]=\"{\r\n name:'dictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n isRequired:true,\r\n options: dictionaries\r\n }\" (onInput)=\"handleBadgeDictionarySelect($event, i)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-3 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"badge\" [attributeModel]=\"{\r\n name:'dictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Properties',\r\n isRequired:true,\r\n options: badgeDictionaryItemArray[i]\r\n }\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-4 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"badge\" [attributeModel]=\"{\r\n name : 'style',\r\n readonly : false,\r\n displayText : 'Style',\r\n isRequired : false,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-2 m-0 flex justify-content-start md:col-2 mt-5\">\r\n <div class=\"ml-4 delete-icon-container\">\r\n <i class=\"pi pi-trash trash-icon-wrapper cursor-pointer\" (click)=\"handleDeleteBadge(i)\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Widget Items -->\r\n <h5 *ngIf=\"record.dataItems.length > 0\" class=\"font-bold col-12 md:col-12 mb-2\">Widget Items</h5>\r\n <div class=\"feild-card col-12 md:col-12 flex\" *ngFor=\"let widgetItem of record.dataItems; let i = index;\">\r\n <div class=\"field col-2 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'name',\r\n readonly : false,\r\n displayText : 'Item Label',\r\n isRequired : true,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n isRequired:true,\r\n options: dictionaries\r\n }\" (onInput)=\"handleWidgetItemDictionarySelect($event, i)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Properties',\r\n isRequired:true,\r\n options: dictionaryItemArray[i]\r\n }\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-4 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'style',\r\n readonly : false,\r\n displayText : 'Item Style',\r\n isRequired : false,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-4 m-0 flex justify-content-center md:col-2 mt-5\">\r\n <div class=\"m-0\">\r\n <check-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Is Active ?',\r\n }\">\r\n </check-box>\r\n </div>\r\n <div class=\"ml-4 delete-icon-container\">\r\n <i class=\"pi pi-trash trash-icon-wrapper cursor-pointer\" (click)=\"handleDeleteRecord(i)\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</form-container>", styles: [".trash-icon-wrapper{font-size:20px;color:var(--red-500)}\n"] }]
|
|
3886
3942
|
}], ctorParameters: () => [{ type: WidgetAdminService }, { type: ValidatorService }, { type: WidgetAdminStore }, { type: WidgetAdminQuery }, { type: i3$4.Router }, { type: i3$4.ActivatedRoute }, { type: BaseStore }, { type: BaseQuery }] });
|
|
3887
3943
|
|
|
3888
3944
|
/**
|