1
1
( function ( f ) { if ( typeof exports === "object" && typeof module !== "undefined" ) { module . exports = f ( ) } else if ( typeof define === "function" && define . amd ) { define ( [ ] , f ) } else { var g ; if ( typeof window !== "undefined" ) { g = window } else if ( typeof global !== "undefined" ) { g = global } else if ( typeof self !== "undefined" ) { g = self } else { g = this } g . notifications = f ( ) } } ) ( function ( ) { var define , module , exports ; return ( function e ( t , n , r ) { function s ( o , u ) { if ( ! n [ o ] ) { if ( ! t [ o ] ) { var a = typeof require == "function" && require ; if ( ! u && a ) return a ( o , ! 0 ) ; if ( i ) return i ( o , ! 0 ) ; var f = new Error ( "Cannot find module '" + o + "'" ) ; throw f . code = "MODULE_NOT_FOUND" , f } var l = n [ o ] = { exports :{ } } ; t [ o ] [ 0 ] . call ( l . exports , function ( e ) { var n = t [ o ] [ 1 ] [ e ] ; return s ( n ?n :e ) } , l , l . exports , e , t , n , r ) } return n [ o ] . exports } var i = typeof require == "function" && require ; for ( var o = 0 ; o < r . length ; o ++ ) s ( r [ o ] ) ; return s } ) ( { 1 :[ function ( require , module , exports ) {
2
- 'use strict' ;
3
-
4
- Object . defineProperty ( exports , '__esModule' , {
2
+ Object . defineProperty ( exports , "__esModule" , {
5
3
value : true
6
4
} ) ;
7
5
@@ -66,39 +64,21 @@ function hide(uid) {
66
64
}
67
65
68
66
} , { "./const" :2 } ] , 2 :[ function ( require , module , exports ) {
69
- 'use strict' ;
70
-
71
- Object . defineProperty ( exports , '__esModule' , {
67
+ Object . defineProperty ( exports , "__esModule" , {
72
68
value : true
73
69
} ) ;
74
- var RNS_SHOW_NOTIFICATION = 'RNS_SHOW_NOTIFICATION' ;
75
- exports . RNS_SHOW_NOTIFICATION = RNS_SHOW_NOTIFICATION ;
76
- var RNS_HIDE_NOTIFICATION = 'RNS_HIDE_NOTIFICATION' ;
77
- exports . RNS_HIDE_NOTIFICATION = RNS_HIDE_NOTIFICATION ;
70
+ var RNS_SHOW_NOTIFICATION = exports . RNS_SHOW_NOTIFICATION = 'RNS_SHOW_NOTIFICATION' ;
71
+ var RNS_HIDE_NOTIFICATION = exports . RNS_HIDE_NOTIFICATION = 'RNS_HIDE_NOTIFICATION' ;
78
72
79
73
} , { } ] , 3 :[ function ( require , module , exports ) {
80
74
( function ( global ) {
81
- 'use strict' ;
82
-
83
- Object . defineProperty ( exports , '__esModule' , {
75
+ Object . defineProperty ( exports , "__esModule" , {
84
76
value : true
85
77
} ) ;
86
78
87
79
var _extends = Object . assign || function ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] ; for ( var key in source ) { if ( Object . prototype . hasOwnProperty . call ( source , key ) ) { target [ key ] = source [ key ] ; } } } return target ; } ;
88
80
89
- var _createClass = ( function ( ) { function defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( 'value' in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } } return function ( Constructor , protoProps , staticProps ) { if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) defineProperties ( Constructor , staticProps ) ; return Constructor ; } ; } ) ( ) ;
90
-
91
- var _get = function get ( _x , _x2 , _x3 ) { var _again = true ; _function: while ( _again ) { var object = _x , property = _x2 , receiver = _x3 ; _again = false ; if ( object === null ) object = Function . prototype ; var desc = Object . getOwnPropertyDescriptor ( object , property ) ; if ( desc === undefined ) { var parent = Object . getPrototypeOf ( object ) ; if ( parent === null ) { return undefined ; } else { _x = parent ; _x2 = property ; _x3 = receiver ; _again = true ; desc = parent = undefined ; continue _function; } } else if ( 'value' in desc ) { return desc . value ; } else { var getter = desc . get ; if ( getter === undefined ) { return undefined ; } return getter . call ( receiver ) ; } } } ;
92
-
93
- function _interopRequireWildcard ( obj ) { if ( obj && obj . __esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj [ 'default' ] = obj ; return newObj ; } }
94
-
95
- function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { 'default' : obj } ; }
96
-
97
- function _objectWithoutProperties ( obj , keys ) { var target = { } ; for ( var i in obj ) { if ( keys . indexOf ( i ) >= 0 ) continue ; if ( ! Object . prototype . hasOwnProperty . call ( obj , i ) ) continue ; target [ i ] = obj [ i ] ; } return target ; }
98
-
99
- function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( 'Cannot call a class as a function' ) ; } }
100
-
101
- function _inherits ( subClass , superClass ) { if ( typeof superClass !== 'function' && superClass !== null ) { throw new TypeError ( 'Super expression must either be null or a function, not ' + typeof superClass ) ; } subClass . prototype = Object . create ( superClass && superClass . prototype , { constructor : { value : subClass , enumerable : false , writable : true , configurable : true } } ) ; if ( superClass ) Object . setPrototypeOf ? Object . setPrototypeOf ( subClass , superClass ) : subClass . __proto__ = superClass ; }
81
+ var _createClass = function ( ) { function defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( "value" in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } } return function ( Constructor , protoProps , staticProps ) { if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) defineProperties ( Constructor , staticProps ) ; return Constructor ; } ; } ( ) ;
102
82
103
83
var _react = ( typeof window !== "undefined" ? window [ 'React' ] : typeof global !== "undefined" ? global [ 'React' ] : null ) ;
104
84
@@ -116,66 +96,98 @@ var _reactNotificationSystem = require('react-notification-system');
116
96
117
97
var _reactNotificationSystem2 = _interopRequireDefault ( _reactNotificationSystem ) ;
118
98
119
- var Notifications = ( function ( _React$Component ) {
99
+ function _interopRequireWildcard ( obj ) { if ( obj && obj . __esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj [ 'default' ] = obj ; return newObj ; } }
100
+
101
+ function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { 'default' : obj } ; }
102
+
103
+ function _objectWithoutProperties ( obj , keys ) { var target = { } ; for ( var i in obj ) { if ( keys . indexOf ( i ) >= 0 ) continue ; if ( ! Object . prototype . hasOwnProperty . call ( obj , i ) ) continue ; target [ i ] = obj [ i ] ; } return target ; }
104
+
105
+ function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
106
+
107
+ function _possibleConstructorReturn ( self , call ) { if ( ! self ) { throw new ReferenceError ( "this hasn't been initialised - super() hasn't been called" ) ; } return call && ( typeof call === "object" || typeof call === "function" ) ? call : self ; }
108
+
109
+ function _inherits ( subClass , superClass ) { if ( typeof superClass !== "function" && superClass !== null ) { throw new TypeError ( "Super expression must either be null or a function, not " + typeof superClass ) ; } subClass . prototype = Object . create ( superClass && superClass . prototype , { constructor : { value : subClass , enumerable : false , writable : true , configurable : true } } ) ; if ( superClass ) Object . setPrototypeOf ? Object . setPrototypeOf ( subClass , superClass ) : subClass . __proto__ = superClass ; }
110
+
111
+ var Notifications = function ( _React$Component ) {
120
112
_inherits ( Notifications , _React$Component ) ;
121
113
122
114
function Notifications ( ) {
123
115
_classCallCheck ( this , Notifications ) ;
124
116
125
- _get ( Object . getPrototypeOf ( Notifications . prototype ) , 'constructor' , this ) . apply ( this , arguments ) ;
117
+ return _possibleConstructorReturn ( this , ( Notifications . __proto__ || Object . getPrototypeOf ( Notifications ) ) . apply ( this , arguments ) ) ;
126
118
}
127
119
128
120
_createClass ( Notifications , [ {
129
121
key : 'system' ,
130
- value : function system ( ) {
131
- return this . refs . notify ;
132
- }
122
+ value : function ( ) {
123
+ function system ( ) {
124
+ return this . refs . notify ;
125
+ }
126
+
127
+ return system ;
128
+ } ( )
133
129
} , {
134
130
key : 'componentWillReceiveProps' ,
135
- value : function componentWillReceiveProps ( nextProps ) {
136
- var _this = this ;
131
+ value : function ( ) {
132
+ function componentWillReceiveProps ( nextProps ) {
133
+ var _this2 = this ;
137
134
138
- var notifications = nextProps . notifications ;
135
+ var notifications = nextProps . notifications ;
139
136
140
- var notificationIds = notifications . map ( function ( notification ) {
141
- return notification . uid ;
142
- } ) ;
137
+ var notificationIds = notifications . map ( function ( notification ) {
138
+ return notification . uid ;
139
+ } ) ;
143
140
144
- // Get all active notifications from react-notification-system
145
- /// and remove all where uid is not found in the reducer
146
- ( this . system ( ) . state . notifications || [ ] ) . forEach ( function ( notification ) {
147
- if ( notificationIds . indexOf ( notification . uid ) < 0 ) {
148
- _this . system ( ) . removeNotification ( notification . uid ) ;
149
- }
150
- } ) ;
151
-
152
- notifications . forEach ( function ( notification ) {
153
- _this . system ( ) . addNotification ( _extends ( { } , notification , {
154
- onRemove : function onRemove ( ) {
155
- _this . context . store . dispatch ( actions . hide ( notification . uid ) ) ;
141
+ // Get all active notifications from react-notification-system
142
+ /// and remove all where uid is not found in the reducer
143
+ ( this . system ( ) . state . notifications || [ ] ) . forEach ( function ( notification ) {
144
+ if ( notificationIds . indexOf ( notification . uid ) < 0 ) {
145
+ _this2 . system ( ) . removeNotification ( notification . uid ) ;
156
146
}
157
- } ) ) ;
158
- } ) ;
159
- }
147
+ } ) ;
148
+
149
+ notifications . forEach ( function ( notification ) {
150
+ _this2 . system ( ) . addNotification ( _extends ( { } , notification , {
151
+ onRemove : function ( ) {
152
+ function onRemove ( ) {
153
+ _this2 . context . store . dispatch ( actions . hide ( notification . uid ) ) ;
154
+ }
155
+
156
+ return onRemove ;
157
+ } ( )
158
+ } ) ) ;
159
+ } ) ;
160
+ }
161
+
162
+ return componentWillReceiveProps ;
163
+ } ( )
160
164
} , {
161
165
key : 'shouldComponentUpdate' ,
162
- value : function shouldComponentUpdate ( nextProps ) {
163
- return this . props !== nextProps ;
164
- }
166
+ value : function ( ) {
167
+ function shouldComponentUpdate ( nextProps ) {
168
+ return this . props !== nextProps ;
169
+ }
170
+
171
+ return shouldComponentUpdate ;
172
+ } ( )
165
173
} , {
166
174
key : 'render' ,
167
- value : function render ( ) {
168
- var _props = this . props ;
169
- var notifications = _props . notifications ;
175
+ value : function ( ) {
176
+ function render ( ) {
177
+ var _props = this . props ;
178
+ var notifications = _props . notifications ;
170
179
171
- var rest = _objectWithoutProperties ( _props , [ 'notifications' ] ) ;
180
+ var rest = _objectWithoutProperties ( _props , [ 'notifications' ] ) ;
172
181
173
- return _react2 [ 'default' ] . createElement ( _reactNotificationSystem2 [ 'default' ] , _extends ( { ref : 'notify' } , rest ) ) ;
174
- }
182
+ return _react2 [ 'default' ] . createElement ( _reactNotificationSystem2 [ 'default' ] , _extends ( { ref : 'notify' } , rest ) ) ;
183
+ }
184
+
185
+ return render ;
186
+ } ( )
175
187
} ] ) ;
176
188
177
189
return Notifications ;
178
- } ) ( _react2 [ 'default' ] . Component ) ;
190
+ } ( _react2 [ 'default' ] . Component ) ;
179
191
180
192
Notifications . propTypes = {
181
193
notifications : _react . PropTypes . array
@@ -193,34 +205,32 @@ Object.keys(actions).forEach(function (key) {
193
205
Notifications . reducer = _reducer2 [ 'default' ] ;
194
206
195
207
exports [ 'default' ] = Notifications ;
196
- module . exports = exports [ 'default' ] ;
197
208
198
209
} ) . call ( this , typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : { } )
199
210
} , { "./actions" :1 , "./reducer" :4 , "react-notification-system" :undefined } ] , 4 :[ function ( require , module , exports ) {
200
- 'use strict' ;
201
-
202
- Object . defineProperty ( exports , '__esModule' , {
211
+ Object . defineProperty ( exports , "__esModule" , {
203
212
value : true
204
213
} ) ;
205
214
206
215
var _extends = Object . assign || function ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] ; for ( var key in source ) { if ( Object . prototype . hasOwnProperty . call ( source , key ) ) { target [ key ] = source [ key ] ; } } } return target ; } ;
207
216
208
217
exports [ 'default' ] = Notifications ;
209
218
210
- function _toConsumableArray ( arr ) { if ( Array . isArray ( arr ) ) { for ( var i = 0 , arr2 = Array ( arr . length ) ; i < arr . length ; i ++ ) arr2 [ i ] = arr [ i ] ; return arr2 ; } else { return Array . from ( arr ) ; } }
219
+ var _const = require ( './const' ) ;
211
220
212
- function _objectWithoutProperties ( obj , keys ) { var target = { } ; for ( var i in obj ) { if ( keys . indexOf ( i ) >= 0 ) continue ; if ( ! Object . prototype . hasOwnProperty . call ( obj , i ) ) continue ; target [ i ] = obj [ i ] ; } return target ; }
221
+ function _toConsumableArray ( arr ) { if ( Array . isArray ( arr ) ) { for ( var i = 0 , arr2 = Array ( arr . length ) ; i < arr . length ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; } else { return Array . from ( arr ) ; } }
213
222
214
- var _const = require ( './const' ) ;
223
+ function _objectWithoutProperties ( obj , keys ) { var target = { } ; for ( var i in obj ) { if ( keys . indexOf ( i ) >= 0 ) continue ; if ( ! Object . prototype . hasOwnProperty . call ( obj , i ) ) continue ; target [ i ] = obj [ i ] ; } return target ; }
215
224
216
225
function Notifications ( ) {
217
226
var state = arguments . length <= 0 || arguments [ 0 ] === undefined ? [ ] : arguments [ 0 ] ;
218
227
var action = arguments . length <= 1 || arguments [ 1 ] === undefined ? { } : arguments [ 1 ] ;
219
228
220
229
switch ( action . type ) {
221
230
case _const . RNS_SHOW_NOTIFICATION :
222
- var type = action . type ,
223
- rest = _objectWithoutProperties ( action , [ 'type' ] ) ;
231
+ var type = action . type ;
232
+
233
+ var rest = _objectWithoutProperties ( action , [ 'type' ] ) ;
224
234
225
235
return [ ] . concat ( _toConsumableArray ( state ) , [ _extends ( { } , rest , { uid : action . uid } ) ] ) ;
226
236
case _const . RNS_HIDE_NOTIFICATION :
@@ -231,7 +241,5 @@ function Notifications() {
231
241
return state ;
232
242
}
233
243
234
- module . exports = exports [ 'default' ] ;
235
-
236
244
} , { "./const" :2 } ] } , { } , [ 3 ] ) ( 3 )
237
245
} ) ;
0 commit comments