Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit 7c22147

Browse files
committed
Simplifying control variant definitions
1 parent bb050aa commit 7c22147

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/components/control-component.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -677,11 +677,11 @@ function createControlClass(s = defaultStrategy) {
677677
render() {
678678
return (
679679
<ConnectedControl
680+
{...this.props}
680681
mapProps={{
681682
...controlPropsMap.default,
682683
...this.props.mapProps,
683684
}}
684-
{...omit(this.props, 'mapProps')}
685685
/>
686686
);
687687
}
@@ -694,11 +694,11 @@ function createControlClass(s = defaultStrategy) {
694694
return (
695695
<ConnectedControl
696696
component="input"
697+
{...this.props}
697698
mapProps={{
698699
...controlPropsMap.default,
699700
...this.props.mapProps,
700701
}}
701-
{...omit(this.props, 'mapProps')}
702702
/>
703703
);
704704
}
@@ -711,12 +711,12 @@ function createControlClass(s = defaultStrategy) {
711711
return (
712712
<ConnectedControl
713713
component="input"
714+
{...this.props}
714715
mapProps={{
715716
...controlPropsMap.text,
716717
type: 'text',
717718
...this.props.mapProps,
718719
}}
719-
{...omit(this.props, 'mapProps')}
720720
/>
721721
);
722722
}
@@ -729,11 +729,11 @@ function createControlClass(s = defaultStrategy) {
729729
return (
730730
<ConnectedControl
731731
component="textarea"
732+
{...this.props}
732733
mapProps={{
733734
...controlPropsMap.textarea,
734735
...this.props.mapProps,
735736
}}
736-
{...omit(this.props, 'mapProps')}
737737
/>
738738
);
739739
}
@@ -748,11 +748,11 @@ function createControlClass(s = defaultStrategy) {
748748
component="input"
749749
type="radio"
750750
isToggle
751+
{...this.props}
751752
mapProps={{
752753
...controlPropsMap.radio,
753754
...this.props.mapProps,
754755
}}
755-
{...omit(this.props, 'mapProps')}
756756
/>
757757
);
758758
}
@@ -767,13 +767,13 @@ function createControlClass(s = defaultStrategy) {
767767
component="input"
768768
type="checkbox"
769769
isToggle
770+
{...this.props}
770771
mapProps={{
771772
...controlPropsMap.checkbox,
772773
...this.props.mapProps,
773774
}}
774775
getValue={getCheckboxValue}
775776
changeAction={this.props.changeAction || s.actions.checkWithValue}
776-
{...omit(this.props, 'mapProps')}
777777
/>
778778
);
779779
}
@@ -787,11 +787,11 @@ function createControlClass(s = defaultStrategy) {
787787
<ConnectedControl
788788
component="input"
789789
type="file"
790+
{...this.props}
790791
mapProps={{
791792
...controlPropsMap.file,
792793
...this.props.mapProps,
793794
}}
794-
{...omit(this.props, 'mapProps')}
795795
/>
796796
);
797797
}
@@ -804,11 +804,11 @@ function createControlClass(s = defaultStrategy) {
804804
return (
805805
<ConnectedControl
806806
component="select"
807+
{...this.props}
807808
mapProps={{
808809
...controlPropsMap.select,
809810
...this.props.mapProps,
810811
}}
811-
{...omit(this.props, 'mapProps')}
812812
/>
813813
);
814814
}
@@ -821,11 +821,11 @@ function createControlClass(s = defaultStrategy) {
821821
return (
822822
<ConnectedControl
823823
component="button"
824+
{...this.props}
824825
mapProps={{
825826
...controlPropsMap.button,
826827
...this.props.mapProps,
827828
}}
828-
{...omit(this.props, 'mapProps')}
829829
/>
830830
);
831831
}
@@ -839,11 +839,11 @@ function createControlClass(s = defaultStrategy) {
839839
<ConnectedControl
840840
component="button"
841841
type="reset"
842+
{...this.props}
842843
mapProps={{
843844
...controlPropsMap.reset,
844845
...this.props.mapProps,
845846
}}
846-
{...omit(this.props, 'mapProps')}
847847
/>
848848
);
849849
}

0 commit comments

Comments
 (0)