Gets how wide the overlay panel should be.
(
preferredOrigin: ElementRef<ElementRef> | CdkOverlayOrigin | undefined,
)
| 1137 | |
| 1138 | /** Gets how wide the overlay panel should be. */ |
| 1139 | private _getOverlayWidth( |
| 1140 | preferredOrigin: ElementRef<ElementRef> | CdkOverlayOrigin | undefined, |
| 1141 | ): string | number { |
| 1142 | if (this.panelWidth === 'auto') { |
| 1143 | const refToMeasure = |
| 1144 | preferredOrigin instanceof CdkOverlayOrigin |
| 1145 | ? preferredOrigin.elementRef |
| 1146 | : preferredOrigin || this._elementRef; |
| 1147 | return refToMeasure.nativeElement.getBoundingClientRect().width; |
| 1148 | } |
| 1149 | |
| 1150 | return this.panelWidth === null ? '' : this.panelWidth; |
| 1151 | } |
| 1152 | /** Syncs the parent state with the individual options. */ |
| 1153 | _syncParentProperties(): void { |
| 1154 | if (this.options) { |
no test coverage detected