@@ -42,6 +42,10 @@ var _Recaptcha2 = require('./Recaptcha');
4242
4343var _Recaptcha3 = _interopRequireDefault ( _Recaptcha2 ) ;
4444
45+ var _Condition = require ( './Condition' ) ;
46+
47+ var _Condition2 = _interopRequireDefault ( _Condition ) ;
48+
4549function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { default : obj } ; }
4650
4751function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
@@ -60,45 +64,74 @@ var Control = function (_Component) {
6064
6165 _this . control = {
6266 Checkbox : function Checkbox ( opt ) {
63- return _react2 . default . createElement ( _reactFinalForm . Field , _extends ( {
64- component : _Checkbox3 . default ,
65- fullWidth : true
66- } , opt ) ) ;
67+ return _react2 . default . createElement (
68+ _Condition2 . default ,
69+ opt . condition ,
70+ _react2 . default . createElement ( _reactFinalForm . Field , _extends ( {
71+ component : _Checkbox3 . default ,
72+ fullWidth : true
73+ } , opt ) )
74+ ) ;
6775 } ,
6876 Radio : function Radio ( opt ) {
69- return _react2 . default . createElement ( _reactFinalForm . Field , _extends ( {
70- component : _Radio3 . default ,
71- fullWidth : true
72- } , opt ) ) ;
77+ return _react2 . default . createElement (
78+ _Condition2 . default ,
79+ opt . condition ,
80+ _react2 . default . createElement ( _reactFinalForm . Field , _extends ( {
81+ component : _Radio3 . default ,
82+ fullWidth : true
83+ } , opt ) )
84+ ) ;
7385 } ,
7486 TextField : function TextField ( opt ) {
75- return _react2 . default . createElement ( _reactFinalForm . Field , _extends ( {
76- component : _TextField3 . default ,
77- fullWidth : true
78- } , opt ) ) ;
87+ return _react2 . default . createElement (
88+ _Condition2 . default ,
89+ opt . condition ,
90+ _react2 . default . createElement ( _reactFinalForm . Field , _extends ( {
91+ component : _TextField3 . default ,
92+ fullWidth : true
93+ } , opt ) )
94+ ) ;
7995 } ,
8096 Select : function Select ( opt ) {
81- return _react2 . default . createElement ( _reactFinalForm . Field , _extends ( {
82- component : _Select3 . default ,
83- fullWidth : true
84- } , opt ) ) ;
97+ return _react2 . default . createElement (
98+ _Condition2 . default ,
99+ opt . condition ,
100+ _react2 . default . createElement ( _reactFinalForm . Field , _extends ( {
101+ component : _Select3 . default ,
102+ fullWidth : true
103+ } , opt ) )
104+ ) ;
85105 } ,
86106 Button : function Button ( opt ) {
87- return _react2 . default . createElement ( _reactFinalForm . Field , _extends ( {
88- component : _Button3 . default ,
89- fullWidth : true
90- } , opt ) ) ;
107+ return _react2 . default . createElement (
108+ _Condition2 . default ,
109+ opt . condition ,
110+ _react2 . default . createElement ( _reactFinalForm . Field , _extends ( {
111+ component : _Button3 . default ,
112+ fullWidth : true ,
113+ values : opt . values
114+ } , opt ) )
115+ ) ;
91116 } ,
92117 Recaptcha : function Recaptcha ( opt ) {
93- return _react2 . default . createElement ( _reactFinalForm . Field , _extends ( {
94- component : _Recaptcha3 . default ,
95- fullWidth : true
96- } , opt ) ) ;
118+ return _react2 . default . createElement (
119+ _Condition2 . default ,
120+ opt . condition ,
121+ _react2 . default . createElement ( _reactFinalForm . Field , _extends ( {
122+ component : _Recaptcha3 . default ,
123+ fullWidth : true
124+ } , opt ) )
125+ ) ;
97126 } ,
98127 Custom : function Custom ( opt ) {
99- return _react2 . default . createElement ( _reactFinalForm . Field , _extends ( {
100- fullWidth : true
101- } , opt ) ) ;
128+ return _react2 . default . createElement (
129+ _Condition2 . default ,
130+ opt . condition ,
131+ _react2 . default . createElement ( _reactFinalForm . Field , _extends ( {
132+ fullWidth : true
133+ } , opt ) )
134+ ) ;
102135 }
103136 } ;
104137 return _this ;
0 commit comments