mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 10:41:13 +08:00
feat(textarea): add legacy prop (#26783)
This commit is contained in:
@ -2159,7 +2159,7 @@ export declare interface IonText extends Components.IonText {}
|
|||||||
|
|
||||||
|
|
||||||
@ProxyCmp({
|
@ProxyCmp({
|
||||||
inputs: ['autoGrow', 'autocapitalize', 'autofocus', 'clearOnEdit', 'color', 'cols', 'counter', 'counterFormatter', 'debounce', 'disabled', 'enterkeyhint', 'errorText', 'fill', 'helperText', 'inputmode', 'label', 'labelPlacement', 'maxlength', 'minlength', 'mode', 'name', 'placeholder', 'readonly', 'required', 'rows', 'shape', 'spellcheck', 'value', 'wrap'],
|
inputs: ['autoGrow', 'autocapitalize', 'autofocus', 'clearOnEdit', 'color', 'cols', 'counter', 'counterFormatter', 'debounce', 'disabled', 'enterkeyhint', 'errorText', 'fill', 'helperText', 'inputmode', 'label', 'labelPlacement', 'legacy', 'maxlength', 'minlength', 'mode', 'name', 'placeholder', 'readonly', 'required', 'rows', 'shape', 'spellcheck', 'value', 'wrap'],
|
||||||
methods: ['setFocus', 'getInputElement']
|
methods: ['setFocus', 'getInputElement']
|
||||||
})
|
})
|
||||||
@Component({
|
@Component({
|
||||||
@ -2167,7 +2167,7 @@ export declare interface IonText extends Components.IonText {}
|
|||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
template: '<ng-content></ng-content>',
|
template: '<ng-content></ng-content>',
|
||||||
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
||||||
inputs: ['autoGrow', 'autocapitalize', 'autofocus', 'clearOnEdit', 'color', 'cols', 'counter', 'counterFormatter', 'debounce', 'disabled', 'enterkeyhint', 'errorText', 'fill', 'helperText', 'inputmode', 'label', 'labelPlacement', 'maxlength', 'minlength', 'mode', 'name', 'placeholder', 'readonly', 'required', 'rows', 'shape', 'spellcheck', 'value', 'wrap'],
|
inputs: ['autoGrow', 'autocapitalize', 'autofocus', 'clearOnEdit', 'color', 'cols', 'counter', 'counterFormatter', 'debounce', 'disabled', 'enterkeyhint', 'errorText', 'fill', 'helperText', 'inputmode', 'label', 'labelPlacement', 'legacy', 'maxlength', 'minlength', 'mode', 'name', 'placeholder', 'readonly', 'required', 'rows', 'shape', 'spellcheck', 'value', 'wrap'],
|
||||||
})
|
})
|
||||||
export class IonTextarea {
|
export class IonTextarea {
|
||||||
protected el: HTMLElement;
|
protected el: HTMLElement;
|
||||||
|
@ -1362,6 +1362,7 @@ ion-textarea,prop,helperText,string | undefined,undefined,false,false
|
|||||||
ion-textarea,prop,inputmode,"decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url" | undefined,undefined,false,false
|
ion-textarea,prop,inputmode,"decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url" | undefined,undefined,false,false
|
||||||
ion-textarea,prop,label,string | undefined,undefined,false,false
|
ion-textarea,prop,label,string | undefined,undefined,false,false
|
||||||
ion-textarea,prop,labelPlacement,"end" | "fixed" | "floating" | "stacked" | "start",'start',false,false
|
ion-textarea,prop,labelPlacement,"end" | "fixed" | "floating" | "stacked" | "start",'start',false,false
|
||||||
|
ion-textarea,prop,legacy,boolean | undefined,undefined,false,false
|
||||||
ion-textarea,prop,maxlength,number | undefined,undefined,false,false
|
ion-textarea,prop,maxlength,number | undefined,undefined,false,false
|
||||||
ion-textarea,prop,minlength,number | undefined,undefined,false,false
|
ion-textarea,prop,minlength,number | undefined,undefined,false,false
|
||||||
ion-textarea,prop,mode,"ios" | "md",undefined,false,false
|
ion-textarea,prop,mode,"ios" | "md",undefined,false,false
|
||||||
|
8
core/src/components.d.ts
vendored
8
core/src/components.d.ts
vendored
@ -2983,6 +2983,10 @@ export namespace Components {
|
|||||||
* Where to place the label relative to the textarea. `'start'`: The label will appear to the left of the textarea in LTR and to the right in RTL. `'end'`: The label will appear to the right of the textarea in LTR and to the left in RTL. `'floating'`: The label will appear smaller and above the textarea when the textarea is focused or it has a value. Otherwise it will appear on top of the textarea. `'stacked'`: The label will appear smaller and above the textarea regardless even when the textarea is blurred or has no value. `'fixed'`: The label has the same behavior as `'start'` except it also has a fixed width. Long text will be truncated with ellipses ("...").
|
* Where to place the label relative to the textarea. `'start'`: The label will appear to the left of the textarea in LTR and to the right in RTL. `'end'`: The label will appear to the right of the textarea in LTR and to the left in RTL. `'floating'`: The label will appear smaller and above the textarea when the textarea is focused or it has a value. Otherwise it will appear on top of the textarea. `'stacked'`: The label will appear smaller and above the textarea regardless even when the textarea is blurred or has no value. `'fixed'`: The label has the same behavior as `'start'` except it also has a fixed width. Long text will be truncated with ellipses ("...").
|
||||||
*/
|
*/
|
||||||
"labelPlacement": 'start' | 'end' | 'floating' | 'stacked' | 'fixed';
|
"labelPlacement": 'start' | 'end' | 'floating' | 'stacked' | 'fixed';
|
||||||
|
/**
|
||||||
|
* Set the `legacy` property to `true` to forcibly use the legacy form control markup. Ionic will only opt components in to the modern form markup when they are using either the `aria-label` attribute or the default slot that contains the label text. As a result, the `legacy` property should only be used as an escape hatch when you want to avoid this automatic opt-in behavior. Note that this property will be removed in an upcoming major release of Ionic, and all form components will be opted-in to using the modern form markup.
|
||||||
|
*/
|
||||||
|
"legacy"?: boolean;
|
||||||
/**
|
/**
|
||||||
* This attribute specifies the maximum number of characters that the user can enter.
|
* This attribute specifies the maximum number of characters that the user can enter.
|
||||||
*/
|
*/
|
||||||
@ -7053,6 +7057,10 @@ declare namespace LocalJSX {
|
|||||||
* Where to place the label relative to the textarea. `'start'`: The label will appear to the left of the textarea in LTR and to the right in RTL. `'end'`: The label will appear to the right of the textarea in LTR and to the left in RTL. `'floating'`: The label will appear smaller and above the textarea when the textarea is focused or it has a value. Otherwise it will appear on top of the textarea. `'stacked'`: The label will appear smaller and above the textarea regardless even when the textarea is blurred or has no value. `'fixed'`: The label has the same behavior as `'start'` except it also has a fixed width. Long text will be truncated with ellipses ("...").
|
* Where to place the label relative to the textarea. `'start'`: The label will appear to the left of the textarea in LTR and to the right in RTL. `'end'`: The label will appear to the right of the textarea in LTR and to the left in RTL. `'floating'`: The label will appear smaller and above the textarea when the textarea is focused or it has a value. Otherwise it will appear on top of the textarea. `'stacked'`: The label will appear smaller and above the textarea regardless even when the textarea is blurred or has no value. `'fixed'`: The label has the same behavior as `'start'` except it also has a fixed width. Long text will be truncated with ellipses ("...").
|
||||||
*/
|
*/
|
||||||
"labelPlacement"?: 'start' | 'end' | 'floating' | 'stacked' | 'fixed';
|
"labelPlacement"?: 'start' | 'end' | 'floating' | 'stacked' | 'fixed';
|
||||||
|
/**
|
||||||
|
* Set the `legacy` property to `true` to forcibly use the legacy form control markup. Ionic will only opt components in to the modern form markup when they are using either the `aria-label` attribute or the default slot that contains the label text. As a result, the `legacy` property should only be used as an escape hatch when you want to avoid this automatic opt-in behavior. Note that this property will be removed in an upcoming major release of Ionic, and all form components will be opted-in to using the modern form markup.
|
||||||
|
*/
|
||||||
|
"legacy"?: boolean;
|
||||||
/**
|
/**
|
||||||
* This attribute specifies the maximum number of characters that the user can enter.
|
* This attribute specifies the maximum number of characters that the user can enter.
|
||||||
*/
|
*/
|
||||||
|
@ -218,6 +218,17 @@ export class Textarea implements ComponentInterface {
|
|||||||
*/
|
*/
|
||||||
@Prop() labelPlacement: 'start' | 'end' | 'floating' | 'stacked' | 'fixed' = 'start';
|
@Prop() labelPlacement: 'start' | 'end' | 'floating' | 'stacked' | 'fixed' = 'start';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the `legacy` property to `true` to forcibly use the legacy form control markup.
|
||||||
|
* Ionic will only opt components in to the modern form markup when they are
|
||||||
|
* using either the `aria-label` attribute or the default slot that contains
|
||||||
|
* the label text. As a result, the `legacy` property should only be used as
|
||||||
|
* an escape hatch when you want to avoid this automatic opt-in behavior.
|
||||||
|
* Note that this property will be removed in an upcoming major release
|
||||||
|
* of Ionic, and all form components will be opted-in to using the modern form markup.
|
||||||
|
*/
|
||||||
|
@Prop() legacy?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The shape of the textarea. If "round" it will have an increased border radius.
|
* The shape of the textarea. If "round" it will have an increased border radius.
|
||||||
*/
|
*/
|
||||||
|
@ -809,6 +809,7 @@ export const IonTextarea = /*@__PURE__*/ defineContainer<JSX.IonTextarea>('ion-t
|
|||||||
'helperText',
|
'helperText',
|
||||||
'label',
|
'label',
|
||||||
'labelPlacement',
|
'labelPlacement',
|
||||||
|
'legacy',
|
||||||
'shape',
|
'shape',
|
||||||
'ionChange',
|
'ionChange',
|
||||||
'ionInput',
|
'ionInput',
|
||||||
|
Reference in New Issue
Block a user