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

feat(input-v1): upgrading component #71

Merged
merged 10 commits into from
Jun 26, 2023
Merged

feat(input-v1): upgrading component #71

merged 10 commits into from
Jun 26, 2023

Conversation

Leotheluck
Copy link
Contributor

New properties:

loading: boolean => it should display a Spinner when true
clearable: boolean => it should display "close" Icon in the input when true and when there is a value. Should clear input value on click (use clear() method)
hideable: boolean => it should display an eye icon when true
hidden: boolean => it should hide the input content when true (as an <input type="password">)
type: OdsInputType => type 'number' already exists, 'email', 'password', 'search', 'tel', 'text' and 'url' types should be added to the enum (in ods-input-type.ts)

@Leotheluck Leotheluck requested a review from a team as a code owner June 13, 2023 16:14
@Leotheluck Leotheluck changed the title Feat/input v1 feat(input-v1): upgrading component Jun 14, 2023
Copy link
Contributor

@dpellier dpellier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clear button does not work when value is invalid.
ex: input number => type "azerty" => click clear button => nothing happen

Copy link
Contributor

@astagnol astagnol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type number + hideable: doesn't work as expected with invalid value (for example some text), it is cleared on click

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add TsDoc to attributes here so description will be visible in Specification (Storybook)

actionDescription: 'contrasted',
action: () => el.setProperty('contrasted', true),
}, {
actionDescription: 'disabled',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more test when component is disabled? Disabled only tested with a spinner or with contrasted colours?

@@ -74,7 +74,10 @@ export class OdsInputController extends OdsComponentController<OdsInput> {
return `${forbiddenValue}` === `${this.component.value}`;
}
if (this.component.value) {
return this.component.value >= forbiddenValue.min && this.component.value <= forbiddenValue.max;
if (typeof this.component.value === 'number') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il ne faudrait pas plutot vérifier le this.component.type ?

@astagnol astagnol merged commit 5609893 into master Jun 26, 2023
@astagnol astagnol deleted the feat/input-v1 branch June 26, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants