mdui 2.0.3 → 2.0.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.
- package/components/avatar/index.d.ts +13 -13
- package/components/avatar/index.js +4 -4
- package/components/badge/index.d.ts +7 -6
- package/components/badge/index.js +6 -5
- package/components/bottom-app-bar/index.d.ts +4 -3
- package/components/bottom-app-bar/index.js +3 -3
- package/components/button/button-base-style.js +1 -1
- package/components/button/button-base.d.ts +43 -44
- package/components/button/button-base.js +20 -20
- package/components/button/index.d.ts +13 -13
- package/components/button/index.js +12 -12
- package/components/button-icon/index.d.ts +8 -8
- package/components/button-icon/index.js +7 -7
- package/components/card/index.d.ts +8 -8
- package/components/card/index.js +7 -7
- package/components/checkbox/index.d.ts +20 -20
- package/components/checkbox/index.js +18 -18
- package/components/chip/index.d.ts +19 -19
- package/components/chip/index.js +16 -16
- package/components/circular-progress/index.d.ts +2 -2
- package/components/circular-progress/index.js +1 -1
- package/components/collapse/collapse-item.d.ts +4 -4
- package/components/collapse/collapse-item.js +2 -2
- package/components/collapse/collapse.d.ts +6 -9
- package/components/collapse/collapse.js +4 -4
- package/components/dialog/index.d.ts +13 -13
- package/components/dialog/index.js +13 -13
- package/components/divider/index.d.ts +3 -3
- package/components/divider/index.js +3 -3
- package/components/dropdown/index.d.ts +35 -35
- package/components/dropdown/index.js +33 -33
- package/components/fab/index.d.ts +6 -6
- package/components/fab/index.js +6 -6
- package/components/layout/layout-item.d.ts +7 -7
- package/components/layout/layout-item.js +6 -6
- package/components/layout/layout-main.d.ts +2 -2
- package/components/layout/layout-main.js +2 -2
- package/components/layout/layout.d.ts +2 -2
- package/components/layout/layout.js +2 -2
- package/components/linear-progress/index.d.ts +4 -4
- package/components/linear-progress/index.js +3 -3
- package/components/list/list-item.d.ts +17 -17
- package/components/list/list-item.js +7 -7
- package/components/list/list-subheader.d.ts +2 -2
- package/components/list/list-subheader.js +2 -2
- package/components/list/list.d.ts +1 -1
- package/components/list/list.js +1 -1
- package/components/menu/menu-item.d.ts +4 -4
- package/components/menu/menu-item.js +2 -2
- package/components/menu/menu.d.ts +15 -18
- package/components/menu/menu.js +8 -8
- package/components/navigation-bar/navigation-bar-item.d.ts +5 -5
- package/components/navigation-bar/navigation-bar-item.js +4 -4
- package/components/navigation-bar/navigation-bar.d.ts +9 -8
- package/components/navigation-bar/navigation-bar.js +6 -6
- package/components/navigation-drawer/index.d.ts +19 -20
- package/components/navigation-drawer/index.js +44 -30
- package/components/navigation-rail/navigation-rail-item.d.ts +6 -6
- package/components/navigation-rail/navigation-rail-item.js +4 -4
- package/components/navigation-rail/navigation-rail.d.ts +10 -11
- package/components/navigation-rail/navigation-rail.js +9 -10
- package/components/radio/radio-group.d.ts +13 -13
- package/components/radio/radio-group.js +11 -11
- package/components/radio/radio.d.ts +3 -3
- package/components/radio/radio.js +3 -3
- package/components/range-slider/index.d.ts +4 -5
- package/components/range-slider/index.js +4 -5
- package/components/segmented-button/segmented-button-group.d.ts +17 -20
- package/components/segmented-button/segmented-button-group.js +11 -14
- package/components/segmented-button/segmented-button.d.ts +3 -3
- package/components/segmented-button/segmented-button.js +3 -3
- package/components/select/index.d.ts +31 -32
- package/components/select/index.js +19 -20
- package/components/slider/index.d.ts +1 -1
- package/components/slider/index.js +1 -1
- package/components/slider/slider-base.d.ts +15 -15
- package/components/slider/slider-base.js +13 -13
- package/components/snackbar/index.d.ts +21 -21
- package/components/snackbar/index.js +15 -15
- package/components/switch/index.d.ts +14 -14
- package/components/switch/index.js +11 -11
- package/components/tabs/tab-panel.d.ts +3 -3
- package/components/tabs/tab-panel.js +2 -2
- package/components/tabs/tab.d.ts +6 -6
- package/components/tabs/tab.js +5 -5
- package/components/tabs/tabs.d.ts +19 -19
- package/components/tabs/tabs.js +17 -17
- package/components/text-field/index.d.ts +51 -51
- package/components/text-field/index.js +25 -25
- package/components/tooltip/index.d.ts +31 -31
- package/components/tooltip/index.js +28 -28
- package/components/top-app-bar/top-app-bar-title.d.ts +4 -4
- package/components/top-app-bar/top-app-bar-title.js +4 -4
- package/components/top-app-bar/top-app-bar.d.ts +5 -5
- package/components/top-app-bar/top-app-bar.js +4 -4
- package/css-data.en.json +2826 -0
- package/css-data.zh-cn.json +374 -367
- package/custom-elements.json +1072 -1115
- package/html-data.en.json +6551 -0
- package/html-data.zh-cn.json +1420 -1435
- package/jsx.en.d.ts +3303 -0
- package/jsx.zh-cn.d.ts +3351 -0
- package/mdui.esm.js +9 -9
- package/mdui.global.js +5 -5
- package/package.json +6 -5
- package/web-types.en.json +11718 -0
- package/web-types.zh-cn.json +3222 -3232
|
@@ -12,22 +12,22 @@ declare const Card_base: import("@open-wc/dedupe-mixin").Constructor<import("@md
|
|
|
12
12
|
* @event focus - 获得焦点时触发
|
|
13
13
|
* @event blur - 失去焦点时触发
|
|
14
14
|
*
|
|
15
|
-
* @slot -
|
|
15
|
+
* @slot - 卡片的内容
|
|
16
16
|
*
|
|
17
|
-
* @cssprop --shape-corner -
|
|
17
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
18
18
|
*/
|
|
19
19
|
export declare class Card extends Card_base<CardEventMap> {
|
|
20
20
|
static styles: CSSResultGroup;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* 卡片的形状。可选值包括:
|
|
23
23
|
*
|
|
24
|
-
* * `elevated
|
|
25
|
-
* * `filled
|
|
26
|
-
* * `outlined
|
|
24
|
+
* * `elevated`:带阴影的卡片,与背景的视觉分离度较高
|
|
25
|
+
* * `filled`:带填充色的卡片,与背景的视觉分离度较低
|
|
26
|
+
* * `outlined`:带边框的卡片,与背景的视觉分离度最高
|
|
27
27
|
*/
|
|
28
|
-
variant:
|
|
28
|
+
variant: /*带阴影的卡片,与背景的视觉分离度较高*/ 'elevated' | /*带填充色的卡片,与背景的视觉分离度较低*/ 'filled' | /*带边框的卡片,与背景的视觉分离度最高*/ 'outlined';
|
|
29
29
|
/**
|
|
30
|
-
* 是否可点击。为 `true`
|
|
30
|
+
* 是否可点击。为 `true` 时,卡片将具有鼠标悬浮效果和点击涟漪效果
|
|
31
31
|
*/
|
|
32
32
|
clickable: boolean;
|
|
33
33
|
/**
|
package/components/card/index.js
CHANGED
|
@@ -19,23 +19,23 @@ import { style } from './style.js';
|
|
|
19
19
|
* @event focus - 获得焦点时触发
|
|
20
20
|
* @event blur - 失去焦点时触发
|
|
21
21
|
*
|
|
22
|
-
* @slot -
|
|
22
|
+
* @slot - 卡片的内容
|
|
23
23
|
*
|
|
24
|
-
* @cssprop --shape-corner -
|
|
24
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
25
25
|
*/
|
|
26
26
|
let Card = class Card extends AnchorMixin(RippleMixin(FocusableMixin(MduiElement))) {
|
|
27
27
|
constructor() {
|
|
28
28
|
super(...arguments);
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* 卡片的形状。可选值包括:
|
|
31
31
|
*
|
|
32
|
-
* * `elevated
|
|
33
|
-
* * `filled
|
|
34
|
-
* * `outlined
|
|
32
|
+
* * `elevated`:带阴影的卡片,与背景的视觉分离度较高
|
|
33
|
+
* * `filled`:带填充色的卡片,与背景的视觉分离度较低
|
|
34
|
+
* * `outlined`:带边框的卡片,与背景的视觉分离度最高
|
|
35
35
|
*/
|
|
36
36
|
this.variant = 'elevated';
|
|
37
37
|
/**
|
|
38
|
-
* 是否可点击。为 `true`
|
|
38
|
+
* 是否可点击。为 `true` 时,卡片将具有鼠标悬浮效果和点击涟漪效果
|
|
39
39
|
*/
|
|
40
40
|
this.clickable = false;
|
|
41
41
|
/**
|
|
@@ -20,16 +20,16 @@ declare const Checkbox_base: import("@open-wc/dedupe-mixin").Constructor<import(
|
|
|
20
20
|
* @event input - 选中状态变更时触发
|
|
21
21
|
* @event invalid - 表单字段验证未通过时触发
|
|
22
22
|
*
|
|
23
|
-
* @slot -
|
|
24
|
-
* @slot unchecked-icon -
|
|
25
|
-
* @slot checked-icon -
|
|
26
|
-
* @slot indeterminate-icon -
|
|
23
|
+
* @slot - 复选框文本
|
|
24
|
+
* @slot unchecked-icon - 未选中状态的图标
|
|
25
|
+
* @slot checked-icon - 选中状态的图标
|
|
26
|
+
* @slot indeterminate-icon - 不确定状态的图标
|
|
27
27
|
*
|
|
28
28
|
* @csspart control - 左侧图标容器
|
|
29
|
-
* @csspart unchecked-icon -
|
|
30
|
-
* @csspart checked-icon -
|
|
31
|
-
* @csspart indeterminate-icon -
|
|
32
|
-
* @csspart label -
|
|
29
|
+
* @csspart unchecked-icon - 未选中状态的图标
|
|
30
|
+
* @csspart checked-icon - 选中状态的图标
|
|
31
|
+
* @csspart indeterminate-icon - 不确定状态的图标
|
|
32
|
+
* @csspart label - 复选框文本
|
|
33
33
|
*/
|
|
34
34
|
export declare class Checkbox extends Checkbox_base<CheckboxEventMap> implements FormControl {
|
|
35
35
|
static styles: CSSResultGroup;
|
|
@@ -42,21 +42,21 @@ export declare class Checkbox extends Checkbox_base<CheckboxEventMap> implements
|
|
|
42
42
|
*/
|
|
43
43
|
checked: boolean;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* 默认选中状态。在重置表单时,将恢复为此状态。此属性只能通过 JavaScript 属性设置
|
|
46
46
|
*/
|
|
47
47
|
defaultChecked: boolean;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* 是否处于不确定状态
|
|
50
50
|
*/
|
|
51
51
|
indeterminate: boolean;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* 提交表单时,是否必须选中此复选框
|
|
54
54
|
*/
|
|
55
55
|
required: boolean;
|
|
56
56
|
/**
|
|
57
|
-
* 关联的
|
|
57
|
+
* 关联的 `<form>` 元素。此属性值应为同一页面中的一个 `<form>` 元素的 `id`。
|
|
58
58
|
*
|
|
59
|
-
*
|
|
59
|
+
* 如果未指定此属性,则该元素必须是 `<form>` 元素的子元素。通过此属性,你可以将元素放置在页面的任何位置,而不仅仅是 `<form>` 元素的子元素。
|
|
60
60
|
*/
|
|
61
61
|
form?: string;
|
|
62
62
|
/**
|
|
@@ -87,11 +87,11 @@ export declare class Checkbox extends Checkbox_base<CheckboxEventMap> implements
|
|
|
87
87
|
private readonly rippleRef;
|
|
88
88
|
private readonly formController;
|
|
89
89
|
/**
|
|
90
|
-
*
|
|
90
|
+
* 表单验证状态对象,具体参见 [`ValidityState`](https://developer.mozilla.org/zh-CN/docs/Web/API/ValidityState)
|
|
91
91
|
*/
|
|
92
92
|
get validity(): ValidityState;
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
94
|
+
* 如果表单验证未通过,此属性将包含提示信息。如果验证通过,此属性将为空字符串
|
|
95
95
|
*/
|
|
96
96
|
get validationMessage(): string;
|
|
97
97
|
protected get rippleElement(): Ripple;
|
|
@@ -101,19 +101,19 @@ export declare class Checkbox extends Checkbox_base<CheckboxEventMap> implements
|
|
|
101
101
|
private onDisabledChange;
|
|
102
102
|
private onCheckedChange;
|
|
103
103
|
/**
|
|
104
|
-
*
|
|
104
|
+
* 检查表单字段是否通过验证。如果未通过,返回 `false` 并触发 `invalid` 事件;如果通过,返回 `true`
|
|
105
105
|
*/
|
|
106
106
|
checkValidity(): boolean;
|
|
107
107
|
/**
|
|
108
|
-
*
|
|
108
|
+
* 检查表单字段是否通过验证。如果未通过,返回 `false` 并触发 `invalid` 事件;如果通过,返回 `true`。
|
|
109
109
|
*
|
|
110
|
-
*
|
|
110
|
+
* 如果验证未通过,还会在组件上显示验证失败的提示。
|
|
111
111
|
*/
|
|
112
112
|
reportValidity(): boolean;
|
|
113
113
|
/**
|
|
114
|
-
*
|
|
114
|
+
* 设置自定义的错误提示文本。只要这个文本不为空,就表示字段未通过验证
|
|
115
115
|
*
|
|
116
|
-
* @param message
|
|
116
|
+
* @param message 自定义的错误提示文本
|
|
117
117
|
*/
|
|
118
118
|
setCustomValidity(message: string): void;
|
|
119
119
|
protected render(): TemplateResult;
|
|
@@ -31,16 +31,16 @@ import { style } from './style.js';
|
|
|
31
31
|
* @event input - 选中状态变更时触发
|
|
32
32
|
* @event invalid - 表单字段验证未通过时触发
|
|
33
33
|
*
|
|
34
|
-
* @slot -
|
|
35
|
-
* @slot unchecked-icon -
|
|
36
|
-
* @slot checked-icon -
|
|
37
|
-
* @slot indeterminate-icon -
|
|
34
|
+
* @slot - 复选框文本
|
|
35
|
+
* @slot unchecked-icon - 未选中状态的图标
|
|
36
|
+
* @slot checked-icon - 选中状态的图标
|
|
37
|
+
* @slot indeterminate-icon - 不确定状态的图标
|
|
38
38
|
*
|
|
39
39
|
* @csspart control - 左侧图标容器
|
|
40
|
-
* @csspart unchecked-icon -
|
|
41
|
-
* @csspart checked-icon -
|
|
42
|
-
* @csspart indeterminate-icon -
|
|
43
|
-
* @csspart label -
|
|
40
|
+
* @csspart unchecked-icon - 未选中状态的图标
|
|
41
|
+
* @csspart checked-icon - 选中状态的图标
|
|
42
|
+
* @csspart indeterminate-icon - 不确定状态的图标
|
|
43
|
+
* @csspart label - 复选框文本
|
|
44
44
|
*/
|
|
45
45
|
let Checkbox = class Checkbox extends RippleMixin(FocusableMixin(MduiElement)) {
|
|
46
46
|
constructor() {
|
|
@@ -54,15 +54,15 @@ let Checkbox = class Checkbox extends RippleMixin(FocusableMixin(MduiElement)) {
|
|
|
54
54
|
*/
|
|
55
55
|
this.checked = false;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* 默认选中状态。在重置表单时,将恢复为此状态。此属性只能通过 JavaScript 属性设置
|
|
58
58
|
*/
|
|
59
59
|
this.defaultChecked = false;
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* 是否处于不确定状态
|
|
62
62
|
*/
|
|
63
63
|
this.indeterminate = false;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* 提交表单时,是否必须选中此复选框
|
|
66
66
|
*/
|
|
67
67
|
this.required = false;
|
|
68
68
|
/**
|
|
@@ -86,13 +86,13 @@ let Checkbox = class Checkbox extends RippleMixin(FocusableMixin(MduiElement)) {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
89
|
+
* 表单验证状态对象,具体参见 [`ValidityState`](https://developer.mozilla.org/zh-CN/docs/Web/API/ValidityState)
|
|
90
90
|
*/
|
|
91
91
|
get validity() {
|
|
92
92
|
return this.inputRef.value.validity;
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
|
-
*
|
|
95
|
+
* 如果表单验证未通过,此属性将包含提示信息。如果验证通过,此属性将为空字符串
|
|
96
96
|
*/
|
|
97
97
|
get validationMessage() {
|
|
98
98
|
return this.inputRef.value.validationMessage;
|
|
@@ -126,7 +126,7 @@ let Checkbox = class Checkbox extends RippleMixin(FocusableMixin(MduiElement)) {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
129
|
-
*
|
|
129
|
+
* 检查表单字段是否通过验证。如果未通过,返回 `false` 并触发 `invalid` 事件;如果通过,返回 `true`
|
|
130
130
|
*/
|
|
131
131
|
checkValidity() {
|
|
132
132
|
const valid = this.inputRef.value.checkValidity();
|
|
@@ -140,9 +140,9 @@ let Checkbox = class Checkbox extends RippleMixin(FocusableMixin(MduiElement)) {
|
|
|
140
140
|
return valid;
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
|
-
*
|
|
143
|
+
* 检查表单字段是否通过验证。如果未通过,返回 `false` 并触发 `invalid` 事件;如果通过,返回 `true`。
|
|
144
144
|
*
|
|
145
|
-
*
|
|
145
|
+
* 如果验证未通过,还会在组件上显示验证失败的提示。
|
|
146
146
|
*/
|
|
147
147
|
reportValidity() {
|
|
148
148
|
this.invalid = !this.inputRef.value.reportValidity();
|
|
@@ -161,9 +161,9 @@ let Checkbox = class Checkbox extends RippleMixin(FocusableMixin(MduiElement)) {
|
|
|
161
161
|
return !this.invalid;
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
|
-
*
|
|
164
|
+
* 设置自定义的错误提示文本。只要这个文本不为空,就表示字段未通过验证
|
|
165
165
|
*
|
|
166
|
-
* @param message
|
|
166
|
+
* @param message 自定义的错误提示文本
|
|
167
167
|
*/
|
|
168
168
|
setCustomValidity(message) {
|
|
169
169
|
this.inputRef.value.setCustomValidity(message);
|
|
@@ -17,35 +17,35 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
|
17
17
|
* @event change - 选中状态变更时触发
|
|
18
18
|
* @event delete - 点击删除图标时触发
|
|
19
19
|
*
|
|
20
|
-
* @slot -
|
|
20
|
+
* @slot - 纸片文本
|
|
21
21
|
* @slot icon - 左侧元素
|
|
22
22
|
* @slot end-icon - 右侧元素
|
|
23
|
-
* @slot selected-icon -
|
|
24
|
-
* @slot delete-icon -
|
|
23
|
+
* @slot selected-icon - 选中状态下的左侧元素
|
|
24
|
+
* @slot delete-icon - 可删除时的右侧删除元素
|
|
25
25
|
*
|
|
26
|
-
* @csspart button - 内部的
|
|
27
|
-
* @csspart label -
|
|
26
|
+
* @csspart button - 内部的 `<button>` 或 `<a>` 元素
|
|
27
|
+
* @csspart label - 纸片文本
|
|
28
28
|
* @csspart icon - 左侧图标
|
|
29
29
|
* @csspart end-icon - 右侧图标
|
|
30
|
-
* @csspart selected-icon -
|
|
31
|
-
* @csspart delete-icon -
|
|
30
|
+
* @csspart selected-icon - 选中状态下的左侧图标
|
|
31
|
+
* @csspart delete-icon - 可删除时的右侧删除图标
|
|
32
32
|
* @csspart loading - 加载中状态的 `<mdui-circular-progress>` 元素
|
|
33
33
|
*
|
|
34
|
-
* @cssprop --shape-corner -
|
|
34
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
35
35
|
*/
|
|
36
36
|
export declare class Chip extends ButtonBase<ChipEventMap> {
|
|
37
37
|
static styles: CSSResultGroup;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* 纸片的形状。可选值包括:
|
|
40
40
|
*
|
|
41
|
-
* * `assist
|
|
42
|
-
* * `filter
|
|
43
|
-
* * `input
|
|
44
|
-
* * `suggestion
|
|
41
|
+
* * `assist`:用于显示与当前上下文相关的辅助操作,如在点餐页面提供分享、收藏等功能
|
|
42
|
+
* * `filter`:用于对内容进行筛选,如在搜索结果页过滤搜索结果
|
|
43
|
+
* * `input`:用于表示用户输入的信息片段,如在 Gmail 的“收件人”字段中的联系人
|
|
44
|
+
* * `suggestion`:用于提供动态生成的推荐信息,以简化用户操作,如在聊天应用中预测用户可能想发送的信息
|
|
45
45
|
*/
|
|
46
|
-
variant:
|
|
46
|
+
variant: /*用于显示与当前上下文相关的辅助操作,如在点餐页面提供分享、收藏等功能*/ 'assist' | /*用于对内容进行筛选,如在搜索结果页过滤搜索结果*/ 'filter' | /*用于表示用户输入的信息片段,如在 Gmail 的“收件人”字段中的联系人*/ 'input' | /*用于提供动态生成的推荐信息,以简化用户操作,如在聊天应用中预测用户可能想发送的信息*/ 'suggestion';
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* 是否显示阴影
|
|
49
49
|
*/
|
|
50
50
|
elevated: boolean;
|
|
51
51
|
/**
|
|
@@ -53,11 +53,11 @@ export declare class Chip extends ButtonBase<ChipEventMap> {
|
|
|
53
53
|
*/
|
|
54
54
|
selectable: boolean;
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* 是否已选中
|
|
57
57
|
*/
|
|
58
58
|
selected: boolean;
|
|
59
59
|
/**
|
|
60
|
-
* 是否可删除。为 `true`
|
|
60
|
+
* 是否可删除。为 `true` 时,纸片右侧会显示删除图标
|
|
61
61
|
*/
|
|
62
62
|
deletable: boolean;
|
|
63
63
|
/**
|
|
@@ -65,7 +65,7 @@ export declare class Chip extends ButtonBase<ChipEventMap> {
|
|
|
65
65
|
*/
|
|
66
66
|
icon?: string;
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
68
|
+
* 选中状态下左侧的 Material Icons 图标名。也可以通过 `slot="selected-icon"` 设置
|
|
69
69
|
*/
|
|
70
70
|
selectedIcon?: string;
|
|
71
71
|
/**
|
|
@@ -73,7 +73,7 @@ export declare class Chip extends ButtonBase<ChipEventMap> {
|
|
|
73
73
|
*/
|
|
74
74
|
endIcon?: string;
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
76
|
+
* 可删除时,右侧删除图标的 Material Icons 图标名。也可以通过 `slot="delete-icon"` 设置
|
|
77
77
|
*/
|
|
78
78
|
deleteIcon?: string;
|
|
79
79
|
private readonly rippleRef;
|
package/components/chip/index.js
CHANGED
|
@@ -25,36 +25,36 @@ import { style } from './style.js';
|
|
|
25
25
|
* @event change - 选中状态变更时触发
|
|
26
26
|
* @event delete - 点击删除图标时触发
|
|
27
27
|
*
|
|
28
|
-
* @slot -
|
|
28
|
+
* @slot - 纸片文本
|
|
29
29
|
* @slot icon - 左侧元素
|
|
30
30
|
* @slot end-icon - 右侧元素
|
|
31
|
-
* @slot selected-icon -
|
|
32
|
-
* @slot delete-icon -
|
|
31
|
+
* @slot selected-icon - 选中状态下的左侧元素
|
|
32
|
+
* @slot delete-icon - 可删除时的右侧删除元素
|
|
33
33
|
*
|
|
34
|
-
* @csspart button - 内部的
|
|
35
|
-
* @csspart label -
|
|
34
|
+
* @csspart button - 内部的 `<button>` 或 `<a>` 元素
|
|
35
|
+
* @csspart label - 纸片文本
|
|
36
36
|
* @csspart icon - 左侧图标
|
|
37
37
|
* @csspart end-icon - 右侧图标
|
|
38
|
-
* @csspart selected-icon -
|
|
39
|
-
* @csspart delete-icon -
|
|
38
|
+
* @csspart selected-icon - 选中状态下的左侧图标
|
|
39
|
+
* @csspart delete-icon - 可删除时的右侧删除图标
|
|
40
40
|
* @csspart loading - 加载中状态的 `<mdui-circular-progress>` 元素
|
|
41
41
|
*
|
|
42
|
-
* @cssprop --shape-corner -
|
|
42
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
43
43
|
*/
|
|
44
44
|
let Chip = class Chip extends ButtonBase {
|
|
45
45
|
constructor() {
|
|
46
46
|
super();
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* 纸片的形状。可选值包括:
|
|
49
49
|
*
|
|
50
|
-
* * `assist
|
|
51
|
-
* * `filter
|
|
52
|
-
* * `input
|
|
53
|
-
* * `suggestion
|
|
50
|
+
* * `assist`:用于显示与当前上下文相关的辅助操作,如在点餐页面提供分享、收藏等功能
|
|
51
|
+
* * `filter`:用于对内容进行筛选,如在搜索结果页过滤搜索结果
|
|
52
|
+
* * `input`:用于表示用户输入的信息片段,如在 Gmail 的“收件人”字段中的联系人
|
|
53
|
+
* * `suggestion`:用于提供动态生成的推荐信息,以简化用户操作,如在聊天应用中预测用户可能想发送的信息
|
|
54
54
|
*/
|
|
55
55
|
this.variant = 'assist';
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* 是否显示阴影
|
|
58
58
|
*/
|
|
59
59
|
this.elevated = false;
|
|
60
60
|
/**
|
|
@@ -62,11 +62,11 @@ let Chip = class Chip extends ButtonBase {
|
|
|
62
62
|
*/
|
|
63
63
|
this.selectable = false;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* 是否已选中
|
|
66
66
|
*/
|
|
67
67
|
this.selected = false;
|
|
68
68
|
/**
|
|
69
|
-
* 是否可删除。为 `true`
|
|
69
|
+
* 是否可删除。为 `true` 时,纸片右侧会显示删除图标
|
|
70
70
|
*/
|
|
71
71
|
this.deletable = false;
|
|
72
72
|
this.rippleRef = createRef();
|
|
@@ -10,11 +10,11 @@ import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
|
10
10
|
export declare class CircularProgress extends MduiElement<CircularProgressEventMap> {
|
|
11
11
|
static styles: CSSResultGroup;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* 进度指示器的最大值。默认为 `1`
|
|
14
14
|
*/
|
|
15
15
|
max: number;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* 进度指示器的当前值。如果未指定该值,则显示为不确定状态
|
|
18
18
|
*/
|
|
19
19
|
value?: number;
|
|
20
20
|
protected render(): TemplateResult;
|
|
@@ -3,7 +3,7 @@ import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
|
3
3
|
import type { JQ } from '@mdui/jq/shared/core.js';
|
|
4
4
|
import type { CSSResultGroup, TemplateResult, PropertyValues } from 'lit';
|
|
5
5
|
/**
|
|
6
|
-
* @summary
|
|
6
|
+
* @summary 折叠面板项组件,需配合 `<mdui-collapse>` 组件使用
|
|
7
7
|
*
|
|
8
8
|
* ```html
|
|
9
9
|
* <mdui-collapse>
|
|
@@ -26,15 +26,15 @@ import type { CSSResultGroup, TemplateResult, PropertyValues } from 'lit';
|
|
|
26
26
|
export declare class CollapseItem extends MduiElement<CollapseItemEventMap> {
|
|
27
27
|
static styles: CSSResultGroup;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* 此折叠面板项的值
|
|
30
30
|
*/
|
|
31
31
|
value?: string;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* 此折叠面板项的头部文本
|
|
34
34
|
*/
|
|
35
35
|
header?: string;
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* 是否禁用此折叠面板项
|
|
38
38
|
*/
|
|
39
39
|
disabled: boolean;
|
|
40
40
|
/**
|
|
@@ -12,7 +12,7 @@ import { uniqueId } from '@mdui/shared/helpers/uniqueId.js';
|
|
|
12
12
|
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
13
13
|
import { collapseItemStyle } from './collapse-item-style.js';
|
|
14
14
|
/**
|
|
15
|
-
* @summary
|
|
15
|
+
* @summary 折叠面板项组件,需配合 `<mdui-collapse>` 组件使用
|
|
16
16
|
*
|
|
17
17
|
* ```html
|
|
18
18
|
* <mdui-collapse>
|
|
@@ -36,7 +36,7 @@ let CollapseItem = class CollapseItem extends MduiElement {
|
|
|
36
36
|
constructor() {
|
|
37
37
|
super(...arguments);
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* 是否禁用此折叠面板项
|
|
40
40
|
*/
|
|
41
41
|
this.disabled = false;
|
|
42
42
|
/**
|
|
@@ -2,7 +2,7 @@ import '@mdui/jq/methods/is.js';
|
|
|
2
2
|
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
3
3
|
import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
4
4
|
/**
|
|
5
|
-
* @summary
|
|
5
|
+
* @summary 折叠面板组件,需配合 `<mdui-collapse-item>` 组件使用
|
|
6
6
|
*
|
|
7
7
|
* ```html
|
|
8
8
|
* <mdui-collapse>
|
|
@@ -11,27 +11,24 @@ import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
|
11
11
|
* </mdui-collapse>
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
|
-
* @event change -
|
|
14
|
+
* @event change - 当前展开的折叠面板项变化时触发
|
|
15
15
|
*
|
|
16
16
|
* @slot - `<mdui-collapse-item>` 组件
|
|
17
17
|
*/
|
|
18
18
|
export declare class Collapse extends MduiElement<CollapseEventMap> {
|
|
19
19
|
static styles: CSSResultGroup;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* 是否启用手风琴模式
|
|
22
22
|
*/
|
|
23
23
|
accordion: boolean;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* 当前展开的 `<mdui-collapse-item>` 的值
|
|
26
26
|
*
|
|
27
|
-
* Note
|
|
28
|
-
* 该属性的 HTML 属性始终为字符串,且仅在 `accordion` 为 `true` 时可以设置初始值;
|
|
29
|
-
* 该属性的 JavaScript 属性值在 `accordion` 为 `true` 时为字符串、在 `accordion` 为 `false` 时为字符串数组。
|
|
30
|
-
* 所以,在 `accordion` 为 `false` 时,如果要修改该值,只能通过修改 JavaScript 属性值实现。
|
|
27
|
+
* **Note**:该属性的 HTML 属性始终为字符串,只有在 `accordion` 为 `true` 时,才能设置初始值;该属性的 JavaScript 属性值在 `accordion` 为 `true` 时为字符串,在 `accordion` 为 `false` 时为字符串数组。因此,当 `accordion` 为 `false` 时,只能通过修改 JavaScript 属性值来改变此值。
|
|
31
28
|
*/
|
|
32
29
|
value?: string | string[];
|
|
33
30
|
/**
|
|
34
|
-
*
|
|
31
|
+
* 是否禁用此折叠面板
|
|
35
32
|
*/
|
|
36
33
|
disabled: boolean;
|
|
37
34
|
private activeKeys;
|
|
@@ -12,7 +12,7 @@ import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
|
12
12
|
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
13
13
|
import { collapseStyle } from './collapse-style.js';
|
|
14
14
|
/**
|
|
15
|
-
* @summary
|
|
15
|
+
* @summary 折叠面板组件,需配合 `<mdui-collapse-item>` 组件使用
|
|
16
16
|
*
|
|
17
17
|
* ```html
|
|
18
18
|
* <mdui-collapse>
|
|
@@ -21,7 +21,7 @@ import { collapseStyle } from './collapse-style.js';
|
|
|
21
21
|
* </mdui-collapse>
|
|
22
22
|
* ```
|
|
23
23
|
*
|
|
24
|
-
* @event change -
|
|
24
|
+
* @event change - 当前展开的折叠面板项变化时触发
|
|
25
25
|
*
|
|
26
26
|
* @slot - `<mdui-collapse-item>` 组件
|
|
27
27
|
*/
|
|
@@ -29,11 +29,11 @@ let Collapse = class Collapse extends MduiElement {
|
|
|
29
29
|
constructor() {
|
|
30
30
|
super(...arguments);
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* 是否启用手风琴模式
|
|
33
33
|
*/
|
|
34
34
|
this.accordion = false;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* 是否禁用此折叠面板
|
|
37
37
|
*/
|
|
38
38
|
this.disabled = false;
|
|
39
39
|
// 因为 collapse-item 的 value 可能会重复,所以在每个 collapse-item 元素上都添加了一个唯一的 key,通过 activeKey 来记录激活状态的 key
|
|
@@ -8,10 +8,10 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
|
8
8
|
* <mdui-dialog>content</mdui-dialog>
|
|
9
9
|
* ```
|
|
10
10
|
*
|
|
11
|
-
* @event open -
|
|
12
|
-
* @event opened -
|
|
13
|
-
* @event close -
|
|
14
|
-
* @event closed -
|
|
11
|
+
* @event open - 对话框开始打开时触发。可以通过调用 `event.preventDefault()` 阻止对话框打开
|
|
12
|
+
* @event opened - 对话框打开动画完成后触发
|
|
13
|
+
* @event close - 对话框开始关闭时触发。可以通过调用 `event.preventDefault()` 阻止对话框关闭
|
|
14
|
+
* @event closed - 对话框关闭动画完成后触发
|
|
15
15
|
* @event overlay-click - 点击遮罩层时触发
|
|
16
16
|
*
|
|
17
17
|
* @slot header - 顶部元素,默认包含 `icon` slot 和 `headline` slot
|
|
@@ -23,15 +23,15 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
|
23
23
|
*
|
|
24
24
|
* @csspart overlay - 遮罩层
|
|
25
25
|
* @csspart panel - 对话框容器
|
|
26
|
-
* @csspart header - 对话框 header
|
|
27
|
-
* @csspart icon -
|
|
28
|
-
* @csspart headline -
|
|
29
|
-
* @csspart body -
|
|
26
|
+
* @csspart header - 对话框 header 部分,包含 icon 和 headline
|
|
27
|
+
* @csspart icon - 顶部图标,位于 header 中
|
|
28
|
+
* @csspart headline - 顶部标题,位于 header 中
|
|
29
|
+
* @csspart body - 对话框 body 部分
|
|
30
30
|
* @csspart description - 副文本部分,位于 body 中
|
|
31
31
|
* @csspart action - 底部操作按钮
|
|
32
32
|
*
|
|
33
|
-
* @cssprop --shape-corner -
|
|
34
|
-
* @cssprop --z-index - 组件的 CSS
|
|
33
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
34
|
+
* @cssprop --z-index - 组件的 CSS `z-index` 值
|
|
35
35
|
*/
|
|
36
36
|
export declare class Dialog extends MduiElement<DialogEventMap> {
|
|
37
37
|
static styles: CSSResultGroup;
|
|
@@ -52,15 +52,15 @@ export declare class Dialog extends MduiElement<DialogEventMap> {
|
|
|
52
52
|
*/
|
|
53
53
|
open: boolean;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* 是否全屏显示对话框
|
|
56
56
|
*/
|
|
57
57
|
fullscreen: boolean;
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* 是否允许按下 ESC 键关闭对话框
|
|
60
60
|
*/
|
|
61
61
|
closeOnEsc: boolean;
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
63
|
+
* 是否允许点击遮罩层关闭对话框
|
|
64
64
|
*/
|
|
65
65
|
closeOnOverlayClick: boolean;
|
|
66
66
|
/**
|