@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,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
1
|
+
import { iterateArrayLike, nextTick } from '../../core/dom.js';
|
|
2
|
+
import * as Overlay from '../../core/overlay/index.js';
|
|
3
|
+
import * as Ripple from '../../core/ripple/index.js';
|
|
4
4
|
|
|
5
5
|
iterateArrayLike(document.getElementsByClassName('mdw-overlay'), Overlay.attach);
|
|
6
6
|
iterateArrayLike(document.getElementsByClassName('mdw-ripple'), Ripple.attach);
|
|
@@ -16,7 +16,6 @@ const sampleContrastText = document.getElementById('sample-contrast__text');
|
|
|
16
16
|
const sampleContrastSelected = document.getElementById('sample-contrast__selected');
|
|
17
17
|
const sampleContrastActivated = document.getElementById('sample-contrast__activated');
|
|
18
18
|
|
|
19
|
-
|
|
20
19
|
/** @typedef {{r:number,g:number,b:number,a:number}} Color */
|
|
21
20
|
|
|
22
21
|
/**
|
|
@@ -40,7 +39,7 @@ function parseColor(colorString) {
|
|
|
40
39
|
return colorString
|
|
41
40
|
.match(/\(([^)]+)\)/)[1]
|
|
42
41
|
.split(',')
|
|
43
|
-
.map(value => (value == null ? 1.0 : parseFloat(value)))
|
|
42
|
+
.map((value) => (value == null ? 1.0 : parseFloat(value)))
|
|
44
43
|
.reduce((prev, curr, index) => {
|
|
45
44
|
if (index > 3) {
|
|
46
45
|
throw new Error('Unexpected 5th value');
|
|
@@ -76,13 +75,20 @@ function overlayColor(color, overlay) {
|
|
|
76
75
|
* @return {number}
|
|
77
76
|
*/
|
|
78
77
|
function getLuminance(color) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
/**
|
|
79
|
+
* @param {number} colorValue
|
|
80
|
+
* @return {number}
|
|
81
|
+
*/
|
|
82
|
+
function sRGBMapping(colorValue) {
|
|
83
|
+
if (colorValue <= (0.03928 * 255)) {
|
|
84
|
+
return colorValue / 255 / 12.92;
|
|
85
|
+
}
|
|
86
|
+
return ((colorValue / 255 + 0.055) / 1.055) ** 2.4;
|
|
87
|
+
}
|
|
88
|
+
const R = 0.2126 * sRGBMapping(color.r);
|
|
89
|
+
const G = 0.7152 * sRGBMapping(color.g);
|
|
90
|
+
const B = 0.0722 * sRGBMapping(color.b);
|
|
91
|
+
return (R + G + B);
|
|
86
92
|
}
|
|
87
93
|
|
|
88
94
|
/**
|
|
@@ -126,10 +132,10 @@ function calculateContrast() {
|
|
|
126
132
|
const style = window.getComputedStyle(sampleButton);
|
|
127
133
|
const surfaceColor = parseColor(style.backgroundColor);
|
|
128
134
|
const inkColor = parseColor(style.color);
|
|
129
|
-
sampleSurface.textContent =
|
|
130
|
-
sampleInk.textContent =
|
|
135
|
+
sampleSurface.textContent = colorToString(surfaceColor);
|
|
136
|
+
sampleInk.textContent = colorToString(inkColor);
|
|
131
137
|
const flattenedInk = overlayColor(surfaceColor, inkColor);
|
|
132
|
-
sampleContrastText.textContent =
|
|
138
|
+
sampleContrastText.textContent = getContrastRatio(surfaceColor, flattenedInk).toFixed(2);
|
|
133
139
|
|
|
134
140
|
let selectedOpacity = 0.08;
|
|
135
141
|
let activatedOpacity = 0.12;
|
|
@@ -146,12 +152,12 @@ function calculateContrast() {
|
|
|
146
152
|
const selectedOverlay = parseColor(`rgba(${overlayInkColor.r},${overlayInkColor.g},${overlayInkColor.b},${selectedOpacity})`);
|
|
147
153
|
const selectedBackground = overlayColor(surfaceColor, selectedOverlay);
|
|
148
154
|
const selectedColor = overlayColor(selectedFlattenedInk, selectedOverlay);
|
|
149
|
-
sampleContrastSelected.textContent =
|
|
155
|
+
sampleContrastSelected.textContent = getContrastRatio(selectedBackground, selectedColor).toFixed(2);
|
|
150
156
|
|
|
151
157
|
const activatedOverlay = parseColor(`rgba(${overlayInkColor.r},${overlayInkColor.g},${overlayInkColor.b},${activatedOpacity})`);
|
|
152
158
|
const activatedBackground = overlayColor(surfaceColor, activatedOverlay);
|
|
153
159
|
const activatedColor = overlayColor(flattenedInk, activatedOverlay);
|
|
154
|
-
sampleContrastActivated.textContent =
|
|
160
|
+
sampleContrastActivated.textContent = getContrastRatio(activatedBackground, activatedColor).toFixed(2);
|
|
155
161
|
});
|
|
156
162
|
}
|
|
157
163
|
|
|
@@ -174,14 +180,83 @@ function onItemClick(event) {
|
|
|
174
180
|
calculateContrast();
|
|
175
181
|
}
|
|
176
182
|
|
|
183
|
+
const currentInkOptions = {
|
|
184
|
+
color: 'secondary',
|
|
185
|
+
tone: 'contrast',
|
|
186
|
+
opacity: '',
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const currentSurfaceOptions = {
|
|
190
|
+
color: 'binary',
|
|
191
|
+
tone: '',
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
/** @return {void} */
|
|
195
|
+
function refresh() {
|
|
196
|
+
const inkProperties = [
|
|
197
|
+
currentInkOptions.color,
|
|
198
|
+
currentInkOptions.tone,
|
|
199
|
+
currentInkOptions.opacity,
|
|
200
|
+
].filter((v) => v).join(' ');
|
|
201
|
+
const surfaceProperties = [
|
|
202
|
+
currentSurfaceOptions.color,
|
|
203
|
+
currentSurfaceOptions.tone,
|
|
204
|
+
].filter((v) => v).join(' ');
|
|
205
|
+
iterateArrayLike(document.querySelectorAll('#color-sample-area .demo-core-item'), (el) => {
|
|
206
|
+
el.setAttribute('mdw-ink', inkProperties);
|
|
207
|
+
el.setAttribute('mdw-surface', surfaceProperties);
|
|
208
|
+
});
|
|
209
|
+
calculateContrast();
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* @param {Event} event
|
|
214
|
+
* @return {void}
|
|
215
|
+
*/
|
|
216
|
+
function onOptionChange(event) {
|
|
217
|
+
/** @type {HTMLSelectElement} */
|
|
218
|
+
const selectElement = (event.target);
|
|
219
|
+
const { name, value } = selectElement;
|
|
220
|
+
switch (name) {
|
|
221
|
+
case 'ink-color':
|
|
222
|
+
currentInkOptions.color = value;
|
|
223
|
+
break;
|
|
224
|
+
case 'ink-tone':
|
|
225
|
+
currentInkOptions.tone = value;
|
|
226
|
+
break;
|
|
227
|
+
case 'ink-opacity':
|
|
228
|
+
currentInkOptions.opacity = value;
|
|
229
|
+
break;
|
|
230
|
+
case 'surface-color':
|
|
231
|
+
currentSurfaceOptions.color = value;
|
|
232
|
+
break;
|
|
233
|
+
case 'surface-tone':
|
|
234
|
+
currentSurfaceOptions.tone = value;
|
|
235
|
+
break;
|
|
236
|
+
default:
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
refresh();
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/** @return {void} */
|
|
243
|
+
function setupComponentOptions() {
|
|
244
|
+
// sampleComponent = document.querySelector('.component-sample .mdw-button');
|
|
245
|
+
// Button.attach(sampleComponent);
|
|
246
|
+
iterateArrayLike(document.querySelectorAll('#color-page-options [name]'), (el) => {
|
|
247
|
+
el.addEventListener('change', onOptionChange);
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
177
251
|
iterateArrayLike(
|
|
178
252
|
document.getElementsByClassName('demo-core-item'),
|
|
179
|
-
item => item.addEventListener('click', onItemClick)
|
|
253
|
+
(item) => item.addEventListener('click', onItemClick),
|
|
180
254
|
);
|
|
181
255
|
|
|
182
256
|
[
|
|
183
257
|
document.getElementById('darkModeButton'),
|
|
184
258
|
document.getElementById('altThemeButton'),
|
|
185
|
-
].forEach(button => button.addEventListener('click', calculateContrast));
|
|
259
|
+
].forEach((button) => button.addEventListener('click', calculateContrast));
|
|
186
260
|
|
|
187
|
-
|
|
261
|
+
setupComponentOptions();
|
|
262
|
+
refresh();
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
include ../_mixins.pug
|
|
2
|
+
|
|
3
|
+
+header("color")
|
|
4
|
+
.mdw-grid(mdw-margin-top mdw-margin-bottom mdw-columns="4")#color-page-options
|
|
5
|
+
.mdw-grid__item(mdw-colspan="4")
|
|
6
|
+
.mdw-grid__content.mdw-theme(mdw-elevation="8")
|
|
7
|
+
#color-sample-area
|
|
8
|
+
a#sample-button.demo-core-item.mdw-overlay.mdw-elevation.mdw-ripple.mdw-theme(tabindex="0" mdw-elevation="1" mdw-surface="binary" mdw-ink="secondary contrast") Enabled
|
|
9
|
+
a#sample-button__selected.demo-core-item.mdw-overlay.mdw-elevation.mdw-ripple.mdw-theme(tabindex="0" mdw-elevation="1" mdw-surface="binary" mdw-ink="secondary contrast" aria-selected="true") Selected
|
|
10
|
+
a#sample-button__activated.demo-core-item.mdw-overlay.mdw-elevation.mdw-ripple.mdw-theme(tabindex="0" mdw-elevation="1" mdw-surface="binary" mdw-ink="secondary contrast" aria-pressed="true") Activated
|
|
11
|
+
div(style="margin:8px")
|
|
12
|
+
p.mdw-type Surface:
|
|
13
|
+
span#sample-surface.mdw-theme(mdw-ink="medium") test
|
|
14
|
+
p.mdw-type Ink:
|
|
15
|
+
span#sample-ink.mdw-theme(mdw-ink="medium") test
|
|
16
|
+
div(style="margin:8px")
|
|
17
|
+
p.mdw-type Text Contrast:
|
|
18
|
+
span#sample-contrast__text.mdw-theme(mdw-ink="medium") test
|
|
19
|
+
span / 4.5
|
|
20
|
+
p.mdw-type Selected Contrast:
|
|
21
|
+
span#sample-contrast__selected.mdw-theme(mdw-ink="medium") test
|
|
22
|
+
span / 4.5
|
|
23
|
+
p.mdw-type Activated Contrast:
|
|
24
|
+
span#sample-contrast__activated.mdw-theme(mdw-ink="medium") test
|
|
25
|
+
span / 4.5
|
|
26
|
+
.mdw-grid__item(mdw-colspan="2")
|
|
27
|
+
.mdw-grid__content
|
|
28
|
+
.mdw-type(mdw-style="subtitle") Ink
|
|
29
|
+
div
|
|
30
|
+
label.mdw-textfield.mdw-theme(mdw-ink="secondary" mdw-outlined)
|
|
31
|
+
select.mdw-textfield__input(name="ink-color")
|
|
32
|
+
option.mdw-theme(mdw-surface="card" value="default") Default
|
|
33
|
+
option.mdw-theme(mdw-surface="card" value="black") Black
|
|
34
|
+
option.mdw-theme(mdw-surface="card" value="white") White
|
|
35
|
+
option.mdw-theme(mdw-surface="card" value="primary") Primary
|
|
36
|
+
option.mdw-theme(mdw-surface="card" value="secondary" selected) Secondary
|
|
37
|
+
option.mdw-theme(mdw-surface="card" value="warn") Warn
|
|
38
|
+
option.mdw-theme(mdw-surface="card" value="amber") Amber
|
|
39
|
+
option.mdw-theme(mdw-surface="card" value="blue") Blue
|
|
40
|
+
option.mdw-theme(mdw-surface="card" value="cyan") Cyan
|
|
41
|
+
option.mdw-theme(mdw-surface="card" value="red") Red
|
|
42
|
+
option.mdw-theme(mdw-surface="card" value="green") Green
|
|
43
|
+
option.mdw-theme(mdw-surface="card" value="deeppurple") Deeppurple
|
|
44
|
+
option.mdw-theme(mdw-surface="card" value="purple") Purple
|
|
45
|
+
option.mdw-theme(mdw-surface="card" value="yellow") Yellow
|
|
46
|
+
option.mdw-theme(mdw-surface="card" value="teal") Teal
|
|
47
|
+
.mdw-textfield__icon(mdw-dropdown)
|
|
48
|
+
.mdw-textfield__border
|
|
49
|
+
.mdw-textfield__outline-gap
|
|
50
|
+
.mdw-textfield__label Color
|
|
51
|
+
label.mdw-textfield.mdw-theme(mdw-ink="secondary" mdw-outlined)
|
|
52
|
+
select.mdw-textfield__input(name="ink-tone")
|
|
53
|
+
option.mdw-theme(mdw-surface="card" value="" selected) Auto
|
|
54
|
+
option.mdw-theme(mdw-surface="card" value="light") Light
|
|
55
|
+
option.mdw-theme(mdw-surface="card" value="contrast" selected) Contrast
|
|
56
|
+
option.mdw-theme(mdw-surface="card" value="A100") A100
|
|
57
|
+
option.mdw-theme(mdw-surface="card" value="A200") A200
|
|
58
|
+
option.mdw-theme(mdw-surface="card" value="A400") A400
|
|
59
|
+
option.mdw-theme(mdw-surface="card" value="A700") A700
|
|
60
|
+
.mdw-textfield__icon(mdw-dropdown)
|
|
61
|
+
.mdw-textfield__border
|
|
62
|
+
.mdw-textfield__outline-gap
|
|
63
|
+
.mdw-textfield__label Tone
|
|
64
|
+
label.mdw-textfield.mdw-theme(mdw-ink="secondary" mdw-outlined)
|
|
65
|
+
select.mdw-textfield__input(name="ink-opacity")
|
|
66
|
+
option.mdw-theme(mdw-surface="card" value="" selected) Auto
|
|
67
|
+
option.mdw-theme(mdw-surface="card" value="solid") Solid
|
|
68
|
+
option.mdw-theme(mdw-surface="card" value="high") High
|
|
69
|
+
option.mdw-theme(mdw-surface="card" value="medium") Medium
|
|
70
|
+
option.mdw-theme(mdw-surface="card" value="inactive") Inactive
|
|
71
|
+
option.mdw-theme(mdw-surface="card" value="divider") Divider
|
|
72
|
+
.mdw-textfield__icon(mdw-dropdown)
|
|
73
|
+
.mdw-textfield__border
|
|
74
|
+
.mdw-textfield__outline-gap
|
|
75
|
+
.mdw-textfield__label Opacity
|
|
76
|
+
.mdw-grid__item(mdw-colspan="2")
|
|
77
|
+
.mdw-grid__content
|
|
78
|
+
.mdw-type(mdw-style="subtitle") Surface
|
|
79
|
+
#color-page-options
|
|
80
|
+
label.mdw-textfield.mdw-theme(mdw-ink="secondary" mdw-outlined)
|
|
81
|
+
select.mdw-textfield__input(name="surface-color")
|
|
82
|
+
option.mdw-theme(mdw-surface="card" value="card") Card
|
|
83
|
+
option.mdw-theme(mdw-surface="card" value="binary" selected) Binary
|
|
84
|
+
option.mdw-theme(mdw-surface="card" value="black") Black
|
|
85
|
+
option.mdw-theme(mdw-surface="card" value="white") White
|
|
86
|
+
option.mdw-theme(mdw-surface="card" value="background") Background
|
|
87
|
+
option.mdw-theme(mdw-surface="card" value="primary") Primary
|
|
88
|
+
option.mdw-theme(mdw-surface="card" value="secondary") Secondary
|
|
89
|
+
option.mdw-theme(mdw-surface="card" value="warn") Warn
|
|
90
|
+
option.mdw-theme(mdw-surface="card" value="amber") Amber
|
|
91
|
+
option.mdw-theme(mdw-surface="card" value="blue") Blue
|
|
92
|
+
option.mdw-theme(mdw-surface="card" value="cyan") Cyan
|
|
93
|
+
option.mdw-theme(mdw-surface="card" value="red") Red
|
|
94
|
+
option.mdw-theme(mdw-surface="card" value="green") Green
|
|
95
|
+
option.mdw-theme(mdw-surface="card" value="deeppurple") Deeppurple
|
|
96
|
+
option.mdw-theme(mdw-surface="card" value="purple") Purple
|
|
97
|
+
option.mdw-theme(mdw-surface="card" value="yellow") Yellow
|
|
98
|
+
option.mdw-theme(mdw-surface="card" value="teal") Teal
|
|
99
|
+
.mdw-textfield__icon(mdw-dropdown)
|
|
100
|
+
.mdw-textfield__border
|
|
101
|
+
.mdw-textfield__outline-gap
|
|
102
|
+
.mdw-textfield__label Color
|
|
103
|
+
label.mdw-textfield.mdw-theme(mdw-ink="secondary" mdw-outlined)
|
|
104
|
+
select.mdw-textfield__input(name="surface-tone")
|
|
105
|
+
option.mdw-theme(mdw-surface="card" value="" selected) Default
|
|
106
|
+
option.mdw-theme(mdw-surface="card" value="alt") Alternate
|
|
107
|
+
option.mdw-theme(mdw-surface="card" value="50") 50
|
|
108
|
+
option.mdw-theme(mdw-surface="card" value="100") 100
|
|
109
|
+
option.mdw-theme(mdw-surface="card" value="200") 200
|
|
110
|
+
option.mdw-theme(mdw-surface="card" value="300") 300
|
|
111
|
+
option.mdw-theme(mdw-surface="card" value="400") 400
|
|
112
|
+
option.mdw-theme(mdw-surface="card" value="500") 500
|
|
113
|
+
option.mdw-theme(mdw-surface="card" value="600") 600
|
|
114
|
+
option.mdw-theme(mdw-surface="card" value="700") 700
|
|
115
|
+
option.mdw-theme(mdw-surface="card" value="800") 800
|
|
116
|
+
option.mdw-theme(mdw-surface="card" value="900") 900
|
|
117
|
+
.mdw-textfield__icon(mdw-dropdown)
|
|
118
|
+
.mdw-textfield__border
|
|
119
|
+
.mdw-textfield__outline-gap
|
|
120
|
+
.mdw-textfield__label Tone
|
|
121
|
+
script(src='color.min.js')
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
<% var T = '../../templates/index.eta' %>
|
|
2
|
+
<% layout('../_partials/_header.eta', {page: 'datatable'}) %>
|
|
3
|
+
<div class="mdw-grid" mdw-margin-top mdw-margin-bottom>
|
|
4
|
+
<div class="mdw-grid__item" mdw-colspan="100%">
|
|
5
|
+
<div class="mdw-card mdw-theme" mdw-surface="card" mdw-border-ink>
|
|
6
|
+
<div class="mdw-datatable mdw-theme" mdw-ink="primary" style="overflow-x:auto;">
|
|
7
|
+
<table>
|
|
8
|
+
<caption>Standard HTML Table (CSS Only)</caption>
|
|
9
|
+
<thead>
|
|
10
|
+
<tr>
|
|
11
|
+
<th>Dessert (100g serving)</th>
|
|
12
|
+
<th>Calories</th>
|
|
13
|
+
<th>Fat (g)</th>
|
|
14
|
+
<th>Carbs (g)</th>
|
|
15
|
+
<th>Protein (g)</th>
|
|
16
|
+
<th>Sodium (mg)</th>
|
|
17
|
+
<th>Calcium (%)</th>
|
|
18
|
+
<th>Iron (%)</th>
|
|
19
|
+
</tr>
|
|
20
|
+
</thead>
|
|
21
|
+
<tbody>
|
|
22
|
+
<tr>
|
|
23
|
+
<td>Frozen Yogurt</td>
|
|
24
|
+
<td>159</td>
|
|
25
|
+
<td>6.0</td>
|
|
26
|
+
<td>24</td>
|
|
27
|
+
<td>4.0</td>
|
|
28
|
+
<td>87</td>
|
|
29
|
+
<td>14%</td>
|
|
30
|
+
<td>1%</td>
|
|
31
|
+
</tr>
|
|
32
|
+
<tr>
|
|
33
|
+
<td>Ice cream sandwich</td>
|
|
34
|
+
<td>237</td>
|
|
35
|
+
<td>9.0</td>
|
|
36
|
+
<td>37</td>
|
|
37
|
+
<td>4.3</td>
|
|
38
|
+
<td>129</td>
|
|
39
|
+
<td>8%</td>
|
|
40
|
+
<td>1%</td>
|
|
41
|
+
</tr>
|
|
42
|
+
<tr>
|
|
43
|
+
<td>Eclair</td>
|
|
44
|
+
<td>262</td>
|
|
45
|
+
<td>16.0</td>
|
|
46
|
+
<td>24</td>
|
|
47
|
+
<td>6.0</td>
|
|
48
|
+
<td>337</td>
|
|
49
|
+
<td>6%</td>
|
|
50
|
+
<td>7%</td>
|
|
51
|
+
</tr>
|
|
52
|
+
<tr>
|
|
53
|
+
<td>Cupcake</td>
|
|
54
|
+
<td>305</td>
|
|
55
|
+
<td>3.7</td>
|
|
56
|
+
<td>67</td>
|
|
57
|
+
<td>4.3</td>
|
|
58
|
+
<td>413</td>
|
|
59
|
+
<td>3%</td>
|
|
60
|
+
<td>8%</td>
|
|
61
|
+
</tr>
|
|
62
|
+
<tr>
|
|
63
|
+
<td>Gingerbread</td>
|
|
64
|
+
<td>356</td>
|
|
65
|
+
<td>16.0</td>
|
|
66
|
+
<td>49</td>
|
|
67
|
+
<td>3.9</td>
|
|
68
|
+
<td>327</td>
|
|
69
|
+
<td>7%</td>
|
|
70
|
+
<td>16%</td>
|
|
71
|
+
</tr>
|
|
72
|
+
<tr>
|
|
73
|
+
<td>Jelly bean</td>
|
|
74
|
+
<td>375</td>
|
|
75
|
+
<td>0.0</td>
|
|
76
|
+
<td>94</td>
|
|
77
|
+
<td>0.0</td>
|
|
78
|
+
<td>50</td>
|
|
79
|
+
<td>0%</td>
|
|
80
|
+
<td>0%</td>
|
|
81
|
+
</tr>
|
|
82
|
+
<tr>
|
|
83
|
+
<td>Lollipop</td>
|
|
84
|
+
<td>392</td>
|
|
85
|
+
<td>0.2</td>
|
|
86
|
+
<td>98</td>
|
|
87
|
+
<td>0</td>
|
|
88
|
+
<td>38</td>
|
|
89
|
+
<td>0%</td>
|
|
90
|
+
<td>2%</td>
|
|
91
|
+
</tr>
|
|
92
|
+
<tr>
|
|
93
|
+
<td>Honeycomb</td>
|
|
94
|
+
<td>408</td>
|
|
95
|
+
<td>3.2</td>
|
|
96
|
+
<td>87</td>
|
|
97
|
+
<td>6.5</td>
|
|
98
|
+
<td>562</td>
|
|
99
|
+
<td>0%</td>
|
|
100
|
+
<td>45%</td>
|
|
101
|
+
</tr>
|
|
102
|
+
<tr>
|
|
103
|
+
<td>Donut</td>
|
|
104
|
+
<td>452</td>
|
|
105
|
+
<td>25.0</td>
|
|
106
|
+
<td>51</td>
|
|
107
|
+
<td>4.9</td>
|
|
108
|
+
<td>326</td>
|
|
109
|
+
<td>2%</td>
|
|
110
|
+
<td>22%</td>
|
|
111
|
+
</tr>
|
|
112
|
+
<tr>
|
|
113
|
+
<td>Kitkat</td>
|
|
114
|
+
<td>518</td>
|
|
115
|
+
<td>26.0</td>
|
|
116
|
+
<td>65</td>
|
|
117
|
+
<td>7</td>
|
|
118
|
+
<td>54</td>
|
|
119
|
+
<td>12%</td>
|
|
120
|
+
<td>6%</td>
|
|
121
|
+
</tr>
|
|
122
|
+
</tbody>
|
|
123
|
+
</table>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
<div class="mdw-grid__item" mdw-colspan="100%">
|
|
128
|
+
<div class="mdw-card mdw-theme" mdw-surface="card" mdw-border-ink>
|
|
129
|
+
<div class="mdw-datatable js mdw-theme" mdw-ink="primary" mdw-cell-focusable>
|
|
130
|
+
<div class="mdw-datatable__header">
|
|
131
|
+
<div class="mdw-datatable__header-text">Customized HTML Table</div>
|
|
132
|
+
</div>
|
|
133
|
+
<div class="mdw-datatable__scroller">
|
|
134
|
+
<table>
|
|
135
|
+
<thead>
|
|
136
|
+
<tr>
|
|
137
|
+
<th aria-sort="none" mdw-text mdw-primary-column><span class="mdw-datatable__sort-icon material-icons">arrow_downward</span>Dessert (100g serving)</th>
|
|
138
|
+
<th aria-sort="ascending" mdw-number><span class="mdw-datatable__sort-icon material-icons">arrow_downward</span><span class="mdw-tooltip__wrapper"><span class="mdw-tooltip__target">Calories</span><div class="mdw-tooltip mdw-theme" mdw-surface="background 700" mdw-dark>The total amount of food energy in the given serving size.</div></span></th>
|
|
139
|
+
<th aria-sort="none" mdw-number><span class="mdw-datatable__sort-icon material-icons">arrow_downward</span>Fat (g)</th>
|
|
140
|
+
<th aria-sort="none" mdw-number><span class="mdw-datatable__sort-icon material-icons">arrow_downward</span>Carbs (g)</th>
|
|
141
|
+
<th aria-sort="none" mdw-number><span class="mdw-datatable__sort-icon material-icons">arrow_downward</span>Protein (g)</th>
|
|
142
|
+
<th aria-sort="none" mdw-number><span class="mdw-datatable__sort-icon material-icons">arrow_downward</span>Sodium (mg)</th>
|
|
143
|
+
<th aria-sort="none" mdw-number><span class="mdw-datatable__sort-icon material-icons">arrow_downward</span>Calcium (%)</th>
|
|
144
|
+
<th aria-sort="none" mdw-number><span class="mdw-datatable__sort-icon material-icons">arrow_downward</span>Iron (%)</th>
|
|
145
|
+
</tr>
|
|
146
|
+
</thead>
|
|
147
|
+
<tbody>
|
|
148
|
+
<tr>
|
|
149
|
+
<td mdw-text mdw-primary-column>Frozen Yogurt</td>
|
|
150
|
+
<td mdw-number>159</td>
|
|
151
|
+
<td mdw-number>6.0</td>
|
|
152
|
+
<td mdw-number>24</td>
|
|
153
|
+
<td mdw-number>4.0</td>
|
|
154
|
+
<td mdw-number>87</td>
|
|
155
|
+
<td mdw-number>14%</td>
|
|
156
|
+
<td mdw-number>1%</td>
|
|
157
|
+
</tr>
|
|
158
|
+
<tr>
|
|
159
|
+
<td mdw-text mdw-primary-column>Ice cream sandwich</td>
|
|
160
|
+
<td mdw-number>237</td>
|
|
161
|
+
<td mdw-number>9.0</td>
|
|
162
|
+
<td mdw-number>37</td>
|
|
163
|
+
<td mdw-number>4.3</td>
|
|
164
|
+
<td mdw-number>129</td>
|
|
165
|
+
<td mdw-number>8%</td>
|
|
166
|
+
<td mdw-number>1%</td>
|
|
167
|
+
</tr>
|
|
168
|
+
<tr>
|
|
169
|
+
<td mdw-text mdw-primary-column>Eclair</td>
|
|
170
|
+
<td mdw-number>262</td>
|
|
171
|
+
<td mdw-number>16.0</td>
|
|
172
|
+
<td mdw-number>24</td>
|
|
173
|
+
<td mdw-number>6.0</td>
|
|
174
|
+
<td mdw-number>337</td>
|
|
175
|
+
<td mdw-number>6%</td>
|
|
176
|
+
<td mdw-number>7%</td>
|
|
177
|
+
</tr>
|
|
178
|
+
<tr>
|
|
179
|
+
<td mdw-text mdw-primary-column>Cupcake</td>
|
|
180
|
+
<td mdw-number>305</td>
|
|
181
|
+
<td mdw-number>3.7</td>
|
|
182
|
+
<td mdw-number>67</td>
|
|
183
|
+
<td mdw-number>4.3</td>
|
|
184
|
+
<td mdw-number>413</td>
|
|
185
|
+
<td mdw-number>3%</td>
|
|
186
|
+
<td mdw-number>8%</td>
|
|
187
|
+
</tr>
|
|
188
|
+
<tr>
|
|
189
|
+
<td mdw-text mdw-primary-column>Gingerbread</td>
|
|
190
|
+
<td mdw-number>356</td>
|
|
191
|
+
<td mdw-number>16.0</td>
|
|
192
|
+
<td mdw-number>49</td>
|
|
193
|
+
<td mdw-number>3.9</td>
|
|
194
|
+
<td mdw-number>327</td>
|
|
195
|
+
<td mdw-number>7%</td>
|
|
196
|
+
<td mdw-number>16%</td>
|
|
197
|
+
</tr>
|
|
198
|
+
<tr>
|
|
199
|
+
<td mdw-text mdw-primary-column>Jelly bean</td>
|
|
200
|
+
<td mdw-number>375</td>
|
|
201
|
+
<td mdw-number>0.0</td>
|
|
202
|
+
<td mdw-number>94</td>
|
|
203
|
+
<td mdw-number>0.0</td>
|
|
204
|
+
<td mdw-number>50</td>
|
|
205
|
+
<td mdw-number>0%</td>
|
|
206
|
+
<td mdw-number>0%</td>
|
|
207
|
+
</tr>
|
|
208
|
+
<tr>
|
|
209
|
+
<td mdw-text mdw-primary-column>Lollipop</td>
|
|
210
|
+
<td mdw-number>392</td>
|
|
211
|
+
<td mdw-number>0.2</td>
|
|
212
|
+
<td mdw-number>98</td>
|
|
213
|
+
<td mdw-number>0</td>
|
|
214
|
+
<td mdw-number>38</td>
|
|
215
|
+
<td mdw-number>0%</td>
|
|
216
|
+
<td mdw-number>2%</td>
|
|
217
|
+
</tr>
|
|
218
|
+
<tr>
|
|
219
|
+
<td mdw-text mdw-primary-column>Honeycomb</td>
|
|
220
|
+
<td mdw-number>408</td>
|
|
221
|
+
<td mdw-number>3.2</td>
|
|
222
|
+
<td mdw-number>87</td>
|
|
223
|
+
<td mdw-number>6.5</td>
|
|
224
|
+
<td mdw-number>562</td>
|
|
225
|
+
<td mdw-number>0%</td>
|
|
226
|
+
<td mdw-number>45%</td>
|
|
227
|
+
</tr>
|
|
228
|
+
<tr>
|
|
229
|
+
<td mdw-text mdw-primary-column>Donut</td>
|
|
230
|
+
<td mdw-number>452</td>
|
|
231
|
+
<td mdw-number>25.0</td>
|
|
232
|
+
<td mdw-number>51</td>
|
|
233
|
+
<td mdw-number>4.9</td>
|
|
234
|
+
<td mdw-number>326</td>
|
|
235
|
+
<td mdw-number>2%</td>
|
|
236
|
+
<td mdw-number>22%</td>
|
|
237
|
+
</tr>
|
|
238
|
+
<tr>
|
|
239
|
+
<td mdw-text mdw-primary-column>Kitkat</td>
|
|
240
|
+
<td mdw-number>518</td>
|
|
241
|
+
<td mdw-number>26.0</td>
|
|
242
|
+
<td mdw-number>65</td>
|
|
243
|
+
<td mdw-number>7</td>
|
|
244
|
+
<td mdw-number>54</td>
|
|
245
|
+
<td mdw-number>12%</td>
|
|
246
|
+
<td mdw-number>6%</td>
|
|
247
|
+
</tr>
|
|
248
|
+
</tbody>
|
|
249
|
+
</table>
|
|
250
|
+
</div>
|
|
251
|
+
<div class="mdw-datatable__footer">
|
|
252
|
+
<div class="mdw-datatable__footer-options">
|
|
253
|
+
<div>Rows per page</div>
|
|
254
|
+
<label class="mdw-textfield" mdw-solo>
|
|
255
|
+
<select class="mdw-textfield__input">
|
|
256
|
+
<option class="mdw-theme" mdw-surface="card" value="10">10</option>
|
|
257
|
+
<option class="mdw-theme" mdw-surface="card" value="25">25</option>
|
|
258
|
+
<option class="mdw-theme" mdw-surface="card" value="50">50</option>
|
|
259
|
+
<option class="mdw-theme" mdw-surface="card" value="100">100</option>
|
|
260
|
+
</select>
|
|
261
|
+
<div class="mdw-textfield__icon" mdw-dropdown></div>
|
|
262
|
+
</label>
|
|
263
|
+
</div>
|
|
264
|
+
<div class="mdw-datatable__footer-details">1-10 of 10</div>
|
|
265
|
+
<div class="mdw-datatable__footer-controls">
|
|
266
|
+
<%~ includeFile(T, { button: { icon:true, disabled:true , class:'material-icons', text:'chevron_left' }}) %>
|
|
267
|
+
<%~ includeFile(T, { button: { icon: true, disabled:true , class:'material-icons', text:'chevron_right' }}) %>
|
|
268
|
+
</div>
|
|
269
|
+
</div>
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
<div class="mdw-grid__item" mdw-colspan="100%">
|
|
274
|
+
<div class="mdw-card mdw-theme" mdw-surface="card" mdw-border-ink>
|
|
275
|
+
<div class="mdw-datatable js mdw-theme" id="dynamic-table" mdw-ink="primary" mdw-row-focusable style="max-height:80vh;">
|
|
276
|
+
<div class="mdw-datatable__header">
|
|
277
|
+
<div class="mdw-datatable__header-text">Data Table Adapter</div>
|
|
278
|
+
<div class="mdw-datatable__header-controls">
|
|
279
|
+
<div class="mdw-menu__wrapper">
|
|
280
|
+
<%~ includeFile(T, { button: { icon:true, ink:'primary' , class:'material-icons', attributes: {'mdw-overlay-default':"medium", 'aria-pressed':"false"}, text:'filter_list' }}) %>
|
|
281
|
+
<div class="mdw-menu" mdw-position="end">
|
|
282
|
+
<div class="mdw-menu__popup mdw-theme" mdw-surface="card">
|
|
283
|
+
<div class="mdw-menu__item" aria-checked="true" data-filter="none">
|
|
284
|
+
<div class="mdw-menu__radio mdw-theme material-icons" mdw-ink="medium">check</div>
|
|
285
|
+
<div class="mdw-menu__text">No filter</div>
|
|
286
|
+
</div>
|
|
287
|
+
<div class="mdw-menu__item" data-filter="md">
|
|
288
|
+
<div class="mdw-menu__radio mdw-theme material-icons" mdw-ink="medium">check</div>
|
|
289
|
+
<div class="mdw-menu__text">Contains 'md'</div>
|
|
290
|
+
</div>
|
|
291
|
+
<div class="mdw-menu__item" data-filter="div9">
|
|
292
|
+
<div class="mdw-menu__radio mdw-theme material-icons" mdw-ink="medium">check</div>
|
|
293
|
+
<div class="mdw-menu__text">Random divisible by 9</div>
|
|
294
|
+
</div>
|
|
295
|
+
<div class="mdw-menu__item" data-filter="bool">
|
|
296
|
+
<div class="mdw-menu__radio mdw-theme material-icons" mdw-ink="medium">check</div>
|
|
297
|
+
<div class="mdw-menu__text">bool is checked</div>
|
|
298
|
+
</div>
|
|
299
|
+
</div>
|
|
300
|
+
</div>
|
|
301
|
+
</div>
|
|
302
|
+
<div class="mdw-menu__wrapper">
|
|
303
|
+
<%~ includeFile(T, { button: { icon:true, ink:'medium' , class:'material-icons', text:'more_vert' }}) %>
|
|
304
|
+
<div class="mdw-menu" mdw-position="end">
|
|
305
|
+
<div class="mdw-menu__popup mdw-theme" mdw-surface="card">
|
|
306
|
+
<div class="mdw-menu__item" aria-checked="true" data-option="throttle">
|
|
307
|
+
<div class="mdw-menu__check mdw-theme material-icons" mdw-ink="medium">check</div>
|
|
308
|
+
<div class="mdw-menu__text">Throttle</div>
|
|
309
|
+
</div>
|
|
310
|
+
<div class="mdw-menu__item" aria-checked="true" data-option="paginate">
|
|
311
|
+
<div class="mdw-menu__check mdw-theme material-icons" mdw-ink="medium">check</div>
|
|
312
|
+
<div class="mdw-menu__text">Paginate</div>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
</div>
|
|
319
|
+
</div>
|
|
320
|
+
</div>
|
|
321
|
+
</div>
|
|
322
|
+
</div>
|
|
323
|
+
<script src="datatable.min.js"></script>
|