feat(datetime): add size property (#23649)

resolves #23518
This commit is contained in:
William Martin
2021-07-20 12:31:38 -04:00
committed by GitHub
parent 2c07a1566b
commit 321341d97d
13 changed files with 184 additions and 5 deletions

View File

@ -318,6 +318,12 @@ export class Datetime implements ComponentInterface {
*/
@Prop() showDefaultTimeLabel = true;
/**
* If `cover`, the `ion-datetime` will expand to cover the full width of its container.
* If `fixed`, the `ion-datetime` will have a fixed width.
*/
@Prop() size: 'cover' | 'fixed' = 'fixed';
/**
* Emitted when the datetime selection was cancelled.
*/
@ -1525,7 +1531,7 @@ export class Datetime implements ComponentInterface {
}
render() {
const { name, value, disabled, el, color, isPresented, readonly, showMonthAndYear, presentation } = this;
const { name, value, disabled, el, color, isPresented, readonly, showMonthAndYear, presentation, size } = this;
const mode = getIonMode(this);
renderHiddenInput(true, el, name, value, disabled);
@ -1540,7 +1546,8 @@ export class Datetime implements ComponentInterface {
['datetime-readonly']: readonly,
['datetime-disabled']: disabled,
'show-month-and-year': showMonthAndYear,
[`datetime-presentation-${presentation}`]: true
[`datetime-presentation-${presentation}`]: true,
[`datetime-size-${size}`]: true
})
}}
>