mdui 2.0.2 → 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 +17 -15
- package/components/avatar/index.js +7 -6
- package/components/badge/index.d.ts +11 -8
- package/components/badge/index.js +9 -7
- package/components/bottom-app-bar/index.d.ts +11 -4
- package/components/bottom-app-bar/index.js +8 -9
- package/components/button/button-base-style.js +1 -1
- package/components/button/button-base.d.ts +46 -47
- package/components/button/button-base.js +27 -25
- package/components/button/index.d.ts +19 -14
- package/components/button/index.js +12 -12
- package/components/button-icon/index.d.ts +15 -9
- package/components/button-icon/index.js +8 -9
- package/components/card/index.d.ts +15 -11
- package/components/card/index.js +10 -9
- package/components/checkbox/index.d.ts +30 -23
- package/components/checkbox/index.js +25 -25
- package/components/chip/index.d.ts +27 -20
- package/components/chip/index.js +19 -20
- package/components/circular-progress/index.d.ts +6 -4
- package/components/circular-progress/index.js +4 -3
- package/components/collapse/collapse-item.d.ts +17 -6
- package/components/collapse/collapse-item.js +7 -7
- package/components/collapse/collapse.d.ts +16 -11
- package/components/collapse/collapse.js +10 -10
- package/components/dialog/index.d.ts +22 -15
- package/components/dialog/index.js +23 -27
- package/components/divider/index.d.ts +7 -5
- package/components/divider/index.js +6 -5
- package/components/dropdown/index.d.ts +44 -37
- package/components/dropdown/index.js +50 -48
- package/components/fab/index.d.ts +12 -7
- package/components/fab/index.js +6 -6
- 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 +11 -10
- package/components/layout/layout-item.js +6 -6
- package/components/layout/layout-main.d.ts +6 -4
- package/components/layout/layout-main.js +5 -4
- package/components/layout/layout.d.ts +6 -4
- package/components/layout/layout.js +5 -4
- package/components/linear-progress/index.d.ts +8 -6
- package/components/linear-progress/index.js +6 -5
- package/components/list/list-item-style.js +1 -1
- package/components/list/list-item.d.ts +24 -20
- package/components/list/list-item.js +10 -9
- package/components/list/list-subheader.d.ts +6 -4
- package/components/list/list-subheader.js +5 -4
- package/components/list/list.d.ts +5 -3
- package/components/list/list.js +4 -3
- package/components/menu/menu-item.d.ts +15 -7
- package/components/menu/menu-item.js +11 -15
- package/components/menu/menu.d.ts +20 -20
- package/components/menu/menu.js +13 -13
- package/components/navigation-bar/navigation-bar-item.d.ts +12 -8
- package/components/navigation-bar/navigation-bar-item.js +7 -6
- package/components/navigation-bar/navigation-bar.d.ts +17 -9
- package/components/navigation-bar/navigation-bar.js +15 -13
- package/components/navigation-drawer/index.d.ts +27 -21
- package/components/navigation-drawer/index.js +51 -38
- package/components/navigation-drawer/style.js +1 -1
- package/components/navigation-rail/navigation-rail-item.d.ts +13 -9
- package/components/navigation-rail/navigation-rail-item.js +7 -6
- package/components/navigation-rail/navigation-rail.d.ts +14 -12
- package/components/navigation-rail/navigation-rail.js +13 -12
- package/components/radio/radio-group.d.ts +20 -15
- package/components/radio/radio-group.js +21 -24
- package/components/radio/radio.d.ts +11 -6
- package/components/radio/radio.js +7 -7
- package/components/range-slider/index.d.ts +13 -8
- package/components/range-slider/index.js +10 -7
- 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 +23 -22
- package/components/segmented-button/segmented-button-group.js +20 -23
- package/components/segmented-button/segmented-button.d.ts +9 -4
- package/components/segmented-button/segmented-button.js +3 -3
- package/components/select/index.d.ts +42 -35
- package/components/select/index.js +24 -25
- package/components/slider/index.d.ts +9 -2
- package/components/slider/index.js +5 -10
- package/components/slider/slider-base.d.ts +22 -18
- package/components/slider/slider-base.js +40 -21
- package/components/snackbar/index.d.ts +30 -23
- package/components/snackbar/index.js +25 -25
- package/components/switch/index.d.ts +24 -17
- package/components/switch/index.js +18 -18
- package/components/tabs/tab-panel.d.ts +7 -5
- package/components/tabs/tab-panel.js +5 -4
- package/components/tabs/tab.d.ts +13 -9
- package/components/tabs/tab.js +8 -7
- package/components/tabs/tabs.d.ts +24 -21
- package/components/tabs/tabs.js +24 -21
- package/components/text-field/index.d.ts +62 -54
- package/components/text-field/index.js +37 -37
- package/components/tooltip/index.d.ts +40 -33
- package/components/tooltip/index.js +45 -43
- package/components/top-app-bar/top-app-bar-title.d.ts +8 -6
- package/components/top-app-bar/top-app-bar-title.js +7 -6
- package/components/top-app-bar/top-app-bar.d.ts +12 -6
- package/components/top-app-bar/top-app-bar.js +9 -10
- package/css-data.en.json +2826 -0
- package/css-data.zh-cn.json +374 -367
- package/custom-elements.json +3844 -3824
- package/html-data.en.json +6551 -0
- package/html-data.zh-cn.json +1621 -1636
- 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 +9 -9
- package/package.json +7 -5
- package/web-types.en.json +11718 -0
- package/web-types.zh-cn.json +3613 -3623
package/components/icon/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
4
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
5
5
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
6
6
|
import { until } from 'lit/directives/until.js';
|
|
7
7
|
import { ajax } from '@mdui/jq/functions/ajax.js';
|
|
8
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
8
9
|
import { HasSlotController } from '@mdui/shared/controllers/has-slot.js';
|
|
9
10
|
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
10
11
|
import { style } from './style.js';
|
|
@@ -17,7 +18,7 @@ import { style } from './style.js';
|
|
|
17
18
|
*
|
|
18
19
|
* @slot - `svg` 图标的内容
|
|
19
20
|
*/
|
|
20
|
-
let Icon = class Icon extends
|
|
21
|
+
let Icon = class Icon extends MduiElement {
|
|
21
22
|
constructor() {
|
|
22
23
|
super(...arguments);
|
|
23
24
|
this.hasSlotController = new HasSlotController(this, '[default]');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
2
2
|
import type { LayoutManager, LayoutPlacement } from './helper.js';
|
|
3
|
-
|
|
3
|
+
import type { PlainObject } from '@mdui/jq/shared/helper.js';
|
|
4
|
+
export declare class LayoutItemBase<E = PlainObject> extends MduiElement<E> {
|
|
4
5
|
/**
|
|
5
6
|
* 该组件在 [`<mdui-layout>`](/docs/2/components/layout) 中的布局顺序,按从小到大排序。默认为 `0`
|
|
6
7
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { LitElement } from 'lit';
|
|
3
2
|
import { property } from 'lit/decorators.js';
|
|
4
3
|
import { isNodeName } from '@mdui/jq/shared/helper.js';
|
|
4
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
5
5
|
import { watch } from '@mdui/shared/decorators/watch.js';
|
|
6
6
|
import { getLayout } from './helper.js';
|
|
7
|
-
export class LayoutItemBase extends
|
|
7
|
+
export class LayoutItemBase extends MduiElement {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
10
10
|
// 父元素是否是 `mdui-layout`
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { CSSResultGroup } from 'lit';
|
|
2
1
|
import { LayoutItemBase } from './layout-item-base.js';
|
|
3
2
|
import type { LayoutPlacement } from './helper.js';
|
|
4
|
-
import type { TemplateResult } from 'lit';
|
|
3
|
+
import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
5
4
|
/**
|
|
6
5
|
* @summary 布局项组件
|
|
7
6
|
*
|
|
@@ -13,23 +12,25 @@ import type { TemplateResult } from 'lit';
|
|
|
13
12
|
* </mdui-layout>
|
|
14
13
|
* ```
|
|
15
14
|
*
|
|
16
|
-
* @slot -
|
|
15
|
+
* @slot - 可以包含任意内容
|
|
17
16
|
*/
|
|
18
|
-
export declare class LayoutItem extends LayoutItemBase {
|
|
17
|
+
export declare class LayoutItem extends LayoutItemBase<LayoutItemEventMap> {
|
|
19
18
|
static styles: CSSResultGroup;
|
|
20
19
|
/**
|
|
21
|
-
*
|
|
20
|
+
* 组件的位置。可选值包括:
|
|
22
21
|
*
|
|
23
|
-
* * `top
|
|
24
|
-
* * `bottom
|
|
25
|
-
* * `left
|
|
26
|
-
* * `right
|
|
22
|
+
* * `top`:上方
|
|
23
|
+
* * `bottom`:下方
|
|
24
|
+
* * `left`:左侧
|
|
25
|
+
* * `right`:右侧
|
|
27
26
|
*/
|
|
28
|
-
placement:
|
|
27
|
+
placement: /*上方*/ 'top' | /*下方*/ 'bottom' | /*左侧*/ 'left' | /*右侧*/ 'right';
|
|
29
28
|
protected get layoutPlacement(): LayoutPlacement;
|
|
30
29
|
private onPlacementChange;
|
|
31
30
|
protected render(): TemplateResult;
|
|
32
31
|
}
|
|
32
|
+
export interface LayoutItemEventMap {
|
|
33
|
+
}
|
|
33
34
|
declare global {
|
|
34
35
|
interface HTMLElementTagNameMap {
|
|
35
36
|
'mdui-layout-item': LayoutItem;
|
|
@@ -16,18 +16,18 @@ import { layoutItemStyle } from './layout-item-style.js';
|
|
|
16
16
|
* </mdui-layout>
|
|
17
17
|
* ```
|
|
18
18
|
*
|
|
19
|
-
* @slot -
|
|
19
|
+
* @slot - 可以包含任意内容
|
|
20
20
|
*/
|
|
21
21
|
let LayoutItem = class LayoutItem extends LayoutItemBase {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments);
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* 组件的位置。可选值包括:
|
|
26
26
|
*
|
|
27
|
-
* * `top
|
|
28
|
-
* * `bottom
|
|
29
|
-
* * `left
|
|
30
|
-
* * `right
|
|
27
|
+
* * `top`:上方
|
|
28
|
+
* * `bottom`:下方
|
|
29
|
+
* * `left`:左侧
|
|
30
|
+
* * `right`:右侧
|
|
31
31
|
*/
|
|
32
32
|
this.placement = 'top';
|
|
33
33
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
2
2
|
import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
|
-
* @summary
|
|
4
|
+
* @summary 布局主体内容组件
|
|
5
5
|
*
|
|
6
6
|
* ```html
|
|
7
7
|
* <mdui-layout>
|
|
@@ -11,15 +11,17 @@ import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
|
11
11
|
* </mdui-layout>
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
|
-
* @slot -
|
|
14
|
+
* @slot - 可以包含任意内容
|
|
15
15
|
*/
|
|
16
|
-
export declare class LayoutMain extends
|
|
16
|
+
export declare class LayoutMain extends MduiElement<LayoutMainEventMap> {
|
|
17
17
|
static styles: CSSResultGroup;
|
|
18
18
|
private layoutManager?;
|
|
19
19
|
connectedCallback(): void;
|
|
20
20
|
disconnectedCallback(): void;
|
|
21
21
|
protected render(): TemplateResult;
|
|
22
22
|
}
|
|
23
|
+
export interface LayoutMainEventMap {
|
|
24
|
+
}
|
|
23
25
|
declare global {
|
|
24
26
|
interface HTMLElementTagNameMap {
|
|
25
27
|
'mdui-layout-main': LayoutMain;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
import { customElement } from 'lit/decorators.js';
|
|
4
4
|
import { isNodeName } from '@mdui/jq/shared/helper.js';
|
|
5
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
5
6
|
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
6
7
|
import { getLayout } from './helper.js';
|
|
7
8
|
import { layoutMainStyle } from './layout-main-style.js';
|
|
8
9
|
/**
|
|
9
|
-
* @summary
|
|
10
|
+
* @summary 布局主体内容组件
|
|
10
11
|
*
|
|
11
12
|
* ```html
|
|
12
13
|
* <mdui-layout>
|
|
@@ -16,9 +17,9 @@ import { layoutMainStyle } from './layout-main-style.js';
|
|
|
16
17
|
* </mdui-layout>
|
|
17
18
|
* ```
|
|
18
19
|
*
|
|
19
|
-
* @slot -
|
|
20
|
+
* @slot - 可以包含任意内容
|
|
20
21
|
*/
|
|
21
|
-
let LayoutMain = class LayoutMain extends
|
|
22
|
+
let LayoutMain = class LayoutMain extends MduiElement {
|
|
22
23
|
connectedCallback() {
|
|
23
24
|
super.connectedCallback();
|
|
24
25
|
const parentElement = this.parentElement;
|
|
@@ -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 布局组件
|
|
@@ -11,16 +11,18 @@ import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
|
11
11
|
* </mdui-layout>
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
|
-
* @slot -
|
|
14
|
+
* @slot - 可以包含 [`<mdui-top-app-bar>`](/docs/2/components/top-app-bar)、[`<mdui-bottom-app-bar>`](/docs/2/components/bottom-app-bar)、[`<mdui-navigation-bar>`](/docs/2/components/navigation-bar)、[`<mdui-navigation-drawer>`](/docs/2/components/navigation-drawer)、[`<mdui-navigation-rail>`](/docs/2/components/navigation-rail)、`<mdui-layout-item>`、`<mdui-layout-main>` 元素
|
|
15
15
|
*/
|
|
16
|
-
export declare class Layout extends
|
|
16
|
+
export declare class Layout extends MduiElement<LayoutEventMap> {
|
|
17
17
|
static styles: CSSResultGroup;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* 设置当前布局的高度为 100%
|
|
20
20
|
*/
|
|
21
21
|
fullHeight: boolean;
|
|
22
22
|
protected render(): TemplateResult;
|
|
23
23
|
}
|
|
24
|
+
export interface LayoutEventMap {
|
|
25
|
+
}
|
|
24
26
|
declare global {
|
|
25
27
|
interface HTMLElementTagNameMap {
|
|
26
28
|
'mdui-layout': Layout;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
4
5
|
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
5
6
|
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
6
7
|
import { layoutStyle } from './layout-style.js';
|
|
@@ -15,13 +16,13 @@ import { layoutStyle } from './layout-style.js';
|
|
|
15
16
|
* </mdui-layout>
|
|
16
17
|
* ```
|
|
17
18
|
*
|
|
18
|
-
* @slot -
|
|
19
|
+
* @slot - 可以包含 [`<mdui-top-app-bar>`](/docs/2/components/top-app-bar)、[`<mdui-bottom-app-bar>`](/docs/2/components/bottom-app-bar)、[`<mdui-navigation-bar>`](/docs/2/components/navigation-bar)、[`<mdui-navigation-drawer>`](/docs/2/components/navigation-drawer)、[`<mdui-navigation-rail>`](/docs/2/components/navigation-rail)、`<mdui-layout-item>`、`<mdui-layout-main>` 元素
|
|
19
20
|
*/
|
|
20
|
-
let Layout = class Layout extends
|
|
21
|
+
let Layout = class Layout extends MduiElement {
|
|
21
22
|
constructor() {
|
|
22
23
|
super(...arguments);
|
|
23
24
|
/**
|
|
24
|
-
*
|
|
25
|
+
* 设置当前布局的高度为 100%
|
|
25
26
|
*/
|
|
26
27
|
this.fullHeight = false;
|
|
27
28
|
}
|
|
@@ -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 线性进度指示器组件
|
|
@@ -7,22 +7,24 @@ import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
|
7
7
|
* <mdui-linear-progress></mdui-linear-progress>
|
|
8
8
|
* ```
|
|
9
9
|
*
|
|
10
|
-
* @csspart indicator -
|
|
10
|
+
* @csspart indicator - 指示器部分
|
|
11
11
|
*
|
|
12
|
-
* @cssprop --shape-corner -
|
|
12
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
13
13
|
*/
|
|
14
|
-
export declare class LinearProgress extends
|
|
14
|
+
export declare class LinearProgress extends MduiElement<LinearProgressEventMap> {
|
|
15
15
|
static styles: CSSResultGroup;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* 进度指示器的最大值。默认为 `1`
|
|
18
18
|
*/
|
|
19
19
|
max: number;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* 进度指示器的当前值。如果未指定该值,则处于不确定状态
|
|
22
22
|
*/
|
|
23
23
|
value?: number;
|
|
24
24
|
protected render(): TemplateResult;
|
|
25
25
|
}
|
|
26
|
+
export interface LinearProgressEventMap {
|
|
27
|
+
}
|
|
26
28
|
declare global {
|
|
27
29
|
interface HTMLElementTagNameMap {
|
|
28
30
|
'mdui-linear-progress': LinearProgress;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html
|
|
2
|
+
import { html } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
4
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
5
5
|
import { isUndefined } from '@mdui/jq/shared/helper.js';
|
|
6
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
6
7
|
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
7
8
|
import { style } from './style.js';
|
|
8
9
|
/**
|
|
@@ -12,15 +13,15 @@ import { style } from './style.js';
|
|
|
12
13
|
* <mdui-linear-progress></mdui-linear-progress>
|
|
13
14
|
* ```
|
|
14
15
|
*
|
|
15
|
-
* @csspart indicator -
|
|
16
|
+
* @csspart indicator - 指示器部分
|
|
16
17
|
*
|
|
17
|
-
* @cssprop --shape-corner -
|
|
18
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
18
19
|
*/
|
|
19
|
-
let LinearProgress = class LinearProgress extends
|
|
20
|
+
let LinearProgress = class LinearProgress extends MduiElement {
|
|
20
21
|
constructor() {
|
|
21
22
|
super(...arguments);
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
+
* 进度指示器的最大值。默认为 `1`
|
|
24
25
|
*/
|
|
25
26
|
this.max = 1;
|
|
26
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
export const listItemStyle = css `:host{--shape-corner:var(--mdui-shape-corner-none);--shape-corner-rounded:var(--mdui-shape-corner-extra-large);position:relative;display:block;border-radius:var(--shape-corner);--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([rounded]),:host([rounded]) mdui-ripple{border-radius:var(--shape-corner-rounded)}:host([active]){background-color:rgb(var(--mdui-color-secondary-container));--mdui-comp-ripple-state-layer-color:var(
|
|
3
3
|
--mdui-color-on-secondary-container
|
|
4
|
-
)}:host([disabled]){pointer-events:none}.container{cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}:host([disabled]) .container{cursor:default;opacity:.38}:host([nonclickable]:not([href])) .container{cursor:auto;-webkit-user-select:auto;user-select:auto}.preset{display:flex;align-items:center;
|
|
4
|
+
)}:host([disabled]){pointer-events:none}.container{cursor:pointer;-webkit-user-select:none;user-select:none;text-decoration:none;color:inherit;-webkit-tap-highlight-color:transparent}:host([disabled]) .container{cursor:default;opacity:.38}:host([nonclickable]:not([href])) .container{cursor:auto;-webkit-user-select:auto;user-select:auto}.preset{display:flex;align-items:center;padding:.5rem 1.5rem .5rem 1rem;min-height:3.5rem}:host([alignment=start]) .preset{align-items:flex-start}:host([alignment=end]) .preset{align-items:flex-end}.body{display:flex;flex:1 1 100%;flex-direction:column;justify-content:center;min-width:0}.headline{display:block;color:rgb(var(--mdui-color-on-surface));font-size:var(--mdui-typescale-body-large-size);font-weight:var(--mdui-typescale-body-large-weight);letter-spacing:var(--mdui-typescale-body-large-tracking);line-height:var(--mdui-typescale-body-large-line-height)}:host([active]) .headline{color:rgb(var(--mdui-color-on-secondary-container))}.description{display:none;color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-body-medium-size);font-weight:var(--mdui-typescale-body-medium-weight);letter-spacing:var(--mdui-typescale-body-medium-tracking);line-height:var(--mdui-typescale-body-medium-line-height)}:host([disabled]) .description,:host([focused]) .description,:host([hover]) .description,:host([pressed]) .description{color:rgb(var(--mdui-color-on-surface))}.has-description .description{display:block}:host([description-line='1']) .description,:host([headline-line='1']) .headline{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([description-line='2']) .description,:host([description-line='3']) .description,:host([headline-line='2']) .headline,:host([headline-line='3']) .headline{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}:host([description-line='2']) .description,:host([headline-line='2']) .headline{-webkit-line-clamp:2}:host([description-line='3']) .description,:host([headline-line='3']) .headline{-webkit-line-clamp:3}.end-icon,.icon{display:flex;flex:0 0 auto;font-size:var(--mdui-typescale-label-small-size);font-weight:var(--mdui-typescale-label-small-weight);letter-spacing:var(--mdui-typescale-label-small-tracking);line-height:var(--mdui-typescale-label-small-line-height);color:rgb(var(--mdui-color-on-surface-variant))}:host([disabled]) .end-icon,:host([disabled]) .icon,:host([focused]) .end-icon,:host([focused]) .icon,:host([hover]) .end-icon,:host([hover]) .icon,:host([pressed]) .end-icon,:host([pressed]) .icon{color:rgb(var(--mdui-color-on-surface))}:host([active]) .end-icon,:host([active]) .icon{color:rgb(var(--mdui-color-on-secondary-container))}.end-icon mdui-icon,.icon mdui-icon,.is-end-icon ::slotted([slot=end-icon]),.is-icon ::slotted([slot=icon]){font-size:1.5rem}.has-icon .icon{margin-right:1rem}.has-icon ::slotted(mdui-checkbox[slot=icon]),.has-icon ::slotted(mdui-radio[slot=icon]){margin-left:-.5rem}.has-end-icon .end-icon{margin-left:1rem}.has-end-icon ::slotted(mdui-checkbox[slot=end-icon]),.has-end-icon ::slotted(mdui-radio[slot=end-icon]){margin-right:-.5rem}`;
|
|
@@ -1,10 +1,10 @@
|
|
|
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 ListItem_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 ListItem_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
|
-
* @summary
|
|
7
|
+
* @summary 列表项组件。需配合 `<mdui-list>` 组件使用
|
|
8
8
|
*
|
|
9
9
|
* ```html
|
|
10
10
|
* <mdui-list>
|
|
@@ -30,35 +30,35 @@ declare const ListItem_base: import("@open-wc/dedupe-mixin").Constructor<import(
|
|
|
30
30
|
* @csspart headline - 主标题
|
|
31
31
|
* @csspart description - 副标题
|
|
32
32
|
*
|
|
33
|
-
* @cssprop --shape-corner -
|
|
34
|
-
* @cssprop --shape-corner-rounded - 指定了 `rounded`
|
|
33
|
+
* @cssprop --shape-corner - 列表项的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
34
|
+
* @cssprop --shape-corner-rounded - 指定了 `rounded` 属性时,列表项的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
35
35
|
*/
|
|
36
|
-
export declare class ListItem extends ListItem_base {
|
|
36
|
+
export declare class ListItem extends ListItem_base<ListItemEventMap> {
|
|
37
37
|
static styles: CSSResultGroup;
|
|
38
38
|
/**
|
|
39
39
|
* 主文本。也可以通过 default slot 设置
|
|
40
40
|
*/
|
|
41
41
|
headline?: string;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* 主文本行数,超过限制后将截断显示。默认无行数限制。可选值包括:
|
|
44
44
|
*
|
|
45
|
-
* * `1
|
|
46
|
-
* * `2
|
|
47
|
-
* * `3
|
|
45
|
+
* * `1`:显示单行,超出后截断
|
|
46
|
+
* * `2`:显示两行,超出后截断
|
|
47
|
+
* * `3`:显示三行,超出后截断
|
|
48
48
|
*/
|
|
49
|
-
headlineLine?:
|
|
49
|
+
headlineLine?: /*显示单行,超出后截断*/ 1 | /*显示两行,超出后截断*/ 2 | /*显示三行,超出后截断*/ 3;
|
|
50
50
|
/**
|
|
51
51
|
* 副文本。也可以通过 `slot="description"` 设置
|
|
52
52
|
*/
|
|
53
53
|
description?: string;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* 副文本行数,超过限制后将截断显示。默认无行数限制。可选值包括:
|
|
56
56
|
*
|
|
57
|
-
* * `1
|
|
58
|
-
* * `2
|
|
59
|
-
* * `3
|
|
57
|
+
* * `1`:显示单行,超出后截断
|
|
58
|
+
* * `2`:显示两行,超出后截断
|
|
59
|
+
* * `3`:显示三行,超出后截断
|
|
60
60
|
*/
|
|
61
|
-
descriptionLine?: 1 | 2 | 3;
|
|
61
|
+
descriptionLine?: /*显示单行,超出后截断*/ 1 | /*显示两行,超出后截断*/ 2 | /*显示三行,超出后截断*/ 3;
|
|
62
62
|
/**
|
|
63
63
|
* 左侧的 Material Icons 图标名。也可以通过 `slot="icon"` 设置
|
|
64
64
|
*/
|
|
@@ -68,7 +68,7 @@ export declare class ListItem extends ListItem_base {
|
|
|
68
68
|
*/
|
|
69
69
|
endIcon?: string;
|
|
70
70
|
/**
|
|
71
|
-
*
|
|
71
|
+
* 是否禁用该列表项,禁用后,列表项将变为灰色,且其中的 [`<mdui-checkbox>`](/docs/2/components/checkbox)、[`<mdui-radio>`](/docs/2/components/radio)、[`<mdui-switch>`](/docs/2/components/switch) 等也将禁用
|
|
72
72
|
*/
|
|
73
73
|
disabled: boolean;
|
|
74
74
|
/**
|
|
@@ -76,15 +76,15 @@ export declare class ListItem extends ListItem_base {
|
|
|
76
76
|
*/
|
|
77
77
|
active: boolean;
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* 是否使列表项不可点击。设置后,列表项中的 [`<mdui-checkbox>`](/docs/2/components/checkbox)、[`<mdui-radio>`](/docs/2/components/radio)、[`<mdui-switch>`](/docs/2/components/switch) 等仍可交互
|
|
80
80
|
*/
|
|
81
81
|
nonclickable: boolean;
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
83
|
+
* 是否使用圆角形状的列表项
|
|
84
84
|
*/
|
|
85
85
|
rounded: boolean;
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
87
|
+
* 列表项的垂直对齐方式。可选值包括:
|
|
88
88
|
*
|
|
89
89
|
* * `start`:顶部对齐
|
|
90
90
|
* * `center`:居中对齐
|
|
@@ -103,6 +103,10 @@ export declare class ListItem extends ListItem_base {
|
|
|
103
103
|
protected render(): TemplateResult;
|
|
104
104
|
private renderInner;
|
|
105
105
|
}
|
|
106
|
+
export interface ListItemEventMap {
|
|
107
|
+
focus: FocusEvent;
|
|
108
|
+
blur: FocusEvent;
|
|
109
|
+
}
|
|
106
110
|
declare global {
|
|
107
111
|
interface HTMLElementTagNameMap {
|
|
108
112
|
'mdui-list-item': ListItem;
|
|
@@ -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';
|
|
@@ -14,7 +15,7 @@ import '../icon.js';
|
|
|
14
15
|
import { RippleMixin } from '../ripple/ripple-mixin.js';
|
|
15
16
|
import { listItemStyle } from './list-item-style.js';
|
|
16
17
|
/**
|
|
17
|
-
* @summary
|
|
18
|
+
* @summary 列表项组件。需配合 `<mdui-list>` 组件使用
|
|
18
19
|
*
|
|
19
20
|
* ```html
|
|
20
21
|
* <mdui-list>
|
|
@@ -40,14 +41,14 @@ import { listItemStyle } from './list-item-style.js';
|
|
|
40
41
|
* @csspart headline - 主标题
|
|
41
42
|
* @csspart description - 副标题
|
|
42
43
|
*
|
|
43
|
-
* @cssprop --shape-corner -
|
|
44
|
-
* @cssprop --shape-corner-rounded - 指定了 `rounded`
|
|
44
|
+
* @cssprop --shape-corner - 列表项的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
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
|
/**
|
|
50
|
-
*
|
|
51
|
+
* 是否禁用该列表项,禁用后,列表项将变为灰色,且其中的 [`<mdui-checkbox>`](/docs/2/components/checkbox)、[`<mdui-radio>`](/docs/2/components/radio)、[`<mdui-switch>`](/docs/2/components/switch) 等也将禁用
|
|
51
52
|
*/
|
|
52
53
|
this.disabled = false;
|
|
53
54
|
/**
|
|
@@ -55,15 +56,15 @@ let ListItem = class ListItem extends AnchorMixin(RippleMixin(FocusableMixin(Lit
|
|
|
55
56
|
*/
|
|
56
57
|
this.active = false;
|
|
57
58
|
/**
|
|
58
|
-
*
|
|
59
|
+
* 是否使列表项不可点击。设置后,列表项中的 [`<mdui-checkbox>`](/docs/2/components/checkbox)、[`<mdui-radio>`](/docs/2/components/radio)、[`<mdui-switch>`](/docs/2/components/switch) 等仍可交互
|
|
59
60
|
*/
|
|
60
61
|
this.nonclickable = false;
|
|
61
62
|
/**
|
|
62
|
-
*
|
|
63
|
+
* 是否使用圆角形状的列表项
|
|
63
64
|
*/
|
|
64
65
|
this.rounded = false;
|
|
65
66
|
/**
|
|
66
|
-
*
|
|
67
|
+
* 列表项的垂直对齐方式。可选值包括:
|
|
67
68
|
*
|
|
68
69
|
* * `start`:顶部对齐
|
|
69
70
|
* * `center`:居中对齐
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
2
2
|
import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
|
-
* @summary
|
|
4
|
+
* @summary 列表标题组件。需配合 `<mdui-list>` 组件使用
|
|
5
5
|
*
|
|
6
6
|
* ```html
|
|
7
7
|
* <mdui-list>
|
|
@@ -11,12 +11,14 @@ import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
|
11
11
|
* </mdui-list>
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
|
-
* @slot -
|
|
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,10 +1,11 @@
|
|
|
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
|
/**
|
|
7
|
-
* @summary
|
|
8
|
+
* @summary 列表标题组件。需配合 `<mdui-list>` 组件使用
|
|
8
9
|
*
|
|
9
10
|
* ```html
|
|
10
11
|
* <mdui-list>
|
|
@@ -14,9 +15,9 @@ import { listSubheaderStyle } from './list-subheader-style.js';
|
|
|
14
15
|
* </mdui-list>
|
|
15
16
|
* ```
|
|
16
17
|
*
|
|
17
|
-
* @slot -
|
|
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,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
2
2
|
import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
|
-
* @summary
|
|
4
|
+
* @summary 列表组件。需配合 `<mdui-list-item>` 组件使用
|
|
5
5
|
*
|
|
6
6
|
* ```html
|
|
7
7
|
* <mdui-list>
|
|
@@ -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,10 +1,11 @@
|
|
|
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
|
/**
|
|
7
|
-
* @summary
|
|
8
|
+
* @summary 列表组件。需配合 `<mdui-list-item>` 组件使用
|
|
8
9
|
*
|
|
9
10
|
* ```html
|
|
10
11
|
* <mdui-list>
|
|
@@ -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
|
}
|