mdui 2.1.1 → 2.1.3
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/components/avatar/style.js +1 -1
- package/components/badge/style.js +1 -1
- package/components/bottom-app-bar/index.d.ts +1 -1
- package/components/bottom-app-bar/style.js +1 -1
- package/components/button/button-base.d.ts +1 -1
- package/components/button/style.js +2 -2
- package/components/button-icon/style.js +2 -2
- package/components/card/index.d.ts +1 -1
- package/components/card/style.js +1 -1
- package/components/checkbox/index.d.ts +1 -1
- package/components/checkbox/style.js +1 -1
- package/components/chip/style.js +2 -2
- package/components/circular-progress/style.js +1 -1
- package/components/dialog/style.js +1 -1
- package/components/divider/style.js +1 -1
- package/components/dropdown/index.js +9 -4
- package/components/fab/style.js +2 -2
- package/components/icon/style.js +1 -1
- package/components/layout/layout-style.js +1 -1
- package/components/list/list-item-style.js +2 -2
- package/components/list/list-item.d.ts +1 -1
- package/components/menu/menu-item-style.js +1 -1
- package/components/menu/menu-item.d.ts +1 -1
- package/components/navigation-bar/navigation-bar-item.d.ts +1 -1
- package/components/navigation-bar/navigation-bar-style.js +1 -1
- package/components/navigation-bar/navigation-bar.d.ts +1 -1
- package/components/navigation-drawer/index.d.ts +1 -0
- package/components/navigation-drawer/index.js +17 -11
- package/components/navigation-drawer/style.js +1 -1
- package/components/navigation-rail/navigation-rail-item.d.ts +1 -1
- package/components/navigation-rail/navigation-rail-style.js +1 -1
- package/components/radio/radio-style.js +1 -1
- package/components/radio/radio.d.ts +1 -1
- package/components/ripple/ripple-mixin.d.ts +1 -1
- package/components/segmented-button/segmented-button-group-style.js +1 -1
- package/components/segmented-button/segmented-button-style.js +1 -1
- package/components/select/index.d.ts +1 -3
- package/components/select/index.js +6 -6
- package/components/slider/slider-base-style.js +1 -1
- package/components/slider/slider-base.d.ts +1 -1
- package/components/snackbar/index.d.ts +12 -0
- package/components/snackbar/index.js +105 -46
- package/components/snackbar/style.js +1 -1
- package/components/switch/index.d.ts +1 -1
- package/components/switch/style.js +1 -1
- package/components/tabs/tab-style.js +1 -1
- package/components/tabs/tab.d.ts +1 -1
- package/components/tabs/tabs-style.js +1 -1
- package/components/tabs/tabs.d.ts +2 -2
- package/components/tabs/tabs.js +6 -4
- package/components/text-field/index.d.ts +6 -8
- package/components/text-field/index.js +35 -31
- package/components/text-field/style.js +1 -1
- package/components/tooltip/index.js +6 -4
- package/components/top-app-bar/top-app-bar-style.js +1 -1
- package/components/top-app-bar/top-app-bar.d.ts +1 -1
- package/components/top-app-bar/top-app-bar.js +1 -1
- package/custom-elements.json +5920 -7207
- package/functions/alert.js +5 -3
- package/functions/confirm.js +5 -3
- package/functions/dialog.js +8 -3
- package/functions/prompt.js +5 -3
- package/functions/snackbar.js +8 -2
- package/html-data.en.json +580 -586
- package/html-data.zh-cn.json +580 -586
- package/jsx.en.d.ts +424 -427
- package/jsx.zh-cn.d.ts +424 -427
- package/mdui.esm.js +8 -8
- package/mdui.global.js +8 -8
- package/package.json +9 -10
- package/web-types.en.json +1285 -1275
- package/web-types.zh-cn.json +1285 -1275
package/functions/alert.js
CHANGED
|
@@ -66,9 +66,11 @@ export const alert = (options) => {
|
|
|
66
66
|
$(dialog).find('[slot="action"]').text(getConfirmText());
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
$(dialog).on('close', () => {
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
$(dialog).on('close', (e) => {
|
|
70
|
+
if (e.target === dialog) {
|
|
71
|
+
isResolve ? resolve() : reject();
|
|
72
|
+
offLocaleReady(dialog);
|
|
73
|
+
}
|
|
72
74
|
});
|
|
73
75
|
});
|
|
74
76
|
};
|
package/functions/confirm.js
CHANGED
|
@@ -87,9 +87,11 @@ export const confirm = (options) => {
|
|
|
87
87
|
$(dialog).find('[slot="action"]').first().text(getCancelText());
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
$(dialog).on('close', () => {
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
$(dialog).on('close', (e) => {
|
|
91
|
+
if (e.target === dialog) {
|
|
92
|
+
isResolve ? resolve() : reject();
|
|
93
|
+
offLocaleReady(dialog);
|
|
94
|
+
}
|
|
93
95
|
});
|
|
94
96
|
});
|
|
95
97
|
};
|
package/functions/dialog.js
CHANGED
|
@@ -38,8 +38,10 @@ export const dialog = (options) => {
|
|
|
38
38
|
}
|
|
39
39
|
else if (callbacks.includes(key)) {
|
|
40
40
|
const eventName = toKebabCase(key.slice(2));
|
|
41
|
-
$dialog.on(eventName, () => {
|
|
42
|
-
|
|
41
|
+
$dialog.on(eventName, (e) => {
|
|
42
|
+
if (e.target === dialog) {
|
|
43
|
+
value.call(dialog, dialog);
|
|
44
|
+
}
|
|
43
45
|
});
|
|
44
46
|
}
|
|
45
47
|
});
|
|
@@ -72,7 +74,10 @@ export const dialog = (options) => {
|
|
|
72
74
|
});
|
|
73
75
|
});
|
|
74
76
|
}
|
|
75
|
-
$dialog.appendTo('body').on('closed', () => {
|
|
77
|
+
$dialog.appendTo('body').on('closed', (e) => {
|
|
78
|
+
if (e.target !== dialog) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
76
81
|
$dialog.remove();
|
|
77
82
|
if (options.queue) {
|
|
78
83
|
currentDialog = undefined;
|
package/functions/prompt.js
CHANGED
|
@@ -122,9 +122,11 @@ export const prompt = (options) => {
|
|
|
122
122
|
$(dialog).find('[slot="action"]').first().text(getCancelText());
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
|
-
$(dialog).on('close', () => {
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
$(dialog).on('close', (e) => {
|
|
126
|
+
if (e.target === dialog) {
|
|
127
|
+
isResolve ? resolve(textField.value) : reject();
|
|
128
|
+
offLocaleReady(dialog);
|
|
129
|
+
}
|
|
128
130
|
});
|
|
129
131
|
});
|
|
130
132
|
};
|
package/functions/snackbar.js
CHANGED
|
@@ -28,7 +28,10 @@ export const snackbar = (options) => {
|
|
|
28
28
|
'onClosed',
|
|
29
29
|
].includes(key)) {
|
|
30
30
|
const eventName = toKebabCase(key.slice(2));
|
|
31
|
-
$snackbar.on(eventName, () => {
|
|
31
|
+
$snackbar.on(eventName, (e) => {
|
|
32
|
+
if (e.target !== snackbar) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
32
35
|
if (key === 'onActionClick') {
|
|
33
36
|
const actionClick = (options.onActionClick ?? returnTrue).call(snackbar, snackbar);
|
|
34
37
|
if (isPromise(actionClick)) {
|
|
@@ -55,7 +58,10 @@ export const snackbar = (options) => {
|
|
|
55
58
|
snackbar[key] = value;
|
|
56
59
|
}
|
|
57
60
|
});
|
|
58
|
-
$snackbar.appendTo('body').on('closed', () => {
|
|
61
|
+
$snackbar.appendTo('body').on('closed', (e) => {
|
|
62
|
+
if (e.target !== snackbar) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
59
65
|
$snackbar.remove();
|
|
60
66
|
if (options.queue) {
|
|
61
67
|
currentSnackbar = undefined;
|