mdui 2.0.5 → 2.1.0
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 +10 -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.d.ts +18 -0
- package/components/select/index.js +42 -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.d.ts +2 -0
- package/components/text-field/index.js +58 -163
- 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 +1194 -1099
- package/functions/alert.d.ts +2 -0
- package/functions/alert.js +19 -4
- package/functions/confirm.d.ts +4 -0
- package/functions/confirm.js +33 -6
- package/functions/getLocale.d.ts +6 -0
- package/functions/getLocale.js +11 -0
- package/functions/getTheme.d.ts +1 -1
- package/functions/loadLocale.d.ts +6 -0
- package/functions/loadLocale.js +8 -0
- package/functions/prompt.d.ts +4 -0
- package/functions/prompt.js +35 -8
- package/functions/removeColorScheme.js +1 -1
- package/functions/setColorScheme.d.ts +1 -1
- package/functions/setColorScheme.js +1 -1
- package/functions/setLocale.d.ts +6 -0
- package/functions/setLocale.js +11 -0
- package/functions/setTheme.d.ts +1 -1
- package/internal/localeCodes.d.ts +13 -0
- package/internal/localeCodes.js +144 -0
- package/internal/localize.d.ts +32 -0
- package/internal/localize.js +55 -0
- package/locales/ar-eg.d.ts +8 -0
- package/locales/ar-eg.js +12 -0
- package/locales/az-az.d.ts +8 -0
- package/locales/az-az.js +12 -0
- package/locales/be-by.d.ts +8 -0
- package/locales/be-by.js +12 -0
- package/locales/bg-bg.d.ts +8 -0
- package/locales/bg-bg.js +12 -0
- package/locales/bn-bd.d.ts +8 -0
- package/locales/bn-bd.js +12 -0
- package/locales/ca-es.d.ts +8 -0
- package/locales/ca-es.js +12 -0
- package/locales/cs-cz.d.ts +8 -0
- package/locales/cs-cz.js +12 -0
- package/locales/da-dk.d.ts +8 -0
- package/locales/da-dk.js +12 -0
- package/locales/de-de.d.ts +8 -0
- package/locales/de-de.js +12 -0
- package/locales/el-gr.d.ts +8 -0
- package/locales/el-gr.js +12 -0
- package/locales/en-gb.d.ts +8 -0
- package/locales/en-gb.js +12 -0
- package/locales/es-es.d.ts +8 -0
- package/locales/es-es.js +12 -0
- package/locales/et-ee.d.ts +8 -0
- package/locales/et-ee.js +12 -0
- package/locales/fa-ir.d.ts +8 -0
- package/locales/fa-ir.js +12 -0
- package/locales/fi-fi.d.ts +8 -0
- package/locales/fi-fi.js +12 -0
- package/locales/fr-be.d.ts +8 -0
- package/locales/fr-be.js +12 -0
- package/locales/fr-ca.d.ts +8 -0
- package/locales/fr-ca.js +12 -0
- package/locales/fr-fr.d.ts +8 -0
- package/locales/fr-fr.js +12 -0
- package/locales/ga-ie.d.ts +8 -0
- package/locales/ga-ie.js +12 -0
- package/locales/gl-es.d.ts +8 -0
- package/locales/gl-es.js +12 -0
- package/locales/he-il.d.ts +8 -0
- package/locales/he-il.js +12 -0
- package/locales/hi-in.d.ts +8 -0
- package/locales/hi-in.js +12 -0
- package/locales/hr-hr.d.ts +8 -0
- package/locales/hr-hr.js +12 -0
- package/locales/hu-hu.d.ts +8 -0
- package/locales/hu-hu.js +12 -0
- package/locales/hy-am.d.ts +8 -0
- package/locales/hy-am.js +12 -0
- package/locales/id-id.d.ts +8 -0
- package/locales/id-id.js +12 -0
- package/locales/is-is.d.ts +8 -0
- package/locales/is-is.js +12 -0
- package/locales/it-it.d.ts +8 -0
- package/locales/it-it.js +12 -0
- package/locales/ja-jp.d.ts +8 -0
- package/locales/ja-jp.js +12 -0
- package/locales/ka-ge.d.ts +8 -0
- package/locales/ka-ge.js +12 -0
- package/locales/kk-kz.d.ts +8 -0
- package/locales/kk-kz.js +12 -0
- package/locales/km-kh.d.ts +8 -0
- package/locales/km-kh.js +12 -0
- package/locales/kmr-iq.d.ts +8 -0
- package/locales/kmr-iq.js +12 -0
- package/locales/kn-in.d.ts +8 -0
- package/locales/kn-in.js +12 -0
- package/locales/ko-kr.d.ts +8 -0
- package/locales/ko-kr.js +12 -0
- package/locales/lt-lt.d.ts +8 -0
- package/locales/lt-lt.js +12 -0
- package/locales/lv-lv.d.ts +8 -0
- package/locales/lv-lv.js +12 -0
- package/locales/mk-mk.d.ts +8 -0
- package/locales/mk-mk.js +12 -0
- package/locales/ml-in.d.ts +8 -0
- package/locales/ml-in.js +12 -0
- package/locales/mn-mn.d.ts +8 -0
- package/locales/mn-mn.js +12 -0
- package/locales/ms-my.d.ts +8 -0
- package/locales/ms-my.js +12 -0
- package/locales/nb-no.d.ts +8 -0
- package/locales/nb-no.js +12 -0
- package/locales/ne-np.d.ts +8 -0
- package/locales/ne-np.js +12 -0
- package/locales/nl-be.d.ts +8 -0
- package/locales/nl-be.js +12 -0
- package/locales/nl-nl.d.ts +8 -0
- package/locales/nl-nl.js +12 -0
- package/locales/pl-pl.d.ts +8 -0
- package/locales/pl-pl.js +12 -0
- package/locales/pt-br.d.ts +8 -0
- package/locales/pt-br.js +12 -0
- package/locales/pt-pt.d.ts +8 -0
- package/locales/pt-pt.js +12 -0
- package/locales/ro-ro.d.ts +8 -0
- package/locales/ro-ro.js +12 -0
- package/locales/ru-ru.d.ts +8 -0
- package/locales/ru-ru.js +12 -0
- package/locales/sk-sk.d.ts +8 -0
- package/locales/sk-sk.js +12 -0
- package/locales/sl-si.d.ts +8 -0
- package/locales/sl-si.js +12 -0
- package/locales/sr-rs.d.ts +8 -0
- package/locales/sr-rs.js +12 -0
- package/locales/sv-se.d.ts +8 -0
- package/locales/sv-se.js +12 -0
- package/locales/ta-in.d.ts +8 -0
- package/locales/ta-in.js +12 -0
- package/locales/th-th.d.ts +8 -0
- package/locales/th-th.js +12 -0
- package/locales/tr-tr.d.ts +8 -0
- package/locales/tr-tr.js +12 -0
- package/locales/uk-ua.d.ts +8 -0
- package/locales/uk-ua.js +12 -0
- package/locales/ur-pk.d.ts +8 -0
- package/locales/ur-pk.js +12 -0
- package/locales/vi-vn.d.ts +8 -0
- package/locales/vi-vn.js +12 -0
- package/locales/zh-cn.d.ts +8 -0
- package/locales/zh-cn.js +12 -0
- package/locales/zh-hk.d.ts +8 -0
- package/locales/zh-hk.js +12 -0
- package/locales/zh-tw.d.ts +8 -0
- package/locales/zh-tw.js +12 -0
- package/mdui.d.ts +5 -0
- package/mdui.esm.js +22 -0
- package/mdui.global.js +22 -0
- package/mdui.js +3 -0
- package/package.json +9 -6
- package/web-types.en.json +91 -1
- package/web-types.zh-cn.json +91 -1
- /package/{functions/utils → internal}/colorScheme.d.ts +0 -0
- /package/{functions/utils → internal}/colorScheme.js +0 -0
- /package/{functions/utils → internal}/theme.d.ts +0 -0
- /package/{functions/utils → internal}/theme.js +0 -0
|
@@ -32,14 +32,9 @@ let Avatar = class Avatar extends MduiElement {
|
|
|
32
32
|
return this.hasSlotController.test('[default]')
|
|
33
33
|
? html `<slot></slot>`
|
|
34
34
|
: this.src
|
|
35
|
-
? html `<img
|
|
36
|
-
part="image"
|
|
37
|
-
alt=${ifDefined(this.label)}
|
|
38
|
-
src=${this.src}
|
|
39
|
-
style=${styleMap({ objectFit: this.fit })}
|
|
40
|
-
/>`
|
|
35
|
+
? html `<img part="image" alt="${ifDefined(this.label)}" src="${this.src}" style="${styleMap({ objectFit: this.fit })}">`
|
|
41
36
|
: this.icon
|
|
42
|
-
? html `<mdui-icon part="icon" name
|
|
37
|
+
? html `<mdui-icon part="icon" name="${this.icon}"></mdui-icon>`
|
|
43
38
|
: nothingTemplate;
|
|
44
39
|
}
|
|
45
40
|
};
|
|
@@ -1,32 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css
|
|
3
|
-
:host {
|
|
4
|
-
--shape-corner: var(--mdui-shape-corner-full);
|
|
5
|
-
position: relative;
|
|
6
|
-
display: inline-flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
white-space: nowrap;
|
|
11
|
-
vertical-align: middle;
|
|
12
|
-
border-radius: var(--shape-corner);
|
|
13
|
-
-webkit-user-select: none;
|
|
14
|
-
user-select: none;
|
|
15
|
-
width: 2.5rem;
|
|
16
|
-
height: 2.5rem;
|
|
17
|
-
background-color: rgb(var(--mdui-color-primary-container));
|
|
18
|
-
color: rgb(var(--mdui-color-on-primary-container));
|
|
19
|
-
font-size: var(--mdui-typescale-title-medium-size);
|
|
20
|
-
font-weight: var(--mdui-typescale-title-medium-weight);
|
|
21
|
-
letter-spacing: var(--mdui-typescale-title-medium-tracking);
|
|
22
|
-
line-height: var(--mdui-typescale-title-medium-line-height);
|
|
23
|
-
}
|
|
24
|
-
img {
|
|
25
|
-
width: 100%;
|
|
26
|
-
height: 100%;
|
|
27
|
-
}
|
|
28
|
-
mdui-icon,
|
|
29
|
-
::slotted(mdui-icon) {
|
|
30
|
-
font-size: 1.5em;
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
2
|
+
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-full);position:relative;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;white-space:nowrap;vertical-align:middle;border-radius:var(--shape-corner);-webkit-user-select:none;user-select:none;width:2.5rem;height:2.5rem;background-color:rgb(var(--mdui-color-primary-container));color:rgb(var(--mdui-color-on-primary-container));font-size:var(--mdui-typescale-title-medium-size);font-weight:var(--mdui-typescale-title-medium-weight);letter-spacing:var(--mdui-typescale-title-medium-tracking);line-height:var(--mdui-typescale-title-medium-line-height)}img{width:100%;height:100%}::slotted(mdui-icon),mdui-icon{font-size:1.5em}`;
|
|
@@ -1,26 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css
|
|
3
|
-
:host {
|
|
4
|
-
--shape-corner: var(--mdui-shape-corner-full);
|
|
5
|
-
display: inline-flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
justify-content: center;
|
|
8
|
-
border-radius: var(--shape-corner);
|
|
9
|
-
padding-left: 0.25rem;
|
|
10
|
-
padding-right: 0.25rem;
|
|
11
|
-
color: rgb(var(--mdui-color-on-error));
|
|
12
|
-
background-color: rgb(var(--mdui-color-error));
|
|
13
|
-
height: 1rem;
|
|
14
|
-
min-width: 1rem;
|
|
15
|
-
font-size: var(--mdui-typescale-label-small-size);
|
|
16
|
-
font-weight: var(--mdui-typescale-label-small-weight);
|
|
17
|
-
letter-spacing: var(--mdui-typescale-label-small-tracking);
|
|
18
|
-
line-height: var(--mdui-typescale-label-small-line-height);
|
|
19
|
-
}
|
|
20
|
-
:host([variant='small']) {
|
|
21
|
-
min-width: 0;
|
|
22
|
-
padding: 0;
|
|
23
|
-
width: 0.375rem;
|
|
24
|
-
height: 0.375rem;
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
2
|
+
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-full);display:inline-flex;align-items:center;justify-content:center;border-radius:var(--shape-corner);padding-left:.25rem;padding-right:.25rem;color:rgb(var(--mdui-color-on-error));background-color:rgb(var(--mdui-color-error));height:1rem;min-width:1rem;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)}:host([variant=small]){min-width:0;padding:0;width:.375rem;height:.375rem}`;
|
|
@@ -1,93 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css
|
|
3
|
-
:host {
|
|
4
|
-
--shape-corner: var(--mdui-shape-corner-none);
|
|
5
|
-
--z-index: 2000;
|
|
6
|
-
position: fixed;
|
|
7
|
-
right: 0;
|
|
8
|
-
bottom: 0;
|
|
9
|
-
left: 0;
|
|
10
|
-
display: flex;
|
|
11
|
-
flex: 0 0 auto;
|
|
12
|
-
align-items: center;
|
|
13
|
-
justify-content: flex-start;
|
|
14
|
-
border-radius: var(--shape-corner) var(--shape-corner) 0 0;
|
|
15
|
-
z-index: var(--z-index);
|
|
16
|
-
transition: bottom var(--mdui-motion-duration-long2)
|
|
17
|
-
var(--mdui-motion-easing-emphasized);
|
|
18
|
-
padding: 0rem 1rem;
|
|
19
|
-
height: 5rem;
|
|
20
|
-
background-color: rgb(var(--mdui-color-surface-container));
|
|
21
|
-
box-shadow: var(--mdui-elevation-level2);
|
|
22
|
-
}
|
|
23
|
-
:host([scroll-target]:not([scroll-target=''])) {
|
|
24
|
-
position: absolute;
|
|
25
|
-
}
|
|
26
|
-
:host([hide]) {
|
|
27
|
-
transition-duration: var(--mdui-motion-duration-short4);
|
|
28
|
-
bottom: -5.625rem;
|
|
29
|
-
}
|
|
30
|
-
::slotted(:not(:first-child)) {
|
|
31
|
-
margin-left: 0.5rem;
|
|
32
|
-
}
|
|
33
|
-
::slotted(mdui-fab) {
|
|
34
|
-
box-shadow: var(--mdui-elevation-level0);
|
|
35
|
-
}
|
|
36
|
-
:host([fab-detach]) ::slotted(mdui-fab) {
|
|
37
|
-
position: absolute;
|
|
38
|
-
transition: bottom var(--mdui-motion-duration-long2)
|
|
39
|
-
var(--mdui-motion-easing-standard);
|
|
40
|
-
right: 1rem;
|
|
41
|
-
bottom: 0.75rem;
|
|
42
|
-
}
|
|
43
|
-
:host([fab-detach][hide][scroll-behavior~='hide']) ::slotted(mdui-fab) {
|
|
44
|
-
transition-duration: var(--mdui-motion-duration-short4);
|
|
45
|
-
bottom: 1rem;
|
|
46
|
-
box-shadow: var(--mdui-elevation-level2);
|
|
47
|
-
}
|
|
48
|
-
:host(
|
|
49
|
-
[fab-detach][hide][scroll-behavior~='hide'][scroll-target]:not(
|
|
50
|
-
[scroll-target='']
|
|
51
|
-
)
|
|
52
|
-
)
|
|
53
|
-
::slotted(mdui-fab) {
|
|
54
|
-
bottom: 6.625rem;
|
|
55
|
-
}
|
|
56
|
-
:host([hide]) ::slotted(:not(mdui-fab)),
|
|
57
|
-
:host([hide]:not([fab-detach])) ::slotted(mdui-fab) {
|
|
58
|
-
transform: translateY(8.75rem);
|
|
59
|
-
transition: transform var(--mdui-motion-duration-0)
|
|
60
|
-
var(--mdui-motion-easing-emphasized-accelerate)
|
|
61
|
-
var(--mdui-motion-duration-short4);
|
|
62
|
-
}
|
|
63
|
-
::slotted(:first-child) {
|
|
64
|
-
transition: transform var(--mdui-motion-duration-short3)
|
|
65
|
-
var(--mdui-motion-easing-emphasized-decelerate)
|
|
66
|
-
var(--mdui-motion-duration-short1);
|
|
67
|
-
}
|
|
68
|
-
::slotted(:nth-child(2)) {
|
|
69
|
-
transition: transform var(--mdui-motion-duration-short3)
|
|
70
|
-
var(--mdui-motion-easing-emphasized-decelerate)
|
|
71
|
-
var(--mdui-motion-duration-short3);
|
|
72
|
-
}
|
|
73
|
-
::slotted(:nth-child(3)) {
|
|
74
|
-
transition: transform var(--mdui-motion-duration-short3)
|
|
75
|
-
var(--mdui-motion-easing-emphasized-decelerate)
|
|
76
|
-
var(--mdui-motion-duration-short4);
|
|
77
|
-
}
|
|
78
|
-
::slotted(:nth-child(4)) {
|
|
79
|
-
transition: transform var(--mdui-motion-duration-short3)
|
|
80
|
-
var(--mdui-motion-easing-emphasized-decelerate)
|
|
81
|
-
var(--mdui-motion-duration-medium1);
|
|
82
|
-
}
|
|
83
|
-
::slotted(:nth-child(5)) {
|
|
84
|
-
transition: transform var(--mdui-motion-duration-short3)
|
|
85
|
-
var(--mdui-motion-easing-emphasized-decelerate)
|
|
86
|
-
var(--mdui-motion-duration-medium2);
|
|
87
|
-
}
|
|
88
|
-
::slotted(:nth-child(6)) {
|
|
89
|
-
transition: transform var(--mdui-motion-duration-short3)
|
|
90
|
-
var(--mdui-motion-easing-emphasized-decelerate)
|
|
91
|
-
var(--mdui-motion-duration-medium3);
|
|
92
|
-
}
|
|
93
|
-
`;
|
|
2
|
+
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-none);--z-index:2000;position:fixed;right:0;bottom:0;left:0;display:flex;flex:0 0 auto;align-items:center;justify-content:flex-start;border-radius:var(--shape-corner) var(--shape-corner) 0 0;z-index:var(--z-index);transition:bottom var(--mdui-motion-duration-long2) var(--mdui-motion-easing-emphasized);padding:0 1rem;height:5rem;background-color:rgb(var(--mdui-color-surface-container));box-shadow:var(--mdui-elevation-level2)}:host([scroll-target]:not([scroll-target=''])){position:absolute}:host([hide]){transition-duration:var(--mdui-motion-duration-short4);bottom:-5.625rem}::slotted(:not(:first-child)){margin-left:.5rem}::slotted(mdui-fab){box-shadow:var(--mdui-elevation-level0)}:host([fab-detach]) ::slotted(mdui-fab){position:absolute;transition:bottom var(--mdui-motion-duration-long2) var(--mdui-motion-easing-standard);right:1rem;bottom:.75rem}:host([fab-detach][hide][scroll-behavior~=hide]) ::slotted(mdui-fab){transition-duration:var(--mdui-motion-duration-short4);bottom:1rem;box-shadow:var(--mdui-elevation-level2)}:host([fab-detach][hide][scroll-behavior~=hide][scroll-target]:not([scroll-target=''])) ::slotted(mdui-fab){bottom:6.625rem}:host([hide]) ::slotted(:not(mdui-fab)),:host([hide]:not([fab-detach])) ::slotted(mdui-fab){transform:translateY(8.75rem);transition:transform var(--mdui-motion-duration-0) var(--mdui-motion-easing-emphasized-accelerate) var(--mdui-motion-duration-short4)}::slotted(:first-child){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-short1)}::slotted(:nth-child(2)){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-short3)}::slotted(:nth-child(3)){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-short4)}::slotted(:nth-child(4)){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-medium1)}::slotted(:nth-child(5)){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-medium2)}::slotted(:nth-child(6)){transition:transform var(--mdui-motion-duration-short3) var(--mdui-motion-easing-emphasized-decelerate) var(--mdui-motion-duration-medium3)}`;
|
|
@@ -1,29 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const buttonBaseStyle = css
|
|
3
|
-
.button {
|
|
4
|
-
position: relative;
|
|
5
|
-
display: inline-flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
justify-content: center;
|
|
8
|
-
height: 100%;
|
|
9
|
-
padding: 0;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
color: inherit;
|
|
12
|
-
font-size: inherit;
|
|
13
|
-
font-family: inherit;
|
|
14
|
-
font-weight: inherit;
|
|
15
|
-
letter-spacing: inherit;
|
|
16
|
-
white-space: nowrap;
|
|
17
|
-
text-align: center;
|
|
18
|
-
text-decoration: none;
|
|
19
|
-
vertical-align: middle;
|
|
20
|
-
background: transparent;
|
|
21
|
-
border: none;
|
|
22
|
-
outline: none;
|
|
23
|
-
cursor: inherit;
|
|
24
|
-
user-select: none;
|
|
25
|
-
touch-action: manipulation;
|
|
26
|
-
zoom: 1;
|
|
27
|
-
-webkit-user-drag: none;
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
2
|
+
export const buttonBaseStyle = css `.button{position:relative;display:inline-flex;align-items:center;justify-content:center;height:100%;padding:0;overflow:hidden;color:inherit;font-size:inherit;font-family:inherit;font-weight:inherit;letter-spacing:inherit;white-space:nowrap;text-align:center;text-decoration:none;vertical-align:middle;background:0 0;border:none;outline:0;cursor:inherit;-webkit-user-select:none;user-select:none;touch-action:manipulation;zoom:1;-webkit-user-drag:none}`;
|
|
@@ -151,14 +151,7 @@ export class ButtonBase extends AnchorMixin(RippleMixin(FocusableMixin(MduiEleme
|
|
|
151
151
|
: nothingTemplate;
|
|
152
152
|
}
|
|
153
153
|
renderButton({ id, className, part, content = html `<slot></slot>`, }) {
|
|
154
|
-
return html `<button
|
|
155
|
-
id=${ifDefined(id)}
|
|
156
|
-
class=${cc(['_button', className])}
|
|
157
|
-
part=${ifDefined(part)}
|
|
158
|
-
?disabled=${this.rippleDisabled || this.focusDisabled}
|
|
159
|
-
>
|
|
160
|
-
${content}
|
|
161
|
-
</button>`;
|
|
154
|
+
return html `<button id="${ifDefined(id)}" class="${cc(['_button', className])}" part="${ifDefined(part)}" ?disabled="${this.rippleDisabled || this.focusDisabled}">${content}</button>`;
|
|
162
155
|
}
|
|
163
156
|
isButton() {
|
|
164
157
|
return !this.href;
|
|
@@ -53,20 +53,14 @@ let Button = class Button extends ButtonBase {
|
|
|
53
53
|
return this.rippleRef.value;
|
|
54
54
|
}
|
|
55
55
|
render() {
|
|
56
|
-
return html `<mdui-ripple
|
|
57
|
-
${ref(this.rippleRef)}
|
|
58
|
-
.noRipple=${this.noRipple}
|
|
59
|
-
></mdui-ripple>
|
|
60
|
-
${this.isButton()
|
|
56
|
+
return html `<mdui-ripple ${ref(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()
|
|
61
57
|
? this.renderButton({
|
|
62
58
|
className: 'button',
|
|
63
59
|
part: 'button',
|
|
64
60
|
content: this.renderInner(),
|
|
65
61
|
})
|
|
66
62
|
: this.disabled || this.loading
|
|
67
|
-
? html `<span part="button" class="button _a"
|
|
68
|
-
${this.renderInner()}
|
|
69
|
-
</span>`
|
|
63
|
+
? html `<span part="button" class="button _a">${this.renderInner()}</span>`
|
|
70
64
|
: this.renderAnchor({
|
|
71
65
|
className: 'button',
|
|
72
66
|
part: 'button',
|
|
@@ -77,21 +71,17 @@ let Button = class Button extends ButtonBase {
|
|
|
77
71
|
if (this.loading) {
|
|
78
72
|
return this.renderLoading();
|
|
79
73
|
}
|
|
80
|
-
return html `<slot name="icon" part="icon" class="icon"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
: nothingTemplate}
|
|
84
|
-
</slot>`;
|
|
74
|
+
return html `<slot name="icon" part="icon" class="icon">${this.icon
|
|
75
|
+
? html `<mdui-icon name="${this.icon}"></mdui-icon>`
|
|
76
|
+
: nothingTemplate}</slot>`;
|
|
85
77
|
}
|
|
86
78
|
renderLabel() {
|
|
87
79
|
return html `<slot part="label" class="label"></slot>`;
|
|
88
80
|
}
|
|
89
81
|
renderEndIcon() {
|
|
90
|
-
return html `<slot name="end-icon" part="end-icon" class="end-icon"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
: nothingTemplate}
|
|
94
|
-
</slot>`;
|
|
82
|
+
return html `<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon
|
|
83
|
+
? html `<mdui-icon name="${this.endIcon}"></mdui-icon>`
|
|
84
|
+
: nothingTemplate}</slot>`;
|
|
95
85
|
}
|
|
96
86
|
renderInner() {
|
|
97
87
|
return [this.renderIcon(), this.renderLabel(), this.renderEndIcon()];
|
|
@@ -1,113 +1,4 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css
|
|
3
|
-
/**
|
|
4
|
-
* mdui-button 组件。默认为 variant="text"
|
|
5
|
-
*/
|
|
6
|
-
:host {
|
|
7
|
-
--shape-corner: var(--mdui-shape-corner-full);
|
|
8
|
-
position: relative;
|
|
9
|
-
display: inline-block;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
text-align: center;
|
|
12
|
-
border-radius: var(--shape-corner);
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
-webkit-tap-highlight-color: transparent;
|
|
15
|
-
transition: box-shadow var(--mdui-motion-duration-short4)
|
|
16
|
-
var(--mdui-motion-easing-linear);
|
|
17
|
-
min-width: 3rem;
|
|
18
|
-
height: 2.5rem;
|
|
19
|
-
color: rgb(var(--mdui-color-primary));
|
|
20
|
-
font-size: var(--mdui-typescale-label-large-size);
|
|
21
|
-
font-weight: var(--mdui-typescale-label-large-weight);
|
|
22
|
-
letter-spacing: var(--mdui-typescale-label-large-tracking);
|
|
23
|
-
line-height: var(--mdui-typescale-label-large-line-height);
|
|
24
|
-
}
|
|
25
|
-
.button {
|
|
26
|
-
width: 100%;
|
|
27
|
-
padding: 0rem 1rem;
|
|
28
|
-
}
|
|
29
|
-
:host([full-width]) {
|
|
30
|
-
display: block;
|
|
31
|
-
}
|
|
32
|
-
:host([variant='elevated']) {
|
|
33
|
-
box-shadow: var(--mdui-elevation-level1);
|
|
34
|
-
background-color: rgb(var(--mdui-color-surface-container-low));
|
|
35
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-primary);
|
|
36
|
-
}
|
|
37
|
-
:host([variant='filled']) {
|
|
38
|
-
color: rgb(var(--mdui-color-on-primary));
|
|
39
|
-
background-color: rgb(var(--mdui-color-primary));
|
|
40
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-on-primary);
|
|
41
|
-
}
|
|
42
|
-
:host([variant='tonal']) {
|
|
43
|
-
color: rgb(var(--mdui-color-on-secondary-container));
|
|
44
|
-
background-color: rgb(var(--mdui-color-secondary-container));
|
|
45
|
-
--mdui-comp-ripple-state-layer-color: var(
|
|
2
|
+
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-full);position:relative;display:inline-block;overflow:hidden;text-align:center;border-radius:var(--shape-corner);cursor:pointer;-webkit-tap-highlight-color:transparent;transition:box-shadow var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);min-width:3rem;height:2.5rem;color:rgb(var(--mdui-color-primary));font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height)}.button{width:100%;padding:0 1rem}:host([full-width]){display:block}:host([variant=elevated]){box-shadow:var(--mdui-elevation-level1);background-color:rgb(var(--mdui-color-surface-container-low));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=filled]){color:rgb(var(--mdui-color-on-primary));background-color:rgb(var(--mdui-color-primary));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-primary)}:host([variant=tonal]){color:rgb(var(--mdui-color-on-secondary-container));background-color:rgb(var(--mdui-color-secondary-container));--mdui-comp-ripple-state-layer-color:var(
|
|
46
3
|
--mdui-color-on-secondary-container
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
:host([variant='outlined']) {
|
|
50
|
-
border: 0.0625rem solid rgb(var(--mdui-color-outline));
|
|
51
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-primary);
|
|
52
|
-
}
|
|
53
|
-
:host([variant='text']) {
|
|
54
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-primary);
|
|
55
|
-
}
|
|
56
|
-
:host([variant='outlined'][focus-visible]) {
|
|
57
|
-
border-color: rgb(var(--mdui-color-primary));
|
|
58
|
-
}
|
|
59
|
-
:host([variant='elevated'][hover]) {
|
|
60
|
-
box-shadow: var(--mdui-elevation-level2);
|
|
61
|
-
}
|
|
62
|
-
:host([variant='filled'][hover]),
|
|
63
|
-
:host([variant='tonal'][hover]) {
|
|
64
|
-
box-shadow: var(--mdui-elevation-level1);
|
|
65
|
-
}
|
|
66
|
-
:host([disabled]),
|
|
67
|
-
:host([loading]) {
|
|
68
|
-
cursor: default;
|
|
69
|
-
pointer-events: none;
|
|
70
|
-
}
|
|
71
|
-
:host([disabled]) {
|
|
72
|
-
color: rgba(var(--mdui-color-on-surface), 38%);
|
|
73
|
-
box-shadow: var(--mdui-elevation-level0);
|
|
74
|
-
}
|
|
75
|
-
:host([variant='elevated'][disabled]),
|
|
76
|
-
:host([variant='filled'][disabled]),
|
|
77
|
-
:host([variant='tonal'][disabled]) {
|
|
78
|
-
background-color: rgba(var(--mdui-color-on-surface), 12%);
|
|
79
|
-
}
|
|
80
|
-
:host([variant='outlined'][disabled]) {
|
|
81
|
-
border-color: rgba(var(--mdui-color-on-surface), 12%);
|
|
82
|
-
}
|
|
83
|
-
.label {
|
|
84
|
-
display: inline-flex;
|
|
85
|
-
padding-right: 0.5rem;
|
|
86
|
-
padding-left: 0.5rem;
|
|
87
|
-
}
|
|
88
|
-
.icon,
|
|
89
|
-
.end-icon {
|
|
90
|
-
display: inline-flex;
|
|
91
|
-
font-size: 1.28571429em;
|
|
92
|
-
}
|
|
93
|
-
.icon mdui-icon,
|
|
94
|
-
.end-icon mdui-icon,
|
|
95
|
-
::slotted([slot='icon']),
|
|
96
|
-
::slotted([slot='end-icon']) {
|
|
97
|
-
font-size: inherit;
|
|
98
|
-
}
|
|
99
|
-
mdui-circular-progress {
|
|
100
|
-
display: inline-flex;
|
|
101
|
-
width: 1.125rem;
|
|
102
|
-
height: 1.125rem;
|
|
103
|
-
}
|
|
104
|
-
:host([variant='filled']) mdui-circular-progress {
|
|
105
|
-
stroke: rgb(var(--mdui-color-on-primary));
|
|
106
|
-
}
|
|
107
|
-
:host([variant='tonal']) mdui-circular-progress {
|
|
108
|
-
stroke: rgb(var(--mdui-color-on-secondary-container));
|
|
109
|
-
}
|
|
110
|
-
:host([disabled]) mdui-circular-progress {
|
|
111
|
-
stroke: rgba(var(--mdui-color-on-surface), 38%);
|
|
112
|
-
}
|
|
113
|
-
`;
|
|
4
|
+
)}:host([variant=outlined]){border:.0625rem solid rgb(var(--mdui-color-outline));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=text]){--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=outlined][focus-visible]){border-color:rgb(var(--mdui-color-primary))}:host([variant=elevated][hover]){box-shadow:var(--mdui-elevation-level2)}:host([variant=filled][hover]),:host([variant=tonal][hover]){box-shadow:var(--mdui-elevation-level1)}:host([disabled]),:host([loading]){cursor:default;pointer-events:none}:host([disabled]){color:rgba(var(--mdui-color-on-surface),38%);box-shadow:var(--mdui-elevation-level0)}:host([variant=elevated][disabled]),:host([variant=filled][disabled]),:host([variant=tonal][disabled]){background-color:rgba(var(--mdui-color-on-surface),12%)}:host([variant=outlined][disabled]){border-color:rgba(var(--mdui-color-on-surface),12%)}.label{display:inline-flex;padding-right:.5rem;padding-left:.5rem}.end-icon,.icon{display:inline-flex;font-size:1.28571429em}.end-icon mdui-icon,.icon mdui-icon,::slotted([slot=end-icon]),::slotted([slot=icon]){font-size:inherit}mdui-circular-progress{display:inline-flex;width:1.125rem;height:1.125rem}:host([variant=filled]) mdui-circular-progress{stroke:rgb(var(--mdui-color-on-primary))}:host([variant=tonal]) mdui-circular-progress{stroke:rgb(var(--mdui-color-on-secondary-container))}:host([disabled]) mdui-circular-progress{stroke:rgba(var(--mdui-color-on-surface),38%)}`;
|
|
@@ -70,45 +70,28 @@ let ButtonIcon = class ButtonIcon extends ButtonBase {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
render() {
|
|
73
|
-
return html `<mdui-ripple
|
|
74
|
-
${ref(this.rippleRef)}
|
|
75
|
-
.noRipple=${this.noRipple}
|
|
76
|
-
></mdui-ripple>
|
|
77
|
-
${this.isButton()
|
|
73
|
+
return html `<mdui-ripple ${ref(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()
|
|
78
74
|
? this.renderButton({
|
|
79
75
|
className: 'button',
|
|
80
76
|
part: 'button',
|
|
81
77
|
content: this.renderIcon(),
|
|
82
78
|
})
|
|
83
79
|
: this.disabled || this.loading
|
|
84
|
-
? html `<span part="button" class="button _a"
|
|
85
|
-
${this.renderIcon()}
|
|
86
|
-
</span>`
|
|
80
|
+
? html `<span part="button" class="button _a">${this.renderIcon()}</span>`
|
|
87
81
|
: this.renderAnchor({
|
|
88
82
|
className: 'button',
|
|
89
83
|
part: 'button',
|
|
90
84
|
content: this.renderIcon(),
|
|
91
|
-
})}
|
|
92
|
-
${this.renderLoading()}`;
|
|
85
|
+
})} ${this.renderLoading()}`;
|
|
93
86
|
}
|
|
94
87
|
renderIcon() {
|
|
95
88
|
const icon = () => this.hasSlotController.test('[default]')
|
|
96
89
|
? html `<slot></slot>`
|
|
97
90
|
: this.icon
|
|
98
|
-
? html `<mdui-icon
|
|
99
|
-
part="icon"
|
|
100
|
-
class="icon"
|
|
101
|
-
name=${this.icon}
|
|
102
|
-
></mdui-icon>`
|
|
91
|
+
? html `<mdui-icon part="icon" class="icon" name="${this.icon}"></mdui-icon>`
|
|
103
92
|
: nothingTemplate;
|
|
104
93
|
const selectedIcon = () => this.hasSlotController.test('selected-icon') || this.selectedIcon
|
|
105
|
-
? html `<slot
|
|
106
|
-
name="selected-icon"
|
|
107
|
-
part="selected-icon"
|
|
108
|
-
class="selected-icon"
|
|
109
|
-
>
|
|
110
|
-
<mdui-icon name=${this.selectedIcon}></mdui-icon>
|
|
111
|
-
</slot>`
|
|
94
|
+
? html `<slot name="selected-icon" part="selected-icon" class="selected-icon"><mdui-icon name="${this.selectedIcon}"></mdui-icon></slot>`
|
|
112
95
|
: icon();
|
|
113
96
|
return this.selected ? selectedIcon() : icon();
|
|
114
97
|
}
|
|
@@ -1,105 +1,4 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css
|
|
3
|
-
:host {
|
|
4
|
-
--shape-corner: var(--mdui-shape-corner-full);
|
|
5
|
-
position: relative;
|
|
6
|
-
display: inline-block;
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
text-align: center;
|
|
9
|
-
border-radius: var(--shape-corner);
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
-webkit-tap-highlight-color: transparent;
|
|
12
|
-
font-size: 1.5rem;
|
|
13
|
-
width: 2.5rem;
|
|
14
|
-
min-width: 2.5rem;
|
|
15
|
-
height: 2.5rem;
|
|
16
|
-
}
|
|
17
|
-
:host([variant='standard']) {
|
|
18
|
-
color: rgb(var(--mdui-color-on-surface-variant));
|
|
19
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-on-surface-variant);
|
|
20
|
-
}
|
|
21
|
-
:host([variant='filled']) {
|
|
22
|
-
color: rgb(var(--mdui-color-primary));
|
|
23
|
-
background-color: rgb(var(--mdui-color-surface-container-highest));
|
|
24
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-primary);
|
|
25
|
-
}
|
|
26
|
-
:host([variant='tonal']) {
|
|
27
|
-
color: rgb(var(--mdui-color-on-surface-variant));
|
|
28
|
-
background-color: rgb(var(--mdui-color-surface-container-highest));
|
|
29
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-on-surface-variant);
|
|
30
|
-
}
|
|
31
|
-
:host([variant='outlined']) {
|
|
32
|
-
border: 0.0625rem solid rgb(var(--mdui-color-outline));
|
|
33
|
-
color: rgb(var(--mdui-color-on-surface-variant));
|
|
34
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-on-surface-variant);
|
|
35
|
-
}
|
|
36
|
-
:host([variant='outlined'][pressed]) {
|
|
37
|
-
color: rgb(var(--mdui-color-on-surface));
|
|
38
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-on-surface);
|
|
39
|
-
}
|
|
40
|
-
:host([variant='standard'][selected]) {
|
|
41
|
-
color: rgb(var(--mdui-color-primary));
|
|
42
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-primary);
|
|
43
|
-
}
|
|
44
|
-
:host([variant='filled'][selected]),
|
|
45
|
-
:host([variant='filled']:not([selectable])) {
|
|
46
|
-
color: rgb(var(--mdui-color-on-primary));
|
|
47
|
-
background-color: rgb(var(--mdui-color-primary));
|
|
48
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-on-primary);
|
|
49
|
-
}
|
|
50
|
-
:host([variant='tonal'][selected]),
|
|
51
|
-
:host([variant='tonal']:not([selectable])) {
|
|
52
|
-
color: rgb(var(--mdui-color-on-secondary-container));
|
|
53
|
-
background-color: rgb(var(--mdui-color-secondary-container));
|
|
54
|
-
--mdui-comp-ripple-state-layer-color: var(
|
|
2
|
+
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-full);position:relative;display:inline-block;overflow:hidden;text-align:center;border-radius:var(--shape-corner);cursor:pointer;-webkit-tap-highlight-color:transparent;font-size:1.5rem;width:2.5rem;min-width:2.5rem;height:2.5rem}:host([variant=standard]){color:rgb(var(--mdui-color-on-surface-variant));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}:host([variant=filled]){color:rgb(var(--mdui-color-primary));background-color:rgb(var(--mdui-color-surface-container-highest));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=tonal]){color:rgb(var(--mdui-color-on-surface-variant));background-color:rgb(var(--mdui-color-surface-container-highest));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}:host([variant=outlined]){border:.0625rem solid rgb(var(--mdui-color-outline));color:rgb(var(--mdui-color-on-surface-variant));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}:host([variant=outlined][pressed]){color:rgb(var(--mdui-color-on-surface));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([variant=standard][selected]){color:rgb(var(--mdui-color-primary));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=filled]:not([selectable])),:host([variant=filled][selected]){color:rgb(var(--mdui-color-on-primary));background-color:rgb(var(--mdui-color-primary));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-primary)}:host([variant=tonal]:not([selectable])),:host([variant=tonal][selected]){color:rgb(var(--mdui-color-on-secondary-container));background-color:rgb(var(--mdui-color-secondary-container));--mdui-comp-ripple-state-layer-color:var(
|
|
55
3
|
--mdui-color-on-secondary-container
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
:host([variant='outlined'][selected]) {
|
|
59
|
-
border: none;
|
|
60
|
-
color: rgb(var(--mdui-color-inverse-on-surface));
|
|
61
|
-
background-color: rgb(var(--mdui-color-inverse-surface));
|
|
62
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-inverse-on-surface);
|
|
63
|
-
}
|
|
64
|
-
:host([variant='filled'][disabled]),
|
|
65
|
-
:host([variant='tonal'][disabled]),
|
|
66
|
-
:host([variant='outlined'][disabled]) {
|
|
67
|
-
background-color: rgba(var(--mdui-color-on-surface), 0.12);
|
|
68
|
-
border-color: rgba(var(--mdui-color-on-surface), 0.12);
|
|
69
|
-
}
|
|
70
|
-
:host([disabled]),
|
|
71
|
-
:host([loading]) {
|
|
72
|
-
cursor: default;
|
|
73
|
-
pointer-events: none;
|
|
74
|
-
}
|
|
75
|
-
:host([disabled]) {
|
|
76
|
-
color: rgba(var(--mdui-color-on-surface), 0.38) !important;
|
|
77
|
-
}
|
|
78
|
-
:host([loading]) mdui-ripple,
|
|
79
|
-
:host([loading]) .button {
|
|
80
|
-
opacity: 0;
|
|
81
|
-
}
|
|
82
|
-
.button {
|
|
83
|
-
float: left;
|
|
84
|
-
width: 100%;
|
|
85
|
-
}
|
|
86
|
-
.icon,
|
|
87
|
-
.selected-icon mdui-icon,
|
|
88
|
-
::slotted(*) {
|
|
89
|
-
font-size: inherit;
|
|
90
|
-
}
|
|
91
|
-
mdui-circular-progress {
|
|
92
|
-
display: flex;
|
|
93
|
-
position: absolute;
|
|
94
|
-
top: calc(50% - 1.5rem / 2);
|
|
95
|
-
left: calc(50% - 1.5rem / 2);
|
|
96
|
-
width: 1.5rem;
|
|
97
|
-
height: 1.5rem;
|
|
98
|
-
}
|
|
99
|
-
:host([variant='filled']:not([disabled])) mdui-circular-progress {
|
|
100
|
-
stroke: rgb(var(--mdui-color-on-primary));
|
|
101
|
-
}
|
|
102
|
-
:host([disabled]) mdui-circular-progress {
|
|
103
|
-
stroke: rgba(var(--mdui-color-on-surface), 38%);
|
|
104
|
-
}
|
|
105
|
-
`;
|
|
4
|
+
)}:host([variant=outlined][selected]){border:none;color:rgb(var(--mdui-color-inverse-on-surface));background-color:rgb(var(--mdui-color-inverse-surface));--mdui-comp-ripple-state-layer-color:var(--mdui-color-inverse-on-surface)}:host([variant=filled][disabled]),:host([variant=outlined][disabled]),:host([variant=tonal][disabled]){background-color:rgba(var(--mdui-color-on-surface),.12);border-color:rgba(var(--mdui-color-on-surface),.12)}:host([disabled]),:host([loading]){cursor:default;pointer-events:none}:host([disabled]){color:rgba(var(--mdui-color-on-surface),.38)!important}:host([loading]) .button,:host([loading]) mdui-ripple{opacity:0}.button{float:left;width:100%}.icon,.selected-icon mdui-icon,::slotted(*){font-size:inherit}mdui-circular-progress{display:flex;position:absolute;top:calc(50% - 1.5rem / 2);left:calc(50% - 1.5rem / 2);width:1.5rem;height:1.5rem}:host([variant=filled]:not([disabled])) mdui-circular-progress{stroke:rgb(var(--mdui-color-on-primary))}:host([disabled]) mdui-circular-progress{stroke:rgba(var(--mdui-color-on-surface),38%)}`;
|
package/components/card/index.js
CHANGED
|
@@ -59,11 +59,7 @@ let Card = class Card extends AnchorMixin(RippleMixin(FocusableMixin(MduiElement
|
|
|
59
59
|
return this.rippleDisabled;
|
|
60
60
|
}
|
|
61
61
|
render() {
|
|
62
|
-
return html `<mdui-ripple
|
|
63
|
-
${ref(this.rippleRef)}
|
|
64
|
-
.noRipple=${this.noRipple}
|
|
65
|
-
></mdui-ripple
|
|
66
|
-
>${this.href && !this.disabled
|
|
62
|
+
return html `<mdui-ripple ${ref(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.href && !this.disabled
|
|
67
63
|
? this.renderAnchor({
|
|
68
64
|
className: 'link',
|
|
69
65
|
content: html `<slot></slot>`,
|
package/components/card/style.js
CHANGED
|
@@ -1,73 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css
|
|
3
|
-
/**
|
|
4
|
-
* mdui-card 组件。默认为 variant="elevated"
|
|
5
|
-
*/
|
|
6
|
-
:host {
|
|
7
|
-
--shape-corner: var(--mdui-shape-corner-medium);
|
|
8
|
-
position: relative;
|
|
9
|
-
display: inline-block;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
border-radius: var(--shape-corner);
|
|
12
|
-
-webkit-tap-highlight-color: transparent;
|
|
13
|
-
transition: box-shadow var(--mdui-motion-duration-short4)
|
|
14
|
-
var(--mdui-motion-easing-linear);
|
|
15
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-on-surface);
|
|
16
|
-
}
|
|
17
|
-
:host([clickable]) {
|
|
18
|
-
cursor: pointer;
|
|
19
|
-
}
|
|
20
|
-
:host([variant='elevated']) {
|
|
21
|
-
background-color: rgb(var(--mdui-color-surface-container-low));
|
|
22
|
-
box-shadow: var(--mdui-elevation-level1);
|
|
23
|
-
}
|
|
24
|
-
:host([variant='filled']) {
|
|
25
|
-
background-color: rgb(var(--mdui-color-surface-container-highest));
|
|
26
|
-
}
|
|
27
|
-
:host([variant='outlined']) {
|
|
28
|
-
background-color: rgb(var(--mdui-color-surface));
|
|
29
|
-
border: 0.0625rem solid rgb(var(--mdui-color-outline));
|
|
30
|
-
}
|
|
31
|
-
:host([variant='elevated'][hover]) {
|
|
32
|
-
box-shadow: var(--mdui-elevation-level2);
|
|
33
|
-
}
|
|
34
|
-
:host([variant='filled'][hover]),
|
|
35
|
-
:host([variant='outlined'][hover]) {
|
|
36
|
-
box-shadow: var(--mdui-elevation-level1);
|
|
37
|
-
}
|
|
38
|
-
:host([variant='elevated'][dragged]),
|
|
39
|
-
:host([variant='filled'][dragged]),
|
|
40
|
-
:host([variant='outlined'][dragged]) {
|
|
41
|
-
box-shadow: var(--mdui-elevation-level3);
|
|
42
|
-
}
|
|
43
|
-
:host([disabled]) {
|
|
44
|
-
opacity: 0.38;
|
|
45
|
-
cursor: default;
|
|
46
|
-
-webkit-user-select: none;
|
|
47
|
-
user-select: none;
|
|
48
|
-
}
|
|
49
|
-
:host([variant='elevated'][disabled]) {
|
|
50
|
-
background-color: rgb(var(--mdui-color-surface-variant));
|
|
51
|
-
box-shadow: var(--mdui-elevation-level0);
|
|
52
|
-
}
|
|
53
|
-
:host([variant='filled'][disabled]) {
|
|
54
|
-
background-color: rgb(var(--mdui-color-surface));
|
|
55
|
-
box-shadow: var(--mdui-elevation-level1);
|
|
56
|
-
}
|
|
57
|
-
:host([variant='outlined'][disabled]) {
|
|
58
|
-
box-shadow: var(--mdui-elevation-level0);
|
|
59
|
-
border-color: rgba(var(--mdui-color-outline), 0.32);
|
|
60
|
-
}
|
|
61
|
-
.link {
|
|
62
|
-
position: relative;
|
|
63
|
-
display: inline-block;
|
|
64
|
-
width: 100%;
|
|
65
|
-
height: 100%;
|
|
66
|
-
color: inherit;
|
|
67
|
-
font-size: inherit;
|
|
68
|
-
letter-spacing: inherit;
|
|
69
|
-
text-decoration: none;
|
|
70
|
-
touch-action: manipulation;
|
|
71
|
-
-webkit-user-drag: none;
|
|
72
|
-
}
|
|
73
|
-
`;
|
|
2
|
+
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-medium);position:relative;display:inline-block;overflow:hidden;border-radius:var(--shape-corner);-webkit-tap-highlight-color:transparent;transition:box-shadow var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([clickable]){cursor:pointer}:host([variant=elevated]){background-color:rgb(var(--mdui-color-surface-container-low));box-shadow:var(--mdui-elevation-level1)}:host([variant=filled]){background-color:rgb(var(--mdui-color-surface-container-highest))}:host([variant=outlined]){background-color:rgb(var(--mdui-color-surface));border:.0625rem solid rgb(var(--mdui-color-outline))}:host([variant=elevated][hover]){box-shadow:var(--mdui-elevation-level2)}:host([variant=filled][hover]),:host([variant=outlined][hover]){box-shadow:var(--mdui-elevation-level1)}:host([variant=elevated][dragged]),:host([variant=filled][dragged]),:host([variant=outlined][dragged]){box-shadow:var(--mdui-elevation-level3)}:host([disabled]){opacity:.38;cursor:default;-webkit-user-select:none;user-select:none}:host([variant=elevated][disabled]){background-color:rgb(var(--mdui-color-surface-variant));box-shadow:var(--mdui-elevation-level0)}:host([variant=filled][disabled]){background-color:rgb(var(--mdui-color-surface));box-shadow:var(--mdui-elevation-level1)}:host([variant=outlined][disabled]){box-shadow:var(--mdui-elevation-level0);border-color:rgba(var(--mdui-color-outline),.32)}.link{position:relative;display:inline-block;width:100%;height:100%;color:inherit;font-size:inherit;letter-spacing:inherit;text-decoration:none;touch-action:manipulation;-webkit-user-drag:none}`;
|