@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,26 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as Button from '../../components/button/index';
|
|
3
|
-
import * as DataTable from '../../components/datatable/index';
|
|
4
|
-
import * as Menu from '../../components/menu/index';
|
|
5
|
-
import * as MenuItem from '../../components/menu/item';
|
|
6
|
-
import
|
|
1
|
+
import DataTableAdapter from '../../adapters/datatable/index.js';
|
|
2
|
+
import * as Button from '../../components/button/index.js';
|
|
3
|
+
import * as DataTable from '../../components/datatable/index.js';
|
|
4
|
+
import * as Menu from '../../components/menu/index.js';
|
|
5
|
+
import * as MenuItem from '../../components/menu/item.js';
|
|
6
|
+
import * as Selection from '../../components/selection/index.js';
|
|
7
|
+
import { iterateArrayLike } from '../../core/dom.js';
|
|
7
8
|
|
|
8
9
|
/** @return {void} */
|
|
9
10
|
function initializeMdwComponents() {
|
|
10
11
|
iterateArrayLike(document.querySelectorAll('.mdw-datatable.js'), DataTable.attach);
|
|
11
12
|
iterateArrayLike(document.getElementsByClassName('mdw-button'), Button.attach);
|
|
13
|
+
iterateArrayLike(document.getElementsByClassName('mdw-selection'), Selection.attach);
|
|
12
14
|
iterateArrayLike(document.getElementsByClassName('mdw-menu'), Menu.attach);
|
|
13
15
|
}
|
|
14
16
|
|
|
17
|
+
/**
|
|
18
|
+
* @typedef {Object} CustomData
|
|
19
|
+
* @prop {boolean} selected
|
|
20
|
+
* @prop {string} text
|
|
21
|
+
* @prop {string} text2
|
|
22
|
+
* @prop {boolean} check1
|
|
23
|
+
* @prop {number} increment
|
|
24
|
+
* @prop {number} random
|
|
25
|
+
*/
|
|
15
26
|
|
|
16
|
-
/** @type {DataTableAdapter} */
|
|
27
|
+
/** @type {DataTableAdapter<CustomData>} */
|
|
17
28
|
let dynamicTableAdapter = null;
|
|
18
29
|
/** @return {void} */
|
|
19
30
|
function buildDynamicTable() {
|
|
31
|
+
/** @type {CustomData[]} */
|
|
20
32
|
const datasource = [];
|
|
21
33
|
let count = 1;
|
|
22
34
|
const addDatasourceObject = () => {
|
|
23
35
|
datasource.push({
|
|
36
|
+
selected: false,
|
|
24
37
|
text: Math.random().toString(36).substring(2),
|
|
25
38
|
text2: Math.random().toString(36).substring(2),
|
|
26
39
|
check1: Math.random() > 0.5,
|
|
@@ -84,8 +97,8 @@ function buildDynamicTable() {
|
|
|
84
97
|
Menu.attach(filterMenu);
|
|
85
98
|
Menu.attach(optionsMenu);
|
|
86
99
|
|
|
87
|
-
filterButton.addEventListener('click', event => Menu.show(filterMenu, event));
|
|
88
|
-
optionsButton.addEventListener('click', event => Menu.show(optionsMenu, event));
|
|
100
|
+
filterButton.addEventListener('click', (/** @type {MouseEvent} */ event) => Menu.show(filterMenu, event));
|
|
101
|
+
optionsButton.addEventListener('click', (/** @type {MouseEvent} */ event) => Menu.show(optionsMenu, event));
|
|
89
102
|
|
|
90
103
|
filterMenu.addEventListener(MenuItem.CHECK_EVENT, (event) => {
|
|
91
104
|
/** @type {HTMLElement} */
|
|
@@ -96,13 +109,13 @@ function buildDynamicTable() {
|
|
|
96
109
|
dynamicTableAdapter.setFilter(null);
|
|
97
110
|
break;
|
|
98
111
|
case 'md':
|
|
99
|
-
dynamicTableAdapter.setFilter(data => data.text.indexOf('md') !== -1 || data.text2.indexOf('md') !== -1);
|
|
112
|
+
dynamicTableAdapter.setFilter((data) => data.text.indexOf('md') !== -1 || data.text2.indexOf('md') !== -1);
|
|
100
113
|
break;
|
|
101
114
|
case 'div9':
|
|
102
|
-
dynamicTableAdapter.setFilter(data => data.random % 9 === 0);
|
|
115
|
+
dynamicTableAdapter.setFilter((data) => data.random % 9 === 0);
|
|
103
116
|
break;
|
|
104
117
|
case 'bool':
|
|
105
|
-
dynamicTableAdapter.setFilter(data => data.check1);
|
|
118
|
+
dynamicTableAdapter.setFilter((data) => data.check1);
|
|
106
119
|
break;
|
|
107
120
|
}
|
|
108
121
|
dynamicTableAdapter.refresh();
|
|
@@ -113,7 +126,7 @@ function buildDynamicTable() {
|
|
|
113
126
|
}
|
|
114
127
|
});
|
|
115
128
|
filterMenu.addEventListener(MenuItem.ACTIVATE_EVENT, () => Menu.hide(filterMenu));
|
|
116
|
-
|
|
129
|
+
|
|
117
130
|
optionsMenu.addEventListener(MenuItem.CHECK_EVENT, (event) => {
|
|
118
131
|
/** @type {HTMLElement} */
|
|
119
132
|
const menuItem = (event.target);
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
include ../_mixins.pug
|
|
2
|
+
|
|
3
|
+
+header("datatable")
|
|
4
|
+
.mdw-grid(mdw-margin-top mdw-margin-bottom)
|
|
5
|
+
.mdw-grid__item(mdw-colspan="100%")
|
|
6
|
+
.mdw-card.mdw-theme(mdw-surface="card" mdw-border-ink)
|
|
7
|
+
.mdw-datatable.mdw-theme(mdw-ink="primary" style="overflow-x:auto")
|
|
8
|
+
table
|
|
9
|
+
caption Standard HTML Table (CSS Only)
|
|
10
|
+
thead
|
|
11
|
+
tr
|
|
12
|
+
th Dessert (100g serving)
|
|
13
|
+
th Calories
|
|
14
|
+
th Fat (g)
|
|
15
|
+
th Carbs (g)
|
|
16
|
+
th Protein (g)
|
|
17
|
+
th Sodium (mg)
|
|
18
|
+
th Calcium (%)
|
|
19
|
+
th Iron (%)
|
|
20
|
+
tbody
|
|
21
|
+
tr
|
|
22
|
+
td Frozen Yogurt
|
|
23
|
+
td 159
|
|
24
|
+
td 6.0
|
|
25
|
+
td 24
|
|
26
|
+
td 4.0
|
|
27
|
+
td 87
|
|
28
|
+
td 14%
|
|
29
|
+
td 1%
|
|
30
|
+
tr
|
|
31
|
+
td Ice cream sandwich
|
|
32
|
+
td 237
|
|
33
|
+
td 9.0
|
|
34
|
+
td 37
|
|
35
|
+
td 4.3
|
|
36
|
+
td 129
|
|
37
|
+
td 8%
|
|
38
|
+
td 1%
|
|
39
|
+
tr
|
|
40
|
+
td Eclair
|
|
41
|
+
td 262
|
|
42
|
+
td 16.0
|
|
43
|
+
td 24
|
|
44
|
+
td 6.0
|
|
45
|
+
td 337
|
|
46
|
+
td 6%
|
|
47
|
+
td 7%
|
|
48
|
+
tr
|
|
49
|
+
td Cupcake
|
|
50
|
+
td 305
|
|
51
|
+
td 3.7
|
|
52
|
+
td 67
|
|
53
|
+
td 4.3
|
|
54
|
+
td 413
|
|
55
|
+
td 3%
|
|
56
|
+
td 8%
|
|
57
|
+
tr
|
|
58
|
+
td Gingerbread
|
|
59
|
+
td 356
|
|
60
|
+
td 16.0
|
|
61
|
+
td 49
|
|
62
|
+
td 3.9
|
|
63
|
+
td 327
|
|
64
|
+
td 7%
|
|
65
|
+
td 16%
|
|
66
|
+
tr
|
|
67
|
+
td Jelly bean
|
|
68
|
+
td 375
|
|
69
|
+
td 0.0
|
|
70
|
+
td 94
|
|
71
|
+
td 0.0
|
|
72
|
+
td 50
|
|
73
|
+
td 0%
|
|
74
|
+
td 0%
|
|
75
|
+
tr
|
|
76
|
+
td Lollipop
|
|
77
|
+
td 392
|
|
78
|
+
td 0.2
|
|
79
|
+
td 98
|
|
80
|
+
td 0
|
|
81
|
+
td 38
|
|
82
|
+
td 0%
|
|
83
|
+
td 2%
|
|
84
|
+
tr
|
|
85
|
+
td Honeycomb
|
|
86
|
+
td 408
|
|
87
|
+
td 3.2
|
|
88
|
+
td 87
|
|
89
|
+
td 6.5
|
|
90
|
+
td 562
|
|
91
|
+
td 0%
|
|
92
|
+
td 45%
|
|
93
|
+
tr
|
|
94
|
+
td Donut
|
|
95
|
+
td 452
|
|
96
|
+
td 25.0
|
|
97
|
+
td 51
|
|
98
|
+
td 4.9
|
|
99
|
+
td 326
|
|
100
|
+
td 2%
|
|
101
|
+
td 22%
|
|
102
|
+
tr
|
|
103
|
+
td Kitkat
|
|
104
|
+
td 518
|
|
105
|
+
td 26.0
|
|
106
|
+
td 65
|
|
107
|
+
td 7
|
|
108
|
+
td 54
|
|
109
|
+
td 12%
|
|
110
|
+
td 6%
|
|
111
|
+
.mdw-grid__item(mdw-colspan="100%")
|
|
112
|
+
.mdw-card.mdw-theme(mdw-surface="card" mdw-border-ink)
|
|
113
|
+
.mdw-datatable.js.mdw-theme(mdw-ink="primary" mdw-cell-focusable)
|
|
114
|
+
.mdw-datatable__header
|
|
115
|
+
.mdw-datatable__header-text Customized HTML Table
|
|
116
|
+
.mdw-datatable__scroller
|
|
117
|
+
table
|
|
118
|
+
thead
|
|
119
|
+
tr
|
|
120
|
+
th(aria-sort="none" mdw-text mdw-primary-column)
|
|
121
|
+
span.mdw-datatable__sort-icon.material-icons arrow_downward
|
|
122
|
+
span Dessert (100g serving)
|
|
123
|
+
th(aria-sort="ascending" mdw-number)
|
|
124
|
+
span.mdw-datatable__sort-icon.material-icons arrow_downward
|
|
125
|
+
span.mdw-tooltip__wrapper
|
|
126
|
+
span.mdw-tooltip__target Calories
|
|
127
|
+
.mdw-tooltip.mdw-theme(mdw-surface="background 700" mdw-dark) The total amount of food energy in the given serving size.
|
|
128
|
+
th(aria-sort="none" mdw-number)
|
|
129
|
+
span.mdw-datatable__sort-icon.material-icons arrow_downward
|
|
130
|
+
span Fat (g)
|
|
131
|
+
th(aria-sort="none" mdw-number)
|
|
132
|
+
span.mdw-datatable__sort-icon.material-icons arrow_downward
|
|
133
|
+
span Carbs (g)
|
|
134
|
+
th(aria-sort="none" mdw-number)
|
|
135
|
+
span.mdw-datatable__sort-icon.material-icons arrow_downward
|
|
136
|
+
span Protein (g)
|
|
137
|
+
th(aria-sort="none" mdw-number)
|
|
138
|
+
span.mdw-datatable__sort-icon.material-icons arrow_downward
|
|
139
|
+
span Sodium (mg)
|
|
140
|
+
th(aria-sort="none" mdw-number)
|
|
141
|
+
span.mdw-datatable__sort-icon.material-icons arrow_downward
|
|
142
|
+
span Calcium (%)
|
|
143
|
+
th(aria-sort="none" mdw-number)
|
|
144
|
+
span.mdw-datatable__sort-icon.material-icons arrow_downward
|
|
145
|
+
span Iron (%)
|
|
146
|
+
tbody
|
|
147
|
+
tr
|
|
148
|
+
td(mdw-text mdw-primary-column) Frozen Yogurt
|
|
149
|
+
td(mdw-number) 159
|
|
150
|
+
td(mdw-number) 6.0
|
|
151
|
+
td(mdw-number) 24
|
|
152
|
+
td(mdw-number) 4.0
|
|
153
|
+
td(mdw-number) 87
|
|
154
|
+
td(mdw-number) 14%
|
|
155
|
+
td(mdw-number) 1%
|
|
156
|
+
tr
|
|
157
|
+
td(mdw-text mdw-primary-column) Ice cream sandwich
|
|
158
|
+
td(mdw-number) 237
|
|
159
|
+
td(mdw-number) 9.0
|
|
160
|
+
td(mdw-number) 37
|
|
161
|
+
td(mdw-number) 4.3
|
|
162
|
+
td(mdw-number) 129
|
|
163
|
+
td(mdw-number) 8%
|
|
164
|
+
td(mdw-number) 1%
|
|
165
|
+
tr
|
|
166
|
+
td(mdw-text mdw-primary-column) Eclair
|
|
167
|
+
td(mdw-number) 262
|
|
168
|
+
td(mdw-number) 16.0
|
|
169
|
+
td(mdw-number) 24
|
|
170
|
+
td(mdw-number) 6.0
|
|
171
|
+
td(mdw-number) 337
|
|
172
|
+
td(mdw-number) 6%
|
|
173
|
+
td(mdw-number) 7%
|
|
174
|
+
tr
|
|
175
|
+
td(mdw-text mdw-primary-column) Cupcake
|
|
176
|
+
td(mdw-number) 305
|
|
177
|
+
td(mdw-number) 3.7
|
|
178
|
+
td(mdw-number) 67
|
|
179
|
+
td(mdw-number) 4.3
|
|
180
|
+
td(mdw-number) 413
|
|
181
|
+
td(mdw-number) 3%
|
|
182
|
+
td(mdw-number) 8%
|
|
183
|
+
tr
|
|
184
|
+
td(mdw-text mdw-primary-column) Gingerbread
|
|
185
|
+
td(mdw-number) 356
|
|
186
|
+
td(mdw-number) 16.0
|
|
187
|
+
td(mdw-number) 49
|
|
188
|
+
td(mdw-number) 3.9
|
|
189
|
+
td(mdw-number) 327
|
|
190
|
+
td(mdw-number) 7%
|
|
191
|
+
td(mdw-number) 16%
|
|
192
|
+
tr
|
|
193
|
+
td(mdw-text mdw-primary-column) Jelly bean
|
|
194
|
+
td(mdw-number) 375
|
|
195
|
+
td(mdw-number) 0.0
|
|
196
|
+
td(mdw-number) 94
|
|
197
|
+
td(mdw-number) 0.0
|
|
198
|
+
td(mdw-number) 50
|
|
199
|
+
td(mdw-number) 0%
|
|
200
|
+
td(mdw-number) 0%
|
|
201
|
+
tr
|
|
202
|
+
td(mdw-text mdw-primary-column) Lollipop
|
|
203
|
+
td(mdw-number) 392
|
|
204
|
+
td(mdw-number) 0.2
|
|
205
|
+
td(mdw-number) 98
|
|
206
|
+
td(mdw-number) 0
|
|
207
|
+
td(mdw-number) 38
|
|
208
|
+
td(mdw-number) 0%
|
|
209
|
+
td(mdw-number) 2%
|
|
210
|
+
tr
|
|
211
|
+
td(mdw-text mdw-primary-column) Honeycomb
|
|
212
|
+
td(mdw-number) 408
|
|
213
|
+
td(mdw-number) 3.2
|
|
214
|
+
td(mdw-number) 87
|
|
215
|
+
td(mdw-number) 6.5
|
|
216
|
+
td(mdw-number) 562
|
|
217
|
+
td(mdw-number) 0%
|
|
218
|
+
td(mdw-number) 45%
|
|
219
|
+
tr
|
|
220
|
+
td(mdw-text mdw-primary-column) Donut
|
|
221
|
+
td(mdw-number) 452
|
|
222
|
+
td(mdw-number) 25.0
|
|
223
|
+
td(mdw-number) 51
|
|
224
|
+
td(mdw-number) 4.9
|
|
225
|
+
td(mdw-number) 326
|
|
226
|
+
td(mdw-number) 2%
|
|
227
|
+
td(mdw-number) 22%
|
|
228
|
+
tr
|
|
229
|
+
td(mdw-text mdw-primary-column) Kitkat
|
|
230
|
+
td(mdw-number) 518
|
|
231
|
+
td(mdw-number) 26.0
|
|
232
|
+
td(mdw-number) 65
|
|
233
|
+
td(mdw-number) 7
|
|
234
|
+
td(mdw-number) 54
|
|
235
|
+
td(mdw-number) 12%
|
|
236
|
+
td(mdw-number) 6%
|
|
237
|
+
.mdw-datatable__footer
|
|
238
|
+
.mdw-datatable__footer-options
|
|
239
|
+
span Rows per page
|
|
240
|
+
label.mdw-textfield(mdw-solo)
|
|
241
|
+
select.mdw-textfield__input
|
|
242
|
+
option.mdw-theme(mdw-surface="card" value="10") 10
|
|
243
|
+
option.mdw-theme(mdw-surface="card" value="25") 25
|
|
244
|
+
option.mdw-theme(mdw-surface="card" value="50") 50
|
|
245
|
+
option.mdw-theme(mdw-surface="card" value="100") 100
|
|
246
|
+
.mdw-textfield__icon(mdw-dropdown)
|
|
247
|
+
.mdw-datatable__footer-details 1-10 of 10
|
|
248
|
+
.mdw-datatable__footer-controls
|
|
249
|
+
+mdwButton({ icon:true, disabled:true }).material-icons chevron_left
|
|
250
|
+
+mdwButton({ icon: true, disabled:true }).material-icons chevron_right
|
|
251
|
+
.mdw-grid__item(mdw-colspan="100%")
|
|
252
|
+
.mdw-card.mdw-theme(mdw-surface="card" mdw-border-ink)
|
|
253
|
+
.mdw-datatable.js#dynamic-table.mdw-theme(mdw-ink="primary" mdw-row-focusable style="max-height:80vh")
|
|
254
|
+
.mdw-datatable__header
|
|
255
|
+
.mdw-datatable__header-text Data Table Adapter
|
|
256
|
+
.mdw-datatable__header-controls
|
|
257
|
+
.mdw-menu__wrapper
|
|
258
|
+
+mdwButton({ icon:true, ink:'primary' }).material-icons(mdw-overlay-default="medium" aria-pressed="false") filter_list
|
|
259
|
+
.mdw-menu(mdw-position="end")
|
|
260
|
+
.mdw-menu__popup.mdw-theme(mdw-surface="card")
|
|
261
|
+
.mdw-menu__item(aria-checked="true" data-filter="none")
|
|
262
|
+
.mdw-menu__radio.mdw-theme.material-icons(mdw-ink="medium") check
|
|
263
|
+
.mdw-menu__text No filter
|
|
264
|
+
.mdw-menu__item(data-filter="md")
|
|
265
|
+
.mdw-menu__radio.mdw-theme.material-icons(mdw-ink="medium") check
|
|
266
|
+
.mdw-menu__text Contains 'md'
|
|
267
|
+
.mdw-menu__item(data-filter="div9")
|
|
268
|
+
.mdw-menu__radio.mdw-theme.material-icons(mdw-ink="medium") check
|
|
269
|
+
.mdw-menu__text Random divisible by 9
|
|
270
|
+
.mdw-menu__item(data-filter="bool")
|
|
271
|
+
.mdw-menu__radio.mdw-theme.material-icons(mdw-ink="medium") check
|
|
272
|
+
.mdw-menu__text bool is checked
|
|
273
|
+
.mdw-menu__wrapper
|
|
274
|
+
+mdwButton({ icon:true, ink:'medium' }).material-icons more_vert
|
|
275
|
+
.mdw-menu(mdw-position="end")
|
|
276
|
+
.mdw-menu__popup.mdw-theme(mdw-surface="card")
|
|
277
|
+
.mdw-menu__item(aria-checked="true" data-option="throttle")
|
|
278
|
+
.mdw-menu__check.mdw-theme.material-icons(mdw-ink="medium") check
|
|
279
|
+
.mdw-menu__text Throttle
|
|
280
|
+
.mdw-menu__item(aria-checked="true" data-option="paginate")
|
|
281
|
+
.mdw-menu__check.mdw-theme.material-icons(mdw-ink="medium") check
|
|
282
|
+
.mdw-menu__text Paginate
|
|
283
|
+
script(src='datatable.min.js')
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
<% var T = '../../templates/index.eta' %>
|
|
2
|
+
<% layout('../_partials/_header.eta', {page: 'dialog'}) %>
|
|
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">Dialogs inform users about a specific task and may contain critical information, require decisions, or involve multiple tasks.</h5>
|
|
6
|
+
<p class="mdw-type">Dialogs contain text and UI controls. They retain focus until dismissed or a required action has been taken. Use dialogs sparingly because they are interruptive.</p>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="mdw-grid__item" mdw-colspan="4">
|
|
9
|
+
<div class="mdw-grid__content">
|
|
10
|
+
<div class="component-sample">
|
|
11
|
+
<div class="component-sample__container">
|
|
12
|
+
<%~ includeFile(T, {button: { href: "#sample-dialog", text:'Open' }}) %>
|
|
13
|
+
<div class="mdw-dialog" id="sample-dialog">
|
|
14
|
+
<a class="mdw-dialog__close" href="#"></a>
|
|
15
|
+
<div class="mdw-dialog__popup mdw-theme" mdw-surface="card">
|
|
16
|
+
<div class="mdw-dialog__title">Sample title</div>
|
|
17
|
+
<div class="mdw-dialog__body mdw-theme" mdw-ink="medium">Sample body text</div>
|
|
18
|
+
<div class="mdw-dialog__button-area">
|
|
19
|
+
<%~ includeFile(T, { button: { href:'#', ink:'secondary', text:'Agree' }}) %>
|
|
20
|
+
<%~ includeFile(T, { button: { href:'#', ink:'secondary', text:'Disagree' }}) %>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="mdw-grid__item" mdw-colspan="8">
|
|
29
|
+
<div class="mdw-type" mdw-style="subtitle">Javascript</div>
|
|
30
|
+
<div class="docs-option-list">
|
|
31
|
+
<%~ includeFile(T, { selection: { ink:'secondary', name:'javascript', type:'radio', value:'required', text:'Required' }}) %>
|
|
32
|
+
<%~ includeFile(T, { selection: { ink:'secondary', name:'javascript', type:'radio', value:'optional', checked:true, text:'Optional' }}) %>
|
|
33
|
+
<%~ includeFile(T, { selection: { ink:'secondary', name:'javascript', type:'radio', value:'none', text:'None' }}) %>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="mdw-type" mdw-style="subtitle">Options</div>
|
|
36
|
+
<div class="docs-option-list">
|
|
37
|
+
<%~ includeFile(T, { selection: { ink:'secondary', name:'stacked-buttons', text:'Stacked Buttons' }}) %>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="mdw-type" mdw-style="subtitle">Width Units</div>
|
|
40
|
+
<div class="docs-option-list">
|
|
41
|
+
<%~ includeFile(T, { selection: { ink:'secondary', name:'width', type:'radio', value:'auto', checked:true, text:'Auto' }}) %>
|
|
42
|
+
<%~ includeFile(T, { selection: { ink:'secondary', name:'width', type:'radio', value:'3', text:'3' }}) %>
|
|
43
|
+
<%~ includeFile(T, { selection: { ink:'secondary', name:'width', type:'radio', value:'4', text:'4' }}) %>
|
|
44
|
+
<%~ includeFile(T, { selection: { ink:'secondary', name:'width', type:'radio', value:'5', text:'5' }}) %>
|
|
45
|
+
<%~ includeFile(T, { selection: { ink:'secondary', name:'width', type:'radio', value:'6', text:'6' }}) %>
|
|
46
|
+
<%~ includeFile(T, { selection: { ink:'secondary', name:'width', type:'radio', value:'7', text:'7' }}) %>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="mdw-grid__item" mdw-colspan="100%" style="max-height:0;"></div>
|
|
50
|
+
<div class="mdw-grid__item" mdw-colspan="100%">
|
|
51
|
+
<h6 class="mdw-type">HTML Code</h6>
|
|
52
|
+
<div class="mdw-card mdw-theme component-code component-html" mdw-surface="card" mdw-border-ink></div>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="mdw-grid__item" mdw-colspan="100%">
|
|
55
|
+
<h6 class="mdw-type">Javascript Code</h6>
|
|
56
|
+
<div class="mdw-card mdw-theme component-code component-js" mdw-surface="card" mdw-border-ink></div>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="mdw-grid__item" mdw-colspan="100%">
|
|
59
|
+
<h6 class="mdw-type">Samples</h6>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="mdw-grid__item display-flex" mdw-colspan="4" flex-justify-content="center">
|
|
62
|
+
<div class="render">
|
|
63
|
+
<div class="display-flex flex-1" flex-column style="position:relative;">
|
|
64
|
+
<%~ includeFile('../_partials/_androidstatusbar.eta', { surface: 'primary 700', dark: true }) %>
|
|
65
|
+
<div class="mdw-appbar mdw-theme" mdw-surface="primary 500" mdw-dark>
|
|
66
|
+
<div class="mdw-appbar__action">
|
|
67
|
+
<div class="mdw-appbar__start">
|
|
68
|
+
<div class="mdw-tooltip__wrapper">
|
|
69
|
+
<%~ includeFile(T, {button: { icon:true, class:"mdw-tooltip__target material-icons", text:'menu' }}) %>
|
|
70
|
+
<div class="mdw-tooltip mdw-theme" mdw-surface="background 700" mdw-dark>Menu</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="mdw-appbar__end">
|
|
74
|
+
<div class="mdw-tooltip__wrapper">
|
|
75
|
+
<%~ includeFile(T, {button: { icon:true, class:"mdw-tooltip__target material-icons", text:'more_vert' }}) %>
|
|
76
|
+
<div class="mdw-tooltip mdw-theme" mdw-surface="background 700" mdw-dark>Options</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="content" style="padding:16px 8px;">
|
|
82
|
+
<h6 class="mdw-type">Javascript</h6>
|
|
83
|
+
<div class="display-flex js" style="padding:16px 0;">
|
|
84
|
+
<%~ includeFile(T, { button: { surface:'primary 500', dark:true, raised:true, text:'Chained' }}) %>
|
|
85
|
+
<%~ includeFile(T, { button: { surface:'primary 500', dark:true, raised:true, text:'Input Autofocus' }}) %>
|
|
86
|
+
</div>
|
|
87
|
+
<h6 class="mdw-type">CSS-Only</h6>
|
|
88
|
+
<div class="display-flex js" style="padding:16px 0;">
|
|
89
|
+
<%~ includeFile(T, { button: { surface:'primary 500', dark:true, raised:true, attributes: {href:"#confirmdialog-titled"}, id:'titled-button', text: 'Titled' }}) %>
|
|
90
|
+
<%~ includeFile(T, { button: { surface:'primary 500', dark:true, raised:true, attributes: {href:"#confirmdialog-text"}, id:'text-button', text: 'Text' }}) %>
|
|
91
|
+
<%~ includeFile(T, { button: { surface:'primary 500', dark:true, raised:true, attributes: {href:"#dialog-scrolling"}, id:'scrolling-button', text: 'Scrolling' }}) %>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
<div class="mdw-dialog" id="confirmdialog-titled">
|
|
95
|
+
<a class="mdw-dialog__close" href="#titled-button"></a>
|
|
96
|
+
<div class="mdw-dialog__popup mdw-theme" mdw-surface="card">
|
|
97
|
+
<div class="mdw-dialog__title">Use Google's location service?</div>
|
|
98
|
+
<div class="mdw-dialog__body mdw-theme" mdw-ink="medium">Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running.</div>
|
|
99
|
+
<div class="mdw-dialog__button-area">
|
|
100
|
+
<%~ includeFile(T, { button: { ink:'secondary', attributes: {href:"#titled-button"}, text:'Agree' }}) %>
|
|
101
|
+
<%~ includeFile(T, { button: { ink:'secondary', attributes: {href:"#titled-button"}, text:'Disagree' }}) %>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
<div class="mdw-dialog" id="dialog-scrolling">
|
|
106
|
+
<a class="mdw-dialog__close" href="#scrolling-button"></a>
|
|
107
|
+
<div class="mdw-dialog__popup mdw-theme" mdw-surface="card">
|
|
108
|
+
<div class="mdw-dialog__header">
|
|
109
|
+
<div class="mdw-dialog__title">Dialog header</div>
|
|
110
|
+
</div>
|
|
111
|
+
<div class="mdw-divider mdw-theme" mdw-border-ink="divider"></div>
|
|
112
|
+
<div class="mdw-dialog__scrolling">
|
|
113
|
+
<ul class="mdw-list">
|
|
114
|
+
<li class="mdw-list__item">
|
|
115
|
+
<a class="mdw-list__content mdw-overlay mdw-ripple mdw-theme" href="#scrolling-button" mdw-ink="default">Item 1</a>
|
|
116
|
+
</li>
|
|
117
|
+
<li class="mdw-list__item">
|
|
118
|
+
<a class="mdw-list__content mdw-overlay mdw-ripple mdw-theme" href="#scrolling-button" mdw-ink="default">Item 2</a>
|
|
119
|
+
</li>
|
|
120
|
+
<li class="mdw-list__item">
|
|
121
|
+
<a class="mdw-list__content mdw-overlay mdw-ripple mdw-theme" href="#scrolling-button" mdw-ink="default">Item 3</a>
|
|
122
|
+
</li>
|
|
123
|
+
<li class="mdw-list__item">
|
|
124
|
+
<a class="mdw-list__content mdw-overlay mdw-ripple mdw-theme" href="#scrolling-button" mdw-ink="default">Item 4</a>
|
|
125
|
+
</li>
|
|
126
|
+
<li class="mdw-list__item">
|
|
127
|
+
<a class="mdw-list__content mdw-overlay mdw-ripple mdw-theme" href="#scrolling-button" mdw-ink="default">Item 5</a>
|
|
128
|
+
</li>
|
|
129
|
+
<li class="mdw-list__item">
|
|
130
|
+
<a class="mdw-list__content mdw-overlay mdw-ripple mdw-theme" href="#scrolling-button" mdw-ink="default">Item 6</a>
|
|
131
|
+
</li>
|
|
132
|
+
<li class="mdw-list__item">
|
|
133
|
+
<a class="mdw-list__content mdw-overlay mdw-ripple mdw-theme" href="#scrolling-button" mdw-ink="default">Item 7</a>
|
|
134
|
+
</li>
|
|
135
|
+
<li class="mdw-list__item">
|
|
136
|
+
<a class="mdw-list__content mdw-overlay mdw-ripple mdw-theme" href="#scrolling-button" mdw-ink="default">Item 8</a>
|
|
137
|
+
</li>
|
|
138
|
+
<li class="mdw-list__item">
|
|
139
|
+
<a class="mdw-list__content mdw-overlay mdw-ripple mdw-theme" href="#scrolling-button" mdw-ink="default">Item 9</a>
|
|
140
|
+
</li>
|
|
141
|
+
</ul>
|
|
142
|
+
</div>
|
|
143
|
+
<div class="mdw-divider mdw-theme" mdw-border-ink="divider"></div>
|
|
144
|
+
<div class="mdw-dialog__button-area">
|
|
145
|
+
<%~ includeFile(T, { button: { ink:'secondary', attributes: { href:"#scrolling-button" }, text:'Agree' }}) %>
|
|
146
|
+
<%~ includeFile(T, { button: { ink:'secondary', attributes: { href:"#scrolling-button" }, text:'Disagree' }}) %>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
<div class="mdw-dialog" id="confirmdialog-text">
|
|
151
|
+
<a class="mdw-dialog__close" href="#text-button"></a>
|
|
152
|
+
<div class="mdw-dialog__popup mdw-theme" mdw-surface="card">
|
|
153
|
+
<div class="mdw-dialog__body mdw-theme" mdw-ink="medium">Discard draft?</div>
|
|
154
|
+
<div class="mdw-dialog__button-area">
|
|
155
|
+
<%~ includeFile(T, { button: { ink:'secondary', attributes: { href:"#text-button" }, text:'Discard' }}) %>
|
|
156
|
+
<%~ includeFile(T, { button: { ink:'secondary', attributes: { href:"#text-button" }, text:'Cancel' }}) %>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
<div class="mdw-dialog" id="dialog-textfield" mdw-width-units="5">
|
|
161
|
+
<form class="mdw-dialog__popup mdw-theme" mdw-surface="card">
|
|
162
|
+
<div class="mdw-dialog__header">
|
|
163
|
+
<div class="mdw-dialog__title">Dialog Title</div>
|
|
164
|
+
</div>
|
|
165
|
+
<label class="mdw-textfield mdw-theme" mdw-ink="secondary" style="padding:0 24px;">
|
|
166
|
+
<div class="mdw-textfield__signifier material-icons">security</div>
|
|
167
|
+
<input class="mdw-textfield__input" placeholder=" " name="input" mdw-autofocus/>
|
|
168
|
+
<div class="mdw-textfield__border">
|
|
169
|
+
<div class="mdw-textfield__outline-gap">
|
|
170
|
+
<div class="mdw-textfield__label">Text Field Label</div>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
<div class="mdw-textfield__error-text">This field is required</div>
|
|
174
|
+
</label>
|
|
175
|
+
<div class="mdw-dialog__button-area">
|
|
176
|
+
<button class="mdw-button mdw-theme" mdw-ink="secondary" tabindex="0" type="submit">Change</button>
|
|
177
|
+
<button class="mdw-button mdw-theme" mdw-ink="secondary" tabindex="0" type="button">Cancel</button>
|
|
178
|
+
</div>
|
|
179
|
+
</form>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
<%~ includeFile('../_partials/_androidnavbar.eta') %>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
<script src="dialog.min.js"></script>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as Button from '../../components/button/index';
|
|
2
|
-
import * as Dialog from '../../components/dialog/index';
|
|
3
|
-
import { iterateArrayLike } from '../../core/dom';
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import * as Button from '../../components/button/index.js';
|
|
2
|
+
import * as Dialog from '../../components/dialog/index.js';
|
|
3
|
+
import { iterateArrayLike } from '../../core/dom.js';
|
|
4
|
+
import { convertElementToCode } from '../_sample-utils.js';
|
|
6
5
|
|
|
7
6
|
/** @type {HTMLElement} */
|
|
8
7
|
let sampleComponent;
|
|
@@ -17,19 +16,19 @@ function onSampleButtonClick(event) {
|
|
|
17
16
|
|
|
18
17
|
/** @return {void} */
|
|
19
18
|
function updateSampleCode() {
|
|
20
|
-
const jsRequired = document.querySelector('input[name="javascript"][value="required"]').checked;
|
|
21
|
-
const jsOptional = document.querySelector('input[name="javascript"][value="optional"]').checked;
|
|
19
|
+
const jsRequired = /** @type {HTMLInputElement} */ (document.querySelector('input[name="javascript"][value="required"]')).checked;
|
|
20
|
+
const jsOptional = /** @type {HTMLInputElement} */ (document.querySelector('input[name="javascript"][value="optional"]')).checked;
|
|
22
21
|
const useJS = jsRequired || jsOptional;
|
|
23
22
|
|
|
24
23
|
// Strip JS related elements and attributes
|
|
25
24
|
Dialog.detach(sampleComponent);
|
|
26
|
-
|
|
25
|
+
const button = document.querySelector('.component-sample .mdw-button');
|
|
27
26
|
let closer = document.querySelector('.component-sample .mdw-dialog__close');
|
|
28
27
|
const dialogButtons = sampleComponent.querySelectorAll('.mdw-dialog__button-area .mdw-button');
|
|
29
28
|
Button.detach(button);
|
|
30
29
|
button.removeEventListener('click', onSampleButtonClick);
|
|
31
30
|
const tabIndexElements = sampleComponent.querySelectorAll('[tabindex]');
|
|
32
|
-
iterateArrayLike(tabIndexElements, el => el.removeAttribute('tabindex'));
|
|
31
|
+
iterateArrayLike(tabIndexElements, (el) => el.removeAttribute('tabindex'));
|
|
33
32
|
|
|
34
33
|
if (closer) {
|
|
35
34
|
if (jsRequired || (closer instanceof HTMLAnchorElement === false)) {
|
|
@@ -50,7 +49,7 @@ function updateSampleCode() {
|
|
|
50
49
|
dialogButtons[0].removeAttribute('href');
|
|
51
50
|
dialogButtons[1].removeAttribute('href');
|
|
52
51
|
} else {
|
|
53
|
-
sampleComponent.
|
|
52
|
+
sampleComponent.id = 'sample-dialog';
|
|
54
53
|
button.setAttribute('href', '#sample-dialog');
|
|
55
54
|
dialogButtons[0].setAttribute('href', '#');
|
|
56
55
|
dialogButtons[1].setAttribute('href', '#');
|
|
@@ -62,7 +61,6 @@ function updateSampleCode() {
|
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
|
|
65
|
-
|
|
66
64
|
const htmlCodeElement = document.getElementsByClassName('component-html')[0];
|
|
67
65
|
const sampleContainer = document.querySelector('.component-sample__container');
|
|
68
66
|
const htmlCodeBlocks = [];
|
|
@@ -96,7 +94,7 @@ function updateSampleCode() {
|
|
|
96
94
|
* @return {void}
|
|
97
95
|
*/
|
|
98
96
|
function onOptionChange(event) {
|
|
99
|
-
const { name, value, checked } = event.target;
|
|
97
|
+
const { name, value, checked } = /** @type {HTMLInputElement} */ (event.target);
|
|
100
98
|
const buttonArea = sampleComponent.getElementsByClassName('mdw-dialog__button-area')[0];
|
|
101
99
|
switch (name) {
|
|
102
100
|
case 'stacked-buttons':
|
|
@@ -130,7 +128,7 @@ function setupComponentOptions() {
|
|
|
130
128
|
}
|
|
131
129
|
|
|
132
130
|
/** @return {void} */
|
|
133
|
-
function
|
|
131
|
+
function setupJSSample1() {
|
|
134
132
|
const button = document.querySelector('.js .mdw-button');
|
|
135
133
|
Button.attach(button);
|
|
136
134
|
const confirmDialogElement = Dialog.create({
|
|
@@ -159,6 +157,21 @@ function initializeSampleComponents() {
|
|
|
159
157
|
});
|
|
160
158
|
}
|
|
161
159
|
|
|
160
|
+
/** @return {void} */
|
|
161
|
+
function setupJSSample2() {
|
|
162
|
+
const button = document.querySelectorAll('.js .mdw-button')[1];
|
|
163
|
+
Button.attach(button);
|
|
164
|
+
button.addEventListener('click', (event) => {
|
|
165
|
+
Dialog.show(document.getElementById('dialog-textfield'), event);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** @return {void} */
|
|
170
|
+
function initializeSampleComponents() {
|
|
171
|
+
setupJSSample1();
|
|
172
|
+
setupJSSample2();
|
|
173
|
+
}
|
|
174
|
+
|
|
162
175
|
initializeSampleComponents();
|
|
163
176
|
setupComponentOptions();
|
|
164
177
|
updateSampleCode();
|