jquery-ui-rails 6.0.1 → 8.0.0

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 (170) hide show
  1. checksums.yaml +5 -5
  2. data/History.md +11 -2
  3. data/README.md +12 -12
  4. data/Rakefile +8 -3
  5. data/VERSIONS.md +2 -0
  6. data/app/assets/images/jquery-ui/ui-icons_444444_256x240.png +0 -0
  7. data/app/assets/images/jquery-ui/ui-icons_555555_256x240.png +0 -0
  8. data/app/assets/images/jquery-ui/ui-icons_777620_256x240.png +0 -0
  9. data/app/assets/images/jquery-ui/ui-icons_777777_256x240.png +0 -0
  10. data/app/assets/images/jquery-ui/ui-icons_cc0000_256x240.png +0 -0
  11. data/app/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
  12. data/app/assets/javascripts/jquery-ui/data.js +16 -18
  13. data/app/assets/javascripts/jquery-ui/disable-selection.js +10 -7
  14. data/app/assets/javascripts/jquery-ui/effect.js +69 -752
  15. data/app/assets/javascripts/jquery-ui/effects/effect-blind.js +11 -8
  16. data/app/assets/javascripts/jquery-ui/effects/effect-bounce.js +11 -8
  17. data/app/assets/javascripts/jquery-ui/effects/effect-clip.js +11 -8
  18. data/app/assets/javascripts/jquery-ui/effects/effect-drop.js +11 -8
  19. data/app/assets/javascripts/jquery-ui/effects/effect-explode.js +13 -10
  20. data/app/assets/javascripts/jquery-ui/effects/effect-fade.js +11 -8
  21. data/app/assets/javascripts/jquery-ui/effects/effect-fold.js +11 -8
  22. data/app/assets/javascripts/jquery-ui/effects/effect-highlight.js +11 -8
  23. data/app/assets/javascripts/jquery-ui/effects/effect-puff.js +11 -8
  24. data/app/assets/javascripts/jquery-ui/effects/effect-pulsate.js +11 -8
  25. data/app/assets/javascripts/jquery-ui/effects/effect-scale.js +11 -8
  26. data/app/assets/javascripts/jquery-ui/effects/effect-shake.js +11 -8
  27. data/app/assets/javascripts/jquery-ui/effects/effect-size.js +13 -8
  28. data/app/assets/javascripts/jquery-ui/effects/effect-slide.js +11 -8
  29. data/app/assets/javascripts/jquery-ui/effects/effect-transfer.js +12 -9
  30. data/app/assets/javascripts/jquery-ui/focusable.js +13 -20
  31. data/app/assets/javascripts/jquery-ui/form-reset-mixin.js +11 -10
  32. data/app/assets/javascripts/jquery-ui/i18n/datepicker-af.js +8 -5
  33. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ar-DZ.js +8 -5
  34. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ar.js +7 -4
  35. data/app/assets/javascripts/jquery-ui/i18n/datepicker-az.js +14 -11
  36. data/app/assets/javascripts/jquery-ui/i18n/datepicker-be.js +14 -11
  37. data/app/assets/javascripts/jquery-ui/i18n/datepicker-bg.js +15 -12
  38. data/app/assets/javascripts/jquery-ui/i18n/datepicker-bs.js +14 -11
  39. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ca.js +12 -9
  40. data/app/assets/javascripts/jquery-ui/i18n/datepicker-cs.js +12 -9
  41. data/app/assets/javascripts/jquery-ui/i18n/datepicker-cy-GB.js +8 -5
  42. data/app/assets/javascripts/jquery-ui/i18n/datepicker-da.js +15 -12
  43. data/app/assets/javascripts/jquery-ui/i18n/datepicker-de-AT.js +41 -0
  44. data/app/assets/javascripts/jquery-ui/i18n/datepicker-de.js +14 -11
  45. data/app/assets/javascripts/jquery-ui/i18n/datepicker-el.js +13 -10
  46. data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-AU.js +8 -5
  47. data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-GB.js +8 -5
  48. data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-NZ.js +8 -5
  49. data/app/assets/javascripts/jquery-ui/i18n/datepicker-eo.js +14 -11
  50. data/app/assets/javascripts/jquery-ui/i18n/datepicker-es.js +14 -11
  51. data/app/assets/javascripts/jquery-ui/i18n/datepicker-et.js +8 -5
  52. data/app/assets/javascripts/jquery-ui/i18n/datepicker-eu.js +14 -11
  53. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fa.js +8 -5
  54. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fi.js +14 -11
  55. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fo.js +13 -10
  56. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr-CA.js +5 -2
  57. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr-CH.js +7 -4
  58. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr.js +6 -3
  59. data/app/assets/javascripts/jquery-ui/i18n/datepicker-gl.js +14 -11
  60. data/app/assets/javascripts/jquery-ui/i18n/datepicker-he.js +14 -11
  61. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hi.js +7 -4
  62. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hr.js +14 -11
  63. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hu.js +9 -6
  64. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hy.js +14 -11
  65. data/app/assets/javascripts/jquery-ui/i18n/datepicker-id.js +16 -12
  66. data/app/assets/javascripts/jquery-ui/i18n/datepicker-is.js +13 -10
  67. data/app/assets/javascripts/jquery-ui/i18n/datepicker-it-CH.js +14 -11
  68. data/app/assets/javascripts/jquery-ui/i18n/datepicker-it.js +14 -11
  69. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ja.js +14 -11
  70. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ka.js +11 -8
  71. data/app/assets/javascripts/jquery-ui/i18n/datepicker-kk.js +14 -11
  72. data/app/assets/javascripts/jquery-ui/i18n/datepicker-km.js +9 -6
  73. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ko.js +12 -9
  74. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ky.js +12 -9
  75. data/app/assets/javascripts/jquery-ui/i18n/datepicker-lb.js +8 -5
  76. data/app/assets/javascripts/jquery-ui/i18n/datepicker-lt.js +13 -10
  77. data/app/assets/javascripts/jquery-ui/i18n/datepicker-lv.js +11 -8
  78. data/app/assets/javascripts/jquery-ui/i18n/datepicker-mk.js +14 -11
  79. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ml.js +8 -5
  80. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ms.js +14 -11
  81. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nb.js +11 -8
  82. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nl-BE.js +7 -4
  83. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nl.js +8 -5
  84. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nn.js +11 -8
  85. data/app/assets/javascripts/jquery-ui/i18n/datepicker-no.js +11 -8
  86. data/app/assets/javascripts/jquery-ui/i18n/datepicker-pl.js +14 -11
  87. data/app/assets/javascripts/jquery-ui/i18n/datepicker-pt-BR.js +13 -10
  88. data/app/assets/javascripts/jquery-ui/i18n/datepicker-pt.js +12 -9
  89. data/app/assets/javascripts/jquery-ui/i18n/datepicker-rm.js +10 -7
  90. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ro.js +10 -7
  91. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ru.js +14 -11
  92. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sk.js +14 -11
  93. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sl.js +14 -11
  94. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sq.js +14 -11
  95. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sr-SR.js +14 -11
  96. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sr.js +14 -11
  97. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sv.js +14 -11
  98. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ta.js +10 -7
  99. data/app/assets/javascripts/jquery-ui/i18n/datepicker-th.js +14 -11
  100. data/app/assets/javascripts/jquery-ui/i18n/datepicker-tj.js +14 -11
  101. data/app/assets/javascripts/jquery-ui/i18n/datepicker-tr.js +14 -11
  102. data/app/assets/javascripts/jquery-ui/i18n/datepicker-uk.js +14 -11
  103. data/app/assets/javascripts/jquery-ui/i18n/datepicker-vi.js +7 -4
  104. data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-CN.js +14 -11
  105. data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-HK.js +14 -11
  106. data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-TW.js +15 -12
  107. data/app/assets/javascripts/jquery-ui/jquery-patch.js +58 -0
  108. data/app/assets/javascripts/jquery-ui/jquery-var-for-color.js +24 -0
  109. data/app/assets/javascripts/jquery-ui/keycode.js +11 -7
  110. data/app/assets/javascripts/jquery-ui/labels.js +18 -13
  111. data/app/assets/javascripts/jquery-ui/plugin.js +5 -2
  112. data/app/assets/javascripts/jquery-ui/position.js +30 -17
  113. data/app/assets/javascripts/jquery-ui/scroll-parent.js +10 -7
  114. data/app/assets/javascripts/jquery-ui/tabbable.js +11 -8
  115. data/app/assets/javascripts/jquery-ui/unique-id.js +10 -7
  116. data/app/assets/javascripts/jquery-ui/vendor/jquery-color/jquery.color.js +691 -0
  117. data/app/assets/javascripts/jquery-ui/version.js +6 -3
  118. data/app/assets/javascripts/jquery-ui/widget.js +56 -30
  119. data/app/assets/javascripts/jquery-ui/widgets/accordion.js +32 -23
  120. data/app/assets/javascripts/jquery-ui/widgets/autocomplete.js +31 -74
  121. data/app/assets/javascripts/jquery-ui/widgets/button.js +91 -28
  122. data/app/assets/javascripts/jquery-ui/widgets/checkboxradio.js +27 -24
  123. data/app/assets/javascripts/jquery-ui/widgets/controlgroup.js +15 -11
  124. data/app/assets/javascripts/jquery-ui/widgets/datepicker.js +185 -68
  125. data/app/assets/javascripts/jquery-ui/widgets/dialog.js +57 -54
  126. data/app/assets/javascripts/jquery-ui/widgets/draggable.js +30 -25
  127. data/app/assets/javascripts/jquery-ui/widgets/droppable.js +25 -19
  128. data/app/assets/javascripts/jquery-ui/widgets/menu.js +90 -52
  129. data/app/assets/javascripts/jquery-ui/widgets/mouse.js +36 -40
  130. data/app/assets/javascripts/jquery-ui/widgets/progressbar.js +14 -11
  131. data/app/assets/javascripts/jquery-ui/widgets/resizable.js +116 -42
  132. data/app/assets/javascripts/jquery-ui/widgets/selectable.js +18 -11
  133. data/app/assets/javascripts/jquery-ui/widgets/selectmenu.js +30 -52
  134. data/app/assets/javascripts/jquery-ui/widgets/slider.js +15 -12
  135. data/app/assets/javascripts/jquery-ui/widgets/sortable.js +193 -140
  136. data/app/assets/javascripts/jquery-ui/widgets/spinner.js +28 -45
  137. data/app/assets/javascripts/jquery-ui/widgets/tabs.js +32 -66
  138. data/app/assets/javascripts/jquery-ui/widgets/tooltip.js +38 -36
  139. data/app/assets/javascripts/jquery-ui.js +3 -7
  140. data/app/assets/stylesheets/jquery-ui/accordion.css +5 -5
  141. data/app/assets/stylesheets/jquery-ui/all.css +5 -5
  142. data/app/assets/stylesheets/jquery-ui/autocomplete.css +5 -5
  143. data/app/assets/stylesheets/jquery-ui/base.css +5 -5
  144. data/app/assets/stylesheets/jquery-ui/button.css +6 -11
  145. data/app/assets/stylesheets/jquery-ui/checkboxradio.css +5 -5
  146. data/app/assets/stylesheets/jquery-ui/controlgroup.css +5 -8
  147. data/app/assets/stylesheets/jquery-ui/core.css +5 -9
  148. data/app/assets/stylesheets/jquery-ui/datepicker.css +5 -5
  149. data/app/assets/stylesheets/jquery-ui/dialog.css +5 -5
  150. data/app/assets/stylesheets/jquery-ui/draggable.css +4 -5
  151. data/app/assets/stylesheets/jquery-ui/menu.css +5 -7
  152. data/app/assets/stylesheets/jquery-ui/progressbar.css +5 -6
  153. data/app/assets/stylesheets/jquery-ui/resizable.css +4 -5
  154. data/app/assets/stylesheets/jquery-ui/selectable.css +4 -5
  155. data/app/assets/stylesheets/jquery-ui/selectmenu.css +5 -5
  156. data/app/assets/stylesheets/jquery-ui/slider.css +6 -13
  157. data/app/assets/stylesheets/jquery-ui/sortable.css +4 -5
  158. data/app/assets/stylesheets/jquery-ui/spinner.css +5 -5
  159. data/app/assets/stylesheets/jquery-ui/tabs.css +5 -5
  160. data/app/assets/stylesheets/jquery-ui/theme.css.erb +10 -14
  161. data/app/assets/stylesheets/jquery-ui/tooltip.css +5 -5
  162. data/lib/jquery/ui/rails/version.rb +2 -2
  163. metadata +11 -15
  164. data/app/assets/javascripts/jquery-ui/core.js +0 -15
  165. data/app/assets/javascripts/jquery-ui/escape-selector.js +0 -23
  166. data/app/assets/javascripts/jquery-ui/form.js +0 -22
  167. data/app/assets/javascripts/jquery-ui/ie.js +0 -17
  168. data/app/assets/javascripts/jquery-ui/jquery-1-7.js +0 -91
  169. data/app/assets/javascripts/jquery-ui/safe-active-element.js +0 -42
  170. data/app/assets/javascripts/jquery-ui/safe-blur.js +0 -23
@@ -1,21 +1,23 @@
1
1
  //= require jquery-ui/version
2
2
 
3
3
  /*!
4
- * jQuery UI Widget 1.12.1
5
- * http://jqueryui.com
4
+ * jQuery UI Widget 1.14.1
5
+ * https://jqueryui.com
6
6
  *
7
- * Copyright jQuery Foundation and other contributors
7
+ * Copyright OpenJS Foundation and other contributors
8
8
  * Released under the MIT license.
9
- * http://jquery.org/license
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: http://api.jqueryui.com/jQuery.widget/
16
- //>>demos: http://jqueryui.com/widget/
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
- // Http://bugs.jquery.com/ticket/8235
46
- } catch ( e ) {}
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
  };
@@ -58,6 +58,9 @@ $.widget = function( name, base, prototype ) {
58
58
 
59
59
  var namespace = name.split( "." )[ 0 ];
60
60
  name = name.split( "." )[ 1 ];
61
+ if ( name === "__proto__" || name === "constructor" ) {
62
+ return $.error( "Invalid widget name: " + name );
63
+ }
61
64
  var fullName = namespace + "-" + name;
62
65
 
63
66
  if ( !prototype ) {
@@ -65,12 +68,12 @@ $.widget = function( name, base, prototype ) {
65
68
  base = $.Widget;
66
69
  }
67
70
 
68
- if ( $.isArray( prototype ) ) {
71
+ if ( Array.isArray( prototype ) ) {
69
72
  prototype = $.extend.apply( null, [ {} ].concat( prototype ) );
70
73
  }
71
74
 
72
75
  // Create selector for plugin
73
- $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
76
+ $.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) {
74
77
  return !!$.data( elem, fullName );
75
78
  };
76
79
 
@@ -79,7 +82,7 @@ $.widget = function( name, base, prototype ) {
79
82
  constructor = $[ namespace ][ name ] = function( options, element ) {
80
83
 
81
84
  // Allow instantiation without "new" keyword
82
- if ( !this._createWidget ) {
85
+ if ( !this || !this._createWidget ) {
83
86
  return new constructor( options, element );
84
87
  }
85
88
 
@@ -110,7 +113,7 @@ $.widget = function( name, base, prototype ) {
110
113
  // inheriting from
111
114
  basePrototype.options = $.widget.extend( {}, basePrototype.options );
112
115
  $.each( prototype, function( prop, value ) {
113
- if ( !$.isFunction( value ) ) {
116
+ if ( typeof value !== "function" ) {
114
117
  proxiedPrototype[ prop ] = value;
115
118
  return;
116
119
  }
@@ -189,7 +192,7 @@ $.widget.extend = function( target ) {
189
192
  for ( ; inputIndex < inputLength; inputIndex++ ) {
190
193
  for ( key in input[ inputIndex ] ) {
191
194
  value = input[ inputIndex ][ key ];
192
- if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
195
+ if ( widgetHasOwnProperty.call( input[ inputIndex ], key ) && value !== undefined ) {
193
196
 
194
197
  // Clone objects
195
198
  if ( $.isPlainObject( value ) ) {
@@ -238,7 +241,8 @@ $.widget.bridge = function( name, object ) {
238
241
  "attempted to call method '" + options + "'" );
239
242
  }
240
243
 
241
- if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === "_" ) {
244
+ if ( typeof instance[ options ] !== "function" ||
245
+ options.charAt( 0 ) === "_" ) {
242
246
  return $.error( "no such method '" + options + "' for " + name +
243
247
  " widget instance" );
244
248
  }
@@ -499,12 +503,34 @@ $.Widget.prototype = {
499
503
  classes: this.options.classes || {}
500
504
  }, options );
501
505
 
506
+ function bindRemoveEvent() {
507
+ var nodesToBind = [];
508
+
509
+ options.element.each( function( _, element ) {
510
+ var isTracked = $.map( that.classesElementLookup, function( elements ) {
511
+ return elements;
512
+ } )
513
+ .some( function( elements ) {
514
+ return elements.is( element );
515
+ } );
516
+
517
+ if ( !isTracked ) {
518
+ nodesToBind.push( element );
519
+ }
520
+ } );
521
+
522
+ that._on( $( nodesToBind ), {
523
+ remove: "_untrackClassesElement"
524
+ } );
525
+ }
526
+
502
527
  function processClassString( classes, checkOption ) {
503
528
  var current, i;
504
529
  for ( i = 0; i < classes.length; i++ ) {
505
530
  current = that.classesElementLookup[ classes[ i ] ] || $();
506
531
  if ( options.add ) {
507
- current = $( $.unique( current.get().concat( options.element.get() ) ) );
532
+ bindRemoveEvent();
533
+ current = $( $.uniqueSort( current.get().concat( options.element.get() ) ) );
508
534
  } else {
509
535
  current = $( current.not( options.element ).get() );
510
536
  }
@@ -516,10 +542,6 @@ $.Widget.prototype = {
516
542
  }
517
543
  }
518
544
 
519
- this._on( options.element, {
520
- "remove": "_untrackClassesElement"
521
- } );
522
-
523
545
  if ( options.keys ) {
524
546
  processClassString( options.keys.match( /\S+/g ) || [], true );
525
547
  }
@@ -537,6 +559,8 @@ $.Widget.prototype = {
537
559
  that.classesElementLookup[ key ] = $( value.not( event.target ).get() );
538
560
  }
539
561
  } );
562
+
563
+ this._off( $( event.target ) );
540
564
  },
541
565
 
542
566
  _removeClass: function( element, keys, extra ) {
@@ -617,7 +641,7 @@ $.Widget.prototype = {
617
641
  _off: function( element, eventName ) {
618
642
  eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) +
619
643
  this.eventNamespace;
620
- element.off( eventName ).off( eventName );
644
+ element.off( eventName );
621
645
 
622
646
  // Clear the stack to avoid memory leaks (#10056)
623
647
  this.bindings = $( this.bindings.not( element ).get() );
@@ -683,7 +707,7 @@ $.Widget.prototype = {
683
707
  }
684
708
 
685
709
  this.element.trigger( event, data );
686
- return !( $.isFunction( callback ) &&
710
+ return !( typeof callback === "function" &&
687
711
  callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||
688
712
  event.isDefaultPrevented() );
689
713
  }
@@ -705,6 +729,8 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
705
729
  options = options || {};
706
730
  if ( typeof options === "number" ) {
707
731
  options = { duration: options };
732
+ } else if ( options === true ) {
733
+ options = {};
708
734
  }
709
735
 
710
736
  hasOptions = !$.isEmptyObject( options );
@@ -732,4 +758,4 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
732
758
 
733
759
  return $.widget;
734
760
 
735
- } ) );
761
+ } );
@@ -4,26 +4,28 @@
4
4
  //= require jquery-ui/widget
5
5
 
6
6
  /*!
7
- * jQuery UI Accordion 1.12.1
8
- * http://jqueryui.com
7
+ * jQuery UI Accordion 1.14.1
8
+ * https://jqueryui.com
9
9
  *
10
- * Copyright jQuery Foundation and other contributors
10
+ * Copyright OpenJS Foundation and other contributors
11
11
  * Released under the MIT license.
12
- * http://jquery.org/license
12
+ * https://jquery.org/license
13
13
  */
14
14
 
15
15
  //>>label: Accordion
16
16
  //>>group: Widgets
17
- // jscs:disable maximumLineLength
17
+ /* eslint-disable max-len */
18
18
  //>>description: Displays collapsible content panels for presenting information in a limited amount of space.
19
- // jscs:enable maximumLineLength
20
- //>>docs: http://api.jqueryui.com/accordion/
21
- //>>demos: http://jqueryui.com/accordion/
19
+ /* eslint-enable max-len */
20
+ //>>docs: https://api.jqueryui.com/accordion/
21
+ //>>demos: https://jqueryui.com/accordion/
22
22
  //>>css.structure: ../../themes/base/core.css
23
23
  //>>css.structure: ../../themes/base/accordion.css
24
24
  //>>css.theme: ../../themes/base/theme.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.
@@ -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
  return $.widget( "ui.accordion", {
45
- version: "1.12.1",
48
+ version: "1.14.1",
46
49
  options: {
47
50
  active: 0,
48
51
  animate: {},
@@ -53,7 +56,19 @@ return $.widget( "ui.accordion", {
53
56
  },
54
57
  collapsible: false,
55
58
  event: "click",
56
- header: "> li > :first-child, > :not(li):even",
59
+ header: function( elem ) {
60
+ return elem
61
+ .find( "> li > :first-child" )
62
+ .add(
63
+ elem.find( "> :not(li)" )
64
+
65
+ // Support: jQuery <3.5 only
66
+ // We could use `.even()` but that's unavailable in older jQuery.
67
+ .filter( function( i ) {
68
+ return i % 2 === 0;
69
+ } )
70
+ );
71
+ },
57
72
  heightStyle: "auto",
58
73
  icons: {
59
74
  activeHeader: "ui-icon-triangle-1-s",
@@ -187,13 +202,7 @@ return $.widget( "ui.accordion", {
187
202
  this._super( value );
188
203
 
189
204
  this.element.attr( "aria-disabled", value );
190
-
191
- // Support: IE8 Only
192
- // #5332 / #6059 - opacity doesn't cascade to positioned elements in IE
193
- // so we need to add the disabled class to the headers and panels
194
205
  this._toggleClass( null, "ui-state-disabled", !!value );
195
- this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled",
196
- !!value );
197
206
  },
198
207
 
199
208
  _keydown: function( event ) {
@@ -284,7 +293,11 @@ return $.widget( "ui.accordion", {
284
293
  var prevHeaders = this.headers,
285
294
  prevPanels = this.panels;
286
295
 
287
- this.headers = this.element.find( this.options.header );
296
+ if ( typeof this.options.header === "function" ) {
297
+ this.headers = this.options.header( this.element );
298
+ } else {
299
+ this.headers = this.element.find( this.options.header );
300
+ }
288
301
  this._addClass( this.headers, "ui-accordion-header ui-accordion-header-collapsed",
289
302
  "ui-state-default" );
290
303
 
@@ -607,12 +620,8 @@ return $.widget( "ui.accordion", {
607
620
  this._removeClass( prev, "ui-accordion-header-active" )
608
621
  ._addClass( prev, "ui-accordion-header-collapsed" );
609
622
 
610
- // Work around for rendering bug in IE (#5421)
611
- if ( toHide.length ) {
612
- toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
613
- }
614
623
  this._trigger( "activate", null, data );
615
624
  }
616
625
  } );
617
626
 
618
- } ) );
627
+ } );
@@ -1,29 +1,30 @@
1
1
  //= require jquery-ui/widgets/menu
2
2
  //= require jquery-ui/keycode
3
3
  //= require jquery-ui/position
4
- //= require jquery-ui/safe-active-element
5
4
  //= require jquery-ui/version
6
5
  //= require jquery-ui/widget
7
6
 
8
7
  /*!
9
- * jQuery UI Autocomplete 1.12.1
10
- * http://jqueryui.com
8
+ * jQuery UI Autocomplete 1.14.1
9
+ * https://jqueryui.com
11
10
  *
12
- * Copyright jQuery Foundation and other contributors
11
+ * Copyright OpenJS Foundation and other contributors
13
12
  * Released under the MIT license.
14
- * http://jquery.org/license
13
+ * https://jquery.org/license
15
14
  */
16
15
 
17
16
  //>>label: Autocomplete
18
17
  //>>group: Widgets
19
18
  //>>description: Lists suggested words as the user is typing.
20
- //>>docs: http://api.jqueryui.com/autocomplete/
21
- //>>demos: http://jqueryui.com/autocomplete/
19
+ //>>docs: https://api.jqueryui.com/autocomplete/
20
+ //>>demos: https://jqueryui.com/autocomplete/
22
21
  //>>css.structure: ../../themes/base/core.css
23
22
  //>>css.structure: ../../themes/base/autocomplete.css
24
23
  //>>css.theme: ../../themes/base/theme.css
25
24
 
26
25
  ( function( factory ) {
26
+ "use strict";
27
+
27
28
  if ( typeof define === "function" && define.amd ) {
28
29
 
29
30
  // AMD. Register as an anonymous module.
@@ -32,7 +33,6 @@
32
33
  "./menu",
33
34
  "../keycode",
34
35
  "../position",
35
- "../safe-active-element",
36
36
  "../version",
37
37
  "../widget"
38
38
  ], factory );
@@ -41,10 +41,11 @@
41
41
  // Browser globals
42
42
  factory( jQuery );
43
43
  }
44
- }( function( $ ) {
44
+ } )( function( $ ) {
45
+ "use strict";
45
46
 
46
47
  $.widget( "ui.autocomplete", {
47
- version: "1.12.1",
48
+ version: "1.14.1",
48
49
  defaultElement: "<input>",
49
50
  options: {
50
51
  appendTo: null,
@@ -70,6 +71,7 @@ $.widget( "ui.autocomplete", {
70
71
 
71
72
  requestIndex: 0,
72
73
  pending: 0,
74
+ liveRegionTimer: null,
73
75
 
74
76
  _create: function() {
75
77
 
@@ -87,9 +89,9 @@ $.widget( "ui.autocomplete", {
87
89
 
88
90
  // Textareas are always multi-line
89
91
  // Inputs are always single-line, even if inside a contentEditable element
90
- // IE also treats inputs as contentEditable
91
- // All other element types are determined by whether or not they're contentEditable
92
- this.isMultiLine = isTextarea || !isInput && this._isContentEditable( this.element );
92
+ // All other element types are determined by whether they're contentEditable
93
+ this.isMultiLine = isTextarea ||
94
+ !isInput && this.element.prop( "contentEditable" ) === "true";
93
95
 
94
96
  this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
95
97
  this.isNewMenu = true;
@@ -153,7 +155,6 @@ $.widget( "ui.autocomplete", {
153
155
 
154
156
  // Different browsers have different default behavior for escape
155
157
  // Single press can mean undo or clear
156
- // Double press in IE means clear the whole form
157
158
  event.preventDefault();
158
159
  }
159
160
  break;
@@ -207,11 +208,6 @@ $.widget( "ui.autocomplete", {
207
208
  this.previous = this._value();
208
209
  },
209
210
  blur: function( event ) {
210
- if ( this.cancelBlur ) {
211
- delete this.cancelBlur;
212
- return;
213
- }
214
-
215
211
  clearTimeout( this.searching );
216
212
  this.close( event );
217
213
  this._change( event );
@@ -233,30 +229,13 @@ $.widget( "ui.autocomplete", {
233
229
  this._on( this.menu.element, {
234
230
  mousedown: function( event ) {
235
231
 
236
- // prevent moving focus out of the text field
232
+ // Prevent moving focus out of the text field
237
233
  event.preventDefault();
238
-
239
- // IE doesn't prevent moving focus even with event.preventDefault()
240
- // so we set a flag to know when we should ignore the blur event
241
- this.cancelBlur = true;
242
- this._delay( function() {
243
- delete this.cancelBlur;
244
-
245
- // Support: IE 8 only
246
- // Right clicking a menu item or selecting text from the menu items will
247
- // result in focus moving out of the input. However, we've already received
248
- // and ignored the blur event because of the cancelBlur flag set above. So
249
- // we restore focus to ensure that the menu closes properly based on the user's
250
- // next actions.
251
- if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {
252
- this.element.trigger( "focus" );
253
- }
254
- } );
255
234
  },
256
235
  menufocus: function( event, ui ) {
257
236
  var label, item;
258
237
 
259
- // support: Firefox
238
+ // Support: Firefox
260
239
  // Prevent accidental activation of menu items in Firefox (#7024 #9118)
261
240
  if ( this.isNewMenu ) {
262
241
  this.isNewMenu = false;
@@ -282,9 +261,11 @@ $.widget( "ui.autocomplete", {
282
261
 
283
262
  // Announce the value in the liveRegion
284
263
  label = ui.item.attr( "aria-label" ) || item.value;
285
- if ( label && $.trim( label ).length ) {
286
- this.liveRegion.children().hide();
287
- $( "<div>" ).text( label ).appendTo( this.liveRegion );
264
+ if ( label && String.prototype.trim.call( label ).length ) {
265
+ clearTimeout( this.liveRegionTimer );
266
+ this.liveRegionTimer = this._delay( function() {
267
+ this.liveRegion.html( $( "<div>" ).text( label ) );
268
+ }, 100 );
288
269
  }
289
270
  },
290
271
  menuselect: function( event, ui ) {
@@ -292,17 +273,9 @@ $.widget( "ui.autocomplete", {
292
273
  previous = this.previous;
293
274
 
294
275
  // Only trigger when focus was lost (click on menu)
295
- if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {
276
+ if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) {
296
277
  this.element.trigger( "focus" );
297
278
  this.previous = previous;
298
-
299
- // #6109 - IE triggers two focus events and the second
300
- // is asynchronous, so we need to reset the previous
301
- // term synchronously and asynchronously :-(
302
- this._delay( function() {
303
- this.previous = previous;
304
- this.selectedItem = item;
305
- } );
306
279
  }
307
280
 
308
281
  if ( false !== this._trigger( "select", event, { item: item } ) ) {
@@ -394,7 +367,7 @@ $.widget( "ui.autocomplete", {
394
367
  _initSource: function() {
395
368
  var array, url,
396
369
  that = this;
397
- if ( $.isArray( this.options.source ) ) {
370
+ if ( Array.isArray( this.options.source ) ) {
398
371
  array = this.options.source;
399
372
  this.source = function( request, response ) {
400
373
  response( $.ui.autocomplete.filter( array, request.term ) );
@@ -466,7 +439,7 @@ $.widget( "ui.autocomplete", {
466
439
  _response: function() {
467
440
  var index = ++this.requestIndex;
468
441
 
469
- return $.proxy( function( content ) {
442
+ return function( content ) {
470
443
  if ( index === this.requestIndex ) {
471
444
  this.__response( content );
472
445
  }
@@ -475,7 +448,7 @@ $.widget( "ui.autocomplete", {
475
448
  if ( !this.pending ) {
476
449
  this._removeClass( "ui-autocomplete-loading" );
477
450
  }
478
- }, this );
451
+ }.bind( this );
479
452
  },
480
453
 
481
454
  __response: function( content ) {
@@ -621,24 +594,6 @@ $.widget( "ui.autocomplete", {
621
594
  // Prevents moving cursor to beginning/end of the text field in some browsers
622
595
  event.preventDefault();
623
596
  }
624
- },
625
-
626
- // Support: Chrome <=50
627
- // We should be able to just use this.element.prop( "isContentEditable" )
628
- // but hidden elements always report false in Chrome.
629
- // https://code.google.com/p/chromium/issues/detail?id=313082
630
- _isContentEditable: function( element ) {
631
- if ( !element.length ) {
632
- return false;
633
- }
634
-
635
- var editable = element.prop( "contentEditable" );
636
-
637
- if ( editable === "inherit" ) {
638
- return this._isContentEditable( element.parent() );
639
- }
640
-
641
- return editable === "true";
642
597
  }
643
598
  } );
644
599
 
@@ -679,11 +634,13 @@ $.widget( "ui.autocomplete", $.ui.autocomplete, {
679
634
  } else {
680
635
  message = this.options.messages.noResults;
681
636
  }
682
- this.liveRegion.children().hide();
683
- $( "<div>" ).text( message ).appendTo( this.liveRegion );
637
+ clearTimeout( this.liveRegionTimer );
638
+ this.liveRegionTimer = this._delay( function() {
639
+ this.liveRegion.html( $( "<div>" ).text( message ) );
640
+ }, 100 );
684
641
  }
685
642
  } );
686
643
 
687
644
  return $.ui.autocomplete;
688
645
 
689
- } ) );
646
+ } );