@mediafly/js-ui 51.5.1-1 → 51.5.1-2
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.
|
@@ -18,7 +18,7 @@ export default class MflyModalComponentController implements IComponentControlle
|
|
|
18
18
|
modalHeaderClass?: string | undefined;
|
|
19
19
|
modalSize?: 'large' | 'full' | undefined;
|
|
20
20
|
modalId: string | undefined;
|
|
21
|
-
|
|
21
|
+
modalFocus?: boolean | undefined;
|
|
22
22
|
modalCloseCallback: () => void;
|
|
23
23
|
/** A callback that provides an optional "are you sure?" dialog when the modal is dismissed (canceled). Return `undefined` if no confirmation is required. */
|
|
24
24
|
modalConfirmDismissCallback?: () => ModalDismissConfirmation | undefined;
|
|
@@ -66,7 +66,7 @@ let MflyModalComponentController = class MflyModalComponentController {
|
|
|
66
66
|
this.$timeout(() => {
|
|
67
67
|
var _a;
|
|
68
68
|
this.$element.find('.c-modal__backdrop').addClass('is-visible');
|
|
69
|
-
if (this.
|
|
69
|
+
if (this.modalFocus) {
|
|
70
70
|
(_a = this.modalElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
71
71
|
}
|
|
72
72
|
else {
|
|
@@ -157,7 +157,7 @@ __decorate([
|
|
|
157
157
|
__decorate([
|
|
158
158
|
decorators_1.Input('@'),
|
|
159
159
|
__metadata("design:type", Object)
|
|
160
|
-
], MflyModalComponentController.prototype, "
|
|
160
|
+
], MflyModalComponentController.prototype, "modalFocus", void 0);
|
|
161
161
|
__decorate([
|
|
162
162
|
decorators_1.Output(),
|
|
163
163
|
__metadata("design:type", Function)
|
|
@@ -1197,8 +1197,8 @@
|
|
|
1197
1197
|
"affectsGlobalScope": false
|
|
1198
1198
|
},
|
|
1199
1199
|
"../src/components/modal/modal.component.ts": {
|
|
1200
|
-
"version": "
|
|
1201
|
-
"signature": "
|
|
1200
|
+
"version": "22b65e4a255dd7bd2297ed1c3fa165045a26de86fd10d7b53e96400605d7bb8b",
|
|
1201
|
+
"signature": "cc750fad1e1c2323ee91e394e7343c694ff82c96c1ac0b7d5461ac7002198c7a",
|
|
1202
1202
|
"affectsGlobalScope": false
|
|
1203
1203
|
},
|
|
1204
1204
|
"../src/components/modal/index.ts": {
|
package/package.json
CHANGED
|
@@ -25,9 +25,9 @@ export default class MflyModalComponentController implements IComponentControlle
|
|
|
25
25
|
@Input('@') modalHeaderClass?: string | undefined
|
|
26
26
|
@Input('@') modalSize?: 'large' | 'full' | undefined
|
|
27
27
|
@Input('@') modalId: string | undefined
|
|
28
|
-
// This focuses the modal element
|
|
28
|
+
// This focuses the modal element rather than the first focusable child.
|
|
29
29
|
// It is primarily for use by modals that load their content asynchronously.
|
|
30
|
-
@Input('@')
|
|
30
|
+
@Input('@') modalFocus?: boolean | undefined
|
|
31
31
|
|
|
32
32
|
@Output() modalCloseCallback: () => void
|
|
33
33
|
/** A callback that provides an optional "are you sure?" dialog when the modal is dismissed (canceled). Return `undefined` if no confirmation is required. */
|
|
@@ -102,7 +102,7 @@ export default class MflyModalComponentController implements IComponentControlle
|
|
|
102
102
|
// Timeout 0 only intermittently fires the animation; 50ms seems to be reliable.
|
|
103
103
|
this.$timeout(() => {
|
|
104
104
|
this.$element.find('.c-modal__backdrop').addClass('is-visible')
|
|
105
|
-
if (this.
|
|
105
|
+
if (this.modalFocus) {
|
|
106
106
|
this.modalElement?.focus()
|
|
107
107
|
} else {
|
|
108
108
|
this.firstFocusable.focus()
|