@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,11 +1,7 @@
1
- import {I18n} from './i18n';
1
+ import { I18n } from './i18n';
2
2
 
3
3
  const CLOSE_BUTTON_CLASS = 'aui-close-button';
4
4
  const CLOSE_BUTTON_CLASS_SELECTOR = `.${CLOSE_BUTTON_CLASS}`;
5
5
  const CLOSE_BUTTON = `<button type="button" class="${CLOSE_BUTTON_CLASS}" aria-label="${I18n.getText('aui.words.close')}">`;
6
6
 
7
- export {
8
- CLOSE_BUTTON,
9
- CLOSE_BUTTON_CLASS,
10
- CLOSE_BUTTON_CLASS_SELECTOR
11
- };
7
+ export { CLOSE_BUTTON, CLOSE_BUTTON_CLASS, CLOSE_BUTTON_CLASS_SELECTOR };
@@ -1,7 +1,7 @@
1
1
  import $ from './jquery';
2
2
  import globalize from './internal/globalize';
3
3
 
4
- function containDropdown (dropdown, containerSelector, dynamic) {
4
+ function containDropdown(dropdown, containerSelector, dynamic) {
5
5
  function getDropdownOffset() {
6
6
  return dropdown.$.offset().top - $(containerSelector).offset().top;
7
7
  }
@@ -24,17 +24,17 @@ function containDropdown (dropdown, containerSelector, dynamic) {
24
24
  }
25
25
  dropdown.reset();
26
26
  }
27
- };
27
+ }
28
28
 
29
29
  containDropdown.containHeight = function (dropdown, availableArea) {
30
30
  dropdown.$.css({
31
- height: availableArea
31
+ height: availableArea,
32
32
  });
33
33
  if (dropdown.$.css('overflowY') !== 'scroll') {
34
34
  dropdown.$.css({
35
35
  width: 15 + dropdown.$.attr('scrollWidth'),
36
36
  overflowY: 'scroll',
37
- overflowX: 'hidden'
37
+ overflowX: 'hidden',
38
38
  });
39
39
  }
40
40
  };
@@ -44,7 +44,7 @@ containDropdown.releaseContainment = function (dropdown) {
44
44
  height: '',
45
45
  width: '',
46
46
  overflowY: '',
47
- overflowX: ''
47
+ overflowX: '',
48
48
  });
49
49
  };
50
50
 
@@ -9,7 +9,7 @@ import indexOf from './index-of';
9
9
  *
10
10
  * @return {Boolean}
11
11
  */
12
- function contains (array, item) {
12
+ function contains(array, item) {
13
13
  return indexOf(array, item) > -1;
14
14
  }
15
15
 
@@ -7,11 +7,11 @@ var CONSECUTIVE_PIPE_CHARS_REGEX = /\|\|+/g;
7
7
  var ANY_QUOTE_REGEX = /"/g;
8
8
  var REGEX_SPECIAL_CHARS = /[.*+?|^$()[\]{\\]/g;
9
9
 
10
- function regexEscape (str) {
10
+ function regexEscape(str) {
11
11
  return str.replace(REGEX_SPECIAL_CHARS, '\\$&');
12
12
  }
13
13
 
14
- function getValueFromConglomerate (name, cookieValue) {
14
+ function getValueFromConglomerate(name, cookieValue) {
15
15
  // A null cookieValue is just the first time through so create it.
16
16
  cookieValue = cookieValue || '';
17
17
  var reg = new RegExp(regexEscape(name) + '=([^|]+)');
@@ -20,7 +20,7 @@ function getValueFromConglomerate (name, cookieValue) {
20
20
  }
21
21
 
22
22
  // Either append or replace the value in the cookie string/
23
- function addOrAppendToValue (name, value, cookieValue) {
23
+ function addOrAppendToValue(name, value, cookieValue) {
24
24
  // A cookie name follows after any amount of white space mixed with any amount of '|' characters.
25
25
  // A cookie value is preceded by '=', then anything except for '|'.
26
26
  var reg = new RegExp('(\\s|\\|)*\\b' + regexEscape(name) + '=[^|]*[|]*');
@@ -38,17 +38,17 @@ function addOrAppendToValue (name, value, cookieValue) {
38
38
  return cookieValue.replace(CONSECUTIVE_PIPE_CHARS_REGEX, '|');
39
39
  }
40
40
 
41
- function unescapeCookieValue (name) {
41
+ function unescapeCookieValue(name) {
42
42
  return name.replace(UNESCAPE_COOKIE_REGEX, '');
43
43
  }
44
44
 
45
- function getCookieValue (name) {
45
+ function getCookieValue(name) {
46
46
  var reg = new RegExp('\\b' + regexEscape(name) + '=((?:[^\\\\;]+|\\\\.)*)(?:;|$)');
47
47
  var res = document.cookie.match(reg);
48
48
  return res && unescapeCookieValue(res[1]);
49
49
  }
50
50
 
51
- function saveCookie (name, value, days) {
51
+ function saveCookie(name, value, days) {
52
52
  var ex = '';
53
53
  var d;
54
54
  var quotedValue = '"' + value.replace(ANY_QUOTE_REGEX, '\\"') + '"';
@@ -68,7 +68,7 @@ function saveCookie (name, value, days) {
68
68
  * @param value {String} value of cookie
69
69
  * @param expires {Number} number of days before cookie expires
70
70
  */
71
- function save (name, value, expires) {
71
+ function save(name, value, expires) {
72
72
  var cookieValue = getCookieValue(COOKIE_NAME);
73
73
  cookieValue = addOrAppendToValue(name, value, cookieValue);
74
74
  saveCookie(COOKIE_NAME, cookieValue, expires || 365);
@@ -79,7 +79,7 @@ function save (name, value, expires) {
79
79
  * @param name {String} name of cookie to read
80
80
  * @param defaultValue {String} the default value of the cookie to return if not found
81
81
  */
82
- function read (name, defaultValue) {
82
+ function read(name, defaultValue) {
83
83
  var cookieValue = getCookieValue(COOKIE_NAME);
84
84
  var value = getValueFromConglomerate(name, cookieValue);
85
85
  if (value != null) {
@@ -92,14 +92,14 @@ function read (name, defaultValue) {
92
92
  * Remove the given cookie.
93
93
  * @param name {String} the name of the cookie to remove
94
94
  */
95
- function erase (name) {
95
+ function erase(name) {
96
96
  save(name, '');
97
97
  }
98
98
 
99
99
  var cookie = {
100
100
  erase: erase,
101
101
  read: read,
102
- save: save
102
+ save: save,
103
103
  };
104
104
 
105
105
  globalize('cookie', cookie);
@@ -107,11 +107,7 @@ globalize('Cookie', cookie);
107
107
 
108
108
  deprecate.prop(AJS, 'Cookie', {
109
109
  alternativeName: 'cookie',
110
- sinceVersion: '5.8.0'
110
+ sinceVersion: '5.8.0',
111
111
  });
112
112
 
113
- export {
114
- erase,
115
- read,
116
- save
117
- };
113
+ export { erase, read, save };
@@ -8,7 +8,7 @@ import { I18n } from './i18n';
8
8
  import InlineDialogEl from './inline-dialog2';
9
9
  import generateUniqueId from './unique-id';
10
10
 
11
- const makePopup = ({horizontalAlignment, datePickerUUID}) => {
11
+ const makePopup = ({ horizontalAlignment, datePickerUUID }) => {
12
12
  const popupInlineDialogElement = new InlineDialogEl();
13
13
  popupInlineDialogElement.id = datePickerUUID;
14
14
 
@@ -21,7 +21,15 @@ const makePopup = ({horizontalAlignment, datePickerUUID}) => {
21
21
  return popup;
22
22
  };
23
23
 
24
- const makeConfig = ({ minDate, maxDate, dateFormat, $field, onSelect, hide, onChangeMonthYear}) => ({
24
+ const makeConfig = ({
25
+ minDate,
26
+ maxDate,
27
+ dateFormat,
28
+ $field,
29
+ onSelect,
30
+ hide,
31
+ onChangeMonthYear,
32
+ }) => ({
25
33
  dateFormat,
26
34
  defaultDate: $field.val(),
27
35
  maxDate: maxDate || $field.attr('max'),
@@ -35,10 +43,10 @@ const makeConfig = ({ minDate, maxDate, dateFormat, $field, onSelect, hide, onCh
35
43
  onSelect && onSelect.call(this, dateText);
36
44
  },
37
45
  onChangeMonthYear,
38
- prevText: '<'
46
+ prevText: '<',
39
47
  });
40
48
 
41
- const initCalendar = ({config, popupContents, getCalendarNode, hint}) => {
49
+ const initCalendar = ({ config, popupContents, getCalendarNode, hint }) => {
42
50
  const calendar = $(getCalendarNode());
43
51
 
44
52
  calendar.datepicker(config);
@@ -59,7 +67,6 @@ const makeDefaultPopupController = ($field, datePickerUUID) => {
59
67
  let parentPopup;
60
68
  let isTrackingDatePickerFocus = false; // used to prevent multiple bindings of handleDatePickerFocus within handleFieldBlur
61
69
 
62
-
63
70
  const $body = $('body');
64
71
 
65
72
  const handleDatePickerFocus = (event) => {
@@ -81,33 +88,33 @@ const makeDefaultPopupController = ($field, datePickerUUID) => {
81
88
 
82
89
  const handleFieldBlur = () => {
83
90
  // Trigger blur if event is keydown and esc OR is focusout.
84
- if (!(isTrackingDatePickerFocus)) {
91
+ if (!isTrackingDatePickerFocus) {
85
92
  $body.on('focus blur click mousedown', '*', handleDatePickerFocus);
86
93
  isTrackingDatePickerFocus = true;
87
94
  }
88
95
  };
89
96
 
90
-
91
97
  const createPolyfill = function () {
92
98
  // bind additional field processing events
93
99
  $body.on('keydown', handleDatePickerFocus);
94
100
  $field.on('focusout keydown', handleFieldBlur);
95
-
96
-
97
101
  };
98
102
 
99
- const getPopupContents = ({$field}) => {
100
- const calculateHorizontalAlignment = $field => {
103
+ const getPopupContents = ({ $field }) => {
104
+ const calculateHorizontalAlignment = ($field) => {
101
105
  let inLeftHalf = $field.offset().left < window.innerWidth / 2;
102
106
  return inLeftHalf ? 'left' : 'right';
103
107
  };
104
108
 
105
- popup = makePopup({horizontalAlignment: calculateHorizontalAlignment($field), datePickerUUID});
109
+ popup = makePopup({
110
+ horizontalAlignment: calculateHorizontalAlignment($field),
111
+ datePickerUUID,
112
+ });
106
113
 
107
114
  parentPopup = $field.closest('aui-inline-dialog').get(0);
108
115
  if (parentPopup) {
109
116
  parentPopup._datePickerPopup = popup; // AUI-2696 - hackish coupling to control inline-dialog close behaviour.
110
- $(parentPopup).on('aui-hide', e => {
117
+ $(parentPopup).on('aui-hide', (e) => {
111
118
  if (isTrackingDatePickerFocus) {
112
119
  e.preventDefault();
113
120
  }
@@ -127,7 +134,7 @@ const makeDefaultPopupController = ($field, datePickerUUID) => {
127
134
 
128
135
  const handleFieldFocus = () => {
129
136
  if (!popup.get(0).open) {
130
- showDatePicker()
137
+ showDatePicker();
131
138
  }
132
139
  };
133
140
 
@@ -144,8 +151,7 @@ const makeDefaultPopupController = ($field, datePickerUUID) => {
144
151
  setTimeout(popup.refresh, 0);
145
152
  };
146
153
 
147
- const getCalendarNode = () =>
148
- popup.get(0).childNodes[0];
154
+ const getCalendarNode = () => popup.get(0).childNodes[0];
149
155
 
150
156
  const destroyPolyfill = () => {
151
157
  // goodbye, cruel world!
@@ -167,8 +173,8 @@ const makeDefaultPopupController = ($field, datePickerUUID) => {
167
173
  handleChangeMonthYear,
168
174
  getCalendarNode,
169
175
  destroyPolyfill,
170
- createPolyfill
171
- }
176
+ createPolyfill,
177
+ };
172
178
  };
173
179
 
174
180
  const initPolyfill = function (datePicker) {
@@ -211,9 +217,9 @@ const initPolyfill = function (datePicker) {
211
217
  // mutate datePicker public API
212
218
  // -----------------------------------------------------------------
213
219
  {
214
- const withCalendar = callback => value => {
220
+ const withCalendar = (callback) => (value) => {
215
221
  if (typeof calendar !== 'undefined') {
216
- return callback(value)
222
+ return callback(value);
217
223
  }
218
224
  };
219
225
 
@@ -254,26 +260,27 @@ const initPolyfill = function (datePicker) {
254
260
 
255
261
  delete datePicker.show;
256
262
  delete datePicker.hide;
257
-
258
263
  };
259
264
 
260
- datePicker.setDate = withCalendar(value => {
261
- calendar.datepicker('setDate', value)
265
+ datePicker.setDate = withCalendar((value) => {
266
+ calendar.datepicker('setDate', value);
262
267
  });
263
268
 
264
269
  datePicker.getDate = withCalendar(() => calendar.datepicker('getDate'));
265
270
 
266
- datePicker.setMin = withCalendar(value => calendar.datepicker('option', 'minDate', value));
271
+ datePicker.setMin = withCalendar((value) =>
272
+ calendar.datepicker('option', 'minDate', value)
273
+ );
267
274
 
268
- datePicker.setMax = withCalendar(value => calendar.datepicker('option', 'maxDate', value));
275
+ datePicker.setMax = withCalendar((value) =>
276
+ calendar.datepicker('option', 'maxDate', value)
277
+ );
269
278
  }
270
279
 
271
-
272
280
  // -----------------------------------------------------------------
273
281
  // polyfill bootstrap ----------------------------------------------
274
282
  // -----------------------------------------------------------------
275
283
 
276
-
277
284
  if (!(options.languageCode in DatePicker.prototype.localisations)) {
278
285
  options.languageCode = '';
279
286
  }
@@ -283,7 +290,9 @@ const initPolyfill = function (datePicker) {
283
290
 
284
291
  if (typeof calendar === 'undefined') {
285
292
  if (typeof $field.attr('step') !== 'undefined') {
286
- logger.log('WARNING: The date picker polyfill currently does not support the step attribute!');
293
+ logger.log(
294
+ 'WARNING: The date picker polyfill currently does not support the step attribute!'
295
+ );
287
296
  }
288
297
  const baseConfig = makeConfig({
289
298
  dateFormat: options.dateFormat,
@@ -292,7 +301,7 @@ const initPolyfill = function (datePicker) {
292
301
  $field,
293
302
  onSelect: options.onSelect,
294
303
  hide: datePicker.hide,
295
- onChangeMonthYear: handleChangeMonthYear
304
+ onChangeMonthYear: handleChangeMonthYear,
296
305
  });
297
306
  const config = $.extend(undefined, baseConfig, i18nConfig);
298
307
 
@@ -304,16 +313,15 @@ const initPolyfill = function (datePicker) {
304
313
 
305
314
  calendar = initCalendar({
306
315
  config,
307
- popupContents: getPopupContents({$field}),
316
+ popupContents: getPopupContents({ $field }),
308
317
  getCalendarNode,
309
- hint: options.hint
318
+ hint: options.hint,
310
319
  });
311
320
 
312
321
  createPolyfill();
313
322
 
314
323
  $field.on('propertychange keyup input paste', handleFieldUpdate);
315
324
 
316
-
317
325
  // bind attribute handlers to account for html5 attributes
318
326
  attributeHandler = new MutationObserver(function (mutationsList) {
319
327
  mutationsList.forEach(function (mutation) {
@@ -324,7 +332,7 @@ const initPolyfill = function (datePicker) {
324
332
  }
325
333
  });
326
334
  });
327
- attributeHandler.observe($field.get(0), {attributes: true});
335
+ attributeHandler.observe($field.get(0), { attributes: true });
328
336
  }
329
337
 
330
338
  // bind what we need to start off with
@@ -370,17 +378,14 @@ function DatePicker(field, baseOptions) {
370
378
  const browserDoesNotSupportDateField = !DatePicker.prototype.browserSupportsDateField;
371
379
  const shouldOverrideBrowserDefault = options.overrideBrowserDefault !== false;
372
380
 
373
- if (
374
- browserDoesNotSupportDateField ||
375
- shouldOverrideBrowserDefault
376
- ) {
381
+ if (browserDoesNotSupportDateField || shouldOverrideBrowserDefault) {
377
382
  initPolyfill(datePicker);
378
383
  }
379
384
  },
380
- reconfigure: newOptions => {
385
+ reconfigure: (newOptions) => {
381
386
  options = $.extend(undefined, DatePicker.prototype.defaultOptions, newOptions);
382
387
  datePicker.reset();
383
- }
388
+ },
384
389
  };
385
390
 
386
391
  datePicker.reconfigure(baseOptions);
@@ -398,14 +403,17 @@ DatePicker.prototype.defaultOptions = {
398
403
  overrideBrowserDefault: false,
399
404
  firstDay: -1,
400
405
  languageCode: $('html').attr('lang') || 'en-AU',
401
- dateFormat: datepickerUI.W3C // same as $.datepicker.ISO_8601
406
+ dateFormat: datepickerUI.W3C, // same as $.datepicker.ISO_8601
402
407
  };
403
408
 
404
409
  function CalendarWidget(calendarNode, baseOptions) {
405
- const options = $.extend({
406
- 'nextText': '>',
407
- 'prevText': '<'
408
- }, baseOptions);
410
+ const options = $.extend(
411
+ {
412
+ nextText: '>',
413
+ prevText: '<',
414
+ },
415
+ baseOptions
416
+ );
409
417
 
410
418
  const $calendarNode = $(calendarNode);
411
419
 
@@ -429,7 +437,7 @@ function CalendarWidget(calendarNode, baseOptions) {
429
437
  $result.datepicker('destroy');
430
438
  };
431
439
 
432
- return $result
440
+ return $result;
433
441
  }
434
442
 
435
443
  // adapted from the jQuery UI Datepicker widget (v1.8.16), with the following changes:
@@ -459,23 +467,28 @@ for (langCode in langs) {
459
467
  */
460
468
 
461
469
  DatePicker.prototype.localisations = {
462
- 'dayNames': [I18n.getText('ajs.datepicker.localisations.day-names.sunday'),
470
+ dayNames: [
471
+ I18n.getText('ajs.datepicker.localisations.day-names.sunday'),
463
472
  I18n.getText('ajs.datepicker.localisations.day-names.monday'),
464
473
  I18n.getText('ajs.datepicker.localisations.day-names.tuesday'),
465
474
  I18n.getText('ajs.datepicker.localisations.day-names.wednesday'),
466
475
  I18n.getText('ajs.datepicker.localisations.day-names.thursday'),
467
476
  I18n.getText('ajs.datepicker.localisations.day-names.friday'),
468
- I18n.getText('ajs.datepicker.localisations.day-names.saturday')],
469
- 'dayNamesMin': [I18n.getText('ajs.datepicker.localisations.day-names-min.sunday'),
477
+ I18n.getText('ajs.datepicker.localisations.day-names.saturday'),
478
+ ],
479
+ dayNamesMin: [
480
+ I18n.getText('ajs.datepicker.localisations.day-names-min.sunday'),
470
481
  I18n.getText('ajs.datepicker.localisations.day-names-min.monday'),
471
482
  I18n.getText('ajs.datepicker.localisations.day-names-min.tuesday'),
472
483
  I18n.getText('ajs.datepicker.localisations.day-names-min.wednesday'),
473
484
  I18n.getText('ajs.datepicker.localisations.day-names-min.thursday'),
474
485
  I18n.getText('ajs.datepicker.localisations.day-names-min.friday'),
475
- I18n.getText('ajs.datepicker.localisations.day-names-min.saturday')],
476
- 'firstDay': I18n.getText('ajs.datepicker.localisations.first-day'),
477
- 'isRTL': I18n.getText('ajs.datepicker.localisations.is-RTL') === 'true',
478
- 'monthNames': [I18n.getText('ajs.datepicker.localisations.month-names.january'),
486
+ I18n.getText('ajs.datepicker.localisations.day-names-min.saturday'),
487
+ ],
488
+ firstDay: I18n.getText('ajs.datepicker.localisations.first-day'),
489
+ isRTL: I18n.getText('ajs.datepicker.localisations.is-RTL') === 'true',
490
+ monthNames: [
491
+ I18n.getText('ajs.datepicker.localisations.month-names.january'),
479
492
  I18n.getText('ajs.datepicker.localisations.month-names.february'),
480
493
  I18n.getText('ajs.datepicker.localisations.month-names.march'),
481
494
  I18n.getText('ajs.datepicker.localisations.month-names.april'),
@@ -486,29 +499,31 @@ DatePicker.prototype.localisations = {
486
499
  I18n.getText('ajs.datepicker.localisations.month-names.september'),
487
500
  I18n.getText('ajs.datepicker.localisations.month-names.october'),
488
501
  I18n.getText('ajs.datepicker.localisations.month-names.november'),
489
- I18n.getText('ajs.datepicker.localisations.month-names.december')],
490
- 'showMonthAfterYear': I18n.getText('ajs.datepicker.localisations.show-month-after-year') === 'true',
491
- 'yearSuffix': I18n.getText('ajs.datepicker.localisations.year-suffix')
502
+ I18n.getText('ajs.datepicker.localisations.month-names.december'),
503
+ ],
504
+ showMonthAfterYear:
505
+ I18n.getText('ajs.datepicker.localisations.show-month-after-year') === 'true',
506
+ yearSuffix: I18n.getText('ajs.datepicker.localisations.year-suffix'),
492
507
  };
493
508
 
494
-
495
509
  // -------------------------------------------------------------------------
496
510
  // finally, integrate with jQuery for convenience --------------------------
497
511
  // -------------------------------------------------------------------------
498
512
  const key = 'aui-datepicker';
499
513
 
500
- const makePlugin = (WidgetConstructor) => function (options) {
501
- let picker = this.data(key);
502
- if (!picker) {
503
- picker = new WidgetConstructor(this, options);
504
- this.data(key, picker);
505
- } else if (typeof options === 'object') {
506
- picker.reconfigure(options);
507
- } else if (options === 'destroy') {
508
- picker.destroy();
509
- }
510
- return picker;
511
- };
514
+ const makePlugin = (WidgetConstructor) =>
515
+ function (options) {
516
+ let picker = this.data(key);
517
+ if (!picker) {
518
+ picker = new WidgetConstructor(this, options);
519
+ this.data(key, picker);
520
+ } else if (typeof options === 'object') {
521
+ picker.reconfigure(options);
522
+ } else if (options === 'destroy') {
523
+ picker.destroy();
524
+ }
525
+ return picker;
526
+ };
512
527
 
513
528
  $.fn.datePicker = makePlugin(DatePicker);
514
529
  globalize('DatePicker', DatePicker);
@@ -517,4 +532,4 @@ $.fn.calendarWidget = makePlugin(CalendarWidget);
517
532
  globalize('CalendarWidget', CalendarWidget);
518
533
 
519
534
  export default DatePicker;
520
- export { CalendarWidget }
535
+ export { CalendarWidget };
@@ -4,7 +4,7 @@ import * as deprecate from './internal/deprecation';
4
4
  /**
5
5
  * @deprecated Since 8.0.0 Use equivalent functions from libraries like lodash / underscore instead.
6
6
  */
7
- function debounce (func, wait) {
7
+ function debounce(func, wait) {
8
8
  var timeout;
9
9
  var result;
10
10
 
@@ -26,7 +26,7 @@ function debounce (func, wait) {
26
26
  var deprecatedDebounce = deprecate.fn(debounce, 'AJS.debounce', {
27
27
  removeInVersion: '10.0.0',
28
28
  sinceVersion: '8.0.0',
29
- extraInfo: 'Use equivalent functions from libraries like lodash / underscore instead'
29
+ extraInfo: 'Use equivalent functions from libraries like lodash / underscore instead',
30
30
  });
31
31
 
32
32
  export default deprecatedDebounce;
@@ -36,7 +36,7 @@ globalize('debounce', deprecatedDebounce);
36
36
  /**
37
37
  * @deprecated Since 8.0.0 Use equivalent functions from libraries like lodash / underscore instead.
38
38
  */
39
- function debounceImmediate (func, wait) {
39
+ function debounceImmediate(func, wait) {
40
40
  var timeout = null;
41
41
  var result;
42
42
 
@@ -61,12 +61,9 @@ function debounceImmediate (func, wait) {
61
61
  var deprecatedDebounceImmediate = deprecate.fn(debounceImmediate, 'AJS.debounceImmediate', {
62
62
  removeInVersion: '10.0.0',
63
63
  sinceVersion: '8.0.0',
64
- extraInfo: 'Use equivalent functions from libraries like lodash / underscore instead'
64
+ extraInfo: 'Use equivalent functions from libraries like lodash / underscore instead',
65
65
  });
66
66
 
67
- export {
68
- deprecatedDebounceImmediate as debounceImmediate
69
- };
67
+ export { deprecatedDebounceImmediate as debounceImmediate };
70
68
 
71
69
  globalize('debounceImmediate', deprecatedDebounceImmediate);
72
-