22
33Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
44
5- function _interopDefault ( ex ) { return ( ex && ( typeof ex === 'object' ) && 'default' in ex ) ? ex [ 'default' ] : ex ; }
6-
75var reactFormutil = require ( 'react-formutil' ) ;
86var React = require ( 'react' ) ;
9- var React__default = _interopDefault ( React ) ;
10- var reactIs = require ( 'react-is' ) ;
11- var PropTypes = _interopDefault ( require ( 'prop-types' ) ) ;
7+ var PropTypes = require ( 'prop-types' ) ;
128var reactBootstrap = require ( 'react-bootstrap' ) ;
13- var isEqual = _interopDefault ( require ( 'react-fast-compare' ) ) ;
9+ var reactIs = require ( 'react-is' ) ;
10+ var isEqual = require ( 'react-fast-compare' ) ;
11+
12+ function _interopDefaultLegacy ( e ) { return e && typeof e === 'object' && 'default' in e ? e : { 'default' : e } ; }
13+
14+ var React__default = /*#__PURE__*/ _interopDefaultLegacy ( React ) ;
15+ var PropTypes__default = /*#__PURE__*/ _interopDefaultLegacy ( PropTypes ) ;
16+ var reactIs__default = /*#__PURE__*/ _interopDefaultLegacy ( reactIs ) ;
17+ var isEqual__default = /*#__PURE__*/ _interopDefaultLegacy ( isEqual ) ;
1418
1519function _defineProperty ( obj , key , value ) {
1620 if ( key in obj ) {
@@ -175,6 +179,36 @@ function _createClass(Constructor, protoProps, staticProps) {
175179
176180var createClass = _createClass ;
177181
182+ var setPrototypeOf = createCommonjsModule ( function ( module ) {
183+ function _setPrototypeOf ( o , p ) {
184+ module . exports = _setPrototypeOf = Object . setPrototypeOf || function _setPrototypeOf ( o , p ) {
185+ o . __proto__ = p ;
186+ return o ;
187+ } ;
188+
189+ return _setPrototypeOf ( o , p ) ;
190+ }
191+
192+ module . exports = _setPrototypeOf ;
193+ } ) ;
194+
195+ function _inherits ( subClass , superClass ) {
196+ if ( typeof superClass !== "function" && superClass !== null ) {
197+ throw new TypeError ( "Super expression must either be null or a function" ) ;
198+ }
199+
200+ subClass . prototype = Object . create ( superClass && superClass . prototype , {
201+ constructor : {
202+ value : subClass ,
203+ writable : true ,
204+ configurable : true
205+ }
206+ } ) ;
207+ if ( superClass ) setPrototypeOf ( subClass , superClass ) ;
208+ }
209+
210+ var inherits = _inherits ;
211+
178212var getPrototypeOf = createCommonjsModule ( function ( module ) {
179213function _getPrototypeOf ( o ) {
180214 module . exports = _getPrototypeOf = Object . setPrototypeOf ? Object . getPrototypeOf : function _getPrototypeOf ( o ) {
@@ -222,11 +256,12 @@ function _possibleConstructorReturn(self, call) {
222256var possibleConstructorReturn = _possibleConstructorReturn ;
223257
224258function _createSuper ( Derived ) {
225- return function ( ) {
259+ var hasNativeReflectConstruct = isNativeReflectConstruct ( ) ;
260+ return function _createSuperInternal ( ) {
226261 var Super = getPrototypeOf ( Derived ) ,
227262 result ;
228263
229- if ( isNativeReflectConstruct ( ) ) {
264+ if ( hasNativeReflectConstruct ) {
230265 var NewTarget = getPrototypeOf ( this ) . constructor ;
231266 result = Reflect . construct ( Super , arguments , NewTarget ) ;
232267 } else {
@@ -239,36 +274,6 @@ function _createSuper(Derived) {
239274
240275var createSuper = _createSuper ;
241276
242- var setPrototypeOf = createCommonjsModule ( function ( module ) {
243- function _setPrototypeOf ( o , p ) {
244- module . exports = _setPrototypeOf = Object . setPrototypeOf || function _setPrototypeOf ( o , p ) {
245- o . __proto__ = p ;
246- return o ;
247- } ;
248-
249- return _setPrototypeOf ( o , p ) ;
250- }
251-
252- module . exports = _setPrototypeOf ;
253- } ) ;
254-
255- function _inherits ( subClass , superClass ) {
256- if ( typeof superClass !== "function" && superClass !== null ) {
257- throw new TypeError ( "Super expression must either be null or a function" ) ;
258- }
259-
260- subClass . prototype = Object . create ( superClass && superClass . prototype , {
261- constructor : {
262- value : subClass ,
263- writable : true ,
264- configurable : true
265- }
266- } ) ;
267- if ( superClass ) setPrototypeOf ( subClass , superClass ) ;
268- }
269-
270- var inherits = _inherits ;
271-
272277var CheckboxGroup = /*#__PURE__*/ function ( _Component ) {
273278 inherits ( CheckboxGroup , _Component ) ;
274279
@@ -305,7 +310,7 @@ var CheckboxGroup = /*#__PURE__*/function (_Component) {
305310
306311 return React . Children . map ( children , function ( child ) {
307312 var childValue = child . props . value ;
308- return React . cloneElement ( child , {
313+ return /*#__PURE__*/ React . cloneElement ( child , {
309314 isValid : isValid ,
310315 isInvalid : isInvalid ,
311316 checked : ! ! value && value . indexOf ( childValue ) > - 1 ,
@@ -323,10 +328,10 @@ var CheckboxGroup = /*#__PURE__*/function (_Component) {
323328
324329CheckboxGroup . formutilType = 'array' ;
325330CheckboxGroup . propTypes = {
326- onChange : PropTypes . func ,
327- onFocus : PropTypes . func ,
328- onBlur : PropTypes . func ,
329- value : PropTypes . array
331+ onChange : PropTypes__default [ 'default' ] . func ,
332+ onFocus : PropTypes__default [ 'default' ] . func ,
333+ onBlur : PropTypes__default [ 'default' ] . func ,
334+ value : PropTypes__default [ 'default' ] . array
330335} ;
331336
332337var styleSheet ;
@@ -348,7 +353,9 @@ function insertRule(selector, content) {
348353 }
349354}
350355
351- var _createContext = React . createContext ( { } ) ,
356+ var isValidElementType = reactIs__default [ 'default' ] . isValidElementType ;
357+
358+ var _createContext = /*#__PURE__*/ React . createContext ( { } ) ,
352359 Consumer = _createContext . Consumer ,
353360 Provider = _createContext . Provider ;
354361
@@ -368,7 +375,7 @@ function getChildComponent(children) {
368375 if ( children ) {
369376 var childrenType = children . type ;
370377
371- if ( reactIs . isValidElementType ( childrenType ) ) {
378+ if ( isValidElementType ( childrenType ) ) {
372379 // SomeComponent.formutiType = xx
373380 if ( childrenType . formutilType ) {
374381 return childrenType . formutilType ;
@@ -473,10 +480,10 @@ var _FormGroup = /*#__PURE__*/function (_Component) {
473480 return {
474481 groupProps : groupProps ,
475482 validationProps : validationProps ,
476- error : hasError ? /*#__PURE__*/ React__default . createElement ( HelpBlock , {
483+ error : hasError ? /*#__PURE__*/ React__default [ 'default' ] . createElement ( HelpBlock , {
477484 type : "invalid"
478485 } , Array . isArray ( $errors ) ? $errors . map ( function ( err , index ) {
479- return /*#__PURE__*/ React__default . createElement ( "div" , {
486+ return /*#__PURE__*/ React__default [ 'default' ] . createElement ( "div" , {
480487 key : index
481488 } , err ) ;
482489 } ) : $errors ) : null
@@ -529,14 +536,14 @@ var _FormGroup = /*#__PURE__*/function (_Component) {
529536 var groupAsProps = ! as && ( labelCol || wrapperCol ) ? reactBootstrap . Row : as ;
530537
531538 if ( label ) {
532- if ( React . isValidElement ( label ) ) {
539+ if ( /*#__PURE__*/ React . isValidElement ( label ) ) {
533540 if ( labelCol ) {
534- label = React . cloneElement ( label , objectSpread2 ( {
541+ label = /*#__PURE__*/ React . cloneElement ( label , objectSpread2 ( {
535542 column : true
536543 } , labelCol ) ) ;
537544 }
538545 } else {
539- label = /*#__PURE__*/ React__default . createElement ( reactBootstrap . FormLabel , Object . assign ( {
546+ label = /*#__PURE__*/ React__default [ 'default' ] . createElement ( reactBootstrap . FormLabel , Object . assign ( {
540547 column : ! ! labelCol
541548 } , labelCol ) , label ) ;
542549 }
@@ -549,18 +556,18 @@ var _FormGroup = /*#__PURE__*/function (_Component) {
549556
550557 if ( addons ) {
551558 if ( addons . pre ) {
552- addons . pre = /*#__PURE__*/ React__default . createElement ( reactBootstrap . InputGroup . Prepend , null , React . isValidElement ( addons . pre ) ? addons . pre : /*#__PURE__*/ React__default . createElement ( reactBootstrap . InputGroup . Text , null , addons . pre ) ) ;
559+ addons . pre = /*#__PURE__*/ React__default [ 'default' ] . createElement ( reactBootstrap . InputGroup . Prepend , null , /*#__PURE__*/ React . isValidElement ( addons . pre ) ? addons . pre : /*#__PURE__*/ React__default [ 'default' ] . createElement ( reactBootstrap . InputGroup . Text , null , addons . pre ) ) ;
553560 }
554561
555562 if ( addons . end ) {
556- addons . end = /*#__PURE__*/ React__default . createElement ( reactBootstrap . InputGroup . Append , null , React . isValidElement ( addons . end ) ? addons . end : /*#__PURE__*/ React__default . createElement ( reactBootstrap . InputGroup . Text , null , addons . end ) ) ;
563+ addons . end = /*#__PURE__*/ React__default [ 'default' ] . createElement ( reactBootstrap . InputGroup . Append , null , /*#__PURE__*/ React . isValidElement ( addons . end ) ? addons . end : /*#__PURE__*/ React__default [ 'default' ] . createElement ( reactBootstrap . InputGroup . Text , null , addons . end ) ) ;
557564 }
558565 } else {
559566 addons = { } ;
560567 }
561568
562- if ( helper && ! React . isValidElement ( helper ) ) {
563- helper = /*#__PURE__*/ React__default . createElement ( reactBootstrap . FormText , {
569+ if ( helper && ! /*#__PURE__*/ React . isValidElement ( helper ) ) {
570+ helper = /*#__PURE__*/ React__default [ 'default' ] . createElement ( reactBootstrap . FormText , {
564571 className : "text-muted"
565572 } , helper ) ;
566573 }
@@ -575,15 +582,15 @@ var _FormGroup = /*#__PURE__*/function (_Component) {
575582
576583
577584 Promise . resolve ( ) . then ( function ( ) {
578- if ( ! isEqual ( _this2 . latestValidationProps , _this2 . fetchCurrentValidationProps ( errorLevel ) ) ) {
585+ if ( ! isEqual__default [ 'default' ] ( _this2 . latestValidationProps , _this2 . fetchCurrentValidationProps ( errorLevel ) ) ) {
579586 _this2 . forceUpdate ( ) ;
580587 }
581588 } ) ;
582- return /*#__PURE__*/ React__default . createElement ( Provider , {
589+ return /*#__PURE__*/ React__default [ 'default' ] . createElement ( Provider , {
583590 value : this . registerField
584- } , /*#__PURE__*/ React__default . createElement ( reactBootstrap . FormGroup , Object . assign ( { } , fieldProps , groupProps , {
591+ } , /*#__PURE__*/ React__default [ 'default' ] . createElement ( reactBootstrap . FormGroup , Object . assign ( { } , fieldProps , groupProps , {
585592 as : groupAsProps
586- } ) , label , /*#__PURE__*/ React__default . createElement ( Wrapper , wrapperCol , /*#__PURE__*/ React__default . createElement ( AddonWrapper , addonWrapperProps , addons . pre , typeof childList === 'function' ? childList ( ) : childList , addons . end ) , error || helper ) , extraNode ) ) ;
593+ } ) , label , /*#__PURE__*/ React__default [ 'default' ] . createElement ( Wrapper , wrapperCol , /*#__PURE__*/ React__default [ 'default' ] . createElement ( AddonWrapper , addonWrapperProps , addons . pre , typeof childList === 'function' ? childList ( ) : childList , addons . end ) , error || helper ) , extraNode ) ) ;
587594 } // If $memo is true, pass the children to Field for SCU diffing.
588595
589596
@@ -629,7 +636,7 @@ var _FormGroup = /*#__PURE__*/function (_Component) {
629636 break ;
630637 }
631638
632- return /*#__PURE__*/ React__default . createElement ( reactFormutil . EasyField , Object . assign ( { } , fieldProps , {
639+ return /*#__PURE__*/ React__default [ 'default' ] . createElement ( reactFormutil . EasyField , Object . assign ( { } , fieldProps , {
633640 passUtil : "$fieldutil" ,
634641 render : function render ( $handleProps ) {
635642 var _childProps , _Object$assign ;
@@ -725,17 +732,17 @@ var _FormGroup = /*#__PURE__*/function (_Component) {
725732 error = _this2$getValidationP . error ;
726733
727734 childProps = Object . assign ( ( _Object$assign = { } , defineProperty ( _Object$assign , focusPropName , onFocus ) , defineProperty ( _Object$assign , blurPropName , onBlur ) , _Object$assign ) , childProps , validationProps ) ;
728- var fieldInstance = typeof children === 'function' ? children ( childProps ) : React . cloneElement ( children , childProps ) ;
729- return /*#__PURE__*/ React__default . createElement ( Consumer , null , function ( registerField ) {
735+ var fieldInstance = typeof children === 'function' ? children ( childProps ) : /*#__PURE__*/ React . cloneElement ( children , childProps ) ;
736+ return /*#__PURE__*/ React__default [ 'default' ] . createElement ( Consumer , null , function ( registerField ) {
730737 if ( noStyle ) {
731738 _this2 . $fieldutil = $fieldutil ;
732739 _this2 . registerAncestorField = registerField ;
733740 return fieldInstance ;
734741 }
735742
736- return /*#__PURE__*/ React__default . createElement ( reactBootstrap . FormGroup , Object . assign ( { } , restProps , groupProps , {
743+ return /*#__PURE__*/ React__default [ 'default' ] . createElement ( reactBootstrap . FormGroup , Object . assign ( { } , restProps , groupProps , {
737744 as : groupAsProps
738- } ) , label , /*#__PURE__*/ React__default . createElement ( Wrapper , wrapperCol , /*#__PURE__*/ React__default . createElement ( AddonWrapper , addonWrapperProps , addons . pre , fieldInstance , addons . end ) , error || helper ) , extraNode ) ;
745+ } ) , label , /*#__PURE__*/ React__default [ 'default' ] . createElement ( Wrapper , wrapperCol , /*#__PURE__*/ React__default [ 'default' ] . createElement ( AddonWrapper , addonWrapperProps , addons . pre , fieldInstance , addons . end ) , error || helper ) , extraNode ) ;
739746 } ) ;
740747 }
741748 } ) ) ;
@@ -756,20 +763,20 @@ _FormGroup.propTypes = {
756763 if ( 'name' in props ) {
757764 var _PropTypes$oneOfType ;
758765
759- return ( _PropTypes$oneOfType = PropTypes . oneOfType ( [ PropTypes . element , PropTypes . func ] ) ) . isRequired . apply ( _PropTypes$oneOfType , [ props ] . concat ( args ) ) ;
766+ return ( _PropTypes$oneOfType = PropTypes__default [ 'default' ] . oneOfType ( [ PropTypes__default [ 'default' ] . element , PropTypes__default [ 'default' ] . func ] ) ) . isRequired . apply ( _PropTypes$oneOfType , [ props ] . concat ( args ) ) ;
760767 }
761768
762- return ( _PropTypes$node = PropTypes . node ) . isRequired . apply ( _PropTypes$node , [ props ] . concat ( args ) ) ;
769+ return ( _PropTypes$node = PropTypes__default [ 'default' ] . node ) . isRequired . apply ( _PropTypes$node , [ props ] . concat ( args ) ) ;
763770 } ,
764- label : PropTypes . any ,
765- helper : PropTypes . any ,
766- labelCol : PropTypes . object ,
767- wrapperCol : PropTypes . object ,
768- addons : PropTypes . object ,
769- extra : PropTypes . node ,
770- feedback : PropTypes . bool ,
771- noStyle : PropTypes . bool ,
772- errorLevel : PropTypes . oneOf ( [ 0 , 1 , 2 , 'off' ] ) // $parser $formatter checked unchecked $validators validMessage等传递给 EasyField 组件的额外参数
771+ label : PropTypes__default [ 'default' ] . any ,
772+ helper : PropTypes__default [ 'default' ] . any ,
773+ labelCol : PropTypes__default [ 'default' ] . object ,
774+ wrapperCol : PropTypes__default [ 'default' ] . object ,
775+ addons : PropTypes__default [ 'default' ] . object ,
776+ extra : PropTypes__default [ 'default' ] . node ,
777+ feedback : PropTypes__default [ 'default' ] . bool ,
778+ noStyle : PropTypes__default [ 'default' ] . bool ,
779+ errorLevel : PropTypes__default [ 'default' ] . oneOf ( [ 0 , 1 , 2 , 'off' ] ) // $parser $formatter checked unchecked $validators validMessage等传递给 EasyField 组件的额外参数
773780
774781} ;
775782insertRule ( '.valid-feedback:empty,.invalid-feedback:empty' , 'display: none !important' ) ;
@@ -805,7 +812,7 @@ var RadioGroup = /*#__PURE__*/function (_Component) {
805812
806813 return React . Children . map ( children , function ( child ) {
807814 var childValue = child . props . value ;
808- return React . cloneElement ( child , {
815+ return /*#__PURE__*/ React . cloneElement ( child , {
809816 isValid : isValid ,
810817 isInvalid : isInvalid ,
811818 checked : value === childValue ,
@@ -822,10 +829,10 @@ var RadioGroup = /*#__PURE__*/function (_Component) {
822829} ( React . Component ) ;
823830
824831RadioGroup . propTypes = {
825- onChange : PropTypes . func ,
826- onFocus : PropTypes . func ,
827- onBlur : PropTypes . func ,
828- value : PropTypes . string
832+ onChange : PropTypes__default [ 'default' ] . func ,
833+ onFocus : PropTypes__default [ 'default' ] . func ,
834+ onBlur : PropTypes__default [ 'default' ] . func ,
835+ value : PropTypes__default [ 'default' ] . string
829836} ;
830837
831838Object . keys ( reactFormutil ) . forEach ( function ( k ) {
0 commit comments