mdui 2.0.4 → 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.
- package/components/avatar/index.js +7 -2
- package/components/avatar/style.js +31 -1
- package/components/badge/style.js +25 -1
- package/components/bottom-app-bar/style.js +92 -1
- package/components/button/button-base-style.js +28 -1
- package/components/button/button-base.js +8 -1
- package/components/button/index.js +18 -8
- package/components/button/style.js +111 -2
- package/components/button-icon/index.js +22 -5
- package/components/button-icon/style.js +103 -2
- package/components/card/index.js +5 -1
- package/components/card/style.js +72 -1
- package/components/checkbox/index.js +50 -7
- package/components/checkbox/style.js +131 -1
- package/components/chip/index.js +33 -9
- package/components/chip/style.js +205 -2
- package/components/circular-progress/index.js +39 -5
- package/components/circular-progress/style.js +136 -1
- package/components/collapse/collapse-item-style.js +21 -1
- package/components/collapse/collapse-item.js +10 -2
- package/components/collapse/collapse-style.js +5 -1
- package/components/collapse/collapse.js +4 -1
- package/components/dialog/index.js +35 -7
- package/components/dialog/style.js +116 -1
- package/components/divider/style.js +18 -1
- package/components/dropdown/index.js +8 -1
- package/components/dropdown/style.js +11 -1
- package/components/fab/index.js +13 -5
- package/components/fab/style.js +153 -4
- package/components/icon/index.js +5 -1
- package/components/icon/style.js +29 -1
- package/components/layout/layout-item-style.js +6 -1
- package/components/layout/layout-main-style.js +7 -1
- package/components/layout/layout-style.js +11 -1
- package/components/linear-progress/index.js +6 -2
- package/components/linear-progress/style.js +73 -1
- package/components/list/list-item-style.js +153 -2
- package/components/list/list-item.js +27 -8
- package/components/list/list-style.js +10 -1
- package/components/list/list-subheader-style.js +19 -1
- package/components/menu/menu-item-style.js +125 -1
- package/components/menu/menu-item.js +55 -13
- package/components/menu/menu-style.js +19 -1
- package/components/menu/menu.js +5 -1
- package/components/navigation-bar/navigation-bar-item-style.js +132 -1
- package/components/navigation-bar/navigation-bar-item.js +23 -7
- package/components/navigation-bar/navigation-bar-style.js +28 -1
- package/components/navigation-bar/navigation-bar.js +4 -1
- package/components/navigation-drawer/index.js +12 -1
- package/components/navigation-drawer/style.js +66 -1
- package/components/navigation-rail/navigation-rail-item-style.js +122 -1
- package/components/navigation-rail/navigation-rail-item.js +26 -7
- package/components/navigation-rail/navigation-rail-style.js +79 -1
- package/components/navigation-rail/navigation-rail.js +10 -1
- package/components/radio/radio-group-style.js +20 -1
- package/components/radio/radio-group.js +19 -1
- package/components/radio/radio-style.js +107 -1
- package/components/radio/radio.js +23 -5
- package/components/range-slider/index.d.ts +1 -1
- package/components/range-slider/index.js +53 -5
- package/components/ripple/index.js +5 -2
- package/components/ripple/style.js +96 -1
- package/components/segmented-button/segmented-button-group-style.js +28 -1
- package/components/segmented-button/segmented-button-group.js +21 -1
- package/components/segmented-button/segmented-button-style.js +81 -2
- package/components/segmented-button/segmented-button.js +27 -11
- package/components/select/index.js +87 -6
- package/components/select/style.js +27 -1
- package/components/slider/index.js +33 -2
- package/components/slider/slider-base-style.js +173 -1
- package/components/slider/slider-base.js +6 -1
- package/components/slider/style.js +7 -1
- package/components/snackbar/index.js +32 -5
- package/components/snackbar/style.js +100 -1
- package/components/switch/index.js +40 -6
- package/components/switch/style.js +202 -1
- package/components/tabs/tab-panel-style.js +10 -1
- package/components/tabs/tab-style.js +85 -1
- package/components/tabs/tab.js +24 -4
- package/components/tabs/tabs-style.js +138 -1
- package/components/tabs/tabs.js +9 -1
- package/components/text-field/index.js +160 -32
- package/components/text-field/style.js +362 -1
- package/components/tooltip/index.js +10 -1
- package/components/tooltip/style.js +57 -1
- package/components/top-app-bar/top-app-bar-style.js +78 -1
- package/components/top-app-bar/top-app-bar-title-style.js +81 -1
- package/components/top-app-bar/top-app-bar-title.js +17 -3
- package/custom-elements.json +1144 -1101
- package/html-data.en.json +15 -6
- package/html-data.zh-cn.json +15 -6
- package/jsx.en.d.ts +2 -2
- package/jsx.zh-cn.d.ts +2 -2
- package/package.json +2 -2
- package/web-types.en.json +20 -4
- package/web-types.zh-cn.json +20 -4
- package/mdui.esm.js +0 -22
- package/mdui.global.js +0 -22
|
@@ -1,2 +1,58 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css
|
|
2
|
+
export const style = css `
|
|
3
|
+
:host {
|
|
4
|
+
--shape-corner-plain: var(--mdui-shape-corner-extra-small);
|
|
5
|
+
--shape-corner-rich: var(--mdui-shape-corner-medium);
|
|
6
|
+
--z-index: 2500;
|
|
7
|
+
display: contents;
|
|
8
|
+
}
|
|
9
|
+
.popup {
|
|
10
|
+
position: fixed;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
z-index: var(--z-index);
|
|
14
|
+
border-radius: var(--shape-corner-plain);
|
|
15
|
+
background-color: rgb(var(--mdui-color-inverse-surface));
|
|
16
|
+
padding: 0rem 0.5rem;
|
|
17
|
+
min-width: 1.75rem;
|
|
18
|
+
max-width: 20rem;
|
|
19
|
+
}
|
|
20
|
+
:host([variant='rich']) .popup {
|
|
21
|
+
border-radius: var(--shape-corner-rich);
|
|
22
|
+
background-color: rgb(var(--mdui-color-surface-container));
|
|
23
|
+
box-shadow: var(--mdui-elevation-level2);
|
|
24
|
+
padding: 0.75rem 1rem 0.5rem 1rem;
|
|
25
|
+
}
|
|
26
|
+
.headline {
|
|
27
|
+
display: flex;
|
|
28
|
+
color: rgb(var(--mdui-color-on-surface-variant));
|
|
29
|
+
font-size: var(--mdui-typescale-title-small-size);
|
|
30
|
+
font-weight: var(--mdui-typescale-title-small-weight);
|
|
31
|
+
letter-spacing: var(--mdui-typescale-title-small-tracking);
|
|
32
|
+
line-height: var(--mdui-typescale-title-small-line-height);
|
|
33
|
+
}
|
|
34
|
+
.content {
|
|
35
|
+
display: flex;
|
|
36
|
+
padding: 0.25rem 0rem;
|
|
37
|
+
color: rgb(var(--mdui-color-inverse-on-surface));
|
|
38
|
+
font-size: var(--mdui-typescale-body-small-size);
|
|
39
|
+
font-weight: var(--mdui-typescale-body-small-weight);
|
|
40
|
+
letter-spacing: var(--mdui-typescale-body-small-tracking);
|
|
41
|
+
line-height: var(--mdui-typescale-body-small-line-height);
|
|
42
|
+
}
|
|
43
|
+
:host([variant='rich']) .content {
|
|
44
|
+
color: rgb(var(--mdui-color-on-surface-variant));
|
|
45
|
+
font-size: var(--mdui-typescale-body-medium-size);
|
|
46
|
+
font-weight: var(--mdui-typescale-body-medium-weight);
|
|
47
|
+
letter-spacing: var(--mdui-typescale-body-medium-tracking);
|
|
48
|
+
line-height: var(--mdui-typescale-body-medium-line-height);
|
|
49
|
+
}
|
|
50
|
+
.action {
|
|
51
|
+
display: flex;
|
|
52
|
+
justify-content: flex-start;
|
|
53
|
+
padding-top: 0.5rem;
|
|
54
|
+
}
|
|
55
|
+
.action ::slotted(:not(:last-child)) {
|
|
56
|
+
margin-right: 0.5rem;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
@@ -1,2 +1,79 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const topAppBarStyle = css
|
|
2
|
+
export const topAppBarStyle = css `
|
|
3
|
+
:host {
|
|
4
|
+
--shape-corner: var(--mdui-shape-corner-none);
|
|
5
|
+
--z-index: 2000;
|
|
6
|
+
position: fixed;
|
|
7
|
+
top: 0;
|
|
8
|
+
right: 0;
|
|
9
|
+
left: 0;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex: 0 0 auto;
|
|
12
|
+
align-items: flex-start;
|
|
13
|
+
justify-content: flex-start;
|
|
14
|
+
border-bottom-left-radius: var(--shape-corner);
|
|
15
|
+
border-bottom-right-radius: var(--shape-corner);
|
|
16
|
+
z-index: var(--z-index);
|
|
17
|
+
transition:
|
|
18
|
+
top var(--mdui-motion-duration-long2) var(--mdui-motion-easing-standard),
|
|
19
|
+
height var(--mdui-motion-duration-long2)
|
|
20
|
+
var(--mdui-motion-easing-standard),
|
|
21
|
+
box-shadow var(--mdui-motion-duration-short4)
|
|
22
|
+
var(--mdui-motion-easing-linear),
|
|
23
|
+
background-color var(--mdui-motion-duration-short4)
|
|
24
|
+
var(--mdui-motion-easing-linear);
|
|
25
|
+
padding: 0.75rem 0.5rem;
|
|
26
|
+
height: 4rem;
|
|
27
|
+
background-color: rgb(var(--mdui-color-surface));
|
|
28
|
+
}
|
|
29
|
+
:host([scroll-target]:not([scroll-target=''])) {
|
|
30
|
+
position: absolute;
|
|
31
|
+
}
|
|
32
|
+
:host([scroll-behavior~='shrink']) {
|
|
33
|
+
transition-duration: var(--mdui-motion-duration-short4);
|
|
34
|
+
}
|
|
35
|
+
:host([scrolling]) {
|
|
36
|
+
background-color: rgb(var(--mdui-color-surface-container));
|
|
37
|
+
box-shadow: var(--mdui-elevation-level2);
|
|
38
|
+
}
|
|
39
|
+
::slotted(mdui-button-icon) {
|
|
40
|
+
color: rgb(var(--mdui-color-on-surface-variant));
|
|
41
|
+
font-size: 1.5rem;
|
|
42
|
+
}
|
|
43
|
+
::slotted(mdui-button-icon:first-child) {
|
|
44
|
+
color: rgb(var(--mdui-color-on-surface));
|
|
45
|
+
}
|
|
46
|
+
::slotted(mdui-avatar) {
|
|
47
|
+
width: 1.875rem;
|
|
48
|
+
height: 1.875rem;
|
|
49
|
+
margin-top: 0.3125rem;
|
|
50
|
+
margin-bottom: 0.3125rem;
|
|
51
|
+
}
|
|
52
|
+
::slotted(*) {
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
}
|
|
55
|
+
::slotted(:not(:last-child)) {
|
|
56
|
+
margin-right: 0.5rem;
|
|
57
|
+
}
|
|
58
|
+
:host([variant='medium']) {
|
|
59
|
+
height: 7rem;
|
|
60
|
+
}
|
|
61
|
+
:host([variant='large']) {
|
|
62
|
+
height: 9.5rem;
|
|
63
|
+
}
|
|
64
|
+
:host([hide]) {
|
|
65
|
+
transition-duration: var(--mdui-motion-duration-short4);
|
|
66
|
+
top: -4.625rem;
|
|
67
|
+
}
|
|
68
|
+
:host([hide][variant='medium']) {
|
|
69
|
+
top: -7.625rem;
|
|
70
|
+
}
|
|
71
|
+
:host([hide][variant='large']) {
|
|
72
|
+
top: -10.125rem;
|
|
73
|
+
}
|
|
74
|
+
:host([shrink][variant='medium']),
|
|
75
|
+
:host([shrink][variant='large']) {
|
|
76
|
+
transition-duration: var(--mdui-motion-duration-short4);
|
|
77
|
+
height: 4rem;
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
@@ -1,2 +1,82 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const topAppBarTitleStyle = css
|
|
2
|
+
export const topAppBarTitleStyle = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
width: 100%;
|
|
6
|
+
flex-shrink: initial !important;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
color: rgb(var(--mdui-color-on-surface));
|
|
9
|
+
font-size: var(--mdui-typescale-title-large-size);
|
|
10
|
+
font-weight: var(--mdui-typescale-title-large-weight);
|
|
11
|
+
letter-spacing: var(--mdui-typescale-title-large-tracking);
|
|
12
|
+
line-height: var(--mdui-typescale-title-large-line-height);
|
|
13
|
+
line-height: 2.5rem;
|
|
14
|
+
}
|
|
15
|
+
.label {
|
|
16
|
+
display: block;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
text-overflow: ellipsis;
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
opacity: 1;
|
|
21
|
+
transition: opacity var(--mdui-motion-duration-short2)
|
|
22
|
+
var(--mdui-motion-easing-linear);
|
|
23
|
+
}
|
|
24
|
+
.label.variant-center-aligned {
|
|
25
|
+
text-align: center;
|
|
26
|
+
}
|
|
27
|
+
.label.variant-medium:not(.shrink),
|
|
28
|
+
.label.variant-large:not(.shrink) {
|
|
29
|
+
opacity: 0;
|
|
30
|
+
}
|
|
31
|
+
.label.variant-medium.shrink,
|
|
32
|
+
.label.variant-large.shrink {
|
|
33
|
+
transition-delay: var(--mdui-motion-duration-short2);
|
|
34
|
+
}
|
|
35
|
+
.label-large {
|
|
36
|
+
display: none;
|
|
37
|
+
position: absolute;
|
|
38
|
+
width: 100%;
|
|
39
|
+
left: 0;
|
|
40
|
+
margin-right: 0;
|
|
41
|
+
padding: 0rem 1rem;
|
|
42
|
+
transition: opacity var(--mdui-motion-duration-short2)
|
|
43
|
+
var(--mdui-motion-easing-linear);
|
|
44
|
+
}
|
|
45
|
+
.label-large.variant-medium,
|
|
46
|
+
.label-large.variant-large {
|
|
47
|
+
display: block;
|
|
48
|
+
}
|
|
49
|
+
.label-large.variant-medium {
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
text-overflow: ellipsis;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
bottom: 0.75rem;
|
|
54
|
+
font-size: var(--mdui-typescale-headline-small-size);
|
|
55
|
+
font-weight: var(--mdui-typescale-headline-small-weight);
|
|
56
|
+
letter-spacing: var(--mdui-typescale-headline-small-tracking);
|
|
57
|
+
line-height: var(--mdui-typescale-headline-small-line-height);
|
|
58
|
+
}
|
|
59
|
+
.label-large.variant-large {
|
|
60
|
+
display: -webkit-box;
|
|
61
|
+
/* stylelint-disable-line value-no-vendor-prefix */
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
white-space: normal;
|
|
64
|
+
-webkit-box-orient: vertical;
|
|
65
|
+
-webkit-line-clamp: 2;
|
|
66
|
+
bottom: 1.25rem;
|
|
67
|
+
font-size: var(--mdui-typescale-headline-medium-size);
|
|
68
|
+
font-weight: var(--mdui-typescale-headline-medium-weight);
|
|
69
|
+
letter-spacing: var(--mdui-typescale-headline-medium-tracking);
|
|
70
|
+
line-height: var(--mdui-typescale-headline-medium-line-height);
|
|
71
|
+
}
|
|
72
|
+
.label-large.variant-medium:not(.shrink),
|
|
73
|
+
.label-large.variant-large:not(.shrink) {
|
|
74
|
+
opacity: 1;
|
|
75
|
+
transition-delay: var(--mdui-motion-duration-short2);
|
|
76
|
+
}
|
|
77
|
+
.label-large.variant-medium.shrink,
|
|
78
|
+
.label-large.variant-large.shrink {
|
|
79
|
+
opacity: 0;
|
|
80
|
+
z-index: -1;
|
|
81
|
+
}
|
|
82
|
+
`;
|
|
@@ -50,9 +50,23 @@ let TopAppBarTitle = class TopAppBarTitle extends MduiElement {
|
|
|
50
50
|
'variant-medium': this.variant === 'medium',
|
|
51
51
|
'variant-large': this.variant === 'large',
|
|
52
52
|
});
|
|
53
|
-
return html `<slot
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
return html `<slot
|
|
54
|
+
part="label"
|
|
55
|
+
class="label ${className}"
|
|
56
|
+
${ref(this.defaultSlotRef)}
|
|
57
|
+
@slotchange="${() => this.onSlotChange(hasLabelLargeSlot)}"
|
|
58
|
+
></slot>
|
|
59
|
+
${hasLabelLargeSlot
|
|
60
|
+
? html `<slot
|
|
61
|
+
name="label-large"
|
|
62
|
+
part="label-large"
|
|
63
|
+
class="label-large ${className}"
|
|
64
|
+
></slot>`
|
|
65
|
+
: html `<div
|
|
66
|
+
${ref(this.labelLargeRef)}
|
|
67
|
+
part="label-large"
|
|
68
|
+
class="label-large ${className}"
|
|
69
|
+
></div>`}`;
|
|
56
70
|
}
|
|
57
71
|
/**
|
|
58
72
|
* default slot 变化时,同步到 label-large 中
|