mdui 2.1.3 → 2.1.5
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/README.md +49 -49
- package/components/avatar/index.d.ts +2 -2
- package/components/avatar/index.js +1 -1
- package/components/badge/index.d.ts +1 -1
- package/components/badge/index.js +1 -1
- package/components/bottom-app-bar/index.d.ts +2 -2
- package/components/bottom-app-bar/index.js +2 -2
- package/components/bottom-app-bar/style.js +1 -1
- package/components/button/index.d.ts +1 -1
- package/components/button/index.js +1 -1
- package/components/button/style.js +1 -1
- package/components/button-icon/index.d.ts +1 -1
- package/components/button-icon/index.js +3 -2
- package/components/button-icon/style.js +1 -1
- package/components/card/index.d.ts +1 -1
- package/components/card/index.js +1 -1
- package/components/checkbox/index.d.ts +4 -4
- package/components/checkbox/index.js +4 -4
- package/components/chip/index.d.ts +8 -8
- package/components/chip/index.js +8 -8
- package/components/circular-progress/index.d.ts +3 -3
- package/components/circular-progress/index.js +2 -2
- package/components/collapse/collapse-item.d.ts +1 -1
- package/components/collapse/collapse-item.js +1 -0
- package/components/dialog/index.d.ts +1 -1
- package/components/dialog/index.js +1 -1
- package/components/divider/index.d.ts +2 -2
- package/components/divider/index.js +2 -2
- package/components/dropdown/index.d.ts +2 -2
- package/components/dropdown/index.js +10 -3
- package/components/fab/index.d.ts +3 -3
- package/components/fab/index.js +3 -3
- package/components/icon/index.js +1 -1
- package/components/layout/layout-item-base.d.ts +1 -1
- package/components/layout/layout.d.ts +1 -1
- package/components/layout/layout.js +1 -1
- package/components/linear-progress/index.d.ts +4 -4
- package/components/linear-progress/index.js +3 -3
- package/components/list/list-item.d.ts +4 -4
- package/components/list/list-item.js +9 -8
- package/components/menu/menu-item.d.ts +2 -2
- package/components/menu/menu-item.js +4 -3
- package/components/menu/menu.d.ts +2 -2
- package/components/menu/menu.js +2 -3
- package/components/navigation-bar/navigation-bar-item.d.ts +1 -1
- package/components/navigation-bar/navigation-bar-item.js +1 -1
- package/components/navigation-bar/navigation-bar-style.js +1 -1
- package/components/navigation-bar/navigation-bar.d.ts +1 -1
- package/components/navigation-bar/navigation-bar.js +1 -1
- package/components/navigation-drawer/index.d.ts +15 -15
- package/components/navigation-drawer/index.js +15 -16
- package/components/navigation-drawer/style.js +1 -1
- package/components/navigation-rail/navigation-rail-item.d.ts +1 -1
- package/components/navigation-rail/navigation-rail-item.js +1 -1
- package/components/navigation-rail/navigation-rail.d.ts +3 -3
- package/components/navigation-rail/navigation-rail.js +3 -4
- package/components/radio/radio-group.d.ts +1 -1
- package/components/radio/radio-group.js +1 -1
- package/components/radio/radio.d.ts +2 -2
- package/components/radio/radio.js +2 -2
- package/components/range-slider/index.d.ts +1 -1
- package/components/range-slider/index.js +1 -1
- package/components/segmented-button/segmented-button-group.d.ts +1 -1
- package/components/segmented-button/segmented-button-group.js +1 -2
- package/components/segmented-button/segmented-button.d.ts +1 -1
- package/components/segmented-button/segmented-button.js +1 -1
- package/components/select/index.d.ts +2 -2
- package/components/select/index.js +3 -3
- package/components/slider/index.d.ts +1 -1
- package/components/slider/index.js +1 -1
- package/components/snackbar/index.d.ts +2 -2
- package/components/snackbar/index.js +2 -3
- package/components/switch/index.d.ts +4 -4
- package/components/switch/index.js +4 -4
- package/components/text-field/index.d.ts +4 -4
- package/components/text-field/index.js +7 -11
- package/components/text-field/style.js +1 -1
- package/components/tooltip/index.d.ts +3 -3
- package/components/tooltip/index.js +8 -7
- package/components/top-app-bar/top-app-bar-style.js +1 -1
- package/components/top-app-bar/top-app-bar.d.ts +2 -1
- package/components/top-app-bar/top-app-bar.js +7 -1
- package/css-data.en.json +128 -128
- package/css-data.zh-cn.json +111 -111
- package/custom-elements.json +142 -136
- package/functions/alert.js +6 -1
- package/functions/confirm.js +6 -1
- package/functions/prompt.js +6 -1
- package/html-data.en.json +488 -488
- package/html-data.zh-cn.json +29 -29
- package/jsx.en.d.ts +2554 -2552
- package/jsx.zh-cn.d.ts +2062 -2060
- package/locales/ar-eg.js +0 -2
- package/locales/az-az.js +0 -2
- package/locales/be-by.js +0 -2
- package/locales/bg-bg.js +0 -2
- package/locales/bn-bd.js +0 -2
- package/locales/ca-es.js +0 -2
- package/locales/cs-cz.js +0 -2
- package/locales/da-dk.js +0 -2
- package/locales/de-de.js +0 -2
- package/locales/el-gr.js +0 -2
- package/locales/en-gb.js +0 -2
- package/locales/es-es.js +0 -2
- package/locales/et-ee.js +0 -2
- package/locales/fa-ir.js +0 -2
- package/locales/fi-fi.js +0 -2
- package/locales/fr-be.js +0 -2
- package/locales/fr-ca.js +0 -2
- package/locales/fr-fr.js +0 -2
- package/locales/ga-ie.js +0 -2
- package/locales/gl-es.js +0 -2
- package/locales/he-il.js +0 -2
- package/locales/hi-in.js +0 -2
- package/locales/hr-hr.js +0 -2
- package/locales/hu-hu.js +0 -2
- package/locales/hy-am.js +0 -2
- package/locales/id-id.js +0 -2
- package/locales/is-is.js +0 -2
- package/locales/it-it.js +0 -2
- package/locales/ja-jp.js +0 -2
- package/locales/ka-ge.js +0 -2
- package/locales/kk-kz.js +0 -2
- package/locales/km-kh.js +0 -2
- package/locales/kmr-iq.js +0 -2
- package/locales/kn-in.js +0 -2
- package/locales/ko-kr.js +0 -2
- package/locales/lt-lt.js +0 -2
- package/locales/lv-lv.js +0 -2
- package/locales/mk-mk.js +0 -2
- package/locales/ml-in.js +0 -2
- package/locales/mn-mn.js +0 -2
- package/locales/ms-my.js +0 -2
- package/locales/nb-no.js +0 -2
- package/locales/ne-np.js +0 -2
- package/locales/nl-be.js +0 -2
- package/locales/nl-nl.js +0 -2
- package/locales/pl-pl.js +0 -2
- package/locales/pt-br.js +0 -2
- package/locales/pt-pt.js +0 -2
- package/locales/ro-ro.js +0 -2
- package/locales/ru-ru.js +0 -2
- package/locales/sk-sk.js +0 -2
- package/locales/sl-si.js +0 -2
- package/locales/sr-rs.js +0 -2
- package/locales/sv-se.js +0 -2
- package/locales/ta-in.js +0 -2
- package/locales/th-th.js +0 -2
- package/locales/tr-tr.js +0 -2
- package/locales/uk-ua.js +0 -2
- package/locales/ur-pk.js +0 -2
- package/locales/vi-vn.js +0 -2
- package/locales/zh-cn.js +0 -2
- package/locales/zh-hk.js +0 -2
- package/locales/zh-tw.js +0 -2
- package/mdui.css +1 -1
- package/mdui.esm.js +9 -9
- package/mdui.global.js +9 -9
- package/package.json +10 -9
- package/web-types.en.json +696 -696
- package/web-types.zh-cn.json +181 -181
package/README.md
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
# mdui
|
|
2
|
-
|
|
3
|
-
[](https://badge.fury.io/gh/zdhxiong%2Fmdui)
|
|
4
|
-
[](https://www.npmjs.com/package/mdui)
|
|
5
|
-
[](https://cdnjs.com/libraries/mdui)
|
|
6
|
-
|
|
7
|
-
[官网](https://www.mdui.org) | [文档](https://www.mdui.org/docs/2/)
|
|
8
|
-
|
|
9
|
-
使用 Web Components 实现,遵循 Material You 设计规范的 Web 前端组件库。
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## 安装
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
npm install mdui --save
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### 导入 CSS 及 JS 文件
|
|
31
|
-
|
|
32
|
-
```js
|
|
33
|
-
import 'mdui/mdui.css';
|
|
34
|
-
import 'mdui';
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### 使用组件
|
|
38
|
-
|
|
39
|
-
```html
|
|
40
|
-
<mdui-button>Button</mdui-button>
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## 赞助
|
|
44
|
-
|
|
45
|
-
赞助以帮助 mdui 持续更新
|
|
46
|
-
|
|
47
|
-

|
|
48
|
-

|
|
49
|
-
[](https://www.paypal.me/zdhxiong/5)
|
|
1
|
+
# mdui
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/gh/zdhxiong%2Fmdui)
|
|
4
|
+
[](https://www.npmjs.com/package/mdui)
|
|
5
|
+
[](https://cdnjs.com/libraries/mdui)
|
|
6
|
+
|
|
7
|
+
[官网](https://www.mdui.org) | [文档](https://www.mdui.org/docs/2/)
|
|
8
|
+
|
|
9
|
+
使用 Web Components 实现,遵循 Material You 设计规范的 Web 前端组件库。
|
|
10
|
+
|
|
11
|
+
- **Web Components**:mdui 组件全部使用 Web Components 开发,使用组件就像使用 `<div>` 标签一样简单。
|
|
12
|
+
- **Material You**:遵循最新的 Material Design 3(Material You)设计规范,使你的产品美观、易用。
|
|
13
|
+
- **动态配色**:支持根据给定颜色值,或给定一张图片,mdui 能自动计算出颜色值,生成整套配色方案,并在所有 mdui 组件中生效。
|
|
14
|
+
- **深色模式**:所有组件都支持深色模式、及支持根据操作系统设置自动切换浅色模式和深色模式。
|
|
15
|
+
- **轻量级**:gzip 后的 CSS + JavaScript 仅 85KB,使用按需导入可进一步减小体积,使加载更迅速。
|
|
16
|
+
- **IDE 支持**:在 VSCode 和 WebStorm 中能获得完美的代码提示。且提供了 VSCode 扩展和 WebStorm 插件,使开发更便捷。
|
|
17
|
+
- **兼容所有框架**:mdui 能兼容 Vue、React、Angular 等框架,只要在浏览器上运行的应用,都能使用 mdui。
|
|
18
|
+
- **TypeScript 支持**:mdui 完全使用 TypeScript 开发,拥有完美的类型提示。
|
|
19
|
+
- **无依赖**:不需要依赖任何第三方库,节约网络流量,使加载更迅速。
|
|
20
|
+
- **组件丰富**:mdui 包含 30 多个组件,及十余个工具函数,常用组件都有。
|
|
21
|
+
- **Material Icons 图标库**:提供了超过 1 万个图标组件,可按需导入所需图标。
|
|
22
|
+
- **低学习成本**:只需懂一点 HTML、CSS、JavaScript 的基础知识,就能使用 mdui。
|
|
23
|
+
|
|
24
|
+
## 安装
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install mdui --save
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 导入 CSS 及 JS 文件
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import 'mdui/mdui.css';
|
|
34
|
+
import 'mdui';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 使用组件
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<mdui-button>Button</mdui-button>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 赞助
|
|
44
|
+
|
|
45
|
+
赞助以帮助 mdui 持续更新
|
|
46
|
+
|
|
47
|
+

|
|
48
|
+

|
|
49
|
+
[](https://www.paypal.me/zdhxiong/5)
|
|
@@ -13,7 +13,7 @@ import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
|
13
13
|
* @csspart image - 使用图片作为头像时,组件内部的 `<img>` 元素
|
|
14
14
|
* @csspart icon - 使用图标作为头像时,组件内部的 `<mdui-icon>` 元素
|
|
15
15
|
*
|
|
16
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
16
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/docs/2/styles/design-tokens#shape-corner)
|
|
17
17
|
*/
|
|
18
18
|
export declare class Avatar extends MduiElement<AvatarEventMap> {
|
|
19
19
|
static styles: CSSResultGroup;
|
|
@@ -22,7 +22,7 @@ export declare class Avatar extends MduiElement<AvatarEventMap> {
|
|
|
22
22
|
*/
|
|
23
23
|
src?: string;
|
|
24
24
|
/**
|
|
25
|
-
* 图片如何适应容器框,与原生的 [`object-fit`](https://developer.mozilla.org/
|
|
25
|
+
* 图片如何适应容器框,与原生的 [`object-fit`](https://developer.mozilla.org/zh-CN/docs/Web/CSS/object-fit) 属性相同。可选值包括:
|
|
26
26
|
*
|
|
27
27
|
* * `contain`:保持图片原有尺寸比例,内容会被等比例缩放
|
|
28
28
|
* * `cover`:保持图片原有尺寸比例,但部分内容可能被剪切
|
|
@@ -21,7 +21,7 @@ import { style } from './style.js';
|
|
|
21
21
|
* @csspart image - 使用图片作为头像时,组件内部的 `<img>` 元素
|
|
22
22
|
* @csspart icon - 使用图标作为头像时,组件内部的 `<mdui-icon>` 元素
|
|
23
23
|
*
|
|
24
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
24
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/docs/2/styles/design-tokens#shape-corner)
|
|
25
25
|
*/
|
|
26
26
|
let Avatar = class Avatar extends MduiElement {
|
|
27
27
|
constructor() {
|
|
@@ -9,7 +9,7 @@ import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
|
9
9
|
*
|
|
10
10
|
* @slot - 徽标中显示的文本
|
|
11
11
|
*
|
|
12
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
12
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/docs/2/styles/design-tokens#shape-corner)
|
|
13
13
|
*/
|
|
14
14
|
export declare class Badge extends MduiElement<BadgeEventMap> {
|
|
15
15
|
static styles: CSSResultGroup;
|
|
@@ -14,7 +14,7 @@ import { style } from './style.js';
|
|
|
14
14
|
*
|
|
15
15
|
* @slot - 徽标中显示的文本
|
|
16
16
|
*
|
|
17
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
17
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/docs/2/styles/design-tokens#shape-corner)
|
|
18
18
|
*/
|
|
19
19
|
let Badge = class Badge extends MduiElement {
|
|
20
20
|
constructor() {
|
|
@@ -24,7 +24,7 @@ declare const BottomAppBar_base: import("@lit/reactive-element/decorators/base.j
|
|
|
24
24
|
*
|
|
25
25
|
* @slot - 底部应用栏内部的元素
|
|
26
26
|
*
|
|
27
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
27
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/docs/2/styles/design-tokens#shape-corner)
|
|
28
28
|
* @cssprop --z-index - 组件的 CSS `z-index` 值
|
|
29
29
|
*/
|
|
30
30
|
export declare class BottomAppBar extends BottomAppBar_base<BottomAppBarEventMap> {
|
|
@@ -34,7 +34,7 @@ export declare class BottomAppBar extends BottomAppBar_base<BottomAppBarEventMap
|
|
|
34
34
|
*/
|
|
35
35
|
hide: boolean;
|
|
36
36
|
/**
|
|
37
|
-
* 是否让底部应用栏中的 [`<mdui-fab>`](/docs/2/components/fab) 组件脱离应用栏。如果为 `true`,则当应用栏隐藏后,[`<mdui-fab>`](/docs/2/components/fab) 仍会停留在页面上
|
|
37
|
+
* 是否让底部应用栏中的 [`<mdui-fab>`](/zh-cn/docs/2/components/fab) 组件脱离应用栏。如果为 `true`,则当应用栏隐藏后,[`<mdui-fab>`](/zh-cn/docs/2/components/fab) 仍会停留在页面上
|
|
38
38
|
*/
|
|
39
39
|
fabDetach: boolean;
|
|
40
40
|
/**
|
|
@@ -27,7 +27,7 @@ import { style } from './style.js';
|
|
|
27
27
|
*
|
|
28
28
|
* @slot - 底部应用栏内部的元素
|
|
29
29
|
*
|
|
30
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
30
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/docs/2/styles/design-tokens#shape-corner)
|
|
31
31
|
* @cssprop --z-index - 组件的 CSS `z-index` 值
|
|
32
32
|
*/
|
|
33
33
|
let BottomAppBar = class BottomAppBar extends ScrollBehaviorMixin(LayoutItemBase) {
|
|
@@ -38,7 +38,7 @@ let BottomAppBar = class BottomAppBar extends ScrollBehaviorMixin(LayoutItemBase
|
|
|
38
38
|
*/
|
|
39
39
|
this.hide = false;
|
|
40
40
|
/**
|
|
41
|
-
* 是否让底部应用栏中的 [`<mdui-fab>`](/docs/2/components/fab) 组件脱离应用栏。如果为 `true`,则当应用栏隐藏后,[`<mdui-fab>`](/docs/2/components/fab) 仍会停留在页面上
|
|
41
|
+
* 是否让底部应用栏中的 [`<mdui-fab>`](/zh-cn/docs/2/components/fab) 组件脱离应用栏。如果为 `true`,则当应用栏隐藏后,[`<mdui-fab>`](/zh-cn/docs/2/components/fab) 仍会停留在页面上
|
|
42
42
|
*/
|
|
43
43
|
this.fabDetach = false;
|
|
44
44
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-none);--z-index:2000;position:fixed;right:0;bottom:0;left:0;display:flex;flex:0 0 auto;align-items:center;justify-content:flex-start;border-radius:var(--shape-corner) var(--shape-corner) 0 0;z-index:var(--z-index);transition:
|
|
2
|
+
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-none);--z-index:2000;position:fixed;right:0;bottom:0;left:0;display:flex;flex:0 0 auto;align-items:center;justify-content:flex-start;border-radius:var(--shape-corner) var(--shape-corner) 0 0;z-index:var(--z-index);transition:transform var(--mdui-motion-duration-long2) var(--mdui-motion-easing-emphasized);padding:0 1rem;height:5rem;background-color:rgb(var(--mdui-color-surface-container));box-shadow:var(--mdui-elevation-level2)}:host([scroll-target]:not([scroll-target=''])){position:absolute}:host([hide]:not([hide=false i])){transition-duration:var(--mdui-motion-duration-short4);transform:translateY(5.625rem)}::slotted(:not(:first-child)){margin-left:.5rem}::slotted(mdui-fab){box-shadow:var(--mdui-elevation-level0)}:host([fab-detach]:not([fab-detach=false i])) ::slotted(mdui-fab){transition:transform var(--mdui-motion-duration-long2) var(--mdui-motion-easing-standard)}:host([fab-detach][hide][scroll-behavior~=hide]:not([hide=false i],[fab-detach=false i])) ::slotted(mdui-fab){transition-duration:var(--mdui-motion-duration-short4);box-shadow:var(--mdui-elevation-level2);transform:translateY(-5.875rem)}:host([hide]:not([hide=false i])) ::slotted(:not(mdui-fab)),:host([hide]:not([hide=false i],[fab-detach])) ::slotted(mdui-fab),:host([hide][fab-detach=false i]:not([hide=false i])) ::slotted(mdui-fab){transform:translateY(8.75rem);transition:transform var(--mdui-motion-duration-0) var(--mdui-motion-easing-emphasized-accelerate) var(--mdui-motion-duration-short4)}::slotted(:first-child){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-short1)}::slotted(:nth-child(2)){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-short3)}::slotted(:nth-child(3)){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-short4)}::slotted(:nth-child(4)){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-medium1)}::slotted(:nth-child(5)){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-medium2)}::slotted(:nth-child(6)){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-medium3)}`;
|
|
@@ -23,7 +23,7 @@ import type { TemplateResult, CSSResultGroup } from 'lit';
|
|
|
23
23
|
* @csspart end-icon - 按钮右侧的图标
|
|
24
24
|
* @csspart loading - 加载中状态的 `<mdui-circular-progress>` 元素
|
|
25
25
|
*
|
|
26
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
26
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/docs/2/styles/design-tokens#shape-corner)
|
|
27
27
|
*/
|
|
28
28
|
export declare class Button extends ButtonBase<ButtonEventMap> {
|
|
29
29
|
static styles: CSSResultGroup;
|
|
@@ -28,7 +28,7 @@ import { style } from './style.js';
|
|
|
28
28
|
* @csspart end-icon - 按钮右侧的图标
|
|
29
29
|
* @csspart loading - 加载中状态的 `<mdui-circular-progress>` 元素
|
|
30
30
|
*
|
|
31
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
31
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/docs/2/styles/design-tokens#shape-corner)
|
|
32
32
|
*/
|
|
33
33
|
let Button = class Button extends ButtonBase {
|
|
34
34
|
constructor() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-full);position:relative;display:inline-block;flex-shrink:0;overflow:hidden;text-align:center;border-radius:var(--shape-corner);cursor:pointer;-webkit-tap-highlight-color:transparent;transition:box-shadow var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);min-width:3rem;height:2.5rem;color:rgb(var(--mdui-color-primary));font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height)}.button{width:100%;padding:0 1rem}:host([full-width]:not([full-width=false i])){
|
|
2
|
+
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-full);position:relative;display:inline-block;flex-shrink:0;overflow:hidden;text-align:center;border-radius:var(--shape-corner);cursor:pointer;-webkit-tap-highlight-color:transparent;transition:box-shadow var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);min-width:3rem;height:2.5rem;color:rgb(var(--mdui-color-primary));font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height)}.button{width:100%;padding:0 1rem}:host([full-width]:not([full-width=false i])){width:100%}:host([variant=elevated]){box-shadow:var(--mdui-elevation-level1);background-color:rgb(var(--mdui-color-surface-container-low));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=filled]){color:rgb(var(--mdui-color-on-primary));background-color:rgb(var(--mdui-color-primary));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-primary)}:host([variant=tonal]){color:rgb(var(--mdui-color-on-secondary-container));background-color:rgb(var(--mdui-color-secondary-container));--mdui-comp-ripple-state-layer-color:var(
|
|
3
3
|
--mdui-color-on-secondary-container
|
|
4
4
|
)}:host([variant=outlined]){border:.0625rem solid rgb(var(--mdui-color-outline));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=text]){--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=outlined][focus-visible]){border-color:rgb(var(--mdui-color-primary))}:host([variant=elevated][hover]){box-shadow:var(--mdui-elevation-level2)}:host([variant=filled][hover]),:host([variant=tonal][hover]){box-shadow:var(--mdui-elevation-level1)}:host([disabled]:not([disabled=false i])),:host([loading]:not([loading=false i])){cursor:default;pointer-events:none}:host([disabled]:not([disabled=false i])){color:rgba(var(--mdui-color-on-surface),38%);box-shadow:var(--mdui-elevation-level0)}:host([variant=elevated][disabled]:not([disabled=false i])),:host([variant=filled][disabled]:not([disabled=false i])),:host([variant=tonal][disabled]:not([disabled=false i])){background-color:rgba(var(--mdui-color-on-surface),12%)}:host([variant=outlined][disabled]:not([disabled=false i])){border-color:rgba(var(--mdui-color-on-surface),12%)}.label{display:inline-flex;padding-right:.5rem;padding-left:.5rem}.end-icon,.icon{display:inline-flex;font-size:1.28571429em}.end-icon mdui-icon,.icon mdui-icon,::slotted([slot=end-icon]),::slotted([slot=icon]){font-size:inherit}mdui-circular-progress{display:inline-flex;width:1.125rem;height:1.125rem}:host([variant=filled]) mdui-circular-progress{stroke:rgb(var(--mdui-color-on-primary))}:host([variant=tonal]) mdui-circular-progress{stroke:rgb(var(--mdui-color-on-secondary-container))}:host([disabled]:not([disabled=false i])) mdui-circular-progress{stroke:rgba(var(--mdui-color-on-surface),38%)}`;
|
|
@@ -22,7 +22,7 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
|
22
22
|
* @csspart selected-icon 选中状态的图标
|
|
23
23
|
* @csspart loading - 加载中状态的 `<mdui-circular-progress>` 元素
|
|
24
24
|
*
|
|
25
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
25
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/docs/2/styles/design-tokens#shape-corner)
|
|
26
26
|
*/
|
|
27
27
|
export declare class ButtonIcon extends ButtonBase<ButtonIconEventMap> {
|
|
28
28
|
static styles: CSSResultGroup;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
5
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
5
6
|
import { HasSlotController } from '@mdui/shared/controllers/has-slot.js';
|
|
6
7
|
import { watch } from '@mdui/shared/decorators/watch.js';
|
|
@@ -29,7 +30,7 @@ import { style } from './style.js';
|
|
|
29
30
|
* @csspart selected-icon 选中状态的图标
|
|
30
31
|
* @csspart loading - 加载中状态的 `<mdui-circular-progress>` 元素
|
|
31
32
|
*
|
|
32
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
33
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/docs/2/styles/design-tokens#shape-corner)
|
|
33
34
|
*/
|
|
34
35
|
let ButtonIcon = class ButtonIcon extends ButtonBase {
|
|
35
36
|
constructor() {
|
|
@@ -91,7 +92,7 @@ let ButtonIcon = class ButtonIcon extends ButtonBase {
|
|
|
91
92
|
? html `<mdui-icon part="icon" class="icon" name="${this.icon}"></mdui-icon>`
|
|
92
93
|
: nothingTemplate;
|
|
93
94
|
const selectedIcon = () => this.hasSlotController.test('selected-icon') || this.selectedIcon
|
|
94
|
-
? html `<slot name="selected-icon" part="selected-icon" class="selected-icon"><mdui-icon name="${this.selectedIcon}"></mdui-icon></slot>`
|
|
95
|
+
? html `<slot name="selected-icon" part="selected-icon" class="selected-icon"><mdui-icon name="${ifDefined(this.selectedIcon)}"></mdui-icon></slot>`
|
|
95
96
|
: icon();
|
|
96
97
|
return this.selected ? selectedIcon() : icon();
|
|
97
98
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-full);position:relative;display:inline-block;flex-shrink:0;overflow:hidden;text-align:center;border-radius:var(--shape-corner);cursor:pointer;-webkit-tap-highlight-color:transparent;font-size:1.5rem;width:2.5rem;height:2.5rem}:host([variant=standard]){color:rgb(var(--mdui-color-on-surface-variant));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}:host([variant=filled]){color:rgb(var(--mdui-color-primary));background-color:rgb(var(--mdui-color-surface-container-highest));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=tonal]){color:rgb(var(--mdui-color-on-surface-variant));background-color:rgb(var(--mdui-color-surface-container-highest));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}:host([variant=outlined]){border:.0625rem solid rgb(var(--mdui-color-outline));color:rgb(var(--mdui-color-on-surface-variant));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}:host([variant=outlined][pressed]){color:rgb(var(--mdui-color-on-surface));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([variant=standard][selected]:not([selected=false i])){color:rgb(var(--mdui-color-primary));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=filled]:not([selectable])),:host([variant=filled][selectable=false i]),:host([variant=filled][selected]:not([selected=false i])){color:rgb(var(--mdui-color-on-primary));background-color:rgb(var(--mdui-color-primary));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-primary)}:host([variant=tonal]:not([selectable])),:host([variant=tonal][selectable=false i]),:host([variant=tonal][selected]:not([selected=false i])){color:rgb(var(--mdui-color-on-secondary-container));background-color:rgb(var(--mdui-color-secondary-container));--mdui-comp-ripple-state-layer-color:var(
|
|
3
3
|
--mdui-color-on-secondary-container
|
|
4
|
-
)}:host([variant=outlined][selected]:not([selected=false i])){border:none;color:rgb(var(--mdui-color-inverse-on-surface));background-color:rgb(var(--mdui-color-inverse-surface));--mdui-comp-ripple-state-layer-color:var(--mdui-color-inverse-on-surface)}:host([variant=filled][disabled]:not([disabled=false i])),:host([variant=outlined][disabled]:not([disabled=false i])),:host([variant=tonal][disabled]:not([disabled=false i])){background-color:rgba(var(--mdui-color-on-surface),.12);border-color:rgba(var(--mdui-color-on-surface),.12)}:host([disabled]:not([disabled=false i])),:host([loading]:not([loading=false i])){cursor:default;pointer-events:none}:host([disabled]:not([disabled=false i])){color:rgba(var(--mdui-color-on-surface),.38)!important}:host([loading]:not([loading=false i])) .button,:host([loading]:not([loading=false i])) mdui-ripple{opacity:0}.
|
|
4
|
+
)}:host([variant=outlined][selected]:not([selected=false i])){border:none;color:rgb(var(--mdui-color-inverse-on-surface));background-color:rgb(var(--mdui-color-inverse-surface));--mdui-comp-ripple-state-layer-color:var(--mdui-color-inverse-on-surface)}:host([variant=filled][disabled]:not([disabled=false i])),:host([variant=outlined][disabled]:not([disabled=false i])),:host([variant=tonal][disabled]:not([disabled=false i])){background-color:rgba(var(--mdui-color-on-surface),.12);border-color:rgba(var(--mdui-color-on-surface),.12)}:host([disabled]:not([disabled=false i])),:host([loading]:not([loading=false i])){cursor:default;pointer-events:none}:host([disabled]:not([disabled=false i])){color:rgba(var(--mdui-color-on-surface),.38)!important}.button{float:left;width:100%}:host([loading]:not([loading=false i])) .button,:host([loading]:not([loading=false i])) mdui-ripple{opacity:0}.icon,.selected-icon mdui-icon,::slotted(*){font-size:inherit}mdui-circular-progress{display:flex;position:absolute;top:calc(50% - 1.5rem / 2);left:calc(50% - 1.5rem / 2);width:1.5rem;height:1.5rem}:host([variant=filled]:not([disabled])) mdui-circular-progress,:host([variant=filled][disabled=false i]) mdui-circular-progress{stroke:rgb(var(--mdui-color-on-primary))}:host([disabled]:not([disabled=false i])) mdui-circular-progress{stroke:rgba(var(--mdui-color-on-surface),38%)}`;
|
|
@@ -14,7 +14,7 @@ declare const Card_base: import("@lit/reactive-element/decorators/base.js").Cons
|
|
|
14
14
|
*
|
|
15
15
|
* @slot - 卡片的内容
|
|
16
16
|
*
|
|
17
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
17
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/docs/2/styles/design-tokens#shape-corner)
|
|
18
18
|
*/
|
|
19
19
|
export declare class Card extends Card_base<CardEventMap> {
|
|
20
20
|
static styles: CSSResultGroup;
|
package/components/card/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import { style } from './style.js';
|
|
|
21
21
|
*
|
|
22
22
|
* @slot - 卡片的内容
|
|
23
23
|
*
|
|
24
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
24
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/docs/2/styles/design-tokens#shape-corner)
|
|
25
25
|
*/
|
|
26
26
|
let Card = class Card extends AnchorMixin(RippleMixin(FocusableMixin(MduiElement))) {
|
|
27
27
|
constructor() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import '@mdui/icons-shared/check-box-outline-blank.js';
|
|
2
|
+
import '@mdui/icons-shared/check-box.js';
|
|
3
|
+
import '@mdui/icons-shared/indeterminate-check-box.js';
|
|
1
4
|
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
2
|
-
import '@mdui/shared/icons/check-box-outline-blank.js';
|
|
3
|
-
import '@mdui/shared/icons/check-box.js';
|
|
4
|
-
import '@mdui/shared/icons/indeterminate-check-box.js';
|
|
5
5
|
import '../icon.js';
|
|
6
6
|
import type { Ripple } from '../ripple/index.js';
|
|
7
7
|
import type { FormControl } from '@mdui/jq/shared/form.js';
|
|
@@ -64,7 +64,7 @@ export declare class Checkbox extends Checkbox_base<CheckboxEventMap> implements
|
|
|
64
64
|
*/
|
|
65
65
|
name: string;
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
67
|
+
* 复选框的值,将与表单数据一起提交
|
|
68
68
|
*/
|
|
69
69
|
value: string;
|
|
70
70
|
/**
|
|
@@ -5,14 +5,14 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
|
5
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
6
|
import { live } from 'lit/directives/live.js';
|
|
7
7
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
8
|
+
import '@mdui/icons-shared/check-box-outline-blank.js';
|
|
9
|
+
import '@mdui/icons-shared/check-box.js';
|
|
10
|
+
import '@mdui/icons-shared/indeterminate-check-box.js';
|
|
8
11
|
import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
9
12
|
import { FormController, formResets } from '@mdui/shared/controllers/form.js';
|
|
10
13
|
import { defaultValue } from '@mdui/shared/decorators/default-value.js';
|
|
11
14
|
import { watch } from '@mdui/shared/decorators/watch.js';
|
|
12
15
|
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
13
|
-
import '@mdui/shared/icons/check-box-outline-blank.js';
|
|
14
|
-
import '@mdui/shared/icons/check-box.js';
|
|
15
|
-
import '@mdui/shared/icons/indeterminate-check-box.js';
|
|
16
16
|
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
17
17
|
import { FocusableMixin } from '@mdui/shared/mixins/focusable.js';
|
|
18
18
|
import '../icon.js';
|
|
@@ -70,7 +70,7 @@ let Checkbox = class Checkbox extends RippleMixin(FocusableMixin(MduiElement)) {
|
|
|
70
70
|
*/
|
|
71
71
|
this.name = '';
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
73
|
+
* 复选框的值,将与表单数据一起提交
|
|
74
74
|
*/
|
|
75
75
|
this.value = 'on';
|
|
76
76
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import '@mdui/shared/
|
|
2
|
-
import '@mdui/shared/
|
|
1
|
+
import '@mdui/icons-shared/check.js';
|
|
2
|
+
import '@mdui/icons-shared/clear.js';
|
|
3
3
|
import { ButtonBase } from '../button/button-base.js';
|
|
4
4
|
import '../icon.js';
|
|
5
5
|
import type { Ripple } from '../ripple/index.js';
|
|
6
6
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
7
7
|
/**
|
|
8
|
-
* @summary
|
|
8
|
+
* @summary 标签组件
|
|
9
9
|
*
|
|
10
10
|
* ```html
|
|
11
11
|
* <mdui-chip>Chip</mdui-chip>
|
|
@@ -17,26 +17,26 @@ 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
23
|
* @slot selected-icon - 选中状态下的左侧元素
|
|
24
24
|
* @slot delete-icon - 可删除时的右侧删除元素
|
|
25
25
|
*
|
|
26
26
|
* @csspart button - 内部的 `<button>` 或 `<a>` 元素
|
|
27
|
-
* @csspart label -
|
|
27
|
+
* @csspart label - 标签文本
|
|
28
28
|
* @csspart icon - 左侧图标
|
|
29
29
|
* @csspart end-icon - 右侧图标
|
|
30
30
|
* @csspart selected-icon - 选中状态下的左侧图标
|
|
31
31
|
* @csspart delete-icon - 可删除时的右侧删除图标
|
|
32
32
|
* @csspart loading - 加载中状态的 `<mdui-circular-progress>` 元素
|
|
33
33
|
*
|
|
34
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
34
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/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
41
|
* * `assist`:用于显示与当前上下文相关的辅助操作,如在点餐页面提供分享、收藏等功能
|
|
42
42
|
* * `filter`:用于对内容进行筛选,如在搜索结果页过滤搜索结果
|
|
@@ -57,7 +57,7 @@ export declare class Chip extends ButtonBase<ChipEventMap> {
|
|
|
57
57
|
*/
|
|
58
58
|
selected: boolean;
|
|
59
59
|
/**
|
|
60
|
-
* 是否可删除。为 `true`
|
|
60
|
+
* 是否可删除。为 `true` 时,标签右侧会显示删除图标
|
|
61
61
|
*/
|
|
62
62
|
deletable: boolean;
|
|
63
63
|
/**
|
package/components/chip/index.js
CHANGED
|
@@ -2,18 +2,18 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
4
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
5
|
+
import '@mdui/icons-shared/check.js';
|
|
6
|
+
import '@mdui/icons-shared/clear.js';
|
|
5
7
|
import cc from 'classcat';
|
|
6
8
|
import { HasSlotController } from '@mdui/shared/controllers/has-slot.js';
|
|
7
9
|
import { watch } from '@mdui/shared/decorators/watch.js';
|
|
8
10
|
import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
9
11
|
import { nothingTemplate } from '@mdui/shared/helpers/template.js';
|
|
10
|
-
import '@mdui/shared/icons/check.js';
|
|
11
|
-
import '@mdui/shared/icons/clear.js';
|
|
12
12
|
import { ButtonBase } from '../button/button-base.js';
|
|
13
13
|
import '../icon.js';
|
|
14
14
|
import { style } from './style.js';
|
|
15
15
|
/**
|
|
16
|
-
* @summary
|
|
16
|
+
* @summary 标签组件
|
|
17
17
|
*
|
|
18
18
|
* ```html
|
|
19
19
|
* <mdui-chip>Chip</mdui-chip>
|
|
@@ -25,27 +25,27 @@ 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
31
|
* @slot selected-icon - 选中状态下的左侧元素
|
|
32
32
|
* @slot delete-icon - 可删除时的右侧删除元素
|
|
33
33
|
*
|
|
34
34
|
* @csspart button - 内部的 `<button>` 或 `<a>` 元素
|
|
35
|
-
* @csspart label -
|
|
35
|
+
* @csspart label - 标签文本
|
|
36
36
|
* @csspart icon - 左侧图标
|
|
37
37
|
* @csspart end-icon - 右侧图标
|
|
38
38
|
* @csspart selected-icon - 选中状态下的左侧图标
|
|
39
39
|
* @csspart delete-icon - 可删除时的右侧删除图标
|
|
40
40
|
* @csspart loading - 加载中状态的 `<mdui-circular-progress>` 元素
|
|
41
41
|
*
|
|
42
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
42
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/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
50
|
* * `assist`:用于显示与当前上下文相关的辅助操作,如在点餐页面提供分享、收藏等功能
|
|
51
51
|
* * `filter`:用于对内容进行筛选,如在搜索结果页过滤搜索结果
|
|
@@ -66,7 +66,7 @@ let Chip = class Chip extends ButtonBase {
|
|
|
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();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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-circular-progress></mdui-circular-progress>
|
|
@@ -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;
|
|
@@ -7,7 +7,7 @@ import { MduiElement } from '@mdui/shared/base/mdui-element.js';
|
|
|
7
7
|
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
8
8
|
import { style } from './style.js';
|
|
9
9
|
/**
|
|
10
|
-
* @summary
|
|
10
|
+
* @summary 环形进度条组件
|
|
11
11
|
*
|
|
12
12
|
* ```html
|
|
13
13
|
* <mdui-circular-progress></mdui-circular-progress>
|
|
@@ -17,7 +17,7 @@ let CircularProgress = class CircularProgress extends MduiElement {
|
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments);
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* 进度条的最大值。默认为 `1`
|
|
21
21
|
*/
|
|
22
22
|
this.max = 1;
|
|
23
23
|
}
|
|
@@ -38,7 +38,7 @@ export declare class CollapseItem extends MduiElement<CollapseItemEventMap> {
|
|
|
38
38
|
*/
|
|
39
39
|
disabled: boolean;
|
|
40
40
|
/**
|
|
41
|
-
* 点击该元素时触发折叠,值可以是 CSS 选择器、DOM 元素、或 [JQ 对象](/docs/2/functions/jq)。默认为点击整个 header 区域触发
|
|
41
|
+
* 点击该元素时触发折叠,值可以是 CSS 选择器、DOM 元素、或 [JQ 对象](/zh-cn/docs/2/functions/jq)。默认为点击整个 header 区域触发
|
|
42
42
|
*/
|
|
43
43
|
trigger?: string | HTMLElement | JQ<HTMLElement>;
|
|
44
44
|
/**
|
|
@@ -85,6 +85,7 @@ let CollapseItem = class CollapseItem extends MduiElement {
|
|
|
85
85
|
// 如果是从 opened 状态开始关闭,则先设置高度值,并等重绘完成
|
|
86
86
|
if (this.state === 'close') {
|
|
87
87
|
$(this.bodyRef.value).height(scrollHeight);
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
88
89
|
this.bodyRef.value.clientLeft;
|
|
89
90
|
}
|
|
90
91
|
$(this.bodyRef.value).height(this.state === 'opened'
|
|
@@ -30,7 +30,7 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
|
30
30
|
* @csspart description - 副文本部分,位于 body 中
|
|
31
31
|
* @csspart action - 底部操作按钮
|
|
32
32
|
*
|
|
33
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
33
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/docs/2/styles/design-tokens#shape-corner)
|
|
34
34
|
* @cssprop --z-index - 组件的 CSS `z-index` 值
|
|
35
35
|
*/
|
|
36
36
|
export declare class Dialog extends MduiElement<DialogEventMap> {
|
|
@@ -47,7 +47,7 @@ import { style } from './style.js';
|
|
|
47
47
|
* @csspart description - 副文本部分,位于 body 中
|
|
48
48
|
* @csspart action - 底部操作按钮
|
|
49
49
|
*
|
|
50
|
-
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
|
|
50
|
+
* @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/zh-cn/docs/2/styles/design-tokens#shape-corner)
|
|
51
51
|
* @cssprop --z-index - 组件的 CSS `z-index` 值
|
|
52
52
|
*/
|
|
53
53
|
let Dialog = class Dialog extends MduiElement {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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-divider></mdui-divider>
|
|
@@ -10,7 +10,7 @@ import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
|
10
10
|
export declare class Divider extends MduiElement<DividerEventMap> {
|
|
11
11
|
static styles: CSSResultGroup;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* 是否为垂直分隔线
|
|
14
14
|
*/
|
|
15
15
|
vertical: boolean;
|
|
16
16
|
/**
|
|
@@ -6,7 +6,7 @@ import { booleanConverter } from '@mdui/shared/helpers/decorator.js';
|
|
|
6
6
|
import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
|
|
7
7
|
import { style } from './style.js';
|
|
8
8
|
/**
|
|
9
|
-
* @summary
|
|
9
|
+
* @summary 分隔线组件
|
|
10
10
|
*
|
|
11
11
|
* ```html
|
|
12
12
|
* <mdui-divider></mdui-divider>
|
|
@@ -16,7 +16,7 @@ let Divider = class Divider extends MduiElement {
|
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* 是否为垂直分隔线
|
|
20
20
|
*/
|
|
21
21
|
this.vertical = false;
|
|
22
22
|
/**
|
|
@@ -22,7 +22,7 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
|
22
22
|
* @event closed - 下拉组件关闭动画完成时,事件被触发
|
|
23
23
|
*
|
|
24
24
|
* @slot - 下拉组件的内容
|
|
25
|
-
* @slot trigger - 触发下拉组件的元素,例如 [`<mdui-button>`](/docs/2/components/button) 元素
|
|
25
|
+
* @slot trigger - 触发下拉组件的元素,例如 [`<mdui-button>`](/zh-cn/docs/2/components/button) 元素
|
|
26
26
|
*
|
|
27
27
|
* @csspart trigger - 触发下拉组件的元素的容器,即 `trigger` slot 的容器
|
|
28
28
|
* @csspart panel - 下拉组件内容的容器
|
|
@@ -68,7 +68,7 @@ export declare class Dropdown extends MduiElement<DropdownEventMap> {
|
|
|
68
68
|
*/
|
|
69
69
|
placement: /*自动判断位置*/ 'auto' | /*上方左对齐*/ 'top-start' | /*上方居中*/ 'top' | /*上方右对齐*/ 'top-end' | /*下方左对齐*/ 'bottom-start' | /*下方居中*/ 'bottom' | /*下方右对齐*/ 'bottom-end' | /*左侧顶部对齐*/ 'left-start' | /*左侧居中*/ 'left' | /*左侧底部对齐*/ 'left-end' | /*右侧顶部对齐*/ 'right-start' | /*右侧居中*/ 'right' | /*右侧底部对齐*/ 'right-end';
|
|
70
70
|
/**
|
|
71
|
-
* 点击 [`<mdui-menu-item>`](/docs/2/components/menu#menu-item-api) 后,下拉组件是否保持打开状态
|
|
71
|
+
* 点击 [`<mdui-menu-item>`](/zh-cn/docs/2/components/menu#menu-item-api) 后,下拉组件是否保持打开状态
|
|
72
72
|
*/
|
|
73
73
|
stayOpenOnClick: boolean;
|
|
74
74
|
/**
|