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,203 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css
|
|
2
|
+
export const style = css `
|
|
3
|
+
:host {
|
|
4
|
+
--shape-corner: var(--mdui-shape-corner-full);
|
|
5
|
+
--shape-corner-thumb: var(--mdui-shape-corner-full);
|
|
6
|
+
position: relative;
|
|
7
|
+
display: inline-block;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
-webkit-tap-highlight-color: transparent;
|
|
10
|
+
height: 2.5rem;
|
|
11
|
+
}
|
|
12
|
+
:host([disabled]) {
|
|
13
|
+
cursor: default;
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
}
|
|
16
|
+
label {
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
cursor: inherit;
|
|
23
|
+
-webkit-user-select: none;
|
|
24
|
+
user-select: none;
|
|
25
|
+
touch-action: manipulation;
|
|
26
|
+
zoom: 1;
|
|
27
|
+
-webkit-user-drag: none;
|
|
28
|
+
}
|
|
29
|
+
/* 轨道 */
|
|
30
|
+
.track {
|
|
31
|
+
position: relative;
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
border-radius: var(--shape-corner);
|
|
35
|
+
transition-property: background-color, border-width;
|
|
36
|
+
transition-duration: var(--mdui-motion-duration-short4);
|
|
37
|
+
transition-timing-function: var(--mdui-motion-easing-standard);
|
|
38
|
+
height: 2rem;
|
|
39
|
+
width: 3.25rem;
|
|
40
|
+
border: 0.125rem solid rgb(var(--mdui-color-outline));
|
|
41
|
+
background-color: rgb(var(--mdui-color-surface-container-highest));
|
|
42
|
+
}
|
|
43
|
+
:host([checked]) .track {
|
|
44
|
+
background-color: rgb(var(--mdui-color-primary));
|
|
45
|
+
border-width: 0rem;
|
|
46
|
+
}
|
|
47
|
+
.invalid .track {
|
|
48
|
+
background-color: rgb(var(--mdui-color-error-container));
|
|
49
|
+
border-color: rgb(var(--mdui-color-error));
|
|
50
|
+
}
|
|
51
|
+
:host([disabled]) .track {
|
|
52
|
+
background-color: rgba(var(--mdui-color-surface-container-highest), 0.12);
|
|
53
|
+
border-color: rgba(var(--mdui-color-on-surface), 0.12);
|
|
54
|
+
}
|
|
55
|
+
:host([disabled][checked]) .track {
|
|
56
|
+
background-color: rgba(var(--mdui-color-on-surface), 0.12);
|
|
57
|
+
}
|
|
58
|
+
/* 隐藏系统 input 标签,用自定义的图标代替 */
|
|
59
|
+
input {
|
|
60
|
+
position: absolute;
|
|
61
|
+
padding: 0;
|
|
62
|
+
opacity: 0;
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
width: 1.25rem;
|
|
65
|
+
height: 1.25rem;
|
|
66
|
+
margin: 0rem 0rem 0rem 0.625rem;
|
|
67
|
+
}
|
|
68
|
+
mdui-ripple {
|
|
69
|
+
border-radius: 50%;
|
|
70
|
+
transition-property: left, top;
|
|
71
|
+
transition-duration: var(--mdui-motion-duration-short4);
|
|
72
|
+
transition-timing-function: var(--mdui-motion-easing-standard);
|
|
73
|
+
width: 2.5rem;
|
|
74
|
+
height: 2.5rem;
|
|
75
|
+
}
|
|
76
|
+
.thumb {
|
|
77
|
+
position: absolute;
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
border-radius: var(--shape-corner-thumb);
|
|
82
|
+
transition-property: width, height, left, background-color;
|
|
83
|
+
transition-duration: var(--mdui-motion-duration-short4);
|
|
84
|
+
transition-timing-function: var(--mdui-motion-easing-standard);
|
|
85
|
+
height: 1rem;
|
|
86
|
+
width: 1rem;
|
|
87
|
+
left: 0.375rem;
|
|
88
|
+
background-color: rgb(var(--mdui-color-outline));
|
|
89
|
+
--mdui-comp-ripple-state-layer-color: var(--mdui-color-on-surface);
|
|
90
|
+
}
|
|
91
|
+
.thumb mdui-ripple {
|
|
92
|
+
left: -0.75rem;
|
|
93
|
+
top: -0.75rem;
|
|
94
|
+
}
|
|
95
|
+
.has-unchecked-icon .thumb {
|
|
96
|
+
height: 1.5rem;
|
|
97
|
+
width: 1.5rem;
|
|
98
|
+
left: 0.125rem;
|
|
99
|
+
}
|
|
100
|
+
.has-unchecked-icon .thumb mdui-ripple {
|
|
101
|
+
left: -0.5rem;
|
|
102
|
+
top: -0.5rem;
|
|
103
|
+
}
|
|
104
|
+
:host([hover]) .thumb,
|
|
105
|
+
:host([focus-visible]) .thumb,
|
|
106
|
+
:host([pressed]) .thumb {
|
|
107
|
+
background-color: rgb(var(--mdui-color-on-surface-variant));
|
|
108
|
+
}
|
|
109
|
+
:host([checked]) .thumb {
|
|
110
|
+
height: 1.5rem;
|
|
111
|
+
width: 1.5rem;
|
|
112
|
+
left: 1.5rem;
|
|
113
|
+
background-color: rgb(var(--mdui-color-on-primary));
|
|
114
|
+
--mdui-comp-ripple-state-layer-color: var(--mdui-color-primary);
|
|
115
|
+
}
|
|
116
|
+
:host([checked]) .thumb mdui-ripple {
|
|
117
|
+
left: -0.5rem;
|
|
118
|
+
top: -0.5rem;
|
|
119
|
+
}
|
|
120
|
+
:host([pressed]) .thumb {
|
|
121
|
+
height: 1.75rem;
|
|
122
|
+
width: 1.75rem;
|
|
123
|
+
left: 0rem;
|
|
124
|
+
}
|
|
125
|
+
:host([pressed]) .thumb mdui-ripple {
|
|
126
|
+
left: -0.375rem;
|
|
127
|
+
top: -0.375rem;
|
|
128
|
+
}
|
|
129
|
+
:host([pressed][checked]) .thumb {
|
|
130
|
+
left: 1.375rem;
|
|
131
|
+
}
|
|
132
|
+
:host([hover][checked]) .thumb,
|
|
133
|
+
:host([focus-visible][checked]) .thumb,
|
|
134
|
+
:host([pressed][checked]) .thumb {
|
|
135
|
+
background-color: rgb(var(--mdui-color-primary-container));
|
|
136
|
+
}
|
|
137
|
+
.invalid .thumb {
|
|
138
|
+
background-color: rgb(var(--mdui-color-error));
|
|
139
|
+
--mdui-comp-ripple-state-layer-color: var(--mdui-color-error);
|
|
140
|
+
}
|
|
141
|
+
:host([hover]) .invalid .thumb,
|
|
142
|
+
:host([focus-visible]) .invalid .thumb,
|
|
143
|
+
:host([pressed]) .invalid .thumb {
|
|
144
|
+
background-color: rgb(var(--mdui-color-error));
|
|
145
|
+
}
|
|
146
|
+
:host([disabled]) .thumb {
|
|
147
|
+
background-color: rgba(var(--mdui-color-on-surface), 0.38);
|
|
148
|
+
}
|
|
149
|
+
:host([disabled][checked]) .thumb {
|
|
150
|
+
background-color: rgb(var(--mdui-color-surface));
|
|
151
|
+
}
|
|
152
|
+
.unchecked-icon,
|
|
153
|
+
.checked-icon {
|
|
154
|
+
display: flex;
|
|
155
|
+
position: absolute;
|
|
156
|
+
transition-property: opacity, transform;
|
|
157
|
+
font-size: 1rem;
|
|
158
|
+
}
|
|
159
|
+
.unchecked-icon {
|
|
160
|
+
opacity: 1;
|
|
161
|
+
transform: scale(1);
|
|
162
|
+
transition-delay: var(--mdui-motion-duration-short1);
|
|
163
|
+
transition-duration: var(--mdui-motion-duration-short3);
|
|
164
|
+
transition-timing-function: var(--mdui-motion-easing-linear);
|
|
165
|
+
color: rgb(var(--mdui-color-surface-container-highest));
|
|
166
|
+
}
|
|
167
|
+
:host([checked]) .unchecked-icon {
|
|
168
|
+
opacity: 0;
|
|
169
|
+
transform: scale(0.92);
|
|
170
|
+
transition-delay: 0ms;
|
|
171
|
+
transition-duration: var(--mdui-motion-duration-short1);
|
|
172
|
+
}
|
|
173
|
+
:host([disabled]) .unchecked-icon {
|
|
174
|
+
color: rgba(var(--mdui-color-surface-container-highest), 0.38);
|
|
175
|
+
}
|
|
176
|
+
.checked-icon {
|
|
177
|
+
opacity: 0;
|
|
178
|
+
transform: scale(0.92);
|
|
179
|
+
transition-delay: 0ms;
|
|
180
|
+
transition-duration: var(--mdui-motion-duration-short1);
|
|
181
|
+
transition-timing-function: var(--mdui-motion-easing-linear);
|
|
182
|
+
color: rgb(var(--mdui-color-on-primary-container));
|
|
183
|
+
}
|
|
184
|
+
:host([checked]) .checked-icon {
|
|
185
|
+
opacity: 1;
|
|
186
|
+
transform: scale(1);
|
|
187
|
+
transition-delay: var(--mdui-motion-duration-short1);
|
|
188
|
+
transition-duration: var(--mdui-motion-duration-short3);
|
|
189
|
+
}
|
|
190
|
+
.invalid .checked-icon {
|
|
191
|
+
color: rgb(var(--mdui-color-error-container));
|
|
192
|
+
}
|
|
193
|
+
:host([disabled]) .checked-icon {
|
|
194
|
+
color: rgba(var(--mdui-color-on-surface), 0.38);
|
|
195
|
+
}
|
|
196
|
+
.unchecked-icon .i,
|
|
197
|
+
.checked-icon .i,
|
|
198
|
+
::slotted([slot='unchecked-icon']),
|
|
199
|
+
::slotted([slot='checked-icon']) {
|
|
200
|
+
font-size: inherit;
|
|
201
|
+
color: inherit;
|
|
202
|
+
}
|
|
203
|
+
`;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const tabPanelStyle = css
|
|
2
|
+
export const tabPanelStyle = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
overflow-y: auto;
|
|
6
|
+
flex: 1 1 auto;
|
|
7
|
+
}
|
|
8
|
+
:host(:not([active])) {
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
@@ -1,2 +1,86 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const tabStyle = css
|
|
2
|
+
export const tabStyle = css `
|
|
3
|
+
:host {
|
|
4
|
+
position: relative;
|
|
5
|
+
--mdui-comp-ripple-state-layer-color: var(--mdui-color-on-surface);
|
|
6
|
+
}
|
|
7
|
+
:host([active]) {
|
|
8
|
+
--mdui-comp-ripple-state-layer-color: var(--mdui-color-primary);
|
|
9
|
+
}
|
|
10
|
+
.container {
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
align-items: center;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
-webkit-user-select: none;
|
|
16
|
+
user-select: none;
|
|
17
|
+
-webkit-tap-highlight-color: transparent;
|
|
18
|
+
height: 100%;
|
|
19
|
+
}
|
|
20
|
+
.preset {
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
min-height: 3rem;
|
|
23
|
+
padding: 0.625rem 1rem;
|
|
24
|
+
}
|
|
25
|
+
:host([inline]) .preset {
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
}
|
|
28
|
+
.icon-container,
|
|
29
|
+
.label-container {
|
|
30
|
+
position: relative;
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
}
|
|
35
|
+
.icon-container ::slotted([slot='badge']) {
|
|
36
|
+
position: absolute;
|
|
37
|
+
transform: translate(50%, -50%);
|
|
38
|
+
}
|
|
39
|
+
.icon-container ::slotted([slot='badge'][variant='small']) {
|
|
40
|
+
transform: translate(0.5625rem, -0.5625rem);
|
|
41
|
+
}
|
|
42
|
+
.label-container ::slotted([slot='badge']) {
|
|
43
|
+
position: absolute;
|
|
44
|
+
left: 100%;
|
|
45
|
+
bottom: 100%;
|
|
46
|
+
transform: translate(-0.75rem, 0.625rem);
|
|
47
|
+
}
|
|
48
|
+
.label-container ::slotted([slot='badge'][variant='small']) {
|
|
49
|
+
transform: translate(-0.375rem, 0.375rem);
|
|
50
|
+
}
|
|
51
|
+
.icon,
|
|
52
|
+
.label {
|
|
53
|
+
display: flex;
|
|
54
|
+
color: rgb(var(--mdui-color-on-surface-variant));
|
|
55
|
+
}
|
|
56
|
+
:host([hover]) .icon,
|
|
57
|
+
:host([hover]) .label,
|
|
58
|
+
:host([focused]) .icon,
|
|
59
|
+
:host([focused]) .label,
|
|
60
|
+
:host([pressed]) .icon,
|
|
61
|
+
:host([pressed]) .label {
|
|
62
|
+
color: rgb(var(--mdui-color-on-surface));
|
|
63
|
+
}
|
|
64
|
+
:host([active]) .icon,
|
|
65
|
+
:host([active]) .label {
|
|
66
|
+
color: rgb(var(--mdui-color-primary));
|
|
67
|
+
}
|
|
68
|
+
:host([active]) .variant-secondary .icon,
|
|
69
|
+
:host([active]) .variant-secondary .label {
|
|
70
|
+
color: rgb(var(--mdui-color-on-surface));
|
|
71
|
+
}
|
|
72
|
+
.icon {
|
|
73
|
+
font-size: 1.5rem;
|
|
74
|
+
}
|
|
75
|
+
.label {
|
|
76
|
+
font-size: var(--mdui-typescale-title-small-size);
|
|
77
|
+
font-weight: var(--mdui-typescale-title-small-weight);
|
|
78
|
+
letter-spacing: var(--mdui-typescale-title-small-tracking);
|
|
79
|
+
line-height: var(--mdui-typescale-title-small-line-height);
|
|
80
|
+
}
|
|
81
|
+
.icon mdui-icon,
|
|
82
|
+
::slotted([slot='icon']) {
|
|
83
|
+
font-size: inherit;
|
|
84
|
+
color: inherit;
|
|
85
|
+
}
|
|
86
|
+
`;
|
package/components/tabs/tab.js
CHANGED
|
@@ -77,13 +77,33 @@ let Tab = class Tab extends RippleMixin(FocusableMixin(MduiElement)) {
|
|
|
77
77
|
const hasIcon = this.icon || this.hasSlotController.test('icon');
|
|
78
78
|
const hasCustomSlot = this.hasSlotController.test('custom');
|
|
79
79
|
const renderBadge = () => html `<slot name="badge"></slot>`;
|
|
80
|
-
return html `<mdui-ripple
|
|
80
|
+
return html `<mdui-ripple
|
|
81
|
+
${ref(this.rippleRef)}
|
|
82
|
+
.noRipple=${this.noRipple}
|
|
83
|
+
></mdui-ripple>
|
|
84
|
+
<div
|
|
85
|
+
part="container"
|
|
86
|
+
class=${classMap({
|
|
81
87
|
container: true,
|
|
82
88
|
preset: !hasCustomSlot,
|
|
83
89
|
'variant-secondary': this.variant === 'secondary',
|
|
84
|
-
})}
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
})}
|
|
91
|
+
>
|
|
92
|
+
<slot name="custom">
|
|
93
|
+
<div class="icon-container">
|
|
94
|
+
${when(hasIcon || this.icon, renderBadge)}
|
|
95
|
+
<slot name="icon" part="icon" class="icon">
|
|
96
|
+
${this.icon
|
|
97
|
+
? html `<mdui-icon name=${this.icon}></mdui-icon>`
|
|
98
|
+
: nothingTemplate}
|
|
99
|
+
</slot>
|
|
100
|
+
</div>
|
|
101
|
+
<div class="label-container">
|
|
102
|
+
${when(!hasIcon, renderBadge)}
|
|
103
|
+
<slot part="label" class="label"></slot>
|
|
104
|
+
</div>
|
|
105
|
+
</slot>
|
|
106
|
+
</div>`;
|
|
87
107
|
}
|
|
88
108
|
};
|
|
89
109
|
Tab.styles = [componentStyle, tabStyle];
|
|
@@ -1,2 +1,139 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const tabsStyle = css
|
|
2
|
+
export const tabsStyle = css `
|
|
3
|
+
:host {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
}
|
|
7
|
+
:host([placement^='top']) {
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
}
|
|
10
|
+
:host([placement^='bottom']) {
|
|
11
|
+
flex-direction: column-reverse;
|
|
12
|
+
}
|
|
13
|
+
:host([placement^='left']) {
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
}
|
|
16
|
+
:host([placement^='right']) {
|
|
17
|
+
flex-direction: row-reverse;
|
|
18
|
+
}
|
|
19
|
+
.container {
|
|
20
|
+
position: relative;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex: 0 0 auto;
|
|
23
|
+
overflow-x: auto;
|
|
24
|
+
background-color: rgb(var(--mdui-color-surface));
|
|
25
|
+
}
|
|
26
|
+
:host([placement^='top']) .container,
|
|
27
|
+
:host([placement^='bottom']) .container {
|
|
28
|
+
flex-direction: row;
|
|
29
|
+
}
|
|
30
|
+
:host([placement^='left']) .container,
|
|
31
|
+
:host([placement^='right']) .container {
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
}
|
|
34
|
+
:host([placement$='-start']) .container {
|
|
35
|
+
justify-content: flex-start;
|
|
36
|
+
}
|
|
37
|
+
:host([placement='top']) .container,
|
|
38
|
+
:host([placement='bottom']) .container,
|
|
39
|
+
:host([placement='left']) .container,
|
|
40
|
+
:host([placement='right']) .container {
|
|
41
|
+
justify-content: center;
|
|
42
|
+
}
|
|
43
|
+
:host([placement$='-end']) .container {
|
|
44
|
+
justify-content: flex-end;
|
|
45
|
+
}
|
|
46
|
+
.container::after {
|
|
47
|
+
content: ' ';
|
|
48
|
+
position: absolute;
|
|
49
|
+
background-color: rgb(var(--mdui-color-surface-variant));
|
|
50
|
+
}
|
|
51
|
+
:host([placement^='top']) .container::after,
|
|
52
|
+
:host([placement^='bottom']) .container::after {
|
|
53
|
+
left: 0;
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 0.0625rem;
|
|
56
|
+
}
|
|
57
|
+
:host([placement^='top']) .container::after {
|
|
58
|
+
bottom: 0;
|
|
59
|
+
}
|
|
60
|
+
:host([placement^='bottom']) .container::after {
|
|
61
|
+
top: 0;
|
|
62
|
+
}
|
|
63
|
+
:host([placement^='left']) .container::after,
|
|
64
|
+
:host([placement^='right']) .container::after {
|
|
65
|
+
top: 0;
|
|
66
|
+
height: 100%;
|
|
67
|
+
width: 0.0625rem;
|
|
68
|
+
}
|
|
69
|
+
:host([placement^='left']) .container::after {
|
|
70
|
+
right: 0;
|
|
71
|
+
}
|
|
72
|
+
:host([placement^='right']) .container::after {
|
|
73
|
+
left: 0;
|
|
74
|
+
}
|
|
75
|
+
.indicator {
|
|
76
|
+
position: absolute;
|
|
77
|
+
z-index: 1;
|
|
78
|
+
background-color: rgb(var(--mdui-color-primary));
|
|
79
|
+
}
|
|
80
|
+
.container:not(.initial) .indicator {
|
|
81
|
+
transition-duration: var(--mdui-motion-duration-medium2);
|
|
82
|
+
transition-timing-function: var(--mdui-motion-easing-standard-decelerate);
|
|
83
|
+
}
|
|
84
|
+
:host([placement^='top']) .indicator,
|
|
85
|
+
:host([placement^='bottom']) .indicator {
|
|
86
|
+
transition-property: transform, left, width;
|
|
87
|
+
}
|
|
88
|
+
:host([placement^='left']) .indicator,
|
|
89
|
+
:host([placement^='right']) .indicator {
|
|
90
|
+
transition-property: transform, top, height;
|
|
91
|
+
}
|
|
92
|
+
:host([placement^='top']) .indicator {
|
|
93
|
+
bottom: 0;
|
|
94
|
+
}
|
|
95
|
+
:host([placement^='bottom']) .indicator {
|
|
96
|
+
top: 0;
|
|
97
|
+
}
|
|
98
|
+
:host([placement^='left']) .indicator {
|
|
99
|
+
right: 0;
|
|
100
|
+
}
|
|
101
|
+
:host([placement^='right']) .indicator {
|
|
102
|
+
left: 0;
|
|
103
|
+
}
|
|
104
|
+
:host([placement^='top'][variant='primary']) .indicator,
|
|
105
|
+
:host([placement^='bottom'][variant='primary']) .indicator {
|
|
106
|
+
height: 0.1875rem;
|
|
107
|
+
}
|
|
108
|
+
:host([placement^='top'][variant='secondary']) .indicator,
|
|
109
|
+
:host([placement^='bottom'][variant='secondary']) .indicator {
|
|
110
|
+
height: 0.125rem;
|
|
111
|
+
}
|
|
112
|
+
:host([placement^='left'][variant='primary']) .indicator,
|
|
113
|
+
:host([placement^='right'][variant='primary']) .indicator {
|
|
114
|
+
width: 0.1875rem;
|
|
115
|
+
}
|
|
116
|
+
:host([placement^='left'][variant='secondary']) .indicator,
|
|
117
|
+
:host([placement^='right'][variant='secondary']) .indicator {
|
|
118
|
+
width: 0.125rem;
|
|
119
|
+
}
|
|
120
|
+
:host([placement^='top'][variant='primary']) .indicator {
|
|
121
|
+
border-top-left-radius: 0.1875rem;
|
|
122
|
+
border-top-right-radius: 0.1875rem;
|
|
123
|
+
}
|
|
124
|
+
:host([placement^='bottom'][variant='primary']) .indicator {
|
|
125
|
+
border-bottom-right-radius: 0.1875rem;
|
|
126
|
+
border-bottom-left-radius: 0.1875rem;
|
|
127
|
+
}
|
|
128
|
+
:host([placement^='left'][variant='primary']) .indicator {
|
|
129
|
+
border-top-left-radius: 0.1875rem;
|
|
130
|
+
border-bottom-left-radius: 0.1875rem;
|
|
131
|
+
}
|
|
132
|
+
:host([placement^='right'][variant='primary']) .indicator {
|
|
133
|
+
border-top-right-radius: 0.1875rem;
|
|
134
|
+
border-bottom-right-radius: 0.1875rem;
|
|
135
|
+
}
|
|
136
|
+
:host([full-width]) ::slotted(mdui-tab) {
|
|
137
|
+
flex: 1;
|
|
138
|
+
}
|
|
139
|
+
`;
|
package/components/tabs/tabs.js
CHANGED
|
@@ -107,7 +107,15 @@ let Tabs = class Tabs extends MduiElement {
|
|
|
107
107
|
this.observeResize = observeResize(this.containerRef.value, () => this.updateIndicator());
|
|
108
108
|
}
|
|
109
109
|
render() {
|
|
110
|
-
return html `<div
|
|
110
|
+
return html `<div
|
|
111
|
+
${ref(this.containerRef)}
|
|
112
|
+
part="container"
|
|
113
|
+
class="container ${classMap({ initial: this.isInitial })}"
|
|
114
|
+
>
|
|
115
|
+
<slot @slotchange=${this.onSlotChange} @click=${this.onClick}></slot>
|
|
116
|
+
<div ${ref(this.indicatorRef)} part="indicator" class="indicator"></div>
|
|
117
|
+
</div>
|
|
118
|
+
<slot name="panel" @slotchange=${this.onSlotChange}></slot>`;
|
|
111
119
|
}
|
|
112
120
|
async onSlotChange() {
|
|
113
121
|
await this.definedController.whenDefined();
|