@atlassian/aui 9.10.3 → 9.10.5

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@atlassian/aui",
3
3
  "description": "Atlassian User Interface library",
4
- "version": "9.10.3",
4
+ "version": "9.10.5",
5
5
  "author": "Atlassian Pty Ltd.",
6
6
  "homepage": "https://aui.atlassian.com",
7
7
  "license": "Apache-2.0",
@@ -321,6 +321,9 @@ function InlineDialog (items, identifier, url, options) {
321
321
  }
322
322
  };
323
323
  var $items = $(items);
324
+ // jquery 3 does not have selector property anymore. To make this compatible, the property is
325
+ // being added back. This would also require the user of inline dialog to add the property to items object
326
+ $items.selector = $items.selector || items.selector;
324
327
 
325
328
  if (opts.onHover) {
326
329
  if (opts.useLiveEvents) {
@@ -1,6 +1,6 @@
1
1
  import $ from './jquery';
2
2
  import '../../js-vendor/jquery/plugins/jquery.select2';
3
- import layer from "./layer";
3
+ import layer from './layer';
4
4
 
5
5
  /**
6
6
  * Wraps a vanilla Select2 with ADG _style_, as an auiSelect2 method on jQuery objects.
@@ -20,9 +20,11 @@ const auiContainer = 'aui-select2-container';
20
20
  const auiDropdown = 'aui-select2-drop aui-dropdown2';
21
21
  const auiHasAvatar = 'aui-has-avatar';
22
22
 
23
+ // Other constants
24
+ const DROPDOWN_LAYER_KEY = 'aui.select2DropdownLayer';
25
+
23
26
  $.fn.auiSelect2 = function (first) {
24
27
  let updatedArgs;
25
- let dropdownLayer;
26
28
 
27
29
  if ($.isPlainObject(first)) {
28
30
  const auiOpts = $.extend({}, first);
@@ -83,12 +85,18 @@ $.fn.auiSelect2 = function (first) {
83
85
  const $selectInput = $(this);
84
86
  const $selectDropdown = $selectInput.select2('dropdown');
85
87
 
86
- if (!dropdownLayer) dropdownLayer = layer();
88
+ let dropdownLayer = $selectInput.data(DROPDOWN_LAYER_KEY);
89
+
90
+ if (!dropdownLayer) {
91
+ dropdownLayer = layer();
92
+ $selectInput.data(DROPDOWN_LAYER_KEY, dropdownLayer);
93
+ }
94
+
87
95
  dropdownLayer.show(); // add layer to layer manager to get top z-index
88
96
 
89
97
  $selectDropdown.css('z-index', dropdownLayer.$el.css('z-index'));
90
98
  // mask is created during opening event, before open
91
- $("#select2-drop-mask").css('z-index', dropdownLayer.$el.css('z-index'));
99
+ $('#select2-drop-mask').css('z-index', dropdownLayer.$el.css('z-index'));
92
100
 
93
101
  if (options.multiple || $selectInput.attr('multiple')) {
94
102
  // This is a multi-select, exiting
@@ -102,8 +110,17 @@ $.fn.auiSelect2 = function (first) {
102
110
 
103
111
  select2Instance.on('select2-close', function () {
104
112
  const $selectInput = $(this);
105
-
106
- dropdownLayer.hide();
113
+ const dropdownLayer = $selectInput.data(DROPDOWN_LAYER_KEY);
114
+
115
+ if (dropdownLayer) {
116
+ dropdownLayer.hide();
117
+ } else {
118
+ AJS.warn(
119
+ 'Warning! AUI: `select2-close` event handler could not discover the layer linked with the Select2 dropdown.',
120
+ 'This may be happening when there are many instances of Select2 created on the same DOM element.',
121
+ 'Consider checking your code as this can negatively affect performance.'
122
+ );
123
+ }
107
124
 
108
125
  $selectInput.removeData('was-ariadescribedby-cleared');
109
126
  });
@@ -34,7 +34,7 @@ aui-header,
34
34
  @section-gap: 20px;
35
35
 
36
36
  box-sizing: border-box;
37
- padding: 0 @aui-grid;
37
+ padding: 7px @aui-grid 10px @aui-grid;
38
38
  position: relative;
39
39
 
40
40
  .aui-header-before {