@atlassian/aui 9.3.21 → 9.3.23

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 (272) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +7 -9
  3. package/dist/aui/aui-css-deprecations.js +1 -1
  4. package/dist/aui/aui-css-deprecations.js.map +1 -1
  5. package/dist/aui/aui-prototyping-browserfocus.css +1 -353
  6. package/dist/aui/aui-prototyping-darkmode.css +1 -262
  7. package/dist/aui/aui-prototyping.css +10 -10
  8. package/dist/aui/aui-prototyping.js +7 -7
  9. package/dist/aui/aui-prototyping.js.map +1 -1
  10. package/dist/aui/aui-prototyping.nodeps.css +10 -10
  11. package/dist/aui/aui-prototyping.nodeps.js +9 -9
  12. package/dist/aui/aui-prototyping.nodeps.js.map +1 -1
  13. package/entry/aui.batch.components.js +21 -21
  14. package/entry/aui.batch.page.js +3 -3
  15. package/entry/aui.batch.patterns.js +20 -20
  16. package/entry/aui.batch.prototyping.js +3 -11
  17. package/entry/aui.component.nav.js +1 -1
  18. package/entry/aui.component.progressbar.js +4 -1
  19. package/entry/aui.side-effects.js +2 -2
  20. package/entry/behaviours/aui.behaviour.format.js +1 -1
  21. package/entry/behaviours/aui.behaviour.i18n.js +1 -1
  22. package/entry/behaviours/aui.behaviour.keyboard-shortcuts.js +1 -1
  23. package/entry/behaviours/aui.behaviour.progressive-data-set.js +1 -1
  24. package/entry/behaviours/aui.behaviour.version.js +1 -1
  25. package/entry/deprecated/aui.component.inline-dialog1.js +1 -1
  26. package/package.json +3 -7
  27. package/src/js/aui/alphanum.js +1 -1
  28. package/src/js/aui/banner.js +2 -2
  29. package/src/js/aui/blanket.js +7 -11
  30. package/src/js/aui/button.js +5 -5
  31. package/src/js/aui/checkbox-multiselect.js +79 -76
  32. package/src/js/aui/clone.js +1 -1
  33. package/src/js/aui/close-button.js +2 -6
  34. package/src/js/aui/contain-dropdown.js +5 -5
  35. package/src/js/aui/contains.js +1 -1
  36. package/src/js/aui/cookie.js +12 -16
  37. package/src/js/aui/date-picker.js +84 -69
  38. package/src/js/aui/debounce.js +5 -8
  39. package/src/js/aui/dialog.js +206 -172
  40. package/src/js/aui/dialog2.js +9 -8
  41. package/src/js/aui/dropdown2.js +211 -181
  42. package/src/js/aui/escape-html.js +2 -2
  43. package/src/js/aui/escape.js +1 -1
  44. package/src/js/aui/event.js +4 -8
  45. package/src/js/aui/expander.js +9 -7
  46. package/src/js/aui/flag.js +15 -17
  47. package/src/js/aui/focus-manager.js +19 -18
  48. package/src/js/aui/form-notification.js +14 -13
  49. package/src/js/aui/form-validation/basic-validators.js +39 -30
  50. package/src/js/aui/form-validation/validator-register.js +9 -5
  51. package/src/js/aui/form-validation.js +17 -14
  52. package/src/js/aui/format.js +9 -6
  53. package/src/js/aui/forms/create-forms-component-body.js +6 -9
  54. package/src/js/aui/forms/custom-checkbox.js +2 -6
  55. package/src/js/aui/forms/custom-radio.js +2 -6
  56. package/src/js/aui/forms.js +4 -8
  57. package/src/js/aui/header-async.js +1 -1
  58. package/src/js/aui/header.js +2 -2
  59. package/src/js/aui/i18n.js +2 -5
  60. package/src/js/aui/index-of.js +1 -1
  61. package/src/js/aui/inline-dialog.js +171 -117
  62. package/src/js/aui/inline-dialog2.js +60 -50
  63. package/src/js/aui/internal/add-id.js +1 -1
  64. package/src/js/aui/internal/alignment.js +57 -49
  65. package/src/js/aui/internal/amdify.js +0 -1
  66. package/src/js/aui/internal/animation.js +2 -5
  67. package/src/js/aui/internal/attributes.js +2 -3
  68. package/src/js/aui/internal/browser.js +5 -6
  69. package/src/js/aui/internal/constants.js +1 -3
  70. package/src/js/aui/internal/deduplicateIDs.js +8 -7
  71. package/src/js/aui/internal/deprecation/deprecated-adg2-icons.js +132 -132
  72. package/src/js/aui/internal/deprecation.js +53 -31
  73. package/src/js/aui/internal/detect-children-change.js +3 -2
  74. package/src/js/aui/internal/elements.js +2 -5
  75. package/src/js/aui/internal/enforcer.js +11 -13
  76. package/src/js/aui/internal/globalize.js +3 -3
  77. package/src/js/aui/internal/has-touch.js +1 -2
  78. package/src/js/aui/internal/header/create-header.js +54 -28
  79. package/src/js/aui/internal/i18n/aui.js +8 -5
  80. package/src/js/aui/internal/i18n/aui_af.js +31 -31
  81. package/src/js/aui/internal/i18n/aui_ar.js +31 -31
  82. package/src/js/aui/internal/i18n/aui_ar_DZ.js +31 -31
  83. package/src/js/aui/internal/i18n/aui_az.js +31 -31
  84. package/src/js/aui/internal/i18n/aui_bg.js +31 -31
  85. package/src/js/aui/internal/i18n/aui_bs.js +31 -31
  86. package/src/js/aui/internal/i18n/aui_ca.js +31 -31
  87. package/src/js/aui/internal/i18n/aui_cs.js +31 -31
  88. package/src/js/aui/internal/i18n/aui_da.js +31 -31
  89. package/src/js/aui/internal/i18n/aui_de.js +31 -31
  90. package/src/js/aui/internal/i18n/aui_el.js +31 -31
  91. package/src/js/aui/internal/i18n/aui_en_AU.js +31 -31
  92. package/src/js/aui/internal/i18n/aui_en_GB.js +31 -31
  93. package/src/js/aui/internal/i18n/aui_en_NZ.js +31 -31
  94. package/src/js/aui/internal/i18n/aui_eo.js +31 -31
  95. package/src/js/aui/internal/i18n/aui_es.js +31 -31
  96. package/src/js/aui/internal/i18n/aui_et.js +31 -31
  97. package/src/js/aui/internal/i18n/aui_eu.js +31 -31
  98. package/src/js/aui/internal/i18n/aui_fa.js +31 -31
  99. package/src/js/aui/internal/i18n/aui_fi.js +31 -31
  100. package/src/js/aui/internal/i18n/aui_fo.js +31 -31
  101. package/src/js/aui/internal/i18n/aui_fr.js +31 -31
  102. package/src/js/aui/internal/i18n/aui_fr_CH.js +31 -31
  103. package/src/js/aui/internal/i18n/aui_gl.js +31 -31
  104. package/src/js/aui/internal/i18n/aui_he.js +31 -31
  105. package/src/js/aui/internal/i18n/aui_hr.js +31 -31
  106. package/src/js/aui/internal/i18n/aui_hu.js +31 -31
  107. package/src/js/aui/internal/i18n/aui_hy.js +31 -31
  108. package/src/js/aui/internal/i18n/aui_id.js +31 -31
  109. package/src/js/aui/internal/i18n/aui_is.js +31 -31
  110. package/src/js/aui/internal/i18n/aui_it.js +31 -31
  111. package/src/js/aui/internal/i18n/aui_ja.js +31 -31
  112. package/src/js/aui/internal/i18n/aui_ko.js +31 -31
  113. package/src/js/aui/internal/i18n/aui_kz.js +31 -31
  114. package/src/js/aui/internal/i18n/aui_lt.js +31 -31
  115. package/src/js/aui/internal/i18n/aui_lv.js +31 -31
  116. package/src/js/aui/internal/i18n/aui_ml.js +31 -31
  117. package/src/js/aui/internal/i18n/aui_ms.js +31 -31
  118. package/src/js/aui/internal/i18n/aui_nl.js +31 -31
  119. package/src/js/aui/internal/i18n/aui_no.js +31 -31
  120. package/src/js/aui/internal/i18n/aui_pl.js +31 -31
  121. package/src/js/aui/internal/i18n/aui_pt.js +31 -31
  122. package/src/js/aui/internal/i18n/aui_pt_BR.js +31 -31
  123. package/src/js/aui/internal/i18n/aui_rm.js +31 -31
  124. package/src/js/aui/internal/i18n/aui_ro.js +31 -31
  125. package/src/js/aui/internal/i18n/aui_ru.js +31 -31
  126. package/src/js/aui/internal/i18n/aui_sk.js +31 -31
  127. package/src/js/aui/internal/i18n/aui_sl.js +31 -31
  128. package/src/js/aui/internal/i18n/aui_sq.js +31 -31
  129. package/src/js/aui/internal/i18n/aui_sr.js +31 -31
  130. package/src/js/aui/internal/i18n/aui_sr_SR.js +31 -31
  131. package/src/js/aui/internal/i18n/aui_sv.js +31 -31
  132. package/src/js/aui/internal/i18n/aui_ta.js +31 -31
  133. package/src/js/aui/internal/i18n/aui_th.js +31 -31
  134. package/src/js/aui/internal/i18n/aui_tj.js +31 -31
  135. package/src/js/aui/internal/i18n/aui_tr.js +31 -31
  136. package/src/js/aui/internal/i18n/aui_uk.js +31 -31
  137. package/src/js/aui/internal/i18n/aui_vi.js +31 -31
  138. package/src/js/aui/internal/i18n/aui_zh_CN.js +31 -31
  139. package/src/js/aui/internal/i18n/aui_zh_HK.js +31 -31
  140. package/src/js/aui/internal/i18n/aui_zh_TW.js +31 -31
  141. package/src/js/aui/internal/log.js +2 -6
  142. package/src/js/aui/internal/mediaQuery.js +2 -3
  143. package/src/js/aui/internal/select/option.js +3 -3
  144. package/src/js/aui/internal/select/suggestion-model.js +1 -1
  145. package/src/js/aui/internal/select/suggestions-model.js +4 -5
  146. package/src/js/aui/internal/select/suggestions-view.js +17 -12
  147. package/src/js/aui/internal/state.js +2 -3
  148. package/src/js/aui/is-clipped.js +2 -2
  149. package/src/js/aui/key-code.js +1 -1
  150. package/src/js/aui/label.js +6 -6
  151. package/src/js/aui/layer.js +100 -98
  152. package/src/js/aui/messages.js +51 -38
  153. package/src/js/aui/navigation.js +7 -9
  154. package/src/js/aui/on-text-resize.js +7 -5
  155. package/src/js/aui/params.js +11 -8
  156. package/src/js/aui/polyfills/custom-event.js +7 -7
  157. package/src/js/aui/polyfills/placeholder.js +4 -4
  158. package/src/js/aui/populate-parameters.js +4 -4
  159. package/src/js/aui/progress-indicator.js +35 -27
  160. package/src/js/aui/progressive-data-set.js +13 -8
  161. package/src/js/aui/query-input.js +1 -1
  162. package/src/js/aui/restful-table/class-names.js +1 -1
  163. package/src/js/aui/restful-table/data-keys.js +1 -1
  164. package/src/js/aui/restful-table/edit-row.js +63 -63
  165. package/src/js/aui/restful-table/entry-model.js +6 -13
  166. package/src/js/aui/restful-table/event-handlers.js +4 -8
  167. package/src/js/aui/restful-table/event-names.js +1 -1
  168. package/src/js/aui/restful-table/row.js +41 -23
  169. package/src/js/aui/restful-table.js +101 -72
  170. package/src/js/aui/result-set.js +5 -5
  171. package/src/js/aui/results-list.js +3 -3
  172. package/src/js/aui/select.js +65 -49
  173. package/src/js/aui/select2.js +14 -6
  174. package/src/js/aui/sidebar.js +81 -51
  175. package/src/js/aui/spin.js +61 -49
  176. package/src/js/aui/spinner.js +11 -12
  177. package/src/js/aui/tables-sortable.js +21 -10
  178. package/src/js/aui/tabs.js +108 -77
  179. package/src/js/aui/to-init.js +1 -1
  180. package/src/js/aui/toggle.js +55 -43
  181. package/src/js/aui/tooltip.js +32 -31
  182. package/src/js/aui/trigger.js +20 -18
  183. package/src/js/aui/truncating-progressive-data-set.js +1 -1
  184. package/src/js/aui/unbind-text-resize.js +1 -1
  185. package/src/js/aui/unique-id.js +1 -1
  186. package/src/js/aui/when-i-type.js +66 -39
  187. package/src/js/aui-css-deprecations.js +50 -50
  188. package/src/js/jquery/jquery.hotkeys.js +124 -49
  189. package/src/js/jquery/jquery.moveto.js +18 -12
  190. package/src/less/adg-fancy-file-input.less +2 -3
  191. package/src/less/adg-header-quicksearch.less +4 -1
  192. package/src/less/adg-iconfont.less +242 -242
  193. package/src/less/adgs-icons.less +262 -262
  194. package/src/less/aui-appheader.less +10 -6
  195. package/src/less/aui-buttons.less +6 -5
  196. package/src/less/aui-date-picker.less +9 -6
  197. package/src/less/aui-experimental-expander.less +8 -8
  198. package/src/less/aui-experimental-labels.less +4 -3
  199. package/src/less/aui-experimental-progress-indicator.less +10 -4
  200. package/src/less/aui-experimental-progress-tracker.less +9 -6
  201. package/src/less/aui-experimental-restfultable.less +11 -3
  202. package/src/less/aui-experimental-tables-sortable.less +5 -3
  203. package/src/less/aui-experimental-tooltip.less +1 -1
  204. package/src/less/aui-link.less +0 -1
  205. package/src/less/aui-lozenge.less +6 -3
  206. package/src/less/aui-navigation.less +13 -13
  207. package/src/less/aui-page-layout.less +3 -4
  208. package/src/less/aui-page-typography.less +8 -3
  209. package/src/less/aui-reset.less +22 -6
  210. package/src/less/aui-select2.less +11 -8
  211. package/src/less/aui-sidebar-badges.less +1 -2
  212. package/src/less/aui-sidebar-config.less +7 -2
  213. package/src/less/aui-sidebar-grouping.less +16 -6
  214. package/src/less/aui-sidebar-navigation.less +7 -5
  215. package/src/less/aui-sidebar-skeleton.less +4 -3
  216. package/src/less/aui-skip-link.less +2 -1
  217. package/src/less/aui-spinner.less +2 -2
  218. package/src/less/aui-toggle.less +2 -2
  219. package/src/less/aui-toolbar2.less +1 -1
  220. package/src/less/checkbox-multiselect.less +13 -13
  221. package/src/less/dialog.less +3 -3
  222. package/src/less/dialog2.less +12 -11
  223. package/src/less/dropdown2-temp.css +4 -4
  224. package/src/less/dropdown2.less +3 -3
  225. package/src/less/form-notification.less +10 -6
  226. package/src/less/forms-current.less +6 -5
  227. package/src/less/forms-legacy.less +4 -2
  228. package/src/less/forms-radios-and-checkboxes.less +9 -11
  229. package/src/less/forms.less +2 -4
  230. package/src/less/iconfont-mixin.less +7 -4
  231. package/src/less/imports/aui-theme/adg/adg-colors.less +40 -40
  232. package/src/less/imports/aui-theme/adg/adg-neutral-dark.less +20 -20
  233. package/src/less/imports/aui-theme/adg/adg-neutral-light.less +20 -20
  234. package/src/less/imports/aui-theme/components/buttons.less +5 -1
  235. package/src/less/imports/aui-theme/components/dropdown.less +3 -1
  236. package/src/less/imports/aui-theme/components/form-notification.less +2 -1
  237. package/src/less/imports/aui-theme/components/forms.less +16 -1
  238. package/src/less/imports/aui-theme/components/inline-dialog2.less +1 -1
  239. package/src/less/imports/aui-theme/components/navigation.less +3 -3
  240. package/src/less/imports/aui-theme/components/progress-tracker.less +6 -2
  241. package/src/less/imports/aui-theme/components/tables.less +3 -2
  242. package/src/less/imports/aui-theme/components/toggle.less +8 -3
  243. package/src/less/imports/aui-theme/core/colors.less +12 -4
  244. package/src/less/imports/aui-theme/core/icons.less +22 -22
  245. package/src/less/imports/aui-theme/core/text.less +6 -3
  246. package/src/less/imports/mixins/dropdown2-trigger-chevron-icon.less +0 -1
  247. package/src/less/imports/mixins/focus.less +12 -4
  248. package/src/less/imports/mixins/media-queries.less +2 -2
  249. package/src/less/imports/mixins/shadows.less +3 -1
  250. package/src/less/imports/mixins/tab-indicator.less +2 -2
  251. package/src/less/imports/mixins.less +11 -4
  252. package/src/less/inline-dialog.less +21 -19
  253. package/src/less/layer.less +0 -2
  254. package/src/less/messages.less +2 -1
  255. package/src/less/single-select.less +14 -9
  256. package/src/less/tables.less +3 -2
  257. package/src/less/tabs.less +4 -3
  258. package/entry/token-themes-generated/npm/aui-prototyping-design-tokens-base-themes.css +0 -797
  259. package/entry/token-themes-generated/npm/aui-prototyping-design-tokens-base-themes.js +0 -26
  260. package/entry/token-themes-generated/npm/aui-prototyping-design-tokens-theme-import-map.js +0 -51
  261. package/entry/token-themes-generated/npm/themes/dark-future.js +0 -7
  262. package/entry/token-themes-generated/npm/themes/dark-new-input-border.js +0 -7
  263. package/entry/token-themes-generated/npm/themes/dark.js +0 -395
  264. package/entry/token-themes-generated/npm/themes/legacy-dark.js +0 -395
  265. package/entry/token-themes-generated/npm/themes/legacy-light.js +0 -395
  266. package/entry/token-themes-generated/npm/themes/light-future.js +0 -7
  267. package/entry/token-themes-generated/npm/themes/light-new-input-border.js +0 -7
  268. package/entry/token-themes-generated/npm/themes/light.js +0 -395
  269. package/entry/token-themes-generated/npm/themes/shape.js +0 -15
  270. package/entry/token-themes-generated/npm/themes/spacing.js +0 -27
  271. package/entry/token-themes-generated/npm/themes/typography-adg3.js +0 -50
  272. package/entry/token-themes-generated/npm/themes/typography-minor3.js +0 -41
@@ -1,68 +1,72 @@
1
1
  import $ from './jquery';
2
2
  import Alignment from './internal/alignment';
3
3
  import amdify from './internal/amdify';
4
- import attributes, {setBooleanAttribute} from './internal/attributes';
4
+ import attributes, { setBooleanAttribute } from './internal/attributes';
5
5
  import enforce from './internal/enforcer';
6
6
  import globalize from './internal/globalize';
7
- import layer, {EVENT_PREFIX} from './layer';
7
+ import layer, { EVENT_PREFIX } from './layer';
8
8
  import skate from './internal/skate';
9
9
  import state from './internal/state';
10
- import {doIfTrigger, forEachTrigger, getTrigger, setTrigger} from './trigger';
11
- import {ifGone} from './internal/elements';
10
+ import { doIfTrigger, forEachTrigger, getTrigger, setTrigger } from './trigger';
11
+ import { ifGone } from './internal/elements';
12
12
  import getFocusManager from './focus-manager';
13
13
 
14
14
  const DEFAULT_HOVEROUT_DELAY = 1000;
15
15
 
16
16
  function changeTrigger(element, newTrigger) {
17
- doIfTrigger(element, function(oldTrigger) {
17
+ doIfTrigger(element, function (oldTrigger) {
18
18
  oldTrigger.setAttribute('aria-expanded', 'false');
19
19
  newTrigger.setAttribute('aria-expanded', element.open);
20
20
  });
21
21
  setTrigger(element, newTrigger);
22
22
  }
23
23
 
24
- function enableAlignment (element, trigger) {
24
+ function enableAlignment(element, trigger) {
25
25
  if (element._auiAlignment) {
26
26
  element._auiAlignment.changeTarget(trigger);
27
- element._auiAlignment.enable()
27
+ element._auiAlignment.enable();
28
28
  } else {
29
29
  let alignmentOptions = {
30
- overflowContainer: element.getAttribute('contained-by') === 'viewport' ? 'viewport' : 'window',
30
+ overflowContainer:
31
+ element.getAttribute('contained-by') === 'viewport' ? 'viewport' : 'window',
31
32
  positionFixed: false,
32
- eventsEnabled: true
33
+ eventsEnabled: true,
33
34
  };
34
35
 
35
- alignmentOptions = {... alignmentOptions, ...{
36
- onCreate: () => {
37
- if (shouldFocus(element)) {
38
- getFocusManager().enter($(element), $(trigger));
39
- }
40
- },
41
- onEvents: {
42
- enabled: () => {
36
+ alignmentOptions = {
37
+ ...alignmentOptions,
38
+ ...{
39
+ onCreate: () => {
43
40
  if (shouldFocus(element)) {
44
- getFocusManager().enter($(element));
41
+ getFocusManager().enter($(element), $(trigger));
45
42
  }
46
43
  },
47
- disabled: () => {
48
- if (shouldFocus(element)) {
49
- getFocusManager().exit($(element));
50
- }
51
- }
52
- }
53
- }};
44
+ onEvents: {
45
+ enabled: () => {
46
+ if (shouldFocus(element)) {
47
+ getFocusManager().enter($(element));
48
+ }
49
+ },
50
+ disabled: () => {
51
+ if (shouldFocus(element)) {
52
+ getFocusManager().exit($(element));
53
+ }
54
+ },
55
+ },
56
+ },
57
+ };
54
58
 
55
59
  element._auiAlignment = new Alignment(element, trigger, alignmentOptions);
56
60
  }
57
61
  }
58
62
 
59
- function disableAlignment (element) {
63
+ function disableAlignment(element) {
60
64
  if (element._auiAlignment) {
61
65
  element._auiAlignment.disable();
62
66
  }
63
67
  }
64
68
 
65
- function destroyAlignment (element) {
69
+ function destroyAlignment(element) {
66
70
  if (element._auiAlignment) {
67
71
  element._auiAlignment.destroy();
68
72
  delete element._auiAlignment;
@@ -87,7 +91,7 @@ function showOnEnter(element, e) {
87
91
  clearTimeout(element._closingTimeout);
88
92
  }
89
93
 
90
- function closeAfter (delay = 0) {
94
+ function closeAfter(delay = 0) {
91
95
  return function closing(element) {
92
96
  if (!element.open || layer(element).isPersistent()) {
93
97
  return;
@@ -100,7 +104,7 @@ function closeAfter (delay = 0) {
100
104
  }
101
105
  element._closingTimeout = null;
102
106
  }, delay);
103
- }
107
+ };
104
108
  }
105
109
 
106
110
  const messageHandler = {
@@ -122,10 +126,10 @@ const messageHandler = {
122
126
  blur: closeAfter(0),
123
127
  };
124
128
 
125
- function handleMessage (element, message) {
129
+ function handleMessage(element, message) {
126
130
  var messageTypeMap = {
127
131
  toggle: ['click'],
128
- hover: ['mouseenter', 'mouseleave', 'focus', 'blur']
132
+ hover: ['mouseenter', 'mouseleave', 'focus', 'blur'],
129
133
  };
130
134
 
131
135
  var messageList = messageTypeMap[element.respondsTo];
@@ -138,7 +142,7 @@ function onMouseEnter(e) {
138
142
  var element = e.currentTarget;
139
143
  state(element).set('mouse-inside', true);
140
144
  element.message({
141
- type: 'mouseenter'
145
+ type: 'mouseenter',
142
146
  });
143
147
  }
144
148
 
@@ -146,7 +150,7 @@ function onMouseLeave(e) {
146
150
  var element = e.currentTarget;
147
151
  state(element).set('mouse-inside', false);
148
152
  element.message({
149
- type: 'mouseleave'
153
+ type: 'mouseleave',
150
154
  });
151
155
  }
152
156
 
@@ -161,7 +165,7 @@ function rebindMouseEvents(el) {
161
165
  state(el).set('mouse-inside', undefined);
162
166
  el.removeEventListener('mouseenter', onMouseEnter);
163
167
  el.removeEventListener('mouseleave', onMouseLeave);
164
- el.removeEventListener('blur', onBlur)
168
+ el.removeEventListener('blur', onBlur);
165
169
 
166
170
  if (el.respondsTo === 'hover') {
167
171
  state(el).set('mouse-inside', false);
@@ -171,13 +175,13 @@ function rebindMouseEvents(el) {
171
175
  }
172
176
  }
173
177
  function namespaceEvent(eventName, elId) {
174
- return `${eventName}.nested-layer-${elId}`
178
+ return `${eventName}.nested-layer-${elId}`;
175
179
  }
176
180
 
177
181
  function setupNestedLayerHandlers(el) {
178
182
  let $el = $(el);
179
183
  const elId = el.id;
180
- const noNestedTriggers = e => {
184
+ const noNestedTriggers = (e) => {
181
185
  return $el.find(getTrigger(e.target)).length < 1;
182
186
  };
183
187
  // Temporary timeout variable to resolve AUI-5025 issue
@@ -185,13 +189,13 @@ function setupNestedLayerHandlers(el) {
185
189
  const selectCloseTimeout = 150;
186
190
 
187
191
  $(document)
188
- .on(namespaceEvent('aui-layer-show', elId), e => {
192
+ .on(namespaceEvent('aui-layer-show', elId), (e) => {
189
193
  if (noNestedTriggers(e)) {
190
194
  return;
191
195
  }
192
196
  $el.attr('persistent', '');
193
197
  })
194
- .on(namespaceEvent('aui-layer-hide', elId), e => {
198
+ .on(namespaceEvent('aui-layer-hide', elId), (e) => {
195
199
  if (noNestedTriggers(e)) {
196
200
  return;
197
201
  }
@@ -257,7 +261,7 @@ function maybeInitialise(element) {
257
261
  layer(element);
258
262
  $(element).on({
259
263
  // fired only after the layer is shown
260
- [`${EVENT_PREFIX}show`]: function() {
264
+ [`${EVENT_PREFIX}show`]: function () {
261
265
  const el = this;
262
266
  setupNestedLayerHandlers(el);
263
267
  doIfTrigger(el, function (trigger) {
@@ -266,7 +270,7 @@ function maybeInitialise(element) {
266
270
  });
267
271
  },
268
272
  // fired only after the layer is hidden
269
- [`${EVENT_PREFIX}hide`]: function() {
273
+ [`${EVENT_PREFIX}hide`]: function () {
270
274
  const el = this;
271
275
  teardownNestedLayerHandlers(el.id);
272
276
  // in case the element has been removed from DOM already
@@ -281,7 +285,7 @@ function maybeInitialise(element) {
281
285
  trigger.setAttribute('aria-expanded', 'false');
282
286
  });
283
287
  setTrigger(el, null);
284
- }
288
+ },
285
289
  });
286
290
 
287
291
  element.__initialised = true;
@@ -291,7 +295,7 @@ const RESPONDS_TO_ATTRIBUTE_ENUM = {
291
295
  attribute: 'responds-to',
292
296
  values: ['toggle', 'hover'],
293
297
  missingDefault: 'toggle',
294
- invalidDefault: 'toggle'
298
+ invalidDefault: 'toggle',
295
299
  };
296
300
 
297
301
  const InlineDialogEl = skate('aui-inline-dialog', {
@@ -315,7 +319,7 @@ const InlineDialogEl = skate('aui-inline-dialog', {
315
319
  // a flag to help avoid things getting called a second time via the attribute mutation handler
316
320
  this.__propUpdate = true;
317
321
  if (value) {
318
- maybeShow(this)
322
+ maybeShow(this);
319
323
  } else {
320
324
  maybeHide(this);
321
325
  }
@@ -352,10 +356,10 @@ const InlineDialogEl = skate('aui-inline-dialog', {
352
356
  message: function (msg) {
353
357
  handleMessage(this, msg);
354
358
  return this;
355
- }
359
+ },
356
360
  },
357
361
  attributes: {
358
- open: function (element, change) {
362
+ 'open': function (element, change) {
359
363
  maybeInitialise(element);
360
364
 
361
365
  if (element.__propUpdate) {
@@ -377,12 +381,18 @@ const InlineDialogEl = skate('aui-inline-dialog', {
377
381
  }
378
382
  },
379
383
  'responds-to': function (element, change) {
380
- const oldComputedValue = attributes.computeEnumValue(RESPONDS_TO_ATTRIBUTE_ENUM, change.oldValue);
381
- const newComputedValue = attributes.computeEnumValue(RESPONDS_TO_ATTRIBUTE_ENUM, change.newValue);
384
+ const oldComputedValue = attributes.computeEnumValue(
385
+ RESPONDS_TO_ATTRIBUTE_ENUM,
386
+ change.oldValue
387
+ );
388
+ const newComputedValue = attributes.computeEnumValue(
389
+ RESPONDS_TO_ATTRIBUTE_ENUM,
390
+ change.newValue
391
+ );
382
392
  if (oldComputedValue !== newComputedValue) {
383
393
  rebindMouseEvents(element);
384
394
  }
385
- }
395
+ },
386
396
  },
387
397
 
388
398
  created: maybeInitialise,
@@ -406,7 +416,7 @@ const InlineDialogEl = skate('aui-inline-dialog', {
406
416
  forEachTrigger(element, function (trigger) {
407
417
  trigger.removeAttribute('aria-haspopup');
408
418
  trigger.removeAttribute('aria-expanded');
409
- })
419
+ });
410
420
  });
411
421
  },
412
422
 
@@ -414,7 +424,7 @@ const InlineDialogEl = skate('aui-inline-dialog', {
414
424
  $('<div class="aui-inline-dialog-contents"></div>')
415
425
  .append(element.childNodes)
416
426
  .appendTo(element);
417
- }
427
+ },
418
428
  });
419
429
 
420
430
  amdify('aui/inline-dialog2', InlineDialogEl);
@@ -10,7 +10,7 @@ import uniqueId from '../unique-id';
10
10
  *
11
11
  * @returns {undefined}
12
12
  */
13
- function addId (el, prefix = '') {
13
+ function addId(el, prefix = '') {
14
14
  var element = $(el);
15
15
  var addprefix = prefix || false;
16
16
 
@@ -43,10 +43,10 @@ function getPlacement(element) {
43
43
  }
44
44
 
45
45
  function getAlignment(element) {
46
- let [side, snap] = (getAlignmentAttribute(element)).split(' ');
46
+ let [side, snap] = getAlignmentAttribute(element).split(' ');
47
47
  return {
48
48
  side,
49
- snap
49
+ snap,
50
50
  };
51
51
  }
52
52
 
@@ -63,7 +63,7 @@ function addAlignmentClasses(element, side, snap) {
63
63
  }
64
64
  }
65
65
 
66
- function getContainer (element) {
66
+ function getContainer(element) {
67
67
  let container = getAttribute(element, ATTR_CONTAINER) || window;
68
68
 
69
69
  if (typeof container === 'string') {
@@ -73,7 +73,7 @@ function getContainer (element) {
73
73
  return container;
74
74
  }
75
75
 
76
- function calculateBestAlignmentSnap (target) {
76
+ function calculateBestAlignmentSnap(target) {
77
77
  let container = getContainer(target);
78
78
  let snap = 'left';
79
79
 
@@ -85,7 +85,10 @@ function calculateBestAlignmentSnap (target) {
85
85
  let containerBounds = container.getBoundingClientRect();
86
86
  let targetBounds = target.getBoundingClientRect();
87
87
 
88
- if ((targetBounds.left - containerBounds.left) > (containerBounds.right - containerBounds.left) / 2) {
88
+ if (
89
+ targetBounds.left - containerBounds.left >
90
+ (containerBounds.right - containerBounds.left) / 2
91
+ ) {
89
92
  snap = 'right';
90
93
  }
91
94
  }
@@ -93,13 +96,12 @@ function calculateBestAlignmentSnap (target) {
93
96
  return snap;
94
97
  }
95
98
 
96
- function calculatePlacement (element, target) {
99
+ function calculatePlacement(element, target) {
97
100
  const alignment = getAlignment(element);
98
101
 
99
102
  let placement;
100
103
 
101
104
  if (!alignment.snap || alignment.snap === 'auto') {
102
-
103
105
  alignment.snap = calculateBestAlignmentSnap(target);
104
106
 
105
107
  if (alignment.side === 'submenu') {
@@ -158,13 +160,15 @@ const allowedPlacement = {
158
160
  * scroll and resize. Equivalent of calling .enable() after init but saves one update cycle.
159
161
  */
160
162
  function Alignment(element, target, options = {}) {
161
- const alignment = getAlignment(element)
163
+ const alignment = getAlignment(element);
162
164
  const placement = calculatePlacement(element, target);
163
165
  const allowedAutoPlacements = allowedPlacement[placement.split('-')[0]];
164
166
 
165
167
  const frame = target.ownerDocument.defaultView.frameElement;
166
168
 
167
- this._eventListenersEnabled = options.hasOwnProperty('eventsEnabled') ? options.eventsEnabled : false;
169
+ this._eventListenersEnabled = options.hasOwnProperty('eventsEnabled')
170
+ ? options.eventsEnabled
171
+ : false;
168
172
  this._triggerOnEvents = false;
169
173
 
170
174
  const modifiers = [
@@ -173,8 +177,12 @@ function Alignment(element, target, options = {}) {
173
177
  enabled: options.hasOwnProperty('flip') ? options.flip : true,
174
178
  options: {
175
179
  allowedAutoPlacements,
176
- boundary: frame || (options.hasOwnProperty('flipContainer') ? options.flipContainer : 'clippingParents'), // clippingParents by default
177
- }
180
+ boundary:
181
+ frame ||
182
+ (options.hasOwnProperty('flipContainer')
183
+ ? options.flipContainer
184
+ : 'clippingParents'), // clippingParents by default
185
+ },
178
186
  },
179
187
  {
180
188
  name: 'preventOverflow',
@@ -182,8 +190,12 @@ function Alignment(element, target, options = {}) {
182
190
  options: {
183
191
  padding: 0, // as of Popper 2.0 it's 0 by default, but explicitly specify in case of defaults change.
184
192
  escapeWithReference: false,
185
- rootBoundary: frame || (options.hasOwnProperty('overflowContainer') ? options.overflowContainer : 'document'), //viewport by default
186
- }
193
+ rootBoundary:
194
+ frame ||
195
+ (options.hasOwnProperty('overflowContainer')
196
+ ? options.overflowContainer
197
+ : 'document'), //viewport by default
198
+ },
187
199
  },
188
200
  {
189
201
  name: 'offset',
@@ -194,44 +206,45 @@ function Alignment(element, target, options = {}) {
194
206
  },
195
207
  {
196
208
  name: 'hide',
197
- enabled: false
209
+ enabled: false,
198
210
  },
199
211
  {
200
212
  name: 'computeStyles',
201
213
  options: {
202
214
  gpuAcceleration: document.body.classList.contains(GPU_ACCELERATION_FLAG),
203
215
  // adaptive: false, // true by default, breaks CSS transitions (do we need it?)
204
- }
216
+ },
205
217
  },
206
218
  {
207
219
  name: 'eventListeners',
208
- enabled: this._eventListenersEnabled
220
+ enabled: this._eventListenersEnabled,
209
221
  },
210
- { // left for backwards compatibility
222
+ {
223
+ // left for backwards compatibility
211
224
  name: 'x-placement',
212
225
  enabled: true,
213
226
  phase: 'write',
214
227
  requires: ['computeStyles'],
215
- fn: ({state}) => {
228
+ fn: ({ state }) => {
216
229
  if (state.elements.popper) {
217
230
  // popper-specific attributes are NOT contracted, public API of AUI layered element
218
- state.elements.popper.setAttribute('x-placement', state.placement)
231
+ state.elements.popper.setAttribute('x-placement', state.placement);
219
232
  }
220
- }
233
+ },
221
234
  },
222
235
  {
223
236
  name: 'onUpdate',
224
237
  enabled: options.hasOwnProperty('onUpdate'),
225
238
  phase: 'afterWrite',
226
- effect: ({state, name}) => {
239
+ effect: ({ state, name }) => {
227
240
  // enable it after initial cycle
228
241
  state.modifiersData[`${name}#persistent`] = {
229
242
  enabled: true,
230
- fn: options.onUpdate
243
+ fn: options.onUpdate,
231
244
  };
232
245
  },
233
246
 
234
- fn: ({state, name}) => {
247
+ fn: ({ state, name }) => {
235
248
  const o = state.modifiersData[`${name}#persistent`];
236
249
 
237
250
  if (o.enabled) {
@@ -239,19 +252,19 @@ function Alignment(element, target, options = {}) {
239
252
  }
240
253
 
241
254
  return state;
242
- }
255
+ },
243
256
  },
244
257
  {
245
258
  name: 'onEvents',
246
259
  enabled: options.hasOwnProperty('onEvents'),
247
260
  phase: 'afterWrite',
248
- effect: ({state, name}) => {
261
+ effect: ({ state, name }) => {
249
262
  // enable it after initial cycle
250
263
  state.modifiersData[`${name}#persistent`] = {
251
- fn: options.onEvents
264
+ fn: options.onEvents,
252
265
  };
253
266
  },
254
- fn: ({state, name}) => {
267
+ fn: ({ state, name }) => {
255
268
  const o = state.modifiersData[`${name}#persistent`];
256
269
 
257
270
  if (this._triggerOnEvents) {
@@ -263,33 +276,26 @@ function Alignment(element, target, options = {}) {
263
276
  this._triggerOnEvents = false;
264
277
  }
265
278
  return state;
266
- }
267
- }
279
+ },
280
+ },
268
281
  ];
269
282
 
270
283
  // IE/Edge may throw a "Permission denied" error when strict-comparing two documents
271
284
  // eslint-disable-next-line eqeqeq
272
- if (frame && (target.ownerDocument != element.ownerDocument)) {
285
+ if (frame && target.ownerDocument != element.ownerDocument) {
273
286
  modifiers.push({
274
287
  name: 'iframeOffset',
275
288
  enabled: true,
276
289
  fn(data) {
277
290
  const rect = frame.getBoundingClientRect();
278
291
  const style = window.getComputedStyle(frame);
279
- const sum = (a, b) => a + b
280
- const getTotalValue = values => values.map(parseFloat).filter(Boolean).reduce(sum, 0);
292
+ const sum = (a, b) => a + b;
293
+ const getTotalValue = (values) =>
294
+ values.map(parseFloat).filter(Boolean).reduce(sum, 0);
281
295
 
282
- const top = getTotalValue([
283
- rect.top,
284
- style.paddingTop,
285
- style.borderTop
286
- ]);
296
+ const top = getTotalValue([rect.top, style.paddingTop, style.borderTop]);
287
297
 
288
- const left = getTotalValue([
289
- rect.left,
290
- style.paddingLeft,
291
- style.borderLeft
292
- ]);
298
+ const left = getTotalValue([rect.left, style.paddingLeft, style.borderLeft]);
293
299
 
294
300
  data.offsets.reference.left += left;
295
301
  data.offsets.reference.top += top;
@@ -297,16 +303,19 @@ function Alignment(element, target, options = {}) {
297
303
  data.offsets.popper.left += left;
298
304
  data.offsets.popper.top += top;
299
305
 
300
- return data
301
- }
306
+ return data;
307
+ },
302
308
  });
303
309
  }
304
310
 
305
311
  const popperConfig = {
306
312
  placement, //controlled by the flip modifier
307
- strategy: options.hasOwnProperty('positionFixed') && !options.positionFixed ? 'absolute' : 'fixed',
313
+ strategy:
314
+ options.hasOwnProperty('positionFixed') && !options.positionFixed
315
+ ? 'absolute'
316
+ : 'fixed',
308
317
  modifiers,
309
- onFirstUpdate: options.onCreate
318
+ onFirstUpdate: options.onCreate,
310
319
  };
311
320
 
312
321
  this.popper = createPopper(target, element, popperConfig);
@@ -315,7 +324,6 @@ function Alignment(element, target, options = {}) {
315
324
  }
316
325
 
317
326
  Alignment.prototype = {
318
-
319
327
  destroy() {
320
328
  this.popper.destroy();
321
329
  return this;
@@ -368,10 +376,10 @@ Alignment.prototype = {
368
376
  * @returns {Alignment}
369
377
  */
370
378
  disable() {
371
- this._eventListenersEnabled = false;
379
+ this._eventListenersEnabled = false;
372
380
  this._triggerOnEvents = true;
373
381
 
374
- this.popper.setOptions({}); // setOptions will re-instanciate all modifiers.
382
+ this.popper.setOptions({}); // setOptions will re-instanciate all modifiers.
375
383
  return this;
376
384
  },
377
385
  };
@@ -1,4 +1,3 @@
1
-
2
1
  export default function (name, fn) {
3
2
  if (window.define) {
4
3
  var alias = window.define;
@@ -1,4 +1,3 @@
1
-
2
1
  /**
3
2
  * Force a re-compute of the style of an element.
4
3
  *
@@ -23,11 +22,9 @@
23
22
  *
24
23
  * @param el The DOM or jQuery element for which style should be recomputed
25
24
  */
26
- function recomputeStyle (el) {
25
+ function recomputeStyle(el) {
27
26
  el = el.jquery ? el[0] : el;
28
27
  window.getComputedStyle(el, null).getPropertyValue('left');
29
28
  }
30
29
 
31
- export {
32
- recomputeStyle
33
- };
30
+ export { recomputeStyle };
@@ -15,7 +15,7 @@ export function setBooleanAttribute(el, attr, newValue) {
15
15
  }
16
16
 
17
17
  export function computeEnumValue(enumOptions, value) {
18
- const matchesEnumValue = enumValue => enumValue.toLowerCase() === value.toLowerCase();
18
+ const matchesEnumValue = (enumValue) => enumValue.toLowerCase() === value.toLowerCase();
19
19
 
20
20
  const isMissing = value === null;
21
21
  const isInvalid = !isMissing && !enumOptions.values.filter(matchesEnumValue).length;
@@ -39,7 +39,6 @@ export function computeEnumValue(enumOptions, value) {
39
39
  return enumOptions.values.length ? enumOptions.values.filter(matchesEnumValue)[0] : null;
40
40
  }
41
41
 
42
-
43
42
  export function setEnumAttribute(el, enumOptions, newValue) {
44
43
  el.setAttribute(enumOptions.attribute, newValue);
45
44
  }
@@ -57,5 +56,5 @@ export default {
57
56
  setBooleanAttribute,
58
57
 
59
58
  computeEnumValue,
60
- setEnumAttribute
59
+ setEnumAttribute,
61
60
  };
@@ -1,10 +1,9 @@
1
-
2
1
  var ua = navigator.userAgent.toLowerCase();
3
2
  var isIE = /msie/.test(ua);
4
3
  var isWinXP = /windows nt 5.1/.test(ua);
5
4
  var isWinVista = /windows nt 6.0/.test(ua);
6
5
  var isWin7 = /windows nt 6.1/.test(ua);
7
- var isMacOSX = (/mac os x/.test(ua));
6
+ var isMacOSX = /mac os x/.test(ua);
8
7
  var doesSupportHtml5DateInput;
9
8
  var doesSupportFocusWithin;
10
9
 
@@ -14,15 +13,15 @@ var doesSupportFocusWithin;
14
13
  * From manual testing, all IE versions on Windows 7 appear to have the bug,
15
14
  * but no IE versions on Windows 8 have it.
16
15
  */
17
- export function needsLayeringShim () {
16
+ export function needsLayeringShim() {
18
17
  return isIE && (isWinXP || isWinVista || isWin7);
19
18
  }
20
19
 
21
- export function supportsVoiceOver () {
20
+ export function supportsVoiceOver() {
22
21
  return isMacOSX;
23
22
  }
24
23
 
25
- export function supportsDateField () {
24
+ export function supportsDateField() {
26
25
  if (typeof doesSupportHtml5DateInput === 'undefined') {
27
26
  var el = document.createElement('input');
28
27
  el.setAttribute('type', 'date');
@@ -31,7 +30,7 @@ export function supportsDateField () {
31
30
  return doesSupportHtml5DateInput;
32
31
  }
33
32
 
34
- export function supportsFocusWithin () {
33
+ export function supportsFocusWithin() {
35
34
  if (typeof doesSupportFocusWithin === 'undefined') {
36
35
  try {
37
36
  document.querySelector(':focus-within');
@@ -1,5 +1,3 @@
1
1
  const INPUT_SUFFIX = '-input';
2
2
 
3
- export {
4
- INPUT_SUFFIX
5
- }
3
+ export { INPUT_SUFFIX };