@momentum-design/components 0.127.5 → 0.127.6
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/dist/browser/index.js +203 -203
- package/dist/browser/index.js.map +4 -4
- package/dist/components/announcementdialog/announcementdialog.component.d.ts +3 -1
- package/dist/components/announcementdialog/announcementdialog.component.js +18 -8
- package/dist/components/dialog/dialog.component.d.ts +12 -1
- package/dist/components/dialog/dialog.component.js +27 -5
- package/dist/custom-elements.json +1715 -1711
- package/dist/react/index.d.ts +4 -4
- package/dist/react/index.js +4 -4
- package/dist/utils/provider/index.d.ts +16 -5
- package/dist/utils/provider/index.js +11 -1
- package/package.json +1 -1
|
@@ -78,7 +78,9 @@ declare class AnnouncementDialog extends Dialog {
|
|
|
78
78
|
* The size of the announcement dialog, can be 'medium' (656px width), 'large' (992px width), 'xlarge' (90% width) or 'fullscreen' (100% width).
|
|
79
79
|
* @default medium
|
|
80
80
|
*/
|
|
81
|
-
size: AnnouncementDialogSize;
|
|
81
|
+
get size(): AnnouncementDialogSize;
|
|
82
|
+
set size(value: AnnouncementDialogSize);
|
|
83
|
+
constructor();
|
|
82
84
|
connectedCallback(): void;
|
|
83
85
|
protected renderHeader(): import("lit-html").TemplateResult<1>;
|
|
84
86
|
protected renderBody(): import("lit-html").TemplateResult<1>;
|
|
@@ -80,13 +80,22 @@ import { DEFAULTS } from './announcementdialog.constants';
|
|
|
80
80
|
* using the footer-link and footer-button slots is preferred
|
|
81
81
|
*/
|
|
82
82
|
class AnnouncementDialog extends Dialog {
|
|
83
|
+
/**
|
|
84
|
+
* The size of the announcement dialog, can be 'medium' (656px width), 'large' (992px width), 'xlarge' (90% width) or 'fullscreen' (100% width).
|
|
85
|
+
* @default medium
|
|
86
|
+
*/
|
|
87
|
+
get size() {
|
|
88
|
+
var _a, _b;
|
|
89
|
+
return ((_b = (_a = this.responsiveSettingsContext) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.forceFullscreenDialog)
|
|
90
|
+
? 'fullscreen'
|
|
91
|
+
: this.internalSize;
|
|
92
|
+
}
|
|
93
|
+
set size(value) {
|
|
94
|
+
this.internalSize = value;
|
|
95
|
+
}
|
|
83
96
|
constructor() {
|
|
84
|
-
super(
|
|
85
|
-
|
|
86
|
-
* The size of the announcement dialog, can be 'medium' (656px width), 'large' (992px width), 'xlarge' (90% width) or 'fullscreen' (100% width).
|
|
87
|
-
* @default medium
|
|
88
|
-
*/
|
|
89
|
-
this.size = DEFAULTS.SIZE;
|
|
97
|
+
super();
|
|
98
|
+
this.internalSize = DEFAULTS.SIZE;
|
|
90
99
|
}
|
|
91
100
|
connectedCallback() {
|
|
92
101
|
super.connectedCallback();
|
|
@@ -126,6 +135,7 @@ __decorate([
|
|
|
126
135
|
], AnnouncementDialog.prototype, "illustration", void 0);
|
|
127
136
|
__decorate([
|
|
128
137
|
property({ type: String, reflect: true }),
|
|
129
|
-
__metadata("design:type", String)
|
|
130
|
-
|
|
138
|
+
__metadata("design:type", String),
|
|
139
|
+
__metadata("design:paramtypes", [String])
|
|
140
|
+
], AnnouncementDialog.prototype, "size", null);
|
|
131
141
|
export default AnnouncementDialog;
|
|
@@ -75,6 +75,10 @@ declare const Dialog_base: import("../../utils/mixins/index.types").Constructor<
|
|
|
75
75
|
* using the footer-link and footer-button slots is preferred
|
|
76
76
|
*/
|
|
77
77
|
declare class Dialog extends Dialog_base {
|
|
78
|
+
/** @internal */
|
|
79
|
+
protected readonly responsiveSettingsContext: import("@lit/context").ContextConsumer<{
|
|
80
|
+
__context__: import("../responsivesettingsprovider/responsivesettingsprovider.types").ResponsiveSettings;
|
|
81
|
+
}, import("lit").ReactiveElement>;
|
|
78
82
|
/**
|
|
79
83
|
* The unique ID of the dialog
|
|
80
84
|
*/
|
|
@@ -99,11 +103,18 @@ declare class Dialog extends Dialog_base {
|
|
|
99
103
|
* @default 1000
|
|
100
104
|
*/
|
|
101
105
|
zIndex: number;
|
|
106
|
+
/**
|
|
107
|
+
* The internal value helps to restore original size when responsive settings disabled.
|
|
108
|
+
*
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
protected internalSize: DialogSize;
|
|
102
112
|
/**
|
|
103
113
|
* The size of the dialog, can be 'small' (432px width), 'medium' (656px width), 'large' (992px width), 'xlarge' (90% width) or 'fullscreen' (100% width).
|
|
104
114
|
* @default small
|
|
105
115
|
*/
|
|
106
|
-
size: DialogSize;
|
|
116
|
+
get size(): DialogSize;
|
|
117
|
+
set size(value: DialogSize);
|
|
107
118
|
/**
|
|
108
119
|
* The variant of the dialog, can be 'default' or 'promotional'
|
|
109
120
|
* @default default
|
|
@@ -17,6 +17,8 @@ import { TYPE, VALID_TEXT_TAGS } from '../text/text.constants';
|
|
|
17
17
|
import { BUTTON_VARIANTS, ICON_BUTTON_SIZES } from '../button/button.constants';
|
|
18
18
|
import { FooterMixin } from '../../utils/mixins/FooterMixin';
|
|
19
19
|
import { BackdropMixin } from '../../utils/mixins/BackdropMixin';
|
|
20
|
+
import providerUtils from '../../utils/provider';
|
|
21
|
+
import ResponsiveSettingsProvider from '../responsivesettingsprovider';
|
|
20
22
|
import { DEFAULTS } from './dialog.constants';
|
|
21
23
|
import { DialogEventManager } from './dialog.events';
|
|
22
24
|
import styles from './dialog.styles';
|
|
@@ -95,6 +97,13 @@ import styles from './dialog.styles';
|
|
|
95
97
|
class Dialog extends BackdropMixin(PreventScrollMixin(FocusTrapMixin(FooterMixin(Component)))) {
|
|
96
98
|
constructor() {
|
|
97
99
|
super(...arguments);
|
|
100
|
+
/** @internal */
|
|
101
|
+
this.responsiveSettingsContext = providerUtils.consume({
|
|
102
|
+
host: this,
|
|
103
|
+
context: ResponsiveSettingsProvider.Context,
|
|
104
|
+
subscribe: true,
|
|
105
|
+
syncProperties: ['size'],
|
|
106
|
+
});
|
|
98
107
|
/**
|
|
99
108
|
* The unique ID of the dialog
|
|
100
109
|
*/
|
|
@@ -114,10 +123,11 @@ class Dialog extends BackdropMixin(PreventScrollMixin(FocusTrapMixin(FooterMixin
|
|
|
114
123
|
*/
|
|
115
124
|
this.zIndex = DEFAULTS.Z_INDEX;
|
|
116
125
|
/**
|
|
117
|
-
* The
|
|
118
|
-
*
|
|
126
|
+
* The internal value helps to restore original size when responsive settings disabled.
|
|
127
|
+
*
|
|
128
|
+
* @internal
|
|
119
129
|
*/
|
|
120
|
-
this.
|
|
130
|
+
this.internalSize = DEFAULTS.SIZE;
|
|
121
131
|
/**
|
|
122
132
|
* The variant of the dialog, can be 'default' or 'promotional'
|
|
123
133
|
* @default default
|
|
@@ -202,6 +212,17 @@ class Dialog extends BackdropMixin(PreventScrollMixin(FocusTrapMixin(FooterMixin
|
|
|
202
212
|
this.closeDialog();
|
|
203
213
|
};
|
|
204
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* The size of the dialog, can be 'small' (432px width), 'medium' (656px width), 'large' (992px width), 'xlarge' (90% width) or 'fullscreen' (100% width).
|
|
217
|
+
* @default small
|
|
218
|
+
*/
|
|
219
|
+
get size() {
|
|
220
|
+
var _a, _b;
|
|
221
|
+
return ((_b = (_a = this.responsiveSettingsContext) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.forceFullscreenDialog) ? 'fullscreen' : this.internalSize;
|
|
222
|
+
}
|
|
223
|
+
set size(value) {
|
|
224
|
+
this.internalSize = value;
|
|
225
|
+
}
|
|
205
226
|
connectedCallback() {
|
|
206
227
|
super.connectedCallback();
|
|
207
228
|
// event listener can be added to the element directly, since dialog is a modal component
|
|
@@ -450,8 +471,9 @@ __decorate([
|
|
|
450
471
|
], Dialog.prototype, "zIndex", void 0);
|
|
451
472
|
__decorate([
|
|
452
473
|
property({ type: String, reflect: true }),
|
|
453
|
-
__metadata("design:type", String)
|
|
454
|
-
|
|
474
|
+
__metadata("design:type", String),
|
|
475
|
+
__metadata("design:paramtypes", [String])
|
|
476
|
+
], Dialog.prototype, "size", null);
|
|
455
477
|
__decorate([
|
|
456
478
|
property({ type: String, reflect: true }),
|
|
457
479
|
__metadata("design:type", String)
|