Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: restore some ESLint rules #9236

Closed
wants to merge 2 commits into from
Closed
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
1 change: 1 addition & 0 deletions packages/calcite-components/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module.exports = {
"@stencil-community/own-methods-must-be-private": "off",
"@stencil-community/own-props-must-be-private": "off",
"@stencil-community/prefer-vdom-listener": "warn",
"@stencil-community/reserved-member-names": "warn",
"@stencil-community/required-jsdoc": "off",
"@stencil-community/strict-boolean-conditions": "off",
"@typescript-eslint/ban-types": "warn",
Expand Down
100 changes: 100 additions & 0 deletions packages/calcite-components/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2034,6 +2034,11 @@ export namespace Components {
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
*/
"autocomplete": string;
/**
* When `true`, the component is focused on page load. Only one element can contain `autofocus`. If multiple elements have `autofocus`, the first element will receive focus.
* @mdn [autofocus](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus)
*/
"autofocus": boolean;
/**
* When `true`, a clear button is displayed when the component has a value. The clear button shows by default for `"search"`, `"time"`, and `"date"` types, and will not display for the `"textarea"` type.
*/
Expand All @@ -2044,6 +2049,11 @@ export namespace Components {
*/
"disabled": boolean;
"editingEnabled": boolean;
/**
* Specifies the action label or icon for the Enter key on virtual keyboards. Read the native attribute's documentation on MDN for more info.
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint)
*/
"enterKeyHint": string;
/**
* When `type` is `"file"`, specifies the component's selected files.
* @mdn https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/files
Expand All @@ -2065,6 +2075,11 @@ export namespace Components {
* When `true`, the icon will be flipped when the element direction is right-to-left (`"rtl"`).
*/
"iconFlipRtl": boolean;
/**
* Specifies the type of content to help devices display an appropriate virtual keyboard. Read the native attribute's documentation on MDN for more info.
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)
*/
"inputMode": string;
/**
* Accessible name for the component.
*/
Expand Down Expand Up @@ -2364,6 +2379,11 @@ export namespace Components {
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
*/
"autocomplete": string;
/**
* When `true`, the component is focused on page load. Only one element can contain `autofocus`. If multiple elements have `autofocus`, the first element will receive focus.
* @mdn [autofocus](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus)
*/
"autofocus": boolean;
/**
* When `true`, a clear button is displayed when the component has a value.
*/
Expand All @@ -2374,6 +2394,11 @@ export namespace Components {
*/
"disabled": boolean;
"editingEnabled": boolean;
/**
* Specifies the action label or icon for the Enter key on virtual keyboards. Read the native attribute's documentation on MDN for more info.
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint)
*/
"enterKeyHint": string;
/**
* The `id` of the form that will be associated with the component. When not set, the component will be associated with its ancestor form element, if any.
*/
Expand All @@ -2391,6 +2416,11 @@ export namespace Components {
* When `true`, the icon will be flipped when the element direction is right-to-left (`"rtl"`).
*/
"iconFlipRtl": boolean;
/**
* Specifies the type of content to help devices display an appropriate virtual keyboard. Read the native attribute's documentation on MDN for more info.
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)
*/
"inputMode": string;
/**
* When `true`, restricts the component to integer numbers only and disables exponential notation.
*/
Expand Down Expand Up @@ -2522,6 +2552,11 @@ export namespace Components {
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
*/
"autocomplete": string;
/**
* When `true`, the component is focused on page load. Only one element can contain `autofocus`. If multiple elements have `autofocus`, the first element will receive focus.
* @mdn [autofocus](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus)
*/
"autofocus": boolean;
/**
* When `true`, a clear button is displayed when the component has a value.
*/
Expand All @@ -2532,6 +2567,11 @@ export namespace Components {
*/
"disabled": boolean;
"editingEnabled": boolean;
/**
* Specifies the action label or icon for the Enter key on virtual keyboards. Read the native attribute's documentation on MDN for more info.
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint)
*/
"enterKeyHint": string;
/**
* The `id` of the form that will be associated with the component. When not set, the component will be associated with its ancestor form element, if any.
*/
Expand All @@ -2545,6 +2585,11 @@ export namespace Components {
* When `true`, the icon will be flipped when the element direction is right-to-left (`"rtl"`).
*/
"iconFlipRtl": boolean;
/**
* Specifies the type of content to help devices display an appropriate virtual keyboard. Read the native attribute's documentation on MDN for more info.
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)
*/
"inputMode": string;
/**
* Accessible name for the component's button or hyperlink.
*/
Expand Down Expand Up @@ -5022,6 +5067,11 @@ export namespace Components {
"scale": Scale;
}
interface CalciteTextArea {
/**
* When `true`, the component is focused on page load. Only one element can contain `autofocus`. If multiple elements have `autofocus`, the first element will receive focus.
* @mdn [autofocus](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus)
*/
"autofocus": boolean;
/**
* Specifies the component's number of columns.
* @mdn [cols](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-cols)
Expand Down Expand Up @@ -9748,6 +9798,11 @@ declare namespace LocalJSX {
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
*/
"autocomplete"?: string;
/**
* When `true`, the component is focused on page load. Only one element can contain `autofocus`. If multiple elements have `autofocus`, the first element will receive focus.
* @mdn [autofocus](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus)
*/
"autofocus"?: boolean;
/**
* When `true`, a clear button is displayed when the component has a value. The clear button shows by default for `"search"`, `"time"`, and `"date"` types, and will not display for the `"textarea"` type.
*/
Expand All @@ -9758,6 +9813,11 @@ declare namespace LocalJSX {
*/
"disabled"?: boolean;
"editingEnabled"?: boolean;
/**
* Specifies the action label or icon for the Enter key on virtual keyboards. Read the native attribute's documentation on MDN for more info.
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint)
*/
"enterKeyHint"?: string;
/**
* When `type` is `"file"`, specifies the component's selected files.
* @mdn https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/files
Expand All @@ -9779,6 +9839,11 @@ declare namespace LocalJSX {
* When `true`, the icon will be flipped when the element direction is right-to-left (`"rtl"`).
*/
"iconFlipRtl"?: boolean;
/**
* Specifies the type of content to help devices display an appropriate virtual keyboard. Read the native attribute's documentation on MDN for more info.
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)
*/
"inputMode"?: string;
/**
* Accessible name for the component.
*/
Expand Down Expand Up @@ -10091,6 +10156,11 @@ declare namespace LocalJSX {
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
*/
"autocomplete"?: string;
/**
* When `true`, the component is focused on page load. Only one element can contain `autofocus`. If multiple elements have `autofocus`, the first element will receive focus.
* @mdn [autofocus](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus)
*/
"autofocus"?: boolean;
/**
* When `true`, a clear button is displayed when the component has a value.
*/
Expand All @@ -10101,6 +10171,11 @@ declare namespace LocalJSX {
*/
"disabled"?: boolean;
"editingEnabled"?: boolean;
/**
* Specifies the action label or icon for the Enter key on virtual keyboards. Read the native attribute's documentation on MDN for more info.
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint)
*/
"enterKeyHint"?: string;
/**
* The `id` of the form that will be associated with the component. When not set, the component will be associated with its ancestor form element, if any.
*/
Expand All @@ -10118,6 +10193,11 @@ declare namespace LocalJSX {
* When `true`, the icon will be flipped when the element direction is right-to-left (`"rtl"`).
*/
"iconFlipRtl"?: boolean;
/**
* Specifies the type of content to help devices display an appropriate virtual keyboard. Read the native attribute's documentation on MDN for more info.
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)
*/
"inputMode"?: string;
/**
* When `true`, restricts the component to integer numbers only and disables exponential notation.
*/
Expand Down Expand Up @@ -10251,6 +10331,11 @@ declare namespace LocalJSX {
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
*/
"autocomplete"?: string;
/**
* When `true`, the component is focused on page load. Only one element can contain `autofocus`. If multiple elements have `autofocus`, the first element will receive focus.
* @mdn [autofocus](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus)
*/
"autofocus"?: boolean;
/**
* When `true`, a clear button is displayed when the component has a value.
*/
Expand All @@ -10261,6 +10346,11 @@ declare namespace LocalJSX {
*/
"disabled"?: boolean;
"editingEnabled"?: boolean;
/**
* Specifies the action label or icon for the Enter key on virtual keyboards. Read the native attribute's documentation on MDN for more info.
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint)
*/
"enterKeyHint"?: string;
/**
* The `id` of the form that will be associated with the component. When not set, the component will be associated with its ancestor form element, if any.
*/
Expand All @@ -10274,6 +10364,11 @@ declare namespace LocalJSX {
* When `true`, the icon will be flipped when the element direction is right-to-left (`"rtl"`).
*/
"iconFlipRtl"?: boolean;
/**
* Specifies the type of content to help devices display an appropriate virtual keyboard. Read the native attribute's documentation on MDN for more info.
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)
*/
"inputMode"?: string;
/**
* Accessible name for the component's button or hyperlink.
*/
Expand Down Expand Up @@ -12873,6 +12968,11 @@ declare namespace LocalJSX {
"scale"?: Scale;
}
interface CalciteTextArea {
/**
* When `true`, the component is focused on page load. Only one element can contain `autofocus`. If multiple elements have `autofocus`, the first element will receive focus.
* @mdn [autofocus](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus)
*/
"autofocus"?: boolean;
/**
* Specifies the component's number of columns.
* @mdn [cols](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-cols)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Element,
Event,
EventEmitter,
forceUpdate,
h,
Host,
Method,
Expand Down Expand Up @@ -97,19 +96,6 @@ export class InputNumber
TextualInputComponent,
LoadableComponent
{
//--------------------------------------------------------------------------
//
// Global attributes
//
//--------------------------------------------------------------------------

@Watch("autofocus")
@Watch("enterkeyhint")
@Watch("inputmode")
handleGlobalAttributesChanged(): void {
forceUpdate(this);
}

//--------------------------------------------------------------------------
//
// Properties
Expand All @@ -119,6 +105,13 @@ export class InputNumber
/** Specifies the text alignment of the component's value. */
@Prop({ reflect: true }) alignment: Extract<"start" | "end", Alignment> = "start";

/**
* When `true`, the component is focused on page load. Only one element can contain `autofocus`. If multiple elements have `autofocus`, the first element will receive focus.
*
* @mdn [autofocus](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus)
*/
@Prop({ reflect: true }) autofocus = false;

/**
* When `true`, a clear button is displayed when the component has a value.
*/
Expand Down Expand Up @@ -303,6 +296,22 @@ export class InputNumber
*/
@Prop() autocomplete: string;

/**
* Specifies the type of content to help devices display an appropriate virtual keyboard.
* Read the native attribute's documentation on MDN for more info.
*
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)
*/
@Prop() inputMode = "decimal";

/**
* Specifies the action label or icon for the Enter key on virtual keyboards.
* Read the native attribute's documentation on MDN for more info.
*
* @mdn [step](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint)
*/
@Prop() enterKeyHint: string;

/** Adds text to the end of the component. */
@Prop() suffixText: string;

Expand Down Expand Up @@ -1056,11 +1065,11 @@ export class InputNumber
<input
aria-label={getLabelText(this)}
autocomplete={this.autocomplete}
autofocus={this.el.autofocus ? true : null}
autofocus={this.autofocus ? true : null}
defaultValue={this.defaultValue}
disabled={this.disabled ? true : null}
enterKeyHint={this.el.enterKeyHint}
inputMode={this.el.inputMode}
enterKeyHint={this.enterKeyHint}
inputMode={this.inputMode}
key="localized-input"
maxLength={this.maxLength}
minLength={this.minLength}
Expand Down
Loading
Loading