mdui 2.1.2 → 2.1.4

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.
Files changed (122) hide show
  1. package/components/bottom-app-bar/style.js +1 -1
  2. package/components/button/style.js +2 -2
  3. package/components/button-icon/style.js +2 -2
  4. package/components/card/style.js +1 -1
  5. package/components/checkbox/style.js +1 -1
  6. package/components/chip/style.js +2 -2
  7. package/components/collapse/collapse-item.js +1 -0
  8. package/components/dialog/style.js +1 -1
  9. package/components/divider/style.js +1 -1
  10. package/components/dropdown/index.js +9 -4
  11. package/components/fab/style.js +1 -1
  12. package/components/icon/index.js +1 -1
  13. package/components/layout/layout-style.js +1 -1
  14. package/components/list/list-item-style.js +2 -2
  15. package/components/list/list-item.js +5 -4
  16. package/components/menu/menu-item-style.js +1 -1
  17. package/components/navigation-bar/navigation-bar-style.js +1 -1
  18. package/components/navigation-drawer/index.d.ts +1 -0
  19. package/components/navigation-drawer/index.js +17 -11
  20. package/components/navigation-drawer/style.js +1 -1
  21. package/components/navigation-rail/navigation-rail-style.js +1 -1
  22. package/components/radio/radio-style.js +1 -1
  23. package/components/segmented-button/segmented-button-group-style.js +1 -1
  24. package/components/segmented-button/segmented-button-style.js +1 -1
  25. package/components/select/index.d.ts +0 -2
  26. package/components/select/index.js +4 -5
  27. package/components/slider/slider-base-style.js +1 -1
  28. package/components/snackbar/index.d.ts +12 -0
  29. package/components/snackbar/index.js +105 -46
  30. package/components/snackbar/style.js +1 -1
  31. package/components/switch/style.js +1 -1
  32. package/components/tabs/tab-style.js +1 -1
  33. package/components/tabs/tabs-style.js +1 -1
  34. package/components/tabs/tabs.d.ts +2 -2
  35. package/components/tabs/tabs.js +6 -4
  36. package/components/text-field/index.d.ts +5 -7
  37. package/components/text-field/index.js +32 -36
  38. package/components/text-field/style.js +1 -1
  39. package/components/tooltip/index.d.ts +1 -1
  40. package/components/tooltip/index.js +10 -8
  41. package/components/top-app-bar/top-app-bar-style.js +1 -1
  42. package/components/top-app-bar/top-app-bar.d.ts +1 -0
  43. package/components/top-app-bar/top-app-bar.js +7 -1
  44. package/custom-elements.json +246 -153
  45. package/functions/alert.js +10 -3
  46. package/functions/confirm.js +10 -3
  47. package/functions/dialog.js +8 -3
  48. package/functions/prompt.js +10 -3
  49. package/functions/snackbar.js +8 -2
  50. package/html-data.en.json +12 -22
  51. package/html-data.zh-cn.json +2 -12
  52. package/jsx.en.d.ts +2079 -2080
  53. package/jsx.zh-cn.d.ts +2062 -2063
  54. package/locales/ar-eg.js +0 -2
  55. package/locales/az-az.js +0 -2
  56. package/locales/be-by.js +0 -2
  57. package/locales/bg-bg.js +0 -2
  58. package/locales/bn-bd.js +0 -2
  59. package/locales/ca-es.js +0 -2
  60. package/locales/cs-cz.js +0 -2
  61. package/locales/da-dk.js +0 -2
  62. package/locales/de-de.js +0 -2
  63. package/locales/el-gr.js +0 -2
  64. package/locales/en-gb.js +0 -2
  65. package/locales/es-es.js +0 -2
  66. package/locales/et-ee.js +0 -2
  67. package/locales/fa-ir.js +0 -2
  68. package/locales/fi-fi.js +0 -2
  69. package/locales/fr-be.js +0 -2
  70. package/locales/fr-ca.js +0 -2
  71. package/locales/fr-fr.js +0 -2
  72. package/locales/ga-ie.js +0 -2
  73. package/locales/gl-es.js +0 -2
  74. package/locales/he-il.js +0 -2
  75. package/locales/hi-in.js +0 -2
  76. package/locales/hr-hr.js +0 -2
  77. package/locales/hu-hu.js +0 -2
  78. package/locales/hy-am.js +0 -2
  79. package/locales/id-id.js +0 -2
  80. package/locales/is-is.js +0 -2
  81. package/locales/it-it.js +0 -2
  82. package/locales/ja-jp.js +0 -2
  83. package/locales/ka-ge.js +0 -2
  84. package/locales/kk-kz.js +0 -2
  85. package/locales/km-kh.js +0 -2
  86. package/locales/kmr-iq.js +0 -2
  87. package/locales/kn-in.js +0 -2
  88. package/locales/ko-kr.js +0 -2
  89. package/locales/lt-lt.js +0 -2
  90. package/locales/lv-lv.js +0 -2
  91. package/locales/mk-mk.js +0 -2
  92. package/locales/ml-in.js +0 -2
  93. package/locales/mn-mn.js +0 -2
  94. package/locales/ms-my.js +0 -2
  95. package/locales/nb-no.js +0 -2
  96. package/locales/ne-np.js +0 -2
  97. package/locales/nl-be.js +0 -2
  98. package/locales/nl-nl.js +0 -2
  99. package/locales/pl-pl.js +0 -2
  100. package/locales/pt-br.js +0 -2
  101. package/locales/pt-pt.js +0 -2
  102. package/locales/ro-ro.js +0 -2
  103. package/locales/ru-ru.js +0 -2
  104. package/locales/sk-sk.js +0 -2
  105. package/locales/sl-si.js +0 -2
  106. package/locales/sr-rs.js +0 -2
  107. package/locales/sv-se.js +0 -2
  108. package/locales/ta-in.js +0 -2
  109. package/locales/th-th.js +0 -2
  110. package/locales/tr-tr.js +0 -2
  111. package/locales/uk-ua.js +0 -2
  112. package/locales/ur-pk.js +0 -2
  113. package/locales/vi-vn.js +0 -2
  114. package/locales/zh-cn.js +0 -2
  115. package/locales/zh-hk.js +0 -2
  116. package/locales/zh-tw.js +0 -2
  117. package/mdui.css +1 -1
  118. package/mdui.esm.js +9 -9
  119. package/mdui.global.js +9 -9
  120. package/package.json +9 -10
  121. package/web-types.en.json +17 -23
  122. package/web-types.zh-cn.json +7 -13
@@ -66,9 +66,16 @@ export const alert = (options) => {
66
66
  $(dialog).find('[slot="action"]').text(getConfirmText());
67
67
  });
68
68
  }
69
- $(dialog).on('close', () => {
70
- isResolve ? resolve() : reject();
71
- offLocaleReady(dialog);
69
+ $(dialog).on('close', (e) => {
70
+ if (e.target === dialog) {
71
+ if (isResolve) {
72
+ resolve();
73
+ }
74
+ else {
75
+ reject();
76
+ }
77
+ offLocaleReady(dialog);
78
+ }
72
79
  });
73
80
  });
74
81
  };
@@ -87,9 +87,16 @@ export const confirm = (options) => {
87
87
  $(dialog).find('[slot="action"]').first().text(getCancelText());
88
88
  });
89
89
  }
90
- $(dialog).on('close', () => {
91
- isResolve ? resolve() : reject();
92
- offLocaleReady(dialog);
90
+ $(dialog).on('close', (e) => {
91
+ if (e.target === dialog) {
92
+ if (isResolve) {
93
+ resolve();
94
+ }
95
+ else {
96
+ reject();
97
+ }
98
+ offLocaleReady(dialog);
99
+ }
93
100
  });
94
101
  });
95
102
  };
@@ -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
- value.call(dialog, dialog);
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;
@@ -122,9 +122,16 @@ export const prompt = (options) => {
122
122
  $(dialog).find('[slot="action"]').first().text(getCancelText());
123
123
  });
124
124
  }
125
- $(dialog).on('close', () => {
126
- isResolve ? resolve(textField.value) : reject();
127
- offLocaleReady(dialog);
125
+ $(dialog).on('close', (e) => {
126
+ if (e.target === dialog) {
127
+ if (isResolve) {
128
+ resolve(textField.value);
129
+ }
130
+ else {
131
+ reject();
132
+ }
133
+ offLocaleReady(dialog);
134
+ }
128
135
  });
129
136
  });
130
137
  };
@@ -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;
package/html-data.en.json CHANGED
@@ -276,7 +276,7 @@
276
276
  },
277
277
  {
278
278
  "name": "href",
279
- "description": "The URL for the hyperlink. If provided, the component is rendered as an `<a>` element and can use link-related attributes.",
279
+ "description": "The URL for the hyperlink. If specified, the component renders as an `<a>` element and can use link-related attributes.",
280
280
  "references": [
281
281
  {
282
282
  "name": "Docs",
@@ -286,7 +286,7 @@
286
286
  },
287
287
  {
288
288
  "name": "download",
289
- "description": "Instructs the browser to download the linked URL.\n\n**Note**: This is only available when `href` is specified.",
289
+ "description": "Instructs the browser to treat the linked URL as a download.\n\n**Note**: This is only available when `href` is specified.",
290
290
  "references": [
291
291
  {
292
292
  "name": "Docs",
@@ -296,7 +296,7 @@
296
296
  },
297
297
  {
298
298
  "name": "target",
299
- "description": "Defines where to open the linked URL. Possible values:\n\n* `_blank`: Opens in a new tab or window.\n* `_parent`: Opens in the parent browsing context or `_self` if no parent.\n* `_self`: Opens in the current browsing context. (Default).\n* `_top`: Opens in the topmost browsing context or `_self` if no ancestors.\n\n**Note**: This is only available when `href` is specified.",
299
+ "description": "Defines where to display the linked URL. Possible values:\n\n* `_blank`: Opens in a new tab or window.\n* `_parent`: Opens in the parent browsing context or `_self` if no parent exists.\n* `_self`: Opens in the current browsing context. (Default).\n* `_top`: Opens in the topmost browsing context or `_self` if no ancestors exist.\n\n**Note**: This is only available when `href` is specified.",
300
300
  "values": [
301
301
  {
302
302
  "name": "_blank",
@@ -304,7 +304,7 @@
304
304
  },
305
305
  {
306
306
  "name": "_parent",
307
- "description": "Opens in the parent browsing context or `_self` if no parent."
307
+ "description": "Opens in the parent browsing context or `_self` if no parent exists."
308
308
  },
309
309
  {
310
310
  "name": "_self",
@@ -312,7 +312,7 @@
312
312
  },
313
313
  {
314
314
  "name": "_top",
315
- "description": "Opens in the topmost browsing context or `_self` if no ancestors."
315
+ "description": "Opens in the topmost browsing context or `_self` if no ancestors exist."
316
316
  }
317
317
  ],
318
318
  "references": [
@@ -324,7 +324,7 @@
324
324
  },
325
325
  {
326
326
  "name": "rel",
327
- "description": "Specifies the relationship of the linked URL as space-separated link types. Possible values:\n\n* `alternate`: Alternate versions of the current document.\n* `author`: The author of the current document or article.\n* `bookmark`: The permalink for the nearest ancestor section.\n* `external`: The referenced document is not part of the same site as the current document.\n* `help`: A link to context-sensitive help.\n* `license`: Indicates that the main content of the current document is covered by the copyright license described by the referenced document.\n* `me`: Indicates that the current document represents the person who owns the linked content.\n* `next`: Indicates that the current document is part of a series and the next document in the series is the referenced document.\n* `nofollow`: Indicates that the current document's original author or publisher does not endorse the referenced document.\n* `noreferrer`: No `Referer` header will be included. Also has the same effect as `noopener`.\n* `opener`: Creates an auxiliary browsing context if the hyperlink would otherwise create a top-level browsing context that is not an auxiliary browsing context (i.e., has \"`_blank`\" as `target` attribute value).\n* `prev`: Indicates that the current document is part of a series and the previous document in the series is the referenced document.\n* `search`: Links to a resource that can be used to search through the current document and its related pages.\n* `tag`: Gives a tag (identified by the given address) that applies to the current document.\n\n**Note**: This is only available when `href` is specified.",
327
+ "description": "Specifies the relationship of the linked URL as space-separated link types. Possible values:\n\n* `alternate`: Alternate versions of the current document.\n* `author`: Author of the current document or article.\n* `bookmark`: Permanent link for the nearest ancestor section.\n* `external`: The referenced document is not part of the same site as the current document.\n* `help`: Link to context-sensitive help.\n* `license`: Indicates that the main content of the current document is covered by the copyright license described by the referenced document.\n* `me`: Indicates that the current document represents the person who owns the linked content.\n* `next`: Indicates that the current document is part of a series and the next document in the series is the referenced document.\n* `nofollow`: Indicates that the current document's original author or publisher does not endorse the referenced document.\n* `noreferrer`: No `Referer` header will be included. Also has the same effect as `noopener`.\n* `opener`: Creates an auxiliary browsing context if the hyperlink would otherwise create a top-level browsing context that is not an auxiliary browsing context (i.e., has \"`_blank`\" as `target` attribute value).\n* `prev`: Indicates that the current document is part of a series and the previous document in the series is the referenced document.\n* `search`: Links to a resource that can be used to search through the current document and its related pages.\n* `tag`: Gives a tag (identified by the given address) that applies to the current document.\n\n**Note**: This is only available when `href` is specified.",
328
328
  "values": [
329
329
  {
330
330
  "name": "alternate",
@@ -332,11 +332,11 @@
332
332
  },
333
333
  {
334
334
  "name": "author",
335
- "description": "The author of the current document or article."
335
+ "description": "Author of the current document or article."
336
336
  },
337
337
  {
338
338
  "name": "bookmark",
339
- "description": "The permalink for the nearest ancestor section."
339
+ "description": "Permanent link for the nearest ancestor section."
340
340
  },
341
341
  {
342
342
  "name": "external",
@@ -344,7 +344,7 @@
344
344
  },
345
345
  {
346
346
  "name": "help",
347
- "description": "A link to context-sensitive help."
347
+ "description": "Link to context-sensitive help."
348
348
  },
349
349
  {
350
350
  "name": "license",
@@ -392,7 +392,7 @@
392
392
  },
393
393
  {
394
394
  "name": "autofocus",
395
- "description": "Specifies that the element should be focused when the page loads.",
395
+ "description": "Determines if the element should be focused when the page loads.",
396
396
  "references": [
397
397
  {
398
398
  "name": "Docs",
@@ -402,7 +402,7 @@
402
402
  },
403
403
  {
404
404
  "name": "tabindex",
405
- "description": "Defines the order in which the element receives focus when navigating with the Tab key.",
405
+ "description": "Specifies the order in which the element receives focus when navigating with the Tab key.",
406
406
  "references": [
407
407
  {
408
408
  "name": "Docs",
@@ -6082,17 +6082,7 @@
6082
6082
  },
6083
6083
  {
6084
6084
  "name": "autocomplete",
6085
- "description": "Enables the browser's autocomplete feature for text input. Possible values:\n\n* `off`: Disables browser autocomplete.\n* `on`: Enables browser autocomplete.",
6086
- "values": [
6087
- {
6088
- "name": "off",
6089
- "description": "Disables browser autocomplete."
6090
- },
6091
- {
6092
- "name": "on",
6093
- "description": "Enables browser autocomplete."
6094
- }
6095
- ],
6085
+ "description": "The `autocomplete` attribute of the `input` element.",
6096
6086
  "references": [
6097
6087
  {
6098
6088
  "name": "Docs",
@@ -6082,17 +6082,7 @@
6082
6082
  },
6083
6083
  {
6084
6084
  "name": "autocomplete",
6085
- "description": "是否使用浏览器的自动填充功能。可选值包括:\n\n* `off`:禁用浏览器的自动填充,使用者必须输入他们想要输入的所有内容。或者网页提供了自己的自动填充方法\n* `on`:浏览器根据用户之前输入的内容或者习惯,在用户输入的时候给出相应输入提示",
6086
- "values": [
6087
- {
6088
- "name": "off",
6089
- "description": "禁用浏览器的自动填充,使用者必须输入他们想要输入的所有内容。或者网页提供了自己的自动填充方法"
6090
- },
6091
- {
6092
- "name": "on",
6093
- "description": "浏览器根据用户之前输入的内容或者习惯,在用户输入的时候给出相应输入提示"
6094
- }
6095
- ],
6085
+ "description": "`input` 元素的 `autocomplete` 属性",
6096
6086
  "references": [
6097
6087
  {
6098
6088
  "name": "开发文档",
@@ -6252,7 +6242,7 @@
6252
6242
  },
6253
6243
  {
6254
6244
  "name": "placement",
6255
- "description": "tooltip 的位置。默认为 `auto`。可选值包括:\n\n* `auto`:自动判断位置。`variant=\"plan\"` 时,优先使用 `top`;`variant=\"rich\"` 时,优先使用 `bottom-right`\n* `top-left`:位于左上方\n* `top-start`:位于上方,左对齐\n* `top`:位于上方,居中对齐\n* `top-end`:位于上方,右对齐\n* `top-right`:位于右上方\n* `bottom-left`:位于左下方\n* `bottom-start`:位于下方,左对齐\n* `bottom`:位于下方,居中对齐\n* `bottom-end`:位于下方,右对齐\n* `bottom-right`:位于右下方\n* `left-start`:位于左侧,顶部对齐\n* `left`:位于左侧,居中对齐\n* `left-end`:位于左侧,底部对齐\n* `right-start`:位于右侧,顶部对齐\n* `right`:位于右侧,居中对齐\n* `right-end`:位于右侧,底部对齐",
6245
+ "description": "tooltip 的位置。默认为 `auto`。可选值包括:\n\n* `auto`:自动判断位置。`variant=\"plain\"` 时,优先使用 `top`;`variant=\"rich\"` 时,优先使用 `bottom-right`\n* `top-left`:位于左上方\n* `top-start`:位于上方,左对齐\n* `top`:位于上方,居中对齐\n* `top-end`:位于上方,右对齐\n* `top-right`:位于右上方\n* `bottom-left`:位于左下方\n* `bottom-start`:位于下方,左对齐\n* `bottom`:位于下方,居中对齐\n* `bottom-end`:位于下方,右对齐\n* `bottom-right`:位于右下方\n* `left-start`:位于左侧,顶部对齐\n* `left`:位于左侧,居中对齐\n* `left-end`:位于左侧,底部对齐\n* `right-start`:位于右侧,顶部对齐\n* `right`:位于右侧,居中对齐\n* `right-end`:位于右侧,底部对齐",
6256
6246
  "values": [
6257
6247
  {
6258
6248
  "name": "auto",