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

style(Form): update typings and propTypes usage #1320

Merged
merged 5 commits into from
Feb 21, 2017
Merged

Conversation

layershifter
Copy link
Member

This PR is part of work for removing propTypes in production bundle (#524, #731).
Also, cleanups and updates typings for #1072.
Fixes #1304.

}

FormGroup.defaultProps = {
as: 'div',
Copy link
Member Author

Choose a reason for hiding this comment

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

ElementType is div by default.

@@ -1,5 +1,3 @@
export type InputType = 'color' | 'date' | 'datetime' | 'datetime-local' | 'email' | 'number' | 'range' | 'search' | 'select' | 'password' | 'tel' | 'text' | 'time' | 'url' | 'week';

Copy link
Member Author

Choose a reason for hiding this comment

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

Cruft.

src/index.d.ts Outdated
@@ -25,8 +23,6 @@ type SemanticWIDTHSSTRING = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' |

export type SemanticWIDTHS = SemanticWIDTHSNUMBER | SemanticWIDTHSSTRING;

export type SemanticGenericOnClick = (event: any, value: any) => void;
export type SemanticFormOnClick = (event: any, object: Object) => void;
Copy link
Member Author

Choose a reason for hiding this comment

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

Cruft.

@codecov-io
Copy link

codecov-io commented Feb 13, 2017

Codecov Report

Merging #1320 into master will decrease coverage by -0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1320      +/-   ##
==========================================
- Coverage   99.74%   99.74%   -0.01%     
==========================================
  Files         140      140              
  Lines        2392     2390       -2     
==========================================
- Hits         2386     2384       -2     
  Misses          6        6
Impacted Files Coverage Δ
src/collections/Form/FormButton.js 100% <ø> (ø)
src/collections/Form/Form.js 100% <ø> (ø)
src/collections/Form/FormTextArea.js 100% <ø> (ø)
src/collections/Form/FormField.js 100% <ø> (ø)
src/collections/Form/FormSelect.js 100% <ø> (ø)
src/collections/Form/FormCheckbox.js 100% <ø> (ø)
src/collections/Form/FormInput.js 100% <ø> (ø)
src/collections/Form/FormDropdown.js 100% <ø> (ø)
src/collections/Form/FormRadio.js 100% <ø> (ø)
src/collections/Form/FormGroup.js 100% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f83015...5334ec2. Read the comment docs.

Copy link
Member

@levithomason levithomason left a comment

Choose a reason for hiding this comment

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

One question before merging.


interface FormInputProps extends InputProps {
interface FormInputProps extends FormFieldProps, InputProps {
Copy link
Member

Choose a reason for hiding this comment

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

Hm, is this going to cause the duplicate property error again? Both FormFieldProps and InputProps define a label prop in their interfaces, each with different types:

FormFieldProps

   /** Mutually exclusive with children. */
  label?: any | Object;

InputProps

  /** Optional Label to display along side the Input. */
  label?: any;

This may also be the case with Checkbox/Radio/Button, since they all accept a label prop as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems, you're right, I'll check it.

@layershifter
Copy link
Member Author

I've checked Form typings with compiler and fixes issues.

Alexander Fedyashov added 2 commits February 21, 2017 10:16
…React into style/form

# Conflicts:
#	src/index.d.ts
#	test/specs/collections/Form/Form-test.js
#	test/specs/collections/Form/FormField-test.js
#	test/specs/collections/Form/FormFieldGroup-test.js
@layershifter
Copy link
Member Author

Rebased to master and added some typings cleanups.

@levithomason
Copy link
Member

What about this comment, do we still have the conflicting input prop typing issue due to the FormFieldProps extending the InputProps?

@layershifter
Copy link
Member Author

Nope.

@levithomason
Copy link
Member

Thanks, that was obvious :P

@levithomason
Copy link
Member

Released in semantic-ui-react@0.66.0.

harel pushed a commit to harel/Semantic-UI-React that referenced this pull request Feb 25, 2017
* style(Form): update typings and propTypes usage

* style(Form): update typings and propTypes usage

* style(Form): update typings and propTypes usage

* style(typings): cleanups
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants