@@ -2,7 +2,7 @@ import { EasyField } from 'react-formutil';
2
2
export * from 'react-formutil' ;
3
3
import React , { Children , cloneElement , Component , isValidElement , createContext , Fragment } from 'react' ;
4
4
import PropTypes from 'prop-types' ;
5
- import { FormControl , FormLabel , InputGroup , FormText , FormGroup , ToggleButtonGroup , ToggleButton , FormCheck , Col , Row } from 'react-bootstrap' ;
5
+ import { FormControl , FormLabel , InputGroup , FormGroup , ToggleButtonGroup , ToggleButton , FormCheck , Col , Row , FormText } from 'react-bootstrap' ;
6
6
import reactIs from 'react-is' ;
7
7
import isEqual from 'react-fast-compare' ;
8
8
@@ -24,17 +24,11 @@ function _defineProperty(obj, key, value) {
24
24
function _typeof ( obj ) {
25
25
"@babel/helpers - typeof" ;
26
26
27
- if ( typeof Symbol === "function" && typeof Symbol . iterator === "symbol" ) {
28
- _typeof = function _typeof ( obj ) {
29
- return typeof obj ;
30
- } ;
31
- } else {
32
- _typeof = function _typeof ( obj ) {
33
- return obj && typeof Symbol === "function" && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ;
34
- } ;
35
- }
36
-
37
- return _typeof ( obj ) ;
27
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol . iterator ? function ( obj ) {
28
+ return typeof obj ;
29
+ } : function ( obj ) {
30
+ return obj && "function" == typeof Symbol && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ;
31
+ } , _typeof ( obj ) ;
38
32
}
39
33
40
34
function _toPrimitive ( input , hint ) {
@@ -60,30 +54,22 @@ function ownKeys(object, enumerableOnly) {
60
54
61
55
if ( Object . getOwnPropertySymbols ) {
62
56
var symbols = Object . getOwnPropertySymbols ( object ) ;
63
- if ( enumerableOnly ) symbols = symbols . filter ( function ( sym ) {
57
+ enumerableOnly && ( symbols = symbols . filter ( function ( sym ) {
64
58
return Object . getOwnPropertyDescriptor ( object , sym ) . enumerable ;
65
- } ) ;
66
- keys . push . apply ( keys , symbols ) ;
59
+ } ) ) , keys . push . apply ( keys , symbols ) ;
67
60
}
68
61
69
62
return keys ;
70
63
}
71
64
72
65
function _objectSpread2 ( target ) {
73
66
for ( var i = 1 ; i < arguments . length ; i ++ ) {
74
- var source = arguments [ i ] != null ? arguments [ i ] : { } ;
75
-
76
- if ( i % 2 ) {
77
- ownKeys ( Object ( source ) , true ) . forEach ( function ( key ) {
78
- _defineProperty ( target , key , source [ key ] ) ;
79
- } ) ;
80
- } else if ( Object . getOwnPropertyDescriptors ) {
81
- Object . defineProperties ( target , Object . getOwnPropertyDescriptors ( source ) ) ;
82
- } else {
83
- ownKeys ( Object ( source ) ) . forEach ( function ( key ) {
84
- Object . defineProperty ( target , key , Object . getOwnPropertyDescriptor ( source , key ) ) ;
85
- } ) ;
86
- }
67
+ var source = null != arguments [ i ] ? arguments [ i ] : { } ;
68
+ i % 2 ? ownKeys ( Object ( source ) , ! 0 ) . forEach ( function ( key ) {
69
+ _defineProperty ( target , key , source [ key ] ) ;
70
+ } ) : Object . getOwnPropertyDescriptors ? Object . defineProperties ( target , Object . getOwnPropertyDescriptors ( source ) ) : ownKeys ( Object ( source ) ) . forEach ( function ( key ) {
71
+ Object . defineProperty ( target , key , Object . getOwnPropertyDescriptor ( source , key ) ) ;
72
+ } ) ;
87
73
}
88
74
89
75
return target ;
@@ -142,15 +128,17 @@ function _defineProperties(target, props) {
142
128
function _createClass ( Constructor , protoProps , staticProps ) {
143
129
if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ;
144
130
if ( staticProps ) _defineProperties ( Constructor , staticProps ) ;
131
+ Object . defineProperty ( Constructor , "prototype" , {
132
+ writable : false
133
+ } ) ;
145
134
return Constructor ;
146
135
}
147
136
148
137
function _setPrototypeOf ( o , p ) {
149
- _setPrototypeOf = Object . setPrototypeOf || function _setPrototypeOf ( o , p ) {
138
+ _setPrototypeOf = Object . setPrototypeOf ? Object . setPrototypeOf . bind ( ) : function _setPrototypeOf ( o , p ) {
150
139
o . __proto__ = p ;
151
140
return o ;
152
141
} ;
153
-
154
142
return _setPrototypeOf ( o , p ) ;
155
143
}
156
144
@@ -166,11 +154,14 @@ function _inherits(subClass, superClass) {
166
154
configurable : true
167
155
}
168
156
} ) ;
157
+ Object . defineProperty ( subClass , "prototype" , {
158
+ writable : false
159
+ } ) ;
169
160
if ( superClass ) _setPrototypeOf ( subClass , superClass ) ;
170
161
}
171
162
172
163
function _getPrototypeOf ( o ) {
173
- _getPrototypeOf = Object . setPrototypeOf ? Object . getPrototypeOf : function _getPrototypeOf ( o ) {
164
+ _getPrototypeOf = Object . setPrototypeOf ? Object . getPrototypeOf . bind ( ) : function _getPrototypeOf ( o ) {
174
165
return o . __proto__ || Object . getPrototypeOf ( o ) ;
175
166
} ;
176
167
return _getPrototypeOf ( o ) ;
@@ -182,7 +173,7 @@ function _isNativeReflectConstruct() {
182
173
if ( typeof Proxy === "function" ) return true ;
183
174
184
175
try {
185
- Date . prototype . toString . call ( Reflect . construct ( Date , [ ] , function ( ) { } ) ) ;
176
+ Boolean . prototype . valueOf . call ( Reflect . construct ( Boolean , [ ] , function ( ) { } ) ) ;
186
177
return true ;
187
178
} catch ( e ) {
188
179
return false ;
@@ -200,6 +191,8 @@ function _assertThisInitialized(self) {
200
191
function _possibleConstructorReturn ( self , call ) {
201
192
if ( call && ( _typeof ( call ) === "object" || typeof call === "function" ) ) {
202
193
return call ;
194
+ } else if ( call !== void 0 ) {
195
+ throw new TypeError ( "Derived constructors may only return object or undefined" ) ;
203
196
}
204
197
205
198
return _assertThisInitialized ( self ) ;
@@ -281,6 +274,7 @@ CheckboxGroup.propTypes = {
281
274
onBlur : PropTypes . func ,
282
275
value : PropTypes . array
283
276
} ;
277
+ var CheckboxGroup$1 = CheckboxGroup ;
284
278
285
279
var styleSheet ;
286
280
@@ -301,6 +295,7 @@ function insertRule(selector, content) {
301
295
}
302
296
}
303
297
298
+ var _excluded = [ "children" , "addons" , "label" , "helper" , "labelCol" , "wrapperCol" , "validationState" , "className" , "as" , "feedback" , "extra" , "noStyle" , "errorLevel" ] ;
304
299
var isValidElementType = reactIs . isValidElementType ;
305
300
306
301
var _createContext = /*#__PURE__*/ createContext ( { } ) ,
@@ -469,16 +464,16 @@ var _FormGroup = /*#__PURE__*/function (_Component) {
469
464
label = props . label ,
470
465
helper = props . helper ,
471
466
labelCol = props . labelCol ,
472
- wrapperCol = props . wrapperCol ,
473
- validationState = props . validationState ,
474
- className = props . className ,
475
- as = props . as ,
476
- feedback = props . feedback ,
477
- extraNode = props . extra ,
467
+ wrapperCol = props . wrapperCol ;
468
+ props . validationState ;
469
+ props . className ;
470
+ var as = props . as ;
471
+ props . feedback ;
472
+ var extraNode = props . extra ,
478
473
noStyle = props . noStyle ,
479
474
_props$errorLevel = props . errorLevel ,
480
475
errorLevel = _props$errorLevel === void 0 ? errorLevelGlobal : _props$errorLevel ,
481
- fieldProps = _objectWithoutProperties ( props , [ "children" , "addons" , "label" , "helper" , "labelCol" , "wrapperCol" , "validationState" , "className" , "as" , "feedback" , "extra" , "noStyle" , "errorLevel" ] ) ;
476
+ fieldProps = _objectWithoutProperties ( props , _excluded ) ;
482
477
483
478
var Wrapper = wrapperCol ? Col : Fragment ;
484
479
var groupAsProps = ! as && ( labelCol || wrapperCol ) ? Row : as ;
@@ -572,7 +567,7 @@ var _FormGroup = /*#__PURE__*/function (_Component) {
572
567
fieldProps . __TYPE__ = 'array' ;
573
568
break ;
574
569
575
- case CheckboxGroup :
570
+ case CheckboxGroup$1 :
576
571
case ToggleButtonGroup :
577
572
if ( children . props . type !== 'radio' ) {
578
573
fieldProps . __TYPE__ = 'array' ;
@@ -732,6 +727,7 @@ _FormGroup.propTypes = {
732
727
errorLevel : PropTypes . oneOf ( [ 0 , 1 , 2 , 'off' ] ) // $parser $formatter checked unchecked $validators validMessage等传递给 EasyField 组件的额外参数
733
728
734
729
} ;
730
+ var _FormGroup$1 = _FormGroup ;
735
731
insertRule ( '.valid-feedback:empty,.invalid-feedback:empty' , 'display: none !important' ) ;
736
732
insertRule ( '.has-error .invalid-feedback' , 'display: block' ) ;
737
733
@@ -787,5 +783,6 @@ RadioGroup.propTypes = {
787
783
onBlur : PropTypes . func ,
788
784
value : PropTypes . string
789
785
} ;
786
+ var RadioGroup$1 = RadioGroup ;
790
787
791
- export { CheckboxGroup , _FormGroup as FormGroup , RadioGroup , CheckboxGroup as SwitchGroup , setErrorLevel } ;
788
+ export { CheckboxGroup$1 as CheckboxGroup , _FormGroup$1 as FormGroup , RadioGroup$1 as RadioGroup , CheckboxGroup$1 as SwitchGroup , setErrorLevel } ;
0 commit comments