activeadmin 3.2.1 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/lib/active_admin/version.rb +1 -1
  4. data/lib/active_admin/views/components/active_admin_form.rb +1 -1
  5. data/vendor/assets/javascripts/jquery-ui/data.js +12 -8
  6. data/vendor/assets/javascripts/jquery-ui/disable-selection.js +10 -7
  7. data/vendor/assets/javascripts/jquery-ui/focusable.js +12 -9
  8. data/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js +60 -57
  9. data/vendor/assets/javascripts/jquery-ui/form.js +15 -12
  10. data/vendor/assets/javascripts/jquery-ui/ie.js +5 -2
  11. data/vendor/assets/javascripts/jquery-ui/keycode.js +11 -7
  12. data/vendor/assets/javascripts/jquery-ui/labels.js +46 -40
  13. data/vendor/assets/javascripts/jquery-ui/plugin.js +5 -2
  14. data/vendor/assets/javascripts/jquery-ui/position.js +30 -17
  15. data/vendor/assets/javascripts/jquery-ui/safe-active-element.js +6 -2
  16. data/vendor/assets/javascripts/jquery-ui/safe-blur.js +6 -2
  17. data/vendor/assets/javascripts/jquery-ui/scroll-parent.js +10 -7
  18. data/vendor/assets/javascripts/jquery-ui/tabbable.js +11 -8
  19. data/vendor/assets/javascripts/jquery-ui/unique-id.js +10 -7
  20. data/vendor/assets/javascripts/jquery-ui/version.js +6 -3
  21. data/vendor/assets/javascripts/jquery-ui/widget.js +53 -30
  22. data/vendor/assets/javascripts/jquery-ui/widgets/button.js +87 -24
  23. data/vendor/assets/javascripts/jquery-ui/widgets/checkboxradio.js +276 -273
  24. data/vendor/assets/javascripts/jquery-ui/widgets/controlgroup.js +15 -11
  25. data/vendor/assets/javascripts/jquery-ui/widgets/datepicker.js +182 -62
  26. data/vendor/assets/javascripts/jquery-ui/widgets/dialog.js +53 -36
  27. data/vendor/assets/javascripts/jquery-ui/widgets/draggable.js +28 -19
  28. data/vendor/assets/javascripts/jquery-ui/widgets/mouse.js +22 -11
  29. data/vendor/assets/javascripts/jquery-ui/widgets/resizable.js +47 -26
  30. data/vendor/assets/javascripts/jquery-ui/widgets/sortable.js +186 -125
  31. data/vendor/assets/javascripts/jquery-ui/widgets/tabs.js +20 -20
  32. metadata +3 -4
  33. data/vendor/assets/javascripts/jquery-ui/escape-selector.js +0 -23
@@ -8,22 +8,24 @@
8
8
  //= require jquery-ui/widget
9
9
 
10
10
  /*!
11
- * jQuery UI Draggable 1.12.1
12
- * http://jqueryui.com
11
+ * jQuery UI Draggable 1.13.3
12
+ * https://jqueryui.com
13
13
  *
14
- * Copyright jQuery Foundation and other contributors
14
+ * Copyright OpenJS Foundation and other contributors
15
15
  * Released under the MIT license.
16
- * http://jquery.org/license
16
+ * https://jquery.org/license
17
17
  */
18
18
 
19
19
  //>>label: Draggable
20
20
  //>>group: Interactions
21
21
  //>>description: Enables dragging functionality for any element.
22
- //>>docs: http://api.jqueryui.com/draggable/
23
- //>>demos: http://jqueryui.com/draggable/
22
+ //>>docs: https://api.jqueryui.com/draggable/
23
+ //>>demos: https://jqueryui.com/draggable/
24
24
  //>>css.structure: ../../themes/base/draggable.css
25
25
 
26
26
  ( function( factory ) {
27
+ "use strict";
28
+
27
29
  if ( typeof define === "function" && define.amd ) {
28
30
 
29
31
  // AMD. Register as an anonymous module.
@@ -43,10 +45,11 @@
43
45
  // Browser globals
44
46
  factory( jQuery );
45
47
  }
46
- }( function( $ ) {
48
+ } )( function( $ ) {
49
+ "use strict";
47
50
 
48
51
  $.widget( "ui.draggable", $.ui.mouse, {
49
- version: "1.12.1",
52
+ version: "1.13.3",
50
53
  widgetEventPrefix: "drag",
51
54
  options: {
52
55
  addClasses: true,
@@ -210,7 +213,9 @@ $.widget( "ui.draggable", $.ui.mouse, {
210
213
  this.originalPageY = event.pageY;
211
214
 
212
215
  //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
213
- ( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) );
216
+ if ( o.cursorAt ) {
217
+ this._adjustOffsetFromHelper( o.cursorAt );
218
+ }
214
219
 
215
220
  //Set a containment if given in the options
216
221
  this._setContainment();
@@ -305,7 +310,7 @@ $.widget( "ui.draggable", $.ui.mouse, {
305
310
 
306
311
  if ( ( this.options.revert === "invalid" && !dropped ) ||
307
312
  ( this.options.revert === "valid" && dropped ) ||
308
- this.options.revert === true || ( $.isFunction( this.options.revert ) &&
313
+ this.options.revert === true || ( typeof this.options.revert === "function" &&
309
314
  this.options.revert.call( this.element, dropped ) )
310
315
  ) {
311
316
  $( this.helper ).animate(
@@ -377,7 +382,7 @@ $.widget( "ui.draggable", $.ui.mouse, {
377
382
  _createHelper: function( event ) {
378
383
 
379
384
  var o = this.options,
380
- helperIsFunction = $.isFunction( o.helper ),
385
+ helperIsFunction = typeof o.helper === "function",
381
386
  helper = helperIsFunction ?
382
387
  $( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
383
388
  ( o.helper === "clone" ?
@@ -390,7 +395,7 @@ $.widget( "ui.draggable", $.ui.mouse, {
390
395
  o.appendTo ) );
391
396
  }
392
397
 
393
- // Http://bugs.jqueryui.com/ticket/9446
398
+ // https://bugs.jqueryui.com/ticket/9446
394
399
  // a helper function can return the original element
395
400
  // which wouldn't have been set to relative in _create
396
401
  if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
@@ -416,7 +421,7 @@ $.widget( "ui.draggable", $.ui.mouse, {
416
421
  if ( typeof obj === "string" ) {
417
422
  obj = obj.split( " " );
418
423
  }
419
- if ( $.isArray( obj ) ) {
424
+ if ( Array.isArray( obj ) ) {
420
425
  obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
421
426
  }
422
427
  if ( "left" in obj ) {
@@ -1125,12 +1130,13 @@ $.ui.plugin.add( "draggable", "snap", {
1125
1130
  !$.contains( inst.snapElements[ i ].item.ownerDocument,
1126
1131
  inst.snapElements[ i ].item ) ) {
1127
1132
  if ( inst.snapElements[ i ].snapping ) {
1128
- ( inst.options.snap.release &&
1133
+ if ( inst.options.snap.release ) {
1129
1134
  inst.options.snap.release.call(
1130
1135
  inst.element,
1131
1136
  event,
1132
1137
  $.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } )
1133
- ) );
1138
+ );
1139
+ }
1134
1140
  }
1135
1141
  inst.snapElements[ i ].snapping = false;
1136
1142
  continue;
@@ -1201,13 +1207,14 @@ $.ui.plugin.add( "draggable", "snap", {
1201
1207
  }
1202
1208
 
1203
1209
  if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) {
1204
- ( inst.options.snap.snap &&
1210
+ if ( inst.options.snap.snap ) {
1205
1211
  inst.options.snap.snap.call(
1206
1212
  inst.element,
1207
1213
  event,
1208
1214
  $.extend( inst._uiHash(), {
1209
1215
  snapItem: inst.snapElements[ i ].item
1210
- } ) ) );
1216
+ } ) );
1217
+ }
1211
1218
  }
1212
1219
  inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first );
1213
1220
 
@@ -1225,7 +1232,9 @@ $.ui.plugin.add( "draggable", "stack", {
1225
1232
  ( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 );
1226
1233
  } );
1227
1234
 
1228
- if ( !group.length ) { return; }
1235
+ if ( !group.length ) {
1236
+ return;
1237
+ }
1229
1238
 
1230
1239
  min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0;
1231
1240
  $( group ).each( function( i ) {
@@ -1256,4 +1265,4 @@ $.ui.plugin.add( "draggable", "zIndex", {
1256
1265
 
1257
1266
  return $.ui.draggable;
1258
1267
 
1259
- } ) );
1268
+ } );
@@ -3,20 +3,22 @@
3
3
  //= require jquery-ui/widget
4
4
 
5
5
  /*!
6
- * jQuery UI Mouse 1.12.1
7
- * http://jqueryui.com
6
+ * jQuery UI Mouse 1.13.3
7
+ * https://jqueryui.com
8
8
  *
9
- * Copyright jQuery Foundation and other contributors
9
+ * Copyright OpenJS Foundation and other contributors
10
10
  * Released under the MIT license.
11
- * http://jquery.org/license
11
+ * https://jquery.org/license
12
12
  */
13
13
 
14
14
  //>>label: Mouse
15
15
  //>>group: Widgets
16
16
  //>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
17
- //>>docs: http://api.jqueryui.com/mouse/
17
+ //>>docs: https://api.jqueryui.com/mouse/
18
18
 
19
19
  ( function( factory ) {
20
+ "use strict";
21
+
20
22
  if ( typeof define === "function" && define.amd ) {
21
23
 
22
24
  // AMD. Register as an anonymous module.
@@ -31,7 +33,8 @@
31
33
  // Browser globals
32
34
  factory( jQuery );
33
35
  }
34
- }( function( $ ) {
36
+ } )( function( $ ) {
37
+ "use strict";
35
38
 
36
39
  var mouseHandled = false;
37
40
  $( document ).on( "mouseup", function() {
@@ -39,7 +42,7 @@ $( document ).on( "mouseup", function() {
39
42
  } );
40
43
 
41
44
  return $.widget( "ui.mouse", {
42
- version: "1.12.1",
45
+ version: "1.13.3",
43
46
  options: {
44
47
  cancel: "input, textarea, button, select, option",
45
48
  distance: 1,
@@ -84,7 +87,9 @@ return $.widget( "ui.mouse", {
84
87
  this._mouseMoved = false;
85
88
 
86
89
  // We may have missed mouseup (out of window)
87
- ( this._mouseStarted && this._mouseUp( event ) );
90
+ if ( this._mouseStarted ) {
91
+ this._mouseUp( event );
92
+ }
88
93
 
89
94
  this._mouseDownEvent = event;
90
95
 
@@ -177,7 +182,11 @@ return $.widget( "ui.mouse", {
177
182
  if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
178
183
  this._mouseStarted =
179
184
  ( this._mouseStart( this._mouseDownEvent, event ) !== false );
180
- ( this._mouseStarted ? this._mouseDrag( event ) : this._mouseUp( event ) );
185
+ if ( this._mouseStarted ) {
186
+ this._mouseDrag( event );
187
+ } else {
188
+ this._mouseUp( event );
189
+ }
181
190
  }
182
191
 
183
192
  return !this._mouseStarted;
@@ -224,7 +233,9 @@ return $.widget( "ui.mouse", {
224
233
  _mouseStart: function( /* event */ ) {},
225
234
  _mouseDrag: function( /* event */ ) {},
226
235
  _mouseStop: function( /* event */ ) {},
227
- _mouseCapture: function( /* event */ ) { return true; }
236
+ _mouseCapture: function( /* event */ ) {
237
+ return true;
238
+ }
228
239
  } );
229
240
 
230
- } ) );
241
+ } );
@@ -5,24 +5,26 @@
5
5
  //= require jquery-ui/widget
6
6
 
7
7
  /*!
8
- * jQuery UI Resizable 1.12.1
9
- * http://jqueryui.com
8
+ * jQuery UI Resizable 1.13.3
9
+ * https://jqueryui.com
10
10
  *
11
- * Copyright jQuery Foundation and other contributors
11
+ * Copyright OpenJS Foundation and other contributors
12
12
  * Released under the MIT license.
13
- * http://jquery.org/license
13
+ * https://jquery.org/license
14
14
  */
15
15
 
16
16
  //>>label: Resizable
17
17
  //>>group: Interactions
18
18
  //>>description: Enables resize functionality for any element.
19
- //>>docs: http://api.jqueryui.com/resizable/
20
- //>>demos: http://jqueryui.com/resizable/
19
+ //>>docs: https://api.jqueryui.com/resizable/
20
+ //>>demos: https://jqueryui.com/resizable/
21
21
  //>>css.structure: ../../themes/base/core.css
22
22
  //>>css.structure: ../../themes/base/resizable.css
23
23
  //>>css.theme: ../../themes/base/theme.css
24
24
 
25
25
  ( function( factory ) {
26
+ "use strict";
27
+
26
28
  if ( typeof define === "function" && define.amd ) {
27
29
 
28
30
  // AMD. Register as an anonymous module.
@@ -39,10 +41,11 @@
39
41
  // Browser globals
40
42
  factory( jQuery );
41
43
  }
42
- }( function( $ ) {
44
+ } )( function( $ ) {
45
+ "use strict";
43
46
 
44
47
  $.widget( "ui.resizable", $.ui.mouse, {
45
- version: "1.12.1",
48
+ version: "1.13.3",
46
49
  widgetEventPrefix: "resize",
47
50
  options: {
48
51
  alsoResize: false,
@@ -97,9 +100,15 @@ $.widget( "ui.resizable", $.ui.mouse, {
97
100
  // TODO: determine which cases actually cause this to happen
98
101
  // if the element doesn't have the scroll set, see if it's possible to
99
102
  // set the scroll
100
- el[ scroll ] = 1;
101
- has = ( el[ scroll ] > 0 );
102
- el[ scroll ] = 0;
103
+ try {
104
+ el[ scroll ] = 1;
105
+ has = ( el[ scroll ] > 0 );
106
+ el[ scroll ] = 0;
107
+ } catch ( e ) {
108
+
109
+ // `el` might be a string, then setting `scroll` will throw
110
+ // an error in strict mode; ignore it.
111
+ }
103
112
  return has;
104
113
  },
105
114
 
@@ -122,7 +131,8 @@ $.widget( "ui.resizable", $.ui.mouse, {
122
131
  if ( this.element[ 0 ].nodeName.match( /^(canvas|textarea|input|select|button|img)$/i ) ) {
123
132
 
124
133
  this.element.wrap(
125
- $( "<div class='ui-wrapper' style='overflow: hidden;'></div>" ).css( {
134
+ $( "<div class='ui-wrapper'></div>" ).css( {
135
+ overflow: "hidden",
126
136
  position: this.element.css( "position" ),
127
137
  width: this.element.outerWidth(),
128
138
  height: this.element.outerHeight(),
@@ -193,15 +203,14 @@ $.widget( "ui.resizable", $.ui.mouse, {
193
203
  _destroy: function() {
194
204
 
195
205
  this._mouseDestroy();
206
+ this._addedHandles.remove();
196
207
 
197
208
  var wrapper,
198
209
  _destroy = function( exp ) {
199
210
  $( exp )
200
211
  .removeData( "resizable" )
201
212
  .removeData( "ui-resizable" )
202
- .off( ".resizable" )
203
- .find( ".ui-resizable-handle" )
204
- .remove();
213
+ .off( ".resizable" );
205
214
  };
206
215
 
207
216
  // TODO: Unwrap at same DOM position
@@ -232,6 +241,9 @@ $.widget( "ui.resizable", $.ui.mouse, {
232
241
  this._removeHandles();
233
242
  this._setupHandles();
234
243
  break;
244
+ case "aspectRatio":
245
+ this._aspectRatio = !!value;
246
+ break;
235
247
  default:
236
248
  break;
237
249
  }
@@ -253,6 +265,7 @@ $.widget( "ui.resizable", $.ui.mouse, {
253
265
  } );
254
266
 
255
267
  this._handles = $();
268
+ this._addedHandles = $();
256
269
  if ( this.handles.constructor === String ) {
257
270
 
258
271
  if ( this.handles === "all" ) {
@@ -264,7 +277,7 @@ $.widget( "ui.resizable", $.ui.mouse, {
264
277
 
265
278
  for ( i = 0; i < n.length; i++ ) {
266
279
 
267
- handle = $.trim( n[ i ] );
280
+ handle = String.prototype.trim.call( n[ i ] );
268
281
  hname = "ui-resizable-" + handle;
269
282
  axis = $( "<div>" );
270
283
  this._addClass( axis, "ui-resizable-handle " + hname );
@@ -272,7 +285,10 @@ $.widget( "ui.resizable", $.ui.mouse, {
272
285
  axis.css( { zIndex: o.zIndex } );
273
286
 
274
287
  this.handles[ handle ] = ".ui-resizable-" + handle;
275
- this.element.append( axis );
288
+ if ( !this.element.children( this.handles[ handle ] ).length ) {
289
+ this.element.append( axis );
290
+ this._addedHandles = this._addedHandles.add( axis );
291
+ }
276
292
  }
277
293
 
278
294
  }
@@ -338,7 +354,7 @@ $.widget( "ui.resizable", $.ui.mouse, {
338
354
  },
339
355
 
340
356
  _removeHandles: function() {
341
- this._handles.remove();
357
+ this._addedHandles.remove();
342
358
  },
343
359
 
344
360
  _mouseCapture: function( event ) {
@@ -523,15 +539,18 @@ $.widget( "ui.resizable", $.ui.mouse, {
523
539
  if ( this.position.left !== this.prevPosition.left ) {
524
540
  props.left = this.position.left + "px";
525
541
  }
542
+
543
+ this.helper.css( props );
544
+
526
545
  if ( this.size.width !== this.prevSize.width ) {
527
546
  props.width = this.size.width + "px";
547
+ this.helper.width( props.width );
528
548
  }
529
549
  if ( this.size.height !== this.prevSize.height ) {
530
550
  props.height = this.size.height + "px";
551
+ this.helper.height( props.height );
531
552
  }
532
553
 
533
- this.helper.css( props );
534
-
535
554
  return props;
536
555
  },
537
556
 
@@ -718,7 +737,7 @@ $.widget( "ui.resizable", $.ui.mouse, {
718
737
 
719
738
  if ( this._helper ) {
720
739
 
721
- this.helper = this.helper || $( "<div style='overflow:hidden;'></div>" );
740
+ this.helper = this.helper || $( "<div></div>" ).css( { overflow: "hidden" } );
722
741
 
723
742
  this._addClass( this.helper, this._helper );
724
743
  this.helper.css( {
@@ -775,7 +794,9 @@ $.widget( "ui.resizable", $.ui.mouse, {
775
794
 
776
795
  _propagate: function( n, event ) {
777
796
  $.ui.plugin.call( this, n, [ event, this.ui() ] );
778
- ( n !== "resize" && this._trigger( n, event, this.ui() ) );
797
+ if ( n !== "resize" ) {
798
+ this._trigger( n, event, this.ui() );
799
+ }
779
800
  },
780
801
 
781
802
  plugins: {},
@@ -896,8 +917,8 @@ $.ui.plugin.add( "resizable", "containment", {
896
917
  co = that.containerOffset;
897
918
  ch = that.containerSize.height;
898
919
  cw = that.containerSize.width;
899
- width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw );
900
- height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ;
920
+ width = ( that._hasScroll( ce, "left" ) ? ce.scrollWidth : cw );
921
+ height = ( that._hasScroll( ce ) ? ce.scrollHeight : ch );
901
922
 
902
923
  that.parentData = {
903
924
  element: ce,
@@ -1036,7 +1057,7 @@ $.ui.plugin.add( "resizable", "alsoResize", {
1036
1057
  $( o.alsoResize ).each( function() {
1037
1058
  var el = $( this );
1038
1059
  el.data( "ui-resizable-alsoresize", {
1039
- width: parseFloat( el.width() ), height: parseFloat( el.height() ),
1060
+ width: parseFloat( el.css( "width" ) ), height: parseFloat( el.css( "height" ) ),
1040
1061
  left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) )
1041
1062
  } );
1042
1063
  } );
@@ -1204,4 +1225,4 @@ $.ui.plugin.add( "resizable", "grid", {
1204
1225
 
1205
1226
  return $.ui.resizable;
1206
1227
 
1207
- } ) );
1228
+ } );