novo-elements 11.2.1 → 11.3.0-next.2
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/elements/data-table/interfaces.d.ts +1 -0
- package/elements/query-builder/condition-builder/condition-builder.component.d.ts +1 -0
- package/elements/query-builder/condition-definitions/boolean-condition.definition.d.ts +1 -0
- package/fesm2022/novo-elements-elements-data-table.mjs.map +1 -1
- package/fesm2022/novo-elements-elements-query-builder.mjs +51 -15
- package/fesm2022/novo-elements-elements-query-builder.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ import * as i1 from 'novo-elements/services';
|
|
|
6
6
|
import { NovoLabelService } from 'novo-elements/services';
|
|
7
7
|
import { Subject, Subscription, merge, interval } from 'rxjs';
|
|
8
8
|
import { debounceTime, distinctUntilChanged, takeUntil, startWith, filter, debounce } from 'rxjs/operators';
|
|
9
|
+
import { Helpers } from 'novo-elements/utils';
|
|
9
10
|
import * as i2 from '@angular/common';
|
|
10
11
|
import { CommonModule } from '@angular/common';
|
|
11
12
|
import * as i5 from 'novo-elements/elements/common';
|
|
@@ -40,7 +41,6 @@ import * as i8$2 from 'novo-elements/elements/form';
|
|
|
40
41
|
import { NovoFormModule, NovoFormExtrasModule } from 'novo-elements/elements/form';
|
|
41
42
|
import * as i7$1 from 'novo-elements/elements/tabbed-group-picker';
|
|
42
43
|
import { NovoTabbedGroupPickerElement, NovoTabbedGroupPickerModule } from 'novo-elements/elements/tabbed-group-picker';
|
|
43
|
-
import { Helpers } from 'novo-elements/utils';
|
|
44
44
|
import * as i5$2 from 'novo-elements/elements/button';
|
|
45
45
|
import { NovoButtonModule } from 'novo-elements/elements/button';
|
|
46
46
|
import * as i8$3 from 'novo-elements/elements/dropdown';
|
|
@@ -625,8 +625,11 @@ class NovoDefaultBooleanConditionDef extends AbstractConditionFieldDef {
|
|
|
625
625
|
this.defaultOperator = Operator.include;
|
|
626
626
|
this.defineOperatorEditGroup(Operator.include, Operator.exclude, Operator.isNull);
|
|
627
627
|
}
|
|
628
|
+
optIdentify(option) {
|
|
629
|
+
return option.label;
|
|
630
|
+
}
|
|
628
631
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: NovoDefaultBooleanConditionDef, deps: [{ token: i1.NovoLabelService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
629
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
632
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: NovoDefaultBooleanConditionDef, isStandalone: false, selector: "novo-boolean-condition-def", usesInheritance: true, ngImport: i0, template: `
|
|
630
633
|
<ng-container novoConditionFieldDef>
|
|
631
634
|
<novo-field *novoConditionOperatorsDef="let formGroup; fieldMeta as meta" [formGroup]="formGroup">
|
|
632
635
|
<novo-select [placeholder]="labels.operator" formControlName="operator" (onSelect)="onOperatorSelect(formGroup)">
|
|
@@ -635,14 +638,23 @@ class NovoDefaultBooleanConditionDef extends AbstractConditionFieldDef {
|
|
|
635
638
|
<novo-option value="isNull" *ngIf="!meta?.removeIsEmpty">{{ labels.isEmpty }}</novo-option>
|
|
636
639
|
</novo-select>
|
|
637
640
|
</novo-field>
|
|
638
|
-
<novo-field *novoConditionInputDef="let formGroup" [style.
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
641
|
+
<novo-field *novoConditionInputDef="let formGroup; fieldMeta as meta" [style.maxWidth.px]="250" [formGroup]="formGroup">
|
|
642
|
+
@let isNull = formGroup.value.operator === 'isNull';
|
|
643
|
+
@let useYesNo = isNull || meta.dataType === 'Boolean';
|
|
644
|
+
@let customOptions = !isNull && meta.options?.length === 2;
|
|
645
|
+
@if (customOptions) {
|
|
646
|
+
<novo-radio-group formControlName="value">
|
|
647
|
+
<novo-radio *ngFor="let opt of meta.options; trackBy: optIdentify" [value]="opt.value">{{ opt.label }}</novo-radio>
|
|
648
|
+
</novo-radio-group>
|
|
649
|
+
} @else {
|
|
650
|
+
<novo-radio-group formControlName="value">
|
|
651
|
+
<novo-radio [value]="true">{{ useYesNo ? labels.yes : labels.true }}</novo-radio>
|
|
652
|
+
<novo-radio [value]="false">{{ useYesNo ? labels.no : labels.false }}</novo-radio>
|
|
653
|
+
</novo-radio-group>
|
|
654
|
+
}
|
|
643
655
|
</novo-field>
|
|
644
656
|
</ng-container>
|
|
645
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { 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.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5$1.NovoSelectElement, selector: "novo-select", inputs: ["disabled", "required", "tabIndex", "id", "name", "placeholder", "readonly", "headerConfig", "position", "overlayWidth", "overlayHeight", "displayIcon", "displayWith", "compareWith", "hideLegacyOptions", "value", "multiple", "options"], outputs: ["onSelect", "selectionChange", "valueChange", "openedChange", "opened", "closed"] }, { kind: "component", type: i6.NovoFieldElement, selector: "novo-field", inputs: ["layout", "appearance", "customOverlayOrigin", "width"], outputs: ["valueChanges", "stateChanges"] }, { kind: "component", type: i5.NovoOption, selector: "novo-option", inputs: ["selected", "keepOpen", "novoInert", "value", "disabled"], exportAs: ["novoOption"] }, { kind: "component", type: i9$1.NovoRadioElement, selector: "novo-radio", inputs: ["id", "name", "tabindex", "vertical", "label", "button", "theme", "size", "icon", "color", "disabled", "checked", "value"], outputs: ["change", "blur", "focus"] }, { kind: "component", type: i9$1.NovoRadioGroup, selector: "novo-radio-group", inputs: ["id", "tabindex", "errorStateMatcher", "appearance", "value", "name", "disabled", "required", "placeholder"], outputs: ["change", "blur"] }, { kind: "directive", type: NovoConditionOperatorsDef, selector: "[novoConditionOperatorsDef]" }, { kind: "directive", type: NovoConditionInputDef, selector: "[novoConditionInputDef]" }, { kind: "directive", type: NovoConditionFieldDef, selector: "[novoConditionFieldDef]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
|
|
657
|
+
`, isInline: true, dependencies: [{ 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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { 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.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5$1.NovoSelectElement, selector: "novo-select", inputs: ["disabled", "required", "tabIndex", "id", "name", "placeholder", "readonly", "headerConfig", "position", "overlayWidth", "overlayHeight", "displayIcon", "displayWith", "compareWith", "hideLegacyOptions", "value", "multiple", "options"], outputs: ["onSelect", "selectionChange", "valueChange", "openedChange", "opened", "closed"] }, { kind: "component", type: i6.NovoFieldElement, selector: "novo-field", inputs: ["layout", "appearance", "customOverlayOrigin", "width"], outputs: ["valueChanges", "stateChanges"] }, { kind: "component", type: i5.NovoOption, selector: "novo-option", inputs: ["selected", "keepOpen", "novoInert", "value", "disabled"], exportAs: ["novoOption"] }, { kind: "component", type: i9$1.NovoRadioElement, selector: "novo-radio", inputs: ["id", "name", "tabindex", "vertical", "label", "button", "theme", "size", "icon", "color", "disabled", "checked", "value"], outputs: ["change", "blur", "focus"] }, { kind: "component", type: i9$1.NovoRadioGroup, selector: "novo-radio-group", inputs: ["id", "tabindex", "errorStateMatcher", "appearance", "value", "name", "disabled", "required", "placeholder"], outputs: ["change", "blur"] }, { kind: "directive", type: NovoConditionOperatorsDef, selector: "[novoConditionOperatorsDef]" }, { kind: "directive", type: NovoConditionInputDef, selector: "[novoConditionInputDef]" }, { kind: "directive", type: NovoConditionFieldDef, selector: "[novoConditionFieldDef]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
|
|
646
658
|
}
|
|
647
659
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: NovoDefaultBooleanConditionDef, decorators: [{
|
|
648
660
|
type: Component,
|
|
@@ -657,11 +669,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
657
669
|
<novo-option value="isNull" *ngIf="!meta?.removeIsEmpty">{{ labels.isEmpty }}</novo-option>
|
|
658
670
|
</novo-select>
|
|
659
671
|
</novo-field>
|
|
660
|
-
<novo-field *novoConditionInputDef="let formGroup" [style.
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
672
|
+
<novo-field *novoConditionInputDef="let formGroup; fieldMeta as meta" [style.maxWidth.px]="250" [formGroup]="formGroup">
|
|
673
|
+
@let isNull = formGroup.value.operator === 'isNull';
|
|
674
|
+
@let useYesNo = isNull || meta.dataType === 'Boolean';
|
|
675
|
+
@let customOptions = !isNull && meta.options?.length === 2;
|
|
676
|
+
@if (customOptions) {
|
|
677
|
+
<novo-radio-group formControlName="value">
|
|
678
|
+
<novo-radio *ngFor="let opt of meta.options; trackBy: optIdentify" [value]="opt.value">{{ opt.label }}</novo-radio>
|
|
679
|
+
</novo-radio-group>
|
|
680
|
+
} @else {
|
|
681
|
+
<novo-radio-group formControlName="value">
|
|
682
|
+
<novo-radio [value]="true">{{ useYesNo ? labels.yes : labels.true }}</novo-radio>
|
|
683
|
+
<novo-radio [value]="false">{{ useYesNo ? labels.no : labels.false }}</novo-radio>
|
|
684
|
+
</novo-radio-group>
|
|
685
|
+
}
|
|
665
686
|
</novo-field>
|
|
666
687
|
</ng-container>
|
|
667
688
|
`,
|
|
@@ -1515,7 +1536,7 @@ class ConditionBuilderComponent {
|
|
|
1515
1536
|
}
|
|
1516
1537
|
}
|
|
1517
1538
|
ngOnDestroy() {
|
|
1518
|
-
this.searches
|
|
1539
|
+
this.searches?.unsubscribe();
|
|
1519
1540
|
// Clear all outlets and Maps
|
|
1520
1541
|
[this._operatorOutlet.viewContainer, this._inputOutlet.viewContainer].forEach((def) => {
|
|
1521
1542
|
def.clear();
|
|
@@ -1591,14 +1612,29 @@ class ConditionBuilderComponent {
|
|
|
1591
1612
|
if (!field) {
|
|
1592
1613
|
return;
|
|
1593
1614
|
}
|
|
1594
|
-
|
|
1615
|
+
let editType = this.editTypeFn()(field);
|
|
1595
1616
|
// Don't look at dataSpecialization it is no good, this misses currency, and percent
|
|
1596
1617
|
const { name } = field;
|
|
1618
|
+
if (editType.toUpperCase() === 'RADIO') {
|
|
1619
|
+
editType = this.doesFieldQualifyAsBinary(field) ? 'BOOLEAN' : 'SELECT';
|
|
1620
|
+
}
|
|
1597
1621
|
const fieldDefsByName = this.queryBuilderService.getFieldDefsByName();
|
|
1598
1622
|
// Check Fields by priority for match Field Definition
|
|
1599
1623
|
const key = [name, editType?.toUpperCase(), 'DEFAULT'].find((it) => fieldDefsByName.has(it));
|
|
1600
1624
|
return fieldDefsByName.get(key);
|
|
1601
1625
|
}
|
|
1626
|
+
doesFieldQualifyAsBinary(field) {
|
|
1627
|
+
if (field.dataType === 'Boolean') {
|
|
1628
|
+
return true;
|
|
1629
|
+
}
|
|
1630
|
+
// If no options are presented, use True/False options.
|
|
1631
|
+
const optionCount = field.options?.length;
|
|
1632
|
+
if (!Helpers.isNumber(optionCount) || optionCount === 0) {
|
|
1633
|
+
return true;
|
|
1634
|
+
}
|
|
1635
|
+
// If the field uses 2 options, we can show 2 radio values for that. 1 is an invalid state, but better displayed with a Select picker.
|
|
1636
|
+
return field.options.length === 2;
|
|
1637
|
+
}
|
|
1602
1638
|
createFieldTemplates() {
|
|
1603
1639
|
const definition = this.findDefinitionForField(this.getField());
|
|
1604
1640
|
if (!this.parentForm.get('operator').value) {
|