@atlassian/aui 9.9.6 → 9.9.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 +2 -651
- package/dist/aui/aui-prototyping-browserfocus.css.map +1 -0
- package/dist/aui/aui-prototyping-darkmode.css +2 -285
- package/dist/aui/aui-prototyping-darkmode.css.map +1 -0
- 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 +2 -115
- package/dist/aui/aui-prototyping-design-tokens-compatibility.css.map +1 -0
- package/dist/aui/aui-prototyping.css +10 -10
- package/dist/aui/aui-prototyping.css.map +1 -1
- package/dist/aui/aui-prototyping.js +4 -4
- 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 +4 -4
- 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 +3 -7
- 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 +5 -4
- 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 +84 -69
- 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 +3 -5
- package/src/js/aui/design-tokens/design-tokens-testing-theme.js +12 -18
- 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 +14 -16
- package/src/js/aui/focus-manager.js +19 -18
- package/src/js/aui/form-notification.js +15 -14
- 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 +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 +40 -33
- 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 +54 -30
- package/src/js/aui/internal/i18n/aui.js +10 -6
- 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 +57 -41
- 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 +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 +35 -34
- 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 +52 -51
- 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 +11 -7
- 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 +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 +11 -8
- 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 +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 +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 +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 +6 -5
- 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 +5 -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 +20 -3
- 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/icons.less +22 -22
- package/src/less/imports/aui-theme/core/spaces.less +1 -1
- 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
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import $ from './jquery';
|
|
2
2
|
import Alignment from './internal/alignment';
|
|
3
3
|
import amdify from './internal/amdify';
|
|
4
|
-
import attributes, {setBooleanAttribute} from './internal/attributes';
|
|
4
|
+
import attributes, { setBooleanAttribute } from './internal/attributes';
|
|
5
5
|
import enforce from './internal/enforcer';
|
|
6
6
|
import globalize from './internal/globalize';
|
|
7
|
-
import layer, {EVENT_PREFIX} from './layer';
|
|
7
|
+
import layer, { EVENT_PREFIX } from './layer';
|
|
8
8
|
import skate from './internal/skate';
|
|
9
9
|
import state from './internal/state';
|
|
10
|
-
import {doIfTrigger, forEachTrigger, getTrigger, setTrigger} from './trigger';
|
|
11
|
-
import {ifGone} from './internal/elements';
|
|
10
|
+
import { doIfTrigger, forEachTrigger, getTrigger, setTrigger } from './trigger';
|
|
11
|
+
import { ifGone } from './internal/elements';
|
|
12
12
|
import getFocusManager from './focus-manager';
|
|
13
13
|
|
|
14
14
|
const DEFAULT_HOVEROUT_DELAY = 1000;
|
|
15
15
|
|
|
16
16
|
function changeTrigger(element, newTrigger) {
|
|
17
17
|
if (isPopupMenu(element)) {
|
|
18
|
-
doIfTrigger(element, function(oldTrigger) {
|
|
18
|
+
doIfTrigger(element, function (oldTrigger) {
|
|
19
19
|
oldTrigger.setAttribute('aria-expanded', 'false');
|
|
20
20
|
newTrigger.setAttribute('aria-expanded', element.open);
|
|
21
21
|
});
|
|
@@ -24,28 +24,29 @@ function changeTrigger(element, newTrigger) {
|
|
|
24
24
|
setTrigger(element, newTrigger);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
function enableAlignment
|
|
27
|
+
function enableAlignment(element, trigger) {
|
|
28
28
|
if (element._auiAlignment) {
|
|
29
29
|
element._auiAlignment.changeTarget(trigger);
|
|
30
|
-
element._auiAlignment.enable()
|
|
30
|
+
element._auiAlignment.enable();
|
|
31
31
|
} else {
|
|
32
32
|
let alignmentOptions = {
|
|
33
|
-
overflowContainer:
|
|
33
|
+
overflowContainer:
|
|
34
|
+
element.getAttribute('contained-by') === 'viewport' ? 'viewport' : 'window',
|
|
34
35
|
positionFixed: false,
|
|
35
|
-
eventsEnabled: true
|
|
36
|
+
eventsEnabled: true,
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
element._auiAlignment = new Alignment(element, trigger, alignmentOptions);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
function disableAlignment
|
|
43
|
+
function disableAlignment(element) {
|
|
43
44
|
if (element._auiAlignment) {
|
|
44
45
|
element._auiAlignment.disable();
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
function destroyAlignment
|
|
49
|
+
function destroyAlignment(element) {
|
|
49
50
|
if (element._auiAlignment) {
|
|
50
51
|
element._auiAlignment.destroy();
|
|
51
52
|
delete element._auiAlignment;
|
|
@@ -70,7 +71,7 @@ function showOnEnter(element, e) {
|
|
|
70
71
|
clearTimeout(element._closingTimeout);
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
function closeAfter
|
|
74
|
+
function closeAfter(delay = 0) {
|
|
74
75
|
return function closing(element) {
|
|
75
76
|
if (!element.open || layer(element).isPersistent()) {
|
|
76
77
|
return;
|
|
@@ -83,7 +84,7 @@ function closeAfter (delay = 0) {
|
|
|
83
84
|
}
|
|
84
85
|
element._closingTimeout = null;
|
|
85
86
|
}, delay);
|
|
86
|
-
}
|
|
87
|
+
};
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
const messageHandler = {
|
|
@@ -105,10 +106,10 @@ const messageHandler = {
|
|
|
105
106
|
blur: closeAfter(0),
|
|
106
107
|
};
|
|
107
108
|
|
|
108
|
-
function handleMessage
|
|
109
|
+
function handleMessage(element, message) {
|
|
109
110
|
var messageTypeMap = {
|
|
110
111
|
toggle: ['click'],
|
|
111
|
-
hover: ['mouseenter', 'mouseleave', 'focus', 'blur']
|
|
112
|
+
hover: ['mouseenter', 'mouseleave', 'focus', 'blur'],
|
|
112
113
|
};
|
|
113
114
|
|
|
114
115
|
var messageList = messageTypeMap[element.respondsTo];
|
|
@@ -121,7 +122,7 @@ function onMouseEnter(e) {
|
|
|
121
122
|
var element = e.currentTarget;
|
|
122
123
|
state(element).set('mouse-inside', true);
|
|
123
124
|
element.message({
|
|
124
|
-
type: 'mouseenter'
|
|
125
|
+
type: 'mouseenter',
|
|
125
126
|
});
|
|
126
127
|
}
|
|
127
128
|
|
|
@@ -129,7 +130,7 @@ function onMouseLeave(e) {
|
|
|
129
130
|
var element = e.currentTarget;
|
|
130
131
|
state(element).set('mouse-inside', false);
|
|
131
132
|
element.message({
|
|
132
|
-
type: 'mouseleave'
|
|
133
|
+
type: 'mouseleave',
|
|
133
134
|
});
|
|
134
135
|
}
|
|
135
136
|
|
|
@@ -144,7 +145,7 @@ function rebindMouseEvents(el) {
|
|
|
144
145
|
state(el).set('mouse-inside', undefined);
|
|
145
146
|
el.removeEventListener('mouseenter', onMouseEnter);
|
|
146
147
|
el.removeEventListener('mouseleave', onMouseLeave);
|
|
147
|
-
el.removeEventListener('blur', onBlur)
|
|
148
|
+
el.removeEventListener('blur', onBlur);
|
|
148
149
|
|
|
149
150
|
if (el.respondsTo === 'hover') {
|
|
150
151
|
state(el).set('mouse-inside', false);
|
|
@@ -155,13 +156,13 @@ function rebindMouseEvents(el) {
|
|
|
155
156
|
}
|
|
156
157
|
|
|
157
158
|
function namespaceEvent(eventName, elId) {
|
|
158
|
-
return `${eventName}.nested-layer-${elId}
|
|
159
|
+
return `${eventName}.nested-layer-${elId}`;
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
function setupNestedLayerHandlers(el) {
|
|
162
163
|
let $el = $(el);
|
|
163
164
|
const elId = el.id;
|
|
164
|
-
const noNestedTriggers = e => {
|
|
165
|
+
const noNestedTriggers = (e) => {
|
|
165
166
|
return $el.find(getTrigger(e.target)).length < 1;
|
|
166
167
|
};
|
|
167
168
|
// Temporary timeout variable to resolve AUI-5025 issue
|
|
@@ -169,13 +170,13 @@ function setupNestedLayerHandlers(el) {
|
|
|
169
170
|
const selectCloseTimeout = 150;
|
|
170
171
|
|
|
171
172
|
$(document)
|
|
172
|
-
.on(namespaceEvent('aui-layer-show', elId), e => {
|
|
173
|
+
.on(namespaceEvent('aui-layer-show', elId), (e) => {
|
|
173
174
|
if (noNestedTriggers(e)) {
|
|
174
175
|
return;
|
|
175
176
|
}
|
|
176
177
|
$el.attr('persistent', '');
|
|
177
178
|
})
|
|
178
|
-
.on(namespaceEvent('aui-layer-hide', elId), e => {
|
|
179
|
+
.on(namespaceEvent('aui-layer-hide', elId), (e) => {
|
|
179
180
|
if (noNestedTriggers(e)) {
|
|
180
181
|
return;
|
|
181
182
|
}
|
|
@@ -244,7 +245,7 @@ function maybeInitialise(element) {
|
|
|
244
245
|
layer(element);
|
|
245
246
|
$(element).on({
|
|
246
247
|
// fired only after the layer is shown
|
|
247
|
-
[`${EVENT_PREFIX}show`]: function(e) {
|
|
248
|
+
[`${EVENT_PREFIX}show`]: function (e) {
|
|
248
249
|
const el = this;
|
|
249
250
|
// This handler can be fired by nested layer/component.
|
|
250
251
|
// We need to be sure that the event was triggered by the inline dialog;
|
|
@@ -268,7 +269,7 @@ function maybeInitialise(element) {
|
|
|
268
269
|
});
|
|
269
270
|
},
|
|
270
271
|
// fired only after the layer is hidden
|
|
271
|
-
[`${EVENT_PREFIX}hide`]: function(e) {
|
|
272
|
+
[`${EVENT_PREFIX}hide`]: function (e) {
|
|
272
273
|
const el = this;
|
|
273
274
|
// This handler can be fired by nested layer/component.
|
|
274
275
|
// We need to be sure that the event was triggered by the inline dialog;
|
|
@@ -296,7 +297,7 @@ function maybeInitialise(element) {
|
|
|
296
297
|
}
|
|
297
298
|
});
|
|
298
299
|
setTrigger(el, null);
|
|
299
|
-
}
|
|
300
|
+
},
|
|
300
301
|
});
|
|
301
302
|
|
|
302
303
|
element.__initialised = true;
|
|
@@ -306,7 +307,7 @@ const RESPONDS_TO_ATTRIBUTE_ENUM = {
|
|
|
306
307
|
attribute: 'responds-to',
|
|
307
308
|
values: ['toggle', 'hover'],
|
|
308
309
|
missingDefault: 'toggle',
|
|
309
|
-
invalidDefault: 'toggle'
|
|
310
|
+
invalidDefault: 'toggle',
|
|
310
311
|
};
|
|
311
312
|
|
|
312
313
|
const InlineDialogEl = skate('aui-inline-dialog', {
|
|
@@ -330,7 +331,7 @@ const InlineDialogEl = skate('aui-inline-dialog', {
|
|
|
330
331
|
// a flag to help avoid things getting called a second time via the attribute mutation handler
|
|
331
332
|
this.__propUpdate = true;
|
|
332
333
|
if (value) {
|
|
333
|
-
maybeShow(this)
|
|
334
|
+
maybeShow(this);
|
|
334
335
|
} else {
|
|
335
336
|
maybeHide(this);
|
|
336
337
|
}
|
|
@@ -367,10 +368,10 @@ const InlineDialogEl = skate('aui-inline-dialog', {
|
|
|
367
368
|
message: function (msg) {
|
|
368
369
|
handleMessage(this, msg);
|
|
369
370
|
return this;
|
|
370
|
-
}
|
|
371
|
+
},
|
|
371
372
|
},
|
|
372
373
|
attributes: {
|
|
373
|
-
open: function (element, change) {
|
|
374
|
+
'open': function (element, change) {
|
|
374
375
|
maybeInitialise(element);
|
|
375
376
|
|
|
376
377
|
if (element.__propUpdate) {
|
|
@@ -392,12 +393,18 @@ const InlineDialogEl = skate('aui-inline-dialog', {
|
|
|
392
393
|
}
|
|
393
394
|
},
|
|
394
395
|
'responds-to': function (element, change) {
|
|
395
|
-
const oldComputedValue = attributes.computeEnumValue(
|
|
396
|
-
|
|
396
|
+
const oldComputedValue = attributes.computeEnumValue(
|
|
397
|
+
RESPONDS_TO_ATTRIBUTE_ENUM,
|
|
398
|
+
change.oldValue
|
|
399
|
+
);
|
|
400
|
+
const newComputedValue = attributes.computeEnumValue(
|
|
401
|
+
RESPONDS_TO_ATTRIBUTE_ENUM,
|
|
402
|
+
change.newValue
|
|
403
|
+
);
|
|
397
404
|
if (oldComputedValue !== newComputedValue) {
|
|
398
405
|
rebindMouseEvents(element);
|
|
399
406
|
}
|
|
400
|
-
}
|
|
407
|
+
},
|
|
401
408
|
},
|
|
402
409
|
|
|
403
410
|
created: maybeInitialise,
|
|
@@ -434,7 +441,7 @@ const InlineDialogEl = skate('aui-inline-dialog', {
|
|
|
434
441
|
$('<div class="aui-inline-dialog-contents"></div>')
|
|
435
442
|
.append(element.childNodes)
|
|
436
443
|
.appendTo(element);
|
|
437
|
-
}
|
|
444
|
+
},
|
|
438
445
|
});
|
|
439
446
|
|
|
440
447
|
amdify('aui/inline-dialog2', InlineDialogEl);
|
|
@@ -43,10 +43,10 @@ function getPlacement(element) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
function getAlignment(element) {
|
|
46
|
-
let [side, snap] =
|
|
46
|
+
let [side, snap] = getAlignmentAttribute(element).split(' ');
|
|
47
47
|
return {
|
|
48
48
|
side,
|
|
49
|
-
snap
|
|
49
|
+
snap,
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -63,7 +63,7 @@ function addAlignmentClasses(element, side, snap) {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
function getContainer
|
|
66
|
+
function getContainer(element) {
|
|
67
67
|
let container = getAttribute(element, ATTR_CONTAINER) || window;
|
|
68
68
|
|
|
69
69
|
if (typeof container === 'string') {
|
|
@@ -73,7 +73,7 @@ function getContainer (element) {
|
|
|
73
73
|
return container;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
function calculateBestAlignmentSnap
|
|
76
|
+
function calculateBestAlignmentSnap(target) {
|
|
77
77
|
let container = getContainer(target);
|
|
78
78
|
let snap = 'left';
|
|
79
79
|
|
|
@@ -85,7 +85,10 @@ function calculateBestAlignmentSnap (target) {
|
|
|
85
85
|
let containerBounds = container.getBoundingClientRect();
|
|
86
86
|
let targetBounds = target.getBoundingClientRect();
|
|
87
87
|
|
|
88
|
-
if (
|
|
88
|
+
if (
|
|
89
|
+
targetBounds.left - containerBounds.left >
|
|
90
|
+
(containerBounds.right - containerBounds.left) / 2
|
|
91
|
+
) {
|
|
89
92
|
snap = 'right';
|
|
90
93
|
}
|
|
91
94
|
}
|
|
@@ -93,13 +96,12 @@ function calculateBestAlignmentSnap (target) {
|
|
|
93
96
|
return snap;
|
|
94
97
|
}
|
|
95
98
|
|
|
96
|
-
function calculatePlacement
|
|
99
|
+
function calculatePlacement(element, target) {
|
|
97
100
|
const alignment = getAlignment(element);
|
|
98
101
|
|
|
99
102
|
let placement;
|
|
100
103
|
|
|
101
104
|
if (!alignment.snap || alignment.snap === 'auto') {
|
|
102
|
-
|
|
103
105
|
alignment.snap = calculateBestAlignmentSnap(target);
|
|
104
106
|
|
|
105
107
|
if (alignment.side === 'submenu') {
|
|
@@ -158,13 +160,15 @@ const allowedPlacement = {
|
|
|
158
160
|
* scroll and resize. Equivalent of calling .enable() after init but saves one update cycle.
|
|
159
161
|
*/
|
|
160
162
|
function Alignment(element, target, options = {}) {
|
|
161
|
-
const alignment = getAlignment(element)
|
|
163
|
+
const alignment = getAlignment(element);
|
|
162
164
|
const placement = calculatePlacement(element, target);
|
|
163
165
|
const allowedAutoPlacements = allowedPlacement[placement.split('-')[0]];
|
|
164
166
|
|
|
165
167
|
const frame = target.ownerDocument.defaultView.frameElement;
|
|
166
168
|
|
|
167
|
-
this._eventListenersEnabled = options.hasOwnProperty('eventsEnabled')
|
|
169
|
+
this._eventListenersEnabled = options.hasOwnProperty('eventsEnabled')
|
|
170
|
+
? options.eventsEnabled
|
|
171
|
+
: false;
|
|
168
172
|
this._triggerOnEvents = false;
|
|
169
173
|
|
|
170
174
|
const modifiers = [
|
|
@@ -173,8 +177,12 @@ function Alignment(element, target, options = {}) {
|
|
|
173
177
|
enabled: options.hasOwnProperty('flip') ? options.flip : true,
|
|
174
178
|
options: {
|
|
175
179
|
allowedAutoPlacements,
|
|
176
|
-
boundary:
|
|
177
|
-
|
|
180
|
+
boundary:
|
|
181
|
+
frame ||
|
|
182
|
+
(options.hasOwnProperty('flipContainer')
|
|
183
|
+
? options.flipContainer
|
|
184
|
+
: 'clippingParents'), // clippingParents by default
|
|
185
|
+
},
|
|
178
186
|
},
|
|
179
187
|
{
|
|
180
188
|
name: 'preventOverflow',
|
|
@@ -182,8 +190,12 @@ function Alignment(element, target, options = {}) {
|
|
|
182
190
|
options: {
|
|
183
191
|
padding: 0, // as of Popper 2.0 it's 0 by default, but explicitly specify in case of defaults change.
|
|
184
192
|
escapeWithReference: false,
|
|
185
|
-
rootBoundary:
|
|
186
|
-
|
|
193
|
+
rootBoundary:
|
|
194
|
+
frame ||
|
|
195
|
+
(options.hasOwnProperty('overflowContainer')
|
|
196
|
+
? options.overflowContainer
|
|
197
|
+
: 'document'), //viewport by default
|
|
198
|
+
},
|
|
187
199
|
},
|
|
188
200
|
{
|
|
189
201
|
name: 'offset',
|
|
@@ -194,44 +206,45 @@ function Alignment(element, target, options = {}) {
|
|
|
194
206
|
},
|
|
195
207
|
{
|
|
196
208
|
name: 'hide',
|
|
197
|
-
enabled: false
|
|
209
|
+
enabled: false,
|
|
198
210
|
},
|
|
199
211
|
{
|
|
200
212
|
name: 'computeStyles',
|
|
201
213
|
options: {
|
|
202
214
|
gpuAcceleration: document.body.classList.contains(GPU_ACCELERATION_FLAG),
|
|
203
215
|
// adaptive: false, // true by default, breaks CSS transitions (do we need it?)
|
|
204
|
-
}
|
|
216
|
+
},
|
|
205
217
|
},
|
|
206
218
|
{
|
|
207
219
|
name: 'eventListeners',
|
|
208
|
-
enabled: this._eventListenersEnabled
|
|
220
|
+
enabled: this._eventListenersEnabled,
|
|
209
221
|
},
|
|
210
|
-
{
|
|
222
|
+
{
|
|
223
|
+
// left for backwards compatibility
|
|
211
224
|
name: 'x-placement',
|
|
212
225
|
enabled: true,
|
|
213
226
|
phase: 'write',
|
|
214
227
|
requires: ['computeStyles'],
|
|
215
|
-
fn: ({state}) => {
|
|
228
|
+
fn: ({ state }) => {
|
|
216
229
|
if (state.elements.popper) {
|
|
217
230
|
// popper-specific attributes are NOT contracted, public API of AUI layered element
|
|
218
|
-
state.elements.popper.setAttribute('x-placement', state.placement)
|
|
231
|
+
state.elements.popper.setAttribute('x-placement', state.placement);
|
|
219
232
|
}
|
|
220
|
-
}
|
|
233
|
+
},
|
|
221
234
|
},
|
|
222
235
|
{
|
|
223
236
|
name: 'onUpdate',
|
|
224
237
|
enabled: options.hasOwnProperty('onUpdate'),
|
|
225
238
|
phase: 'afterWrite',
|
|
226
|
-
effect: ({state, name}) => {
|
|
239
|
+
effect: ({ state, name }) => {
|
|
227
240
|
// enable it after initial cycle
|
|
228
241
|
state.modifiersData[`${name}#persistent`] = {
|
|
229
242
|
enabled: true,
|
|
230
|
-
fn: options.onUpdate
|
|
243
|
+
fn: options.onUpdate,
|
|
231
244
|
};
|
|
232
245
|
},
|
|
233
246
|
|
|
234
|
-
fn: ({state, name}) => {
|
|
247
|
+
fn: ({ state, name }) => {
|
|
235
248
|
const o = state.modifiersData[`${name}#persistent`];
|
|
236
249
|
|
|
237
250
|
if (o.enabled) {
|
|
@@ -239,19 +252,19 @@ function Alignment(element, target, options = {}) {
|
|
|
239
252
|
}
|
|
240
253
|
|
|
241
254
|
return state;
|
|
242
|
-
}
|
|
255
|
+
},
|
|
243
256
|
},
|
|
244
257
|
{
|
|
245
258
|
name: 'onEvents',
|
|
246
259
|
enabled: options.hasOwnProperty('onEvents'),
|
|
247
260
|
phase: 'afterWrite',
|
|
248
|
-
effect: ({state, name}) => {
|
|
261
|
+
effect: ({ state, name }) => {
|
|
249
262
|
// enable it after initial cycle
|
|
250
263
|
state.modifiersData[`${name}#persistent`] = {
|
|
251
|
-
fn: options.onEvents
|
|
264
|
+
fn: options.onEvents,
|
|
252
265
|
};
|
|
253
266
|
},
|
|
254
|
-
fn: ({state, name}) => {
|
|
267
|
+
fn: ({ state, name }) => {
|
|
255
268
|
const o = state.modifiersData[`${name}#persistent`];
|
|
256
269
|
|
|
257
270
|
if (this._triggerOnEvents) {
|
|
@@ -263,33 +276,26 @@ function Alignment(element, target, options = {}) {
|
|
|
263
276
|
this._triggerOnEvents = false;
|
|
264
277
|
}
|
|
265
278
|
return state;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
279
|
+
},
|
|
280
|
+
},
|
|
268
281
|
];
|
|
269
282
|
|
|
270
283
|
// IE/Edge may throw a "Permission denied" error when strict-comparing two documents
|
|
271
284
|
// eslint-disable-next-line eqeqeq
|
|
272
|
-
if (frame &&
|
|
285
|
+
if (frame && target.ownerDocument != element.ownerDocument) {
|
|
273
286
|
modifiers.push({
|
|
274
287
|
name: 'iframeOffset',
|
|
275
288
|
enabled: true,
|
|
276
289
|
fn(data) {
|
|
277
290
|
const rect = frame.getBoundingClientRect();
|
|
278
291
|
const style = window.getComputedStyle(frame);
|
|
279
|
-
const sum = (a, b) => a + b
|
|
280
|
-
const getTotalValue = values =>
|
|
292
|
+
const sum = (a, b) => a + b;
|
|
293
|
+
const getTotalValue = (values) =>
|
|
294
|
+
values.map(parseFloat).filter(Boolean).reduce(sum, 0);
|
|
281
295
|
|
|
282
|
-
const top = getTotalValue([
|
|
283
|
-
rect.top,
|
|
284
|
-
style.paddingTop,
|
|
285
|
-
style.borderTop
|
|
286
|
-
]);
|
|
296
|
+
const top = getTotalValue([rect.top, style.paddingTop, style.borderTop]);
|
|
287
297
|
|
|
288
|
-
const left = getTotalValue([
|
|
289
|
-
rect.left,
|
|
290
|
-
style.paddingLeft,
|
|
291
|
-
style.borderLeft
|
|
292
|
-
]);
|
|
298
|
+
const left = getTotalValue([rect.left, style.paddingLeft, style.borderLeft]);
|
|
293
299
|
|
|
294
300
|
data.offsets.reference.left += left;
|
|
295
301
|
data.offsets.reference.top += top;
|
|
@@ -297,16 +303,19 @@ function Alignment(element, target, options = {}) {
|
|
|
297
303
|
data.offsets.popper.left += left;
|
|
298
304
|
data.offsets.popper.top += top;
|
|
299
305
|
|
|
300
|
-
return data
|
|
301
|
-
}
|
|
306
|
+
return data;
|
|
307
|
+
},
|
|
302
308
|
});
|
|
303
309
|
}
|
|
304
310
|
|
|
305
311
|
const popperConfig = {
|
|
306
312
|
placement, //controlled by the flip modifier
|
|
307
|
-
strategy:
|
|
313
|
+
strategy:
|
|
314
|
+
options.hasOwnProperty('positionFixed') && !options.positionFixed
|
|
315
|
+
? 'absolute'
|
|
316
|
+
: 'fixed',
|
|
308
317
|
modifiers,
|
|
309
|
-
onFirstUpdate: options.onCreate
|
|
318
|
+
onFirstUpdate: options.onCreate,
|
|
310
319
|
};
|
|
311
320
|
|
|
312
321
|
this.popper = createPopper(target, element, popperConfig);
|
|
@@ -315,7 +324,6 @@ function Alignment(element, target, options = {}) {
|
|
|
315
324
|
}
|
|
316
325
|
|
|
317
326
|
Alignment.prototype = {
|
|
318
|
-
|
|
319
327
|
destroy() {
|
|
320
328
|
this.popper.destroy();
|
|
321
329
|
return this;
|
|
@@ -368,10 +376,10 @@ Alignment.prototype = {
|
|
|
368
376
|
* @returns {Alignment}
|
|
369
377
|
*/
|
|
370
378
|
disable() {
|
|
371
|
-
this._eventListenersEnabled
|
|
379
|
+
this._eventListenersEnabled = false;
|
|
372
380
|
this._triggerOnEvents = true;
|
|
373
381
|
|
|
374
|
-
this.popper.setOptions({});
|
|
382
|
+
this.popper.setOptions({}); // setOptions will re-instanciate all modifiers.
|
|
375
383
|
return this;
|
|
376
384
|
},
|
|
377
385
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
/**
|
|
3
2
|
* Force a re-compute of the style of an element.
|
|
4
3
|
*
|
|
@@ -23,11 +22,9 @@
|
|
|
23
22
|
*
|
|
24
23
|
* @param el The DOM or jQuery element for which style should be recomputed
|
|
25
24
|
*/
|
|
26
|
-
function recomputeStyle
|
|
25
|
+
function recomputeStyle(el) {
|
|
27
26
|
el = el.jquery ? el[0] : el;
|
|
28
27
|
window.getComputedStyle(el, null).getPropertyValue('left');
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
export {
|
|
32
|
-
recomputeStyle
|
|
33
|
-
};
|
|
30
|
+
export { recomputeStyle };
|
|
@@ -15,7 +15,7 @@ export function setBooleanAttribute(el, attr, newValue) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export function computeEnumValue(enumOptions, value) {
|
|
18
|
-
const matchesEnumValue = enumValue => enumValue.toLowerCase() === value.toLowerCase();
|
|
18
|
+
const matchesEnumValue = (enumValue) => enumValue.toLowerCase() === value.toLowerCase();
|
|
19
19
|
|
|
20
20
|
const isMissing = value === null;
|
|
21
21
|
const isInvalid = !isMissing && !enumOptions.values.filter(matchesEnumValue).length;
|
|
@@ -39,7 +39,6 @@ export function computeEnumValue(enumOptions, value) {
|
|
|
39
39
|
return enumOptions.values.length ? enumOptions.values.filter(matchesEnumValue)[0] : null;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
43
42
|
export function setEnumAttribute(el, enumOptions, newValue) {
|
|
44
43
|
el.setAttribute(enumOptions.attribute, newValue);
|
|
45
44
|
}
|
|
@@ -57,5 +56,5 @@ export default {
|
|
|
57
56
|
setBooleanAttribute,
|
|
58
57
|
|
|
59
58
|
computeEnumValue,
|
|
60
|
-
setEnumAttribute
|
|
59
|
+
setEnumAttribute,
|
|
61
60
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
1
|
var ua = navigator.userAgent.toLowerCase();
|
|
3
2
|
var isIE = /msie/.test(ua);
|
|
4
3
|
var isWinXP = /windows nt 5.1/.test(ua);
|
|
5
4
|
var isWinVista = /windows nt 6.0/.test(ua);
|
|
6
5
|
var isWin7 = /windows nt 6.1/.test(ua);
|
|
7
|
-
var isMacOSX =
|
|
6
|
+
var isMacOSX = /mac os x/.test(ua);
|
|
8
7
|
var doesSupportHtml5DateInput;
|
|
9
8
|
var doesSupportFocusWithin;
|
|
10
9
|
|
|
@@ -14,15 +13,15 @@ var doesSupportFocusWithin;
|
|
|
14
13
|
* From manual testing, all IE versions on Windows 7 appear to have the bug,
|
|
15
14
|
* but no IE versions on Windows 8 have it.
|
|
16
15
|
*/
|
|
17
|
-
export function needsLayeringShim
|
|
16
|
+
export function needsLayeringShim() {
|
|
18
17
|
return isIE && (isWinXP || isWinVista || isWin7);
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
export function supportsVoiceOver
|
|
20
|
+
export function supportsVoiceOver() {
|
|
22
21
|
return isMacOSX;
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
export function supportsDateField
|
|
24
|
+
export function supportsDateField() {
|
|
26
25
|
if (typeof doesSupportHtml5DateInput === 'undefined') {
|
|
27
26
|
var el = document.createElement('input');
|
|
28
27
|
el.setAttribute('type', 'date');
|
|
@@ -31,7 +30,7 @@ export function supportsDateField () {
|
|
|
31
30
|
return doesSupportHtml5DateInput;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
export function supportsFocusWithin
|
|
33
|
+
export function supportsFocusWithin() {
|
|
35
34
|
if (typeof doesSupportFocusWithin === 'undefined') {
|
|
36
35
|
try {
|
|
37
36
|
document.querySelector(':focus-within');
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import $ from '../jquery';
|
|
2
2
|
|
|
3
3
|
function replaceAttributeForID($clone, id, value, attribute) {
|
|
4
|
-
$clone
|
|
4
|
+
$clone
|
|
5
|
+
.find(`[${attribute}]`)
|
|
6
|
+
.attr(attribute, (i, oldValue) => (id === oldValue ? value : undefined));
|
|
5
7
|
}
|
|
6
8
|
|
|
7
9
|
function setCorrespondingTriggersID($clone, id, uuid) {
|
|
@@ -12,10 +14,9 @@ function setCorrespondingTriggersID($clone, id, uuid) {
|
|
|
12
14
|
export default function deduplicateIDs($clone, uidFunction) {
|
|
13
15
|
let wrapper = $('<div></div>');
|
|
14
16
|
wrapper.append($clone);
|
|
15
|
-
wrapper.find('[id]')
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
17
|
+
wrapper.find('[id]').each((i, el) => {
|
|
18
|
+
const uuid = uidFunction(`${el.id}-`);
|
|
19
|
+
setCorrespondingTriggersID(wrapper, el.id, uuid);
|
|
20
|
+
el.id = uuid;
|
|
21
|
+
});
|
|
21
22
|
}
|