Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/angular/src/lib/stencil-generated/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ export declare interface GcdsIcon extends Components.GcdsIcon {}


@ProxyCmp({
inputs: ['autocomplete', 'autofocus', 'disabled', 'errorMessage', 'form', 'hideLabel', 'hint', 'inputId', 'label', 'max', 'maxlength', 'min', 'minlength', 'name', 'pattern', 'readonly', 'required', 'size', 'step', 'suggestions', 'type', 'validateOn', 'validator', 'validity', 'value'],
inputs: ['autocomplete', 'autofocus', 'disabled', 'errorMessage', 'form', 'hideLabel', 'hint', 'inputId', 'inputmode', 'label', 'max', 'maxlength', 'min', 'minlength', 'name', 'pattern', 'readonly', 'required', 'size', 'step', 'suggestions', 'type', 'validateOn', 'validator', 'validity', 'value'],
methods: ['validate', 'checkValidity', 'getValidationMessage'],
outputs: ['gcdsFocus', 'gcdsBlur', 'gcdsInput', 'gcdsSuggestionSelected', 'gcdsChange', 'gcdsError', 'gcdsValid']
})
Expand All @@ -1199,7 +1199,7 @@ export declare interface GcdsIcon extends Components.GcdsIcon {}
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['autocomplete', 'autofocus', 'disabled', 'errorMessage', 'form', 'hideLabel', 'hint', 'inputId', 'label', 'max', 'maxlength', 'min', 'minlength', 'name', 'pattern', 'readonly', 'required', 'size', 'step', 'suggestions', 'type', 'validateOn', 'validator', 'validity', 'value'],
inputs: ['autocomplete', 'autofocus', 'disabled', 'errorMessage', 'form', 'hideLabel', 'hint', 'inputId', 'inputmode', 'label', 'max', 'maxlength', 'min', 'minlength', 'name', 'pattern', 'readonly', 'required', 'size', 'step', 'suggestions', 'type', 'validateOn', 'validator', 'validity', 'value'],
outputs: ['gcdsFocus', 'gcdsBlur', 'gcdsInput', 'gcdsSuggestionSelected', 'gcdsChange', 'gcdsError', 'gcdsValid'],
standalone: false,
})
Expand Down Expand Up @@ -1247,6 +1247,10 @@ of the expected text length to the user.
*/
set type(_: Components.GcdsInput['type']) {};
/**
* @default null
*/
set inputmode(_: Components.GcdsInput['inputmode']) {};
/**
* Default value for an input element.
*/
set value(_: Components.GcdsInput['value']) {};
Expand Down
1 change: 1 addition & 0 deletions packages/vue/lib/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ export const GcdsInput: StencilVueComponent<JSX.GcdsInput, JSX.GcdsInput["value"
'required',
'size',
'type',
'inputmode',
'value',
'autocomplete',
'autofocus',
Expand Down
22 changes: 22 additions & 0 deletions packages/web/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,17 @@ export namespace Components {
* Id attribute for an input element.
*/
"inputId": string;
/**
* @default null
*/
"inputmode"?: | 'none'
| 'text'
| 'decimal'
| 'numeric'
| 'tel'
| 'search'
| 'email'
| 'url';
/**
* Form field label
*/
Expand Down Expand Up @@ -3110,6 +3121,17 @@ declare namespace LocalJSX {
* Id attribute for an input element.
*/
"inputId": string;
/**
* @default null
*/
"inputmode"?: | 'none'
| 'text'
| 'decimal'
| 'numeric'
| 'tel'
| 'search'
| 'email'
| 'url';
/**
* Form field label
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ export class GcdsDateInput {
label={i18n[lang].year}
inputId="year"
type="number"
inputmode="numeric"
size={4}
disabled={disabled}
value={this.yearValue}
Expand All @@ -470,6 +471,7 @@ export class GcdsDateInput {
label={i18n[lang].day}
inputId="day"
type="number"
inputmode="numeric"
size={2}
disabled={disabled}
value={this.dayValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ describe('gcds-date-input', () => {
December
</option>
</gcds-select>
<gcds-input aria-invalid="false" class="gcds-date-input__day" inputid="day" label="Day" name="day" size="2" type="number" value="" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" value="" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__day" inputid="day" label="Day" name="day" size="2" type="number" inputmode="numeric" value="" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" inputmode="numeric" value="" validate-on="other"></gcds-input>
</fieldset>
</gcds-date-input>
`);
Expand All @@ -71,7 +71,7 @@ describe('gcds-date-input', () => {
<legend id="date-input-legend">
Date input
</legend>
<gcds-input aria-invalid="false" class="gcds-date-input__day" inputid="day" label="Jour" name="day" size="2" type="number" value="" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__day" inputid="day" label="Jour" name="day" size="2" type="number" inputmode="numeric" value="" validate-on="other"></gcds-input>
<gcds-select aria-invalid="false" class="gcds-date-input__month" defaultvalue="Sélectionnez un mois" label="Mois" name="month" selectid="month" value="">
<option value="01">
janvier
Expand Down Expand Up @@ -110,7 +110,7 @@ describe('gcds-date-input', () => {
décembre
</option>
</gcds-select>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Année" name="year" size="4" type="number" value="" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Année" name="year" size="4" type="number" inputmode="numeric" value="" validate-on="other"></gcds-input>
</fieldset>
</mock:shadow-root>
</gcds-date-input>
Expand Down Expand Up @@ -167,7 +167,7 @@ describe('gcds-date-input', () => {
December
</option>
</gcds-select>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" value="" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" inputmode="numeric" value="" validate-on="other"></gcds-input>
</fieldset>
</gcds-date-input>
`);
Expand Down Expand Up @@ -223,7 +223,7 @@ describe('gcds-date-input', () => {
décembre
</option>
</gcds-select>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Année" name="year" size="4" type="number" value="" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Année" name="year" size="4" type="number" inputmode="numeric" value="" validate-on="other"></gcds-input>
</fieldset>
</mock:shadow-root>
</gcds-date-input>
Expand Down Expand Up @@ -283,8 +283,8 @@ describe('gcds-date-input', () => {
December
</option>
</gcds-select>
<gcds-input aria-invalid="false" aria-required="true" class="gcds-date-input__day" inputid="day" label="Day" name="day" size="2" type="number" value="" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" aria-required="true" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" value="" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" aria-required="true" class="gcds-date-input__day" inputid="day" label="Day" name="day" size="2" type="number" inputmode="numeric" value="" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" aria-required="true" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" inputmode="numeric" value="" validate-on="other"></gcds-input>
</fieldset>
</gcds-date-input>
`);
Expand Down Expand Up @@ -343,8 +343,8 @@ describe('gcds-date-input', () => {
December
</option>
</gcds-select>
<gcds-input aria-invalid="false" class="gcds-date-input__day" inputid="day" label="Day" name="day" size="2" type="number" value="" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" value="" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__day" inputid="day" label="Day" name="day" size="2" type="number" inputmode="numeric" value="" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" inputmode="numeric" value="" validate-on="other"></gcds-input>
</fieldset>
</gcds-date-input>
`);
Expand Down Expand Up @@ -400,8 +400,8 @@ describe('gcds-date-input', () => {
December
</option>
</gcds-select>
<gcds-input aria-invalid="false" class="gcds-date-input__day" inputid="day" label="Day" name="day" size="2" type="number" value="15" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" value="1991" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__day" inputid="day" label="Day" name="day" size="2" type="number" inputmode="numeric" value="15" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" inputmode="numeric" value="1991" validate-on="other"></gcds-input>
</fieldset>
</gcds-date-input>
`);
Expand Down Expand Up @@ -457,7 +457,7 @@ describe('gcds-date-input', () => {
December
</option>
</gcds-select>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" value="1991" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" inputmode="numeric" value="1991" validate-on="other"></gcds-input>
</fieldset>
</gcds-date-input>
`);
Expand Down Expand Up @@ -513,8 +513,8 @@ describe('gcds-date-input', () => {
December
</option>
</gcds-select>
<gcds-input aria-invalid="false" class="gcds-date-input__day" inputid="day" label="Day" name="day" size="2" type="number" value="015" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" value="1991" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__day" inputid="day" label="Day" name="day" size="2" type="number" inputmode="numeric" value="015" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" inputmode="numeric" value="1991" validate-on="other"></gcds-input>
</fieldset>
</mock:shadow-root>
</gcds-date-input>
Expand Down Expand Up @@ -571,7 +571,7 @@ describe('gcds-date-input', () => {
December
</option>
</gcds-select>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" value="1991" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" inputmode="numeric" value="1991" validate-on="other"></gcds-input>
</fieldset>
</mock:shadow-root>
</gcds-date-input>
Expand Down Expand Up @@ -676,8 +676,8 @@ describe('gcds-date-input', () => {
December
</option>
</gcds-select>
<gcds-input aria-invalid="false" class="gcds-date-input__day" inputid="day" label="Day" name="day" size="2" type="number" value="red" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" value="222f" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__day" inputid="day" label="Day" name="day" size="2" type="number" inputmode="numeric" value="red" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" inputmode="numeric" value="222f" validate-on="other"></gcds-input>
</fieldset>
</gcds-date-input>
`);
Expand Down Expand Up @@ -733,7 +733,7 @@ describe('gcds-date-input', () => {
December
</option>
</gcds-select>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" value="222f" validate-on="other"></gcds-input>
<gcds-input aria-invalid="false" class="gcds-date-input__year" inputid="year" label="Year" name="year" size="4" type="number" inputmode="numeric" value="222f" validate-on="other"></gcds-input>
</fieldset>
</gcds-date-input>
`);
Expand Down
12 changes: 12 additions & 0 deletions packages/web/src/components/gcds-input/gcds-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ export class GcdsInput {
// prettier-ignore
@Prop() type?: 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' = 'text';

@Prop() inputmode?:
| 'none'
| 'text'
| 'decimal'
| 'numeric'
| 'tel'
| 'search'
| 'email'
| 'url' = null;

/**
* Default value for an input element.
*/
Expand Down Expand Up @@ -574,6 +584,7 @@ export class GcdsInput {
required,
size,
type,
inputmode,
value,
hasError,
autocomplete,
Expand All @@ -600,6 +611,7 @@ export class GcdsInput {
disabled,
required,
type,
inputmode,
autocomplete,
autofocus,
form,
Expand Down
Loading