mdui 2.0.3 → 2.0.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.
Files changed (156) hide show
  1. package/components/avatar/index.d.ts +13 -13
  2. package/components/avatar/index.js +11 -6
  3. package/components/avatar/style.js +31 -1
  4. package/components/badge/index.d.ts +7 -6
  5. package/components/badge/index.js +6 -5
  6. package/components/badge/style.js +25 -1
  7. package/components/bottom-app-bar/index.d.ts +4 -3
  8. package/components/bottom-app-bar/index.js +3 -3
  9. package/components/bottom-app-bar/style.js +92 -1
  10. package/components/button/button-base-style.js +28 -1
  11. package/components/button/button-base.d.ts +43 -44
  12. package/components/button/button-base.js +28 -21
  13. package/components/button/index.d.ts +13 -13
  14. package/components/button/index.js +30 -20
  15. package/components/button/style.js +111 -2
  16. package/components/button-icon/index.d.ts +8 -8
  17. package/components/button-icon/index.js +29 -12
  18. package/components/button-icon/style.js +103 -2
  19. package/components/card/index.d.ts +8 -8
  20. package/components/card/index.js +12 -8
  21. package/components/card/style.js +72 -1
  22. package/components/checkbox/index.d.ts +20 -20
  23. package/components/checkbox/index.js +68 -25
  24. package/components/checkbox/style.js +131 -1
  25. package/components/chip/index.d.ts +19 -19
  26. package/components/chip/index.js +49 -25
  27. package/components/chip/style.js +205 -2
  28. package/components/circular-progress/index.d.ts +2 -2
  29. package/components/circular-progress/index.js +40 -6
  30. package/components/circular-progress/style.js +136 -1
  31. package/components/collapse/collapse-item-style.js +21 -1
  32. package/components/collapse/collapse-item.d.ts +4 -4
  33. package/components/collapse/collapse-item.js +12 -4
  34. package/components/collapse/collapse-style.js +5 -1
  35. package/components/collapse/collapse.d.ts +6 -9
  36. package/components/collapse/collapse.js +8 -5
  37. package/components/dialog/index.d.ts +13 -13
  38. package/components/dialog/index.js +48 -20
  39. package/components/dialog/style.js +116 -1
  40. package/components/divider/index.d.ts +3 -3
  41. package/components/divider/index.js +3 -3
  42. package/components/divider/style.js +18 -1
  43. package/components/dropdown/index.d.ts +35 -35
  44. package/components/dropdown/index.js +41 -34
  45. package/components/dropdown/style.js +11 -1
  46. package/components/fab/index.d.ts +6 -6
  47. package/components/fab/index.js +19 -11
  48. package/components/fab/style.js +153 -4
  49. package/components/icon/index.js +5 -1
  50. package/components/icon/style.js +29 -1
  51. package/components/layout/layout-item-style.js +6 -1
  52. package/components/layout/layout-item.d.ts +7 -7
  53. package/components/layout/layout-item.js +6 -6
  54. package/components/layout/layout-main-style.js +7 -1
  55. package/components/layout/layout-main.d.ts +2 -2
  56. package/components/layout/layout-main.js +2 -2
  57. package/components/layout/layout-style.js +11 -1
  58. package/components/layout/layout.d.ts +2 -2
  59. package/components/layout/layout.js +2 -2
  60. package/components/linear-progress/index.d.ts +4 -4
  61. package/components/linear-progress/index.js +9 -5
  62. package/components/linear-progress/style.js +73 -1
  63. package/components/list/list-item-style.js +153 -2
  64. package/components/list/list-item.d.ts +17 -17
  65. package/components/list/list-item.js +34 -15
  66. package/components/list/list-style.js +10 -1
  67. package/components/list/list-subheader-style.js +19 -1
  68. package/components/list/list-subheader.d.ts +2 -2
  69. package/components/list/list-subheader.js +2 -2
  70. package/components/list/list.d.ts +1 -1
  71. package/components/list/list.js +1 -1
  72. package/components/menu/menu-item-style.js +125 -1
  73. package/components/menu/menu-item.d.ts +4 -4
  74. package/components/menu/menu-item.js +57 -15
  75. package/components/menu/menu-style.js +19 -1
  76. package/components/menu/menu.d.ts +15 -18
  77. package/components/menu/menu.js +13 -9
  78. package/components/navigation-bar/navigation-bar-item-style.js +132 -1
  79. package/components/navigation-bar/navigation-bar-item.d.ts +5 -5
  80. package/components/navigation-bar/navigation-bar-item.js +27 -11
  81. package/components/navigation-bar/navigation-bar-style.js +28 -1
  82. package/components/navigation-bar/navigation-bar.d.ts +9 -8
  83. package/components/navigation-bar/navigation-bar.js +10 -7
  84. package/components/navigation-drawer/index.d.ts +19 -20
  85. package/components/navigation-drawer/index.js +56 -31
  86. package/components/navigation-drawer/style.js +66 -1
  87. package/components/navigation-rail/navigation-rail-item-style.js +122 -1
  88. package/components/navigation-rail/navigation-rail-item.d.ts +6 -6
  89. package/components/navigation-rail/navigation-rail-item.js +30 -11
  90. package/components/navigation-rail/navigation-rail-style.js +79 -1
  91. package/components/navigation-rail/navigation-rail.d.ts +10 -11
  92. package/components/navigation-rail/navigation-rail.js +19 -11
  93. package/components/radio/radio-group-style.js +20 -1
  94. package/components/radio/radio-group.d.ts +13 -13
  95. package/components/radio/radio-group.js +30 -12
  96. package/components/radio/radio-style.js +107 -1
  97. package/components/radio/radio.d.ts +3 -3
  98. package/components/radio/radio.js +26 -8
  99. package/components/range-slider/index.d.ts +5 -6
  100. package/components/range-slider/index.js +57 -10
  101. package/components/ripple/index.js +5 -2
  102. package/components/ripple/style.js +96 -1
  103. package/components/segmented-button/segmented-button-group-style.js +28 -1
  104. package/components/segmented-button/segmented-button-group.d.ts +17 -20
  105. package/components/segmented-button/segmented-button-group.js +32 -15
  106. package/components/segmented-button/segmented-button-style.js +81 -2
  107. package/components/segmented-button/segmented-button.d.ts +3 -3
  108. package/components/segmented-button/segmented-button.js +30 -14
  109. package/components/select/index.d.ts +31 -32
  110. package/components/select/index.js +106 -26
  111. package/components/select/style.js +27 -1
  112. package/components/slider/index.d.ts +1 -1
  113. package/components/slider/index.js +34 -3
  114. package/components/slider/slider-base-style.js +173 -1
  115. package/components/slider/slider-base.d.ts +15 -15
  116. package/components/slider/slider-base.js +19 -14
  117. package/components/slider/style.js +7 -1
  118. package/components/snackbar/index.d.ts +21 -21
  119. package/components/snackbar/index.js +47 -20
  120. package/components/snackbar/style.js +100 -1
  121. package/components/switch/index.d.ts +14 -14
  122. package/components/switch/index.js +51 -17
  123. package/components/switch/style.js +202 -1
  124. package/components/tabs/tab-panel-style.js +10 -1
  125. package/components/tabs/tab-panel.d.ts +3 -3
  126. package/components/tabs/tab-panel.js +2 -2
  127. package/components/tabs/tab-style.js +85 -1
  128. package/components/tabs/tab.d.ts +6 -6
  129. package/components/tabs/tab.js +29 -9
  130. package/components/tabs/tabs-style.js +138 -1
  131. package/components/tabs/tabs.d.ts +19 -19
  132. package/components/tabs/tabs.js +26 -18
  133. package/components/text-field/index.d.ts +51 -51
  134. package/components/text-field/index.js +185 -57
  135. package/components/text-field/style.js +362 -1
  136. package/components/tooltip/index.d.ts +31 -31
  137. package/components/tooltip/index.js +38 -29
  138. package/components/tooltip/style.js +57 -1
  139. package/components/top-app-bar/top-app-bar-style.js +78 -1
  140. package/components/top-app-bar/top-app-bar-title-style.js +81 -1
  141. package/components/top-app-bar/top-app-bar-title.d.ts +4 -4
  142. package/components/top-app-bar/top-app-bar-title.js +21 -7
  143. package/components/top-app-bar/top-app-bar.d.ts +5 -5
  144. package/components/top-app-bar/top-app-bar.js +4 -4
  145. package/css-data.en.json +2826 -0
  146. package/css-data.zh-cn.json +374 -367
  147. package/custom-elements.json +2049 -2049
  148. package/html-data.en.json +6560 -0
  149. package/html-data.zh-cn.json +1427 -1433
  150. package/jsx.en.d.ts +3303 -0
  151. package/jsx.zh-cn.d.ts +3351 -0
  152. package/package.json +6 -5
  153. package/web-types.en.json +11734 -0
  154. package/web-types.zh-cn.json +3227 -3221
  155. package/mdui.esm.js +0 -22
  156. package/mdui.global.js +0 -22
@@ -13,15 +13,15 @@ import { style } from './style.js';
13
13
  * <mdui-linear-progress></mdui-linear-progress>
14
14
  * ```
15
15
  *
16
- * @csspart indicator - 指示器
16
+ * @csspart indicator - 指示器部分
17
17
  *
18
- * @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
18
+ * @cssprop --shape-corner - 组件的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
19
19
  */
20
20
  let LinearProgress = class LinearProgress extends MduiElement {
21
21
  constructor() {
22
22
  super(...arguments);
23
23
  /**
24
- * 进度指示器的最大值,默认为 1
24
+ * 进度指示器的最大值。默认为 `1`
25
25
  */
26
26
  this.max = 1;
27
27
  }
@@ -29,9 +29,13 @@ let LinearProgress = class LinearProgress extends MduiElement {
29
29
  const isDeterminate = !isUndefined(this.value);
30
30
  if (isDeterminate) {
31
31
  const value = this.value;
32
- return html `<div part="indicator" class="determinate" style="${styleMap({
32
+ return html `<div
33
+ part="indicator"
34
+ class="determinate"
35
+ style="${styleMap({
33
36
  width: `${(value / Math.max(this.max ?? value, value)) * 100}%`,
34
- })}"></div>`;
37
+ })}"
38
+ ></div>`;
35
39
  }
36
40
  return html `<div part="indicator" class="indeterminate"></div>`;
37
41
  }
@@ -1,2 +1,74 @@
1
1
  import { css } from 'lit';
2
- export const style = css `:host{--shape-corner:var(--mdui-shape-corner-none);position:relative;display:inline-block;width:100%;overflow:hidden;border-radius:var(--shape-corner);background-color:rgb(var(--mdui-color-surface-container-highest));height:.25rem}.determinate,.indeterminate{background-color:rgb(var(--mdui-color-primary))}.determinate{height:100%;transition:width var(--mdui-motion-duration-long2) var(--mdui-motion-easing-standard)}.indeterminate::before{position:absolute;top:0;bottom:0;left:0;background-color:inherit;animation:mdui-comp-progress-indeterminate 2s var(--mdui-motion-easing-linear) infinite;content:' '}.indeterminate::after{position:absolute;top:0;bottom:0;left:0;background-color:inherit;animation:mdui-comp-progress-indeterminate-short 2s var(--mdui-motion-easing-linear) infinite;content:' '}@keyframes mdui-comp-progress-indeterminate{0%{left:0;width:0}50%{left:30%;width:70%}75%{left:100%;width:0}}@keyframes mdui-comp-progress-indeterminate-short{0%{left:0;width:0}50%{left:0;width:0}75%{left:0;width:25%}100%{left:100%;width:0}}`;
2
+ export const style = css `
3
+ :host {
4
+ --shape-corner: var(--mdui-shape-corner-none);
5
+ position: relative;
6
+ display: inline-block;
7
+ width: 100%;
8
+ overflow: hidden;
9
+ border-radius: var(--shape-corner);
10
+ background-color: rgb(var(--mdui-color-surface-container-highest));
11
+ height: 0.25rem;
12
+ }
13
+ .determinate,
14
+ .indeterminate {
15
+ background-color: rgb(var(--mdui-color-primary));
16
+ }
17
+ .determinate {
18
+ height: 100%;
19
+ transition: width var(--mdui-motion-duration-long2)
20
+ var(--mdui-motion-easing-standard);
21
+ }
22
+ .indeterminate::before {
23
+ position: absolute;
24
+ top: 0;
25
+ bottom: 0;
26
+ left: 0;
27
+ background-color: inherit;
28
+ animation: mdui-comp-progress-indeterminate 2s
29
+ var(--mdui-motion-easing-linear) infinite;
30
+ content: ' ';
31
+ }
32
+ .indeterminate::after {
33
+ position: absolute;
34
+ top: 0;
35
+ bottom: 0;
36
+ left: 0;
37
+ background-color: inherit;
38
+ animation: mdui-comp-progress-indeterminate-short 2s
39
+ var(--mdui-motion-easing-linear) infinite;
40
+ content: ' ';
41
+ }
42
+ @keyframes mdui-comp-progress-indeterminate {
43
+ 0% {
44
+ left: 0;
45
+ width: 0;
46
+ }
47
+ 50% {
48
+ left: 30%;
49
+ width: 70%;
50
+ }
51
+ 75% {
52
+ left: 100%;
53
+ width: 0;
54
+ }
55
+ }
56
+ @keyframes mdui-comp-progress-indeterminate-short {
57
+ 0% {
58
+ left: 0;
59
+ width: 0;
60
+ }
61
+ 50% {
62
+ left: 0;
63
+ width: 0;
64
+ }
65
+ 75% {
66
+ left: 0;
67
+ width: 25%;
68
+ }
69
+ 100% {
70
+ left: 100%;
71
+ width: 0;
72
+ }
73
+ }
74
+ `;
@@ -1,4 +1,155 @@
1
1
  import { css } from 'lit';
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(
2
+ export const listItemStyle = css `
3
+ :host {
4
+ --shape-corner: var(--mdui-shape-corner-none);
5
+ --shape-corner-rounded: var(--mdui-shape-corner-extra-large);
6
+ position: relative;
7
+ display: block;
8
+ border-radius: var(--shape-corner);
9
+ --mdui-comp-ripple-state-layer-color: var(--mdui-color-on-surface);
10
+ }
11
+ :host([rounded]),
12
+ :host([rounded]) mdui-ripple {
13
+ border-radius: var(--shape-corner-rounded);
14
+ }
15
+ :host([active]) {
16
+ background-color: rgb(var(--mdui-color-secondary-container));
17
+ --mdui-comp-ripple-state-layer-color: var(
3
18
  --mdui-color-on-secondary-container
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}`;
19
+ );
20
+ }
21
+ :host([disabled]) {
22
+ pointer-events: none;
23
+ }
24
+ .container {
25
+ cursor: pointer;
26
+ -webkit-user-select: none;
27
+ user-select: none;
28
+ text-decoration: none;
29
+ color: inherit;
30
+ -webkit-tap-highlight-color: transparent;
31
+ }
32
+ :host([disabled]) .container {
33
+ cursor: default;
34
+ opacity: 0.38;
35
+ }
36
+ :host([nonclickable]:not([href])) .container {
37
+ cursor: auto;
38
+ -webkit-user-select: auto;
39
+ user-select: auto;
40
+ }
41
+ .preset {
42
+ display: flex;
43
+ align-items: center;
44
+ padding: 0.5rem 1.5rem 0.5rem 1rem;
45
+ min-height: 3.5rem;
46
+ }
47
+ :host([alignment='start']) .preset {
48
+ align-items: flex-start;
49
+ }
50
+ :host([alignment='end']) .preset {
51
+ align-items: flex-end;
52
+ }
53
+ .body {
54
+ display: flex;
55
+ flex: 1 1 100%;
56
+ flex-direction: column;
57
+ justify-content: center;
58
+ min-width: 0;
59
+ }
60
+ .headline {
61
+ display: block;
62
+ color: rgb(var(--mdui-color-on-surface));
63
+ font-size: var(--mdui-typescale-body-large-size);
64
+ font-weight: var(--mdui-typescale-body-large-weight);
65
+ letter-spacing: var(--mdui-typescale-body-large-tracking);
66
+ line-height: var(--mdui-typescale-body-large-line-height);
67
+ }
68
+ :host([active]) .headline {
69
+ color: rgb(var(--mdui-color-on-secondary-container));
70
+ }
71
+ .description {
72
+ display: none;
73
+ color: rgb(var(--mdui-color-on-surface-variant));
74
+ font-size: var(--mdui-typescale-body-medium-size);
75
+ font-weight: var(--mdui-typescale-body-medium-weight);
76
+ letter-spacing: var(--mdui-typescale-body-medium-tracking);
77
+ line-height: var(--mdui-typescale-body-medium-line-height);
78
+ }
79
+ :host([disabled]) .description,
80
+ :host([hover]) .description,
81
+ :host([focused]) .description,
82
+ :host([pressed]) .description {
83
+ color: rgb(var(--mdui-color-on-surface));
84
+ }
85
+ .has-description .description {
86
+ display: block;
87
+ }
88
+ :host([headline-line='1']) .headline,
89
+ :host([description-line='1']) .description {
90
+ overflow: hidden;
91
+ white-space: nowrap;
92
+ text-overflow: ellipsis;
93
+ }
94
+ :host([headline-line='2']) .headline,
95
+ :host([description-line='2']) .description,
96
+ :host([headline-line='3']) .headline,
97
+ :host([description-line='3']) .description {
98
+ display: -webkit-box;
99
+ overflow: hidden;
100
+ text-overflow: ellipsis;
101
+ -webkit-box-orient: vertical;
102
+ }
103
+ :host([headline-line='2']) .headline,
104
+ :host([description-line='2']) .description {
105
+ -webkit-line-clamp: 2;
106
+ }
107
+ :host([headline-line='3']) .headline,
108
+ :host([description-line='3']) .description {
109
+ -webkit-line-clamp: 3;
110
+ }
111
+ .icon,
112
+ .end-icon {
113
+ display: flex;
114
+ flex: 0 0 auto;
115
+ font-size: var(--mdui-typescale-label-small-size);
116
+ font-weight: var(--mdui-typescale-label-small-weight);
117
+ letter-spacing: var(--mdui-typescale-label-small-tracking);
118
+ line-height: var(--mdui-typescale-label-small-line-height);
119
+ color: rgb(var(--mdui-color-on-surface-variant));
120
+ }
121
+ :host([disabled]) .icon,
122
+ :host([disabled]) .end-icon,
123
+ :host([hover]) .icon,
124
+ :host([hover]) .end-icon,
125
+ :host([focused]) .icon,
126
+ :host([focused]) .end-icon,
127
+ :host([pressed]) .icon,
128
+ :host([pressed]) .end-icon {
129
+ color: rgb(var(--mdui-color-on-surface));
130
+ }
131
+ :host([active]) .icon,
132
+ :host([active]) .end-icon {
133
+ color: rgb(var(--mdui-color-on-secondary-container));
134
+ }
135
+ .icon mdui-icon,
136
+ .end-icon mdui-icon,
137
+ .is-icon ::slotted([slot='icon']),
138
+ .is-end-icon ::slotted([slot='end-icon']) {
139
+ font-size: 1.5rem;
140
+ }
141
+ .has-icon .icon {
142
+ margin-right: 1rem;
143
+ }
144
+ .has-icon ::slotted(mdui-checkbox[slot='icon']),
145
+ .has-icon ::slotted(mdui-radio[slot='icon']) {
146
+ margin-left: -0.5rem;
147
+ }
148
+ .has-end-icon .end-icon {
149
+ margin-left: 1rem;
150
+ }
151
+ .has-end-icon ::slotted(mdui-checkbox[slot='end-icon']),
152
+ .has-end-icon ::slotted(mdui-radio[slot='end-icon']) {
153
+ margin-right: -0.5rem;
154
+ }
155
+ `;
@@ -4,7 +4,7 @@ import type { Ripple } from '../ripple/index.js';
4
4
  import type { CSSResultGroup, TemplateResult } from 'lit';
5
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 列表项组件。需与 `<mdui-list>` 组件配合使用
7
+ * @summary 列表项组件。需配合 `<mdui-list>` 组件使用
8
8
  *
9
9
  * ```html
10
10
  * <mdui-list>
@@ -30,8 +30,8 @@ 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 - 列表项的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
34
- * @cssprop --shape-corner-rounded - 指定了 `rounded` 时,列表项的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
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
36
  export declare class ListItem extends ListItem_base<ListItemEventMap> {
37
37
  static styles: CSSResultGroup;
@@ -40,25 +40,25 @@ export declare class ListItem extends ListItem_base<ListItemEventMap> {
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?: /*显示单行文本,超出后截断显示*/ 1 | /*显示两行文本,超出后截断显示*/ 2 | /*显示三行文本,超出后截断显示*/ 3;
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<ListItemEventMap> {
68
68
  */
69
69
  endIcon?: string;
70
70
  /**
71
- * 是否禁用该列表项,列表项将置灰,且其中的 [`<mdui-checkbox>`](/docs/2/components/checkbox)、[`<mdui-radio>`](/docs/2/components/radio)、[`<mdui-switch>`](/docs/2/components/switch) 等都将禁用
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<ListItemEventMap> {
76
76
  */
77
77
  active: boolean;
78
78
  /**
79
- * 是否使列表项不可点击,但其中的 [`<mdui-checkbox>`](/docs/2/components/checkbox)、[`<mdui-radio>`](/docs/2/components/radio)、[`<mdui-switch>`](/docs/2/components/switch) 等仍可进行交互
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`:居中对齐
@@ -15,7 +15,7 @@ import '../icon.js';
15
15
  import { RippleMixin } from '../ripple/ripple-mixin.js';
16
16
  import { listItemStyle } from './list-item-style.js';
17
17
  /**
18
- * @summary 列表项组件。需与 `<mdui-list>` 组件配合使用
18
+ * @summary 列表项组件。需配合 `<mdui-list>` 组件使用
19
19
  *
20
20
  * ```html
21
21
  * <mdui-list>
@@ -41,14 +41,14 @@ import { listItemStyle } from './list-item-style.js';
41
41
  * @csspart headline - 主标题
42
42
  * @csspart description - 副标题
43
43
  *
44
- * @cssprop --shape-corner - 列表项的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
45
- * @cssprop --shape-corner-rounded - 指定了 `rounded` 时,列表项的圆角大小。可以指定一个具体的像素值;但更推荐[引用设计令牌](/docs/2/styles/design-tokens#shape-corner)
44
+ * @cssprop --shape-corner - 列表项的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
45
+ * @cssprop --shape-corner-rounded - 指定了 `rounded` 属性时,列表项的圆角大小。可以指定一个具体的像素值;但更推荐引用[设计令牌](/docs/2/styles/design-tokens#shape-corner)
46
46
  */
47
47
  let ListItem = class ListItem extends AnchorMixin(RippleMixin(FocusableMixin(MduiElement))) {
48
48
  constructor() {
49
49
  super(...arguments);
50
50
  /**
51
- * 是否禁用该列表项,列表项将置灰,且其中的 [`<mdui-checkbox>`](/docs/2/components/checkbox)、[`<mdui-radio>`](/docs/2/components/radio)、[`<mdui-switch>`](/docs/2/components/switch) 等都将禁用
51
+ * 是否禁用该列表项,禁用后,列表项将变为灰色,且其中的 [`<mdui-checkbox>`](/docs/2/components/checkbox)、[`<mdui-radio>`](/docs/2/components/radio)、[`<mdui-switch>`](/docs/2/components/switch) 等也将禁用
52
52
  */
53
53
  this.disabled = false;
54
54
  /**
@@ -56,15 +56,15 @@ let ListItem = class ListItem extends AnchorMixin(RippleMixin(FocusableMixin(Mdu
56
56
  */
57
57
  this.active = false;
58
58
  /**
59
- * 是否使列表项不可点击,但其中的 [`<mdui-checkbox>`](/docs/2/components/checkbox)、[`<mdui-radio>`](/docs/2/components/radio)、[`<mdui-switch>`](/docs/2/components/switch) 等仍可进行交互
59
+ * 是否使列表项不可点击。设置后,列表项中的 [`<mdui-checkbox>`](/docs/2/components/checkbox)、[`<mdui-radio>`](/docs/2/components/radio)、[`<mdui-switch>`](/docs/2/components/switch) 等仍可交互
60
60
  */
61
61
  this.nonclickable = false;
62
62
  /**
63
- * 使用圆角形状的列表项
63
+ * 是否使用圆角形状的列表项
64
64
  */
65
65
  this.rounded = false;
66
66
  /**
67
- * 列表项的垂直对齐方式。可选值为:
67
+ * 列表项的垂直对齐方式。可选值包括:
68
68
  *
69
69
  * * `start`:顶部对齐
70
70
  * * `center`:居中对齐
@@ -103,24 +103,43 @@ let ListItem = class ListItem extends AnchorMixin(RippleMixin(FocusableMixin(Mdu
103
103
  // end-icon slot 中的元素是否为 mdui-icon 或 mdui-icon-* 组件
104
104
  'is-end-icon': getNodeName(this.endIconElements[0]).startsWith('mdui-icon-'),
105
105
  });
106
- return html `<mdui-ripple ${ref(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.href && !this.disabled
106
+ return html `<mdui-ripple
107
+ ${ref(this.rippleRef)}
108
+ .noRipple=${this.noRipple}
109
+ ></mdui-ripple>
110
+ ${this.href && !this.disabled
107
111
  ? this.renderAnchor({
108
112
  className,
109
113
  content: this.renderInner(),
110
114
  part: 'container',
111
115
  refDirective: ref(this.itemRef),
112
116
  })
113
- : html `<div part="container" class="${className}" ${ref(this.itemRef)}>${this.renderInner()}</div>`}`;
117
+ : html `<div part="container" class="${className}" ${ref(this.itemRef)}>
118
+ ${this.renderInner()}
119
+ </div>`}`;
114
120
  }
115
121
  renderInner() {
116
122
  const hasDefaultSlot = this.hasSlotController.test('[default]');
117
- return html `<slot name="custom"><slot name="icon" part="icon" class="icon">${this.icon
118
- ? html `<mdui-icon name="${this.icon}"></mdui-icon>`
119
- : nothingTemplate}</slot><div part="body" class="body">${hasDefaultSlot
123
+ return html `<slot name="custom">
124
+ <slot name="icon" part="icon" class="icon">
125
+ ${this.icon
126
+ ? html `<mdui-icon name=${this.icon}></mdui-icon>`
127
+ : nothingTemplate}
128
+ </slot>
129
+ <div part="body" class="body">
130
+ ${hasDefaultSlot
120
131
  ? html `<slot part="headline" class="headline"></slot>`
121
- : html `<div part="headline" class="headline">${this.headline}</div>`}<slot name="description" part="description" class="description">${this.description}</slot></div><slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon
122
- ? html `<mdui-icon name="${this.endIcon}"></mdui-icon>`
123
- : nothingTemplate}</slot></slot>`;
132
+ : html `<div part="headline" class="headline">${this.headline}</div>`}
133
+ <slot name="description" part="description" class="description">
134
+ ${this.description}
135
+ </slot>
136
+ </div>
137
+ <slot name="end-icon" part="end-icon" class="end-icon">
138
+ ${this.endIcon
139
+ ? html `<mdui-icon name=${this.endIcon}></mdui-icon>`
140
+ : nothingTemplate}
141
+ </slot>
142
+ </slot>`;
124
143
  }
125
144
  };
126
145
  ListItem.styles = [
@@ -1,2 +1,11 @@
1
1
  import { css } from 'lit';
2
- export const listStyle = css `:host{display:block;padding:.5rem 0}::slotted(mdui-divider[middle]){margin-left:1rem;margin-right:1.5rem}`;
2
+ export const listStyle = css `
3
+ :host {
4
+ display: block;
5
+ padding: 0.5rem 0rem;
6
+ }
7
+ ::slotted(mdui-divider[middle]) {
8
+ margin-left: 1rem;
9
+ margin-right: 1.5rem;
10
+ }
11
+ `;
@@ -1,2 +1,20 @@
1
1
  import { css } from 'lit';
2
- export const listSubheaderStyle = css `:host{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:default;color:rgb(var(--mdui-color-on-surface-variant));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);padding-left:1rem;padding-right:1.5rem;height:3.5rem;line-height:3.5rem}`;
2
+ export const listSubheaderStyle = css `
3
+ /* 规范中没有该描述 */
4
+ :host {
5
+ display: block;
6
+ overflow: hidden;
7
+ white-space: nowrap;
8
+ text-overflow: ellipsis;
9
+ cursor: default;
10
+ color: rgb(var(--mdui-color-on-surface-variant));
11
+ font-size: var(--mdui-typescale-label-small-size);
12
+ font-weight: var(--mdui-typescale-label-small-weight);
13
+ letter-spacing: var(--mdui-typescale-label-small-tracking);
14
+ line-height: var(--mdui-typescale-label-small-line-height);
15
+ padding-left: 1rem;
16
+ padding-right: 1.5rem;
17
+ height: 3.5rem;
18
+ line-height: 3.5rem;
19
+ }
20
+ `;
@@ -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 列表标题组件。需与 `<mdui-list>` 组件配合使用
4
+ * @summary 列表标题组件。需配合 `<mdui-list>` 组件使用
5
5
  *
6
6
  * ```html
7
7
  * <mdui-list>
@@ -11,7 +11,7 @@ import type { CSSResultGroup, TemplateResult } from 'lit';
11
11
  * </mdui-list>
12
12
  * ```
13
13
  *
14
- * @slot - 文本
14
+ * @slot - 列表标题文本
15
15
  */
16
16
  export declare class ListSubheader extends MduiElement<ListSubheaderEventMap> {
17
17
  static styles: CSSResultGroup;
@@ -5,7 +5,7 @@ import { MduiElement } from '@mdui/shared/base/mdui-element.js';
5
5
  import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
6
6
  import { listSubheaderStyle } from './list-subheader-style.js';
7
7
  /**
8
- * @summary 列表标题组件。需与 `<mdui-list>` 组件配合使用
8
+ * @summary 列表标题组件。需配合 `<mdui-list>` 组件使用
9
9
  *
10
10
  * ```html
11
11
  * <mdui-list>
@@ -15,7 +15,7 @@ import { listSubheaderStyle } from './list-subheader-style.js';
15
15
  * </mdui-list>
16
16
  * ```
17
17
  *
18
- * @slot - 文本
18
+ * @slot - 列表标题文本
19
19
  */
20
20
  let ListSubheader = class ListSubheader extends MduiElement {
21
21
  render() {
@@ -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 列表组件。需与 `<mdui-list-item>` 组件配合使用
4
+ * @summary 列表组件。需配合 `<mdui-list-item>` 组件使用
5
5
  *
6
6
  * ```html
7
7
  * <mdui-list>
@@ -5,7 +5,7 @@ import { MduiElement } from '@mdui/shared/base/mdui-element.js';
5
5
  import { componentStyle } from '@mdui/shared/lit-styles/component-style.js';
6
6
  import { listStyle } from './list-style.js';
7
7
  /**
8
- * @summary 列表组件。需与 `<mdui-list-item>` 组件配合使用
8
+ * @summary 列表组件。需配合 `<mdui-list-item>` 组件使用
9
9
  *
10
10
  * ```html
11
11
  * <mdui-list>