ngx-render-material-forms 1.1.0 → 1.1.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/esm2020/lib/components/select/select.component.mjs +22 -4
- package/fesm2015/ngx-render-material-forms.js +21 -3
- package/fesm2015/ngx-render-material-forms.mjs.map +1 -1
- package/fesm2020/ngx-render-material-forms.js +21 -3
- package/fesm2020/ngx-render-material-forms.mjs.map +1 -1
- package/lib/components/select/select.component.d.ts +3 -0
- package/package.json +6 -6
|
@@ -2562,6 +2562,21 @@ class MaterialSelectComponent extends MaterialComponent {
|
|
|
2562
2562
|
});
|
|
2563
2563
|
this.filteredOptions = this.selectOptions;
|
|
2564
2564
|
}
|
|
2565
|
+
calculateViewportHeight() {
|
|
2566
|
+
if (!this.viewport)
|
|
2567
|
+
return 0;
|
|
2568
|
+
// Get the range of rendered items
|
|
2569
|
+
const renderedRange = this.viewport.getRenderedRange();
|
|
2570
|
+
// Get the number of items in the rendered range
|
|
2571
|
+
const itemCount = renderedRange.end - renderedRange.start;
|
|
2572
|
+
console.log(itemCount);
|
|
2573
|
+
// Calculate the total height of items
|
|
2574
|
+
const totalHeight = itemCount * 200; // Assuming each item has a height of 50 pixels
|
|
2575
|
+
// Add extra padding if needed
|
|
2576
|
+
const padding = 500; // Adjust as needed
|
|
2577
|
+
// Return the calculated height
|
|
2578
|
+
return totalHeight + padding;
|
|
2579
|
+
}
|
|
2565
2580
|
// onFilter(value) {
|
|
2566
2581
|
// this.filteredOptions = this.selectOptions.then((options) => {
|
|
2567
2582
|
// const filtered = options.filter((option) => option.label.toLowerCase().indexOf(value.toLowerCase()) !== -1);
|
|
@@ -2574,7 +2589,7 @@ class MaterialSelectComponent extends MaterialComponent {
|
|
|
2574
2589
|
}
|
|
2575
2590
|
}
|
|
2576
2591
|
MaterialSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: MaterialSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2577
|
-
MaterialSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: MaterialSelectComponent, selector: "mat-formio-select", viewQueries: [{ propertyName: "multiSelect", first: true, predicate: ["multiSelect"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
2592
|
+
MaterialSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: MaterialSelectComponent, selector: "mat-formio-select", viewQueries: [{ propertyName: "multiSelect", first: true, predicate: ["multiSelect"], descendants: true, static: true }, { propertyName: "viewport", first: true, predicate: ["viewport"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
2578
2593
|
<mat-formio-form-field [instance]="instance" [componentTemplate]="componentTemplate"></mat-formio-form-field>
|
|
2579
2594
|
<ng-template #componentTemplate let-hasLabel>
|
|
2580
2595
|
<mat-form-field fxFill>
|
|
@@ -2599,7 +2614,7 @@ MaterialSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0"
|
|
|
2599
2614
|
</mat-option>
|
|
2600
2615
|
|
|
2601
2616
|
<ng-container *ngIf="(filteredOptions | async)?.length > 4; else regularOptions">
|
|
2602
|
-
<cdk-virtual-scroll-viewport itemSize="50" class="example-viewport">
|
|
2617
|
+
<cdk-virtual-scroll-viewport itemSize="50" [minBufferPx]="500" [maxBufferPx]="1000" class="example-viewport">
|
|
2603
2618
|
<mat-option *cdkVirtualFor="let option of filteredOptions | async" [value]="option.value">
|
|
2604
2619
|
<span [innerHTML]="option.label"></span>
|
|
2605
2620
|
</mat-option>
|
|
@@ -2651,7 +2666,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImpor
|
|
|
2651
2666
|
</mat-option>
|
|
2652
2667
|
|
|
2653
2668
|
<ng-container *ngIf="(filteredOptions | async)?.length > 4; else regularOptions">
|
|
2654
|
-
<cdk-virtual-scroll-viewport itemSize="50" class="example-viewport">
|
|
2669
|
+
<cdk-virtual-scroll-viewport itemSize="50" [minBufferPx]="500" [maxBufferPx]="1000" class="example-viewport">
|
|
2655
2670
|
<mat-option *cdkVirtualFor="let option of filteredOptions | async" [value]="option.value">
|
|
2656
2671
|
<span [innerHTML]="option.label"></span>
|
|
2657
2672
|
</mat-option>
|
|
@@ -2679,6 +2694,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImpor
|
|
|
2679
2694
|
}], propDecorators: { multiSelect: [{
|
|
2680
2695
|
type: ViewChild,
|
|
2681
2696
|
args: ['multiSelect', { static: true }]
|
|
2697
|
+
}], viewport: [{
|
|
2698
|
+
type: ViewChild,
|
|
2699
|
+
args: ['viewport']
|
|
2682
2700
|
}] } });
|
|
2683
2701
|
SelectComponent.MaterialComponent = MaterialSelectComponent;
|
|
2684
2702
|
// Make sure we detect changes when new items make their way into the select dropdown.
|