@shortfuse/materialdesignweb 0.2.0 → 0.5.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/.browserslistrc +2 -1
- package/.eslintrc.json +188 -30
- package/.stylelintrc.json +643 -2
- package/.vscode/launch.json +20 -5
- package/.vscode/settings.json +3 -0
- package/CHANGELOG.md +36 -0
- package/README.md +82 -2
- package/adapters/datatable/column.js +176 -0
- package/adapters/datatable/index.js +253 -437
- package/adapters/dom/index.js +586 -0
- package/adapters/list/index.js +36 -113
- package/adapters/search/index.js +153 -180
- package/components/appbar/_spec.scss +165 -0
- package/components/appbar/_theme.scss +0 -0
- package/components/appbar/index.scss +2 -0
- package/components/banner/_spec.scss +83 -0
- package/components/banner/_theme.scss +0 -0
- package/components/banner/index.scss +2 -0
- package/components/bottomnav/README.md +4 -4
- package/components/bottomnav/_spec.scss +149 -0
- package/components/bottomnav/_theme.scss +0 -0
- package/components/bottomnav/index.js +100 -120
- package/components/bottomnav/index.scss +2 -0
- package/components/bottomnav/item.js +88 -0
- package/components/button/README.md +16 -22
- package/components/button/_spec.scss +162 -0
- package/components/button/_theme.scss +42 -0
- package/components/button/index.eta +32 -0
- package/components/button/index.js +37 -48
- package/components/button/index.pug +18 -0
- package/components/button/index.scss +2 -0
- package/components/card/_spec.scss +241 -0
- package/components/card/_theme.scss +0 -0
- package/components/card/index.scss +2 -0
- package/components/chip/_spec.scss +111 -0
- package/components/chip/_theme.scss +105 -0
- package/components/chip/index.js +23 -0
- package/components/chip/index.scss +2 -0
- package/components/chip/item.js +20 -0
- package/components/datatable/_spec.scss +225 -0
- package/components/datatable/_theme.scss +128 -0
- package/components/datatable/cell.js +44 -0
- package/components/datatable/columnheader.js +46 -0
- package/components/datatable/index.js +339 -443
- package/components/datatable/index.scss +2 -0
- package/components/datatable/row.js +48 -0
- package/components/datatable/rowheader.js +18 -0
- package/components/dialog/_spec.scss +203 -0
- package/components/dialog/_theme.scss +7 -0
- package/components/dialog/index.js +512 -437
- package/components/dialog/index.scss +2 -0
- package/components/divider/_spec.scss +11 -0
- package/components/divider/_theme.scss +0 -0
- package/components/divider/index.scss +2 -0
- package/components/elevation/_spec.scss +9 -0
- package/components/elevation/_theme.scss +0 -0
- package/components/elevation/index.scss +2 -0
- package/components/fab/{style.scss → _spec.scss} +104 -79
- package/components/fab/_theme.scss +0 -0
- package/components/fab/index.js +85 -79
- package/components/fab/index.scss +2 -0
- package/components/grid/_spec.scss +169 -0
- package/components/grid/_theme.scss +0 -0
- package/components/grid/index.scss +2 -0
- package/components/layout/_mixins.scss +11 -0
- package/components/layout/_spec.scss +916 -0
- package/components/layout/_theme.scss +19 -0
- package/components/layout/index.js +454 -0
- package/components/layout/index.scss +2 -0
- package/components/list/_spec.scss +363 -0
- package/components/list/_theme.scss +102 -0
- package/components/list/content.js +106 -0
- package/components/list/index.js +234 -79
- package/components/list/index.scss +2 -0
- package/components/list/item.js +167 -0
- package/components/list/secondary.js +45 -0
- package/components/menu/_spec.scss +329 -0
- package/components/menu/_theme.scss +0 -0
- package/components/menu/index.js +636 -651
- package/components/menu/index.scss +2 -0
- package/components/menu/item.js +231 -0
- package/components/progress/_spec.scss +156 -0
- package/components/progress/_theme.scss +0 -0
- package/components/progress/index.js +29 -13
- package/components/progress/index.scss +2 -0
- package/components/selection/_spec.scss +376 -0
- package/components/selection/_theme.scss +134 -0
- package/components/selection/index.eta +60 -0
- package/components/selection/index.js +70 -0
- package/components/selection/index.pug +30 -0
- package/components/selection/index.scss +2 -0
- package/components/selection/input.js +54 -0
- package/components/selection/radiogroup.js +40 -0
- package/components/slider/{style.scss → _spec.scss} +31 -34
- package/components/slider/_theme.scss +0 -0
- package/components/slider/index.scss +2 -0
- package/components/snackbar/_spec.scss +150 -0
- package/components/snackbar/_theme.scss +0 -0
- package/components/snackbar/index.js +293 -206
- package/components/snackbar/index.scss +2 -0
- package/components/tab/_spec.scss +220 -0
- package/components/tab/_theme.scss +0 -0
- package/components/tab/content.js +210 -0
- package/components/tab/index.js +229 -213
- package/components/tab/index.scss +2 -0
- package/components/tab/item.js +88 -0
- package/components/tab/list.js +196 -0
- package/components/tab/panel.js +54 -0
- package/components/textfield/README.md +4 -4
- package/components/textfield/_spec.scss +763 -0
- package/components/textfield/_theme.scss +264 -0
- package/components/textfield/index.eta +74 -0
- package/components/textfield/index.js +132 -138
- package/components/textfield/index.pug +30 -0
- package/components/textfield/index.scss +2 -0
- package/components/tooltip/_spec.scss +185 -0
- package/components/tooltip/_theme.scss +0 -0
- package/components/tooltip/index.scss +2 -0
- package/components/type/_spec.scss +227 -0
- package/components/type/_theme.scss +0 -0
- package/components/type/index.scss +2 -0
- package/core/_breakpoint.scss +189 -0
- package/core/_elevation.scss +78 -0
- package/core/_length.scss +8 -0
- package/core/_motion.scss +31 -0
- package/core/_platform.scss +12 -0
- package/core/_type.scss +128 -0
- package/core/aria/attributes.js +141 -0
- package/core/aria/button.js +49 -0
- package/core/aria/keyboard.js +92 -0
- package/core/aria/rovingtabindex.js +175 -0
- package/core/aria/tab.js +59 -0
- package/core/document/index.js +39 -0
- package/core/dom.js +180 -0
- package/core/overlay/_spec.scss +28 -0
- package/core/overlay/_theme.scss +147 -0
- package/core/overlay/index.js +95 -0
- package/core/overlay/index.scss +2 -0
- package/core/ripple/_spec.scss +196 -0
- package/core/ripple/_theme.scss +20 -0
- package/core/ripple/index.js +286 -0
- package/core/ripple/index.scss +2 -0
- package/core/theme/_aliases.scss +15 -0
- package/core/theme/_config.scss +8 -0
- package/core/theme/_functions.scss +22 -0
- package/{components/theming/palettes.scss → core/theme/_palettes.scss} +173 -151
- package/core/theme/_spec.scss +0 -0
- package/core/theme/_theme.scss +268 -0
- package/core/theme/index.js +50 -0
- package/core/theme/index.scss +4 -0
- package/core/throttler.js +42 -0
- package/core/transition/index.js +465 -0
- package/docs/_flex.scss +28 -0
- package/docs/_menuoptions.js +183 -0
- package/docs/_partials/_androidnavbar.eta +5 -0
- package/docs/_partials/_androidstatusbar.eta +13 -0
- package/docs/_partials/_appbar.eta +27 -0
- package/docs/_partials/_buttontest.eta +31 -0
- package/docs/_partials/_header.eta +146 -0
- package/docs/_partials/_navlistitem.eta +16 -0
- package/docs/_partials/_target.eta +1 -0
- package/docs/_sample-utils.js +88 -0
- package/docs/{src/storage.js → _storage.js} +0 -0
- package/docs/docs.scss +331 -0
- package/docs/framework.scss +26 -0
- package/docs/index.eta +12 -0
- package/docs/index.js +7 -0
- package/docs/pages/appbar.eta +108 -0
- package/docs/pages/appbar.js +0 -0
- package/docs/pages/bottomnav.eta +188 -0
- package/docs/pages/bottomnav.js +118 -0
- package/docs/pages/button.eta +124 -0
- package/docs/pages/button.js +224 -0
- package/docs/pages/card.eta +90 -0
- package/docs/pages/card.js +175 -0
- package/docs/pages/chip.eta +122 -0
- package/docs/pages/chip.js +80 -0
- package/docs/pages/color.eta +143 -0
- package/docs/pages/color.js +261 -0
- package/docs/pages/datatable.eta +323 -0
- package/docs/pages/datatable.js +160 -0
- package/docs/pages/dialog.eta +184 -0
- package/docs/{src/components → pages}/dialog.js +35 -48
- package/docs/pages/dom.eta +26 -0
- package/docs/pages/dom.js +140 -0
- package/docs/pages/elevation.eta +35 -0
- package/docs/pages/elevation.js +0 -0
- package/docs/pages/fab.eta +99 -0
- package/docs/{src/components → pages}/fab.js +6 -13
- package/docs/pages/grid.eta +135 -0
- package/docs/pages/grid.js +128 -0
- package/docs/pages/layout.eta +8 -0
- package/docs/pages/layout.js +0 -0
- package/docs/pages/list.eta +465 -0
- package/docs/pages/list.js +8 -0
- package/docs/pages/menu.eta +274 -0
- package/docs/{src/components → pages}/menu.js +26 -42
- package/docs/pages/overlay.eta +69 -0
- package/docs/pages/overlay.js +3 -0
- package/docs/pages/progress.eta +23 -0
- package/docs/{src/components → pages}/progress.js +2 -4
- package/docs/pages/ripple.eta +27 -0
- package/docs/pages/ripple.js +3 -0
- package/docs/pages/search.eta +242 -0
- package/docs/pages/search.js +226 -0
- package/docs/pages/selection.eta +107 -0
- package/docs/pages/selection.js +12 -0
- package/docs/pages/slider.eta +23 -0
- package/docs/pages/slider.js +0 -0
- package/docs/pages/snackbar.eta +83 -0
- package/docs/{src/components → pages}/snackbar.js +31 -36
- package/docs/pages/tab.eta +407 -0
- package/docs/pages/tab.js +152 -0
- package/docs/pages/textfield.eta +487 -0
- package/docs/{src/components → pages}/textfield.js +41 -45
- package/docs/pages/tooltip.eta +92 -0
- package/docs/pages/tooltip.js +0 -0
- package/docs/pages/transition.eta +117 -0
- package/docs/pages/transition.js +52 -0
- package/docs/pages/type.eta +31 -0
- package/docs/pages/type.js +0 -0
- package/docs/postrender.js +41 -0
- package/docs/prerender.js +16 -0
- package/docs/pwa/_dialogs.eta +143 -0
- package/docs/pwa/_menus.eta +16 -0
- package/docs/pwa/pwa-prerender.js +3 -0
- package/docs/pwa/pwa.eta +478 -0
- package/docs/pwa/pwa.js +298 -0
- package/docs/pwa/pwa.scss +31 -0
- package/docs/themes/theme-colored.scss +15 -0
- package/docs/themes/theme-default.scss +3 -0
- package/index.scss +27 -0
- package/jsconfig.json +8 -2
- package/package.json +54 -27
- package/scripts/deploy-docs.sh +9 -0
- package/templates/index.eta +2 -0
- package/templates/index.pug +3 -0
- package/tsconfig.json +16 -0
- package/utils/function.js +3 -0
- package/webpack.config.js +224 -68
- package/_index.scss +0 -4
- package/components/all-components.scss +0 -21
- package/components/bottomnav/style.scss +0 -190
- package/components/bottomnav/theming.scss +0 -76
- package/components/button/style.scss +0 -315
- package/components/button/theming.scss +0 -134
- package/components/card/style.scss +0 -175
- package/components/card/theming.scss +0 -43
- package/components/common/dom.js +0 -51
- package/components/common/functions.scss +0 -174
- package/components/common/mixins.scss +0 -122
- package/components/common/motion.scss +0 -36
- package/components/common/type.scss +0 -104
- package/components/common/variables.scss +0 -46
- package/components/datatable/style.scss +0 -257
- package/components/datatable/theming.scss +0 -119
- package/components/dialog/style.scss +0 -159
- package/components/dialog/theming.scss +0 -29
- package/components/divider/style.scss +0 -7
- package/components/divider/theming.scss +0 -20
- package/components/elevation/style.scss +0 -32
- package/components/layout/style.scss +0 -223
- package/components/list/style.scss +0 -358
- package/components/list/theming.scss +0 -83
- package/components/menu/style.scss +0 -280
- package/components/menu/theming.scss +0 -80
- package/components/navdrawer/index.js +0 -200
- package/components/navdrawer/style.scss +0 -595
- package/components/navdrawer/theming.scss +0 -62
- package/components/progress/style.scss +0 -136
- package/components/ripple/index.js +0 -63
- package/components/ripple/ripple.scss +0 -122
- package/components/selection/style.scss +0 -320
- package/components/selection/theming.scss +0 -98
- package/components/snackbar/style.scss +0 -212
- package/components/switch/style.scss +0 -3
- package/components/tab/style.scss +0 -275
- package/components/tab/theming.scss +0 -34
- package/components/template/theming.scss +0 -31
- package/components/textfield/style.scss +0 -795
- package/components/textfield/theming.scss +0 -256
- package/components/theming/globals.scss +0 -25
- package/components/theming/theming.scss +0 -559
- package/components/toolbar/style.scss +0 -190
- package/components/toolbar/theming.scss +0 -32
- package/components/tooltip/style.scss +0 -135
- package/components/type/style.scss +0 -167
- package/components/type/theming.scss +0 -25
- package/docs/bottomnav.html +0 -1
- package/docs/bottomnav.min.js +0 -2
- package/docs/bottomnav.min.js.map +0 -1
- package/docs/button.html +0 -1
- package/docs/button.min.js +0 -2
- package/docs/button.min.js.map +0 -1
- package/docs/card.html +0 -1
- package/docs/card.min.js +0 -2
- package/docs/card.min.js.map +0 -1
- package/docs/components.min.css +0 -1
- package/docs/components.min.js +0 -2
- package/docs/components.min.js.map +0 -1
- package/docs/datatable.html +0 -1
- package/docs/datatable.min.js +0 -2
- package/docs/datatable.min.js.map +0 -1
- package/docs/dialog.html +0 -1
- package/docs/dialog.min.js +0 -2
- package/docs/dialog.min.js.map +0 -1
- package/docs/docs.min.css +0 -1
- package/docs/docs.min.js +0 -2
- package/docs/docs.min.js.map +0 -1
- package/docs/elevation.html +0 -1
- package/docs/elevation.min.js +0 -2
- package/docs/elevation.min.js.map +0 -1
- package/docs/fab.html +0 -1
- package/docs/fab.min.js +0 -2
- package/docs/fab.min.js.map +0 -1
- package/docs/index.html +0 -1
- package/docs/index.min.js +0 -2
- package/docs/index.min.js.map +0 -1
- package/docs/layout.html +0 -1
- package/docs/layout.min.js +0 -2
- package/docs/layout.min.js.map +0 -1
- package/docs/list.html +0 -1
- package/docs/list.min.js +0 -2
- package/docs/list.min.js.map +0 -1
- package/docs/menu.html +0 -1
- package/docs/menu.min.js +0 -2
- package/docs/menu.min.js.map +0 -1
- package/docs/navdrawer.html +0 -1
- package/docs/navdrawer.min.js +0 -2
- package/docs/navdrawer.min.js.map +0 -1
- package/docs/prerender.min.js +0 -2
- package/docs/prerender.min.js.map +0 -1
- package/docs/progress.html +0 -1
- package/docs/progress.min.js +0 -2
- package/docs/progress.min.js.map +0 -1
- package/docs/search.html +0 -1
- package/docs/search.min.js +0 -2
- package/docs/search.min.js.map +0 -1
- package/docs/selection.html +0 -1
- package/docs/selection.min.js +0 -2
- package/docs/selection.min.js.map +0 -1
- package/docs/slider.html +0 -1
- package/docs/slider.min.js +0 -2
- package/docs/slider.min.js.map +0 -1
- package/docs/snackbar.html +0 -1
- package/docs/snackbar.min.js +0 -2
- package/docs/snackbar.min.js.map +0 -1
- package/docs/src/components/bottomnav.js +0 -16
- package/docs/src/components/bottomnav.pug +0 -112
- package/docs/src/components/button.js +0 -156
- package/docs/src/components/button.pug +0 -194
- package/docs/src/components/card.js +0 -136
- package/docs/src/components/card.pug +0 -133
- package/docs/src/components/datatable.js +0 -183
- package/docs/src/components/datatable.pug +0 -324
- package/docs/src/components/dialog.pug +0 -138
- package/docs/src/components/elevation.js +0 -3
- package/docs/src/components/elevation.pug +0 -17
- package/docs/src/components/fab.pug +0 -84
- package/docs/src/components/layout.js +0 -116
- package/docs/src/components/layout.pug +0 -104
- package/docs/src/components/list.js +0 -15
- package/docs/src/components/list.pug +0 -293
- package/docs/src/components/menu.pug +0 -292
- package/docs/src/components/navdrawer.js +0 -112
- package/docs/src/components/navdrawer.pug +0 -113
- package/docs/src/components/progress.pug +0 -17
- package/docs/src/components/search.js +0 -206
- package/docs/src/components/search.pug +0 -149
- package/docs/src/components/selection.js +0 -6
- package/docs/src/components/selection.pug +0 -116
- package/docs/src/components/slider.js +0 -3
- package/docs/src/components/slider.pug +0 -19
- package/docs/src/components/snackbar.pug +0 -145
- package/docs/src/components/tab.js +0 -137
- package/docs/src/components/tab.pug +0 -329
- package/docs/src/components/textfield.pug +0 -416
- package/docs/src/components/toolbar.js +0 -6
- package/docs/src/components/toolbar.pug +0 -86
- package/docs/src/components/tooltip.js +0 -6
- package/docs/src/components/tooltip.pug +0 -76
- package/docs/src/components/type.js +0 -6
- package/docs/src/components/type.pug +0 -34
- package/docs/src/components.scss +0 -1
- package/docs/src/docs.scss +0 -284
- package/docs/src/index.js +0 -3
- package/docs/src/index.pug +0 -6
- package/docs/src/menuoptions.js +0 -136
- package/docs/src/mixins.pug +0 -139
- package/docs/src/prerender.js +0 -26
- package/docs/src/sample-utils.js +0 -108
- package/docs/src/targetHandler.js +0 -50
- package/docs/src/theming.ie11.scss +0 -18
- package/docs/src/theming.scss +0 -18
- package/docs/tab.html +0 -1
- package/docs/tab.min.js +0 -2
- package/docs/tab.min.js.map +0 -1
- package/docs/textfield.html +0 -2
- package/docs/textfield.min.js +0 -2
- package/docs/textfield.min.js.map +0 -1
- package/docs/theming.ie11.min.css +0 -1
- package/docs/theming.ie11.min.js +0 -2
- package/docs/theming.ie11.min.js.map +0 -1
- package/docs/theming.min.css +0 -1
- package/docs/theming.min.js +0 -2
- package/docs/theming.min.js.map +0 -1
- package/docs/toolbar.html +0 -1
- package/docs/toolbar.min.js +0 -2
- package/docs/toolbar.min.js.map +0 -1
- package/docs/tooltip.html +0 -1
- package/docs/tooltip.min.js +0 -2
- package/docs/tooltip.min.js.map +0 -1
- package/docs/type.html +0 -1
- package/docs/type.min.js +0 -2
- package/docs/type.min.js.map +0 -1
- package/index.js +0 -16
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
// https://material.io/guidelines/components/lists.html
|
|
2
|
+
// https://material.io/guidelines/components/lists-controls.html
|
|
3
|
+
|
|
4
|
+
@use '../../core/_breakpoint.scss' as breakpoint;
|
|
5
|
+
@use '../../core/_length.scss' as *;
|
|
6
|
+
@use '../../core/_motion.scss' as motion;
|
|
7
|
+
@use '../../core/_platform.scss' as platform;
|
|
8
|
+
@use '../../core/_type.scss' as type;
|
|
9
|
+
|
|
10
|
+
$dividerHeight: 1px !default;
|
|
11
|
+
|
|
12
|
+
:root {
|
|
13
|
+
--mdw-list__inline-padding: 24px;
|
|
14
|
+
@include breakpoint.has16DPMargin() {
|
|
15
|
+
--mdw-list__inline-padding: 16px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.mdw-list {
|
|
21
|
+
margin: 0;
|
|
22
|
+
padding: 0;
|
|
23
|
+
|
|
24
|
+
list-style-type: none;
|
|
25
|
+
|
|
26
|
+
&[mdw-margin-top] {
|
|
27
|
+
margin-block-start: 8px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&[mdw-margin-bottom] {
|
|
31
|
+
margin-block-end: 8px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
li.mdw-list__item {
|
|
36
|
+
position: relative;
|
|
37
|
+
|
|
38
|
+
margin: 0;
|
|
39
|
+
|
|
40
|
+
-moz-appearance: none;
|
|
41
|
+
-webkit-appearance: none;
|
|
42
|
+
appearance: none;
|
|
43
|
+
|
|
44
|
+
text-align: start;
|
|
45
|
+
text-decoration: none;
|
|
46
|
+
text-transform: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
a.mdw-list__content {
|
|
50
|
+
text-decoration: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.mdw-list__content > .mdw-divider[mdw-vertical] {
|
|
54
|
+
inline-size: 40px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.mdw-list__subheader,
|
|
58
|
+
.mdw-list__content {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
flex-direction: row;
|
|
62
|
+
justify-content: stretch;
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
|
|
65
|
+
min-block-size: 48px;
|
|
66
|
+
flex: 1;
|
|
67
|
+
padding: 0 var(--mdw-list__inline-padding);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.mdw-list__subheader {
|
|
71
|
+
@include type.addRules('body-2');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.mdw-list__content {
|
|
75
|
+
@include type.addRules('subtitle');
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
|
|
78
|
+
text-align: start;
|
|
79
|
+
text-overflow: ellipsis;
|
|
80
|
+
white-space: nowrap;
|
|
81
|
+
|
|
82
|
+
&[aria-hidden="true"] {
|
|
83
|
+
display: none;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.mdw-list__avatar,
|
|
88
|
+
.mdw-list__icon {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-self: flex-start;
|
|
91
|
+
flex-direction: row;
|
|
92
|
+
justify-content: flex-start;
|
|
93
|
+
order: -1;
|
|
94
|
+
|
|
95
|
+
min-inline-size: 56px; /* 72 - 16 */
|
|
96
|
+
max-inline-size: 56px; /* 72 - 16 */
|
|
97
|
+
margin: 16px 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.mdw-list__avatar {
|
|
101
|
+
min-block-size: 40px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.mdw-list__item {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
|
|
108
|
+
outline: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.mdw-list__item[aria-expanded] {
|
|
112
|
+
position: relative;
|
|
113
|
+
|
|
114
|
+
&::before,
|
|
115
|
+
&::after {
|
|
116
|
+
content: '';
|
|
117
|
+
|
|
118
|
+
position: absolute;
|
|
119
|
+
|
|
120
|
+
inset-inline: 0;
|
|
121
|
+
|
|
122
|
+
block-size: 1px;
|
|
123
|
+
|
|
124
|
+
transition-duration: motion.$shapeChangeDuration;
|
|
125
|
+
|
|
126
|
+
transition-property: background-color;
|
|
127
|
+
transition-timing-function: motion.$standardEasing;
|
|
128
|
+
|
|
129
|
+
background-color: transparent;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&::before {
|
|
133
|
+
inset-block-start: -1px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&::after {
|
|
137
|
+
inset-block-end: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
& > .mdw-list__content .mdw-list__secondary {
|
|
141
|
+
min-block-size: 48px;
|
|
142
|
+
|
|
143
|
+
pointer-events: none;
|
|
144
|
+
|
|
145
|
+
transition-duration: motion.$shapeChangeDuration;
|
|
146
|
+
transition-property: transform;
|
|
147
|
+
transition-timing-function: motion.$standardEasing;
|
|
148
|
+
|
|
149
|
+
transform: rotate(0deg);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
& > .mdw-list {
|
|
153
|
+
display: flex;
|
|
154
|
+
flex-direction: column;
|
|
155
|
+
|
|
156
|
+
& > .mdw-list__item {
|
|
157
|
+
overflow: hidden;
|
|
158
|
+
|
|
159
|
+
flex-basis: 0;
|
|
160
|
+
|
|
161
|
+
animation-duration: motion.$collapseDuration;
|
|
162
|
+
animation-timing-function: motion.$accelerateEasing;
|
|
163
|
+
animation-fill-mode: forwards;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&[aria-expanded="false"] {
|
|
168
|
+
& > .mdw-list > .mdw-list__item {
|
|
169
|
+
animation-name: collapseRow;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&[aria-expanded="true"] {
|
|
174
|
+
& > .mdw-list__content .mdw-list__secondary {
|
|
175
|
+
transform: rotate(180deg);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
& > .mdw-list > .mdw-list__item {
|
|
179
|
+
animation-name: expandRow;
|
|
180
|
+
animation-duration: motion.$expandDuration;
|
|
181
|
+
animation-timing-function: motion.$decelerateEasing;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
& + .mdw-list__list-item[aria-expanded="true"]::before {
|
|
185
|
+
display: none;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&:not([mdw-expander-js]) > .mdw-list .mdw-list__item {
|
|
190
|
+
animation-duration: 0s;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@keyframes expandRow {
|
|
195
|
+
0% {
|
|
196
|
+
min-block-size: 0;
|
|
197
|
+
flex-basis: 0;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
99.99% {
|
|
201
|
+
min-block-size: 48px;
|
|
202
|
+
flex-basis: 0;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
100% {
|
|
206
|
+
min-block-size: 48px;
|
|
207
|
+
flex-basis: 100%;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@keyframes collapseRow {
|
|
212
|
+
0% {
|
|
213
|
+
min-block-size: 48px;
|
|
214
|
+
flex-basis: 0;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
100% {
|
|
218
|
+
min-block-size: 0;
|
|
219
|
+
flex-basis: 0;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.mdw-list__expand-checkbox {
|
|
224
|
+
display: none;
|
|
225
|
+
|
|
226
|
+
max-block-size: 0;
|
|
227
|
+
max-inline-size: 0;
|
|
228
|
+
|
|
229
|
+
-moz-appearance: none;
|
|
230
|
+
-webkit-appearance: none;
|
|
231
|
+
appearance: none;
|
|
232
|
+
|
|
233
|
+
pointer-events: none;
|
|
234
|
+
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.mdw-list__secondary {
|
|
238
|
+
display: flex;
|
|
239
|
+
position: relative;
|
|
240
|
+
align-items: center;
|
|
241
|
+
align-self: stretch;
|
|
242
|
+
flex-direction: row;
|
|
243
|
+
justify-content: center;
|
|
244
|
+
order: 1;
|
|
245
|
+
|
|
246
|
+
min-inline-size: var(--mdw-list__inline-padding);
|
|
247
|
+
margin-inline: 0 calc(-1 * var(--mdw-list__inline-padding));
|
|
248
|
+
border-width: 1px;
|
|
249
|
+
padding: 0 var(--mdw-list__inline-padding);
|
|
250
|
+
|
|
251
|
+
pointer-events: none;
|
|
252
|
+
|
|
253
|
+
z-index: 1;
|
|
254
|
+
|
|
255
|
+
&[mdw-action] {
|
|
256
|
+
pointer-events: auto;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// In order to render 48px, 64px, 72px and 88px heights, lines are rendered bottom-up
|
|
261
|
+
|
|
262
|
+
.mdw-list__text {
|
|
263
|
+
position: static;
|
|
264
|
+
overflow-x: hidden;
|
|
265
|
+
|
|
266
|
+
flex-grow: 1;
|
|
267
|
+
|
|
268
|
+
pointer-events: none;
|
|
269
|
+
|
|
270
|
+
text-overflow: ellipsis;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.mdw-list[mdw-divider] .mdw-list__item:not(:last-child) {
|
|
274
|
+
.mdw-list__text::after {
|
|
275
|
+
content: '';
|
|
276
|
+
|
|
277
|
+
position: absolute;
|
|
278
|
+
inset-block-end: 0;
|
|
279
|
+
inset-inline: 0;
|
|
280
|
+
|
|
281
|
+
block-size: $dividerHeight;
|
|
282
|
+
inline-size: 100%;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.mdw-list__avatar ~ .mdw-list__text::after,
|
|
287
|
+
.mdw-list[mdw-divider] > .mdw-list__item:not(:last-child) .mdw-list__icon ~ .mdw-list__text::after {
|
|
288
|
+
margin-inline-start: 72px;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.mdw-list__text-line {
|
|
292
|
+
overflow-x: hidden;
|
|
293
|
+
overflow-y: hidden;
|
|
294
|
+
|
|
295
|
+
text-overflow: ellipsis;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// First line and meta baseline alignment
|
|
299
|
+
.mdw-list__text-line:first-child,
|
|
300
|
+
.mdw-list__text-block:first-child,
|
|
301
|
+
.mdw-list__meta {
|
|
302
|
+
@include type.baselineToTop(28);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.mdw-list__meta {
|
|
306
|
+
@include type.addRules('caption');
|
|
307
|
+
align-self: flex-start;
|
|
308
|
+
|
|
309
|
+
margin-inline: 28px 0;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// First line is pushed up 20dp
|
|
313
|
+
.mdw-list__text-line:first-child {
|
|
314
|
+
@include type.baselineToBottom(20);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// Second and third lines are pushed up 20dp and its above element is pushed 20dp
|
|
318
|
+
.mdw-list__text-line:not(:first-child),
|
|
319
|
+
.mdw-list__text-block:not(:first-child) {
|
|
320
|
+
@include type.addRules('body-2');
|
|
321
|
+
@include type.baselineToTop(20);
|
|
322
|
+
margin-block-start: -20px;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Second line is pushed up 16dp from baseline
|
|
326
|
+
.mdw-list__text-line:last-child {
|
|
327
|
+
@include type.baselineToBottom(16);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// When 3-lines, 2nd and 3rd lines are pushed up 20dp
|
|
331
|
+
.mdw-list__text-line:nth-child(3),
|
|
332
|
+
.mdw-list__text-line:not(:first-child):not(:last-child) {
|
|
333
|
+
@include type.baselineToBottom(20);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.mdw-list__text-block {
|
|
337
|
+
display: block;
|
|
338
|
+
display: -webkit-box;
|
|
339
|
+
overflow-x: hidden;
|
|
340
|
+
overflow-y: hidden;
|
|
341
|
+
|
|
342
|
+
pointer-events: none;
|
|
343
|
+
|
|
344
|
+
text-align: start;
|
|
345
|
+
text-overflow: ellipsis;
|
|
346
|
+
text-transform: none;
|
|
347
|
+
white-space: normal;
|
|
348
|
+
-webkit-box-orient: vertical;
|
|
349
|
+
-webkit-line-clamp: 2;
|
|
350
|
+
|
|
351
|
+
word-break: break-word;
|
|
352
|
+
|
|
353
|
+
&:not(:only-child) {
|
|
354
|
+
max-block-size: sp(20 * 2);
|
|
355
|
+
block-size: sp(20 * 2);
|
|
356
|
+
margin-block-end: 16px;
|
|
357
|
+
padding-block-end: 4px;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
&:only-child {
|
|
361
|
+
@include type.baselineToBottom(16);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
.mdw-theme {
|
|
2
|
+
--mdw-list__divider-color: var(--mdw-divider-color);
|
|
3
|
+
--mdw-list__focus-opacity: var(--mdw-list__focus-opacity-value);
|
|
4
|
+
--mdw-list__focus-selected-opacity: calc(var(--mdw-list__focus-opacity-value) + var(--mdw-list__selected-opacity-value));
|
|
5
|
+
--mdw-list__focus-activated-opacity: calc(var(--mdw-list__focus-opacity-value) + var(--mdw-list__activated-opacity-value));
|
|
6
|
+
--mdw-list__focus-hover-opacity: calc(var(--mdw-list__focus-opacity-value) + var(--mdw-list__hover-opacity-value));
|
|
7
|
+
--mdw-list__focus-hover-selected-opacity: calc(var(--mdw-list__focus-opacity-value) + var(--mdw-list__hover-opacity-value) + var(--mdw-list__selected-opacity-value));
|
|
8
|
+
--mdw-list__focus-hover-activated-opacity: calc(var(--mdw-list__focus-opacity-value) + var(--mdw-list__hover-opacity-value) + var(--mdw-list__activated-opacity-value));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.mdw-theme[mdw-light] {
|
|
12
|
+
--mdw-list__focus-opacity-value: 0.12;
|
|
13
|
+
--mdw-list__hover-opacity-value: 0.04;
|
|
14
|
+
--mdw-list__selected-opacity-value: 0.08;
|
|
15
|
+
--mdw-list__activated-opacity-value: 0.12;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.mdw-theme[mdw-dark] {
|
|
19
|
+
--mdw-list__focus-opacity-value: 0.24;
|
|
20
|
+
--mdw-list__hover-opacity-value: 0.08;
|
|
21
|
+
--mdw-list__selected-opacity-value: 0.16;
|
|
22
|
+
--mdw-list__activated-opacity-value: 0.24;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
.mdw-list__content {
|
|
28
|
+
&[mdw-ink][aria-current] {
|
|
29
|
+
.mdw-list__icon,
|
|
30
|
+
.mdw-list__text {
|
|
31
|
+
color: inherit;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.mdw-list[mdw-divider] {
|
|
37
|
+
& > .mdw-list__item:not(:last-child) .mdw-list__text::after {
|
|
38
|
+
background-color: var(--mdw-list__divider-color);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.mdw-list__item[aria-expanded]:focus {
|
|
43
|
+
& > .mdw-list__content {
|
|
44
|
+
&:not([mdw-overlay-touch="true"]) {
|
|
45
|
+
&:not([mdw-overlay-off~="focus"]):not([mdw-overlay-touch="true"])::before {
|
|
46
|
+
opacity: var(--mdw-list__focus-opacity);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:not([aria-disabled="true"]):not([mdw-overlay-touch="true"]) {
|
|
50
|
+
&:hover:not([mdw-overlay-off~="hover"]):not([mdw-overlay-off~="focus"])::before {
|
|
51
|
+
opacity: var(--mdw-list__focus-hover-opacity);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Selected
|
|
57
|
+
&[aria-selected="true"]:not([mdw-overlay-off~="selected"]) {
|
|
58
|
+
&:not([mdw-overlay-touch="true"]) {
|
|
59
|
+
&:focus:not([mdw-overlay-off~="focus"])::before {
|
|
60
|
+
opacity: var(--mdw-list__focus-selected-opacity);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:not([aria-disabled="true"]) {
|
|
64
|
+
&:hover:not([mdw-overlay-off~="hover"]):not([mdw-overlay-off~="focus"])::before {
|
|
65
|
+
opacity: var(--mdw-list__focus-hover-selected-opacity);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Activated
|
|
72
|
+
&[aria-current]:not([mdw-overlay-off~="current"]),
|
|
73
|
+
&[aria-pressed="true"]:not([mdw-overlay-off~="activated"]) {
|
|
74
|
+
&:not([mdw-overlay-touch="true"]) {
|
|
75
|
+
&:not([mdw-overlay-off~="focus"])::before {
|
|
76
|
+
opacity: var(--mdw-list__focus-activated-opacity);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&:not([aria-disabled="true"]) {
|
|
80
|
+
&:hover:not([mdw-overlay-off~="hover"]):not([mdw-overlay-off~="focus"])::before {
|
|
81
|
+
opacity: var(--mdw-list__focus-hover-activated-opacity);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.mdw-list__item[aria-expanded="true"] {
|
|
90
|
+
&::before,
|
|
91
|
+
&::after {
|
|
92
|
+
background-color: var(--mdw-list__divider-color);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&[mdw-ink][aria-expanded="true"] {
|
|
96
|
+
& > .mdw-list__content,
|
|
97
|
+
& > .mdw-list__content::before,
|
|
98
|
+
& > .mdw-list__content > .mdw-list__text {
|
|
99
|
+
color: inherit;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as Attributes from '../../core/aria/attributes.js';
|
|
2
|
+
import * as Keyboard from '../../core/aria/keyboard.js';
|
|
3
|
+
import { dispatchDomEvent } from '../../core/dom.js';
|
|
4
|
+
import * as Overlay from '../../core/overlay/index.js';
|
|
5
|
+
import * as Ripple from '../../core/ripple/index.js';
|
|
6
|
+
|
|
7
|
+
import * as ListSecondary from './secondary.js';
|
|
8
|
+
|
|
9
|
+
export const ACTIVATE_EVENT = 'mdw:listcontent-activate';
|
|
10
|
+
export const SELECTED_CHANGE_EVENT = 'mdw:listcontent-selectedchange';
|
|
11
|
+
export const FOCUS_EVENT = 'mdw:listcontent-focus';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param {CustomEvent} event
|
|
15
|
+
* @return {void}
|
|
16
|
+
*/
|
|
17
|
+
function onEnterKey(event) {
|
|
18
|
+
if (event.detail.ctrlKey || event.detail.shiftKey
|
|
19
|
+
|| event.detail.altKey || event.detail.metaKey) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const listContentElement = /** @type {HTMLElement} */ (event.currentTarget);
|
|
23
|
+
if (!listContentElement) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
event.stopPropagation();
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
|
|
29
|
+
// Slightly redundant, but performs ripple
|
|
30
|
+
const newEvent = document.createEvent('Event');
|
|
31
|
+
newEvent.initEvent('click', true, true);
|
|
32
|
+
listContentElement.dispatchEvent(newEvent);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param {MouseEvent|KeyboardEvent|PointerEvent} event
|
|
37
|
+
* @return {void}
|
|
38
|
+
*/
|
|
39
|
+
export function onClick(event) {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
const listContentElement = /** @type {HTMLElement} */ (event.currentTarget);
|
|
42
|
+
if (Attributes.isDisabled(listContentElement)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
dispatchDomEvent(listContentElement, ACTIVATE_EVENT);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @param {Element} listContentElement
|
|
50
|
+
* @return {void}
|
|
51
|
+
*/
|
|
52
|
+
export function attach(listContentElement) {
|
|
53
|
+
if (!listContentElement.hasAttribute('role') && listContentElement.parentElement.getAttribute('role') === 'none') {
|
|
54
|
+
listContentElement.setAttribute('role', 'option');
|
|
55
|
+
}
|
|
56
|
+
for (const el of listContentElement.getElementsByClassName('mdw-list__icon')) {
|
|
57
|
+
el.setAttribute('aria-hidden', 'true');
|
|
58
|
+
}
|
|
59
|
+
for (const el of listContentElement.getElementsByClassName('mdw-list__avatar')) {
|
|
60
|
+
el.setAttribute('aria-hidden', 'true');
|
|
61
|
+
}
|
|
62
|
+
listContentElement.addEventListener('click', onClick);
|
|
63
|
+
|
|
64
|
+
if (!listContentElement.hasAttribute('mdw-no-overlay')) {
|
|
65
|
+
listContentElement.classList.add('mdw-overlay');
|
|
66
|
+
Overlay.attach(listContentElement);
|
|
67
|
+
}
|
|
68
|
+
if (!listContentElement.hasAttribute('mdw-no-ripple')) {
|
|
69
|
+
listContentElement.classList.add('mdw-ripple');
|
|
70
|
+
Ripple.attach(listContentElement);
|
|
71
|
+
}
|
|
72
|
+
if (listContentElement.getAttribute('role') === 'radio'
|
|
73
|
+
&& listContentElement.getAttribute('aria-checked') === 'true'
|
|
74
|
+
&& listContentElement.getAttribute('tabindex') !== '0') {
|
|
75
|
+
listContentElement.setAttribute('tabindex', '0');
|
|
76
|
+
}
|
|
77
|
+
const secondaryElement = listContentElement.getElementsByClassName('mdw-list__secondary')[0];
|
|
78
|
+
if (secondaryElement) {
|
|
79
|
+
ListSecondary.attach(secondaryElement);
|
|
80
|
+
}
|
|
81
|
+
Keyboard.attach(listContentElement);
|
|
82
|
+
listContentElement.addEventListener(Keyboard.ENTER_KEY, onEnterKey);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* @param {Element} listContentElement
|
|
86
|
+
* @return {void}
|
|
87
|
+
*/
|
|
88
|
+
export function detach(listContentElement) {
|
|
89
|
+
Keyboard.detach(listContentElement);
|
|
90
|
+
const secondaryElement = listContentElement.getElementsByClassName('mdw-list__secondary')[0];
|
|
91
|
+
if (secondaryElement) {
|
|
92
|
+
ListSecondary.detach(secondaryElement);
|
|
93
|
+
}
|
|
94
|
+
Ripple.detach(listContentElement);
|
|
95
|
+
Overlay.detach(listContentElement);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @param {Element} element
|
|
100
|
+
* @param {string|boolean} value
|
|
101
|
+
* @param {boolean} [dispatchEvent=true]
|
|
102
|
+
* @return {boolean} successful
|
|
103
|
+
*/
|
|
104
|
+
export function setSelected(element, value, dispatchEvent = true) {
|
|
105
|
+
return Attributes.setSelected(element, value, dispatchEvent ? SELECTED_CHANGE_EVENT : null);
|
|
106
|
+
}
|