mdui 2.0.2 → 2.0.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/index.d.ts +4 -2
- package/components/avatar/index.js +3 -2
- package/components/badge/index.d.ts +4 -2
- package/components/badge/index.js +3 -2
- package/components/bottom-app-bar/index.d.ts +7 -1
- package/components/bottom-app-bar/index.js +5 -6
- package/components/button/button-base.d.ts +3 -3
- package/components/button/button-base.js +7 -5
- package/components/button/index.d.ts +6 -1
- package/components/button-icon/index.d.ts +7 -1
- package/components/button-icon/index.js +1 -2
- package/components/card/index.d.ts +7 -3
- package/components/card/index.js +3 -2
- package/components/checkbox/index.d.ts +10 -3
- package/components/checkbox/index.js +7 -7
- package/components/chip/index.d.ts +8 -1
- package/components/chip/index.js +3 -4
- package/components/circular-progress/index.d.ts +4 -2
- package/components/circular-progress/index.js +3 -2
- package/components/collapse/collapse-item.d.ts +13 -2
- package/components/collapse/collapse-item.js +5 -5
- package/components/collapse/collapse.d.ts +10 -2
- package/components/collapse/collapse.js +6 -6
- package/components/dialog/index.d.ts +9 -2
- package/components/dialog/index.js +10 -14
- package/components/divider/index.d.ts +4 -2
- package/components/divider/index.js +3 -2
- package/components/dropdown/index.d.ts +9 -2
- package/components/dropdown/index.js +17 -15
- package/components/fab/index.d.ts +6 -1
- package/components/icon/index.d.ts +4 -2
- package/components/icon/index.js +3 -2
- package/components/layout/layout-item-base.d.ts +3 -2
- package/components/layout/layout-item-base.js +2 -2
- package/components/layout/layout-item.d.ts +4 -3
- package/components/layout/layout-main.d.ts +4 -2
- package/components/layout/layout-main.js +3 -2
- package/components/layout/layout.d.ts +4 -2
- package/components/layout/layout.js +3 -2
- package/components/linear-progress/index.d.ts +4 -2
- package/components/linear-progress/index.js +3 -2
- package/components/list/list-item-style.js +1 -1
- package/components/list/list-item.d.ts +7 -3
- package/components/list/list-item.js +3 -2
- package/components/list/list-subheader.d.ts +4 -2
- package/components/list/list-subheader.js +3 -2
- package/components/list/list.d.ts +4 -2
- package/components/list/list.js +3 -2
- package/components/menu/menu-item.d.ts +11 -3
- package/components/menu/menu-item.js +9 -13
- package/components/menu/menu.d.ts +5 -2
- package/components/menu/menu.js +5 -5
- package/components/navigation-bar/navigation-bar-item.d.ts +7 -3
- package/components/navigation-bar/navigation-bar-item.js +3 -2
- package/components/navigation-bar/navigation-bar.d.ts +8 -1
- package/components/navigation-bar/navigation-bar.js +9 -7
- package/components/navigation-drawer/index.d.ts +8 -1
- package/components/navigation-drawer/index.js +7 -8
- package/components/navigation-drawer/style.js +1 -1
- package/components/navigation-rail/navigation-rail-item.d.ts +7 -3
- package/components/navigation-rail/navigation-rail-item.js +3 -2
- package/components/navigation-rail/navigation-rail.d.ts +4 -1
- package/components/navigation-rail/navigation-rail.js +4 -2
- package/components/radio/radio-group.d.ts +7 -2
- package/components/radio/radio-group.js +10 -13
- package/components/radio/radio.d.ts +8 -3
- package/components/radio/radio.js +4 -4
- package/components/range-slider/index.d.ts +9 -3
- package/components/range-slider/index.js +6 -2
- package/components/ripple/index.d.ts +4 -2
- package/components/ripple/index.js +3 -2
- package/components/ripple/ripple-mixin.d.ts +1 -1
- package/components/ripple/ripple-mixin.js +0 -1
- package/components/segmented-button/segmented-button-group-style.js +1 -1
- package/components/segmented-button/segmented-button-group.d.ts +6 -2
- package/components/segmented-button/segmented-button-group.js +9 -9
- package/components/segmented-button/segmented-button.d.ts +6 -1
- package/components/select/index.d.ts +11 -3
- package/components/select/index.js +5 -5
- package/components/slider/index.d.ts +8 -1
- package/components/slider/index.js +4 -9
- package/components/slider/slider-base.d.ts +7 -3
- package/components/slider/slider-base.js +27 -8
- package/components/snackbar/index.d.ts +9 -2
- package/components/snackbar/index.js +10 -10
- package/components/switch/index.d.ts +10 -3
- package/components/switch/index.js +7 -7
- package/components/tabs/tab-panel.d.ts +4 -2
- package/components/tabs/tab-panel.js +3 -2
- package/components/tabs/tab.d.ts +7 -3
- package/components/tabs/tab.js +3 -2
- package/components/tabs/tabs.d.ts +5 -2
- package/components/tabs/tabs.js +7 -4
- package/components/text-field/index.d.ts +11 -3
- package/components/text-field/index.js +12 -12
- package/components/tooltip/index.d.ts +9 -2
- package/components/tooltip/index.js +17 -15
- package/components/top-app-bar/top-app-bar-title.d.ts +4 -2
- package/components/top-app-bar/top-app-bar-title.js +3 -2
- package/components/top-app-bar/top-app-bar.d.ts +7 -1
- package/components/top-app-bar/top-app-bar.js +5 -6
- package/custom-elements.json +2954 -2891
- package/html-data.zh-cn.json +439 -439
- package/mdui.esm.js +8 -8
- package/mdui.global.js +8 -8
- package/package.json +3 -2
- package/web-types.zh-cn.json +765 -765
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
import { customElement, property, queryAssignedElements, } from 'lit/decorators.js';
|
|
4
4
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
5
5
|
import cc from 'classcat';
|
|
6
6
|
import { isNodeName, getNodeName } from '@mdui/jq/shared/helper.js';
|
|
7
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
7
8
|
import { HasSlotController } from '@mdui/shared/controllers/has-slot.js';
|
|
8
9
|
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
9
10
|
import { nothingTemplate } from '@mdui/shared/helpers/template.js';
|
|
@@ -43,7 +44,7 @@ import { listItemStyle } from './list-item-style.js';
|
|
|
43
44
|
* @cssprop --shape-corner - 列表项的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
44
45
|
* @cssprop --shape-corner-rounded - 指定了 `rounded` 时,列表项的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
45
46
|
*/
|
|
46
|
-
let ListItem = class ListItem extends AnchorMixin(RippleMixin(FocusableMixin(
|
|
47
|
+
let ListItem = class ListItem extends AnchorMixin(RippleMixin(FocusableMixin(MduiElement))) {
|
|
47
48
|
constructor() {
|
|
48
49
|
super(...arguments);
|
|
49
50
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
2
2
|
import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
4
|
* @summary 列表标题组件。需与 `<mdui-list>` 组件配合使用
|
|
@@ -13,10 +13,12 @@ import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
|
13
13
|
*
|
|
14
14
|
* @slot - 文本
|
|
15
15
|
*/
|
|
16
|
-
export declare class ListSubheader extends
|
|
16
|
+
export declare class ListSubheader extends MduiElement<ListSubheaderEventMap> {
|
|
17
17
|
static styles: CSSResultGroup;
|
|
18
18
|
protected render(): TemplateResult;
|
|
19
19
|
}
|
|
20
|
+
export interface ListSubheaderEventMap {
|
|
21
|
+
}
|
|
20
22
|
declare global {
|
|
21
23
|
interface HTMLElementTagNameMap {
|
|
22
24
|
'mdui-list-subheader': ListSubheader;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
import { customElement } from 'lit/decorators.js';
|
|
4
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
4
5
|
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
5
6
|
import { listSubheaderStyle } from './list-subheader-style.js';
|
|
6
7
|
/**
|
|
@@ -16,7 +17,7 @@ import { listSubheaderStyle } from './list-subheader-style.js';
|
|
|
16
17
|
*
|
|
17
18
|
* @slot - 文本
|
|
18
19
|
*/
|
|
19
|
-
let ListSubheader = class ListSubheader extends
|
|
20
|
+
let ListSubheader = class ListSubheader extends MduiElement {
|
|
20
21
|
render() {
|
|
21
22
|
return html `<slot></slot>`;
|
|
22
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
2
2
|
import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
4
|
* @summary 列表组件。需与 `<mdui-list-item>` 组件配合使用
|
|
@@ -13,10 +13,12 @@ import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
|
13
13
|
*
|
|
14
14
|
* @slot - `<mdui-list-item>` 元素
|
|
15
15
|
*/
|
|
16
|
-
export declare class List extends
|
|
16
|
+
export declare class List extends MduiElement<ListEventMap> {
|
|
17
17
|
static styles: CSSResultGroup;
|
|
18
18
|
protected render(): TemplateResult;
|
|
19
19
|
}
|
|
20
|
+
export interface ListEventMap {
|
|
21
|
+
}
|
|
20
22
|
declare global {
|
|
21
23
|
interface HTMLElementTagNameMap {
|
|
22
24
|
'mdui-list': List;
|
package/components/list/list.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
import { customElement } from 'lit/decorators.js';
|
|
4
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
4
5
|
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
5
6
|
import { listStyle } from './list-style.js';
|
|
6
7
|
/**
|
|
@@ -16,7 +17,7 @@ import { listStyle } from './list-style.js';
|
|
|
16
17
|
*
|
|
17
18
|
* @slot - `<mdui-list-item>` 元素
|
|
18
19
|
*/
|
|
19
|
-
let List = class List extends
|
|
20
|
+
let List = class List extends MduiElement {
|
|
20
21
|
render() {
|
|
21
22
|
return html `<slot></slot>`;
|
|
22
23
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
1
|
import '@mdui/jq/methods/css.js';
|
|
3
2
|
import '@mdui/jq/methods/height.js';
|
|
4
3
|
import '@mdui/jq/methods/innerHeight.js';
|
|
5
4
|
import '@mdui/jq/methods/innerWidth.js';
|
|
6
5
|
import '@mdui/jq/methods/width.js';
|
|
7
6
|
import '@mdui/jq/static/contains.js';
|
|
7
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
8
8
|
import '@mdui/shared/icons/arrow-right.js';
|
|
9
9
|
import '@mdui/shared/icons/check.js';
|
|
10
10
|
import '../icon.js';
|
|
11
11
|
import type { Ripple } from '../ripple/index.js';
|
|
12
12
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
13
|
-
declare const MenuItem_base: import("@open-wc/dedupe-mixin").Constructor<import("@mdui/shared/mixins/anchor.js").AnchorMixinInterface> & import("@open-wc/dedupe-mixin").Constructor<import("../ripple/ripple-mixin.js").RippleMixinInterface> & import("@open-wc/dedupe-mixin").Constructor<import("@mdui/shared/mixins/focusable.js").FocusableMixinInterface> & typeof
|
|
13
|
+
declare const MenuItem_base: import("@open-wc/dedupe-mixin").Constructor<import("@mdui/shared/mixins/anchor.js").AnchorMixinInterface> & import("@open-wc/dedupe-mixin").Constructor<import("../ripple/ripple-mixin.js").RippleMixinInterface> & import("@open-wc/dedupe-mixin").Constructor<import("@mdui/shared/mixins/focusable.js").FocusableMixinInterface> & typeof MduiElement;
|
|
14
14
|
/**
|
|
15
15
|
* @summary 菜单项组件
|
|
16
16
|
*
|
|
@@ -44,7 +44,7 @@ declare const MenuItem_base: import("@open-wc/dedupe-mixin").Constructor<import(
|
|
|
44
44
|
* @csspart selected-icon - 选中状态的图标
|
|
45
45
|
* @csspart submenu - 子菜单元素
|
|
46
46
|
*/
|
|
47
|
-
export declare class MenuItem extends MenuItem_base {
|
|
47
|
+
export declare class MenuItem extends MenuItem_base<MenuItemEventMap> {
|
|
48
48
|
static styles: CSSResultGroup;
|
|
49
49
|
/**
|
|
50
50
|
* 该菜单项的值
|
|
@@ -116,6 +116,14 @@ export declare class MenuItem extends MenuItem_base {
|
|
|
116
116
|
private updateSubmenuPositioner;
|
|
117
117
|
private renderInner;
|
|
118
118
|
}
|
|
119
|
+
export interface MenuItemEventMap {
|
|
120
|
+
focus: FocusEvent;
|
|
121
|
+
blur: FocusEvent;
|
|
122
|
+
'submenu-open': CustomEvent<void>;
|
|
123
|
+
'submenu-opened': CustomEvent<void>;
|
|
124
|
+
'submenu-close': CustomEvent<void>;
|
|
125
|
+
'submenu-closed': CustomEvent<void>;
|
|
126
|
+
}
|
|
119
127
|
declare global {
|
|
120
128
|
interface HTMLElementTagNameMap {
|
|
121
129
|
'mdui-menu-item': MenuItem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
4
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
5
5
|
import { when } from 'lit/directives/when.js';
|
|
@@ -12,12 +12,12 @@ import '@mdui/jq/methods/innerWidth.js';
|
|
|
12
12
|
import '@mdui/jq/methods/width.js';
|
|
13
13
|
import { isUndefined } from '@mdui/jq/shared/helper.js';
|
|
14
14
|
import '@mdui/jq/static/contains.js';
|
|
15
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
15
16
|
import { DefinedController } from '@mdui/shared/controllers/defined.js';
|
|
16
17
|
import { HasSlotController } from '@mdui/shared/controllers/has-slot.js';
|
|
17
18
|
import { watch } from '@mdui/shared/decorators/watch.js';
|
|
18
19
|
import { animateTo, stopAnimations } from '@mdui/shared/helpers/animate.js';
|
|
19
20
|
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
20
|
-
import { emit } from '@mdui/shared/helpers/event.js';
|
|
21
21
|
import { getDuration, getEasing } from '@mdui/shared/helpers/motion.js';
|
|
22
22
|
import { nothingTemplate } from '@mdui/shared/helpers/template.js';
|
|
23
23
|
import { uniqueId } from '@mdui/shared/helpers/uniqueId.js';
|
|
@@ -62,7 +62,7 @@ import { menuItemStyle } from './menu-item-style.js';
|
|
|
62
62
|
* @csspart selected-icon - 选中状态的图标
|
|
63
63
|
* @csspart submenu - 子菜单元素
|
|
64
64
|
*/
|
|
65
|
-
let MenuItem = class MenuItem extends AnchorMixin(RippleMixin(FocusableMixin(
|
|
65
|
+
let MenuItem = class MenuItem extends AnchorMixin(RippleMixin(FocusableMixin(MduiElement))) {
|
|
66
66
|
constructor() {
|
|
67
67
|
super();
|
|
68
68
|
/**
|
|
@@ -128,10 +128,8 @@ let MenuItem = class MenuItem extends AnchorMixin(RippleMixin(FocusableMixin(Lit
|
|
|
128
128
|
// 要区分是否首次渲染,首次渲染时不触发事件,不执行动画;非首次渲染,触发事件,执行动画
|
|
129
129
|
if (this.submenuOpen) {
|
|
130
130
|
if (hasUpdated) {
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
});
|
|
134
|
-
if (requestOpen.defaultPrevented) {
|
|
131
|
+
const eventProceeded = this.emit('submenu-open', { cancelable: true });
|
|
132
|
+
if (!eventProceeded) {
|
|
135
133
|
return;
|
|
136
134
|
}
|
|
137
135
|
}
|
|
@@ -150,14 +148,12 @@ let MenuItem = class MenuItem extends AnchorMixin(RippleMixin(FocusableMixin(Lit
|
|
|
150
148
|
}),
|
|
151
149
|
]);
|
|
152
150
|
if (hasUpdated) {
|
|
153
|
-
emit(
|
|
151
|
+
this.emit('submenu-opened');
|
|
154
152
|
}
|
|
155
153
|
}
|
|
156
154
|
else {
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
});
|
|
160
|
-
if (requestClose.defaultPrevented) {
|
|
155
|
+
const eventProceeded = this.emit('submenu-close', { cancelable: true });
|
|
156
|
+
if (!eventProceeded) {
|
|
161
157
|
return;
|
|
162
158
|
}
|
|
163
159
|
const duration = getDuration(this, 'short4');
|
|
@@ -169,7 +165,7 @@ let MenuItem = class MenuItem extends AnchorMixin(RippleMixin(FocusableMixin(Lit
|
|
|
169
165
|
if (this.submenuRef.value) {
|
|
170
166
|
this.submenuRef.value.hidden = true;
|
|
171
167
|
}
|
|
172
|
-
emit(
|
|
168
|
+
this.emit('submenu-closed');
|
|
173
169
|
}
|
|
174
170
|
}
|
|
175
171
|
connectedCallback() {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
1
|
import '@mdui/jq/methods/add.js';
|
|
3
2
|
import '@mdui/jq/methods/children.js';
|
|
4
3
|
import '@mdui/jq/methods/find.js';
|
|
@@ -6,6 +5,7 @@ import '@mdui/jq/methods/get.js';
|
|
|
6
5
|
import '@mdui/jq/methods/is.js';
|
|
7
6
|
import '@mdui/jq/methods/parent.js';
|
|
8
7
|
import '@mdui/jq/methods/parents.js';
|
|
8
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
9
9
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
10
10
|
/**
|
|
11
11
|
* 键盘快捷键:
|
|
@@ -30,7 +30,7 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
|
30
30
|
*
|
|
31
31
|
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
32
32
|
*/
|
|
33
|
-
export declare class Menu extends
|
|
33
|
+
export declare class Menu extends MduiElement<MenuEventMap> {
|
|
34
34
|
static styles: CSSResultGroup;
|
|
35
35
|
/**
|
|
36
36
|
* 菜单项的可选中状态。默认为不可选中。可选值为:
|
|
@@ -107,6 +107,9 @@ export declare class Menu extends LitElement {
|
|
|
107
107
|
private onClick;
|
|
108
108
|
private onKeyDown;
|
|
109
109
|
}
|
|
110
|
+
export interface MenuEventMap {
|
|
111
|
+
change: CustomEvent<void>;
|
|
112
|
+
}
|
|
110
113
|
declare global {
|
|
111
114
|
interface HTMLElementTagNameMap {
|
|
112
115
|
'mdui-menu': Menu;
|
package/components/menu/menu.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
import { customElement, property, queryAssignedElements, state, } from 'lit/decorators.js';
|
|
4
4
|
import { $ } from '@mdui/jq/$.js';
|
|
5
5
|
import '@mdui/jq/methods/add.js';
|
|
@@ -10,12 +10,12 @@ import '@mdui/jq/methods/is.js';
|
|
|
10
10
|
import '@mdui/jq/methods/parent.js';
|
|
11
11
|
import '@mdui/jq/methods/parents.js';
|
|
12
12
|
import { isString, isUndefined } from '@mdui/jq/shared/helper.js';
|
|
13
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
13
14
|
import { DefinedController } from '@mdui/shared/controllers/defined.js';
|
|
14
15
|
import { watch } from '@mdui/shared/decorators/watch.js';
|
|
15
16
|
import { arraysEqualIgnoreOrder } from '@mdui/shared/helpers/array.js';
|
|
16
17
|
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
17
18
|
import { delay } from '@mdui/shared/helpers/delay.js';
|
|
18
|
-
import { emit } from '@mdui/shared/helpers/event.js';
|
|
19
19
|
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
20
20
|
import { menuStyle } from './menu-style.js';
|
|
21
21
|
/**
|
|
@@ -41,7 +41,7 @@ import { menuStyle } from './menu-style.js';
|
|
|
41
41
|
*
|
|
42
42
|
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
43
43
|
*/
|
|
44
|
-
let Menu = class Menu extends
|
|
44
|
+
let Menu = class Menu extends MduiElement {
|
|
45
45
|
constructor() {
|
|
46
46
|
super(...arguments);
|
|
47
47
|
/**
|
|
@@ -145,7 +145,7 @@ let Menu = class Menu extends LitElement {
|
|
|
145
145
|
const value = this.isMultiple ? values : values[0] || undefined;
|
|
146
146
|
this.setValue(value);
|
|
147
147
|
if (!this.isInitial) {
|
|
148
|
-
emit(
|
|
148
|
+
this.emit('change');
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
async onValueChange() {
|
|
@@ -334,7 +334,7 @@ let Menu = class Menu extends LitElement {
|
|
|
334
334
|
}
|
|
335
335
|
const target = event.target;
|
|
336
336
|
const item = target.closest('mdui-menu-item');
|
|
337
|
-
if (item
|
|
337
|
+
if (!item || item.disabled) {
|
|
338
338
|
return;
|
|
339
339
|
}
|
|
340
340
|
this.lastActiveItem = item;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
2
2
|
import '../icon.js';
|
|
3
3
|
import type { Ripple } from '../ripple/index.js';
|
|
4
4
|
import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
5
|
-
declare const NavigationBarItem_base: import("@open-wc/dedupe-mixin").Constructor<import("@mdui/shared/mixins/anchor.js").AnchorMixinInterface> & import("@open-wc/dedupe-mixin").Constructor<import("../ripple/ripple-mixin.js").RippleMixinInterface> & import("@open-wc/dedupe-mixin").Constructor<import("@mdui/shared/mixins/focusable.js").FocusableMixinInterface> & typeof
|
|
5
|
+
declare const NavigationBarItem_base: import("@open-wc/dedupe-mixin").Constructor<import("@mdui/shared/mixins/anchor.js").AnchorMixinInterface> & import("@open-wc/dedupe-mixin").Constructor<import("../ripple/ripple-mixin.js").RippleMixinInterface> & import("@open-wc/dedupe-mixin").Constructor<import("@mdui/shared/mixins/focusable.js").FocusableMixinInterface> & typeof MduiElement;
|
|
6
6
|
/**
|
|
7
7
|
* @summary 底部导航栏项组件。需与 `<mdui-navigation-bar>` 组件配合使用
|
|
8
8
|
*
|
|
@@ -31,7 +31,7 @@ declare const NavigationBarItem_base: import("@open-wc/dedupe-mixin").Constructo
|
|
|
31
31
|
*
|
|
32
32
|
* @cssprop --shape-corner-indicator - 指示器的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
33
33
|
*/
|
|
34
|
-
export declare class NavigationBarItem extends NavigationBarItem_base {
|
|
34
|
+
export declare class NavigationBarItem extends NavigationBarItem_base<NavigationBarItemEventMap> {
|
|
35
35
|
static styles: CSSResultGroup;
|
|
36
36
|
/**
|
|
37
37
|
* 未激活状态的 Material Icons 图标名。也可以通过 `slot="icon"` 设置
|
|
@@ -68,6 +68,10 @@ export declare class NavigationBarItem extends NavigationBarItem_base {
|
|
|
68
68
|
protected render(): TemplateResult;
|
|
69
69
|
private renderInner;
|
|
70
70
|
}
|
|
71
|
+
export interface NavigationBarItemEventMap {
|
|
72
|
+
focus: FocusEvent;
|
|
73
|
+
blur: FocusEvent;
|
|
74
|
+
}
|
|
71
75
|
declare global {
|
|
72
76
|
interface HTMLElementTagNameMap {
|
|
73
77
|
'mdui-navigation-bar-item': NavigationBarItem;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
4
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
5
5
|
import cc from 'classcat';
|
|
6
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
6
7
|
import { HasSlotController } from '@mdui/shared/controllers/has-slot.js';
|
|
7
8
|
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
8
9
|
import { nothingTemplate } from '@mdui/shared/helpers/template.js';
|
|
@@ -41,7 +42,7 @@ import { navigationBarItemStyle } from './navigation-bar-item-style.js';
|
|
|
41
42
|
*
|
|
42
43
|
* @cssprop --shape-corner-indicator - 指示器的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
43
44
|
*/
|
|
44
|
-
let NavigationBarItem = class NavigationBarItem extends AnchorMixin(RippleMixin(FocusableMixin(
|
|
45
|
+
let NavigationBarItem = class NavigationBarItem extends AnchorMixin(RippleMixin(FocusableMixin(MduiElement))) {
|
|
45
46
|
constructor() {
|
|
46
47
|
super(...arguments);
|
|
47
48
|
/**
|
|
@@ -26,7 +26,7 @@ declare const NavigationBar_base: import("@open-wc/dedupe-mixin").Constructor<im
|
|
|
26
26
|
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
27
27
|
* @cssprop --z-index - 组件的 CSS 的 `z-index` 值
|
|
28
28
|
*/
|
|
29
|
-
export declare class NavigationBar extends NavigationBar_base {
|
|
29
|
+
export declare class NavigationBar extends NavigationBar_base<NavigationBarEventMap> {
|
|
30
30
|
static styles: CSSResultGroup;
|
|
31
31
|
/**
|
|
32
32
|
* 是否隐藏
|
|
@@ -70,6 +70,13 @@ export declare class NavigationBar extends NavigationBar_base {
|
|
|
70
70
|
private updateItems;
|
|
71
71
|
private onSlotChange;
|
|
72
72
|
}
|
|
73
|
+
export interface NavigationBarEventMap {
|
|
74
|
+
change: CustomEvent<void>;
|
|
75
|
+
show: CustomEvent<void>;
|
|
76
|
+
shown: CustomEvent<void>;
|
|
77
|
+
hide: CustomEvent<void>;
|
|
78
|
+
hidden: CustomEvent<void>;
|
|
79
|
+
}
|
|
73
80
|
declare global {
|
|
74
81
|
interface HTMLElementTagNameMap {
|
|
75
82
|
'mdui-navigation-bar': NavigationBar;
|
|
@@ -4,7 +4,6 @@ import { customElement, property, queryAssignedElements, state, } from 'lit/deco
|
|
|
4
4
|
import { DefinedController } from '@mdui/shared/controllers/defined.js';
|
|
5
5
|
import { watch } from '@mdui/shared/decorators/watch.js';
|
|
6
6
|
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
7
|
-
import { emit } from '@mdui/shared/helpers/event.js';
|
|
8
7
|
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
9
8
|
import { ScrollBehaviorMixin } from '@mdui/shared/mixins/scrollBehavior.js';
|
|
10
9
|
import { LayoutItemBase } from '../layout/layout-item-base.js';
|
|
@@ -67,7 +66,7 @@ let NavigationBar = class NavigationBar extends ScrollBehaviorMixin(LayoutItemBa
|
|
|
67
66
|
const item = this.items.find((item) => item.key === this.activeKey);
|
|
68
67
|
this.value = item?.value;
|
|
69
68
|
if (!this.isInitial) {
|
|
70
|
-
emit(
|
|
69
|
+
this.emit('change');
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
72
|
async onValueChange() {
|
|
@@ -85,7 +84,7 @@ let NavigationBar = class NavigationBar extends ScrollBehaviorMixin(LayoutItemBa
|
|
|
85
84
|
super.firstUpdated(_changedProperties);
|
|
86
85
|
this.addEventListener('transitionend', (event) => {
|
|
87
86
|
if (event.target === this) {
|
|
88
|
-
emit(this
|
|
87
|
+
this.emit(this.hide ? 'hidden' : 'shown');
|
|
89
88
|
}
|
|
90
89
|
});
|
|
91
90
|
}
|
|
@@ -99,15 +98,15 @@ let NavigationBar = class NavigationBar extends ScrollBehaviorMixin(LayoutItemBa
|
|
|
99
98
|
runScrollThreshold(isScrollingUp) {
|
|
100
99
|
// 向下滚动
|
|
101
100
|
if (!isScrollingUp && !this.hide) {
|
|
102
|
-
const
|
|
103
|
-
if (
|
|
101
|
+
const eventProceeded = this.emit('hide', { cancelable: true });
|
|
102
|
+
if (eventProceeded) {
|
|
104
103
|
this.hide = true;
|
|
105
104
|
}
|
|
106
105
|
}
|
|
107
106
|
// 向上滚动
|
|
108
107
|
if (isScrollingUp && this.hide) {
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
108
|
+
const eventProceeded = this.emit('show', { cancelable: true });
|
|
109
|
+
if (eventProceeded) {
|
|
111
110
|
this.hide = false;
|
|
112
111
|
}
|
|
113
112
|
}
|
|
@@ -119,6 +118,9 @@ let NavigationBar = class NavigationBar extends ScrollBehaviorMixin(LayoutItemBa
|
|
|
119
118
|
}
|
|
120
119
|
const target = event.target;
|
|
121
120
|
const item = target.closest('mdui-navigation-bar-item');
|
|
121
|
+
if (!item) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
122
124
|
this.activeKey = item.key;
|
|
123
125
|
this.isInitial = false;
|
|
124
126
|
this.updateItems();
|
|
@@ -26,7 +26,7 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
|
26
26
|
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
27
27
|
* @cssprop --z-index - 组件的 CSS 的 `z-index` 值
|
|
28
28
|
*/
|
|
29
|
-
export declare class NavigationDrawer extends LayoutItemBase {
|
|
29
|
+
export declare class NavigationDrawer extends LayoutItemBase<NavigationDrawerEventMap> {
|
|
30
30
|
static styles: CSSResultGroup;
|
|
31
31
|
/**
|
|
32
32
|
* 是否打开抽屉导航
|
|
@@ -81,6 +81,13 @@ export declare class NavigationDrawer extends LayoutItemBase {
|
|
|
81
81
|
private onOverlayClick;
|
|
82
82
|
private getLockTargetAnimate;
|
|
83
83
|
}
|
|
84
|
+
export interface NavigationDrawerEventMap {
|
|
85
|
+
open: CustomEvent<void>;
|
|
86
|
+
opened: CustomEvent<void>;
|
|
87
|
+
close: CustomEvent<void>;
|
|
88
|
+
closed: CustomEvent<void>;
|
|
89
|
+
'overlay-click': CustomEvent<void>;
|
|
90
|
+
}
|
|
84
91
|
declare global {
|
|
85
92
|
interface HTMLElementTagNameMap {
|
|
86
93
|
'mdui-navigation-drawer': NavigationDrawer;
|
|
@@ -12,7 +12,6 @@ import { watch } from '@mdui/shared/decorators/watch.js';
|
|
|
12
12
|
import { animateTo, stopAnimations } from '@mdui/shared/helpers/animate.js';
|
|
13
13
|
import { breakpoint } from '@mdui/shared/helpers/breakpoint.js';
|
|
14
14
|
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
15
|
-
import { emit } from '@mdui/shared/helpers/event.js';
|
|
16
15
|
import { Modal } from '@mdui/shared/helpers/modal.js';
|
|
17
16
|
import { getDuration, getEasing } from '@mdui/shared/helpers/motion.js';
|
|
18
17
|
import { observeResize } from '@mdui/shared/helpers/observeResize.js';
|
|
@@ -162,8 +161,8 @@ let NavigationDrawer = class NavigationDrawer extends LayoutItemBase {
|
|
|
162
161
|
overlay = this.overlayRef.value;
|
|
163
162
|
}
|
|
164
163
|
if (hasUpdated) {
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
164
|
+
const eventProceeded = this.emit('open', { cancelable: true });
|
|
165
|
+
if (!eventProceeded) {
|
|
167
166
|
return;
|
|
168
167
|
}
|
|
169
168
|
}
|
|
@@ -219,13 +218,13 @@ let NavigationDrawer = class NavigationDrawer extends LayoutItemBase {
|
|
|
219
218
|
setLayoutTransition(null);
|
|
220
219
|
}
|
|
221
220
|
if (hasUpdated) {
|
|
222
|
-
emit(
|
|
221
|
+
this.emit('opened');
|
|
223
222
|
}
|
|
224
223
|
}
|
|
225
224
|
else if (this.hasUpdated) {
|
|
226
225
|
// 关闭
|
|
227
|
-
const
|
|
228
|
-
if (
|
|
226
|
+
const eventProceeded = this.emit('close', { cancelable: true });
|
|
227
|
+
if (!eventProceeded) {
|
|
229
228
|
return;
|
|
230
229
|
}
|
|
231
230
|
await this.definedController.whenDefined();
|
|
@@ -272,7 +271,7 @@ let NavigationDrawer = class NavigationDrawer extends LayoutItemBase {
|
|
|
272
271
|
if (isFunction(trigger?.focus)) {
|
|
273
272
|
setTimeout(() => trigger.focus());
|
|
274
273
|
}
|
|
275
|
-
emit(
|
|
274
|
+
this.emit('closed');
|
|
276
275
|
}
|
|
277
276
|
}
|
|
278
277
|
connectedCallback() {
|
|
@@ -300,7 +299,7 @@ let NavigationDrawer = class NavigationDrawer extends LayoutItemBase {
|
|
|
300
299
|
return html `${when(this.isModal, () => html `<div ${ref(this.overlayRef)} part="overlay" class="overlay" @click="${this.onOverlayClick}"></div>`)}<slot ${ref(this.panelRef)} part="panel" class="panel" tabindex="0"></slot>`;
|
|
301
300
|
}
|
|
302
301
|
onOverlayClick() {
|
|
303
|
-
emit(
|
|
302
|
+
this.emit('overlay-click');
|
|
304
303
|
if (this.closeOnOverlayClick) {
|
|
305
304
|
this.open = false;
|
|
306
305
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-large);--z-index:2200;display:none;position:fixed;top:0;bottom:0;left:0;z-index:1;width:22.5rem}:host([placement=right]){left:initial;right:0}:host([mobile]),:host([modal]){top:0!important;right:0;bottom:0!important;width:initial;z-index:var(--z-index)}:host([placement=right][mobile]),:host([placement=right][modal]){left:0}:host([contained]){position:absolute}.overlay{position:absolute;inset:0;z-index:inherit;background-color:rgba(var(--mdui-color-scrim),.4)}.panel{display:block;position:absolute;top:0;bottom:0;left:0;width:100%;overflow:auto;z-index:inherit;background-color:rgb(var(--mdui-color-surface));box-shadow:var(--mdui-elevation-level0)}:host([mobile]) .panel,:host([modal]) .panel{border-radius:0 var(--shape-corner) var(--shape-corner) 0;width:22.5rem;background-color:rgb(var(--mdui-color-surface-container-low));box-shadow:var(--mdui-elevation-level1)}:host([placement=right]) .panel{left:initial;right:0}:host([placement=right][mobile]) .panel,:host([placement=right][modal]) .panel{border-radius:var(--shape-corner) 0 0 var(--shape-corner)}`;
|
|
2
|
+
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-large);--z-index:2200;display:none;position:fixed;top:0;bottom:0;left:0;z-index:1;width:22.5rem}:host([placement=right]){left:initial;right:0}:host([mobile]),:host([modal]){top:0!important;right:0;bottom:0!important;width:initial;z-index:var(--z-index)}:host([placement=right][mobile]),:host([placement=right][modal]){left:0}:host([contained]){position:absolute}.overlay{position:absolute;inset:0;z-index:inherit;background-color:rgba(var(--mdui-color-scrim),.4)}.panel{display:block;position:absolute;top:0;bottom:0;left:0;width:100%;overflow:auto;z-index:inherit;background-color:rgb(var(--mdui-color-surface));box-shadow:var(--mdui-elevation-level0)}:host([mobile]) .panel,:host([modal]) .panel{border-radius:0 var(--shape-corner) var(--shape-corner) 0;max-width:80%;width:22.5rem;background-color:rgb(var(--mdui-color-surface-container-low));box-shadow:var(--mdui-elevation-level1)}:host([placement=right]) .panel{left:initial;right:0}:host([placement=right][mobile]) .panel,:host([placement=right][modal]) .panel{border-radius:var(--shape-corner) 0 0 var(--shape-corner)}`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
2
2
|
import '../icon.js';
|
|
3
3
|
import type { Ripple } from '../ripple/index.js';
|
|
4
4
|
import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
5
|
-
declare const NavigationRailItem_base: import("@open-wc/dedupe-mixin").Constructor<import("@mdui/shared/mixins/anchor.js").AnchorMixinInterface> & import("@open-wc/dedupe-mixin").Constructor<import("../ripple/ripple-mixin.js").RippleMixinInterface> & import("@open-wc/dedupe-mixin").Constructor<import("@mdui/shared/mixins/focusable.js").FocusableMixinInterface> & typeof
|
|
5
|
+
declare const NavigationRailItem_base: import("@open-wc/dedupe-mixin").Constructor<import("@mdui/shared/mixins/anchor.js").AnchorMixinInterface> & import("@open-wc/dedupe-mixin").Constructor<import("../ripple/ripple-mixin.js").RippleMixinInterface> & import("@open-wc/dedupe-mixin").Constructor<import("@mdui/shared/mixins/focusable.js").FocusableMixinInterface> & typeof MduiElement;
|
|
6
6
|
/**
|
|
7
7
|
* @summary 侧边导航栏项组件。需与 `<mdui-navigation-rail>` 组件配合使用
|
|
8
8
|
*
|
|
@@ -31,7 +31,7 @@ declare const NavigationRailItem_base: import("@open-wc/dedupe-mixin").Construct
|
|
|
31
31
|
*
|
|
32
32
|
* @cssprop --shape-corner-indicator - 指示器的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
33
33
|
*/
|
|
34
|
-
export declare class NavigationRailItem extends NavigationRailItem_base {
|
|
34
|
+
export declare class NavigationRailItem extends NavigationRailItem_base<NavigationRailItemEventMap> {
|
|
35
35
|
static styles: CSSResultGroup;
|
|
36
36
|
/**
|
|
37
37
|
* 未激活状态的 Material Icons 图标名。也可以通过 `slot="icon"` 设置
|
|
@@ -68,6 +68,10 @@ export declare class NavigationRailItem extends NavigationRailItem_base {
|
|
|
68
68
|
protected render(): TemplateResult;
|
|
69
69
|
private renderInner;
|
|
70
70
|
}
|
|
71
|
+
export interface NavigationRailItemEventMap {
|
|
72
|
+
focus: FocusEvent;
|
|
73
|
+
blur: FocusEvent;
|
|
74
|
+
}
|
|
71
75
|
declare global {
|
|
72
76
|
interface HTMLElementTagNameMap {
|
|
73
77
|
'mdui-navigation-rail-item': NavigationRailItem;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html,
|
|
2
|
+
import { html, nothing } from 'lit';
|
|
3
3
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
4
|
import { classMap } from 'lit/directives/class-map.js';
|
|
5
5
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
6
6
|
import cc from 'classcat';
|
|
7
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
7
8
|
import { HasSlotController } from '@mdui/shared/controllers/has-slot.js';
|
|
8
9
|
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
9
10
|
import { nothingTemplate } from '@mdui/shared/helpers/template.js';
|
|
@@ -42,7 +43,7 @@ import { navigationRailItemStyle } from './navigation-rail-item-style.js';
|
|
|
42
43
|
*
|
|
43
44
|
* @cssprop --shape-corner-indicator - 指示器的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
44
45
|
*/
|
|
45
|
-
let NavigationRailItem = class NavigationRailItem extends AnchorMixin(RippleMixin(FocusableMixin(
|
|
46
|
+
let NavigationRailItem = class NavigationRailItem extends AnchorMixin(RippleMixin(FocusableMixin(MduiElement))) {
|
|
46
47
|
constructor() {
|
|
47
48
|
super(...arguments);
|
|
48
49
|
/**
|
|
@@ -27,7 +27,7 @@ import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
|
27
27
|
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
28
28
|
* @cssprop --z-index - 组件的 CSS 的 `z-index` 值
|
|
29
29
|
*/
|
|
30
|
-
export declare class NavigationRail extends LayoutItemBase {
|
|
30
|
+
export declare class NavigationRail extends LayoutItemBase<NavigationRailEventMap> {
|
|
31
31
|
static styles: CSSResultGroup;
|
|
32
32
|
/**
|
|
33
33
|
* 当前选中的 `<mdui-navigation-rail-item>` 的值
|
|
@@ -79,6 +79,9 @@ export declare class NavigationRail extends LayoutItemBase {
|
|
|
79
79
|
private updateItems;
|
|
80
80
|
private onSlotChange;
|
|
81
81
|
}
|
|
82
|
+
export interface NavigationRailEventMap {
|
|
83
|
+
change: CustomEvent<void>;
|
|
84
|
+
}
|
|
82
85
|
declare global {
|
|
83
86
|
interface HTMLElementTagNameMap {
|
|
84
87
|
'mdui-navigation-rail': NavigationRail;
|
|
@@ -9,7 +9,6 @@ import { DefinedController } from '@mdui/shared/controllers/defined.js';
|
|
|
9
9
|
import { HasSlotController } from '@mdui/shared/controllers/has-slot.js';
|
|
10
10
|
import { watch } from '@mdui/shared/decorators/watch.js';
|
|
11
11
|
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
12
|
-
import { emit } from '@mdui/shared/helpers/event.js';
|
|
13
12
|
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
14
13
|
import { LayoutItemBase } from '../layout/layout-item-base.js';
|
|
15
14
|
import { navigationRailStyle } from './navigation-rail-style.js';
|
|
@@ -97,7 +96,7 @@ let NavigationRail = class NavigationRail extends LayoutItemBase {
|
|
|
97
96
|
const item = this.items.find((item) => item.key === this.activeKey);
|
|
98
97
|
this.value = item?.value;
|
|
99
98
|
if (!this.isInitial) {
|
|
100
|
-
emit(
|
|
99
|
+
this.emit('change');
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
102
|
async onValueChange() {
|
|
@@ -166,6 +165,9 @@ let NavigationRail = class NavigationRail extends LayoutItemBase {
|
|
|
166
165
|
}
|
|
167
166
|
const target = event.target;
|
|
168
167
|
const item = target.closest('mdui-navigation-rail-item');
|
|
168
|
+
if (!item) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
169
171
|
this.activeKey = item.key;
|
|
170
172
|
this.isInitial = false;
|
|
171
173
|
this.updateItems();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
1
|
import '@mdui/jq/methods/closest.js';
|
|
3
2
|
import '@mdui/jq/methods/find.js';
|
|
4
3
|
import '@mdui/jq/methods/get.js';
|
|
4
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
5
5
|
import type { FormControl } from '@mdui/jq/shared/form.js';
|
|
6
6
|
import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
7
7
|
/**
|
|
@@ -20,7 +20,7 @@ import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
|
20
20
|
*
|
|
21
21
|
* @slot - `<mdui-radio>` 元素
|
|
22
22
|
*/
|
|
23
|
-
export declare class RadioGroup extends
|
|
23
|
+
export declare class RadioGroup extends MduiElement<RadioGroupEventMap> implements FormControl {
|
|
24
24
|
static styles: CSSResultGroup;
|
|
25
25
|
/**
|
|
26
26
|
* 是否为禁用状态
|
|
@@ -98,6 +98,11 @@ export declare class RadioGroup extends LitElement implements FormControl {
|
|
|
98
98
|
private onCheckedChange;
|
|
99
99
|
private updateItems;
|
|
100
100
|
}
|
|
101
|
+
export interface RadioGroupEventMap {
|
|
102
|
+
change: CustomEvent<void>;
|
|
103
|
+
input: CustomEvent<void>;
|
|
104
|
+
invalid: CustomEvent<void>;
|
|
105
|
+
}
|
|
101
106
|
declare global {
|
|
102
107
|
interface HTMLElementTagNameMap {
|
|
103
108
|
'mdui-radio-group': RadioGroup;
|