@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
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
<% var T = '../../templates/index.eta' %>
|
|
2
|
+
<% layout('../_partials/_header.eta', {page: 'bottomnav'}) %>
|
|
3
|
+
<div class="mdw-grid" mdw-margin-top mdw-margin-bottom mdw-stretch>
|
|
4
|
+
<div class="mdw-grid__item" mdw-colspan="100%">
|
|
5
|
+
<h5 class="mdw-type" mdw-baseline-next="36">Bottom navigation bars allow movement between primary destinations in an app.</h5>
|
|
6
|
+
<p class="mdw-typeBottom">navigation bars display three to five destinations at the bottom of a screen. Each destination is represented by an icon and an optional text label. When a bottom navigation icon is tapped, the user is taken to the top-level navigation destination associated with that icon.</p>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="mdw-grid__item" mdw-colspan="6">
|
|
9
|
+
<div class="mdw-grid__content component-sample">
|
|
10
|
+
<div class="render-fill">
|
|
11
|
+
<%~ includeFile('../_partials/_androidstatusbar.eta', { surface: 'background 900', dark:true }) %>
|
|
12
|
+
<%~ includeFile('../_partials/_appbar.eta', { surface: 'background 800', dark:true, body:'Bottom Navigation' }) %>
|
|
13
|
+
<div class="content"></div>
|
|
14
|
+
<nav class="mdw-bottomnav">
|
|
15
|
+
<a class="mdw-bottomnav__item mdw-theme" mdw-ink="primary" aria-selected="true">
|
|
16
|
+
<div class="mdw-bottomnav__icon">
|
|
17
|
+
<i class="material-icons">history</i>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="mdw-bottomnav__label">Recents</div>
|
|
20
|
+
</a>
|
|
21
|
+
<a class="mdw-bottomnav__item mdw-theme" mdw-ink="primary" aria-selected="false">
|
|
22
|
+
<div class="mdw-bottomnav__icon">
|
|
23
|
+
<div class="mdw-bottomnav__badge mdw-theme" mdw-surface="warn 500" mdw-ink="white" mdw-badge></div>
|
|
24
|
+
<i class="material-icons">favorite</i>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="mdw-bottomnav__label">Favorites</div>
|
|
27
|
+
</a>
|
|
28
|
+
<a class="mdw-bottomnav__item mdw-theme" mdw-ink="primary" aria-selected="false">
|
|
29
|
+
<div class="mdw-bottomnav__icon">
|
|
30
|
+
<div class="mdw-bottomnav__badge mdw-theme" mdw-surface="warn 500" mdw-ink="white" mdw-badge="99+"></div>
|
|
31
|
+
<i class="material-icons">near_me</i>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="mdw-bottomnav__label">Nearby</div>
|
|
34
|
+
</a>
|
|
35
|
+
</nav>
|
|
36
|
+
<%~ includeFile('../_partials/_androidnavbar.eta') %>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="mdw-grid__item" mdw-colspan="4">
|
|
41
|
+
<div class="mdw-type" mdw-style="subtitle">Javascript</div>
|
|
42
|
+
<div class="docs-option-list">
|
|
43
|
+
<%~ includeFile(T, { selection: { ink:'secondary', type:'radio', name:'javascript', value:'required', checked:true, text: 'Required' }}) %>
|
|
44
|
+
<%~ includeFile(T, { selection: { ink:'secondary', type:'radio', name:'javascript', value:'optional', disabled:true, text: 'Optional' }}) %>
|
|
45
|
+
<%~ includeFile(T, { selection: { ink:'secondary', type:'radio', name:'javascript', value:'none', disabled:true, text: 'None' }}) %>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="mdw-type" mdw-style="subtitle">Ink</div>
|
|
48
|
+
<div class="docs-option-list">
|
|
49
|
+
<%~ includeFile(T, {selection: { ink:'secondary', type:'radio', name:'ink', value:'default', text:'Default' }}) %>
|
|
50
|
+
<%~ includeFile(T, {selection: { ink:'secondary', type:'radio', name:'ink', value:'primary', checked:true, text:'Primary' }}) %>
|
|
51
|
+
<%~ includeFile(T, {selection: { ink:'secondary', type:'radio', name:'ink', value:'secondary', text:'Secondary' }}) %>
|
|
52
|
+
<%~ includeFile(T, {selection: { ink:'secondary', type:'radio', name:'ink', value:'warn', text:'Warn' }}) %>
|
|
53
|
+
<%~ includeFile(T, {selection: { ink:'secondary', type:'radio', name:'ink', value:'purple', text:'Purple' }}) %>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="mdw-type" mdw-style="subtitle">Surface</div>
|
|
56
|
+
<div class="docs-option-list">
|
|
57
|
+
<%~ includeFile(T, {selection: { ink:'secondary', type:'radio', name:'surface', value:'none', checked:true, text:'None' }}) %>
|
|
58
|
+
<%~ includeFile(T, {selection: { ink:'secondary', type:'radio', name:'surface', value:'card', text:'Card' }}) %>
|
|
59
|
+
<%~ includeFile(T, {selection: { ink:'secondary', type:'radio', name:'surface', value:'primary 500 dark', text:'Primary 500 (Dark)' }}) %>
|
|
60
|
+
<%~ includeFile(T, {selection: { ink:'secondary', type:'radio', name:'surface', value:'secondary 100 light', text:'Secondary 100 (Light)' }}) %>
|
|
61
|
+
<%~ includeFile(T, {selection: { ink:'secondary', type:'radio', name:'surface', value:'warn 200 light', text:'Warn 200 (Light)' }}) %>
|
|
62
|
+
<%~ includeFile(T, {selection: { ink:'secondary', type:'radio', name:'surface', value:'green 700 dark', text:'Green 700 (Dark)' }}) %>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="mdw-grid__item" mdw-colspan="100%"></div>
|
|
66
|
+
<div class="mdw-grid__item" mdw-colspan="6">
|
|
67
|
+
<h6 class="mdw-type">HTML Code</h6>
|
|
68
|
+
<div class="mdw-card mdw-theme component-code component-html" mdw-surface="card" mdw-border-ink>
|
|
69
|
+
<%~ includeFile(T, {button: { icon: true, ink:'secondary', attributes: { 'aria-pressed': 'false', 'mdw-overlay-off':'activated' }, text: 'PUG', id: 'usePug' }}) %>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="mdw-grid__item" mdw-colspan="4">
|
|
73
|
+
<h6 class="mdw-type">Javascript Code</h6>
|
|
74
|
+
<div class="mdw-card mdw-theme component-code component-js" mdw-surface="card" mdw-border-ink></div>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="mdw-grid__item" mdw-colspan="100%">
|
|
77
|
+
<h6 class="mdw-type">Samples</h6>
|
|
78
|
+
</div>
|
|
79
|
+
<div class="mdw-grid__item display-flex" mdw-colspan="6">
|
|
80
|
+
<div class="render-fill mdw-theme" mdw-surface="white" mdw-light>
|
|
81
|
+
<%~ includeFile('../_partials/_androidstatusbar.eta') %>
|
|
82
|
+
<%~ includeFile('../_partials/_appbar.eta', { text: 'Light Theme' }) %>
|
|
83
|
+
<div class="content" style="padding: 16px 0;">
|
|
84
|
+
<ul>
|
|
85
|
+
<li>Radio buttons</li>
|
|
86
|
+
<li>Badges</li>
|
|
87
|
+
</ul>
|
|
88
|
+
</div>
|
|
89
|
+
<nav class="mdw-bottomnav mdw-theme" mdw-ink="primary medium">
|
|
90
|
+
<a class="mdw-bottomnav__item" aria-selected="true">
|
|
91
|
+
<div class="mdw-bottomnav__icon material-icons">history</div>
|
|
92
|
+
<div class="mdw-bottomnav__label">Recents</div>
|
|
93
|
+
</a>
|
|
94
|
+
<a class="mdw-bottomnav__item" aria-selected="false">
|
|
95
|
+
<div class="mdw-bottomnav__icon">
|
|
96
|
+
<div class="mdw-bottomnav__badge mdw-theme" mdw-surface="warn 500" mdw-ink="white" mdw-badge></div>
|
|
97
|
+
<div class="material-icons">favorite</div>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="mdw-bottomnav__label">Favorites</div>
|
|
100
|
+
</a>
|
|
101
|
+
<a class="mdw-bottomnav__item" aria-selected="false">
|
|
102
|
+
<div class="mdw-bottomnav__icon material-icons">near_me</div>
|
|
103
|
+
<div class="mdw-bottomnav__label">Nearby</div>
|
|
104
|
+
</a>
|
|
105
|
+
</nav>
|
|
106
|
+
<%~ includeFile('../_partials/_androidnavbar.eta') %>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<div class="mdw-grid__item display-flex" mdw-colspan="6">
|
|
110
|
+
<div class="render-fill js mdw-theme" mdw-surface="black" mdw-dark>
|
|
111
|
+
<%~ includeFile('../_partials/_androidstatusbar.eta') %>
|
|
112
|
+
<%~ includeFile('../_partials/_appbar.eta', {text: 'Dark Theme'}) %>
|
|
113
|
+
<div class="content" style="padding: 16px 0;">
|
|
114
|
+
<ul>
|
|
115
|
+
<li>Disappearing Labels</li>
|
|
116
|
+
<li>Badges</li>
|
|
117
|
+
<li>Shifting labels</li>
|
|
118
|
+
</ul>
|
|
119
|
+
</div>
|
|
120
|
+
<nav class="mdw-bottomnav" mdw-shifting>
|
|
121
|
+
<a class="mdw-bottomnav__item">
|
|
122
|
+
<div class="mdw-bottomnav__icon material-icons">tv</div>
|
|
123
|
+
<div class="mdw-bottomnav__label">Movies</div>
|
|
124
|
+
</a>
|
|
125
|
+
<a class="mdw-bottomnav__item" aria-selected="true">
|
|
126
|
+
<div class="mdw-bottomnav__icon">
|
|
127
|
+
<div class="mdw-bottomnav__badge mdw-theme" mdw-surface="warn 500" mdw-ink="white" mdw-badge></div>
|
|
128
|
+
<div class="material-icons">music_note</div>
|
|
129
|
+
</div>
|
|
130
|
+
<div class="mdw-bottomnav__label">Music</div>
|
|
131
|
+
</a>
|
|
132
|
+
<a class="mdw-bottomnav__item" aria-selected="false">
|
|
133
|
+
<div class="mdw-bottomnav__icon">
|
|
134
|
+
<div class="mdw-bottomnav__badge mdw-theme" mdw-surface="warn 500" mdw-ink="white" mdw-badge="88"></div>
|
|
135
|
+
<div class="material-icons">book</div>
|
|
136
|
+
</div>
|
|
137
|
+
<div class="mdw-bottomnav__label">Books</div>
|
|
138
|
+
</a>
|
|
139
|
+
<a class="mdw-bottomnav__item" aria-selected="false">
|
|
140
|
+
<div class="mdw-bottomnav__icon">
|
|
141
|
+
<div class="mdw-bottomnav__badge mdw-theme" mdw-surface="warn 500" mdw-ink="white" mdw-badge="888+"></div>
|
|
142
|
+
<div class="material-icons">assignment</div>
|
|
143
|
+
</div>
|
|
144
|
+
<div class="mdw-bottomnav__label">Newsstand</div>
|
|
145
|
+
</a>
|
|
146
|
+
</nav>
|
|
147
|
+
<%~ includeFile('../_partials/_androidnavbar.eta') %>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
<div class="mdw-grid__item display-flex" mdw-colspan="6">
|
|
151
|
+
<div class="render-fill js mdw-theme">
|
|
152
|
+
<%~ includeFile('../_partials/_androidstatusbar.eta') %>
|
|
153
|
+
<%~ includeFile('../_partials/_appbar.eta', {text: 'Tablet'}) %>
|
|
154
|
+
<div class="content" style="padding: 16px 0;">
|
|
155
|
+
<ul>
|
|
156
|
+
<li>Disappearing Labels</li>
|
|
157
|
+
<li>Badges</li>
|
|
158
|
+
</ul>
|
|
159
|
+
</div>
|
|
160
|
+
<nav class="mdw-bottomnav mdw-theme" mdw-surface="teal 700" mdw-dark mdw-shifting>
|
|
161
|
+
<a class="mdw-bottomnav__item" aria-selected="true">
|
|
162
|
+
<div class="mdw-bottomnav__icon">
|
|
163
|
+
<div class="mdw-bottomnav__badge mdw-theme" mdw-surface="warn 500" mdw-ink="white" mdw-badge="4"></div>
|
|
164
|
+
<div class="material-icons">tv</div>
|
|
165
|
+
</div>
|
|
166
|
+
<div class="mdw-bottomnav__label">Movies</div>
|
|
167
|
+
</a>
|
|
168
|
+
<a class="mdw-bottomnav__item" aria-selected="false">
|
|
169
|
+
<div class="mdw-bottomnav__icon">
|
|
170
|
+
<div class="mdw-bottomnav__badge mdw-theme" mdw-surface="warn 500" mdw-ink="white" mdw-badge></div>
|
|
171
|
+
<div class="material-icons">music_note</div>
|
|
172
|
+
</div>
|
|
173
|
+
<div class="mdw-bottomnav__label">Music</div>
|
|
174
|
+
</a>
|
|
175
|
+
<a class="mdw-bottomnav__item" aria-selected="false">
|
|
176
|
+
<div class="mdw-bottomnav__icon material-icons">book</div>
|
|
177
|
+
<div class="mdw-bottomnav__label">Books</div>
|
|
178
|
+
</a>
|
|
179
|
+
<a class="mdw-bottomnav__item" aria-selected="false">
|
|
180
|
+
<div class="mdw-bottomnav__icon material-icons">assignment</div>
|
|
181
|
+
<div class="mdw-bottomnav__label">Newsstand</div>
|
|
182
|
+
</a>
|
|
183
|
+
</nav>
|
|
184
|
+
<%~ includeFile('../_partials/_androidnavbar.eta') %>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
<script src="bottomnav.min.js"></script>
|
|
@@ -1,29 +1,14 @@
|
|
|
1
|
-
import * as BottomNav from '../../components/bottomnav/index';
|
|
2
|
-
import * as BottomNavItem from '../../components/bottomnav/item';
|
|
3
|
-
import * as Button from '../../components/button/index';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import * as BottomNav from '../../components/bottomnav/index.js';
|
|
2
|
+
import * as BottomNavItem from '../../components/bottomnav/item.js';
|
|
3
|
+
import * as Button from '../../components/button/index.js';
|
|
4
|
+
import { iterateArrayLike, setTextNode } from '../../core/dom.js';
|
|
5
|
+
import { convertElementToCode } from '../_sample-utils.js';
|
|
7
6
|
|
|
8
7
|
/** @return {void} */
|
|
9
8
|
function initializeSampleComponents() {
|
|
10
9
|
iterateArrayLike(document.querySelectorAll('.mdw-bottomnav'), BottomNav.attach);
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
/** @return {void} */
|
|
14
|
-
function setupPugButton() {
|
|
15
|
-
const pugButton = document.getElementById('usePug');
|
|
16
|
-
Button.attach(pugButton);
|
|
17
|
-
pugButton.addEventListener('click', () => {
|
|
18
|
-
if (pugButton.getAttribute('aria-pressed') === 'true') {
|
|
19
|
-
pugButton.setAttribute('aria-pressed', 'false');
|
|
20
|
-
} else {
|
|
21
|
-
pugButton.setAttribute('aria-pressed', 'true');
|
|
22
|
-
}
|
|
23
|
-
updateSampleCode();
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
12
|
/** @type {HTMLElement} */
|
|
28
13
|
let sampleComponent;
|
|
29
14
|
|
|
@@ -51,21 +36,35 @@ function updateSampleCode() {
|
|
|
51
36
|
jsCodeElement.textContent = 'mdw.BottomNav.attach(bottomNavElement);';
|
|
52
37
|
}
|
|
53
38
|
|
|
39
|
+
/** @return {void} */
|
|
40
|
+
function setupPugButton() {
|
|
41
|
+
const pugButton = document.getElementById('usePug');
|
|
42
|
+
Button.attach(pugButton);
|
|
43
|
+
pugButton.addEventListener('click', () => {
|
|
44
|
+
if (pugButton.getAttribute('aria-pressed') === 'true') {
|
|
45
|
+
pugButton.setAttribute('aria-pressed', 'false');
|
|
46
|
+
} else {
|
|
47
|
+
pugButton.setAttribute('aria-pressed', 'true');
|
|
48
|
+
}
|
|
49
|
+
updateSampleCode();
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
54
53
|
/**
|
|
55
54
|
* @param {Event} event
|
|
56
55
|
* @return {void}
|
|
57
56
|
*/
|
|
58
57
|
function onOptionChange(event) {
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
/** @type {HTMLInputElement} */
|
|
59
|
+
const { name, value } = (event.target);
|
|
61
60
|
switch (name) {
|
|
62
61
|
case 'ink':
|
|
63
62
|
switch (value) {
|
|
64
63
|
case 'default':
|
|
65
|
-
iterateArrayLike(sampleComponent.getElementsByClassName('mdw-bottomnav__item'), el => el.removeAttribute('mdw-ink'));
|
|
64
|
+
iterateArrayLike(sampleComponent.getElementsByClassName('mdw-bottomnav__item'), (el) => el.removeAttribute('mdw-ink'));
|
|
66
65
|
break;
|
|
67
66
|
default:
|
|
68
|
-
iterateArrayLike(sampleComponent.getElementsByClassName('mdw-bottomnav__item'), el => el.setAttribute('mdw-ink', value));
|
|
67
|
+
iterateArrayLike(sampleComponent.getElementsByClassName('mdw-bottomnav__item'), (el) => el.setAttribute('mdw-ink', value));
|
|
69
68
|
break;
|
|
70
69
|
}
|
|
71
70
|
break;
|
|
@@ -29,19 +29,19 @@ include ../_mixins.pug
|
|
|
29
29
|
+androidnavbar
|
|
30
30
|
.mdw-grid__item(mdw-colspan="4")
|
|
31
31
|
.mdw-type(mdw-style="subtitle") Javascript
|
|
32
|
-
|
|
32
|
+
.docs-option-list
|
|
33
33
|
+mdwSelection({ink:'secondary', type:'radio', name:'javascript', value:'required', checked:true}) Required
|
|
34
34
|
+mdwSelection({ink:'secondary', type:'radio', name:'javascript', value:'optional', disabled:true}) Optional
|
|
35
35
|
+mdwSelection({ink:'secondary', type:'radio', name:'javascript', value:'none', disabled:true}) None
|
|
36
36
|
.mdw-type(mdw-style="subtitle") Ink
|
|
37
|
-
|
|
37
|
+
.docs-option-list
|
|
38
38
|
+mdwSelection({ink:'secondary', type:'radio', name:'ink', value:'default'}) Default
|
|
39
39
|
+mdwSelection({ink:'secondary', type:'radio', name:'ink', value:'primary', checked:true}) Primary
|
|
40
40
|
+mdwSelection({ink:'secondary', type:'radio', name:'ink', value:'secondary'}) Secondary
|
|
41
41
|
+mdwSelection({ink:'secondary', type:'radio', name:'ink', value:'warn'}) Warn
|
|
42
|
-
+mdwSelection({ink:'secondary', type:'radio', name:'ink', value:'purple
|
|
42
|
+
+mdwSelection({ink:'secondary', type:'radio', name:'ink', value:'purple'}) Purple
|
|
43
43
|
.mdw-type(mdw-style="subtitle") Surface
|
|
44
|
-
|
|
44
|
+
.docs-option-list
|
|
45
45
|
+mdwSelection({ink:'secondary', type:'radio', name:'surface', value:'none', checked:true}) None
|
|
46
46
|
+mdwSelection({ink:'secondary', type:'radio', name:'surface', value:'card'}) Card
|
|
47
47
|
+mdwSelection({ink:'secondary', type:'radio', name:'surface', value:'primary 500 dark'}) Primary 500 (Dark)
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
|
|
2
|
+
<% var T = '../../templates/index.eta' %>
|
|
3
|
+
<% layout('../_partials/_header.eta', {page: 'button'}) %>
|
|
4
|
+
<div class="mdw-grid" mdw-margin-top mdw-margin-bottom mdw-stretch>
|
|
5
|
+
<div class="mdw-grid__item" mdw-colspan="100%">
|
|
6
|
+
<div class="mdw-grid__content">
|
|
7
|
+
<h5 class="mdw-type" mdw-baseline-next="36">Buttons communicate the action that will occur when the user touches them.</h5>
|
|
8
|
+
<p class="mdw-type">Material buttons trigger an ink reaction on press. They may display text, imagery, or both.</p>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="mdw-grid__item" mdw-colspan="6">
|
|
12
|
+
<div class="mdw-grid__content">
|
|
13
|
+
<div class="component-sample">
|
|
14
|
+
<div class="display-flex"><a class="mdw-button mdw-theme" mdw-ink="secondary">Button</a></div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="mdw-grid__item" mdw-colspan="6">
|
|
19
|
+
<div class="mdw-grid__content">
|
|
20
|
+
<div class="mdw-type" mdw-style="subtitle">Javascript</div>
|
|
21
|
+
<div class="docs-option-list">
|
|
22
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'javascript', type:'radio', value:'required', disabled:true, text: 'Required' }}) %>
|
|
23
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'javascript', type:'radio', value:'optional', checked:true, text: 'Optional' }}) %>
|
|
24
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'javascript', type:'radio', value:'none', text: 'None' }}) %>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="mdw-type" mdw-style="subtitle">Overlay</div>
|
|
27
|
+
<div class="docs-option-list">
|
|
28
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'overlay-hover', checked:true, text: 'Hover' }}) %>
|
|
29
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'overlay-focus', checked:true, text: 'Focus' }}) %>
|
|
30
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'overlay-activated', checked:true, text: 'Activated' }}) %>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="mdw-type" mdw-style="subtitle">Options</div>
|
|
33
|
+
<div class="docs-option-list">
|
|
34
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'icon', text: 'Icon' }}) %>
|
|
35
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'raised', text: 'Raised' }}) %>
|
|
36
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'ripple', checked:true, text: 'Ripple' }}) %>
|
|
37
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'disabled', text: 'Disabled' }}) %>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="mdw-type" mdw-style="subtitle">Outline</div>
|
|
40
|
+
<div class="docs-option-list">
|
|
41
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'outline', type:'radio', value:'none', checked:true, text: 'None' }}) %>
|
|
42
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'outline', type:'radio', value:'default', text: 'Default' }}) %>
|
|
43
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'outline', type:'radio', value:'', text: 'Ink' }}) %>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="mdw-type" mdw-style="subtitle">Activated Toggle</div>
|
|
46
|
+
<div class="docs-option-list">
|
|
47
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'toggle', type:'radio', value:'', checked:true, text: 'None' }}) %>
|
|
48
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'toggle', type:'radio', value:'false', text: 'Off' }}) %>
|
|
49
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'toggle', type:'radio', value:'true', text: 'On' }}) %>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="mdw-type" mdw-style="subtitle">Ink</div>
|
|
52
|
+
<div class="docs-option-list">
|
|
53
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'ink', type:'radio', value:'default', text: 'Default' }}) %>
|
|
54
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'ink', type:'radio', value:'primary', text: 'Primary' }}) %>
|
|
55
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'ink', type:'radio', value:'secondary', checked:true, text: 'Secondary' }}) %>
|
|
56
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'ink', type:'radio', value:'warn contrast', text: 'Warn Contrast' }}) %>
|
|
57
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'ink', type:'radio', value:'purple', text: 'Purple' }}) %>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="mdw-type" mdw-style="subtitle">Surface</div>
|
|
60
|
+
<div class="docs-option-list">
|
|
61
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'surface', type:'radio', value:'none', checked:true, text: 'Default' }}) %>
|
|
62
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'surface', type:'radio', value:'primary 500 dark', text: 'Primary (Dark)' }}) %>
|
|
63
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'surface', type:'radio', value:'secondary 100 light', text: 'Secondary (Light)' }}) %>
|
|
64
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'surface', type:'radio', value:'warn 200 light', text: 'Warn 200 (Light)' }}) %>
|
|
65
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'surface', type:'radio', value:'green 700 dark', text: 'Green 700 (Dark)' }}) %>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="mdw-type" mdw-style="subtitle">HTML Element Type</div>
|
|
68
|
+
<div class="docs-option-list">
|
|
69
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'htmltype', type:'radio', value:'a', checked:true, text: 'HTMLAnchorElement' }}) %>
|
|
70
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'htmltype', type:'radio', value:'button', text: 'HTMLButtonElement' }}) %>
|
|
71
|
+
<%~ includeFile(T, { selection: {ink:'secondary', name:'htmltype', type:'radio', value:'div', text: 'HTMLDivElement' }}) %>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
<div class="mdw-grid__item" mdw-colspan="100%" style="max-height:0;"></div>
|
|
76
|
+
<div class="mdw-grid__item" mdw-colspan="6">
|
|
77
|
+
<div class="mdw-grid__content">
|
|
78
|
+
<h6 class="mdw-type">HTML Code</h6>
|
|
79
|
+
<div class="mdw-card mdw-theme component-code component-html" mdw-surface="card" mdw-border-ink>
|
|
80
|
+
<%~ includeFile(T, { button: { icon:true, ink:'secondary', id:'usePug', text: 'PUG', attributes: { 'aria-pressed':"false", 'mdw-overlay-off':"activated" }}}) %>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="mdw-grid__item" mdw-colspan="6">
|
|
85
|
+
<div class="mdw-grid__content">
|
|
86
|
+
<h6 class="mdw-type">Javascript Code</h6>
|
|
87
|
+
<div class="mdw-card mdw-theme component-code component-js" mdw-surface="card" mdw-border-ink></div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
<div class="mdw-grid__item" mdw-colspan="100%">
|
|
91
|
+
<div class="mdw-grid__content">
|
|
92
|
+
<h6 class="mdw-type">Samples</h6>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
<div class="mdw-grid__item" mdw-colspan="6">
|
|
96
|
+
<div class="mdw-grid__content">
|
|
97
|
+
<div class="render-fill mdw-theme">
|
|
98
|
+
<%~ includeFile('../_partials/_androidstatusbar.eta') %>
|
|
99
|
+
<%~ includeFile('../_partials/_appbar.eta', {text: 'CSS Only'}) %>
|
|
100
|
+
<div class="content mdw-theme" style="padding: 16px 0;" mdw-surface="binary">
|
|
101
|
+
<div>
|
|
102
|
+
<%~ includeFile('../_partials/_buttontest.eta') %>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
<%~ includeFile('../_partials/_androidnavbar.eta') %>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<div class="mdw-grid__item" mdw-colspan="6">
|
|
110
|
+
<div class="mdw-grid__content">
|
|
111
|
+
<div class="render-fill js mdw-theme">
|
|
112
|
+
<%~ includeFile('../_partials/_androidstatusbar.eta') %>
|
|
113
|
+
<%~ includeFile('../_partials/_appbar.eta', {text: 'Javascript'}) %>
|
|
114
|
+
<div class="content mdw-theme" style="padding: 16px 0;" mdw-surface="binary">
|
|
115
|
+
<div>
|
|
116
|
+
<%~ includeFile('../_partials/_buttontest.eta') %>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
<%~ includeFile('../_partials/_androidnavbar.eta') %>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
<script src="button.min.js"></script>
|
|
@@ -1,28 +1,14 @@
|
|
|
1
|
-
import * as Button from '../../components/button/index';
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import * as Button from '../../components/button/index.js';
|
|
2
|
+
import { iterateArrayLike, setTextNode } from '../../core/dom.js';
|
|
3
|
+
import * as Overlay from '../../core/overlay/index.js';
|
|
4
|
+
import * as Ripple from '../../core/ripple/index.js';
|
|
5
|
+
import { convertElementToCode } from '../_sample-utils.js';
|
|
6
6
|
|
|
7
7
|
/** @return {void} */
|
|
8
8
|
function initializeSampleComponents() {
|
|
9
9
|
iterateArrayLike(document.querySelectorAll('.js .mdw-button'), Button.attach);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
/** @return {void} */
|
|
13
|
-
function setupPugButton() {
|
|
14
|
-
const pugButton = document.getElementById('usePug');
|
|
15
|
-
Button.attach(pugButton);
|
|
16
|
-
pugButton.addEventListener('click', () => {
|
|
17
|
-
if (pugButton.getAttribute('aria-pressed') === 'true') {
|
|
18
|
-
pugButton.setAttribute('aria-pressed', 'false');
|
|
19
|
-
} else {
|
|
20
|
-
pugButton.setAttribute('aria-pressed', 'true');
|
|
21
|
-
}
|
|
22
|
-
updateSampleCode();
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
12
|
/** @type {HTMLElement} */
|
|
27
13
|
let sampleComponent;
|
|
28
14
|
|
|
@@ -81,6 +67,20 @@ function updateSampleCode() {
|
|
|
81
67
|
jsCodeElement.textContent = 'mdw.Button.attach(buttonElement);';
|
|
82
68
|
}
|
|
83
69
|
|
|
70
|
+
/** @return {void} */
|
|
71
|
+
function setupPugButton() {
|
|
72
|
+
const pugButton = document.getElementById('usePug');
|
|
73
|
+
Button.attach(pugButton);
|
|
74
|
+
pugButton.addEventListener('click', () => {
|
|
75
|
+
if (pugButton.getAttribute('aria-pressed') === 'true') {
|
|
76
|
+
pugButton.setAttribute('aria-pressed', 'false');
|
|
77
|
+
} else {
|
|
78
|
+
pugButton.setAttribute('aria-pressed', 'true');
|
|
79
|
+
}
|
|
80
|
+
updateSampleCode();
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
84
|
/**
|
|
85
85
|
* @param {Event} event
|
|
86
86
|
* @return {void}
|
|
@@ -39,51 +39,51 @@ mixin button-test
|
|
|
39
39
|
.mdw-grid__content
|
|
40
40
|
.component-sample
|
|
41
41
|
.display-flex
|
|
42
|
-
a.mdw-button.mdw-theme(mdw-ink="secondary
|
|
42
|
+
a.mdw-button.mdw-theme(mdw-ink="secondary") Button
|
|
43
43
|
.mdw-grid__item(mdw-colspan="6")
|
|
44
44
|
.mdw-grid__content
|
|
45
45
|
.mdw-type(mdw-style="subtitle") Javascript
|
|
46
|
-
|
|
46
|
+
.docs-option-list
|
|
47
47
|
+mdwSelection({ink:'secondary', name:'javascript', type:'radio', value:'required', disabled:true}) Required
|
|
48
48
|
+mdwSelection({ink:'secondary', name:'javascript', type:'radio', value:'optional', checked:true}) Optional
|
|
49
49
|
+mdwSelection({ink:'secondary', name:'javascript', type:'radio', value:'none'}) None
|
|
50
50
|
.mdw-type(mdw-style="subtitle") Overlay
|
|
51
|
-
|
|
51
|
+
.docs-option-list
|
|
52
52
|
+mdwSelection({ink:'secondary', name:'overlay-hover', checked:true}) Hover
|
|
53
53
|
+mdwSelection({ink:'secondary', name:'overlay-focus', checked:true}) Focus
|
|
54
54
|
+mdwSelection({ink:'secondary', name:'overlay-activated', checked:true}) Activated
|
|
55
55
|
.mdw-type(mdw-style="subtitle") Options
|
|
56
|
-
|
|
56
|
+
.docs-option-list
|
|
57
57
|
+mdwSelection({ink:'secondary', name:'icon'}) Icon
|
|
58
58
|
+mdwSelection({ink:'secondary', name:'raised'}) Raised
|
|
59
59
|
+mdwSelection({ink:'secondary', name:'ripple', checked:true}) Ripple
|
|
60
60
|
+mdwSelection({ink:'secondary', name:'disabled'}) Disabled
|
|
61
61
|
.mdw-type(mdw-style="subtitle") Outline
|
|
62
|
-
|
|
62
|
+
.docs-option-list
|
|
63
63
|
+mdwSelection({ink:'secondary', name:'outline', type:'radio', value:'none', checked:true}) None
|
|
64
64
|
+mdwSelection({ink:'secondary', name:'outline', type:'radio', value:'default'}) Default
|
|
65
65
|
+mdwSelection({ink:'secondary', name:'outline', type:'radio', value:''}) Ink
|
|
66
66
|
.mdw-type(mdw-style="subtitle") Activated Toggle
|
|
67
|
-
|
|
67
|
+
.docs-option-list
|
|
68
68
|
+mdwSelection({ink:'secondary', name:'toggle', type:'radio', value:'', checked:true}) None
|
|
69
69
|
+mdwSelection({ink:'secondary', name:'toggle', type:'radio', value:'false'}) Off
|
|
70
70
|
+mdwSelection({ink:'secondary', name:'toggle', type:'radio', value:'true'}) On
|
|
71
71
|
.mdw-type(mdw-style="subtitle") Ink
|
|
72
|
-
|
|
72
|
+
.docs-option-list
|
|
73
73
|
+mdwSelection({ink:'secondary', name:'ink', type:'radio', value:'default'}) Default
|
|
74
74
|
+mdwSelection({ink:'secondary', name:'ink', type:'radio', value:'primary'}) Primary
|
|
75
75
|
+mdwSelection({ink:'secondary', name:'ink', type:'radio', value:'secondary', checked:true}) Secondary
|
|
76
|
-
+mdwSelection({ink:'secondary', name:'ink', type:'radio', value:'warn
|
|
77
|
-
+mdwSelection({ink:'secondary', name:'ink', type:'radio', value:'purple
|
|
76
|
+
+mdwSelection({ink:'secondary', name:'ink', type:'radio', value:'warn contrast'}) Warn Contrast
|
|
77
|
+
+mdwSelection({ink:'secondary', name:'ink', type:'radio', value:'purple'}) Purple
|
|
78
78
|
.mdw-type(mdw-style="subtitle") Surface
|
|
79
|
-
|
|
79
|
+
.docs-option-list
|
|
80
80
|
+mdwSelection({ink:'secondary', name:'surface', type:'radio', value:'none', checked:true}) Default
|
|
81
81
|
+mdwSelection({ink:'secondary', name:'surface', type:'radio', value:'primary 500 dark'}) Primary (Dark)
|
|
82
82
|
+mdwSelection({ink:'secondary', name:'surface', type:'radio', value:'secondary 100 light'}) Secondary (Light)
|
|
83
83
|
+mdwSelection({ink:'secondary', name:'surface', type:'radio', value:'warn 200 light'}) Warn 200 (Light)
|
|
84
84
|
+mdwSelection({ink:'secondary', name:'surface', type:'radio', value:'green 700 dark'}) Green 700 (Dark)
|
|
85
85
|
.mdw-type(mdw-style="subtitle") HTML Element Type
|
|
86
|
-
|
|
86
|
+
.docs-option-list
|
|
87
87
|
+mdwSelection({ink:'secondary', name:'htmltype', type:'radio', value:'a', checked:true}) HTMLAnchorElement
|
|
88
88
|
+mdwSelection({ink:'secondary', name:'htmltype', type:'radio', value:'button'}) HTMLButtonElement
|
|
89
89
|
+mdwSelection({ink:'secondary', name:'htmltype', type:'radio', value:'div'}) HTMLDivElement
|
|
@@ -102,19 +102,19 @@ mixin button-test
|
|
|
102
102
|
h6.mdw-type Samples
|
|
103
103
|
.mdw-grid__item(mdw-colspan="6")
|
|
104
104
|
.mdw-grid__content
|
|
105
|
-
.render-fill.mdw-theme
|
|
105
|
+
.render-fill.mdw-theme
|
|
106
106
|
+androidstatusbar('')
|
|
107
107
|
+appbar('', '', [], []) CSS Only
|
|
108
|
-
.content(style="padding: 16px 0")
|
|
108
|
+
.content.mdw-theme(style="padding: 16px 0" mdw-surface="binary")
|
|
109
109
|
div
|
|
110
110
|
+button-test
|
|
111
111
|
+androidnavbar
|
|
112
112
|
.mdw-grid__item(mdw-colspan="6")
|
|
113
113
|
.mdw-grid__content
|
|
114
|
-
.render-fill.js.mdw-theme
|
|
114
|
+
.render-fill.js.mdw-theme
|
|
115
115
|
+androidstatusbar('')
|
|
116
116
|
+appbar('', '', [], []) Javascript Version
|
|
117
|
-
.content(style="padding: 16px 0")
|
|
117
|
+
.content.mdw-theme(style="padding: 16px 0" mdw-surface="binary")
|
|
118
118
|
div
|
|
119
119
|
+button-test
|
|
120
120
|
+androidnavbar
|