cat-qw-lib 0.48.2 → 0.48.4

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.
@@ -3461,6 +3461,10 @@ class DdItemModel extends BaseModel {
3461
3461
  isActive = true;
3462
3462
  }
3463
3463
 
3464
+ /**
3465
+ * DictionaryStore
3466
+ * @description Store for managing dictionary state
3467
+ */
3464
3468
  let DictionaryStore = class DictionaryStore extends BaseStore {
3465
3469
  setPropertiesData(value) {
3466
3470
  this.update({ propertyData: value });
@@ -3505,6 +3509,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
3505
3509
  args: [{ providedIn: 'root' }]
3506
3510
  }], ctorParameters: () => [{ type: DictionaryStore }, { type: i1$1.HttpClient }, { type: AppConfigService }, { type: ListService }] });
3507
3511
 
3512
+ /**
3513
+ * DictionaryQuery
3514
+ * @description Query for managing dictionary state
3515
+ */
3508
3516
  class DictionaryQuery extends BaseQuery {
3509
3517
  store;
3510
3518
  constructor(store) {
@@ -3536,6 +3544,10 @@ class DdAttributeSidebarViewModel {
3536
3544
  propertyList = SHARED.EMPTY;
3537
3545
  }
3538
3546
 
3547
+ /**
3548
+ * DdAdminItemFormComponent
3549
+ * This component is used to create and edit item expressions and style expressions.
3550
+ */
3539
3551
  class DdAdminItemFormComponent {
3540
3552
  dictionaryStore;
3541
3553
  dictionaryQuery;
@@ -3555,32 +3567,36 @@ class DdAdminItemFormComponent {
3555
3567
  this.baseStore = baseStore;
3556
3568
  this.attributeRecord = new DdAttributeSidebarViewModel();
3557
3569
  }
3558
- ngOnInit() {
3559
- this.loadPropertyOption();
3560
- }
3561
3570
  ngOnChanges(changes) {
3562
3571
  if (changes[SHARED.ISITEMEXPRESSION]) {
3563
3572
  this.attributeRecord.mappingInfo = (this.isItemExpression ? this.ddItemRecord.itemExpression : this.ddItemRecord.styleExpression) ?? SHARED.EMPTY;
3564
3573
  }
3574
+ this.loadPropertyOption();
3565
3575
  }
3566
3576
  loadPropertyOption() {
3567
3577
  this.subscriptions.add(this.dictionaryQuery.selectPropertyData().subscribe((res) => {
3578
+ this.propertyOptions = [];
3568
3579
  if (res) {
3569
- if (res?.properties?.length) {
3570
- res.properties.forEach((property) => {
3571
- this.propertyOptions.push({ label: `${res.name}.${property}`, value: `${res.name}.${property}` });
3572
- });
3573
- }
3574
- if (res?.childApis?.length) {
3575
- res.childApis.forEach((childApi) => {
3576
- childApi.properties.forEach((property) => {
3577
- this.propertyOptions.push({ label: `${res.name}.${childApi.name}.${property}`, value: `${res.name}.${childApi.name}.${property}` });
3578
- });
3579
- });
3580
- }
3580
+ this.mapProperties(res);
3581
3581
  }
3582
3582
  }));
3583
3583
  }
3584
+ mapProperties(res) {
3585
+ if (res?.properties?.length) {
3586
+ this.propertyOptions.push(...res.properties.map((property) => ({
3587
+ label: `${res.name}.${property}`,
3588
+ value: `${res.name}.${property}`
3589
+ })));
3590
+ }
3591
+ if (res?.childApis?.length) {
3592
+ res.childApis.forEach((childApi) => {
3593
+ this.propertyOptions.push(...childApi.properties.map((property) => ({
3594
+ label: `${res.name}.${childApi.name}.${property}`,
3595
+ value: `${res.name}.${childApi.name}.${property}`
3596
+ })));
3597
+ });
3598
+ }
3599
+ }
3584
3600
  handleSaveBtnClick(event) {
3585
3601
  if (this.isItemExpression) {
3586
3602
  if (this.baseStore)
@@ -3605,13 +3621,15 @@ class DdAdminItemFormComponent {
3605
3621
  }
3606
3622
  ngOnDestroy() {
3607
3623
  this.subscriptions.unsubscribe();
3624
+ this.propertyOptions = [];
3625
+ this.attributeRecord = new DdAttributeSidebarViewModel();
3608
3626
  }
3609
3627
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DdAdminItemFormComponent, deps: [{ token: DictionaryStore }, { token: DictionaryQuery }, { token: BaseStore }], target: i0.ɵɵFactoryTarget.Component });
3610
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: DdAdminItemFormComponent, isStandalone: false, selector: "lib-dd-admin-item-form", inputs: { ddItemRecord: "ddItemRecord", isItemExpression: "isItemExpression", isSidebarVisible: "isSidebarVisible" }, outputs: { saveClick: "saveClick" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"dicitonary-edit-action px-3\">\n <div class=\"flex align-items-center justify-content-end mt-3\">\n <lib-button\n [store]=\"dictionaryStore\"\n [record]=\"attributeRecord\"\n [attributeModel]=\"{\n buttonLabel: 'Save',\n isDisabled: false,\n }\"\n (onBtnClick)=\"handleSaveBtnClick($event)\"\n >\n </lib-button>\n </div>\n\n <div class=\"col-12 md:col-12 mt-5\">\n <label *ngIf=\"!isItemExpression\" for=\"styleInput\" class=\"text-gray-600 text-sm mb-2 block\">\n Hint: Use key-value pairs for styles.\n <br/>\n Example:<code>\n 'background-color': 'lightgray',\n 'font-size': '16px',<br>\n 'padding': '10px'\n </code>\n </label>\n <text-area\n [store]=\"dictionaryStore\"\n [record]=\"attributeRecord\"\n [attributeModel]=\"{\n displayText: 'Expression',\n readonly : false,\n name : 'mappingInfo',\n isRequired : isItemExpression ? true : false,\n placeholder : 'Enter Text',\n customPadding: '12px',\n }\"\n ></text-area>\n </div>\n <div class=\"col-12 md:col-12\">\n <div class=\"p-field queue-list-wrapper\">\n <dropdown [store]=\"dictionaryStore\" [record]=\"attributeRecord\" [attributeModel]=\"{\n name:'propertyList',\n displayText : 'Select properties',\n isRequired:false,\n options : propertyOptions,\n filter : true\n }\">\n </dropdown>\n </div>\n </div>\n <div class=\"col-12 md:col-3\">\n <lib-button\n [store]=\"dictionaryStore\"\n [record]=\"attributeRecord\"\n [attributeModel]=\"{\n buttonLabel: 'Add to expression',\n isDisabled: false,\n }\"\n (onBtnClick)=\"handleAddExpressionClick($event)\"\n >\n </lib-button>\n </div>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: DropdownComponent, selector: "dropdown", inputs: ["isStaticDropdown"] }, { kind: "component", type: ButtonComponent, selector: "lib-button" }, { kind: "component", type: TextAreaComponent, selector: "text-area", inputs: ["rowspan"] }] });
3628
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: DdAdminItemFormComponent, isStandalone: false, selector: "lib-dd-admin-item-form", inputs: { ddItemRecord: "ddItemRecord", isItemExpression: "isItemExpression", isSidebarVisible: "isSidebarVisible" }, outputs: { saveClick: "saveClick" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"dicitonary-edit-action px-3\">\n <div class=\"flex align-items-center justify-content-end mt-3\">\n <lib-button\n [store]=\"dictionaryStore\"\n [record]=\"attributeRecord\"\n [attributeModel]=\"{\n buttonLabel: 'Save',\n isDisabled: false,\n }\"\n (onBtnClick)=\"handleSaveBtnClick($event)\"\n >\n </lib-button>\n </div>\n\n <div class=\"col-12 md:col-12 mt-5\">\n <label *ngIf=\"!isItemExpression\" for=\"styleInput\" class=\"text-gray-600 text-sm mb-2 block\">\n Hint: Use key-value pairs for styles.\n <br/>\n Example:<code>\n 'background-color': 'lightgray',\n 'font-size': '16px',<br>\n 'padding': '10px'\n </code>\n </label>\n <text-area\n [store]=\"dictionaryStore\"\n [record]=\"attributeRecord\"\n [attributeModel]=\"{\n displayText: 'Expression',\n readonly : false,\n name : 'mappingInfo',\n isRequired : isItemExpression ? true : false,\n placeholder : 'Enter Text',\n customPadding: '12px',\n }\"\n ></text-area>\n </div>\n <div class=\"col-12 md:col-12\">\n <div class=\"p-field queue-list-wrapper\">\n <dropdown [store]=\"dictionaryStore\" [isStaticDropdown]=\"true\" [record]=\"attributeRecord\" [attributeModel]=\"{\n name:'propertyList',\n displayText : 'Select properties',\n isRequired:false,\n listLabelProperty: 'label',\n listValueProperty: 'value',\n options : propertyOptions,\n filter : true\n }\">\n </dropdown>\n </div>\n </div>\n <div class=\"col-12 md:col-3\">\n <lib-button\n [store]=\"dictionaryStore\"\n [record]=\"attributeRecord\"\n [attributeModel]=\"{\n buttonLabel: 'Add to expression',\n isDisabled: false,\n }\"\n (onBtnClick)=\"handleAddExpressionClick($event)\"\n >\n </lib-button>\n </div>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: DropdownComponent, selector: "dropdown", inputs: ["isStaticDropdown"] }, { kind: "component", type: ButtonComponent, selector: "lib-button" }, { kind: "component", type: TextAreaComponent, selector: "text-area", inputs: ["rowspan"] }] });
3611
3629
  }
3612
3630
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DdAdminItemFormComponent, decorators: [{
3613
3631
  type: Component,
3614
- args: [{ selector: 'lib-dd-admin-item-form', standalone: false, template: "<div class=\"dicitonary-edit-action px-3\">\n <div class=\"flex align-items-center justify-content-end mt-3\">\n <lib-button\n [store]=\"dictionaryStore\"\n [record]=\"attributeRecord\"\n [attributeModel]=\"{\n buttonLabel: 'Save',\n isDisabled: false,\n }\"\n (onBtnClick)=\"handleSaveBtnClick($event)\"\n >\n </lib-button>\n </div>\n\n <div class=\"col-12 md:col-12 mt-5\">\n <label *ngIf=\"!isItemExpression\" for=\"styleInput\" class=\"text-gray-600 text-sm mb-2 block\">\n Hint: Use key-value pairs for styles.\n <br/>\n Example:<code>\n 'background-color': 'lightgray',\n 'font-size': '16px',<br>\n 'padding': '10px'\n </code>\n </label>\n <text-area\n [store]=\"dictionaryStore\"\n [record]=\"attributeRecord\"\n [attributeModel]=\"{\n displayText: 'Expression',\n readonly : false,\n name : 'mappingInfo',\n isRequired : isItemExpression ? true : false,\n placeholder : 'Enter Text',\n customPadding: '12px',\n }\"\n ></text-area>\n </div>\n <div class=\"col-12 md:col-12\">\n <div class=\"p-field queue-list-wrapper\">\n <dropdown [store]=\"dictionaryStore\" [record]=\"attributeRecord\" [attributeModel]=\"{\n name:'propertyList',\n displayText : 'Select properties',\n isRequired:false,\n options : propertyOptions,\n filter : true\n }\">\n </dropdown>\n </div>\n </div>\n <div class=\"col-12 md:col-3\">\n <lib-button\n [store]=\"dictionaryStore\"\n [record]=\"attributeRecord\"\n [attributeModel]=\"{\n buttonLabel: 'Add to expression',\n isDisabled: false,\n }\"\n (onBtnClick)=\"handleAddExpressionClick($event)\"\n >\n </lib-button>\n </div>\n</div>" }]
3632
+ args: [{ selector: 'lib-dd-admin-item-form', standalone: false, template: "<div class=\"dicitonary-edit-action px-3\">\n <div class=\"flex align-items-center justify-content-end mt-3\">\n <lib-button\n [store]=\"dictionaryStore\"\n [record]=\"attributeRecord\"\n [attributeModel]=\"{\n buttonLabel: 'Save',\n isDisabled: false,\n }\"\n (onBtnClick)=\"handleSaveBtnClick($event)\"\n >\n </lib-button>\n </div>\n\n <div class=\"col-12 md:col-12 mt-5\">\n <label *ngIf=\"!isItemExpression\" for=\"styleInput\" class=\"text-gray-600 text-sm mb-2 block\">\n Hint: Use key-value pairs for styles.\n <br/>\n Example:<code>\n 'background-color': 'lightgray',\n 'font-size': '16px',<br>\n 'padding': '10px'\n </code>\n </label>\n <text-area\n [store]=\"dictionaryStore\"\n [record]=\"attributeRecord\"\n [attributeModel]=\"{\n displayText: 'Expression',\n readonly : false,\n name : 'mappingInfo',\n isRequired : isItemExpression ? true : false,\n placeholder : 'Enter Text',\n customPadding: '12px',\n }\"\n ></text-area>\n </div>\n <div class=\"col-12 md:col-12\">\n <div class=\"p-field queue-list-wrapper\">\n <dropdown [store]=\"dictionaryStore\" [isStaticDropdown]=\"true\" [record]=\"attributeRecord\" [attributeModel]=\"{\n name:'propertyList',\n displayText : 'Select properties',\n isRequired:false,\n listLabelProperty: 'label',\n listValueProperty: 'value',\n options : propertyOptions,\n filter : true\n }\">\n </dropdown>\n </div>\n </div>\n <div class=\"col-12 md:col-3\">\n <lib-button\n [store]=\"dictionaryStore\"\n [record]=\"attributeRecord\"\n [attributeModel]=\"{\n buttonLabel: 'Add to expression',\n isDisabled: false,\n }\"\n (onBtnClick)=\"handleAddExpressionClick($event)\"\n >\n </lib-button>\n </div>\n</div>" }]
3615
3633
  }], ctorParameters: () => [{ type: DictionaryStore }, { type: DictionaryQuery }, { type: BaseStore }], propDecorators: { ddItemRecord: [{
3616
3634
  type: Input
3617
3635
  }], isItemExpression: [{
@@ -3622,6 +3640,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
3622
3640
  type: Output
3623
3641
  }] } });
3624
3642
 
3643
+ /**
3644
+ * DdAdminFormComponent
3645
+ * @description Component for managing dictionary form
3646
+ */
3625
3647
  class DdAdminFormComponent extends BaseFormComponent {
3626
3648
  service;
3627
3649
  dictionaryQuery;