You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(dialog): support minWidth, minHeight, maxWidth and maxHeight (#7488)
* feat(dialog): support minWidth, minHeight, maxWidth and maxHeight
* Adds Dialog support for `minWidth`, `minHeight`, `maxWidth` and `maxHeight` via config. Mostly delegates to Overlay.
* Moves declared `max-width` on `. mat-dialog-container` stylesheet to be authored via `MatDialogConfig`, providing the same default `80vw` value. Without this change, there would likely be undesired layout results due to different constraints being set on the overlay container vs the nested the dialog container.
* Added note on `minHeight` and `maxHeight` regarding the potential need to also set a `height` due to the rules around computed height resolution (https://www.w3.org/TR/CSS2/visudet.html#min-max-widths). Any value set on `height` as a default would probably be assuming too much and may have varying results across browsers.
* test(dialog): add tests for minWidth, minHeight, maxWidth and maxHeight
* demo(dialog): add fields for minWidth, minHeight, maxWidth and maxHeight
Not adding `minWidth`, `minHeight`, `maxWidth` and `maxHeight` to `config` to avoid overriding the default value of `maxWidth` particularly—the type checker will require it to be a string. Instead, setting `config` to type `MatDialogConfig` is prefered to appease the type checker since those four properties are optional.
* demo(dialog): address AOT issues
Appeases the AOT type checker for the template by extending `MatDialogConfig` to disallow `position` from being undefined, given that it’s optional. Guards cannot be set on the template because the values are bound to NgModel.
* chore(dialog): address feedback regarding over-verbose comments
* fix(dialog): address feedback to not initialize some dialog config props
* demo(dialog): set init values for minWidth, minHeight, maxWidth and maxHeight
* chore(dialog): allow number|string for min/max widths and heights
0 commit comments