mdui 2.0.5 → 2.0.6
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.js +2 -7
- package/components/avatar/style.js +1 -31
- package/components/badge/style.js +1 -25
- package/components/bottom-app-bar/style.js +1 -92
- package/components/button/button-base-style.js +1 -28
- package/components/button/button-base.js +1 -8
- package/components/button/index.js +8 -18
- package/components/button/style.js +2 -111
- package/components/button-icon/index.js +5 -22
- package/components/button-icon/style.js +2 -103
- package/components/card/index.js +1 -5
- package/components/card/style.js +1 -72
- package/components/checkbox/index.js +7 -50
- package/components/checkbox/style.js +1 -131
- package/components/chip/index.js +9 -33
- package/components/chip/style.js +2 -205
- package/components/circular-progress/index.js +5 -39
- package/components/circular-progress/style.js +1 -136
- package/components/collapse/collapse-item-style.js +1 -21
- package/components/collapse/collapse-item.js +2 -10
- package/components/collapse/collapse-style.js +1 -5
- package/components/collapse/collapse.js +1 -4
- package/components/dialog/index.js +7 -35
- package/components/dialog/style.js +1 -116
- package/components/divider/style.js +1 -18
- package/components/dropdown/index.js +1 -8
- package/components/dropdown/style.js +1 -11
- package/components/fab/index.js +5 -13
- package/components/fab/style.js +4 -153
- package/components/icon/index.js +1 -5
- package/components/icon/style.js +1 -29
- package/components/layout/layout-item-style.js +1 -6
- package/components/layout/layout-main-style.js +1 -7
- package/components/layout/layout-style.js +1 -11
- package/components/linear-progress/index.js +2 -6
- package/components/linear-progress/style.js +1 -73
- package/components/list/list-item-style.js +2 -153
- package/components/list/list-item.js +8 -27
- package/components/list/list-style.js +1 -10
- package/components/list/list-subheader-style.js +1 -19
- package/components/menu/menu-item-style.js +1 -125
- package/components/menu/menu-item.js +13 -55
- package/components/menu/menu-style.js +1 -19
- package/components/menu/menu.js +1 -5
- package/components/navigation-bar/navigation-bar-item-style.js +1 -132
- package/components/navigation-bar/navigation-bar-item.js +7 -23
- package/components/navigation-bar/navigation-bar-style.js +1 -28
- package/components/navigation-bar/navigation-bar.js +1 -4
- package/components/navigation-drawer/index.js +1 -12
- package/components/navigation-drawer/style.js +1 -66
- package/components/navigation-rail/navigation-rail-item-style.js +1 -122
- package/components/navigation-rail/navigation-rail-item.js +7 -26
- package/components/navigation-rail/navigation-rail-style.js +1 -79
- package/components/navigation-rail/navigation-rail.js +1 -10
- package/components/radio/radio-group-style.js +1 -20
- package/components/radio/radio-group.js +1 -19
- package/components/radio/radio-style.js +1 -107
- package/components/radio/radio.js +5 -23
- package/components/range-slider/index.d.ts +1 -1
- package/components/range-slider/index.js +5 -53
- package/components/ripple/index.js +2 -5
- package/components/ripple/style.js +1 -96
- package/components/segmented-button/segmented-button-group-style.js +1 -28
- package/components/segmented-button/segmented-button-group.js +1 -21
- package/components/segmented-button/segmented-button-style.js +2 -81
- package/components/segmented-button/segmented-button.js +11 -27
- package/components/select/index.js +6 -87
- package/components/select/style.js +1 -27
- package/components/slider/index.js +2 -33
- package/components/slider/slider-base-style.js +1 -173
- package/components/slider/slider-base.js +1 -6
- package/components/slider/style.js +1 -7
- package/components/snackbar/index.js +5 -32
- package/components/snackbar/style.js +1 -100
- package/components/switch/index.js +6 -40
- package/components/switch/style.js +1 -202
- package/components/tabs/tab-panel-style.js +1 -10
- package/components/tabs/tab-style.js +1 -85
- package/components/tabs/tab.js +4 -24
- package/components/tabs/tabs-style.js +1 -138
- package/components/tabs/tabs.js +1 -9
- package/components/text-field/index.js +32 -160
- package/components/text-field/style.js +1 -362
- package/components/tooltip/index.js +1 -10
- package/components/tooltip/style.js +1 -57
- package/components/top-app-bar/top-app-bar-style.js +1 -78
- package/components/top-app-bar/top-app-bar-title-style.js +1 -81
- package/components/top-app-bar/top-app-bar-title.js +3 -17
- package/custom-elements.json +1105 -1105
- package/mdui.esm.js +22 -0
- package/mdui.global.js +22 -0
- package/package.json +1 -1
- package/web-types.en.json +1 -1
- package/web-types.zh-cn.json +1 -1
|
@@ -1,137 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css
|
|
3
|
-
:host {
|
|
4
|
-
position: relative;
|
|
5
|
-
display: inline-block;
|
|
6
|
-
width: 2.5rem;
|
|
7
|
-
height: 2.5rem;
|
|
8
|
-
stroke: rgb(var(--mdui-color-primary));
|
|
9
|
-
}
|
|
10
|
-
.progress {
|
|
11
|
-
position: relative;
|
|
12
|
-
display: inline-block;
|
|
13
|
-
width: 100%;
|
|
14
|
-
height: 100%;
|
|
15
|
-
text-align: left;
|
|
16
|
-
transition: opacity var(--mdui-motion-duration-medium1)
|
|
17
|
-
var(--mdui-motion-easing-linear);
|
|
18
|
-
}
|
|
19
|
-
.determinate svg {
|
|
20
|
-
transform: rotate(-90deg);
|
|
21
|
-
fill: transparent;
|
|
22
|
-
}
|
|
23
|
-
.determinate .track {
|
|
24
|
-
stroke: transparent;
|
|
25
|
-
}
|
|
26
|
-
.determinate .circle {
|
|
27
|
-
stroke: inherit;
|
|
28
|
-
transition: stroke-dashoffset var(--mdui-motion-duration-long2)
|
|
29
|
-
var(--mdui-motion-easing-standard);
|
|
30
|
-
}
|
|
31
|
-
.indeterminate {
|
|
32
|
-
font-size: 0;
|
|
33
|
-
letter-spacing: 0;
|
|
34
|
-
white-space: nowrap;
|
|
35
|
-
animation: mdui-comp-circular-progress-rotate 1568ms
|
|
36
|
-
var(--mdui-motion-easing-linear) infinite;
|
|
37
|
-
}
|
|
38
|
-
.indeterminate .layer,
|
|
39
|
-
.indeterminate .circle {
|
|
40
|
-
position: absolute;
|
|
41
|
-
width: 100%;
|
|
42
|
-
height: 100%;
|
|
43
|
-
}
|
|
44
|
-
.indeterminate .layer {
|
|
45
|
-
animation: mdui-comp-circular-progress-layer-rotate 5332ms
|
|
46
|
-
var(--mdui-motion-easing-standard) infinite both;
|
|
47
|
-
}
|
|
48
|
-
.indeterminate .circle {
|
|
49
|
-
fill: transparent;
|
|
50
|
-
stroke: inherit;
|
|
51
|
-
}
|
|
52
|
-
.indeterminate .gap-patch {
|
|
53
|
-
position: absolute;
|
|
54
|
-
top: 0;
|
|
55
|
-
left: 47.5%;
|
|
56
|
-
width: 5%;
|
|
57
|
-
height: 100%;
|
|
58
|
-
overflow: hidden;
|
|
59
|
-
}
|
|
60
|
-
.indeterminate .gap-patch .circle {
|
|
61
|
-
left: -900%;
|
|
62
|
-
width: 2000%;
|
|
63
|
-
transform: rotate(180deg);
|
|
64
|
-
}
|
|
65
|
-
.indeterminate .clipper {
|
|
66
|
-
position: relative;
|
|
67
|
-
display: inline-block;
|
|
68
|
-
width: 50%;
|
|
69
|
-
height: 100%;
|
|
70
|
-
overflow: hidden;
|
|
71
|
-
}
|
|
72
|
-
.indeterminate .clipper .circle {
|
|
73
|
-
width: 200%;
|
|
74
|
-
}
|
|
75
|
-
.indeterminate .clipper.left .circle {
|
|
76
|
-
animation: mdui-comp-circular-progress-left-spin 1333ms
|
|
77
|
-
var(--mdui-motion-easing-standard) infinite both;
|
|
78
|
-
}
|
|
79
|
-
.indeterminate .clipper.right .circle {
|
|
80
|
-
left: -100%;
|
|
81
|
-
animation: mdui-comp-circular-progress-right-spin 1333ms
|
|
82
|
-
var(--mdui-motion-easing-standard) infinite both;
|
|
83
|
-
}
|
|
84
|
-
@keyframes mdui-comp-circular-progress-rotate {
|
|
85
|
-
to {
|
|
86
|
-
transform: rotate(360deg);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
@keyframes mdui-comp-circular-progress-layer-rotate {
|
|
90
|
-
12.5% {
|
|
91
|
-
transform: rotate(135deg);
|
|
92
|
-
}
|
|
93
|
-
25% {
|
|
94
|
-
transform: rotate(270deg);
|
|
95
|
-
}
|
|
96
|
-
37.5% {
|
|
97
|
-
transform: rotate(405deg);
|
|
98
|
-
}
|
|
99
|
-
50% {
|
|
100
|
-
transform: rotate(540deg);
|
|
101
|
-
}
|
|
102
|
-
62.5% {
|
|
103
|
-
transform: rotate(675deg);
|
|
104
|
-
}
|
|
105
|
-
75% {
|
|
106
|
-
transform: rotate(810deg);
|
|
107
|
-
}
|
|
108
|
-
87.5% {
|
|
109
|
-
transform: rotate(945deg);
|
|
110
|
-
}
|
|
111
|
-
100% {
|
|
112
|
-
transform: rotate(1080deg);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
@keyframes mdui-comp-circular-progress-left-spin {
|
|
116
|
-
0% {
|
|
117
|
-
transform: rotate(265deg);
|
|
118
|
-
}
|
|
119
|
-
50% {
|
|
120
|
-
transform: rotate(130deg);
|
|
121
|
-
}
|
|
122
|
-
100% {
|
|
123
|
-
transform: rotate(265deg);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
@keyframes mdui-comp-circular-progress-right-spin {
|
|
127
|
-
0% {
|
|
128
|
-
transform: rotate(-265deg);
|
|
129
|
-
}
|
|
130
|
-
50% {
|
|
131
|
-
transform: rotate(-130deg);
|
|
132
|
-
}
|
|
133
|
-
100% {
|
|
134
|
-
transform: rotate(-265deg);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
`;
|
|
2
|
+
export const style = css `:host{position:relative;display:inline-block;width:2.5rem;height:2.5rem;stroke:rgb(var(--mdui-color-primary))}.progress{position:relative;display:inline-block;width:100%;height:100%;text-align:left;transition:opacity var(--mdui-motion-duration-medium1) var(--mdui-motion-easing-linear)}.determinate svg{transform:rotate(-90deg);fill:transparent}.determinate .track{stroke:transparent}.determinate .circle{stroke:inherit;transition:stroke-dashoffset var(--mdui-motion-duration-long2) var(--mdui-motion-easing-standard)}.indeterminate{font-size:0;letter-spacing:0;white-space:nowrap;animation:mdui-comp-circular-progress-rotate 1568ms var(--mdui-motion-easing-linear) infinite}.indeterminate .circle,.indeterminate .layer{position:absolute;width:100%;height:100%}.indeterminate .layer{animation:mdui-comp-circular-progress-layer-rotate 5332ms var(--mdui-motion-easing-standard) infinite both}.indeterminate .circle{fill:transparent;stroke:inherit}.indeterminate .gap-patch{position:absolute;top:0;left:47.5%;width:5%;height:100%;overflow:hidden}.indeterminate .gap-patch .circle{left:-900%;width:2000%;transform:rotate(180deg)}.indeterminate .clipper{position:relative;display:inline-block;width:50%;height:100%;overflow:hidden}.indeterminate .clipper .circle{width:200%}.indeterminate .clipper.left .circle{animation:mdui-comp-circular-progress-left-spin 1333ms var(--mdui-motion-easing-standard) infinite both}.indeterminate .clipper.right .circle{left:-100%;animation:mdui-comp-circular-progress-right-spin 1333ms var(--mdui-motion-easing-standard) infinite both}@keyframes mdui-comp-circular-progress-rotate{to{transform:rotate(360deg)}}@keyframes mdui-comp-circular-progress-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdui-comp-circular-progress-left-spin{0%{transform:rotate(265deg)}50%{transform:rotate(130deg)}100%{transform:rotate(265deg)}}@keyframes mdui-comp-circular-progress-right-spin{0%{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}100%{transform:rotate(-265deg)}}`;
|
|
@@ -1,22 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const collapseItemStyle = css
|
|
3
|
-
:host {
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
}
|
|
7
|
-
.header {
|
|
8
|
-
display: block;
|
|
9
|
-
}
|
|
10
|
-
.body {
|
|
11
|
-
display: block;
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
transition: height var(--mdui-motion-duration-short4)
|
|
14
|
-
var(--mdui-motion-easing-emphasized);
|
|
15
|
-
}
|
|
16
|
-
.body.opened {
|
|
17
|
-
overflow: visible;
|
|
18
|
-
}
|
|
19
|
-
.body.active {
|
|
20
|
-
transition-duration: var(--mdui-motion-duration-medium4);
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
2
|
+
export const collapseItemStyle = css `:host{display:flex;flex-direction:column}.header{display:block}.body{display:block;overflow:hidden;transition:height var(--mdui-motion-duration-short4) var(--mdui-motion-easing-emphasized)}.body.opened{overflow:visible}.body.active{transition-duration:var(--mdui-motion-duration-medium4)}`;
|
|
@@ -68,18 +68,10 @@ let CollapseItem = class CollapseItem extends MduiElement {
|
|
|
68
68
|
this.updateBodyHeight();
|
|
69
69
|
}
|
|
70
70
|
render() {
|
|
71
|
-
return html `<slot name="header" part="header" class="header"
|
|
72
|
-
${this.header}
|
|
73
|
-
</slot>
|
|
74
|
-
<slot
|
|
75
|
-
part="body"
|
|
76
|
-
class="body ${classMap({
|
|
71
|
+
return html `<slot name="header" part="header" class="header">${this.header}</slot><slot part="body" class="body ${classMap({
|
|
77
72
|
opened: this.state === 'opened',
|
|
78
73
|
active: this.active,
|
|
79
|
-
})}"
|
|
80
|
-
${ref(this.bodyRef)}
|
|
81
|
-
@transitionend=${this.onTransitionEnd}
|
|
82
|
-
></slot>`;
|
|
74
|
+
})}" ${ref(this.bodyRef)} @transitionend="${this.onTransitionEnd}"></slot>`;
|
|
83
75
|
}
|
|
84
76
|
onTransitionEnd(event) {
|
|
85
77
|
if (event.target === this.bodyRef.value) {
|
|
@@ -85,10 +85,7 @@ let Collapse = class Collapse extends MduiElement {
|
|
|
85
85
|
this.updateItems();
|
|
86
86
|
}
|
|
87
87
|
render() {
|
|
88
|
-
return html `<slot
|
|
89
|
-
@slotchange=${this.onSlotChange}
|
|
90
|
-
@click=${this.onClick}
|
|
91
|
-
></slot>`;
|
|
88
|
+
return html `<slot @slotchange="${this.onSlotChange}" @click="${this.onClick}"></slot>`;
|
|
92
89
|
}
|
|
93
90
|
setActiveKeys(activeKeys) {
|
|
94
91
|
if (!arraysEqualIgnoreOrder(this.activeKeys, activeKeys)) {
|
|
@@ -218,33 +218,11 @@ let Dialog = class Dialog extends MduiElement {
|
|
|
218
218
|
const hasDescription = !!this.description || this.hasSlotController.test('description');
|
|
219
219
|
const hasHeader = hasIcon || hasHeadline || this.hasSlotController.test('header');
|
|
220
220
|
const hasBody = hasDescription || hasDefaultSlot;
|
|
221
|
-
return html `<div
|
|
222
|
-
${ref(this.overlayRef)}
|
|
223
|
-
part="overlay"
|
|
224
|
-
class="overlay"
|
|
225
|
-
@click=${this.onOverlayClick}
|
|
226
|
-
tabindex="-1"
|
|
227
|
-
></div>
|
|
228
|
-
<div
|
|
229
|
-
${ref(this.panelRef)}
|
|
230
|
-
part="panel"
|
|
231
|
-
class="panel ${classMap({
|
|
221
|
+
return html `<div ${ref(this.overlayRef)} part="overlay" class="overlay" @click="${this.onOverlayClick}" tabindex="-1"></div><div ${ref(this.panelRef)} part="panel" class="panel ${classMap({
|
|
232
222
|
'has-icon': hasIcon,
|
|
233
223
|
'has-description': hasDescription,
|
|
234
224
|
'has-default': hasDefaultSlot,
|
|
235
|
-
})}"
|
|
236
|
-
tabindex="0"
|
|
237
|
-
>
|
|
238
|
-
${when(hasHeader, () => html `<slot name="header" part="header" class="header">
|
|
239
|
-
${when(hasIcon, () => this.renderIcon())}
|
|
240
|
-
${when(hasHeadline, () => this.renderHeadline())}
|
|
241
|
-
</slot>`)}
|
|
242
|
-
${when(hasBody, () => html `<div ${ref(this.bodyRef)} part="body" class="body">
|
|
243
|
-
${when(hasDescription, () => this.renderDescription())}
|
|
244
|
-
<slot></slot>
|
|
245
|
-
</div>`)}
|
|
246
|
-
${when(hasActionSlot, () => html `<slot name="action" part="action" class="action"></slot>`)}
|
|
247
|
-
</div>`;
|
|
225
|
+
})}" tabindex="0">${when(hasHeader, () => html `<slot name="header" part="header" class="header">${when(hasIcon, () => this.renderIcon())} ${when(hasHeadline, () => this.renderHeadline())}</slot>`)} ${when(hasBody, () => html `<div ${ref(this.bodyRef)} part="body" class="body">${when(hasDescription, () => this.renderDescription())}<slot></slot></div>`)} ${when(hasActionSlot, () => html `<slot name="action" part="action" class="action"></slot>`)}</div>`;
|
|
248
226
|
}
|
|
249
227
|
onOverlayClick() {
|
|
250
228
|
this.emit('overlay-click');
|
|
@@ -254,21 +232,15 @@ let Dialog = class Dialog extends MduiElement {
|
|
|
254
232
|
this.open = false;
|
|
255
233
|
}
|
|
256
234
|
renderIcon() {
|
|
257
|
-
return html `<slot name="icon" part="icon" class="icon"
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
: nothingTemplate}
|
|
261
|
-
</slot>`;
|
|
235
|
+
return html `<slot name="icon" part="icon" class="icon">${this.icon
|
|
236
|
+
? html `<mdui-icon name="${this.icon}"></mdui-icon>`
|
|
237
|
+
: nothingTemplate}</slot>`;
|
|
262
238
|
}
|
|
263
239
|
renderHeadline() {
|
|
264
|
-
return html `<slot name="headline" part="headline" class="headline"
|
|
265
|
-
${this.headline}
|
|
266
|
-
</slot>`;
|
|
240
|
+
return html `<slot name="headline" part="headline" class="headline">${this.headline}</slot>`;
|
|
267
241
|
}
|
|
268
242
|
renderDescription() {
|
|
269
|
-
return html `<slot name="description" part="description" class="description"
|
|
270
|
-
${this.description}
|
|
271
|
-
</slot>`;
|
|
243
|
+
return html `<slot name="description" part="description" class="description">${this.description}</slot>`;
|
|
272
244
|
}
|
|
273
245
|
};
|
|
274
246
|
Dialog.styles = [componentStyle, style];
|
|
@@ -1,117 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css
|
|
3
|
-
:host {
|
|
4
|
-
--shape-corner: var(--mdui-shape-corner-extra-large);
|
|
5
|
-
--z-index: 2300;
|
|
6
|
-
position: fixed;
|
|
7
|
-
z-index: var(--z-index);
|
|
8
|
-
display: none;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
inset: 0;
|
|
12
|
-
padding: 3rem;
|
|
13
|
-
}
|
|
14
|
-
::slotted(mdui-top-app-bar[slot='header']) {
|
|
15
|
-
position: absolute;
|
|
16
|
-
border-top-left-radius: var(--mdui-shape-corner-extra-large);
|
|
17
|
-
border-top-right-radius: var(--mdui-shape-corner-extra-large);
|
|
18
|
-
background-color: rgb(var(--mdui-color-surface-container-high));
|
|
19
|
-
}
|
|
20
|
-
:host([fullscreen]) {
|
|
21
|
-
--shape-corner: var(--mdui-shape-corner-none);
|
|
22
|
-
padding: 0;
|
|
23
|
-
}
|
|
24
|
-
:host([fullscreen]) ::slotted(mdui-top-app-bar[slot='header']) {
|
|
25
|
-
border-top-left-radius: var(--mdui-shape-corner-none);
|
|
26
|
-
border-top-right-radius: var(--mdui-shape-corner-none);
|
|
27
|
-
}
|
|
28
|
-
.overlay {
|
|
29
|
-
position: fixed;
|
|
30
|
-
inset: 0;
|
|
31
|
-
background-color: rgba(var(--mdui-color-scrim), 0.4);
|
|
32
|
-
}
|
|
33
|
-
.panel {
|
|
34
|
-
position: relative;
|
|
35
|
-
display: flex;
|
|
36
|
-
flex-direction: column;
|
|
37
|
-
max-height: 100%;
|
|
38
|
-
border-radius: var(--shape-corner);
|
|
39
|
-
outline: none;
|
|
40
|
-
transform-origin: top;
|
|
41
|
-
min-width: 17.5rem;
|
|
42
|
-
max-width: 35rem;
|
|
43
|
-
padding: 1.5rem;
|
|
44
|
-
background-color: rgb(var(--mdui-color-surface-container-high));
|
|
45
|
-
box-shadow: var(--mdui-elevation-level3);
|
|
46
|
-
}
|
|
47
|
-
:host([fullscreen]) .panel {
|
|
48
|
-
width: 100%;
|
|
49
|
-
max-width: 100%;
|
|
50
|
-
height: 100%;
|
|
51
|
-
max-height: 100%;
|
|
52
|
-
box-shadow: var(--mdui-elevation-level0);
|
|
53
|
-
}
|
|
54
|
-
.header {
|
|
55
|
-
display: flex;
|
|
56
|
-
flex-direction: column;
|
|
57
|
-
}
|
|
58
|
-
.has-icon .header {
|
|
59
|
-
align-items: center;
|
|
60
|
-
}
|
|
61
|
-
.icon {
|
|
62
|
-
display: flex;
|
|
63
|
-
color: rgb(var(--mdui-color-secondary));
|
|
64
|
-
font-size: 1.5rem;
|
|
65
|
-
}
|
|
66
|
-
.icon mdui-icon,
|
|
67
|
-
::slotted([slot='icon']) {
|
|
68
|
-
font-size: inherit;
|
|
69
|
-
}
|
|
70
|
-
.headline {
|
|
71
|
-
display: flex;
|
|
72
|
-
color: rgb(var(--mdui-color-on-surface));
|
|
73
|
-
font-size: var(--mdui-typescale-headline-small-size);
|
|
74
|
-
font-weight: var(--mdui-typescale-headline-small-weight);
|
|
75
|
-
letter-spacing: var(--mdui-typescale-headline-small-tracking);
|
|
76
|
-
line-height: var(--mdui-typescale-headline-small-line-height);
|
|
77
|
-
}
|
|
78
|
-
.icon + .headline {
|
|
79
|
-
padding-top: 1rem;
|
|
80
|
-
}
|
|
81
|
-
.body {
|
|
82
|
-
overflow: auto;
|
|
83
|
-
}
|
|
84
|
-
.header + .body {
|
|
85
|
-
margin-top: 1rem;
|
|
86
|
-
}
|
|
87
|
-
.description {
|
|
88
|
-
display: flex;
|
|
89
|
-
color: rgb(var(--mdui-color-on-surface-variant));
|
|
90
|
-
font-size: var(--mdui-typescale-body-medium-size);
|
|
91
|
-
font-weight: var(--mdui-typescale-body-medium-weight);
|
|
92
|
-
letter-spacing: var(--mdui-typescale-body-medium-tracking);
|
|
93
|
-
line-height: var(--mdui-typescale-body-medium-line-height);
|
|
94
|
-
}
|
|
95
|
-
:host([fullscreen]) .description {
|
|
96
|
-
color: rgb(var(--mdui-color-on-surface));
|
|
97
|
-
}
|
|
98
|
-
.has-description.has-default .description {
|
|
99
|
-
margin-bottom: 1rem;
|
|
100
|
-
}
|
|
101
|
-
.action {
|
|
102
|
-
display: flex;
|
|
103
|
-
justify-content: flex-end;
|
|
104
|
-
padding-top: 1.5rem;
|
|
105
|
-
}
|
|
106
|
-
.action::slotted(:not(:first-child)) {
|
|
107
|
-
margin-left: 0.5rem;
|
|
108
|
-
}
|
|
109
|
-
:host([stacked-actions]) .action {
|
|
110
|
-
flex-direction: column;
|
|
111
|
-
align-items: end;
|
|
112
|
-
}
|
|
113
|
-
:host([stacked-actions]) .action::slotted(:not(:first-child)) {
|
|
114
|
-
margin-left: 0rem;
|
|
115
|
-
margin-top: 0.5rem;
|
|
116
|
-
}
|
|
117
|
-
`;
|
|
2
|
+
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-extra-large);--z-index:2300;position:fixed;z-index:var(--z-index);display:none;align-items:center;justify-content:center;inset:0;padding:3rem}::slotted(mdui-top-app-bar[slot=header]){position:absolute;border-top-left-radius:var(--mdui-shape-corner-extra-large);border-top-right-radius:var(--mdui-shape-corner-extra-large);background-color:rgb(var(--mdui-color-surface-container-high))}:host([fullscreen]){--shape-corner:var(--mdui-shape-corner-none);padding:0}:host([fullscreen]) ::slotted(mdui-top-app-bar[slot=header]){border-top-left-radius:var(--mdui-shape-corner-none);border-top-right-radius:var(--mdui-shape-corner-none)}.overlay{position:fixed;inset:0;background-color:rgba(var(--mdui-color-scrim),.4)}.panel{position:relative;display:flex;flex-direction:column;max-height:100%;border-radius:var(--shape-corner);outline:0;transform-origin:top;min-width:17.5rem;max-width:35rem;padding:1.5rem;background-color:rgb(var(--mdui-color-surface-container-high));box-shadow:var(--mdui-elevation-level3)}:host([fullscreen]) .panel{width:100%;max-width:100%;height:100%;max-height:100%;box-shadow:var(--mdui-elevation-level0)}.header{display:flex;flex-direction:column}.has-icon .header{align-items:center}.icon{display:flex;color:rgb(var(--mdui-color-secondary));font-size:1.5rem}.icon mdui-icon,::slotted([slot=icon]){font-size:inherit}.headline{display:flex;color:rgb(var(--mdui-color-on-surface));font-size:var(--mdui-typescale-headline-small-size);font-weight:var(--mdui-typescale-headline-small-weight);letter-spacing:var(--mdui-typescale-headline-small-tracking);line-height:var(--mdui-typescale-headline-small-line-height)}.icon+.headline{padding-top:1rem}.body{overflow:auto}.header+.body{margin-top:1rem}.description{display:flex;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([fullscreen]) .description{color:rgb(var(--mdui-color-on-surface))}.has-description.has-default .description{margin-bottom:1rem}.action{display:flex;justify-content:flex-end;padding-top:1.5rem}.action::slotted(:not(:first-child)){margin-left:.5rem}:host([stacked-actions]) .action{flex-direction:column;align-items:end}:host([stacked-actions]) .action::slotted(:not(:first-child)){margin-left:0;margin-top:.5rem}`;
|
|
@@ -1,19 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css
|
|
3
|
-
:host {
|
|
4
|
-
display: block;
|
|
5
|
-
height: 0.0625rem;
|
|
6
|
-
background-color: rgb(var(--mdui-color-surface-variant));
|
|
7
|
-
}
|
|
8
|
-
:host([inset]) {
|
|
9
|
-
margin-left: 1rem;
|
|
10
|
-
}
|
|
11
|
-
:host([middle]) {
|
|
12
|
-
margin-left: 1rem;
|
|
13
|
-
margin-right: 1rem;
|
|
14
|
-
}
|
|
15
|
-
:host([vertical]) {
|
|
16
|
-
height: 100%;
|
|
17
|
-
width: 0.0625rem;
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
2
|
+
export const style = css `:host{display:block;height:.0625rem;background-color:rgb(var(--mdui-color-surface-variant))}:host([inset]){margin-left:1rem}:host([middle]){margin-left:1rem;margin-right:1rem}:host([vertical]){height:100%;width:.0625rem}`;
|
|
@@ -234,14 +234,7 @@ let Dropdown = class Dropdown extends MduiElement {
|
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
236
|
render() {
|
|
237
|
-
return html `<slot name="trigger" part="trigger" class="trigger"></slot
|
|
238
|
-
<slot
|
|
239
|
-
${ref(this.panelRef)}
|
|
240
|
-
part="panel"
|
|
241
|
-
class="panel"
|
|
242
|
-
hidden
|
|
243
|
-
@click=${this.onPanelClick}
|
|
244
|
-
></slot>`;
|
|
237
|
+
return html `<slot name="trigger" part="trigger" class="trigger"></slot><slot ${ref(this.panelRef)} part="panel" class="panel" hidden @click="${this.onPanelClick}"></slot>`;
|
|
245
238
|
}
|
|
246
239
|
/**
|
|
247
240
|
* 获取 dropdown 打开、关闭动画的 CSS scaleX 或 scaleY
|
|
@@ -1,12 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css
|
|
3
|
-
:host {
|
|
4
|
-
--z-index: 2100;
|
|
5
|
-
display: contents;
|
|
6
|
-
}
|
|
7
|
-
.panel {
|
|
8
|
-
display: block;
|
|
9
|
-
position: fixed;
|
|
10
|
-
z-index: var(--z-index);
|
|
11
|
-
}
|
|
12
|
-
`;
|
|
2
|
+
export const style = css `:host{--z-index:2100;display:contents}.panel{display:block;position:fixed;z-index:var(--z-index)}`;
|
package/components/fab/index.js
CHANGED
|
@@ -94,20 +94,14 @@ let Fab = class Fab extends ButtonBase {
|
|
|
94
94
|
button: true,
|
|
95
95
|
'has-icon': this.icon || this.hasSlotController.test('icon'),
|
|
96
96
|
});
|
|
97
|
-
return html `<mdui-ripple
|
|
98
|
-
${ref(this.rippleRef)}
|
|
99
|
-
.noRipple=${this.noRipple}
|
|
100
|
-
></mdui-ripple>
|
|
101
|
-
${this.isButton()
|
|
97
|
+
return html `<mdui-ripple ${ref(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()
|
|
102
98
|
? this.renderButton({
|
|
103
99
|
className,
|
|
104
100
|
part: 'button',
|
|
105
101
|
content: this.renderInner(),
|
|
106
102
|
})
|
|
107
103
|
: this.disabled || this.loading
|
|
108
|
-
? html `<span part="button" class="_a ${className}"
|
|
109
|
-
${this.renderInner()}
|
|
110
|
-
</span>`
|
|
104
|
+
? html `<span part="button" class="_a ${className}">${this.renderInner()}</span>`
|
|
111
105
|
: this.renderAnchor({
|
|
112
106
|
className,
|
|
113
107
|
part: 'button',
|
|
@@ -121,11 +115,9 @@ let Fab = class Fab extends ButtonBase {
|
|
|
121
115
|
if (this.loading) {
|
|
122
116
|
return this.renderLoading();
|
|
123
117
|
}
|
|
124
|
-
return html `<slot name="icon" part="icon" class="icon"
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
: nothingTemplate}
|
|
128
|
-
</slot>`;
|
|
118
|
+
return html `<slot name="icon" part="icon" class="icon">${this.icon
|
|
119
|
+
? html `<mdui-icon name="${this.icon}"></mdui-icon>`
|
|
120
|
+
: nothingTemplate}</slot>`;
|
|
129
121
|
}
|
|
130
122
|
renderInner() {
|
|
131
123
|
return [this.renderIcon(), this.renderLabel()];
|
package/components/fab/style.js
CHANGED
|
@@ -1,157 +1,8 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css
|
|
3
|
-
/**
|
|
4
|
-
* mdui-fab 组件。默认为 variant="primary" size="normal"
|
|
5
|
-
*/
|
|
6
|
-
:host {
|
|
7
|
-
--shape-corner-small: var(--mdui-shape-corner-small);
|
|
8
|
-
--shape-corner-normal: var(--mdui-shape-corner-large);
|
|
9
|
-
--shape-corner-large: var(--mdui-shape-corner-extra-large);
|
|
10
|
-
position: relative;
|
|
11
|
-
display: inline-block;
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
text-align: center;
|
|
14
|
-
border-radius: var(--shape-corner-normal);
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
-webkit-tap-highlight-color: transparent;
|
|
17
|
-
transition-property: box-shadow;
|
|
18
|
-
transition-timing-function: var(--mdui-motion-easing-emphasized);
|
|
19
|
-
transition-duration: var(--mdui-motion-duration-medium4);
|
|
20
|
-
width: 3.5rem;
|
|
21
|
-
height: 3.5rem;
|
|
22
|
-
box-shadow: var(--mdui-elevation-level3);
|
|
23
|
-
font-size: var(--mdui-typescale-label-large-size);
|
|
24
|
-
font-weight: var(--mdui-typescale-label-large-weight);
|
|
25
|
-
letter-spacing: var(--mdui-typescale-label-large-tracking);
|
|
26
|
-
line-height: var(--mdui-typescale-label-large-line-height);
|
|
27
|
-
}
|
|
28
|
-
.button {
|
|
29
|
-
padding: 0rem 1rem;
|
|
30
|
-
}
|
|
31
|
-
:host([size='small']) .button {
|
|
32
|
-
padding: 0rem 0.5rem;
|
|
33
|
-
}
|
|
34
|
-
:host([size='large']) .button {
|
|
35
|
-
padding: 0rem 1.875rem;
|
|
36
|
-
}
|
|
37
|
-
:host([lowered]) {
|
|
38
|
-
box-shadow: var(--mdui-elevation-level1);
|
|
39
|
-
}
|
|
40
|
-
:host([focus-visible]) {
|
|
41
|
-
box-shadow: var(--mdui-elevation-level3);
|
|
42
|
-
}
|
|
43
|
-
:host([lowered][focus-visible]) {
|
|
44
|
-
box-shadow: var(--mdui-elevation-level1);
|
|
45
|
-
}
|
|
46
|
-
:host([pressed]) {
|
|
47
|
-
box-shadow: var(--mdui-elevation-level3);
|
|
48
|
-
}
|
|
49
|
-
:host([lowered][pressed]) {
|
|
50
|
-
box-shadow: var(--mdui-elevation-level1);
|
|
51
|
-
}
|
|
52
|
-
:host([hover]) {
|
|
53
|
-
box-shadow: var(--mdui-elevation-level4);
|
|
54
|
-
}
|
|
55
|
-
:host([lowered][hover]) {
|
|
56
|
-
box-shadow: var(--mdui-elevation-level2);
|
|
57
|
-
}
|
|
58
|
-
:host([variant='primary']) {
|
|
59
|
-
color: rgb(var(--mdui-color-on-primary-container));
|
|
60
|
-
background-color: rgb(var(--mdui-color-primary-container));
|
|
61
|
-
--mdui-comp-ripple-state-layer-color: var(
|
|
2
|
+
export const style = css `:host{--shape-corner-small:var(--mdui-shape-corner-small);--shape-corner-normal:var(--mdui-shape-corner-large);--shape-corner-large:var(--mdui-shape-corner-extra-large);position:relative;display:inline-block;overflow:hidden;text-align:center;border-radius:var(--shape-corner-normal);cursor:pointer;-webkit-tap-highlight-color:transparent;transition-property:box-shadow;transition-timing-function:var(--mdui-motion-easing-emphasized);transition-duration:var(--mdui-motion-duration-medium4);width:3.5rem;height:3.5rem;box-shadow:var(--mdui-elevation-level3);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{padding:0 1rem}:host([size=small]) .button{padding:0 .5rem}:host([size=large]) .button{padding:0 1.875rem}:host([lowered]){box-shadow:var(--mdui-elevation-level1)}:host([focus-visible]){box-shadow:var(--mdui-elevation-level3)}:host([lowered][focus-visible]){box-shadow:var(--mdui-elevation-level1)}:host([pressed]){box-shadow:var(--mdui-elevation-level3)}:host([lowered][pressed]){box-shadow:var(--mdui-elevation-level1)}:host([hover]){box-shadow:var(--mdui-elevation-level4)}:host([lowered][hover]){box-shadow:var(--mdui-elevation-level2)}:host([variant=primary]){color:rgb(var(--mdui-color-on-primary-container));background-color:rgb(var(--mdui-color-primary-container));--mdui-comp-ripple-state-layer-color:var(
|
|
62
3
|
--mdui-color-on-primary-container
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
:host([variant='surface']) {
|
|
66
|
-
color: rgb(var(--mdui-color-primary));
|
|
67
|
-
background-color: rgb(var(--mdui-color-surface-container-high));
|
|
68
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-primary);
|
|
69
|
-
}
|
|
70
|
-
:host([variant='surface'][lowered]) {
|
|
71
|
-
background-color: rgb(var(--mdui-color-surface-container-low));
|
|
72
|
-
}
|
|
73
|
-
:host([variant='secondary']) {
|
|
74
|
-
color: rgb(var(--mdui-color-on-secondary-container));
|
|
75
|
-
background-color: rgb(var(--mdui-color-secondary-container));
|
|
76
|
-
--mdui-comp-ripple-state-layer-color: var(
|
|
4
|
+
)}:host([variant=surface]){color:rgb(var(--mdui-color-primary));background-color:rgb(var(--mdui-color-surface-container-high));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=surface][lowered]){background-color:rgb(var(--mdui-color-surface-container-low))}:host([variant=secondary]){color:rgb(var(--mdui-color-on-secondary-container));background-color:rgb(var(--mdui-color-secondary-container));--mdui-comp-ripple-state-layer-color:var(
|
|
77
5
|
--mdui-color-on-secondary-container
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
:host([variant='tertiary']) {
|
|
81
|
-
color: rgb(var(--mdui-color-on-tertiary-container));
|
|
82
|
-
background-color: rgb(var(--mdui-color-tertiary-container));
|
|
83
|
-
--mdui-comp-ripple-state-layer-color: var(
|
|
6
|
+
)}:host([variant=tertiary]){color:rgb(var(--mdui-color-on-tertiary-container));background-color:rgb(var(--mdui-color-tertiary-container));--mdui-comp-ripple-state-layer-color:var(
|
|
84
7
|
--mdui-color-on-tertiary-container
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
:host([size='small']) {
|
|
88
|
-
border-radius: var(--shape-corner-small);
|
|
89
|
-
width: 2.5rem;
|
|
90
|
-
height: 2.5rem;
|
|
91
|
-
}
|
|
92
|
-
:host([size='large']) {
|
|
93
|
-
border-radius: var(--shape-corner-large);
|
|
94
|
-
width: 6rem;
|
|
95
|
-
height: 6rem;
|
|
96
|
-
}
|
|
97
|
-
:host([disabled]),
|
|
98
|
-
:host([loading]) {
|
|
99
|
-
cursor: default;
|
|
100
|
-
pointer-events: none;
|
|
101
|
-
}
|
|
102
|
-
:host([disabled]) {
|
|
103
|
-
color: rgba(var(--mdui-color-on-surface), 38%);
|
|
104
|
-
background-color: rgba(var(--mdui-color-on-surface), 12%);
|
|
105
|
-
box-shadow: var(--mdui-elevation-level0);
|
|
106
|
-
}
|
|
107
|
-
:host([extended]) {
|
|
108
|
-
width: auto;
|
|
109
|
-
}
|
|
110
|
-
.label {
|
|
111
|
-
display: inline-flex;
|
|
112
|
-
transition: opacity var(--mdui-motion-duration-short2)
|
|
113
|
-
var(--mdui-motion-easing-linear) var(--mdui-motion-duration-short2);
|
|
114
|
-
padding-left: 0.25rem;
|
|
115
|
-
padding-right: 0.25rem;
|
|
116
|
-
}
|
|
117
|
-
.has-icon .label {
|
|
118
|
-
margin-left: 0.5rem;
|
|
119
|
-
}
|
|
120
|
-
:host([size='small']) .has-icon .label {
|
|
121
|
-
margin-left: 0.25rem;
|
|
122
|
-
}
|
|
123
|
-
:host([size='large']) .has-icon .label {
|
|
124
|
-
margin-left: 1rem;
|
|
125
|
-
}
|
|
126
|
-
:host(:not([extended])) .label {
|
|
127
|
-
opacity: 0;
|
|
128
|
-
transition-delay: 0ms;
|
|
129
|
-
transition-duration: var(--mdui-motion-duration-short1);
|
|
130
|
-
}
|
|
131
|
-
:host([size='large']) .label {
|
|
132
|
-
font-size: 1.5em;
|
|
133
|
-
}
|
|
134
|
-
.icon {
|
|
135
|
-
display: inline-flex;
|
|
136
|
-
font-size: 1.71428571em;
|
|
137
|
-
}
|
|
138
|
-
:host([size='large']) .icon {
|
|
139
|
-
font-size: 2.57142857em;
|
|
140
|
-
}
|
|
141
|
-
.icon mdui-icon,
|
|
142
|
-
::slotted([slot='icon']) {
|
|
143
|
-
font-size: inherit;
|
|
144
|
-
}
|
|
145
|
-
mdui-circular-progress {
|
|
146
|
-
display: inline-flex;
|
|
147
|
-
width: 1.5rem;
|
|
148
|
-
height: 1.5rem;
|
|
149
|
-
}
|
|
150
|
-
:host([size='large']) mdui-circular-progress {
|
|
151
|
-
width: 2.25rem;
|
|
152
|
-
height: 2.25rem;
|
|
153
|
-
}
|
|
154
|
-
:host([disabled]) mdui-circular-progress {
|
|
155
|
-
stroke: rgba(var(--mdui-color-on-surface), 38%);
|
|
156
|
-
}
|
|
157
|
-
`;
|
|
8
|
+
)}:host([size=small]){border-radius:var(--shape-corner-small);width:2.5rem;height:2.5rem}:host([size=large]){border-radius:var(--shape-corner-large);width:6rem;height:6rem}:host([disabled]),:host([loading]){cursor:default;pointer-events:none}:host([disabled]){color:rgba(var(--mdui-color-on-surface),38%);background-color:rgba(var(--mdui-color-on-surface),12%);box-shadow:var(--mdui-elevation-level0)}:host([extended]){width:auto}.label{display:inline-flex;transition:opacity var(--mdui-motion-duration-short2) var(--mdui-motion-easing-linear) var(--mdui-motion-duration-short2);padding-left:.25rem;padding-right:.25rem}.has-icon .label{margin-left:.5rem}:host([size=small]) .has-icon .label{margin-left:.25rem}:host([size=large]) .has-icon .label{margin-left:1rem}:host(:not([extended])) .label{opacity:0;transition-delay:0s;transition-duration:var(--mdui-motion-duration-short1)}:host([size=large]) .label{font-size:1.5em}.icon{display:inline-flex;font-size:1.71428571em}:host([size=large]) .icon{font-size:2.57142857em}.icon mdui-icon,::slotted([slot=icon]){font-size:inherit}mdui-circular-progress{display:inline-flex;width:1.5rem;height:1.5rem}:host([size=large]) mdui-circular-progress{width:2.25rem;height:2.25rem}:host([disabled]) mdui-circular-progress{stroke:rgba(var(--mdui-color-on-surface),38%)}`;
|
package/components/icon/index.js
CHANGED
|
@@ -34,11 +34,7 @@ let Icon = class Icon extends MduiElement {
|
|
|
34
34
|
['sharp', 'Material Icons Sharp'],
|
|
35
35
|
['two-tone', 'Material Icons Two Tone'],
|
|
36
36
|
]);
|
|
37
|
-
return html `<span
|
|
38
|
-
style=${styleMap({ fontFamily: familyMap.get(variant) })}
|
|
39
|
-
>
|
|
40
|
-
${name}
|
|
41
|
-
</span>`;
|
|
37
|
+
return html `<span style="${styleMap({ fontFamily: familyMap.get(variant) })}">${name}</span>`;
|
|
42
38
|
}
|
|
43
39
|
if (this.src) {
|
|
44
40
|
return html `${until(ajax({ url: this.src }).then(unsafeSVG))}`;
|