activeadmin 3.2.1 → 3.2.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/README.md +2 -2
- data/app/assets/stylesheets/active_admin/_forms.scss +1 -2
- data/app/assets/stylesheets/active_admin/components/_comments.scss +1 -1
- data/app/assets/stylesheets/active_admin/components/_dropdown_menu.scss +7 -4
- data/app/assets/stylesheets/active_admin/components/_pagination.scss +5 -2
- data/app/assets/stylesheets/active_admin/components/_table_tools.scss +9 -6
- data/app/assets/stylesheets/active_admin/components/_tabs.scss +10 -7
- data/app/assets/stylesheets/active_admin/mixins/_buttons.scss +2 -2
- data/app/assets/stylesheets/active_admin/pages/_logged_out.scss +1 -1
- data/app/assets/stylesheets/active_admin/structure/_footer.scss +1 -1
- data/app/assets/stylesheets/active_admin/structure/_title_bar.scss +6 -3
- data/lib/active_admin/pundit_adapter.rb +1 -1
- data/lib/active_admin/resource/attributes.rb +8 -1
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin/views/components/active_admin_form.rb +1 -1
- data/vendor/assets/javascripts/jquery-ui/data.js +12 -8
- data/vendor/assets/javascripts/jquery-ui/disable-selection.js +10 -7
- data/vendor/assets/javascripts/jquery-ui/focusable.js +12 -9
- data/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js +60 -57
- data/vendor/assets/javascripts/jquery-ui/form.js +15 -12
- data/vendor/assets/javascripts/jquery-ui/ie.js +5 -2
- data/vendor/assets/javascripts/jquery-ui/keycode.js +11 -7
- data/vendor/assets/javascripts/jquery-ui/labels.js +46 -40
- data/vendor/assets/javascripts/jquery-ui/plugin.js +5 -2
- data/vendor/assets/javascripts/jquery-ui/position.js +30 -17
- data/vendor/assets/javascripts/jquery-ui/safe-active-element.js +6 -2
- data/vendor/assets/javascripts/jquery-ui/safe-blur.js +6 -2
- data/vendor/assets/javascripts/jquery-ui/scroll-parent.js +10 -7
- data/vendor/assets/javascripts/jquery-ui/tabbable.js +11 -8
- data/vendor/assets/javascripts/jquery-ui/unique-id.js +10 -7
- data/vendor/assets/javascripts/jquery-ui/version.js +6 -3
- data/vendor/assets/javascripts/jquery-ui/widget.js +53 -30
- data/vendor/assets/javascripts/jquery-ui/widgets/button.js +87 -24
- data/vendor/assets/javascripts/jquery-ui/widgets/checkboxradio.js +276 -273
- data/vendor/assets/javascripts/jquery-ui/widgets/controlgroup.js +15 -11
- data/vendor/assets/javascripts/jquery-ui/widgets/datepicker.js +182 -62
- data/vendor/assets/javascripts/jquery-ui/widgets/dialog.js +53 -36
- data/vendor/assets/javascripts/jquery-ui/widgets/draggable.js +28 -19
- data/vendor/assets/javascripts/jquery-ui/widgets/mouse.js +22 -11
- data/vendor/assets/javascripts/jquery-ui/widgets/resizable.js +47 -26
- data/vendor/assets/javascripts/jquery-ui/widgets/sortable.js +186 -125
- data/vendor/assets/javascripts/jquery-ui/widgets/tabs.js +20 -20
- metadata +3 -4
- data/vendor/assets/javascripts/jquery-ui/escape-selector.js +0 -23
@@ -1,21 +1,23 @@
|
|
1
1
|
//= require jquery-ui/version
|
2
2
|
|
3
3
|
/*!
|
4
|
-
* jQuery UI Widget 1.
|
5
|
-
*
|
4
|
+
* jQuery UI Widget 1.13.3
|
5
|
+
* https://jqueryui.com
|
6
6
|
*
|
7
|
-
* Copyright
|
7
|
+
* Copyright OpenJS Foundation and other contributors
|
8
8
|
* Released under the MIT license.
|
9
|
-
*
|
9
|
+
* https://jquery.org/license
|
10
10
|
*/
|
11
11
|
|
12
12
|
//>>label: Widget
|
13
13
|
//>>group: Core
|
14
14
|
//>>description: Provides a factory for creating stateful widgets with a common API.
|
15
|
-
//>>docs:
|
16
|
-
//>>demos:
|
15
|
+
//>>docs: https://api.jqueryui.com/jQuery.widget/
|
16
|
+
//>>demos: https://jqueryui.com/widget/
|
17
17
|
|
18
18
|
( function( factory ) {
|
19
|
+
"use strict";
|
20
|
+
|
19
21
|
if ( typeof define === "function" && define.amd ) {
|
20
22
|
|
21
23
|
// AMD. Register as an anonymous module.
|
@@ -25,25 +27,23 @@
|
|
25
27
|
// Browser globals
|
26
28
|
factory( jQuery );
|
27
29
|
}
|
28
|
-
}( function( $ ) {
|
30
|
+
} )( function( $ ) {
|
31
|
+
"use strict";
|
29
32
|
|
30
33
|
var widgetUuid = 0;
|
34
|
+
var widgetHasOwnProperty = Array.prototype.hasOwnProperty;
|
31
35
|
var widgetSlice = Array.prototype.slice;
|
32
36
|
|
33
37
|
$.cleanData = ( function( orig ) {
|
34
38
|
return function( elems ) {
|
35
39
|
var events, elem, i;
|
36
40
|
for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
|
37
|
-
try {
|
38
|
-
|
39
|
-
// Only trigger remove when necessary to save time
|
40
|
-
events = $._data( elem, "events" );
|
41
|
-
if ( events && events.remove ) {
|
42
|
-
$( elem ).triggerHandler( "remove" );
|
43
|
-
}
|
44
41
|
|
45
|
-
//
|
46
|
-
|
42
|
+
// Only trigger remove when necessary to save time
|
43
|
+
events = $._data( elem, "events" );
|
44
|
+
if ( events && events.remove ) {
|
45
|
+
$( elem ).triggerHandler( "remove" );
|
46
|
+
}
|
47
47
|
}
|
48
48
|
orig( elems );
|
49
49
|
};
|
@@ -65,12 +65,12 @@ $.widget = function( name, base, prototype ) {
|
|
65
65
|
base = $.Widget;
|
66
66
|
}
|
67
67
|
|
68
|
-
if (
|
68
|
+
if ( Array.isArray( prototype ) ) {
|
69
69
|
prototype = $.extend.apply( null, [ {} ].concat( prototype ) );
|
70
70
|
}
|
71
71
|
|
72
72
|
// Create selector for plugin
|
73
|
-
$.expr[
|
73
|
+
$.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) {
|
74
74
|
return !!$.data( elem, fullName );
|
75
75
|
};
|
76
76
|
|
@@ -79,7 +79,7 @@ $.widget = function( name, base, prototype ) {
|
|
79
79
|
constructor = $[ namespace ][ name ] = function( options, element ) {
|
80
80
|
|
81
81
|
// Allow instantiation without "new" keyword
|
82
|
-
if ( !this._createWidget ) {
|
82
|
+
if ( !this || !this._createWidget ) {
|
83
83
|
return new constructor( options, element );
|
84
84
|
}
|
85
85
|
|
@@ -110,7 +110,7 @@ $.widget = function( name, base, prototype ) {
|
|
110
110
|
// inheriting from
|
111
111
|
basePrototype.options = $.widget.extend( {}, basePrototype.options );
|
112
112
|
$.each( prototype, function( prop, value ) {
|
113
|
-
if (
|
113
|
+
if ( typeof value !== "function" ) {
|
114
114
|
proxiedPrototype[ prop ] = value;
|
115
115
|
return;
|
116
116
|
}
|
@@ -189,7 +189,7 @@ $.widget.extend = function( target ) {
|
|
189
189
|
for ( ; inputIndex < inputLength; inputIndex++ ) {
|
190
190
|
for ( key in input[ inputIndex ] ) {
|
191
191
|
value = input[ inputIndex ][ key ];
|
192
|
-
if ( input[ inputIndex ]
|
192
|
+
if ( widgetHasOwnProperty.call( input[ inputIndex ], key ) && value !== undefined ) {
|
193
193
|
|
194
194
|
// Clone objects
|
195
195
|
if ( $.isPlainObject( value ) ) {
|
@@ -238,7 +238,8 @@ $.widget.bridge = function( name, object ) {
|
|
238
238
|
"attempted to call method '" + options + "'" );
|
239
239
|
}
|
240
240
|
|
241
|
-
if (
|
241
|
+
if ( typeof instance[ options ] !== "function" ||
|
242
|
+
options.charAt( 0 ) === "_" ) {
|
242
243
|
return $.error( "no such method '" + options + "' for " + name +
|
243
244
|
" widget instance" );
|
244
245
|
}
|
@@ -499,12 +500,34 @@ $.Widget.prototype = {
|
|
499
500
|
classes: this.options.classes || {}
|
500
501
|
}, options );
|
501
502
|
|
503
|
+
function bindRemoveEvent() {
|
504
|
+
var nodesToBind = [];
|
505
|
+
|
506
|
+
options.element.each( function( _, element ) {
|
507
|
+
var isTracked = $.map( that.classesElementLookup, function( elements ) {
|
508
|
+
return elements;
|
509
|
+
} )
|
510
|
+
.some( function( elements ) {
|
511
|
+
return elements.is( element );
|
512
|
+
} );
|
513
|
+
|
514
|
+
if ( !isTracked ) {
|
515
|
+
nodesToBind.push( element );
|
516
|
+
}
|
517
|
+
} );
|
518
|
+
|
519
|
+
that._on( $( nodesToBind ), {
|
520
|
+
remove: "_untrackClassesElement"
|
521
|
+
} );
|
522
|
+
}
|
523
|
+
|
502
524
|
function processClassString( classes, checkOption ) {
|
503
525
|
var current, i;
|
504
526
|
for ( i = 0; i < classes.length; i++ ) {
|
505
527
|
current = that.classesElementLookup[ classes[ i ] ] || $();
|
506
528
|
if ( options.add ) {
|
507
|
-
|
529
|
+
bindRemoveEvent();
|
530
|
+
current = $( $.uniqueSort( current.get().concat( options.element.get() ) ) );
|
508
531
|
} else {
|
509
532
|
current = $( current.not( options.element ).get() );
|
510
533
|
}
|
@@ -516,10 +539,6 @@ $.Widget.prototype = {
|
|
516
539
|
}
|
517
540
|
}
|
518
541
|
|
519
|
-
this._on( options.element, {
|
520
|
-
"remove": "_untrackClassesElement"
|
521
|
-
} );
|
522
|
-
|
523
542
|
if ( options.keys ) {
|
524
543
|
processClassString( options.keys.match( /\S+/g ) || [], true );
|
525
544
|
}
|
@@ -537,6 +556,8 @@ $.Widget.prototype = {
|
|
537
556
|
that.classesElementLookup[ key ] = $( value.not( event.target ).get() );
|
538
557
|
}
|
539
558
|
} );
|
559
|
+
|
560
|
+
this._off( $( event.target ) );
|
540
561
|
},
|
541
562
|
|
542
563
|
_removeClass: function( element, keys, extra ) {
|
@@ -617,7 +638,7 @@ $.Widget.prototype = {
|
|
617
638
|
_off: function( element, eventName ) {
|
618
639
|
eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) +
|
619
640
|
this.eventNamespace;
|
620
|
-
element.off( eventName )
|
641
|
+
element.off( eventName );
|
621
642
|
|
622
643
|
// Clear the stack to avoid memory leaks (#10056)
|
623
644
|
this.bindings = $( this.bindings.not( element ).get() );
|
@@ -683,7 +704,7 @@ $.Widget.prototype = {
|
|
683
704
|
}
|
684
705
|
|
685
706
|
this.element.trigger( event, data );
|
686
|
-
return !(
|
707
|
+
return !( typeof callback === "function" &&
|
687
708
|
callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||
|
688
709
|
event.isDefaultPrevented() );
|
689
710
|
}
|
@@ -705,6 +726,8 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
|
|
705
726
|
options = options || {};
|
706
727
|
if ( typeof options === "number" ) {
|
707
728
|
options = { duration: options };
|
729
|
+
} else if ( options === true ) {
|
730
|
+
options = {};
|
708
731
|
}
|
709
732
|
|
710
733
|
hasOptions = !$.isEmptyObject( options );
|
@@ -732,4 +755,4 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
|
|
732
755
|
|
733
756
|
return $.widget;
|
734
757
|
|
735
|
-
} )
|
758
|
+
} );
|
@@ -4,24 +4,26 @@
|
|
4
4
|
//= require jquery-ui/widget
|
5
5
|
|
6
6
|
/*!
|
7
|
-
* jQuery UI Button 1.
|
8
|
-
*
|
7
|
+
* jQuery UI Button 1.13.3
|
8
|
+
* https://jqueryui.com
|
9
9
|
*
|
10
|
-
* Copyright
|
10
|
+
* Copyright OpenJS Foundation and other contributors
|
11
11
|
* Released under the MIT license.
|
12
|
-
*
|
12
|
+
* https://jquery.org/license
|
13
13
|
*/
|
14
14
|
|
15
15
|
//>>label: Button
|
16
16
|
//>>group: Widgets
|
17
17
|
//>>description: Enhances a form with themeable buttons.
|
18
|
-
//>>docs:
|
19
|
-
//>>demos:
|
18
|
+
//>>docs: https://api.jqueryui.com/button/
|
19
|
+
//>>demos: https://jqueryui.com/button/
|
20
20
|
//>>css.structure: ../../themes/base/core.css
|
21
21
|
//>>css.structure: ../../themes/base/button.css
|
22
22
|
//>>css.theme: ../../themes/base/theme.css
|
23
23
|
|
24
24
|
( function( factory ) {
|
25
|
+
"use strict";
|
26
|
+
|
25
27
|
if ( typeof define === "function" && define.amd ) {
|
26
28
|
|
27
29
|
// AMD. Register as an anonymous module.
|
@@ -41,10 +43,11 @@
|
|
41
43
|
// Browser globals
|
42
44
|
factory( jQuery );
|
43
45
|
}
|
44
|
-
}( function( $ ) {
|
46
|
+
} )( function( $ ) {
|
47
|
+
"use strict";
|
45
48
|
|
46
49
|
$.widget( "ui.button", {
|
47
|
-
version: "1.
|
50
|
+
version: "1.13.3",
|
48
51
|
defaultElement: "<button>",
|
49
52
|
options: {
|
50
53
|
classes: {
|
@@ -268,7 +271,7 @@ $.widget( "ui.button", {
|
|
268
271
|
this._toggleClass( null, "ui-state-disabled", value );
|
269
272
|
this.element[ 0 ].disabled = value;
|
270
273
|
if ( value ) {
|
271
|
-
this.element.blur
|
274
|
+
this.element.trigger( "blur" );
|
272
275
|
}
|
273
276
|
}
|
274
277
|
},
|
@@ -347,22 +350,82 @@ if ( $.uiBackCompat !== false ) {
|
|
347
350
|
} );
|
348
351
|
|
349
352
|
$.fn.button = ( function( orig ) {
|
350
|
-
return function() {
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
353
|
+
return function( options ) {
|
354
|
+
var isMethodCall = typeof options === "string";
|
355
|
+
var args = Array.prototype.slice.call( arguments, 1 );
|
356
|
+
var returnValue = this;
|
357
|
+
|
358
|
+
if ( isMethodCall ) {
|
359
|
+
|
360
|
+
// If this is an empty collection, we need to have the instance method
|
361
|
+
// return undefined instead of the jQuery instance
|
362
|
+
if ( !this.length && options === "instance" ) {
|
363
|
+
returnValue = undefined;
|
364
|
+
} else {
|
365
|
+
this.each( function() {
|
366
|
+
var methodValue;
|
367
|
+
var type = $( this ).attr( "type" );
|
368
|
+
var name = type !== "checkbox" && type !== "radio" ?
|
369
|
+
"button" :
|
370
|
+
"checkboxradio";
|
371
|
+
var instance = $.data( this, "ui-" + name );
|
372
|
+
|
373
|
+
if ( options === "instance" ) {
|
374
|
+
returnValue = instance;
|
375
|
+
return false;
|
376
|
+
}
|
377
|
+
|
378
|
+
if ( !instance ) {
|
379
|
+
return $.error( "cannot call methods on button" +
|
380
|
+
" prior to initialization; " +
|
381
|
+
"attempted to call method '" + options + "'" );
|
382
|
+
}
|
383
|
+
|
384
|
+
if ( typeof instance[ options ] !== "function" ||
|
385
|
+
options.charAt( 0 ) === "_" ) {
|
386
|
+
return $.error( "no such method '" + options + "' for button" +
|
387
|
+
" widget instance" );
|
388
|
+
}
|
389
|
+
|
390
|
+
methodValue = instance[ options ].apply( instance, args );
|
391
|
+
|
392
|
+
if ( methodValue !== instance && methodValue !== undefined ) {
|
393
|
+
returnValue = methodValue && methodValue.jquery ?
|
394
|
+
returnValue.pushStack( methodValue.get() ) :
|
395
|
+
methodValue;
|
396
|
+
return false;
|
397
|
+
}
|
398
|
+
} );
|
399
|
+
}
|
400
|
+
} else {
|
401
|
+
|
402
|
+
// Allow multiple hashes to be passed on init
|
403
|
+
if ( args.length ) {
|
404
|
+
options = $.widget.extend.apply( null, [ options ].concat( args ) );
|
405
|
+
}
|
406
|
+
|
407
|
+
this.each( function() {
|
408
|
+
var type = $( this ).attr( "type" );
|
409
|
+
var name = type !== "checkbox" && type !== "radio" ? "button" : "checkboxradio";
|
410
|
+
var instance = $.data( this, "ui-" + name );
|
411
|
+
|
412
|
+
if ( instance ) {
|
413
|
+
instance.option( options || {} );
|
414
|
+
if ( instance._init ) {
|
415
|
+
instance._init();
|
416
|
+
}
|
417
|
+
} else {
|
418
|
+
if ( name === "button" ) {
|
419
|
+
orig.call( $( this ), options );
|
420
|
+
return;
|
421
|
+
}
|
422
|
+
|
423
|
+
$( this ).checkboxradio( $.extend( { icon: false }, options ) );
|
424
|
+
}
|
363
425
|
} );
|
364
426
|
}
|
365
|
-
|
427
|
+
|
428
|
+
return returnValue;
|
366
429
|
};
|
367
430
|
} )( $.fn.button );
|
368
431
|
|
@@ -388,4 +451,4 @@ if ( $.uiBackCompat !== false ) {
|
|
388
451
|
|
389
452
|
return $.ui.button;
|
390
453
|
|
391
|
-
} )
|
454
|
+
} );
|