@atlassian/aui 9.12.6 → 9.12.7
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 +1 -1
- package/README.md +7 -9
- package/dist/aui/aui-css-deprecations.js.map +1 -1
- package/dist/aui/aui-prototyping-browserfocus.css +1 -1
- package/dist/aui/aui-prototyping-browserfocus.css.map +1 -1
- package/dist/aui/aui-prototyping-darkmode.css +1 -1
- package/dist/aui/aui-prototyping-darkmode.css.map +1 -1
- package/dist/aui/aui-prototyping-design-tokens-api-full.js +1 -1
- package/dist/aui/aui-prototyping-design-tokens-api-full.js.map +1 -1
- package/dist/aui/aui-prototyping-design-tokens-api.js +1 -1
- package/dist/aui/aui-prototyping-design-tokens-api.js.map +1 -1
- package/dist/aui/aui-prototyping-design-tokens-base-themes-css.css +2 -2
- package/dist/aui/aui-prototyping-design-tokens-base-themes-css.css.map +1 -1
- package/dist/aui/aui-prototyping-design-tokens-base-themes-css.js +1 -1
- package/dist/aui/aui-prototyping-design-tokens-base-themes.js +1 -1
- package/dist/aui/aui-prototyping-design-tokens-compatibility.css +1 -1
- package/dist/aui/aui-prototyping-design-tokens-compatibility.css.map +1 -1
- package/dist/aui/aui-prototyping.css +10 -10
- package/dist/aui/aui-prototyping.css.map +1 -1
- package/dist/aui/aui-prototyping.js +2 -2
- package/dist/aui/aui-prototyping.js.map +1 -1
- package/dist/aui/aui-prototyping.nodeps.css +10 -10
- package/dist/aui/aui-prototyping.nodeps.css.map +1 -1
- package/dist/aui/aui-prototyping.nodeps.js +2 -2
- package/dist/aui/aui-prototyping.nodeps.js.map +1 -1
- package/dist/aui/fonts/adgs-icons.eot +0 -0
- package/dist/aui/fonts/adgs-icons.ttf +0 -0
- package/dist/aui/fonts/adgs-icons.woff +0 -0
- package/entry/aui.batch.components.js +23 -23
- package/entry/aui.batch.page.js +3 -3
- package/entry/aui.batch.patterns.js +20 -20
- package/entry/aui.batch.prototyping.js +3 -11
- 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/entry/styles/aui-design-tokens-compatibility.less +114 -115
- package/package.json +2 -2
- package/src/js/aui/alphanum.js +1 -1
- package/src/js/aui/avatar-badged.js +4 -5
- package/src/js/aui/avatar-group.js +58 -28
- package/src/js/aui/avatar.js +16 -14
- package/src/js/aui/banner.js +3 -2
- package/src/js/aui/blanket.js +11 -14
- 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 +89 -68
- package/src/js/aui/debounce.js +5 -8
- package/src/js/aui/design-tokens/design-tokens-full.js +4 -13
- package/src/js/aui/design-tokens/design-tokens-init.js +1 -3
- package/src/js/aui/design-tokens/design-tokens-testing-theme.js +9 -15
- package/src/js/aui/design-tokens/design-tokens.js +2 -4
- package/src/js/aui/dialog.js +206 -172
- package/src/js/aui/dialog2.js +36 -25
- package/src/js/aui/dropdown2.js +221 -189
- 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 +15 -13
- package/src/js/aui/flag.js +24 -22
- package/src/js/aui/focus-manager.js +20 -21
- package/src/js/aui/form-notification.js +16 -15
- 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 +12 -13
- 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 +6 -13
- 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 +40 -33
- package/src/js/aui/internal/a11y/focusable-query.js +2 -4
- 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 +6 -7
- 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 +54 -32
- 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 +12 -5
- package/src/js/aui/internal/has-touch.js +1 -2
- package/src/js/aui/internal/header/create-header.js +54 -30
- package/src/js/aui/internal/i18n/aui.js +9 -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 +101 -89
- package/src/js/aui/messages.js +67 -43
- 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 +9 -9
- 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 +72 -51
- package/src/js/aui/select2.js +16 -8
- package/src/js/aui/sidebar.js +81 -51
- 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 +34 -33
- package/src/js/aui/trigger.js +21 -19
- 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 +67 -40
- package/src/js/aui-css-deprecations.js +52 -51
- 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 +5 -2
- package/src/less/adg-iconfont.less +242 -242
- package/src/less/adgs-icons.less +262 -262
- package/src/less/aui-appheader.less +10 -6
- package/src/less/aui-avatars.less +1 -1
- package/src/less/aui-banner.less +2 -1
- package/src/less/aui-buttons.less +6 -5
- package/src/less/aui-dark-mode.less +1 -1
- package/src/less/aui-date-picker.less +9 -6
- package/src/less/aui-experimental-expander.less +3 -3
- package/src/less/aui-experimental-labels.less +1 -1
- 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-experimental-tooltip.less +1 -1
- package/src/less/aui-link.less +0 -1
- package/src/less/aui-lozenge.less +6 -3
- package/src/less/aui-navigation.less +16 -14
- 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 +12 -9
- 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 +22 -6
- package/src/less/aui-sidebar-navigation.less +7 -5
- package/src/less/aui-sidebar-skeleton.less +12 -7
- package/src/less/aui-skip-link.less +2 -1
- package/src/less/aui-spinner.less +2 -2
- package/src/less/aui-toggle.less +8 -4
- 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 +11 -10
- package/src/less/dropdown2-temp.css +4 -4
- package/src/less/dropdown2.less +4 -4
- package/src/less/flag.less +2 -2
- package/src/less/form-notification.less +10 -6
- package/src/less/forms-current.less +16 -18
- package/src/less/forms-legacy.less +4 -2
- package/src/less/forms-radios-and-checkboxes.less +18 -16
- 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 +7 -1
- package/src/less/imports/aui-theme/components/dropdown.less +3 -1
- package/src/less/imports/aui-theme/components/flag.less +1 -1
- package/src/less/imports/aui-theme/components/form-notification.less +2 -1
- package/src/less/imports/aui-theme/components/forms.less +8 -3
- package/src/less/imports/aui-theme/components/inline-dialog2.less +1 -1
- package/src/less/imports/aui-theme/components/navigation.less +6 -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 +2 -2
- 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/aui-theme/theme.less +1 -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 +15 -10
- package/src/less/tables.less +3 -2
- package/src/less/tabs.less +4 -3
|
@@ -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 = ({
|
|
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 (!
|
|
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({
|
|
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 =>
|
|
271
|
+
datePicker.setMin = withCalendar((value) =>
|
|
272
|
+
calendar.datepicker('option', 'minDate', value)
|
|
273
|
+
);
|
|
267
274
|
|
|
268
|
-
datePicker.setMax = withCalendar(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(
|
|
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
|
|
@@ -372,17 +380,14 @@ function DatePicker(field, baseOptions) {
|
|
|
372
380
|
const browserDoesNotSupportDateField = !DatePicker.prototype.browserSupportsDateField;
|
|
373
381
|
const shouldOverrideBrowserDefault = options.overrideBrowserDefault !== false;
|
|
374
382
|
|
|
375
|
-
if (
|
|
376
|
-
browserDoesNotSupportDateField ||
|
|
377
|
-
shouldOverrideBrowserDefault
|
|
378
|
-
) {
|
|
383
|
+
if (browserDoesNotSupportDateField || shouldOverrideBrowserDefault) {
|
|
379
384
|
initPolyfill(datePicker);
|
|
380
385
|
}
|
|
381
386
|
},
|
|
382
|
-
reconfigure: newOptions => {
|
|
387
|
+
reconfigure: (newOptions) => {
|
|
383
388
|
options = $.extend(undefined, DatePicker.prototype.defaultOptions, newOptions);
|
|
384
389
|
datePicker.reset();
|
|
385
|
-
}
|
|
390
|
+
},
|
|
386
391
|
};
|
|
387
392
|
|
|
388
393
|
datePicker.reconfigure(baseOptions);
|
|
@@ -400,14 +405,17 @@ DatePicker.prototype.defaultOptions = {
|
|
|
400
405
|
overrideBrowserDefault: false,
|
|
401
406
|
firstDay: -1,
|
|
402
407
|
languageCode: $('html').attr('lang') || 'en-AU',
|
|
403
|
-
dateFormat: datepickerUI.W3C // same as $.datepicker.ISO_8601
|
|
408
|
+
dateFormat: datepickerUI.W3C, // same as $.datepicker.ISO_8601
|
|
404
409
|
};
|
|
405
410
|
|
|
406
411
|
function CalendarWidget(calendarNode, baseOptions) {
|
|
407
|
-
const options = $.extend(
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
412
|
+
const options = $.extend(
|
|
413
|
+
{
|
|
414
|
+
nextText: '>',
|
|
415
|
+
prevText: '<',
|
|
416
|
+
},
|
|
417
|
+
baseOptions
|
|
418
|
+
);
|
|
411
419
|
|
|
412
420
|
const $calendarNode = $(calendarNode);
|
|
413
421
|
|
|
@@ -431,7 +439,7 @@ function CalendarWidget(calendarNode, baseOptions) {
|
|
|
431
439
|
$result.datepicker('destroy');
|
|
432
440
|
};
|
|
433
441
|
|
|
434
|
-
return $result
|
|
442
|
+
return $result;
|
|
435
443
|
}
|
|
436
444
|
|
|
437
445
|
// adapted from the jQuery UI Datepicker widget (v1.8.16), with the following changes:
|
|
@@ -461,23 +469,28 @@ for (langCode in langs) {
|
|
|
461
469
|
*/
|
|
462
470
|
|
|
463
471
|
DatePicker.prototype.localisations = {
|
|
464
|
-
|
|
472
|
+
dayNames: [
|
|
473
|
+
I18n.getText('ajs.datepicker.localisations.day-names.sunday'),
|
|
465
474
|
I18n.getText('ajs.datepicker.localisations.day-names.monday'),
|
|
466
475
|
I18n.getText('ajs.datepicker.localisations.day-names.tuesday'),
|
|
467
476
|
I18n.getText('ajs.datepicker.localisations.day-names.wednesday'),
|
|
468
477
|
I18n.getText('ajs.datepicker.localisations.day-names.thursday'),
|
|
469
478
|
I18n.getText('ajs.datepicker.localisations.day-names.friday'),
|
|
470
|
-
I18n.getText('ajs.datepicker.localisations.day-names.saturday')
|
|
471
|
-
|
|
479
|
+
I18n.getText('ajs.datepicker.localisations.day-names.saturday'),
|
|
480
|
+
],
|
|
481
|
+
dayNamesMin: [
|
|
482
|
+
I18n.getText('ajs.datepicker.localisations.day-names-min.sunday'),
|
|
472
483
|
I18n.getText('ajs.datepicker.localisations.day-names-min.monday'),
|
|
473
484
|
I18n.getText('ajs.datepicker.localisations.day-names-min.tuesday'),
|
|
474
485
|
I18n.getText('ajs.datepicker.localisations.day-names-min.wednesday'),
|
|
475
486
|
I18n.getText('ajs.datepicker.localisations.day-names-min.thursday'),
|
|
476
487
|
I18n.getText('ajs.datepicker.localisations.day-names-min.friday'),
|
|
477
|
-
I18n.getText('ajs.datepicker.localisations.day-names-min.saturday')
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
488
|
+
I18n.getText('ajs.datepicker.localisations.day-names-min.saturday'),
|
|
489
|
+
],
|
|
490
|
+
firstDay: I18n.getText('ajs.datepicker.localisations.first-day'),
|
|
491
|
+
isRTL: I18n.getText('ajs.datepicker.localisations.is-RTL') === 'true',
|
|
492
|
+
monthNames: [
|
|
493
|
+
I18n.getText('ajs.datepicker.localisations.month-names.january'),
|
|
481
494
|
I18n.getText('ajs.datepicker.localisations.month-names.february'),
|
|
482
495
|
I18n.getText('ajs.datepicker.localisations.month-names.march'),
|
|
483
496
|
I18n.getText('ajs.datepicker.localisations.month-names.april'),
|
|
@@ -488,29 +501,37 @@ DatePicker.prototype.localisations = {
|
|
|
488
501
|
I18n.getText('ajs.datepicker.localisations.month-names.september'),
|
|
489
502
|
I18n.getText('ajs.datepicker.localisations.month-names.october'),
|
|
490
503
|
I18n.getText('ajs.datepicker.localisations.month-names.november'),
|
|
491
|
-
I18n.getText('ajs.datepicker.localisations.month-names.december')
|
|
492
|
-
|
|
493
|
-
|
|
504
|
+
I18n.getText('ajs.datepicker.localisations.month-names.december'),
|
|
505
|
+
],
|
|
506
|
+
showMonthAfterYear:
|
|
507
|
+
I18n.getText('ajs.datepicker.localisations.show-month-after-year') === 'true',
|
|
508
|
+
yearSuffix: I18n.getText('ajs.datepicker.localisations.year-suffix'),
|
|
494
509
|
};
|
|
495
510
|
|
|
511
|
+
// TODO Workaround a localisation issue in WRM related to empty strings not being considered as valid localisation values
|
|
512
|
+
// TODO Remove once this WRM PR is pulled in via platform (most probably) 8: https://bitbucket.org/atlassian/atlassian-plugins-webresource/pull-requests/1761/overview
|
|
513
|
+
if (DatePicker.prototype.localisations.yearSuffix === 'ajs.datepicker.localisations.year-suffix') {
|
|
514
|
+
DatePicker.prototype.localisations.yearSuffix = '';
|
|
515
|
+
}
|
|
496
516
|
|
|
497
517
|
// -------------------------------------------------------------------------
|
|
498
518
|
// finally, integrate with jQuery for convenience --------------------------
|
|
499
519
|
// -------------------------------------------------------------------------
|
|
500
520
|
const key = 'aui-datepicker';
|
|
501
521
|
|
|
502
|
-
const makePlugin = (WidgetConstructor) =>
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
522
|
+
const makePlugin = (WidgetConstructor) =>
|
|
523
|
+
function (options) {
|
|
524
|
+
let picker = this.data(key);
|
|
525
|
+
if (!picker) {
|
|
526
|
+
picker = new WidgetConstructor(this, options);
|
|
527
|
+
this.data(key, picker);
|
|
528
|
+
} else if (typeof options === 'object') {
|
|
529
|
+
picker.reconfigure(options);
|
|
530
|
+
} else if (options === 'destroy') {
|
|
531
|
+
picker.destroy();
|
|
532
|
+
}
|
|
533
|
+
return picker;
|
|
534
|
+
};
|
|
514
535
|
|
|
515
536
|
$.fn.datePicker = makePlugin(DatePicker);
|
|
516
537
|
globalize('DatePicker', DatePicker);
|
|
@@ -519,4 +540,4 @@ $.fn.calendarWidget = makePlugin(CalendarWidget);
|
|
|
519
540
|
globalize('CalendarWidget', CalendarWidget);
|
|
520
541
|
|
|
521
542
|
export default DatePicker;
|
|
522
|
-
export { CalendarWidget }
|
|
543
|
+
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
|
-
|
|
@@ -5,19 +5,10 @@ import globalize from '../internal/globalize';
|
|
|
5
5
|
import './design-tokens-init';
|
|
6
6
|
|
|
7
7
|
// Export for NPM bundle, for which Webpack automatically puts those functions under AJS.DesignTokens
|
|
8
|
-
export const {
|
|
9
|
-
setGlobalTheme,
|
|
10
|
-
token,
|
|
11
|
-
getTokenValue,
|
|
12
|
-
ThemeMutationObserver
|
|
13
|
-
} = Tokens;
|
|
8
|
+
export const { setGlobalTheme, token, getTokenValue, ThemeMutationObserver } = Tokens;
|
|
14
9
|
|
|
15
|
-
export const {
|
|
16
|
-
|
|
17
|
-
enableTestingTheme,
|
|
18
|
-
disableTestingTheme,
|
|
19
|
-
toggleTestingTheme
|
|
20
|
-
} = TestingTheme;
|
|
10
|
+
export const { setTestingThemeColor, enableTestingTheme, disableTestingTheme, toggleTestingTheme } =
|
|
11
|
+
TestingTheme;
|
|
21
12
|
|
|
22
13
|
// Export for p2-plugin bundle, where we need to do put those functions under AJS.DesignTokens manually
|
|
23
14
|
globalize('DesignTokens', {
|
|
@@ -29,5 +20,5 @@ globalize('DesignTokens', {
|
|
|
29
20
|
toggleTestingTheme,
|
|
30
21
|
enableTestingTheme,
|
|
31
22
|
disableTestingTheme,
|
|
32
|
-
setTestingThemeColor
|
|
23
|
+
setTestingThemeColor,
|
|
33
24
|
});
|
|
@@ -14,22 +14,22 @@ const testingThemeSelector =
|
|
|
14
14
|
* @param solidColor any valid CSS color, will be used to replace tokens
|
|
15
15
|
*/
|
|
16
16
|
(function generateTestingTheme() {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const initialComment =
|
|
18
|
+
'This theme is autogenerated using AJS.DesignTokens.generateTestingTheme().';
|
|
19
19
|
|
|
20
20
|
// If function called many times theme should be only added once
|
|
21
|
-
const isThemeAlreadyInitialised = !document.querySelector(testingThemeSelector)
|
|
21
|
+
const isThemeAlreadyInitialised = !document.querySelector(testingThemeSelector);
|
|
22
22
|
if (!isThemeAlreadyInitialised) {
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
// We use overridable test color declaration to make theme configurable
|
|
27
|
-
const colorDeclaration = `${testingColorVariableName}: ${defaultTestingColor}
|
|
28
|
-
const themeCSSDeclarations = Object.values(TokenNames)
|
|
29
|
-
|
|
27
|
+
const colorDeclaration = `${testingColorVariableName}: ${defaultTestingColor};`;
|
|
28
|
+
const themeCSSDeclarations = Object.values(TokenNames).map(
|
|
29
|
+
(token) => `\t${token}: var(${testingColorVariableName});`
|
|
30
|
+
);
|
|
30
31
|
const allDeclarations = [colorDeclaration, ...themeCSSDeclarations];
|
|
31
32
|
|
|
32
|
-
|
|
33
33
|
const themeCSS = `/* ${initialComment} */\n${testingThemeSelector} {\n${allDeclarations.join('\n')}\n}`;
|
|
34
34
|
|
|
35
35
|
const themeElement = document.createElement('style');
|
|
@@ -40,7 +40,7 @@ const testingThemeSelector =
|
|
|
40
40
|
if (head) {
|
|
41
41
|
head.appendChild(themeElement);
|
|
42
42
|
}
|
|
43
|
-
}()
|
|
43
|
+
})();
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Overrides default testing color by setting css variable. If no color passed, will revert to default.
|
|
@@ -71,7 +71,6 @@ function disableTestingTheme() {
|
|
|
71
71
|
* @param targetState Optional parameter. Allows to force specific state.
|
|
72
72
|
*/
|
|
73
73
|
function toggleTestingTheme(targetState) {
|
|
74
|
-
|
|
75
74
|
// If not passed, invert existing state
|
|
76
75
|
if (targetState == null) {
|
|
77
76
|
targetState = !isTestingThemeEnabled();
|
|
@@ -80,9 +79,4 @@ function toggleTestingTheme(targetState) {
|
|
|
80
79
|
targetState ? enableTestingTheme() : disableTestingTheme();
|
|
81
80
|
}
|
|
82
81
|
|
|
83
|
-
export {
|
|
84
|
-
setTestingThemeColor,
|
|
85
|
-
enableTestingTheme,
|
|
86
|
-
disableTestingTheme,
|
|
87
|
-
toggleTestingTheme
|
|
88
|
-
}
|
|
82
|
+
export { setTestingThemeColor, enableTestingTheme, disableTestingTheme, toggleTestingTheme };
|
|
@@ -4,11 +4,9 @@ import globalize from '../internal/globalize';
|
|
|
4
4
|
import './design-tokens-init';
|
|
5
5
|
|
|
6
6
|
// Export for NPM bundle, for which Webpack automatically puts those functions under AJS.DesignTokens
|
|
7
|
-
export const {
|
|
8
|
-
setGlobalTheme
|
|
9
|
-
} = Tokens;
|
|
7
|
+
export const { setGlobalTheme } = Tokens;
|
|
10
8
|
|
|
11
9
|
// Export for p2-plugin bundle, where we need to do put those functions under AJS.DesignTokens manually
|
|
12
10
|
globalize('DesignTokens', {
|
|
13
|
-
setGlobalTheme
|
|
11
|
+
setGlobalTheme,
|
|
14
12
|
});
|