@atlassian/aui 9.2.16-bbd82a2f8 → 9.2.16
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/LICENSE.md +1 -1
- package/README.md +7 -9
- package/dist/aui/aui-css-deprecations.js.map +1 -1
- package/dist/aui/aui-prototyping.css +9 -9
- package/dist/aui/aui-prototyping.js +2 -2
- package/dist/aui/aui-prototyping.js.map +1 -1
- package/dist/aui/aui-prototyping.nodeps.css +9 -9
- package/dist/aui/aui-prototyping.nodeps.js +2 -2
- package/dist/aui/aui-prototyping.nodeps.js.map +1 -1
- package/entry/aui.batch.components.js +21 -21
- package/entry/aui.batch.page.js +3 -3
- package/entry/aui.batch.patterns.js +20 -20
- package/entry/aui.batch.prototyping.js +3 -10
- package/entry/aui.component.nav.js +1 -1
- package/entry/aui.component.progressbar.js +4 -1
- package/entry/aui.side-effects.js +2 -2
- package/entry/behaviours/aui.behaviour.format.js +1 -1
- package/entry/behaviours/aui.behaviour.i18n.js +1 -1
- package/entry/behaviours/aui.behaviour.keyboard-shortcuts.js +1 -1
- package/entry/behaviours/aui.behaviour.progressive-data-set.js +1 -1
- package/entry/behaviours/aui.behaviour.version.js +1 -1
- package/entry/deprecated/aui.component.inline-dialog1.js +1 -1
- package/package.json +1 -1
- package/src/js/aui/alphanum.js +1 -1
- package/src/js/aui/banner.js +2 -2
- package/src/js/aui/blanket.js +7 -11
- package/src/js/aui/button.js +5 -5
- package/src/js/aui/checkbox-multiselect.js +79 -76
- package/src/js/aui/clone.js +1 -1
- package/src/js/aui/close-button.js +2 -6
- package/src/js/aui/contain-dropdown.js +5 -5
- package/src/js/aui/contains.js +1 -1
- package/src/js/aui/cookie.js +12 -16
- package/src/js/aui/date-picker.js +82 -75
- package/src/js/aui/debounce.js +5 -8
- package/src/js/aui/dialog.js +206 -172
- package/src/js/aui/dialog2.js +9 -8
- package/src/js/aui/dropdown2.js +207 -180
- package/src/js/aui/escape-html.js +2 -2
- package/src/js/aui/escape.js +1 -1
- package/src/js/aui/event.js +4 -8
- package/src/js/aui/expander.js +9 -7
- package/src/js/aui/flag.js +15 -17
- package/src/js/aui/focus-manager.js +19 -18
- package/src/js/aui/form-notification.js +14 -13
- package/src/js/aui/form-validation/basic-validators.js +39 -30
- package/src/js/aui/form-validation/validator-register.js +9 -5
- package/src/js/aui/form-validation.js +17 -14
- package/src/js/aui/format.js +9 -6
- package/src/js/aui/forms/create-forms-component-body.js +6 -9
- package/src/js/aui/forms/custom-checkbox.js +2 -6
- package/src/js/aui/forms/custom-radio.js +2 -6
- package/src/js/aui/forms.js +4 -8
- package/src/js/aui/header-async.js +1 -1
- package/src/js/aui/header.js +2 -2
- package/src/js/aui/i18n.js +2 -5
- package/src/js/aui/index-of.js +1 -1
- package/src/js/aui/inline-dialog.js +171 -117
- package/src/js/aui/inline-dialog2.js +60 -50
- package/src/js/aui/internal/add-id.js +1 -1
- package/src/js/aui/internal/alignment.js +57 -49
- package/src/js/aui/internal/amdify.js +0 -1
- package/src/js/aui/internal/animation.js +2 -5
- package/src/js/aui/internal/attributes.js +2 -3
- package/src/js/aui/internal/browser.js +5 -6
- package/src/js/aui/internal/constants.js +1 -3
- package/src/js/aui/internal/deduplicateIDs.js +8 -7
- package/src/js/aui/internal/deprecation/deprecated-adg2-icons.js +132 -132
- package/src/js/aui/internal/deprecation.js +53 -31
- package/src/js/aui/internal/detect-children-change.js +3 -2
- package/src/js/aui/internal/elements.js +2 -5
- package/src/js/aui/internal/enforcer.js +11 -13
- package/src/js/aui/internal/globalize.js +3 -3
- package/src/js/aui/internal/has-touch.js +1 -2
- package/src/js/aui/internal/header/create-header.js +49 -26
- package/src/js/aui/internal/i18n/aui.js +8 -5
- package/src/js/aui/internal/i18n/aui_af.js +31 -31
- package/src/js/aui/internal/i18n/aui_ar.js +31 -31
- package/src/js/aui/internal/i18n/aui_ar_DZ.js +31 -31
- package/src/js/aui/internal/i18n/aui_az.js +31 -31
- package/src/js/aui/internal/i18n/aui_bg.js +31 -31
- package/src/js/aui/internal/i18n/aui_bs.js +31 -31
- package/src/js/aui/internal/i18n/aui_ca.js +31 -31
- package/src/js/aui/internal/i18n/aui_cs.js +31 -31
- package/src/js/aui/internal/i18n/aui_da.js +31 -31
- package/src/js/aui/internal/i18n/aui_de.js +31 -31
- package/src/js/aui/internal/i18n/aui_el.js +31 -31
- package/src/js/aui/internal/i18n/aui_en_AU.js +31 -31
- package/src/js/aui/internal/i18n/aui_en_GB.js +31 -31
- package/src/js/aui/internal/i18n/aui_en_NZ.js +31 -31
- package/src/js/aui/internal/i18n/aui_eo.js +31 -31
- package/src/js/aui/internal/i18n/aui_es.js +31 -31
- package/src/js/aui/internal/i18n/aui_et.js +31 -31
- package/src/js/aui/internal/i18n/aui_eu.js +31 -31
- package/src/js/aui/internal/i18n/aui_fa.js +31 -31
- package/src/js/aui/internal/i18n/aui_fi.js +31 -31
- package/src/js/aui/internal/i18n/aui_fo.js +31 -31
- package/src/js/aui/internal/i18n/aui_fr.js +31 -31
- package/src/js/aui/internal/i18n/aui_fr_CH.js +31 -31
- package/src/js/aui/internal/i18n/aui_gl.js +31 -31
- package/src/js/aui/internal/i18n/aui_he.js +31 -31
- package/src/js/aui/internal/i18n/aui_hr.js +31 -31
- package/src/js/aui/internal/i18n/aui_hu.js +31 -31
- package/src/js/aui/internal/i18n/aui_hy.js +31 -31
- package/src/js/aui/internal/i18n/aui_id.js +31 -31
- package/src/js/aui/internal/i18n/aui_is.js +31 -31
- package/src/js/aui/internal/i18n/aui_it.js +31 -31
- package/src/js/aui/internal/i18n/aui_ja.js +31 -31
- package/src/js/aui/internal/i18n/aui_ko.js +31 -31
- package/src/js/aui/internal/i18n/aui_kz.js +31 -31
- package/src/js/aui/internal/i18n/aui_lt.js +31 -31
- package/src/js/aui/internal/i18n/aui_lv.js +31 -31
- package/src/js/aui/internal/i18n/aui_ml.js +31 -31
- package/src/js/aui/internal/i18n/aui_ms.js +31 -31
- package/src/js/aui/internal/i18n/aui_nl.js +31 -31
- package/src/js/aui/internal/i18n/aui_no.js +31 -31
- package/src/js/aui/internal/i18n/aui_pl.js +31 -31
- package/src/js/aui/internal/i18n/aui_pt.js +31 -31
- package/src/js/aui/internal/i18n/aui_pt_BR.js +31 -31
- package/src/js/aui/internal/i18n/aui_rm.js +31 -31
- package/src/js/aui/internal/i18n/aui_ro.js +31 -31
- package/src/js/aui/internal/i18n/aui_ru.js +31 -31
- package/src/js/aui/internal/i18n/aui_sk.js +31 -31
- package/src/js/aui/internal/i18n/aui_sl.js +31 -31
- package/src/js/aui/internal/i18n/aui_sq.js +31 -31
- package/src/js/aui/internal/i18n/aui_sr.js +31 -31
- package/src/js/aui/internal/i18n/aui_sr_SR.js +31 -31
- package/src/js/aui/internal/i18n/aui_sv.js +31 -31
- package/src/js/aui/internal/i18n/aui_ta.js +31 -31
- package/src/js/aui/internal/i18n/aui_th.js +31 -31
- package/src/js/aui/internal/i18n/aui_tj.js +31 -31
- package/src/js/aui/internal/i18n/aui_tr.js +31 -31
- package/src/js/aui/internal/i18n/aui_uk.js +31 -31
- package/src/js/aui/internal/i18n/aui_vi.js +31 -31
- package/src/js/aui/internal/i18n/aui_zh_CN.js +31 -31
- package/src/js/aui/internal/i18n/aui_zh_HK.js +31 -31
- package/src/js/aui/internal/i18n/aui_zh_TW.js +31 -31
- package/src/js/aui/internal/log.js +2 -6
- package/src/js/aui/internal/mediaQuery.js +2 -3
- package/src/js/aui/internal/select/option.js +3 -3
- package/src/js/aui/internal/select/suggestion-model.js +1 -1
- package/src/js/aui/internal/select/suggestions-model.js +4 -5
- package/src/js/aui/internal/select/suggestions-view.js +17 -12
- package/src/js/aui/internal/state.js +2 -3
- package/src/js/aui/is-clipped.js +2 -2
- package/src/js/aui/key-code.js +1 -1
- package/src/js/aui/label.js +6 -6
- package/src/js/aui/layer.js +100 -98
- package/src/js/aui/messages.js +51 -38
- package/src/js/aui/navigation.js +7 -9
- package/src/js/aui/on-text-resize.js +7 -5
- package/src/js/aui/params.js +11 -8
- package/src/js/aui/polyfills/custom-event.js +7 -7
- package/src/js/aui/polyfills/placeholder.js +4 -4
- package/src/js/aui/populate-parameters.js +4 -4
- package/src/js/aui/progress-indicator.js +35 -27
- package/src/js/aui/progressive-data-set.js +13 -8
- package/src/js/aui/query-input.js +1 -1
- package/src/js/aui/restful-table/class-names.js +1 -1
- package/src/js/aui/restful-table/data-keys.js +1 -1
- package/src/js/aui/restful-table/edit-row.js +63 -63
- package/src/js/aui/restful-table/entry-model.js +6 -13
- package/src/js/aui/restful-table/event-handlers.js +4 -8
- package/src/js/aui/restful-table/event-names.js +1 -1
- package/src/js/aui/restful-table/row.js +41 -23
- package/src/js/aui/restful-table.js +101 -72
- package/src/js/aui/result-set.js +5 -5
- package/src/js/aui/results-list.js +3 -3
- package/src/js/aui/select.js +65 -49
- package/src/js/aui/select2.js +14 -6
- package/src/js/aui/sidebar.js +81 -49
- package/src/js/aui/spin.js +61 -49
- package/src/js/aui/spinner.js +11 -12
- package/src/js/aui/tables-sortable.js +21 -10
- package/src/js/aui/tabs.js +108 -77
- package/src/js/aui/to-init.js +1 -1
- package/src/js/aui/toggle.js +55 -43
- package/src/js/aui/tooltip.js +19 -15
- package/src/js/aui/trigger.js +20 -18
- package/src/js/aui/truncating-progressive-data-set.js +1 -1
- package/src/js/aui/unbind-text-resize.js +1 -1
- package/src/js/aui/unique-id.js +1 -1
- package/src/js/aui/when-i-type.js +66 -39
- package/src/js/aui-css-deprecations.js +48 -48
- package/src/js/jquery/jquery.hotkeys.js +124 -49
- package/src/js/jquery/jquery.moveto.js +18 -12
- package/src/less/adg-fancy-file-input.less +2 -3
- package/src/less/adg-header-quicksearch.less +4 -1
- package/src/less/adg-iconfont.less +242 -242
- package/src/less/adgs-icons.less +262 -262
- package/src/less/aui-appheader.less +10 -5
- package/src/less/aui-buttons.less +6 -5
- package/src/less/aui-date-picker.less +9 -6
- package/src/less/aui-experimental-expander.less +8 -8
- package/src/less/aui-experimental-labels.less +4 -3
- package/src/less/aui-experimental-progress-indicator.less +10 -4
- package/src/less/aui-experimental-progress-tracker.less +9 -6
- package/src/less/aui-experimental-restfultable.less +11 -3
- package/src/less/aui-experimental-tables-sortable.less +5 -3
- package/src/less/aui-link.less +0 -1
- package/src/less/aui-lozenge.less +6 -3
- package/src/less/aui-navigation.less +13 -13
- package/src/less/aui-page-layout.less +3 -4
- package/src/less/aui-page-typography.less +8 -3
- package/src/less/aui-reset.less +22 -6
- package/src/less/aui-select2.less +9 -7
- package/src/less/aui-sidebar-badges.less +1 -2
- package/src/less/aui-sidebar-config.less +7 -2
- package/src/less/aui-sidebar-grouping.less +16 -6
- package/src/less/aui-sidebar-navigation.less +7 -5
- package/src/less/aui-sidebar-skeleton.less +4 -3
- package/src/less/aui-skip-link.less +2 -1
- package/src/less/aui-spinner.less +2 -2
- package/src/less/aui-toggle.less +2 -2
- package/src/less/aui-toolbar2.less +1 -1
- package/src/less/checkbox-multiselect.less +13 -13
- package/src/less/dialog.less +3 -3
- package/src/less/dialog2.less +12 -11
- package/src/less/dropdown2-temp.css +4 -4
- package/src/less/dropdown2.less +3 -3
- package/src/less/form-notification.less +10 -6
- package/src/less/forms-current.less +6 -5
- package/src/less/forms-legacy.less +4 -2
- package/src/less/forms-radios-and-checkboxes.less +9 -11
- package/src/less/forms.less +2 -4
- package/src/less/iconfont-mixin.less +7 -4
- package/src/less/imports/aui-theme/adg/adg-colors.less +40 -40
- package/src/less/imports/aui-theme/adg/adg-neutral-dark.less +20 -20
- package/src/less/imports/aui-theme/adg/adg-neutral-light.less +20 -20
- package/src/less/imports/aui-theme/components/buttons.less +5 -1
- package/src/less/imports/aui-theme/components/dropdown.less +3 -1
- package/src/less/imports/aui-theme/components/form-notification.less +2 -1
- package/src/less/imports/aui-theme/components/forms.less +16 -1
- package/src/less/imports/aui-theme/components/inline-dialog2.less +1 -1
- package/src/less/imports/aui-theme/components/navigation.less +3 -3
- package/src/less/imports/aui-theme/components/progress-tracker.less +6 -2
- package/src/less/imports/aui-theme/components/tables.less +3 -2
- package/src/less/imports/aui-theme/components/toggle.less +8 -3
- package/src/less/imports/aui-theme/core/colors.less +12 -4
- package/src/less/imports/aui-theme/core/icons.less +22 -22
- package/src/less/imports/aui-theme/core/text.less +6 -3
- package/src/less/imports/mixins/dropdown2-trigger-chevron-icon.less +0 -1
- package/src/less/imports/mixins/focus.less +12 -4
- package/src/less/imports/mixins/media-queries.less +2 -2
- package/src/less/imports/mixins/shadows.less +3 -1
- package/src/less/imports/mixins/tab-indicator.less +2 -2
- package/src/less/imports/mixins.less +11 -4
- package/src/less/inline-dialog.less +21 -19
- package/src/less/layer.less +0 -2
- package/src/less/messages.less +2 -1
- package/src/less/single-select.less +14 -9
- package/src/less/tables.less +3 -2
- package/src/less/tabs.less +4 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import $ from './jquery';
|
|
2
2
|
import globalize from './internal/globalize';
|
|
3
3
|
|
|
4
|
-
function containDropdown
|
|
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
|
|
package/src/js/aui/contains.js
CHANGED
package/src/js/aui/cookie.js
CHANGED
|
@@ -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
|
|
10
|
+
function regexEscape(str) {
|
|
11
11
|
return str.replace(REGEX_SPECIAL_CHARS, '\\$&');
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
function getValueFromConglomerate
|
|
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
|
|
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
|
|
41
|
+
function unescapeCookieValue(name) {
|
|
42
42
|
return name.replace(UNESCAPE_COOKIE_REGEX, '');
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
function getCookieValue
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,13 +21,13 @@ const makePopup = ({horizontalAlignment, datePickerUUID}) => {
|
|
|
21
21
|
return popup;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const makeConfig = ({dateFormat, $field, onSelect, hide, onChangeMonthYear}) => ({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
const makeConfig = ({ dateFormat, $field, onSelect, hide, onChangeMonthYear }) => ({
|
|
25
|
+
dateFormat: dateFormat,
|
|
26
|
+
defaultDate: $field.val(),
|
|
27
|
+
maxDate: $field.attr('max'),
|
|
28
|
+
minDate: $field.attr('min'),
|
|
29
|
+
nextText: '>',
|
|
30
|
+
onSelect: function (dateText) {
|
|
31
31
|
$field.val(dateText);
|
|
32
32
|
$field.trigger('change');
|
|
33
33
|
hide();
|
|
@@ -35,10 +35,10 @@ const makeConfig = ({dateFormat, $field, onSelect, hide, onChangeMonthYear}) =>
|
|
|
35
35
|
onSelect && onSelect.call(this, dateText);
|
|
36
36
|
},
|
|
37
37
|
onChangeMonthYear,
|
|
38
|
-
|
|
38
|
+
prevText: '<',
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
const initCalendar = ({config, popupContents, getCalendarNode, hint}) => {
|
|
41
|
+
const initCalendar = ({ config, popupContents, getCalendarNode, hint }) => {
|
|
42
42
|
const calendar = $(getCalendarNode());
|
|
43
43
|
|
|
44
44
|
calendar.datepicker(config);
|
|
@@ -59,7 +59,6 @@ const makeDefaultPopupController = ($field, datePickerUUID) => {
|
|
|
59
59
|
let parentPopup;
|
|
60
60
|
let isTrackingDatePickerFocus = false; // used to prevent multiple bindings of handleDatePickerFocus within handleFieldBlur
|
|
61
61
|
|
|
62
|
-
|
|
63
62
|
const $body = $('body');
|
|
64
63
|
|
|
65
64
|
const handleDatePickerFocus = (event) => {
|
|
@@ -81,33 +80,33 @@ const makeDefaultPopupController = ($field, datePickerUUID) => {
|
|
|
81
80
|
|
|
82
81
|
const handleFieldBlur = () => {
|
|
83
82
|
// Trigger blur if event is keydown and esc OR is focusout.
|
|
84
|
-
if (!
|
|
83
|
+
if (!isTrackingDatePickerFocus) {
|
|
85
84
|
$body.on('focus blur click mousedown', '*', handleDatePickerFocus);
|
|
86
85
|
isTrackingDatePickerFocus = true;
|
|
87
86
|
}
|
|
88
87
|
};
|
|
89
88
|
|
|
90
|
-
|
|
91
89
|
const createPolyfill = function () {
|
|
92
90
|
// bind additional field processing events
|
|
93
91
|
$body.on('keydown', handleDatePickerFocus);
|
|
94
92
|
$field.on('focusout keydown', handleFieldBlur);
|
|
95
|
-
|
|
96
|
-
|
|
97
93
|
};
|
|
98
94
|
|
|
99
|
-
const getPopupContents = ({$field}) => {
|
|
100
|
-
const calculateHorizontalAlignment = $field => {
|
|
95
|
+
const getPopupContents = ({ $field }) => {
|
|
96
|
+
const calculateHorizontalAlignment = ($field) => {
|
|
101
97
|
let inLeftHalf = $field.offset().left < window.innerWidth / 2;
|
|
102
98
|
return inLeftHalf ? 'left' : 'right';
|
|
103
99
|
};
|
|
104
100
|
|
|
105
|
-
popup = makePopup({
|
|
101
|
+
popup = makePopup({
|
|
102
|
+
horizontalAlignment: calculateHorizontalAlignment($field),
|
|
103
|
+
datePickerUUID,
|
|
104
|
+
});
|
|
106
105
|
|
|
107
106
|
parentPopup = $field.closest('aui-inline-dialog').get(0);
|
|
108
107
|
if (parentPopup) {
|
|
109
108
|
parentPopup._datePickerPopup = popup; // AUI-2696 - hackish coupling to control inline-dialog close behaviour.
|
|
110
|
-
$(parentPopup).on('aui-hide', e => {
|
|
109
|
+
$(parentPopup).on('aui-hide', (e) => {
|
|
111
110
|
if (isTrackingDatePickerFocus) {
|
|
112
111
|
e.preventDefault();
|
|
113
112
|
}
|
|
@@ -127,7 +126,7 @@ const makeDefaultPopupController = ($field, datePickerUUID) => {
|
|
|
127
126
|
|
|
128
127
|
const handleFieldFocus = () => {
|
|
129
128
|
if (!popup.get(0).open) {
|
|
130
|
-
showDatePicker()
|
|
129
|
+
showDatePicker();
|
|
131
130
|
}
|
|
132
131
|
};
|
|
133
132
|
|
|
@@ -144,8 +143,7 @@ const makeDefaultPopupController = ($field, datePickerUUID) => {
|
|
|
144
143
|
setTimeout(popup.refresh, 0);
|
|
145
144
|
};
|
|
146
145
|
|
|
147
|
-
const getCalendarNode = () =>
|
|
148
|
-
popup.get(0).childNodes[0];
|
|
146
|
+
const getCalendarNode = () => popup.get(0).childNodes[0];
|
|
149
147
|
|
|
150
148
|
const destroyPolyfill = () => {
|
|
151
149
|
// goodbye, cruel world!
|
|
@@ -167,8 +165,8 @@ const makeDefaultPopupController = ($field, datePickerUUID) => {
|
|
|
167
165
|
handleChangeMonthYear,
|
|
168
166
|
getCalendarNode,
|
|
169
167
|
destroyPolyfill,
|
|
170
|
-
createPolyfill
|
|
171
|
-
}
|
|
168
|
+
createPolyfill,
|
|
169
|
+
};
|
|
172
170
|
};
|
|
173
171
|
|
|
174
172
|
const initPolyfill = function (datePicker) {
|
|
@@ -211,9 +209,9 @@ const initPolyfill = function (datePicker) {
|
|
|
211
209
|
// mutate datePicker public API
|
|
212
210
|
// -----------------------------------------------------------------
|
|
213
211
|
{
|
|
214
|
-
const withCalendar = callback => value => {
|
|
212
|
+
const withCalendar = (callback) => (value) => {
|
|
215
213
|
if (typeof calendar !== 'undefined') {
|
|
216
|
-
return callback(value)
|
|
214
|
+
return callback(value);
|
|
217
215
|
}
|
|
218
216
|
};
|
|
219
217
|
|
|
@@ -254,26 +252,27 @@ const initPolyfill = function (datePicker) {
|
|
|
254
252
|
|
|
255
253
|
delete datePicker.show;
|
|
256
254
|
delete datePicker.hide;
|
|
257
|
-
|
|
258
255
|
};
|
|
259
256
|
|
|
260
|
-
datePicker.setDate = withCalendar(value => {
|
|
261
|
-
calendar.datepicker('setDate', value)
|
|
257
|
+
datePicker.setDate = withCalendar((value) => {
|
|
258
|
+
calendar.datepicker('setDate', value);
|
|
262
259
|
});
|
|
263
260
|
|
|
264
261
|
datePicker.getDate = withCalendar(() => calendar.datepicker('getDate'));
|
|
265
262
|
|
|
266
|
-
datePicker.setMin = withCalendar(value =>
|
|
263
|
+
datePicker.setMin = withCalendar((value) =>
|
|
264
|
+
calendar.datepicker('option', 'minDate', value)
|
|
265
|
+
);
|
|
267
266
|
|
|
268
|
-
datePicker.setMax = withCalendar(value =>
|
|
267
|
+
datePicker.setMax = withCalendar((value) =>
|
|
268
|
+
calendar.datepicker('option', 'maxDate', value)
|
|
269
|
+
);
|
|
269
270
|
}
|
|
270
271
|
|
|
271
|
-
|
|
272
272
|
// -----------------------------------------------------------------
|
|
273
273
|
// polyfill bootstrap ----------------------------------------------
|
|
274
274
|
// -----------------------------------------------------------------
|
|
275
275
|
|
|
276
|
-
|
|
277
276
|
if (!(options.languageCode in DatePicker.prototype.localisations)) {
|
|
278
277
|
options.languageCode = '';
|
|
279
278
|
}
|
|
@@ -283,14 +282,16 @@ const initPolyfill = function (datePicker) {
|
|
|
283
282
|
|
|
284
283
|
if (typeof calendar === 'undefined') {
|
|
285
284
|
if (typeof $field.attr('step') !== 'undefined') {
|
|
286
|
-
logger.log(
|
|
285
|
+
logger.log(
|
|
286
|
+
'WARNING: The date picker polyfill currently does not support the step attribute!'
|
|
287
|
+
);
|
|
287
288
|
}
|
|
288
289
|
const baseConfig = makeConfig({
|
|
289
290
|
dateFormat: options.dateFormat,
|
|
290
291
|
$field,
|
|
291
292
|
onSelect: options.onSelect,
|
|
292
293
|
hide: datePicker.hide,
|
|
293
|
-
onChangeMonthYear: handleChangeMonthYear
|
|
294
|
+
onChangeMonthYear: handleChangeMonthYear,
|
|
294
295
|
});
|
|
295
296
|
const config = $.extend(undefined, baseConfig, i18nConfig);
|
|
296
297
|
|
|
@@ -302,16 +303,15 @@ const initPolyfill = function (datePicker) {
|
|
|
302
303
|
|
|
303
304
|
calendar = initCalendar({
|
|
304
305
|
config,
|
|
305
|
-
popupContents: getPopupContents({$field}),
|
|
306
|
+
popupContents: getPopupContents({ $field }),
|
|
306
307
|
getCalendarNode,
|
|
307
|
-
hint: options.hint
|
|
308
|
+
hint: options.hint,
|
|
308
309
|
});
|
|
309
310
|
|
|
310
311
|
createPolyfill();
|
|
311
312
|
|
|
312
313
|
$field.on('propertychange keyup input paste', handleFieldUpdate);
|
|
313
314
|
|
|
314
|
-
|
|
315
315
|
// bind attribute handlers to account for html5 attributes
|
|
316
316
|
attributeHandler = new MutationObserver(function (mutationsList) {
|
|
317
317
|
mutationsList.forEach(function (mutation) {
|
|
@@ -322,7 +322,7 @@ const initPolyfill = function (datePicker) {
|
|
|
322
322
|
}
|
|
323
323
|
});
|
|
324
324
|
});
|
|
325
|
-
attributeHandler.observe($field.get(0), {attributes: true});
|
|
325
|
+
attributeHandler.observe($field.get(0), { attributes: true });
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
// bind what we need to start off with
|
|
@@ -368,17 +368,14 @@ function DatePicker(field, baseOptions) {
|
|
|
368
368
|
const browserDoesNotSupportDateField = !DatePicker.prototype.browserSupportsDateField;
|
|
369
369
|
const shouldOverrideBrowserDefault = options.overrideBrowserDefault !== false;
|
|
370
370
|
|
|
371
|
-
if (
|
|
372
|
-
browserDoesNotSupportDateField ||
|
|
373
|
-
shouldOverrideBrowserDefault
|
|
374
|
-
) {
|
|
371
|
+
if (browserDoesNotSupportDateField || shouldOverrideBrowserDefault) {
|
|
375
372
|
initPolyfill(datePicker);
|
|
376
373
|
}
|
|
377
374
|
},
|
|
378
|
-
reconfigure: newOptions => {
|
|
375
|
+
reconfigure: (newOptions) => {
|
|
379
376
|
options = $.extend(undefined, DatePicker.prototype.defaultOptions, newOptions);
|
|
380
377
|
datePicker.reset();
|
|
381
|
-
}
|
|
378
|
+
},
|
|
382
379
|
};
|
|
383
380
|
|
|
384
381
|
datePicker.reconfigure(baseOptions);
|
|
@@ -396,14 +393,17 @@ DatePicker.prototype.defaultOptions = {
|
|
|
396
393
|
overrideBrowserDefault: false,
|
|
397
394
|
firstDay: -1,
|
|
398
395
|
languageCode: $('html').attr('lang') || 'en-AU',
|
|
399
|
-
dateFormat: datepickerUI.W3C // same as $.datepicker.ISO_8601
|
|
396
|
+
dateFormat: datepickerUI.W3C, // same as $.datepicker.ISO_8601
|
|
400
397
|
};
|
|
401
398
|
|
|
402
399
|
function CalendarWidget(calendarNode, baseOptions) {
|
|
403
|
-
const options = $.extend(
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
400
|
+
const options = $.extend(
|
|
401
|
+
{
|
|
402
|
+
nextText: '>',
|
|
403
|
+
prevText: '<',
|
|
404
|
+
},
|
|
405
|
+
baseOptions
|
|
406
|
+
);
|
|
407
407
|
|
|
408
408
|
const $calendarNode = $(calendarNode);
|
|
409
409
|
|
|
@@ -427,7 +427,7 @@ function CalendarWidget(calendarNode, baseOptions) {
|
|
|
427
427
|
$result.datepicker('destroy');
|
|
428
428
|
};
|
|
429
429
|
|
|
430
|
-
return $result
|
|
430
|
+
return $result;
|
|
431
431
|
}
|
|
432
432
|
|
|
433
433
|
// adapted from the jQuery UI Datepicker widget (v1.8.16), with the following changes:
|
|
@@ -457,23 +457,28 @@ for (langCode in langs) {
|
|
|
457
457
|
*/
|
|
458
458
|
|
|
459
459
|
DatePicker.prototype.localisations = {
|
|
460
|
-
|
|
460
|
+
dayNames: [
|
|
461
|
+
I18n.getText('ajs.datepicker.localisations.day-names.sunday'),
|
|
461
462
|
I18n.getText('ajs.datepicker.localisations.day-names.monday'),
|
|
462
463
|
I18n.getText('ajs.datepicker.localisations.day-names.tuesday'),
|
|
463
464
|
I18n.getText('ajs.datepicker.localisations.day-names.wednesday'),
|
|
464
465
|
I18n.getText('ajs.datepicker.localisations.day-names.thursday'),
|
|
465
466
|
I18n.getText('ajs.datepicker.localisations.day-names.friday'),
|
|
466
|
-
I18n.getText('ajs.datepicker.localisations.day-names.saturday')
|
|
467
|
-
|
|
467
|
+
I18n.getText('ajs.datepicker.localisations.day-names.saturday'),
|
|
468
|
+
],
|
|
469
|
+
dayNamesMin: [
|
|
470
|
+
I18n.getText('ajs.datepicker.localisations.day-names-min.sunday'),
|
|
468
471
|
I18n.getText('ajs.datepicker.localisations.day-names-min.monday'),
|
|
469
472
|
I18n.getText('ajs.datepicker.localisations.day-names-min.tuesday'),
|
|
470
473
|
I18n.getText('ajs.datepicker.localisations.day-names-min.wednesday'),
|
|
471
474
|
I18n.getText('ajs.datepicker.localisations.day-names-min.thursday'),
|
|
472
475
|
I18n.getText('ajs.datepicker.localisations.day-names-min.friday'),
|
|
473
|
-
I18n.getText('ajs.datepicker.localisations.day-names-min.saturday')
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
476
|
+
I18n.getText('ajs.datepicker.localisations.day-names-min.saturday'),
|
|
477
|
+
],
|
|
478
|
+
firstDay: I18n.getText('ajs.datepicker.localisations.first-day'),
|
|
479
|
+
isRTL: I18n.getText('ajs.datepicker.localisations.is-RTL') === 'true',
|
|
480
|
+
monthNames: [
|
|
481
|
+
I18n.getText('ajs.datepicker.localisations.month-names.january'),
|
|
477
482
|
I18n.getText('ajs.datepicker.localisations.month-names.february'),
|
|
478
483
|
I18n.getText('ajs.datepicker.localisations.month-names.march'),
|
|
479
484
|
I18n.getText('ajs.datepicker.localisations.month-names.april'),
|
|
@@ -484,29 +489,31 @@ DatePicker.prototype.localisations = {
|
|
|
484
489
|
I18n.getText('ajs.datepicker.localisations.month-names.september'),
|
|
485
490
|
I18n.getText('ajs.datepicker.localisations.month-names.october'),
|
|
486
491
|
I18n.getText('ajs.datepicker.localisations.month-names.november'),
|
|
487
|
-
I18n.getText('ajs.datepicker.localisations.month-names.december')
|
|
488
|
-
|
|
489
|
-
|
|
492
|
+
I18n.getText('ajs.datepicker.localisations.month-names.december'),
|
|
493
|
+
],
|
|
494
|
+
showMonthAfterYear:
|
|
495
|
+
I18n.getText('ajs.datepicker.localisations.show-month-after-year') === 'true',
|
|
496
|
+
yearSuffix: I18n.getText('ajs.datepicker.localisations.year-suffix'),
|
|
490
497
|
};
|
|
491
498
|
|
|
492
|
-
|
|
493
499
|
// -------------------------------------------------------------------------
|
|
494
500
|
// finally, integrate with jQuery for convenience --------------------------
|
|
495
501
|
// -------------------------------------------------------------------------
|
|
496
502
|
const key = 'aui-datepicker';
|
|
497
503
|
|
|
498
|
-
const makePlugin = (WidgetConstructor) =>
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
504
|
+
const makePlugin = (WidgetConstructor) =>
|
|
505
|
+
function (options) {
|
|
506
|
+
let picker = this.data(key);
|
|
507
|
+
if (!picker) {
|
|
508
|
+
picker = new WidgetConstructor(this, options);
|
|
509
|
+
this.data(key, picker);
|
|
510
|
+
} else if (typeof options === 'object') {
|
|
511
|
+
picker.reconfigure(options);
|
|
512
|
+
} else if (options === 'destroy') {
|
|
513
|
+
picker.destroy();
|
|
514
|
+
}
|
|
515
|
+
return picker;
|
|
516
|
+
};
|
|
510
517
|
|
|
511
518
|
$.fn.datePicker = makePlugin(DatePicker);
|
|
512
519
|
globalize('DatePicker', DatePicker);
|
|
@@ -515,4 +522,4 @@ $.fn.calendarWidget = makePlugin(CalendarWidget);
|
|
|
515
522
|
globalize('CalendarWidget', CalendarWidget);
|
|
516
523
|
|
|
517
524
|
export default DatePicker;
|
|
518
|
-
export { CalendarWidget }
|
|
525
|
+
export { CalendarWidget };
|
package/src/js/aui/debounce.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
-
|