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
|
@@ -1,133 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const navigationBarItemStyle = css
|
|
3
|
-
:host {
|
|
4
|
-
--shape-corner-indicator: var(--mdui-shape-corner-full);
|
|
5
|
-
position: relative;
|
|
6
|
-
z-index: 0;
|
|
7
|
-
flex: 1;
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
min-width: 3rem;
|
|
10
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-on-surface-variant);
|
|
11
|
-
}
|
|
12
|
-
.container {
|
|
13
|
-
display: flex;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
align-items: center;
|
|
16
|
-
justify-content: center;
|
|
17
|
-
height: 100%;
|
|
18
|
-
text-decoration: none;
|
|
19
|
-
cursor: pointer;
|
|
20
|
-
-webkit-user-select: none;
|
|
21
|
-
user-select: none;
|
|
22
|
-
-webkit-tap-highlight-color: transparent;
|
|
23
|
-
padding-top: 0.75rem;
|
|
24
|
-
padding-bottom: 0.75rem;
|
|
25
|
-
}
|
|
26
|
-
.container:not(.initial) {
|
|
27
|
-
transition: padding var(--mdui-motion-duration-short4)
|
|
28
|
-
var(--mdui-motion-easing-standard);
|
|
29
|
-
}
|
|
30
|
-
mdui-ripple {
|
|
31
|
-
z-index: 1;
|
|
32
|
-
left: 50%;
|
|
33
|
-
transform: translateX(-50%);
|
|
34
|
-
width: 4rem;
|
|
35
|
-
height: 2rem;
|
|
36
|
-
margin-top: 0.75rem;
|
|
37
|
-
border-radius: var(--mdui-shape-corner-full);
|
|
38
|
-
}
|
|
39
|
-
mdui-ripple:not(.initial) {
|
|
40
|
-
transition: margin-top var(--mdui-motion-duration-short4)
|
|
41
|
-
var(--mdui-motion-easing-standard);
|
|
42
|
-
}
|
|
43
|
-
.indicator {
|
|
44
|
-
position: relative;
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
justify-content: center;
|
|
48
|
-
background-color: transparent;
|
|
49
|
-
border-radius: var(--shape-corner-indicator);
|
|
50
|
-
height: 2rem;
|
|
51
|
-
width: 2rem;
|
|
52
|
-
}
|
|
53
|
-
:not(.initial) .indicator {
|
|
54
|
-
transition:
|
|
55
|
-
background-color var(--mdui-motion-duration-short1)
|
|
56
|
-
var(--mdui-motion-easing-standard),
|
|
57
|
-
width var(--mdui-motion-duration-short4)
|
|
58
|
-
var(--mdui-motion-easing-standard);
|
|
59
|
-
}
|
|
60
|
-
::slotted([slot='badge']) {
|
|
61
|
-
position: absolute;
|
|
62
|
-
transform: translate(50%, -50%);
|
|
63
|
-
}
|
|
64
|
-
::slotted([slot='badge'][variant='small']) {
|
|
65
|
-
transform: translate(0.5625rem, -0.5625rem);
|
|
66
|
-
}
|
|
67
|
-
.icon,
|
|
68
|
-
.active-icon {
|
|
69
|
-
color: rgb(var(--mdui-color-on-surface-variant));
|
|
70
|
-
font-size: 1.5rem;
|
|
71
|
-
}
|
|
72
|
-
.icon mdui-icon,
|
|
73
|
-
.active-icon mdui-icon,
|
|
74
|
-
::slotted([slot='icon']),
|
|
75
|
-
::slotted([slot='active']) {
|
|
76
|
-
font-size: inherit;
|
|
77
|
-
}
|
|
78
|
-
.icon {
|
|
79
|
-
display: flex;
|
|
80
|
-
}
|
|
81
|
-
.active-icon {
|
|
82
|
-
display: none;
|
|
83
|
-
}
|
|
84
|
-
.label {
|
|
85
|
-
display: flex;
|
|
86
|
-
align-items: center;
|
|
87
|
-
height: 1rem;
|
|
88
|
-
color: rgb(var(--mdui-color-on-surface-variant));
|
|
89
|
-
margin-top: 0.25rem;
|
|
90
|
-
margin-bottom: 0.25rem;
|
|
91
|
-
font-size: var(--mdui-typescale-label-medium-size);
|
|
92
|
-
font-weight: var(--mdui-typescale-label-medium-weight);
|
|
93
|
-
letter-spacing: var(--mdui-typescale-label-medium-tracking);
|
|
94
|
-
line-height: var(--mdui-typescale-label-medium-line-height);
|
|
95
|
-
}
|
|
96
|
-
:not(.initial) .label {
|
|
97
|
-
transition: opacity var(--mdui-motion-duration-short4)
|
|
98
|
-
var(--mdui-motion-easing-linear);
|
|
99
|
-
}
|
|
100
|
-
mdui-ripple.label-visibility-unlabeled,
|
|
101
|
-
:host(:not([active])) mdui-ripple.label-visibility-selected {
|
|
102
|
-
margin-top: 1.5rem;
|
|
103
|
-
}
|
|
104
|
-
.container.label-visibility-unlabeled,
|
|
105
|
-
:host(:not([active])) .container.label-visibility-selected {
|
|
106
|
-
padding-top: 1.5rem;
|
|
107
|
-
padding-bottom: 0rem;
|
|
108
|
-
}
|
|
109
|
-
.container.label-visibility-unlabeled .label,
|
|
110
|
-
:host(:not([active])) .container.label-visibility-selected .label {
|
|
111
|
-
opacity: 0;
|
|
112
|
-
}
|
|
113
|
-
:host([active]) {
|
|
114
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-on-surface);
|
|
115
|
-
}
|
|
116
|
-
:host([active]) .indicator {
|
|
117
|
-
width: 4rem;
|
|
118
|
-
background-color: rgb(var(--mdui-color-secondary-container));
|
|
119
|
-
}
|
|
120
|
-
:host([active]) .icon,
|
|
121
|
-
:host([active]) .active-icon {
|
|
122
|
-
color: rgb(var(--mdui-color-on-secondary-container));
|
|
123
|
-
}
|
|
124
|
-
:host([active]) .has-active-icon .active-icon {
|
|
125
|
-
display: flex;
|
|
126
|
-
}
|
|
127
|
-
:host([active]) .has-active-icon .icon {
|
|
128
|
-
display: none;
|
|
129
|
-
}
|
|
130
|
-
:host([active]) .label {
|
|
131
|
-
color: rgb(var(--mdui-color-on-surface));
|
|
132
|
-
}
|
|
133
|
-
`;
|
|
2
|
+
export const navigationBarItemStyle = css `:host{--shape-corner-indicator:var(--mdui-shape-corner-full);position:relative;z-index:0;flex:1;overflow:hidden;min-width:3rem;--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}.container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;text-decoration:none;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;padding-top:.75rem;padding-bottom:.75rem}.container:not(.initial){transition:padding var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}mdui-ripple{z-index:1;left:50%;transform:translateX(-50%);width:4rem;height:2rem;margin-top:.75rem;border-radius:var(--mdui-shape-corner-full)}mdui-ripple:not(.initial){transition:margin-top var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}.indicator{position:relative;display:flex;align-items:center;justify-content:center;background-color:transparent;border-radius:var(--shape-corner-indicator);height:2rem;width:2rem}:not(.initial) .indicator{transition:background-color var(--mdui-motion-duration-short1) var(--mdui-motion-easing-standard),width var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}::slotted([slot=badge]){position:absolute;transform:translate(50%,-50%)}::slotted([slot=badge][variant=small]){transform:translate(.5625rem,-.5625rem)}.active-icon,.icon{color:rgb(var(--mdui-color-on-surface-variant));font-size:1.5rem}.active-icon mdui-icon,.icon mdui-icon,::slotted([slot=active]),::slotted([slot=icon]){font-size:inherit}.icon{display:flex}.active-icon{display:none}.label{display:flex;align-items:center;height:1rem;color:rgb(var(--mdui-color-on-surface-variant));margin-top:.25rem;margin-bottom:.25rem;font-size:var(--mdui-typescale-label-medium-size);font-weight:var(--mdui-typescale-label-medium-weight);letter-spacing:var(--mdui-typescale-label-medium-tracking);line-height:var(--mdui-typescale-label-medium-line-height)}:not(.initial) .label{transition:opacity var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear)}:host(:not([active])) mdui-ripple.label-visibility-selected,mdui-ripple.label-visibility-unlabeled{margin-top:1.5rem}.container.label-visibility-unlabeled,:host(:not([active])) .container.label-visibility-selected{padding-top:1.5rem;padding-bottom:0}.container.label-visibility-unlabeled .label,:host(:not([active])) .container.label-visibility-selected .label{opacity:0}:host([active]){--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([active]) .indicator{width:4rem;background-color:rgb(var(--mdui-color-secondary-container))}:host([active]) .active-icon,:host([active]) .icon{color:rgb(var(--mdui-color-on-secondary-container))}:host([active]) .has-active-icon .active-icon{display:flex}:host([active]) .has-active-icon .icon{display:none}:host([active]) .label{color:rgb(var(--mdui-color-on-surface))}`;
|
|
@@ -86,36 +86,20 @@ let NavigationBarItem = class NavigationBarItem extends AnchorMixin(RippleMixin(
|
|
|
86
86
|
},
|
|
87
87
|
labelVisibilityClassName,
|
|
88
88
|
]);
|
|
89
|
-
return html `<mdui-ripple
|
|
90
|
-
.noRipple=${!this.active || this.noRipple}
|
|
91
|
-
class=${labelVisibilityClassName}
|
|
92
|
-
${ref(this.rippleRef)}
|
|
93
|
-
></mdui-ripple>
|
|
94
|
-
${this.href
|
|
89
|
+
return html `<mdui-ripple .noRipple="${!this.active || this.noRipple}" class="${labelVisibilityClassName}" ${ref(this.rippleRef)}></mdui-ripple>${this.href
|
|
95
90
|
? this.renderAnchor({
|
|
96
91
|
part: 'container',
|
|
97
92
|
className,
|
|
98
93
|
content: this.renderInner(),
|
|
99
94
|
})
|
|
100
|
-
: html `<div part="container" class
|
|
101
|
-
${this.renderInner()}
|
|
102
|
-
</div>`} `;
|
|
95
|
+
: html `<div part="container" class="${className}">${this.renderInner()}</div>`}`;
|
|
103
96
|
}
|
|
104
97
|
renderInner() {
|
|
105
|
-
return html `<div part="indicator" class="indicator"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
: nothingTemplate}
|
|
111
|
-
</slot>
|
|
112
|
-
<slot name="icon" part="icon" class="icon">
|
|
113
|
-
${this.icon
|
|
114
|
-
? html `<mdui-icon name=${this.icon}></mdui-icon>`
|
|
115
|
-
: nothingTemplate}
|
|
116
|
-
</slot>
|
|
117
|
-
</div>
|
|
118
|
-
<slot part="label" class="label"></slot>`;
|
|
98
|
+
return html `<div part="indicator" class="indicator"><slot name="badge" part="badge" class="badge"></slot><slot name="active-icon" part="active-icon" class="active-icon">${this.activeIcon
|
|
99
|
+
? html `<mdui-icon name="${this.activeIcon}"></mdui-icon>`
|
|
100
|
+
: nothingTemplate}</slot><slot name="icon" part="icon" class="icon">${this.icon
|
|
101
|
+
? html `<mdui-icon name="${this.icon}"></mdui-icon>`
|
|
102
|
+
: nothingTemplate}</slot></div><slot part="label" class="label"></slot>`;
|
|
119
103
|
}
|
|
120
104
|
};
|
|
121
105
|
NavigationBarItem.styles = [
|
|
@@ -1,29 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const navigationBarStyle = 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
|
-
overflow: hidden;
|
|
13
|
-
border-radius: var(--shape-corner) var(--shape-corner) 0 0;
|
|
14
|
-
z-index: var(--z-index);
|
|
15
|
-
transition-property: transform;
|
|
16
|
-
transition-duration: var(--mdui-motion-duration-long2);
|
|
17
|
-
transition-timing-function: var(--mdui-motion-easing-emphasized);
|
|
18
|
-
height: 5rem;
|
|
19
|
-
background-color: rgb(var(--mdui-color-surface));
|
|
20
|
-
box-shadow: var(--mdui-elevation-level2);
|
|
21
|
-
}
|
|
22
|
-
:host([scroll-target]:not([scroll-target=''])) {
|
|
23
|
-
position: absolute;
|
|
24
|
-
}
|
|
25
|
-
:host([hide]) {
|
|
26
|
-
transform: translateY(5.625rem);
|
|
27
|
-
transition-duration: var(--mdui-motion-duration-short4);
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
2
|
+
export const navigationBarStyle = 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;overflow:hidden;border-radius:var(--shape-corner) var(--shape-corner) 0 0;z-index:var(--z-index);transition-property:transform;transition-duration:var(--mdui-motion-duration-long2);transition-timing-function:var(--mdui-motion-easing-emphasized);height:5rem;background-color:rgb(var(--mdui-color-surface));box-shadow:var(--mdui-elevation-level2)}:host([scroll-target]:not([scroll-target=''])){position:absolute}:host([hide]){transform:translateY(5.625rem);transition-duration:var(--mdui-motion-duration-short4)}`;
|
|
@@ -89,10 +89,7 @@ let NavigationBar = class NavigationBar extends ScrollBehaviorMixin(LayoutItemBa
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
render() {
|
|
92
|
-
return html `<slot
|
|
93
|
-
@slotchange=${this.onSlotChange}
|
|
94
|
-
@click=${this.onClick}
|
|
95
|
-
></slot>`;
|
|
92
|
+
return html `<slot @slotchange="${this.onSlotChange}" @click="${this.onClick}"></slot>`;
|
|
96
93
|
}
|
|
97
94
|
/**
|
|
98
95
|
* 滚动行为
|
|
@@ -310,18 +310,7 @@ let NavigationDrawer = class NavigationDrawer extends LayoutItemBase {
|
|
|
310
310
|
});
|
|
311
311
|
}
|
|
312
312
|
render() {
|
|
313
|
-
return html `${when(this.isModal, () => html `<div
|
|
314
|
-
${ref(this.overlayRef)}
|
|
315
|
-
part="overlay"
|
|
316
|
-
class="overlay"
|
|
317
|
-
@click=${this.onOverlayClick}
|
|
318
|
-
></div>`)}
|
|
319
|
-
<slot
|
|
320
|
-
${ref(this.panelRef)}
|
|
321
|
-
part="panel"
|
|
322
|
-
class="panel"
|
|
323
|
-
tabindex="0"
|
|
324
|
-
></slot>`;
|
|
313
|
+
return html `${when(this.isModal, () => html `<div ${ref(this.overlayRef)} part="overlay" class="overlay" @click="${this.onOverlayClick}"></div>`)}<slot ${ref(this.panelRef)} part="panel" class="panel" tabindex="0"></slot>`;
|
|
325
314
|
}
|
|
326
315
|
onOverlayClick() {
|
|
327
316
|
this.emit('overlay-click');
|
|
@@ -1,67 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css
|
|
3
|
-
:host {
|
|
4
|
-
--shape-corner: var(--mdui-shape-corner-large);
|
|
5
|
-
--z-index: 2200;
|
|
6
|
-
display: none;
|
|
7
|
-
position: fixed;
|
|
8
|
-
top: 0;
|
|
9
|
-
bottom: 0;
|
|
10
|
-
left: 0;
|
|
11
|
-
z-index: 1;
|
|
12
|
-
width: 22.5rem;
|
|
13
|
-
}
|
|
14
|
-
:host([placement='right']) {
|
|
15
|
-
left: initial;
|
|
16
|
-
right: 0;
|
|
17
|
-
}
|
|
18
|
-
:host([modal]),
|
|
19
|
-
:host([mobile]) {
|
|
20
|
-
top: 0 !important;
|
|
21
|
-
right: 0;
|
|
22
|
-
bottom: 0 !important;
|
|
23
|
-
width: initial;
|
|
24
|
-
z-index: var(--z-index);
|
|
25
|
-
}
|
|
26
|
-
:host([placement='right'][modal]),
|
|
27
|
-
:host([placement='right'][mobile]) {
|
|
28
|
-
left: 0;
|
|
29
|
-
}
|
|
30
|
-
:host([contained]) {
|
|
31
|
-
position: absolute;
|
|
32
|
-
}
|
|
33
|
-
.overlay {
|
|
34
|
-
position: absolute;
|
|
35
|
-
inset: 0;
|
|
36
|
-
z-index: inherit;
|
|
37
|
-
background-color: rgba(var(--mdui-color-scrim), 0.4);
|
|
38
|
-
}
|
|
39
|
-
.panel {
|
|
40
|
-
display: block;
|
|
41
|
-
position: absolute;
|
|
42
|
-
top: 0;
|
|
43
|
-
bottom: 0;
|
|
44
|
-
left: 0;
|
|
45
|
-
width: 100%;
|
|
46
|
-
overflow: auto;
|
|
47
|
-
z-index: inherit;
|
|
48
|
-
background-color: rgb(var(--mdui-color-surface));
|
|
49
|
-
box-shadow: var(--mdui-elevation-level0);
|
|
50
|
-
}
|
|
51
|
-
:host([modal]) .panel,
|
|
52
|
-
:host([mobile]) .panel {
|
|
53
|
-
border-radius: 0 var(--shape-corner) var(--shape-corner) 0;
|
|
54
|
-
max-width: 80%;
|
|
55
|
-
width: 22.5rem;
|
|
56
|
-
background-color: rgb(var(--mdui-color-surface-container-low));
|
|
57
|
-
box-shadow: var(--mdui-elevation-level1);
|
|
58
|
-
}
|
|
59
|
-
:host([placement='right']) .panel {
|
|
60
|
-
left: initial;
|
|
61
|
-
right: 0;
|
|
62
|
-
}
|
|
63
|
-
:host([placement='right'][modal]) .panel,
|
|
64
|
-
:host([placement='right'][mobile]) .panel {
|
|
65
|
-
border-radius: var(--shape-corner) 0 0 var(--shape-corner);
|
|
66
|
-
}
|
|
67
|
-
`;
|
|
2
|
+
export const style = css `:host{--shape-corner:var(--mdui-shape-corner-large);--z-index:2200;display:none;position:fixed;top:0;bottom:0;left:0;z-index:1;width:22.5rem}:host([placement=right]){left:initial;right:0}:host([mobile]),:host([modal]){top:0!important;right:0;bottom:0!important;width:initial;z-index:var(--z-index)}:host([placement=right][mobile]),:host([placement=right][modal]){left:0}:host([contained]){position:absolute}.overlay{position:absolute;inset:0;z-index:inherit;background-color:rgba(var(--mdui-color-scrim),.4)}.panel{display:block;position:absolute;top:0;bottom:0;left:0;width:100%;overflow:auto;z-index:inherit;background-color:rgb(var(--mdui-color-surface));box-shadow:var(--mdui-elevation-level0)}:host([mobile]) .panel,:host([modal]) .panel{border-radius:0 var(--shape-corner) var(--shape-corner) 0;max-width:80%;width:22.5rem;background-color:rgb(var(--mdui-color-surface-container-low));box-shadow:var(--mdui-elevation-level1)}:host([placement=right]) .panel{left:initial;right:0}:host([placement=right][mobile]) .panel,:host([placement=right][modal]) .panel{border-radius:var(--shape-corner) 0 0 var(--shape-corner)}`;
|
|
@@ -1,123 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const navigationRailItemStyle = css
|
|
3
|
-
:host {
|
|
4
|
-
--shape-corner-indicator: var(--mdui-shape-corner-full);
|
|
5
|
-
position: relative;
|
|
6
|
-
z-index: 0;
|
|
7
|
-
width: 100%;
|
|
8
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-on-surface-variant);
|
|
9
|
-
}
|
|
10
|
-
.container {
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
align-items: center;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
text-decoration: none;
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
-webkit-user-select: none;
|
|
18
|
-
user-select: none;
|
|
19
|
-
-webkit-tap-highlight-color: transparent;
|
|
20
|
-
height: 3.5rem;
|
|
21
|
-
}
|
|
22
|
-
.container:not(.initial) {
|
|
23
|
-
transition: padding var(--mdui-motion-duration-short4)
|
|
24
|
-
var(--mdui-motion-easing-standard);
|
|
25
|
-
}
|
|
26
|
-
mdui-ripple {
|
|
27
|
-
z-index: 1;
|
|
28
|
-
width: 3.5rem;
|
|
29
|
-
height: 2rem;
|
|
30
|
-
border-radius: var(--mdui-shape-corner-full);
|
|
31
|
-
}
|
|
32
|
-
.container:not(.has-label) + mdui-ripple {
|
|
33
|
-
height: 3.5rem;
|
|
34
|
-
}
|
|
35
|
-
.indicator {
|
|
36
|
-
position: relative;
|
|
37
|
-
display: flex;
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
background-color: transparent;
|
|
41
|
-
border-radius: var(--shape-corner-indicator);
|
|
42
|
-
height: 2rem;
|
|
43
|
-
width: 2rem;
|
|
44
|
-
}
|
|
45
|
-
:not(.initial) .indicator {
|
|
46
|
-
transition:
|
|
47
|
-
background-color var(--mdui-motion-duration-short1)
|
|
48
|
-
var(--mdui-motion-easing-standard),
|
|
49
|
-
width var(--mdui-motion-duration-short4)
|
|
50
|
-
var(--mdui-motion-easing-standard),
|
|
51
|
-
height var(--mdui-motion-duration-short4)
|
|
52
|
-
var(--mdui-motion-easing-standard);
|
|
53
|
-
}
|
|
54
|
-
::slotted([slot='badge']) {
|
|
55
|
-
position: absolute;
|
|
56
|
-
transform: translate(50%, -50%);
|
|
57
|
-
}
|
|
58
|
-
.placement-right::slotted([slot='badge']) {
|
|
59
|
-
transform: translate(-50%, -50%);
|
|
60
|
-
}
|
|
61
|
-
::slotted([slot='badge'][variant='small']) {
|
|
62
|
-
transform: translate(0.5625rem, -0.5625rem);
|
|
63
|
-
}
|
|
64
|
-
.placement-right::slotted([slot='badge'][variant='small']) {
|
|
65
|
-
transform: translate(-0.5625rem, -0.5625rem);
|
|
66
|
-
}
|
|
67
|
-
.icon,
|
|
68
|
-
.active-icon {
|
|
69
|
-
color: rgb(var(--mdui-color-on-surface-variant));
|
|
70
|
-
font-size: 1.5rem;
|
|
71
|
-
}
|
|
72
|
-
.icon mdui-icon,
|
|
73
|
-
.active-icon mdui-icon,
|
|
74
|
-
::slotted([slot='icon']),
|
|
75
|
-
::slotted([slot='active-icon']) {
|
|
76
|
-
font-size: inherit;
|
|
77
|
-
}
|
|
78
|
-
.icon {
|
|
79
|
-
display: flex;
|
|
80
|
-
}
|
|
81
|
-
.active-icon {
|
|
82
|
-
display: none;
|
|
83
|
-
}
|
|
84
|
-
.label {
|
|
85
|
-
display: flex;
|
|
86
|
-
align-items: center;
|
|
87
|
-
height: 1rem;
|
|
88
|
-
color: rgb(var(--mdui-color-on-surface-variant));
|
|
89
|
-
margin-top: 0.25rem;
|
|
90
|
-
margin-bottom: 0.25rem;
|
|
91
|
-
font-size: var(--mdui-typescale-label-medium-size);
|
|
92
|
-
font-weight: var(--mdui-typescale-label-medium-weight);
|
|
93
|
-
letter-spacing: var(--mdui-typescale-label-medium-tracking);
|
|
94
|
-
line-height: var(--mdui-typescale-label-medium-line-height);
|
|
95
|
-
}
|
|
96
|
-
:not(.initial) .label {
|
|
97
|
-
transition: opacity var(--mdui-motion-duration-short4)
|
|
98
|
-
var(--mdui-motion-easing-linear);
|
|
99
|
-
}
|
|
100
|
-
:host([active]) {
|
|
101
|
-
--mdui-comp-ripple-state-layer-color: var(--mdui-color-on-surface);
|
|
102
|
-
}
|
|
103
|
-
:host([active]) .indicator {
|
|
104
|
-
width: 3.5rem;
|
|
105
|
-
background-color: rgb(var(--mdui-color-secondary-container));
|
|
106
|
-
}
|
|
107
|
-
:host([active]) :not(.has-label) .indicator {
|
|
108
|
-
height: 3.5rem;
|
|
109
|
-
}
|
|
110
|
-
:host([active]) .icon,
|
|
111
|
-
:host([active]) .active-icon {
|
|
112
|
-
color: rgb(var(--mdui-color-on-secondary-container));
|
|
113
|
-
}
|
|
114
|
-
:host([active]) .has-active-icon .active-icon {
|
|
115
|
-
display: flex;
|
|
116
|
-
}
|
|
117
|
-
:host([active]) .has-active-icon .icon {
|
|
118
|
-
display: none;
|
|
119
|
-
}
|
|
120
|
-
:host([active]) .label {
|
|
121
|
-
color: rgb(var(--mdui-color-on-surface));
|
|
122
|
-
}
|
|
123
|
-
`;
|
|
2
|
+
export const navigationRailItemStyle = css `:host{--shape-corner-indicator:var(--mdui-shape-corner-full);position:relative;z-index:0;width:100%;--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}.container{display:flex;flex-direction:column;align-items:center;justify-content:center;text-decoration:none;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;height:3.5rem}.container:not(.initial){transition:padding var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}mdui-ripple{z-index:1;width:3.5rem;height:2rem;border-radius:var(--mdui-shape-corner-full)}.container:not(.has-label)+mdui-ripple{height:3.5rem}.indicator{position:relative;display:flex;align-items:center;justify-content:center;background-color:transparent;border-radius:var(--shape-corner-indicator);height:2rem;width:2rem}:not(.initial) .indicator{transition:background-color var(--mdui-motion-duration-short1) var(--mdui-motion-easing-standard),width var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard),height var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}::slotted([slot=badge]){position:absolute;transform:translate(50%,-50%)}.placement-right::slotted([slot=badge]){transform:translate(-50%,-50%)}::slotted([slot=badge][variant=small]){transform:translate(.5625rem,-.5625rem)}.placement-right::slotted([slot=badge][variant=small]){transform:translate(-.5625rem,-.5625rem)}.active-icon,.icon{color:rgb(var(--mdui-color-on-surface-variant));font-size:1.5rem}.active-icon mdui-icon,.icon mdui-icon,::slotted([slot=active-icon]),::slotted([slot=icon]){font-size:inherit}.icon{display:flex}.active-icon{display:none}.label{display:flex;align-items:center;height:1rem;color:rgb(var(--mdui-color-on-surface-variant));margin-top:.25rem;margin-bottom:.25rem;font-size:var(--mdui-typescale-label-medium-size);font-weight:var(--mdui-typescale-label-medium-weight);letter-spacing:var(--mdui-typescale-label-medium-tracking);line-height:var(--mdui-typescale-label-medium-line-height)}:not(.initial) .label{transition:opacity var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear)}:host([active]){--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([active]) .indicator{width:3.5rem;background-color:rgb(var(--mdui-color-secondary-container))}:host([active]) :not(.has-label) .indicator{height:3.5rem}:host([active]) .active-icon,:host([active]) .icon{color:rgb(var(--mdui-color-on-secondary-container))}:host([active]) .has-active-icon .active-icon{display:flex}:host([active]) .has-active-icon .icon{display:none}:host([active]) .label{color:rgb(var(--mdui-color-on-surface))}`;
|
|
@@ -91,36 +91,17 @@ let NavigationRailItem = class NavigationRailItem extends AnchorMixin(RippleMixi
|
|
|
91
91
|
className,
|
|
92
92
|
content: this.renderInner(hasDefaultSlot),
|
|
93
93
|
})
|
|
94
|
-
: html `<div part="container" class
|
|
95
|
-
${this.renderInner(hasDefaultSlot)}
|
|
96
|
-
</div>`}
|
|
97
|
-
<mdui-ripple
|
|
98
|
-
.noRipple=${!this.active || this.noRipple}
|
|
99
|
-
${ref(this.rippleRef)}
|
|
100
|
-
></mdui-ripple>`;
|
|
94
|
+
: html `<div part="container" class="${className}">${this.renderInner(hasDefaultSlot)}</div>`}<mdui-ripple .noRipple="${!this.active || this.noRipple}" ${ref(this.rippleRef)}></mdui-ripple>`;
|
|
101
95
|
}
|
|
102
96
|
renderInner(hasDefaultSlot) {
|
|
103
|
-
return html `<div part="indicator" class="indicator"
|
|
104
|
-
<slot
|
|
105
|
-
name="badge"
|
|
106
|
-
part="badge"
|
|
107
|
-
class=${classMap({
|
|
97
|
+
return html `<div part="indicator" class="indicator"><slot name="badge" part="badge" class="${classMap({
|
|
108
98
|
badge: true,
|
|
109
99
|
'placement-right': this.placement === 'right',
|
|
110
|
-
})}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
: nothingTemplate}
|
|
116
|
-
</slot>
|
|
117
|
-
<slot name="icon" part="icon" class="icon">
|
|
118
|
-
${this.icon
|
|
119
|
-
? html `<mdui-icon name=${this.icon}></mdui-icon>`
|
|
120
|
-
: nothingTemplate}
|
|
121
|
-
</slot>
|
|
122
|
-
</div>
|
|
123
|
-
${hasDefaultSlot
|
|
100
|
+
})}"></slot><slot name="active-icon" part="active-icon" class="active-icon">${this.activeIcon
|
|
101
|
+
? html `<mdui-icon name="${this.activeIcon}"></mdui-icon>`
|
|
102
|
+
: nothingTemplate}</slot><slot name="icon" part="icon" class="icon">${this.icon
|
|
103
|
+
? html `<mdui-icon name="${this.icon}"></mdui-icon>`
|
|
104
|
+
: nothingTemplate}</slot></div>${hasDefaultSlot
|
|
124
105
|
? html `<slot part="label" class="label"></slot>`
|
|
125
106
|
: nothing}`;
|
|
126
107
|
}
|
|
@@ -1,80 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const navigationRailStyle = css
|
|
3
|
-
:host {
|
|
4
|
-
--shape-corner: var(--mdui-shape-corner-none);
|
|
5
|
-
--z-index: 2000;
|
|
6
|
-
position: fixed;
|
|
7
|
-
top: 0;
|
|
8
|
-
bottom: 0;
|
|
9
|
-
left: 0;
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
align-items: center;
|
|
13
|
-
border-radius: 0 var(--shape-corner) var(--shape-corner) 0;
|
|
14
|
-
z-index: var(--z-index);
|
|
15
|
-
width: 5rem;
|
|
16
|
-
background-color: rgb(var(--mdui-color-surface));
|
|
17
|
-
padding: 0.375rem 0.75rem;
|
|
18
|
-
}
|
|
19
|
-
:host([contained]) {
|
|
20
|
-
position: absolute;
|
|
21
|
-
}
|
|
22
|
-
:host([divider]) {
|
|
23
|
-
border-right: 0.0625rem solid rgb(var(--mdui-color-surface-variant));
|
|
24
|
-
width: 5.0625rem;
|
|
25
|
-
}
|
|
26
|
-
:host([placement='right']) {
|
|
27
|
-
left: initial;
|
|
28
|
-
right: 0;
|
|
29
|
-
border-radius: var(--shape-corner) 0 0 var(--shape-corner);
|
|
30
|
-
}
|
|
31
|
-
:host([placement='right'][divider]) {
|
|
32
|
-
border-right: none;
|
|
33
|
-
border-left: 0.0625rem solid rgb(var(--mdui-color-surface-variant));
|
|
34
|
-
}
|
|
35
|
-
.top,
|
|
36
|
-
.items,
|
|
37
|
-
.bottom {
|
|
38
|
-
display: flex;
|
|
39
|
-
flex-direction: column;
|
|
40
|
-
align-items: center;
|
|
41
|
-
width: 100%;
|
|
42
|
-
}
|
|
43
|
-
.top {
|
|
44
|
-
margin-bottom: 1.75rem;
|
|
45
|
-
}
|
|
46
|
-
.bottom {
|
|
47
|
-
margin-top: 1.75rem;
|
|
48
|
-
}
|
|
49
|
-
::slotted(mdui-navigation-rail-item),
|
|
50
|
-
::slotted([slot='top']),
|
|
51
|
-
::slotted([slot='bottom']) {
|
|
52
|
-
margin-top: 0.375rem;
|
|
53
|
-
margin-bottom: 0.375rem;
|
|
54
|
-
}
|
|
55
|
-
:host([alignment='start']) .top-spacer {
|
|
56
|
-
flex-grow: 0;
|
|
57
|
-
}
|
|
58
|
-
:host([alignment='start']) .bottom-spacer {
|
|
59
|
-
flex-grow: 1;
|
|
60
|
-
}
|
|
61
|
-
:host([alignment='end']) .top-spacer {
|
|
62
|
-
flex-grow: 1;
|
|
63
|
-
}
|
|
64
|
-
:host([alignment='end']) .bottom-spacer {
|
|
65
|
-
flex-grow: 0;
|
|
66
|
-
}
|
|
67
|
-
:host([alignment='center']) {
|
|
68
|
-
justify-content: center;
|
|
69
|
-
}
|
|
70
|
-
:host([alignment='center']) .top,
|
|
71
|
-
:host([alignment='center']) .bottom {
|
|
72
|
-
position: absolute;
|
|
73
|
-
}
|
|
74
|
-
:host([alignment='center']) .top {
|
|
75
|
-
top: 0.375rem;
|
|
76
|
-
}
|
|
77
|
-
:host([alignment='center']) .bottom {
|
|
78
|
-
bottom: 0.375rem;
|
|
79
|
-
}
|
|
80
|
-
`;
|
|
2
|
+
export const navigationRailStyle = css `:host{--shape-corner:var(--mdui-shape-corner-none);--z-index:2000;position:fixed;top:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;border-radius:0 var(--shape-corner) var(--shape-corner) 0;z-index:var(--z-index);width:5rem;background-color:rgb(var(--mdui-color-surface));padding:.375rem .75rem}:host([contained]){position:absolute}:host([divider]){border-right:.0625rem solid rgb(var(--mdui-color-surface-variant));width:5.0625rem}:host([placement=right]){left:initial;right:0;border-radius:var(--shape-corner) 0 0 var(--shape-corner)}:host([placement=right][divider]){border-right:none;border-left:.0625rem solid rgb(var(--mdui-color-surface-variant))}.bottom,.items,.top{display:flex;flex-direction:column;align-items:center;width:100%}.top{margin-bottom:1.75rem}.bottom{margin-top:1.75rem}::slotted([slot=bottom]),::slotted([slot=top]),::slotted(mdui-navigation-rail-item){margin-top:.375rem;margin-bottom:.375rem}:host([alignment=start]) .top-spacer{flex-grow:0}:host([alignment=start]) .bottom-spacer{flex-grow:1}:host([alignment=end]) .top-spacer{flex-grow:1}:host([alignment=end]) .bottom-spacer{flex-grow:0}:host([alignment=center]){justify-content:center}:host([alignment=center]) .bottom,:host([alignment=center]) .top{position:absolute}:host([alignment=center]) .top{top:.375rem}:host([alignment=center]) .bottom{bottom:.375rem}`;
|
|
@@ -155,16 +155,7 @@ let NavigationRail = class NavigationRail extends LayoutItemBase {
|
|
|
155
155
|
render() {
|
|
156
156
|
const hasTopSlot = this.hasSlotController.test('top');
|
|
157
157
|
const hasBottomSlot = this.hasSlotController.test('bottom');
|
|
158
|
-
return html `${when(hasTopSlot, () => html `<slot name="top" part="top" class="top"></slot>`)}
|
|
159
|
-
<span class="top-spacer"></span>
|
|
160
|
-
<slot
|
|
161
|
-
part="items"
|
|
162
|
-
class="items"
|
|
163
|
-
@slotchange=${this.onSlotChange}
|
|
164
|
-
@click=${this.onClick}
|
|
165
|
-
></slot>
|
|
166
|
-
<span class="bottom-spacer"></span>
|
|
167
|
-
${when(hasBottomSlot, () => html `<slot name="bottom" part="bottom" class="bottom"></slot>`)}`;
|
|
158
|
+
return html `${when(hasTopSlot, () => html `<slot name="top" part="top" class="top"></slot>`)} <span class="top-spacer"></span><slot part="items" class="items" @slotchange="${this.onSlotChange}" @click="${this.onClick}"></slot><span class="bottom-spacer"></span> ${when(hasBottomSlot, () => html `<slot name="bottom" part="bottom" class="bottom"></slot>`)}`;
|
|
168
159
|
}
|
|
169
160
|
onClick(event) {
|
|
170
161
|
// event.button 为 0 时,为鼠标左键点击。忽略鼠标中键和右键
|
|
@@ -1,21 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const radioGroupStyle = css
|
|
3
|
-
:host {
|
|
4
|
-
display: inline-block;
|
|
5
|
-
}
|
|
6
|
-
fieldset {
|
|
7
|
-
border: none;
|
|
8
|
-
padding: 0;
|
|
9
|
-
margin: 0;
|
|
10
|
-
min-width: 0;
|
|
11
|
-
}
|
|
12
|
-
input {
|
|
13
|
-
position: absolute;
|
|
14
|
-
padding: 0;
|
|
15
|
-
opacity: 0;
|
|
16
|
-
pointer-events: none;
|
|
17
|
-
width: 1.25rem;
|
|
18
|
-
height: 1.25rem;
|
|
19
|
-
margin: 0rem 0rem 0rem 0.625rem;
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
2
|
+
export const radioGroupStyle = css `:host{display:inline-block}fieldset{border:none;padding:0;margin:0;min-width:0}input{position:absolute;padding:0;opacity:0;pointer-events:none;width:1.25rem;height:1.25rem;margin:0 0 0 .625rem}`;
|
|
@@ -154,25 +154,7 @@ let RadioGroup = class RadioGroup extends MduiElement {
|
|
|
154
154
|
this.invalid = !this.inputRef.value.checkValidity();
|
|
155
155
|
}
|
|
156
156
|
render() {
|
|
157
|
-
return html `<fieldset
|
|
158
|
-
<input
|
|
159
|
-
${ref(this.inputRef)}
|
|
160
|
-
type="radio"
|
|
161
|
-
class="input"
|
|
162
|
-
name=${ifDefined(this.name)}
|
|
163
|
-
value=${ifDefined(this.value)}
|
|
164
|
-
.checked=${!!this.value}
|
|
165
|
-
.required=${this.required}
|
|
166
|
-
tabindex="-1"
|
|
167
|
-
@keydown=${this.onKeyDown}
|
|
168
|
-
/>
|
|
169
|
-
<slot
|
|
170
|
-
@click=${this.onClick}
|
|
171
|
-
@keydown=${this.onKeyDown}
|
|
172
|
-
@slotchange=${this.onSlotChange}
|
|
173
|
-
@change=${this.onCheckedChange}
|
|
174
|
-
></slot>
|
|
175
|
-
</fieldset>`;
|
|
157
|
+
return html `<fieldset><input ${ref(this.inputRef)} type="radio" class="input" name="${ifDefined(this.name)}" value="${ifDefined(this.value)}" .checked="${!!this.value}" .required="${this.required}" tabindex="-1" @keydown="${this.onKeyDown}"><slot @click="${this.onClick}" @keydown="${this.onKeyDown}" @slotchange="${this.onSlotChange}" @change="${this.onCheckedChange}"></slot></fieldset>`;
|
|
176
158
|
}
|
|
177
159
|
// 更新 mdui-radio 的 checked 后,需要更新可聚焦状态
|
|
178
160
|
// 同一个 mdui-radio-group 中的多个 mdui-radio,仅有一个可聚焦
|