@shortfuse/materialdesignweb 0.3.0 → 0.4.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/.eslintrc.json +136 -30
- package/.stylelintrc.json +6 -40
- package/.vscode/launch.json +20 -5
- package/CHANGELOG.md +24 -0
- package/README.md +12 -9
- package/adapters/datatable/column.js +82 -74
- package/adapters/datatable/index.js +173 -131
- package/adapters/dom/index.js +529 -75
- package/adapters/list/index.js +25 -12
- package/adapters/search/index.js +13 -13
- package/components/appbar/_spec.scss +87 -64
- package/components/appbar/index.scss +2 -2
- package/components/banner/_spec.scss +8 -8
- package/components/banner/index.scss +2 -2
- package/components/bottomnav/_spec.scss +22 -17
- package/components/bottomnav/index.js +61 -52
- package/components/bottomnav/index.scss +2 -2
- package/components/bottomnav/item.js +44 -25
- package/components/button/README.md +14 -14
- package/components/button/_spec.scss +23 -22
- package/components/button/_theme.scss +37 -21
- package/components/button/index.eta +32 -0
- package/components/button/index.js +12 -12
- package/components/button/index.scss +2 -2
- package/components/card/_spec.scss +40 -36
- package/components/card/index.scss +2 -2
- package/components/chip/_spec.scss +7 -8
- package/components/chip/_theme.scss +31 -31
- package/components/chip/index.js +3 -2
- package/components/chip/index.scss +2 -2
- package/components/chip/item.js +1 -16
- package/components/datatable/_spec.scss +71 -85
- package/components/datatable/_theme.scss +61 -156
- package/components/datatable/cell.js +45 -0
- package/components/datatable/columnheader.js +47 -0
- package/components/datatable/index.js +279 -366
- package/components/datatable/index.scss +2 -2
- package/components/datatable/row.js +49 -0
- package/components/datatable/rowheader.js +18 -0
- package/components/dialog/_spec.scss +61 -41
- package/components/dialog/index.js +325 -297
- package/components/dialog/index.scss +2 -2
- package/components/divider/_spec.scss +8 -6
- package/components/divider/index.scss +2 -2
- package/components/elevation/_spec.scss +2 -2
- package/components/elevation/index.scss +2 -2
- package/components/fab/_spec.scss +23 -24
- package/components/fab/index.js +50 -50
- package/components/fab/index.scss +2 -2
- package/components/grid/_spec.scss +33 -31
- package/components/grid/index.scss +2 -2
- package/components/layout/_mixins.scss +5 -5
- package/components/layout/_spec.scss +206 -176
- package/components/layout/_theme.scss +14 -16
- package/components/layout/index.js +181 -153
- package/components/layout/index.scss +2 -2
- package/components/list/_spec.scss +117 -104
- package/components/list/_theme.scss +31 -34
- package/components/list/content.js +68 -52
- package/components/list/index.js +194 -61
- package/components/list/index.scss +2 -2
- package/components/list/item.js +136 -12
- package/components/list/secondary.js +46 -0
- package/components/menu/_spec.scss +32 -19
- package/components/menu/index.js +242 -229
- package/components/menu/index.scss +2 -2
- package/components/menu/item.js +95 -110
- package/components/progress/_spec.scss +35 -27
- package/components/progress/index.js +21 -0
- package/components/progress/index.scss +2 -1
- package/components/selection/_spec.scss +242 -224
- package/components/selection/_theme.scss +100 -95
- package/components/selection/index.eta +60 -0
- package/components/selection/index.js +76 -0
- package/components/selection/index.pug +15 -8
- package/components/selection/index.scss +2 -2
- package/components/selection/input.js +56 -0
- package/components/selection/radiogroup.js +47 -0
- package/components/slider/_spec.scss +10 -8
- package/components/slider/index.scss +2 -2
- package/components/snackbar/_spec.scss +22 -21
- package/components/snackbar/index.js +102 -111
- package/components/snackbar/index.scss +2 -2
- package/components/tab/_spec.scss +20 -19
- package/components/tab/content.js +41 -40
- package/components/tab/index.js +192 -99
- package/components/tab/index.scss +2 -2
- package/components/tab/item.js +38 -55
- package/components/tab/list.js +96 -72
- package/components/tab/panel.js +12 -13
- package/components/template/_theme.scss +11 -11
- package/components/textfield/_mixins.scss +52 -0
- package/components/textfield/_spec.scss +215 -266
- package/components/textfield/_theme.scss +95 -72
- package/components/textfield/index.eta +74 -0
- package/components/textfield/index.js +63 -57
- package/components/textfield/index.scss +2 -2
- package/components/tooltip/_spec.scss +27 -25
- package/components/tooltip/index.scss +2 -2
- package/components/type/_spec.scss +51 -38
- package/components/type/index.scss +2 -2
- package/core/_breakpoint.scss +75 -91
- package/core/_elevation.scss +10 -10
- package/core/_length.scss +9 -0
- package/core/_motion.scss +14 -14
- package/core/_platform.scss +9 -15
- package/core/_type.scss +33 -32
- package/core/aria/attributes.js +125 -25
- package/core/aria/button.js +23 -23
- package/core/aria/keyboard.js +93 -0
- package/core/aria/rovingtabindex.js +69 -154
- package/core/aria/tab.js +31 -28
- package/core/color/_theme.scss +240 -280
- package/core/color/index.scss +2 -2
- package/core/document/index.js +39 -0
- package/core/dom.js +12 -12
- package/core/overlay/_spec.scss +0 -3
- package/core/overlay/_theme.scss +56 -74
- package/core/overlay/index.js +49 -18
- package/core/overlay/index.scss +2 -2
- package/core/ripple/_spec.scss +22 -39
- package/core/ripple/_theme.scss +13 -13
- package/core/ripple/index.js +137 -134
- package/core/ripple/index.scss +2 -2
- package/core/theme/_config.scss +2 -0
- package/core/theme/_mixins.scss +172 -0
- package/core/theme/_palettes.scss +155 -135
- package/core/theme/_variables.scss +24 -15
- package/core/theme/index.js +50 -0
- package/core/throttler.js +1 -1
- package/core/transition/index.js +36 -20
- package/{docs-src → docs}/_flex.scss +0 -0
- package/{docs-src → docs}/_menuoptions.js +21 -34
- package/{docs-src → docs}/_mixins.pug +39 -26
- package/docs/_partials/_androidnavbar.eta +5 -0
- package/docs/_partials/_androidstatusbar.eta +13 -0
- package/docs/_partials/_appbar.eta +29 -0
- package/docs/_partials/_buttontest.eta +31 -0
- package/docs/_partials/_header.eta +149 -0
- package/docs/_partials/_navlistitem.eta +16 -0
- package/docs/_partials/_target.eta +1 -0
- package/{docs-src → docs}/_sample-utils.js +8 -6
- package/{docs-src → docs}/_storage.js +0 -0
- package/{docs-src → docs}/docs.scss +5 -2
- package/docs/index.eta +16 -0
- package/{docs-src → docs}/index.js +0 -0
- package/docs/pages/appbar.eta +114 -0
- package/{docs-src/components → docs/pages}/appbar.js +0 -0
- package/{docs-src/components → docs/pages}/appbar.pug +15 -18
- package/docs/pages/bottomnav.eta +188 -0
- package/{docs-src/components → docs/pages}/bottomnav.js +23 -24
- package/{docs-src/components → docs/pages}/bottomnav.pug +4 -4
- package/docs/pages/button.eta +124 -0
- package/{docs-src/components → docs/pages}/button.js +19 -19
- package/{docs-src/components → docs/pages}/button.pug +15 -15
- package/docs/pages/card.eta +90 -0
- package/{docs-src/components → docs/pages}/card.js +3 -3
- package/{docs-src/components → docs/pages}/card.pug +7 -7
- package/docs/pages/chip.eta +122 -0
- package/{docs-src/components → docs/pages}/chip.js +3 -6
- package/{docs-src/components → docs/pages}/chip.pug +2 -2
- package/docs/pages/color.eta +143 -0
- package/{docs-src/core → docs/pages}/color.js +95 -20
- package/docs/pages/color.pug +121 -0
- package/docs/pages/datatable.eta +323 -0
- package/{docs-src/components → docs/pages}/datatable.js +26 -13
- package/docs/pages/datatable.pug +283 -0
- package/docs/pages/dialog.eta +186 -0
- package/{docs-src/components → docs/pages}/dialog.js +26 -13
- package/{docs-src/components → docs/pages}/dialog.pug +46 -28
- package/docs/pages/dom.eta +26 -0
- package/docs/pages/dom.js +143 -0
- package/docs/pages/dom.pug +22 -0
- package/docs/pages/elevation.eta +35 -0
- package/{docs-src/components → docs/pages}/elevation.js +0 -0
- package/{docs-src/components → docs/pages}/elevation.pug +0 -0
- package/docs/pages/fab.eta +99 -0
- package/{docs-src/components → docs/pages}/fab.js +3 -3
- package/{docs-src/components → docs/pages}/fab.pug +2 -2
- package/docs/pages/grid.eta +135 -0
- package/{docs-src/components → docs/pages}/grid.js +1 -1
- package/{docs-src/components → docs/pages}/grid.pug +3 -3
- package/docs/pages/layout.eta +8 -0
- package/{docs-src/components → docs/pages}/layout.js +0 -0
- package/{docs-src/components → docs/pages}/layout.pug +0 -0
- package/docs/pages/list.eta +465 -0
- package/{docs-src/components → docs/pages}/list.js +2 -2
- package/{docs-src/components → docs/pages}/list.pug +7 -14
- package/docs/pages/menu.eta +276 -0
- package/{docs-src/components → docs/pages}/menu.js +14 -10
- package/{docs-src/components → docs/pages}/menu.pug +0 -0
- package/docs/pages/overlay.eta +69 -0
- package/docs/pages/overlay.js +4 -0
- package/{docs-src/core → docs/pages}/overlay.pug +14 -11
- package/docs/pages/progress.eta +23 -0
- package/{docs-src/components → docs/pages}/progress.js +1 -1
- package/{docs-src/components → docs/pages}/progress.pug +1 -1
- package/docs/pages/ripple.eta +27 -0
- package/docs/pages/ripple.js +4 -0
- package/{docs-src/core → docs/pages}/ripple.pug +4 -4
- package/docs/pages/search.eta +246 -0
- package/{docs-src/components → docs/pages}/search.js +59 -42
- package/{docs-src/components → docs/pages}/search.pug +50 -51
- package/docs/pages/selection.eta +111 -0
- package/docs/pages/selection.js +13 -0
- package/docs/pages/selection.pug +74 -0
- package/docs/pages/slider.eta +23 -0
- package/{docs-src/components → docs/pages}/slider.js +0 -0
- package/{docs-src/components → docs/pages}/slider.pug +0 -0
- package/docs/pages/snackbar.eta +83 -0
- package/{docs-src/components → docs/pages}/snackbar.js +3 -3
- package/{docs-src/components → docs/pages}/snackbar.pug +0 -0
- package/docs/pages/tab.eta +421 -0
- package/{docs-src/components → docs/pages}/tab.js +18 -35
- package/{docs-src/components → docs/pages}/tab.pug +4 -4
- package/docs/pages/textfield.eta +486 -0
- package/{docs-src/components → docs/pages}/textfield.js +3 -4
- package/{docs-src/components → docs/pages}/textfield.pug +87 -35
- package/docs/pages/tooltip.eta +94 -0
- package/{docs-src/components → docs/pages}/tooltip.js +0 -0
- package/{docs-src/components → docs/pages}/tooltip.pug +0 -1
- package/docs/pages/transition.eta +117 -0
- package/{docs-src/core → docs/pages}/transition.js +7 -8
- package/{docs-src/core → docs/pages}/transition.pug +0 -0
- package/docs/pages/type.eta +31 -0
- package/{docs-src/components → docs/pages}/type.js +0 -0
- package/{docs-src/components → docs/pages}/type.pug +0 -1
- package/docs/postrender.js +39 -0
- package/{docs-src → docs}/prerender.js +3 -9
- package/docs/pwa/_dialogs.eta +143 -0
- package/docs/pwa/_dialogs.pug +96 -0
- package/docs/pwa/_menus.eta +16 -0
- package/{docs-src → docs}/pwa/_menus.pug +0 -0
- package/docs/pwa/pwa-prerender.js +3 -0
- package/docs/pwa/pwa.eta +480 -0
- package/docs/pwa/pwa.js +306 -0
- package/{docs-src → docs}/pwa/pwa.pug +166 -263
- package/docs/pwa/pwa.scss +26 -0
- package/docs/spec.scss +26 -0
- package/docs/themes/_component-themes.scss +26 -0
- package/docs/themes/theme-colored-fallbacks.scss +17 -0
- package/docs/themes/theme-colored.scss +17 -0
- package/docs/themes/theme-default-fallbacks.scss +17 -0
- package/docs/themes/theme-default.scss +17 -0
- package/jsconfig.json +4 -2
- package/package.json +40 -27
- package/scripts/deploy-docs.sh +9 -0
- package/templates/index.eta +2 -0
- package/utils/function.js +3 -0
- package/webpack.config.cjs +257 -0
- package/_spec.scss +0 -27
- package/_theme.scss +0 -27
- package/components/list/expander.js +0 -142
- package/components/list/itemgroup.js +0 -22
- package/core/theme/_builder.scss +0 -116
- package/core/theme/index.scss +0 -68
- package/docs/appbar.html +0 -1
- package/docs/appbar.min.js +0 -2
- package/docs/appbar.min.js.map +0 -1
- 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/chip.html +0 -1
- package/docs/chip.min.js +0 -2
- package/docs/chip.min.js.map +0 -1
- package/docs/color.html +0 -1
- package/docs/color.min.js +0 -2
- package/docs/color.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/default.common.min.js +0 -2
- package/docs/default.common.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/grid.html +0 -1
- package/docs/grid.min.js +0 -2
- package/docs/grid.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/ink.html +0 -1
- package/docs/ink.min.js +0 -2
- package/docs/ink.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/overlay.html +0 -1
- package/docs/overlay.min.js +0 -2
- package/docs/overlay.min.js.map +0 -1
- package/docs/prerender.common.min.js +0 -2
- package/docs/prerender.common.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/pwa-prerender.min.js +0 -2
- package/docs/pwa-prerender.min.js.map +0 -1
- package/docs/pwa.html +0 -11
- package/docs/pwa.min.css +0 -1
- package/docs/pwa.min.js +0 -2
- package/docs/pwa.min.js.map +0 -1
- package/docs/ripple.html +0 -1
- package/docs/ripple.min.js +0 -2
- package/docs/ripple.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/spec.min.css +0 -1
- package/docs/spec.min.js +0 -2
- package/docs/spec.min.js.map +0 -1
- package/docs/surface.html +0 -1
- package/docs/surface.min.js +0 -2
- package/docs/surface.min.js.map +0 -1
- 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/theme-colored-fallbacks.min.css +0 -1
- package/docs/theme-colored-fallbacks.min.js +0 -2
- package/docs/theme-colored-fallbacks.min.js.map +0 -1
- package/docs/theme-colored.min.css +0 -1
- package/docs/theme-colored.min.js +0 -2
- package/docs/theme-colored.min.js.map +0 -1
- package/docs/theme-default-fallbacks.min.css +0 -1
- package/docs/theme-default-fallbacks.min.js +0 -2
- package/docs/theme-default-fallbacks.min.js.map +0 -1
- package/docs/theme-default.min.css +0 -1
- package/docs/theme-default.min.js +0 -2
- package/docs/theme-default.min.js.map +0 -1
- package/docs/themes-fallbacks.min.css +0 -1
- package/docs/themes-fallbacks.min.js +0 -2
- package/docs/themes-fallbacks.min.js.map +0 -1
- package/docs/themes.min.css +0 -1
- package/docs/themes.min.js +0 -2
- package/docs/themes.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/transition.html +0 -1
- package/docs/transition.min.js +0 -2
- package/docs/transition.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/docs-src/components/datatable.pug +0 -327
- package/docs-src/components/selection.js +0 -9
- package/docs-src/components/selection.pug +0 -77
- package/docs-src/core/color.pug +0 -201
- package/docs-src/core/overlay.js +0 -4
- package/docs-src/core/ripple.js +0 -4
- package/docs-src/index.pug +0 -9
- package/docs-src/pwa/_dialogs.pug +0 -15
- package/docs-src/pwa/pwa-prerender.js +0 -3
- package/docs-src/pwa/pwa.js +0 -182
- package/docs-src/pwa/pwa.scss +0 -25
- package/docs-src/spec.scss +0 -1
- package/docs-src/themes/theme-colored-fallbacks.scss +0 -14
- package/docs-src/themes/theme-colored.scss +0 -14
- package/docs-src/themes/theme-default-fallbacks.scss +0 -14
- package/docs-src/themes/theme-default.scss +0 -14
- package/index.js +0 -51
- package/index.scss +0 -2
- package/webpack.config.js +0 -187
|
@@ -1,37 +1,35 @@
|
|
|
1
1
|
// https://material.io/guidelines/components/lists.html
|
|
2
2
|
// https://material.io/guidelines/components/lists-controls.html
|
|
3
3
|
|
|
4
|
-
@
|
|
5
|
-
@
|
|
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;
|
|
6
9
|
|
|
7
|
-
$
|
|
10
|
+
$dividerHeight: dp(1) !default;
|
|
8
11
|
|
|
9
12
|
.mdw-list {
|
|
10
|
-
padding-top: dp(8);
|
|
11
|
-
padding-bottom: dp(8);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.mdw-list__item-group {
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
ul.mdw-list,
|
|
20
|
-
ul.mdw-list__item-group {
|
|
21
13
|
margin: 0;
|
|
22
|
-
padding
|
|
23
|
-
padding-left: 0;
|
|
14
|
+
padding: 0;
|
|
24
15
|
|
|
25
16
|
list-style-type: none;
|
|
26
|
-
}
|
|
27
17
|
|
|
18
|
+
&[mdw-margin-top] {
|
|
19
|
+
margin-top: dp(8);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&[mdw-margin-bottom] {
|
|
23
|
+
margin-bottom: dp(8);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
28
26
|
|
|
29
27
|
|
|
30
28
|
li.mdw-list__item {
|
|
31
29
|
position: relative;
|
|
32
30
|
|
|
33
31
|
margin: 0;
|
|
34
|
-
|
|
32
|
+
|
|
35
33
|
-moz-appearance: none;
|
|
36
34
|
-webkit-appearance: none;
|
|
37
35
|
appearance: none;
|
|
@@ -41,23 +39,16 @@ li.mdw-list__item {
|
|
|
41
39
|
text-transform: none;
|
|
42
40
|
}
|
|
43
41
|
|
|
44
|
-
.mdw-
|
|
45
|
-
|
|
46
|
-
position: relative;
|
|
47
|
-
align-content: flex-start;
|
|
48
|
-
flex-direction: row;
|
|
49
|
-
overflow: hidden;
|
|
42
|
+
a.mdw-list__content {
|
|
43
|
+
text-decoration: none;
|
|
50
44
|
}
|
|
51
45
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
text-decoration: none;
|
|
46
|
+
.mdw-list__content > .mdw-divider__vertical {
|
|
47
|
+
height: dp(40);
|
|
55
48
|
}
|
|
56
49
|
|
|
57
|
-
.mdw-
|
|
50
|
+
.mdw-list__subheader,
|
|
58
51
|
.mdw-list__content {
|
|
59
|
-
@include type-rules('subtitle');
|
|
60
|
-
|
|
61
52
|
display: flex;
|
|
62
53
|
align-items: center;
|
|
63
54
|
flex-direction: row;
|
|
@@ -67,10 +58,17 @@ a.mdw-list__expander-content {
|
|
|
67
58
|
min-height: dp(48);
|
|
68
59
|
flex: 1;
|
|
69
60
|
padding: 0 dp(24);
|
|
70
|
-
@include
|
|
61
|
+
@include breakpoint.has16DPMargin() {
|
|
71
62
|
padding: 0 dp(16);
|
|
72
63
|
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.mdw-list__subheader {
|
|
67
|
+
@include type.addRules('body-2');
|
|
68
|
+
}
|
|
73
69
|
|
|
70
|
+
.mdw-list__content {
|
|
71
|
+
@include type.addRules('subtitle');
|
|
74
72
|
cursor: pointer;
|
|
75
73
|
|
|
76
74
|
text-align: start;
|
|
@@ -82,19 +80,6 @@ a.mdw-list__expander-content {
|
|
|
82
80
|
}
|
|
83
81
|
}
|
|
84
82
|
|
|
85
|
-
.mdw-list__subheader {
|
|
86
|
-
@include type-rules('body-2');
|
|
87
|
-
|
|
88
|
-
display: flex;
|
|
89
|
-
align-items: center;
|
|
90
|
-
flex-direction: row;
|
|
91
|
-
justify-content: stretch;
|
|
92
|
-
|
|
93
|
-
min-height: dp(48);
|
|
94
|
-
padding-right: dp(16);
|
|
95
|
-
padding-left: dp(16);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
83
|
.mdw-list__avatar,
|
|
99
84
|
.mdw-list__icon {
|
|
100
85
|
display: flex;
|
|
@@ -113,25 +98,32 @@ a.mdw-list__expander-content {
|
|
|
113
98
|
min-height: dp(40);
|
|
114
99
|
}
|
|
115
100
|
|
|
116
|
-
.mdw-
|
|
101
|
+
.mdw-list__item {
|
|
117
102
|
display: flex;
|
|
118
|
-
position: relative;
|
|
119
103
|
flex-direction: column;
|
|
104
|
+
|
|
120
105
|
outline: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.mdw-list__item[aria-expanded] {
|
|
109
|
+
position: relative;
|
|
121
110
|
|
|
122
111
|
&::before,
|
|
123
112
|
&::after {
|
|
124
|
-
content: '';
|
|
125
|
-
|
|
126
113
|
position: absolute;
|
|
114
|
+
|
|
127
115
|
right: 0;
|
|
128
116
|
left: 0;
|
|
129
|
-
background-color: transparent;
|
|
130
117
|
|
|
131
|
-
transition-property: background-color;
|
|
132
|
-
transition-duration: $mdw-motion__shape-change-duration;
|
|
133
|
-
transition-timing-function: $mdw-motion__standard-easing;
|
|
134
118
|
height: dp(1);
|
|
119
|
+
|
|
120
|
+
transition-duration: motion.$shapeChangeDuration;
|
|
121
|
+
|
|
122
|
+
transition-property: background-color;
|
|
123
|
+
transition-timing-function: motion.$standardEasing;
|
|
124
|
+
|
|
125
|
+
background-color: transparent;
|
|
126
|
+
content: '';
|
|
135
127
|
}
|
|
136
128
|
|
|
137
129
|
&::before {
|
|
@@ -142,49 +134,59 @@ a.mdw-list__expander-content {
|
|
|
142
134
|
bottom: 0;
|
|
143
135
|
}
|
|
144
136
|
|
|
145
|
-
& > .mdw-
|
|
137
|
+
& > .mdw-list__content .mdw-list__secondary {
|
|
146
138
|
min-height: dp(48);
|
|
147
139
|
|
|
148
|
-
transition-duration:
|
|
140
|
+
transition-duration: motion.$shapeChangeDuration;
|
|
149
141
|
transition-property: transform;
|
|
150
|
-
transition-timing-function:
|
|
142
|
+
transition-timing-function: motion.$standardEasing;
|
|
151
143
|
|
|
152
144
|
pointer-events: none;
|
|
153
145
|
transform: rotate(0deg);
|
|
154
146
|
}
|
|
155
147
|
|
|
156
|
-
& > .mdw-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
animation-timing-function: $mdw-motion__accelerate-easing;
|
|
160
|
-
animation-fill-mode: forwards;
|
|
161
|
-
}
|
|
148
|
+
& > .mdw-list {
|
|
149
|
+
display: flex;
|
|
150
|
+
flex-direction: column;
|
|
162
151
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
152
|
+
& > .mdw-list__item {
|
|
153
|
+
overflow: hidden;
|
|
166
154
|
|
|
167
|
-
|
|
168
|
-
|
|
155
|
+
flex-basis: 0;
|
|
156
|
+
|
|
157
|
+
animation-duration: motion.$collapseDuration;
|
|
158
|
+
animation-timing-function: motion.$accelerateEasing;
|
|
159
|
+
animation-fill-mode: forwards;
|
|
160
|
+
}
|
|
169
161
|
}
|
|
170
162
|
|
|
171
|
-
&[aria-expanded="
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
163
|
+
&[aria-expanded="false"] {
|
|
164
|
+
& > .mdw-list > .mdw-list__item {
|
|
165
|
+
animation-name: collapseRow;
|
|
166
|
+
}
|
|
175
167
|
}
|
|
176
168
|
|
|
177
|
-
|
|
178
|
-
|
|
169
|
+
&[aria-expanded="true"] {
|
|
170
|
+
& > .mdw-list__content .mdw-list__secondary {
|
|
171
|
+
transform: rotate(180deg);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
& > .mdw-list > .mdw-list__item {
|
|
175
|
+
animation-name: expandRow;
|
|
176
|
+
animation-duration: motion.$expandDuration;
|
|
177
|
+
animation-timing-function: motion.$decelerateEasing;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
& + .mdw-list__list-item[aria-expanded="true"]::before {
|
|
181
|
+
display: none;
|
|
182
|
+
}
|
|
179
183
|
}
|
|
180
184
|
|
|
181
|
-
|
|
182
|
-
|
|
185
|
+
&:not([mdw-expander-js]) > .mdw-list .mdw-list__item {
|
|
186
|
+
animation-duration: 0s;
|
|
183
187
|
}
|
|
184
188
|
}
|
|
185
189
|
|
|
186
|
-
|
|
187
|
-
|
|
188
190
|
@keyframes expandRow {
|
|
189
191
|
0% {
|
|
190
192
|
min-height: 0;
|
|
@@ -230,32 +232,44 @@ a.mdw-list__expander-content {
|
|
|
230
232
|
|
|
231
233
|
.mdw-list__secondary {
|
|
232
234
|
display: flex;
|
|
235
|
+
position: relative;
|
|
233
236
|
align-items: center;
|
|
237
|
+
align-self: stretch;
|
|
234
238
|
flex-direction: row;
|
|
235
|
-
-ms-grid-column: 3;
|
|
236
|
-
grid-column: 3;
|
|
237
|
-
-ms-grid-column-span: 1;
|
|
238
|
-
grid-column-end: span 1;
|
|
239
239
|
justify-content: center;
|
|
240
240
|
order: 1;
|
|
241
|
-
|
|
242
|
-
min-height: dp(56);
|
|
241
|
+
|
|
243
242
|
min-width: dp(24);
|
|
244
|
-
margin-right:
|
|
245
|
-
margin-left:
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
margin-right: dp(-24);
|
|
244
|
+
margin-left: 0;
|
|
245
|
+
border-width: dp(1);
|
|
246
|
+
padding: 0 dp(24);
|
|
248
247
|
|
|
249
248
|
pointer-events: none;
|
|
250
249
|
|
|
251
|
-
:
|
|
252
|
-
|
|
250
|
+
z-index: 1;
|
|
251
|
+
@include breakpoint.has16DPMargin() {
|
|
252
|
+
margin-right: dp(-16);
|
|
253
253
|
margin-left: 0;
|
|
254
|
+
padding: 0 dp(16);
|
|
254
255
|
}
|
|
255
256
|
|
|
257
|
+
:root[dir="rtl"] & {
|
|
258
|
+
margin-right: 0;
|
|
259
|
+
margin-left: dp(-24);
|
|
260
|
+
@include breakpoint.has16DPMargin() {
|
|
261
|
+
margin-right: 0;
|
|
262
|
+
margin-left: dp(-16);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
&[mdw-action] {
|
|
267
|
+
pointer-events: auto;
|
|
268
|
+
}
|
|
256
269
|
}
|
|
257
270
|
|
|
258
|
-
|
|
271
|
+
|
|
272
|
+
@include platform.ifIE() {
|
|
259
273
|
.mdw-list__icon::after,
|
|
260
274
|
.mdw-list__secondary::after {
|
|
261
275
|
// Fix IE min-height flexbug
|
|
@@ -279,7 +293,6 @@ a.mdw-list__expander-content {
|
|
|
279
293
|
text-overflow: ellipsis;
|
|
280
294
|
}
|
|
281
295
|
|
|
282
|
-
|
|
283
296
|
.mdw-list[mdw-divider] .mdw-list__item:not(:last-child) {
|
|
284
297
|
.mdw-list__text::after {
|
|
285
298
|
content: '';
|
|
@@ -289,14 +302,14 @@ a.mdw-list__expander-content {
|
|
|
289
302
|
bottom: 0;
|
|
290
303
|
left: 0;
|
|
291
304
|
|
|
292
|
-
height: $
|
|
305
|
+
height: $dividerHeight;
|
|
293
306
|
width: 100%;
|
|
294
307
|
}
|
|
308
|
+
}
|
|
295
309
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
310
|
+
.mdw-list__avatar ~ .mdw-list__text::after,
|
|
311
|
+
.mdw-list[mdw-divider] > .mdw-list__item:not(:last-child) .mdw-list__icon ~ .mdw-list__text::after {
|
|
312
|
+
margin-left: dp(72);
|
|
300
313
|
}
|
|
301
314
|
|
|
302
315
|
.mdw-list__text-line {
|
|
@@ -310,11 +323,11 @@ a.mdw-list__expander-content {
|
|
|
310
323
|
.mdw-list__text-line:first-child,
|
|
311
324
|
.mdw-list__text-block:first-child,
|
|
312
325
|
.mdw-list__meta {
|
|
313
|
-
@include
|
|
326
|
+
@include type.baselineToTop(28);
|
|
314
327
|
}
|
|
315
328
|
|
|
316
329
|
.mdw-list__meta {
|
|
317
|
-
@include type
|
|
330
|
+
@include type.addRules('caption');
|
|
318
331
|
align-self: flex-start;
|
|
319
332
|
|
|
320
333
|
margin-right: 0;
|
|
@@ -329,27 +342,27 @@ a.mdw-list__expander-content {
|
|
|
329
342
|
|
|
330
343
|
// First line is pushed up 20dp
|
|
331
344
|
.mdw-list__text-line:first-child {
|
|
332
|
-
@include
|
|
345
|
+
@include type.baselineToBottom(20);
|
|
333
346
|
}
|
|
334
347
|
|
|
335
348
|
// Second and third lines are pushed up 20dp and its above element is pushed 20dp
|
|
336
349
|
.mdw-list__text-line:not(:first-child),
|
|
337
350
|
.mdw-list__text-block:not(:first-child) {
|
|
338
|
-
@include type
|
|
339
|
-
@include
|
|
351
|
+
@include type.addRules('body-2');
|
|
352
|
+
@include type.baselineToTop(20);
|
|
340
353
|
margin-top: dp(-20);
|
|
341
354
|
}
|
|
342
355
|
|
|
343
356
|
// Second line is pushed up 16dp from baseline
|
|
344
357
|
.mdw-list__text-line:last-child {
|
|
345
|
-
@include
|
|
358
|
+
@include type.baselineToBottom(16);
|
|
346
359
|
}
|
|
347
360
|
|
|
348
361
|
|
|
349
362
|
// When 3-lines, 2nd and 3rd lines are pushed up 20dp
|
|
350
363
|
.mdw-list__text-line:nth-child(3),
|
|
351
364
|
.mdw-list__text-line:not(:first-child):not(:last-child) {
|
|
352
|
-
@include
|
|
365
|
+
@include type.baselineToBottom(20);
|
|
353
366
|
}
|
|
354
367
|
|
|
355
368
|
|
|
@@ -368,8 +381,8 @@ a.mdw-list__expander-content {
|
|
|
368
381
|
white-space: normal;
|
|
369
382
|
-webkit-box-orient: vertical;
|
|
370
383
|
-webkit-line-clamp: 2;
|
|
371
|
-
word-break: break-word;
|
|
372
384
|
|
|
385
|
+
word-break: break-word;
|
|
373
386
|
|
|
374
387
|
&:not(:only-child) {
|
|
375
388
|
max-height: sp(20 * 2);
|
|
@@ -379,6 +392,6 @@ a.mdw-list__expander-content {
|
|
|
379
392
|
}
|
|
380
393
|
|
|
381
394
|
&:only-child {
|
|
382
|
-
@include
|
|
395
|
+
@include type.baselineToBottom(16);
|
|
383
396
|
}
|
|
384
397
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
@
|
|
2
|
-
@import '../../core/theme/index.scss';
|
|
1
|
+
@use '../../core/theme/_mixins.scss' as theme;
|
|
3
2
|
|
|
4
|
-
$
|
|
5
|
-
|
|
6
|
-
divider-
|
|
3
|
+
$themeValues: (
|
|
4
|
+
divider-color: theme.$foreground,
|
|
5
|
+
divider-opacity: theme.$divider-opacity,
|
|
7
6
|
|
|
8
7
|
focus-opacity: (0.12, 0.24),
|
|
9
8
|
hover-focus-opacity: (0.04 + 0.12, 0.08 + 0.24),
|
|
@@ -15,15 +14,13 @@ $mdw-list__theme-values: (
|
|
|
15
14
|
|
|
16
15
|
) !default;
|
|
17
16
|
|
|
18
|
-
@function
|
|
19
|
-
@return
|
|
17
|
+
@function getThemeValue($key, $type) {
|
|
18
|
+
@return theme.getThemeValue('list', $themeValues, $key, $type);
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
@mixin
|
|
23
|
-
|
|
21
|
+
@mixin addThemeRules($type: 'var') {
|
|
24
22
|
.mdw-list__content {
|
|
25
|
-
&[mdw-ink][aria-current]
|
|
26
|
-
&[mdw-ink][aria-selected="true"] {
|
|
23
|
+
&[mdw-ink][aria-current] {
|
|
27
24
|
.mdw-list__icon,
|
|
28
25
|
.mdw-list__text {
|
|
29
26
|
color: inherit;
|
|
@@ -33,20 +30,20 @@ $mdw-list__theme-values: (
|
|
|
33
30
|
|
|
34
31
|
.mdw-list[mdw-divider] {
|
|
35
32
|
& > .mdw-list__item:not(:last-child) .mdw-list__text::after {
|
|
36
|
-
background-color:
|
|
33
|
+
background-color: RGBA(getThemeValue("divider-color", $type), getThemeValue("divider-opacity", $type));
|
|
37
34
|
}
|
|
38
35
|
}
|
|
39
36
|
|
|
40
|
-
.mdw-
|
|
41
|
-
& > .mdw-
|
|
37
|
+
.mdw-list__item[aria-expanded]:focus {
|
|
38
|
+
& > .mdw-list__content {
|
|
42
39
|
&:not([mdw-overlay-touch="true"]) {
|
|
43
40
|
&:not([mdw-overlay-off~="focus"]):not([mdw-overlay-touch="true"])::before {
|
|
44
|
-
opacity:
|
|
41
|
+
opacity: getThemeValue("focus-opacity", $type);
|
|
45
42
|
}
|
|
46
43
|
|
|
47
|
-
&:not([
|
|
44
|
+
&:not([aria-disabled="true"]):not([mdw-overlay-touch="true"]) {
|
|
48
45
|
&:hover:not([mdw-overlay-off~="hover"]):not([mdw-overlay-off~="focus"])::before {
|
|
49
|
-
opacity:
|
|
46
|
+
opacity: getThemeValue("hover-focus-opacity", $type);
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
49
|
}
|
|
@@ -55,12 +52,12 @@ $mdw-list__theme-values: (
|
|
|
55
52
|
&[aria-selected="true"]:not([mdw-overlay-off~="selected"]) {
|
|
56
53
|
&:not([mdw-overlay-touch="true"]) {
|
|
57
54
|
&:focus:not([mdw-overlay-off~="focus"])::before {
|
|
58
|
-
opacity:
|
|
55
|
+
opacity: getThemeValue("selected-focus-opacity", $type);
|
|
59
56
|
}
|
|
60
57
|
|
|
61
|
-
&:not([
|
|
58
|
+
&:not([aria-disabled="true"]) {
|
|
62
59
|
&:hover:not([mdw-overlay-off~="hover"]):not([mdw-overlay-off~="focus"])::before {
|
|
63
|
-
opacity:
|
|
60
|
+
opacity: getThemeValue("selected-hover-focus-opacity", $type);
|
|
64
61
|
}
|
|
65
62
|
}
|
|
66
63
|
}
|
|
@@ -71,12 +68,12 @@ $mdw-list__theme-values: (
|
|
|
71
68
|
&[aria-pressed="true"]:not([mdw-overlay-off~="activated"]) {
|
|
72
69
|
&:not([mdw-overlay-touch="true"]) {
|
|
73
70
|
&:not([mdw-overlay-off~="focus"])::before {
|
|
74
|
-
opacity:
|
|
71
|
+
opacity: getThemeValue("activated-focus-opacity", $type);
|
|
75
72
|
}
|
|
76
73
|
|
|
77
|
-
&:not([
|
|
74
|
+
&:not([aria-disabled="true"]) {
|
|
78
75
|
&:hover:not([mdw-overlay-off~="hover"]):not([mdw-overlay-off~="focus"])::before {
|
|
79
|
-
opacity:
|
|
76
|
+
opacity: getThemeValue("activated-hover-focus-opacity", $type);
|
|
80
77
|
}
|
|
81
78
|
}
|
|
82
79
|
}
|
|
@@ -84,16 +81,16 @@ $mdw-list__theme-values: (
|
|
|
84
81
|
}
|
|
85
82
|
}
|
|
86
83
|
|
|
87
|
-
.mdw-
|
|
84
|
+
.mdw-list__item[aria-expanded="true"] {
|
|
88
85
|
&::before,
|
|
89
86
|
&::after {
|
|
90
|
-
background-color:
|
|
87
|
+
background-color: RGBA(getThemeValue("divider-color", $type), getThemeValue("divider-opacity", $type));
|
|
91
88
|
}
|
|
92
89
|
|
|
93
90
|
&[mdw-ink][aria-expanded="true"] {
|
|
94
|
-
& > .mdw-
|
|
95
|
-
& > .mdw-
|
|
96
|
-
& > .mdw-
|
|
91
|
+
& > .mdw-list__content,
|
|
92
|
+
& > .mdw-list__content::before,
|
|
93
|
+
& > .mdw-list__content > .mdw-list__text {
|
|
97
94
|
color: inherit;
|
|
98
95
|
}
|
|
99
96
|
}
|
|
@@ -102,13 +99,13 @@ $mdw-list__theme-values: (
|
|
|
102
99
|
}
|
|
103
100
|
|
|
104
101
|
|
|
105
|
-
@include
|
|
106
|
-
@include
|
|
102
|
+
@include theme.addComponentFallbackRules('light') {
|
|
103
|
+
@include addThemeRules('light');
|
|
107
104
|
}
|
|
108
|
-
@include
|
|
109
|
-
@include
|
|
105
|
+
@include theme.addComponentFallbackRules('dark') {
|
|
106
|
+
@include addThemeRules('dark');
|
|
110
107
|
}
|
|
111
108
|
|
|
112
|
-
@include
|
|
113
|
-
@include
|
|
109
|
+
@include theme.addComponentCSSVariableRules('list', $themeValues) {
|
|
110
|
+
@include addThemeRules();
|
|
114
111
|
}
|
|
@@ -1,58 +1,61 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
1
|
+
import * as Attributes from '../../core/aria/attributes.js';
|
|
2
|
+
import * as Keyboard from '../../core/aria/keyboard.js';
|
|
3
|
+
import { dispatchDomEvent, iterateArrayLike } 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';
|
|
4
8
|
|
|
5
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';
|
|
6
12
|
|
|
7
13
|
/**
|
|
8
|
-
* @param {
|
|
14
|
+
* @param {CustomEvent} event
|
|
9
15
|
* @return {void}
|
|
10
16
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Overlay.attach(listContentElement);
|
|
17
|
+
function onEnterKey(event) {
|
|
18
|
+
if (event.detail.ctrlKey || event.detail.shiftKey
|
|
19
|
+
|| event.detail.altKey || event.detail.metaKey) {
|
|
20
|
+
return;
|
|
16
21
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
/** @type {HTMLElement} */
|
|
23
|
+
const listContentElement = (event.currentTarget);
|
|
24
|
+
if (!listContentElement) {
|
|
25
|
+
return;
|
|
20
26
|
}
|
|
27
|
+
event.stopPropagation();
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
|
|
30
|
+
// Slightly redundant, but performs ripple
|
|
31
|
+
const newEvent = document.createEvent('Event');
|
|
32
|
+
newEvent.initEvent('click', true, true);
|
|
33
|
+
listContentElement.dispatchEvent(newEvent);
|
|
21
34
|
}
|
|
22
35
|
|
|
23
36
|
/**
|
|
24
|
-
* @param {KeyboardEvent} event
|
|
37
|
+
* @param {MouseEvent|KeyboardEvent|PointerEvent} event
|
|
25
38
|
* @return {void}
|
|
26
39
|
*/
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (event.key !== 'Enter' && event.key !== 'Spacebar' && event.key !== ' ') {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (document.activeElement !== event.currentTarget) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
40
|
+
export function onClick(event) {
|
|
41
|
+
event.preventDefault();
|
|
37
42
|
/** @type {HTMLElement} */
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
43
|
+
const listContentElement = (event.currentTarget);
|
|
44
|
+
if (Attributes.isDisabled(listContentElement)) {
|
|
40
45
|
return;
|
|
41
46
|
}
|
|
42
|
-
|
|
43
|
-
event.preventDefault();
|
|
44
|
-
const newEvent = document.createEvent('Event');
|
|
45
|
-
newEvent.initEvent('click', true, true);
|
|
46
|
-
element.dispatchEvent(newEvent);
|
|
47
|
+
dispatchDomEvent(listContentElement, ACTIVATE_EVENT);
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
51
|
* @param {Element} listContentElement
|
|
51
52
|
* @return {void}
|
|
52
53
|
*/
|
|
53
|
-
export function
|
|
54
|
+
export function attach(listContentElement) {
|
|
54
55
|
if (!listContentElement.hasAttribute('role')) {
|
|
55
|
-
listContentElement.
|
|
56
|
+
if (listContentElement.parentElement.getAttribute('role') === 'none') {
|
|
57
|
+
listContentElement.setAttribute('role', 'option');
|
|
58
|
+
}
|
|
56
59
|
}
|
|
57
60
|
iterateArrayLike(listContentElement.getElementsByClassName('mdw-list__icon'), (el) => {
|
|
58
61
|
el.setAttribute('aria-hidden', 'true');
|
|
@@ -61,34 +64,47 @@ export function attachCore(listContentElement) {
|
|
|
61
64
|
el.setAttribute('aria-hidden', 'true');
|
|
62
65
|
});
|
|
63
66
|
listContentElement.addEventListener('click', onClick);
|
|
64
|
-
listContentElement.addEventListener('keydown', onKeyDown);
|
|
65
|
-
}
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
if (!listContentElement.hasAttribute('mdw-no-overlay')) {
|
|
69
|
+
listContentElement.classList.add('mdw-overlay');
|
|
70
|
+
Overlay.attach(listContentElement);
|
|
71
|
+
}
|
|
72
|
+
if (!listContentElement.hasAttribute('mdw-no-ripple')) {
|
|
73
|
+
listContentElement.classList.add('mdw-ripple');
|
|
74
|
+
Ripple.attach(listContentElement);
|
|
75
|
+
}
|
|
76
|
+
if (listContentElement.getAttribute('role') === 'radio'
|
|
77
|
+
&& listContentElement.getAttribute('aria-checked') === 'true'
|
|
78
|
+
&& listContentElement.getAttribute('tabindex') !== '0') {
|
|
79
|
+
listContentElement.setAttribute('tabindex', '0');
|
|
80
|
+
}
|
|
81
|
+
const secondaryElement = listContentElement.getElementsByClassName('mdw-list__secondary')[0];
|
|
82
|
+
if (secondaryElement) {
|
|
83
|
+
ListSecondary.attach(secondaryElement);
|
|
84
|
+
}
|
|
85
|
+
Keyboard.attach(listContentElement);
|
|
86
|
+
listContentElement.addEventListener(Keyboard.ENTER_KEY, onEnterKey);
|
|
75
87
|
}
|
|
76
|
-
|
|
77
88
|
/**
|
|
78
89
|
* @param {Element} listContentElement
|
|
79
90
|
* @return {void}
|
|
80
91
|
*/
|
|
81
|
-
export function
|
|
82
|
-
|
|
83
|
-
listContentElement.
|
|
92
|
+
export function detach(listContentElement) {
|
|
93
|
+
Keyboard.detach(listContentElement);
|
|
94
|
+
const secondaryElement = listContentElement.getElementsByClassName('mdw-list__secondary')[0];
|
|
95
|
+
if (secondaryElement) {
|
|
96
|
+
ListSecondary.detach(secondaryElement);
|
|
97
|
+
}
|
|
98
|
+
Ripple.detach(listContentElement);
|
|
99
|
+
Overlay.detach(listContentElement);
|
|
84
100
|
}
|
|
85
101
|
|
|
86
102
|
/**
|
|
87
|
-
* @param {Element}
|
|
88
|
-
* @
|
|
103
|
+
* @param {Element} element
|
|
104
|
+
* @param {string|boolean} value
|
|
105
|
+
* @param {boolean} [dispatchEvent=true]
|
|
106
|
+
* @return {boolean} successful
|
|
89
107
|
*/
|
|
90
|
-
export function
|
|
91
|
-
|
|
92
|
-
Ripple.detach(listContentElement);
|
|
93
|
-
Overlay.detach(listContentElement);
|
|
108
|
+
export function setSelected(element, value, dispatchEvent = true) {
|
|
109
|
+
return Attributes.setSelected(element, value, dispatchEvent ? SELECTED_CHANGE_EVENT : null);
|
|
94
110
|
}
|