novo-elements 11.0.0-next.2 → 11.0.0-next.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.
@@ -16,6 +16,7 @@ export declare class ConditionGroupComponent implements OnInit, OnDestroy {
16
16
  canBeEmpty: boolean;
17
17
  formGroupName: any;
18
18
  scope: string;
19
+ entity: string;
19
20
  parentForm: UntypedFormGroup;
20
21
  /** Subject that emits when the component has been destroyed. */
21
22
  private readonly _onDestroy;
@@ -23,12 +24,13 @@ export declare class ConditionGroupComponent implements OnInit, OnDestroy {
23
24
  ngOnInit(): void;
24
25
  ngOnChanges(): void;
25
26
  ngOnDestroy(): void;
26
- updateGroupScope(): void;
27
+ updateGroupScopeAndEntity(): void;
27
28
  updateControlName(value: string): void;
29
+ private sanitizeCondition;
28
30
  get root(): FormArray;
29
31
  addCondition(data?: any): void;
30
32
  removeCondition(index: number): void;
31
- newCondition({ field, operator, scope, value, supportingValue }?: Condition): UntypedFormGroup;
33
+ newCondition({ field, operator, scope, value, supportingValue, entity }?: Condition): UntypedFormGroup;
32
34
  cantRemoveRow(): boolean;
33
35
  static ɵfac: i0.ɵɵFactoryDeclaration<ConditionGroupComponent, never>;
34
36
  static ɵcmp: i0.ɵɵComponentDeclaration<ConditionGroupComponent, "novo-condition-group", never, { "controlName": { "alias": "controlName"; "required": false; }; "groupIndex": { "alias": "groupIndex"; "required": false; }; "hideFirstOperator": { "alias": "hideFirstOperator"; "required": false; }; "canBeEmpty": { "alias": "canBeEmpty"; "required": false; }; "formGroupName": { "alias": "formGroupName"; "required": false; }; }, {}, never, never, false, never>;
@@ -42,6 +42,7 @@ export declare class CriteriaBuilderComponent implements OnInit, OnDestroy, Afte
42
42
  addConditionGroup(data?: any): void;
43
43
  newConditionGroup(data: ConditionGroup): UntypedFormGroup;
44
44
  newCondition({ field, operator, scope, value, supportingValue }?: Condition): UntypedFormGroup;
45
+ getFieldEntity(fieldConfigs: any, scope: any): any;
45
46
  removeConditionGroupAt(index: number): void;
46
47
  clearAllConditions(): void;
47
48
  onFieldSelect(field: any): void;
@@ -40,6 +40,7 @@ export interface Condition {
40
40
  scope?: string;
41
41
  value: any;
42
42
  supportingValue?: any;
43
+ entity?: string;
43
44
  }
44
45
  export interface Criteria {
45
46
  criteria: ConditionGroup[];
@@ -713,10 +713,27 @@ class NovoDefaultDateConditionDef extends AbstractConditionFieldDef {
713
713
  </novo-field>
714
714
  <novo-field *novoSwitchCases="['within']">
715
715
  <novo-select [placeholder]="labels.selectDateRange" formControlName="value">
716
- <novo-option value="7">{{ labels.next7Days }}</novo-option>
716
+ <novo-option value="future">{{ labels.future }}</novo-option>
717
+ <novo-option value="-1">{{ labels.past1Day }}</novo-option>
717
718
  <novo-option value="-7">{{ labels.past7Days }}</novo-option>
719
+ <novo-option value="-14">{{ labels.past14Days }}</novo-option>
720
+ <novo-option value="-21">{{ labels.past21Days }}</novo-option>
718
721
  <novo-option value="-30">{{ labels.past30Days }}</novo-option>
722
+ <novo-option value="-60">{{ labels.past60Days }}</novo-option>
719
723
  <novo-option value="-90">{{ labels.past90Days }}</novo-option>
724
+ <novo-option value="-180">{{ labels.past180Days }}</novo-option>
725
+ <novo-option value="-270">{{ labels.past270Days }}</novo-option>
726
+ <novo-option value="-365">{{ labels.past1Year }}</novo-option>
727
+ <novo-option value="1">{{ labels.next1Day }}</novo-option>
728
+ <novo-option value="7">{{ labels.next7Days }}</novo-option>
729
+ <novo-option value="14">{{ labels.next14Days }}</novo-option>
730
+ <novo-option value="21">{{ labels.next21Days }}</novo-option>
731
+ <novo-option value="30">{{ labels.next30Days }}</novo-option>
732
+ <novo-option value="60">{{ labels.next60Days }}</novo-option>
733
+ <novo-option value="90">{{ labels.next90Days }}</novo-option>
734
+ <novo-option value="180">{{ labels.next180Days }}</novo-option>
735
+ <novo-option value="270">{{ labels.next270Days }}</novo-option>
736
+ <novo-option value="365">{{ labels.next1Year }}</novo-option>
720
737
  </novo-select>
721
738
  </novo-field>
722
739
  <novo-field *novoSwitchCases="['isNull']">
@@ -760,10 +777,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
760
777
  </novo-field>
761
778
  <novo-field *novoSwitchCases="['within']">
762
779
  <novo-select [placeholder]="labels.selectDateRange" formControlName="value">
763
- <novo-option value="7">{{ labels.next7Days }}</novo-option>
780
+ <novo-option value="future">{{ labels.future }}</novo-option>
781
+ <novo-option value="-1">{{ labels.past1Day }}</novo-option>
764
782
  <novo-option value="-7">{{ labels.past7Days }}</novo-option>
783
+ <novo-option value="-14">{{ labels.past14Days }}</novo-option>
784
+ <novo-option value="-21">{{ labels.past21Days }}</novo-option>
765
785
  <novo-option value="-30">{{ labels.past30Days }}</novo-option>
786
+ <novo-option value="-60">{{ labels.past60Days }}</novo-option>
766
787
  <novo-option value="-90">{{ labels.past90Days }}</novo-option>
788
+ <novo-option value="-180">{{ labels.past180Days }}</novo-option>
789
+ <novo-option value="-270">{{ labels.past270Days }}</novo-option>
790
+ <novo-option value="-365">{{ labels.past1Year }}</novo-option>
791
+ <novo-option value="1">{{ labels.next1Day }}</novo-option>
792
+ <novo-option value="7">{{ labels.next7Days }}</novo-option>
793
+ <novo-option value="14">{{ labels.next14Days }}</novo-option>
794
+ <novo-option value="21">{{ labels.next21Days }}</novo-option>
795
+ <novo-option value="30">{{ labels.next30Days }}</novo-option>
796
+ <novo-option value="60">{{ labels.next60Days }}</novo-option>
797
+ <novo-option value="90">{{ labels.next90Days }}</novo-option>
798
+ <novo-option value="180">{{ labels.next180Days }}</novo-option>
799
+ <novo-option value="270">{{ labels.next270Days }}</novo-option>
800
+ <novo-option value="365">{{ labels.next1Year }}</novo-option>
767
801
  </novo-select>
768
802
  </novo-field>
769
803
  <novo-field *novoSwitchCases="['isNull']">
@@ -838,10 +872,27 @@ class NovoDefaultDateTimeConditionDef extends AbstractConditionFieldDef {
838
872
  </novo-field>
839
873
  <novo-field *novoSwitchCases="['within']">
840
874
  <novo-select [placeholder]="labels.selectDateRange" formControlName="value">
841
- <novo-option value="7">{{ labels.next7Days }}</novo-option>
875
+ <novo-option value="future">{{ labels.future }}</novo-option>
876
+ <novo-option value="-1">{{ labels.past1Day }}</novo-option>
842
877
  <novo-option value="-7">{{ labels.past7Days }}</novo-option>
878
+ <novo-option value="-14">{{ labels.past14Days }}</novo-option>
879
+ <novo-option value="-21">{{ labels.past21Days }}</novo-option>
843
880
  <novo-option value="-30">{{ labels.past30Days }}</novo-option>
881
+ <novo-option value="-60">{{ labels.past60Days }}</novo-option>
844
882
  <novo-option value="-90">{{ labels.past90Days }}</novo-option>
883
+ <novo-option value="-180">{{ labels.past180Days }}</novo-option>
884
+ <novo-option value="-270">{{ labels.past270Days }}</novo-option>
885
+ <novo-option value="-365">{{ labels.past1Year }}</novo-option>
886
+ <novo-option value="1">{{ labels.next1Day }}</novo-option>
887
+ <novo-option value="7">{{ labels.next7Days }}</novo-option>
888
+ <novo-option value="14">{{ labels.next14Days }}</novo-option>
889
+ <novo-option value="21">{{ labels.next21Days }}</novo-option>
890
+ <novo-option value="30">{{ labels.next30Days }}</novo-option>
891
+ <novo-option value="60">{{ labels.next60Days }}</novo-option>
892
+ <novo-option value="90">{{ labels.next90Days }}</novo-option>
893
+ <novo-option value="180">{{ labels.next180Days }}</novo-option>
894
+ <novo-option value="270">{{ labels.next270Days }}</novo-option>
895
+ <novo-option value="365">{{ labels.next1Year }}</novo-option>
845
896
  </novo-select>
846
897
  </novo-field>
847
898
  <novo-field *novoSwitchCases="['isNull']">
@@ -897,10 +948,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
897
948
  </novo-field>
898
949
  <novo-field *novoSwitchCases="['within']">
899
950
  <novo-select [placeholder]="labels.selectDateRange" formControlName="value">
900
- <novo-option value="7">{{ labels.next7Days }}</novo-option>
951
+ <novo-option value="future">{{ labels.future }}</novo-option>
952
+ <novo-option value="-1">{{ labels.past1Day }}</novo-option>
901
953
  <novo-option value="-7">{{ labels.past7Days }}</novo-option>
954
+ <novo-option value="-14">{{ labels.past14Days }}</novo-option>
955
+ <novo-option value="-21">{{ labels.past21Days }}</novo-option>
902
956
  <novo-option value="-30">{{ labels.past30Days }}</novo-option>
957
+ <novo-option value="-60">{{ labels.past60Days }}</novo-option>
903
958
  <novo-option value="-90">{{ labels.past90Days }}</novo-option>
959
+ <novo-option value="-180">{{ labels.past180Days }}</novo-option>
960
+ <novo-option value="-270">{{ labels.past270Days }}</novo-option>
961
+ <novo-option value="-365">{{ labels.past1Year }}</novo-option>
962
+ <novo-option value="1">{{ labels.next1Day }}</novo-option>
963
+ <novo-option value="7">{{ labels.next7Days }}</novo-option>
964
+ <novo-option value="14">{{ labels.next14Days }}</novo-option>
965
+ <novo-option value="21">{{ labels.next21Days }}</novo-option>
966
+ <novo-option value="30">{{ labels.next30Days }}</novo-option>
967
+ <novo-option value="60">{{ labels.next60Days }}</novo-option>
968
+ <novo-option value="90">{{ labels.next90Days }}</novo-option>
969
+ <novo-option value="180">{{ labels.next180Days }}</novo-option>
970
+ <novo-option value="270">{{ labels.next270Days }}</novo-option>
971
+ <novo-option value="365">{{ labels.next1Year }}</novo-option>
904
972
  </novo-select>
905
973
  </novo-field>
906
974
  <novo-field *novoSwitchCases="['isNull']">
@@ -1615,21 +1683,25 @@ class ConditionGroupComponent {
1615
1683
  ngOnInit() {
1616
1684
  this.parentForm = this.controlContainer.control;
1617
1685
  this.controlName = Object.keys(this.parentForm.controls)[0];
1618
- this.updateGroupScope();
1686
+ this.updateGroupScopeAndEntity();
1619
1687
  merge(this.parentForm.parent.valueChanges, this.qbs.stateChanges)
1620
1688
  .pipe(takeUntil(this._onDestroy))
1621
1689
  .subscribe(() => this.cdr.markForCheck());
1622
1690
  }
1623
1691
  ngOnChanges() {
1624
- this.updateGroupScope();
1692
+ this.updateGroupScopeAndEntity();
1625
1693
  }
1626
1694
  ngOnDestroy() {
1627
1695
  this._onDestroy.next();
1628
1696
  this._onDestroy.complete();
1629
1697
  }
1630
- updateGroupScope() {
1698
+ updateGroupScopeAndEntity() {
1631
1699
  if (this.parentForm && this.controlName) {
1632
1700
  this.scope = this.parentForm.value[this.controlName][0]?.scope || this.qbs.scopes()[0];
1701
+ const entity = this.parentForm.value[this.controlName][0]?.entity;
1702
+ if (entity) {
1703
+ this.entity = entity;
1704
+ }
1633
1705
  }
1634
1706
  }
1635
1707
  updateControlName(value) {
@@ -1640,11 +1712,22 @@ class ConditionGroupComponent {
1640
1712
  delete this.parentForm.controls[this.controlName];
1641
1713
  this.controlName = name;
1642
1714
  // scrub properties not on control
1643
- const currentStrict = current.map((item) => (({ conditionType, field, operator, scope, value, ...rest }) => ({ conditionType, field, operator, scope, value }))(item));
1715
+ const currentStrict = current.map(item => this.sanitizeCondition(item));
1644
1716
  this.parentForm.get(this.controlName)?.setValue(currentStrict);
1645
1717
  this.cdr.markForCheck();
1646
1718
  }
1647
1719
  }
1720
+ sanitizeCondition(condition) {
1721
+ return {
1722
+ conditionType: condition.conditionType,
1723
+ field: condition.field,
1724
+ operator: condition.operator,
1725
+ scope: condition.scope,
1726
+ value: condition.value,
1727
+ supportingValue: condition.supportingValue,
1728
+ entity: condition.entity
1729
+ };
1730
+ }
1648
1731
  get root() {
1649
1732
  return this.parentForm.get(this.controlName);
1650
1733
  }
@@ -1665,7 +1748,7 @@ class ConditionGroupComponent {
1665
1748
  }
1666
1749
  this.cdr.markForCheck();
1667
1750
  }
1668
- newCondition({ field, operator, scope, value, supportingValue } = EMPTY_CONDITION$1) {
1751
+ newCondition({ field, operator, scope, value, supportingValue, entity } = EMPTY_CONDITION$1) {
1669
1752
  return this.formBuilder.group({
1670
1753
  conditionType: '$and',
1671
1754
  field: [field, Validators.required],
@@ -1673,6 +1756,7 @@ class ConditionGroupComponent {
1673
1756
  scope: [scope],
1674
1757
  value: [value],
1675
1758
  supportingValue: [supportingValue],
1759
+ entity: [entity],
1676
1760
  });
1677
1761
  }
1678
1762
  cantRemoveRow() {
@@ -1682,13 +1766,13 @@ class ConditionGroupComponent {
1682
1766
  return this.root.length <= 1;
1683
1767
  }
1684
1768
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ConditionGroupComponent, deps: [{ token: QueryBuilderService }, { token: i1.NovoLabelService }, { token: i3.ControlContainer }, { token: i3.FormBuilder }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
1685
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: ConditionGroupComponent, isStandalone: false, selector: "novo-condition-group", inputs: { controlName: "controlName", groupIndex: "groupIndex", hideFirstOperator: "hideFirstOperator", canBeEmpty: "canBeEmpty", formGroupName: "formGroupName" }, host: { classAttribute: "novo-condition-group" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ConditionGroupComponent), multi: true }], usesOnChanges: true, ngImport: i0, template: "<div [formGroup]=\"parentForm\" class=\"condition-group-container\">\n <novo-stack [formArrayName]=\"controlName\" gap=\"md\">\n <ng-container\n *ngFor=\"let andGroup of root.controls; let andIndex = index; let isFirst = first;let isLast = last;\">\n <ng-container [formGroupName]=\"andIndex\">\n <novo-flex class=\"condition-row\" [ngClass]=\"{ isFirst: andIndex === 0 }\" [class]=\"scope\" align=\"end\" gap=\"sm\" #flex>\n <novo-dropdown *ngIf=\"(!isFirst || !hideFirstOperator) && qbs.allowedGroupings.length > 1; else labeledGroup\">\n <button theme=\"dialogue\" icon=\"collapse\" size=\"sm\">{{qbs.getConjunctionLabel(controlName)}}</button>\n <novo-optgroup>\n <novo-option *ngFor=\"let c of qbs.allowedGroupings\" (click)=\"updateControlName(c)\">\n {{qbs.getConjunctionLabel(c)}}</novo-option>\n </novo-optgroup>\n </novo-dropdown>\n <ng-template #labeledGroup>\n <novo-label *ngIf=\"!isFirst || !hideFirstOperator\" color=\"ash\" size=\"xs\" uppercase padding=\"sm\">\n {{qbs.getConjunctionLabel(controlName)}}</novo-label>\n </ng-template>\n <novo-condition-builder [groupIndex]=\"groupIndex\" [andIndex]=\"andIndex\" [hideOperator]=\"isFirst && hideFirstOperator\" [scope]=\"scope\" [conditionType]=\"controlName\"></novo-condition-builder>\n <novo-button class=\"delete-btn\" theme=\"icon\" icon=\"delete-o\" color=\"negative\" (click)=\"removeCondition(andIndex)\">\n </novo-button>\n </novo-flex>\n </ng-container>\n </ng-container>\n <button\n *ngIf=\"!qbs.hasMultipleScopes()\"\n theme=\"dialogue\"\n data-automation-id=\"add-advanced-search-condition\"\n icon=\"add-thin\"\n side=\"left\"\n size=\"sm\"\n uppercase\n (click)=\"addCondition()\">\n {{ labels.addCondition }}</button>\n </novo-stack>\n</div>\n", styles: [":host{position:relative;display:block;border:1px solid var(--border);border-radius:var(--border-radius-round);padding:var(--spacing-md);width:100%}:host .condition-row{width:100%}:host .delete-btn{margin-bottom:1px}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: i5$2.NovoButtonElement, selector: "novo-button,button[theme]", inputs: ["color", "side", "size", "theme", "loading", "icon", "secondIcon", "disabled"] }, { kind: "component", type: i5.NovoLabel, selector: "novo-label,[novo-label]", inputs: ["id"] }, { kind: "directive", type: i5.PaddingDirective, selector: "[p],[padding],[paddingTop],[paddingRight],[paddingBottom],[paddingLeft],[paddingX],[paddingY],[pt],[pr],[pb],[pl],[px],[py]", inputs: ["padding", "p", "paddingLeft", "pl", "paddingRight", "pr", "paddingTop", "pt", "paddingBottom", "pb", "paddingX", "px", "paddingY", "py"] }, { kind: "directive", type: i5.GapDirective, selector: "[gap]", inputs: ["gap"] }, { kind: "directive", type: i5.ThemeColorDirective, selector: "[theme]", inputs: ["theme"] }, { kind: "component", type: i5.NovoOption, selector: "novo-option", inputs: ["selected", "keepOpen", "novoInert", "value", "disabled"], exportAs: ["novoOption"] }, { kind: "component", type: i5.NovoOptgroup, selector: "novo-optgroup", inputs: ["disabled", "label"], exportAs: ["novoOptgroup"] }, { kind: "component", type: i8.NovoFlexElement, selector: "novo-flex,novo-row", inputs: ["direction", "align", "justify", "wrap", "gap"] }, { kind: "component", type: i8.NovoStackElement, selector: "novo-stack,novo-column", inputs: ["direction", "align"] }, { kind: "component", type: i8$3.NovoDropdownElement, selector: "novo-dropdown", inputs: ["parentScrollSelector", "parentScrollAction", "containerClass", "side", "scrollStrategy", "keepOpen", "height", "width", "appendToBody", "multiple", "scrollToActiveItemOnOpen"], outputs: ["toggled"] }, { kind: "component", type: ConditionBuilderComponent, selector: "novo-condition-builder", inputs: ["label", "scope", "andIndex", "groupIndex", "addressConfig", "hideOperator", "conditionType", "config", "editTypeFn"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1769
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: ConditionGroupComponent, isStandalone: false, selector: "novo-condition-group", inputs: { controlName: "controlName", groupIndex: "groupIndex", hideFirstOperator: "hideFirstOperator", canBeEmpty: "canBeEmpty", formGroupName: "formGroupName" }, host: { classAttribute: "novo-condition-group" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ConditionGroupComponent), multi: true }], usesOnChanges: true, ngImport: i0, template: "<div [formGroup]=\"parentForm\" class=\"condition-group-container\">\n <novo-stack [formArrayName]=\"controlName\" gap=\"md\">\n <ng-container\n *ngFor=\"let andGroup of root.controls; let andIndex = index; let isFirst = first;let isLast = last;\">\n <ng-container [formGroupName]=\"andIndex\">\n <novo-flex class=\"condition-row\" [ngClass]=\"{ isFirst: andIndex === 0 }\" [class]=\"entity || scope\" align=\"end\" gap=\"sm\" #flex>\n <novo-dropdown *ngIf=\"(!isFirst || !hideFirstOperator) && qbs.allowedGroupings.length > 1; else labeledGroup\" data-automation-id=\"groupings-dropdown\">\n <button theme=\"dialogue\" icon=\"collapse\" size=\"sm\">{{qbs.getConjunctionLabel(controlName)}}</button>\n <novo-optgroup>\n <novo-option *ngFor=\"let c of qbs.allowedGroupings\" (click)=\"updateControlName(c)\" [attr.data-automation-id]=\"c\">\n {{qbs.getConjunctionLabel(c)}}</novo-option>\n </novo-optgroup>\n </novo-dropdown>\n <ng-template #labeledGroup>\n <novo-label *ngIf=\"!isFirst || !hideFirstOperator\" color=\"ash\" size=\"xs\" uppercase padding=\"sm\">\n {{qbs.getConjunctionLabel(controlName)}}</novo-label>\n </ng-template>\n <novo-condition-builder [groupIndex]=\"groupIndex\" [andIndex]=\"andIndex\" [hideOperator]=\"isFirst && hideFirstOperator\" [scope]=\"scope\" [conditionType]=\"controlName\"></novo-condition-builder>\n <novo-button class=\"delete-btn\" theme=\"icon\" icon=\"delete-o\" color=\"negative\" (click)=\"removeCondition(andIndex)\">\n </novo-button>\n </novo-flex>\n </ng-container>\n </ng-container>\n <button\n *ngIf=\"!qbs.hasMultipleScopes()\"\n theme=\"dialogue\"\n data-automation-id=\"add-advanced-search-condition\"\n icon=\"add-thin\"\n side=\"left\"\n size=\"sm\"\n uppercase\n (click)=\"addCondition()\">\n {{ labels.addCondition }}</button>\n </novo-stack>\n</div>\n", styles: [":host{position:relative;display:block;border:1px solid var(--border);border-radius:var(--border-radius-round);padding:var(--spacing-md);width:100%}:host .condition-row{width:100%}:host .delete-btn{margin-bottom:1px}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: i5$2.NovoButtonElement, selector: "novo-button,button[theme]", inputs: ["color", "side", "size", "theme", "loading", "icon", "secondIcon", "disabled"] }, { kind: "component", type: i5.NovoLabel, selector: "novo-label,[novo-label]", inputs: ["id"] }, { kind: "directive", type: i5.PaddingDirective, selector: "[p],[padding],[paddingTop],[paddingRight],[paddingBottom],[paddingLeft],[paddingX],[paddingY],[pt],[pr],[pb],[pl],[px],[py]", inputs: ["padding", "p", "paddingLeft", "pl", "paddingRight", "pr", "paddingTop", "pt", "paddingBottom", "pb", "paddingX", "px", "paddingY", "py"] }, { kind: "directive", type: i5.GapDirective, selector: "[gap]", inputs: ["gap"] }, { kind: "directive", type: i5.ThemeColorDirective, selector: "[theme]", inputs: ["theme"] }, { kind: "component", type: i5.NovoOption, selector: "novo-option", inputs: ["selected", "keepOpen", "novoInert", "value", "disabled"], exportAs: ["novoOption"] }, { kind: "component", type: i5.NovoOptgroup, selector: "novo-optgroup", inputs: ["disabled", "label"], exportAs: ["novoOptgroup"] }, { kind: "component", type: i8.NovoFlexElement, selector: "novo-flex,novo-row", inputs: ["direction", "align", "justify", "wrap", "gap"] }, { kind: "component", type: i8.NovoStackElement, selector: "novo-stack,novo-column", inputs: ["direction", "align"] }, { kind: "component", type: i8$3.NovoDropdownElement, selector: "novo-dropdown", inputs: ["parentScrollSelector", "parentScrollAction", "containerClass", "side", "scrollStrategy", "keepOpen", "height", "width", "appendToBody", "multiple", "scrollToActiveItemOnOpen"], outputs: ["toggled"] }, { kind: "component", type: ConditionBuilderComponent, selector: "novo-condition-builder", inputs: ["label", "scope", "andIndex", "groupIndex", "addressConfig", "hideOperator", "conditionType", "config", "editTypeFn"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1686
1770
  }
1687
1771
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ConditionGroupComponent, decorators: [{
1688
1772
  type: Component,
1689
1773
  args: [{ selector: 'novo-condition-group', changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ConditionGroupComponent), multi: true }], host: {
1690
1774
  class: 'novo-condition-group',
1691
- }, standalone: false, template: "<div [formGroup]=\"parentForm\" class=\"condition-group-container\">\n <novo-stack [formArrayName]=\"controlName\" gap=\"md\">\n <ng-container\n *ngFor=\"let andGroup of root.controls; let andIndex = index; let isFirst = first;let isLast = last;\">\n <ng-container [formGroupName]=\"andIndex\">\n <novo-flex class=\"condition-row\" [ngClass]=\"{ isFirst: andIndex === 0 }\" [class]=\"scope\" align=\"end\" gap=\"sm\" #flex>\n <novo-dropdown *ngIf=\"(!isFirst || !hideFirstOperator) && qbs.allowedGroupings.length > 1; else labeledGroup\">\n <button theme=\"dialogue\" icon=\"collapse\" size=\"sm\">{{qbs.getConjunctionLabel(controlName)}}</button>\n <novo-optgroup>\n <novo-option *ngFor=\"let c of qbs.allowedGroupings\" (click)=\"updateControlName(c)\">\n {{qbs.getConjunctionLabel(c)}}</novo-option>\n </novo-optgroup>\n </novo-dropdown>\n <ng-template #labeledGroup>\n <novo-label *ngIf=\"!isFirst || !hideFirstOperator\" color=\"ash\" size=\"xs\" uppercase padding=\"sm\">\n {{qbs.getConjunctionLabel(controlName)}}</novo-label>\n </ng-template>\n <novo-condition-builder [groupIndex]=\"groupIndex\" [andIndex]=\"andIndex\" [hideOperator]=\"isFirst && hideFirstOperator\" [scope]=\"scope\" [conditionType]=\"controlName\"></novo-condition-builder>\n <novo-button class=\"delete-btn\" theme=\"icon\" icon=\"delete-o\" color=\"negative\" (click)=\"removeCondition(andIndex)\">\n </novo-button>\n </novo-flex>\n </ng-container>\n </ng-container>\n <button\n *ngIf=\"!qbs.hasMultipleScopes()\"\n theme=\"dialogue\"\n data-automation-id=\"add-advanced-search-condition\"\n icon=\"add-thin\"\n side=\"left\"\n size=\"sm\"\n uppercase\n (click)=\"addCondition()\">\n {{ labels.addCondition }}</button>\n </novo-stack>\n</div>\n", styles: [":host{position:relative;display:block;border:1px solid var(--border);border-radius:var(--border-radius-round);padding:var(--spacing-md);width:100%}:host .condition-row{width:100%}:host .delete-btn{margin-bottom:1px}\n"] }]
1775
+ }, standalone: false, template: "<div [formGroup]=\"parentForm\" class=\"condition-group-container\">\n <novo-stack [formArrayName]=\"controlName\" gap=\"md\">\n <ng-container\n *ngFor=\"let andGroup of root.controls; let andIndex = index; let isFirst = first;let isLast = last;\">\n <ng-container [formGroupName]=\"andIndex\">\n <novo-flex class=\"condition-row\" [ngClass]=\"{ isFirst: andIndex === 0 }\" [class]=\"entity || scope\" align=\"end\" gap=\"sm\" #flex>\n <novo-dropdown *ngIf=\"(!isFirst || !hideFirstOperator) && qbs.allowedGroupings.length > 1; else labeledGroup\" data-automation-id=\"groupings-dropdown\">\n <button theme=\"dialogue\" icon=\"collapse\" size=\"sm\">{{qbs.getConjunctionLabel(controlName)}}</button>\n <novo-optgroup>\n <novo-option *ngFor=\"let c of qbs.allowedGroupings\" (click)=\"updateControlName(c)\" [attr.data-automation-id]=\"c\">\n {{qbs.getConjunctionLabel(c)}}</novo-option>\n </novo-optgroup>\n </novo-dropdown>\n <ng-template #labeledGroup>\n <novo-label *ngIf=\"!isFirst || !hideFirstOperator\" color=\"ash\" size=\"xs\" uppercase padding=\"sm\">\n {{qbs.getConjunctionLabel(controlName)}}</novo-label>\n </ng-template>\n <novo-condition-builder [groupIndex]=\"groupIndex\" [andIndex]=\"andIndex\" [hideOperator]=\"isFirst && hideFirstOperator\" [scope]=\"scope\" [conditionType]=\"controlName\"></novo-condition-builder>\n <novo-button class=\"delete-btn\" theme=\"icon\" icon=\"delete-o\" color=\"negative\" (click)=\"removeCondition(andIndex)\">\n </novo-button>\n </novo-flex>\n </ng-container>\n </ng-container>\n <button\n *ngIf=\"!qbs.hasMultipleScopes()\"\n theme=\"dialogue\"\n data-automation-id=\"add-advanced-search-condition\"\n icon=\"add-thin\"\n side=\"left\"\n size=\"sm\"\n uppercase\n (click)=\"addCondition()\">\n {{ labels.addCondition }}</button>\n </novo-stack>\n</div>\n", styles: [":host{position:relative;display:block;border:1px solid var(--border);border-radius:var(--border-radius-round);padding:var(--spacing-md);width:100%}:host .condition-row{width:100%}:host .delete-btn{margin-bottom:1px}\n"] }]
1692
1776
  }], ctorParameters: () => [{ type: QueryBuilderService }, { type: i1.NovoLabelService }, { type: i3.ControlContainer }, { type: i3.FormBuilder }, { type: i0.ChangeDetectorRef }], propDecorators: { controlName: [{
1693
1777
  type: Input
1694
1778
  }], groupIndex: [{
@@ -1708,6 +1792,7 @@ const EMPTY_CONDITION = {
1708
1792
  scope: null,
1709
1793
  value: null,
1710
1794
  supportingValue: null,
1795
+ entity: null,
1711
1796
  };
1712
1797
  class CriteriaBuilderComponent {
1713
1798
  set HideFirstOperator(hide) {
@@ -1840,6 +1925,7 @@ class CriteriaBuilderComponent {
1840
1925
  return this.formBuilder.group(controls);
1841
1926
  }
1842
1927
  newCondition({ field, operator, scope, value, supportingValue } = EMPTY_CONDITION) {
1928
+ const entity = this.getFieldEntity(this.config, scope);
1843
1929
  return this.formBuilder.group({
1844
1930
  conditionType: '$and',
1845
1931
  field: [field, Validators.required],
@@ -1847,8 +1933,15 @@ class CriteriaBuilderComponent {
1847
1933
  scope: [scope],
1848
1934
  value: [value],
1849
1935
  supportingValue: [supportingValue],
1936
+ entity: [entity],
1850
1937
  });
1851
1938
  }
1939
+ getFieldEntity(fieldConfigs, scope) {
1940
+ if (Array.isArray(fieldConfigs?.fields)) {
1941
+ return fieldConfigs.fields.find(field => field.value === scope)?.entity;
1942
+ }
1943
+ return null;
1944
+ }
1852
1945
  removeConditionGroupAt(index) {
1853
1946
  this.root.removeAt(index, { emitEvent: false });
1854
1947
  }
@@ -1859,7 +1952,7 @@ class CriteriaBuilderComponent {
1859
1952
  }
1860
1953
  onFieldSelect(field) {
1861
1954
  this.scopedFieldPicker().dropdown.closePanel();
1862
- const condition = { field: field.name, operator: null, scope: field.scope, value: null };
1955
+ const condition = { field: field.name, operator: null, scope: field.scope, value: null, entity: field.entity };
1863
1956
  const group = this.conditionGroups().find((group) => group.scope === field.scope);
1864
1957
  if (group) {
1865
1958
  group.addCondition(condition);