@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
package/core/transition/index.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
// https://material.io/design/navigation/navigation-transitions.html
|
|
2
2
|
|
|
3
|
-
import { nextTick } from '../dom';
|
|
3
|
+
import { nextTick } from '../dom.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {Object} ShapeTranformDetails
|
|
7
|
+
* @prop {number} originWidth
|
|
8
|
+
* @prop {number} originHeight
|
|
9
|
+
* @prop {number} translateX
|
|
10
|
+
* @prop {number} translateY
|
|
11
|
+
* @prop {number} scaleX
|
|
12
|
+
* @prop {number} scaleY
|
|
13
|
+
* @prop {function():string} toString
|
|
14
|
+
*/
|
|
4
15
|
|
|
5
16
|
/**
|
|
6
17
|
* @param {string} px
|
|
@@ -58,7 +69,7 @@ function convertBoxShadow(stringValue, scaleX, scaleY) {
|
|
|
58
69
|
blurRadius,
|
|
59
70
|
spreadRadius,
|
|
60
71
|
color,
|
|
61
|
-
].filter(v => v).join(' ');
|
|
72
|
+
].filter((v) => v).join(' ');
|
|
62
73
|
}
|
|
63
74
|
|
|
64
75
|
if (!stringValue) {
|
|
@@ -66,11 +77,11 @@ function convertBoxShadow(stringValue, scaleX, scaleY) {
|
|
|
66
77
|
}
|
|
67
78
|
return stringValue
|
|
68
79
|
// Strip spaces from anything parenthesized
|
|
69
|
-
.replace(/\([^)]+\)/g, substring => substring.replace(/ /g, ''))
|
|
80
|
+
.replace(/\([^)]+\)/g, (substring) => substring.replace(/ /g, ''))
|
|
70
81
|
// Split shadows by commas no inside parentheses
|
|
71
82
|
.match(/[^,(]+\([^)]+\)?[^,]*(|$)/g)
|
|
72
83
|
// Trim empty spaces
|
|
73
|
-
.map(shadow => shadow.trim())
|
|
84
|
+
.map((shadow) => shadow.trim())
|
|
74
85
|
// Convert values
|
|
75
86
|
.map(convertShadow)
|
|
76
87
|
// Rejoin shadows
|
|
@@ -94,7 +105,7 @@ function convertBorderRadius(stringValue, width, height) {
|
|
|
94
105
|
if (value.indexOf('%') === -1) {
|
|
95
106
|
return numValue;
|
|
96
107
|
}
|
|
97
|
-
return (numValue * length / 100.0);
|
|
108
|
+
return ((numValue * length) / 100.0);
|
|
98
109
|
}
|
|
99
110
|
|
|
100
111
|
if (!stringValue) {
|
|
@@ -121,7 +132,7 @@ function convertBorderRadius(stringValue, width, height) {
|
|
|
121
132
|
* @param {HTMLElement} targetElement
|
|
122
133
|
* @param {HTMLElement} originElement
|
|
123
134
|
* @param {CSSStyleDeclaration} [originStyle]
|
|
124
|
-
* @return {
|
|
135
|
+
* @return {ShapeTranformDetails}
|
|
125
136
|
*/
|
|
126
137
|
export function getShapeTransform(targetElement, originElement, originStyle) {
|
|
127
138
|
const originRect = originElement.getBoundingClientRect();
|
|
@@ -166,11 +177,11 @@ export function getShapeTransform(targetElement, originElement, originStyle) {
|
|
|
166
177
|
* @param {string} property
|
|
167
178
|
* @param {function(TransitionEvent):void} callback
|
|
168
179
|
* @param {number} [expectedDuration]
|
|
169
|
-
* @return {
|
|
180
|
+
* @return {Function} removeListener
|
|
170
181
|
*/
|
|
171
182
|
function buildTransitionEndListener(element, property, callback, expectedDuration) {
|
|
172
183
|
let hasEnded = false;
|
|
173
|
-
const onTransitionEnd = (event) => {
|
|
184
|
+
const onTransitionEnd = (/** @type {TransitionEvent} */ event) => {
|
|
174
185
|
if (event.propertyName !== property) {
|
|
175
186
|
return;
|
|
176
187
|
}
|
|
@@ -200,8 +211,8 @@ function buildTransitionEndListener(element, property, callback, expectedDuratio
|
|
|
200
211
|
* @prop {HTMLElement} toContentElement
|
|
201
212
|
* @prop {number} [duration=250|300] (250ms collapse or 300ms expand)
|
|
202
213
|
* @prop {boolean} [revertFrom=false] Revert from elements on completion
|
|
203
|
-
* @prop {function(TransitionElementOptions)} [onTransitionEnd]
|
|
204
|
-
* @prop {function(TransitionElementOptions)} [onComplete]
|
|
214
|
+
* @prop {function(TransitionElementOptions):any} [onTransitionEnd]
|
|
215
|
+
* @prop {function(TransitionElementOptions):any} [onComplete]
|
|
205
216
|
*/
|
|
206
217
|
|
|
207
218
|
/**
|
|
@@ -212,7 +223,7 @@ export function transitionElement(options) {
|
|
|
212
223
|
const toStyleSyle = window.getComputedStyle(options.toShapeElement);
|
|
213
224
|
|
|
214
225
|
const shapeTransform = getShapeTransform(
|
|
215
|
-
options.fromShapeElement, options.toShapeElement, toStyleSyle
|
|
226
|
+
options.fromShapeElement, options.toShapeElement, toStyleSyle,
|
|
216
227
|
);
|
|
217
228
|
const contentTransform = getShapeTransform(options.toContentElement, options.fromContentElement);
|
|
218
229
|
|
|
@@ -229,10 +240,15 @@ export function transitionElement(options) {
|
|
|
229
240
|
'visibility',
|
|
230
241
|
];
|
|
231
242
|
|
|
243
|
+
/** @type {Object.<string,string>} */
|
|
232
244
|
const oldFromShapeProperties = {};
|
|
245
|
+
/** @type {Object.<string,string>} */
|
|
233
246
|
const oldToShapeProperties = {};
|
|
247
|
+
/** @type {Object.<string,string>} */
|
|
234
248
|
const oldFromContentProperties = {};
|
|
249
|
+
/** @type {Object.<string,string>} */
|
|
235
250
|
const oldToContentProperties = {};
|
|
251
|
+
/** @type {Object.<string,string>} */
|
|
236
252
|
const newFromShapeProperties = {};
|
|
237
253
|
transitionProperties.forEach((prop) => {
|
|
238
254
|
oldFromShapeProperties[prop] = options.fromShapeElement.style.getPropertyValue(prop);
|
|
@@ -243,28 +259,28 @@ export function transitionElement(options) {
|
|
|
243
259
|
newFromShapeProperties[prop] = convertBoxShadow(
|
|
244
260
|
toStyleSyle.getPropertyValue(prop),
|
|
245
261
|
shapeTransform.scaleX,
|
|
246
|
-
shapeTransform.scaleY
|
|
262
|
+
shapeTransform.scaleY,
|
|
247
263
|
);
|
|
248
264
|
} else if (prop === 'border-radius') {
|
|
249
265
|
const topLeft = convertBorderRadius(
|
|
250
266
|
toStyleSyle.getPropertyValue('border-top-left-radius'),
|
|
251
267
|
shapeTransform.originWidth,
|
|
252
|
-
shapeTransform.originHeight
|
|
268
|
+
shapeTransform.originHeight,
|
|
253
269
|
);
|
|
254
270
|
const topRight = convertBorderRadius(
|
|
255
271
|
toStyleSyle.getPropertyValue('border-top-right-radius'),
|
|
256
272
|
shapeTransform.originWidth,
|
|
257
|
-
shapeTransform.originHeight
|
|
273
|
+
shapeTransform.originHeight,
|
|
258
274
|
);
|
|
259
275
|
const bottomLeft = convertBorderRadius(
|
|
260
276
|
toStyleSyle.getPropertyValue('border-bottom-left-radius'),
|
|
261
277
|
shapeTransform.originWidth,
|
|
262
|
-
shapeTransform.originHeight
|
|
278
|
+
shapeTransform.originHeight,
|
|
263
279
|
);
|
|
264
280
|
const bottomRight = convertBorderRadius(
|
|
265
281
|
toStyleSyle.getPropertyValue('border-bottom-right-radius'),
|
|
266
282
|
shapeTransform.originWidth,
|
|
267
|
-
shapeTransform.originHeight
|
|
283
|
+
shapeTransform.originHeight,
|
|
268
284
|
);
|
|
269
285
|
const horizontalRadii = [
|
|
270
286
|
`${topLeft.horizontal / shapeTransform.scaleX}px`,
|
|
@@ -293,7 +309,7 @@ export function transitionElement(options) {
|
|
|
293
309
|
options.toContentElement.style.setProperty('opacity', '0');
|
|
294
310
|
options.toContentElement.style.setProperty('transition', 'none');
|
|
295
311
|
options.toContentElement.style.setProperty('transform-origin', '0 0 0');
|
|
296
|
-
options.toContentElement.style.setProperty('transform', contentTransform);
|
|
312
|
+
options.toContentElement.style.setProperty('transform', contentTransform.toString());
|
|
297
313
|
options.toContentElement.style.setProperty('z-index', '9');
|
|
298
314
|
options.toContentElement.style.setProperty('visibility', 'visible');
|
|
299
315
|
|
|
@@ -348,8 +364,8 @@ export function transitionElement(options) {
|
|
|
348
364
|
const fadeInTime = (calculatedDuration * 0.70).toString(10);
|
|
349
365
|
const fadeOutTime = (calculatedDuration * 0.30).toString(10);
|
|
350
366
|
const transformTransition = transitionProperties
|
|
351
|
-
.filter(prop => prop !== 'transform-origin' && prop !== 'opacity' && prop !== 'transition')
|
|
352
|
-
.map(prop => `${prop} ${totalDuration}ms cubic-bezier(0.4, 0.0, 0.2, 1) 0s`)
|
|
367
|
+
.filter((prop) => prop !== 'transform-origin' && prop !== 'opacity' && prop !== 'transition')
|
|
368
|
+
.map((prop) => `${prop} ${totalDuration}ms cubic-bezier(0.4, 0.0, 0.2, 1) 0s`)
|
|
353
369
|
.join(', ');
|
|
354
370
|
const fadeInTransition = `opacity ${fadeInTime}ms cubic-bezier(0.0, 0.0, 0.2, 1) ${fadeOutTime}ms`;
|
|
355
371
|
const fadeOutTransition = [
|
|
@@ -360,7 +376,7 @@ export function transitionElement(options) {
|
|
|
360
376
|
options.fromShapeElement.style.setProperty('transition', transformTransition);
|
|
361
377
|
transitionProperties.forEach((prop) => {
|
|
362
378
|
if (prop === 'transform') {
|
|
363
|
-
options.fromShapeElement.style.setProperty('transform', shapeTransform);
|
|
379
|
+
options.fromShapeElement.style.setProperty('transform', shapeTransform.toString());
|
|
364
380
|
} else if (prop === 'transition') {
|
|
365
381
|
// noop;
|
|
366
382
|
} else if (prop === 'transform-origin') {
|
|
File without changes
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { iterateArrayLike } from '../core/dom';
|
|
1
|
+
import { getStorageItem, removeStorageItem, setStorageItem } from './_storage.js';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* @param {boolean} value
|
|
6
|
-
* @param {Element
|
|
5
|
+
* @param {Element} [button]
|
|
7
6
|
* @return {void}
|
|
8
7
|
*/
|
|
9
8
|
export function setRTLMode(value, button) {
|
|
10
9
|
if (value) {
|
|
11
|
-
document.documentElement.
|
|
12
|
-
if (button) {
|
|
13
|
-
button.setAttribute('aria-pressed', 'true');
|
|
14
|
-
}
|
|
15
|
-
// element.setAttribute('mdw-active', '');
|
|
16
|
-
// Poor visibility even though spec says 70% opacity
|
|
10
|
+
document.documentElement.dir = 'rtl';
|
|
17
11
|
setStorageItem('rtlmode', 'true');
|
|
18
12
|
} else {
|
|
19
13
|
// Explicit LTR is required for Safari to support repeated toggling
|
|
20
|
-
document.documentElement.
|
|
21
|
-
if (button) {
|
|
22
|
-
button.setAttribute('aria-pressed', 'false');
|
|
23
|
-
}
|
|
24
|
-
// element.removeAttribute('mdw-active');
|
|
14
|
+
document.documentElement.dir = 'ltr';
|
|
25
15
|
removeStorageItem('rtlmode');
|
|
26
16
|
}
|
|
17
|
+
if (button) {
|
|
18
|
+
button.setAttribute('aria-pressed', value ? 'true' : 'false');
|
|
19
|
+
}
|
|
27
20
|
}
|
|
28
21
|
|
|
29
22
|
/** @return {boolean} */
|
|
@@ -37,17 +30,15 @@ export function isDarkMode() {
|
|
|
37
30
|
|
|
38
31
|
/**
|
|
39
32
|
* @param {boolean} value
|
|
40
|
-
* @param {Element
|
|
33
|
+
* @param {Element} [button]
|
|
41
34
|
* @return {void}
|
|
42
35
|
*/
|
|
43
36
|
export function setDarkMode(value, button) {
|
|
44
37
|
if (value) {
|
|
45
38
|
document.documentElement.setAttribute('mdw-dark', '');
|
|
46
|
-
document.documentElement.setAttribute('mdw-surface', 'black');
|
|
47
39
|
document.documentElement.removeAttribute('mdw-light');
|
|
48
40
|
} else {
|
|
49
41
|
document.documentElement.setAttribute('mdw-light', '');
|
|
50
|
-
document.documentElement.setAttribute('mdw-surface', 'white');
|
|
51
42
|
document.documentElement.removeAttribute('mdw-dark');
|
|
52
43
|
}
|
|
53
44
|
const stringValue = (value ? 'true' : 'false');
|
|
@@ -59,24 +50,26 @@ export function setDarkMode(value, button) {
|
|
|
59
50
|
|
|
60
51
|
/**
|
|
61
52
|
* @param {boolean} value
|
|
62
|
-
* @param {Element
|
|
53
|
+
* @param {Element} [button]
|
|
63
54
|
* @return {void}
|
|
64
55
|
*/
|
|
65
56
|
export function setAltTheme(value, button) {
|
|
66
|
-
|
|
57
|
+
const items = document.head.getElementsByTagName('link');
|
|
58
|
+
for (let i = 0; i < items.length; i += 1) {
|
|
59
|
+
const stylesheet = items.item(i);
|
|
67
60
|
if (stylesheet.href.indexOf(value ? 'theme-colored' : 'theme-default') !== -1) {
|
|
68
|
-
stylesheet.
|
|
61
|
+
stylesheet.disabled = false;
|
|
69
62
|
}
|
|
70
63
|
if (stylesheet.href.indexOf(value ? 'theme-default' : 'theme-colored') !== -1) {
|
|
71
|
-
stylesheet.
|
|
64
|
+
stylesheet.disabled = true;
|
|
72
65
|
}
|
|
73
|
-
}
|
|
66
|
+
}
|
|
74
67
|
|
|
75
68
|
const stringValue = (value ? 'true' : 'false');
|
|
76
69
|
if (button) {
|
|
77
70
|
button.setAttribute('aria-pressed', stringValue);
|
|
78
71
|
}
|
|
79
|
-
const statusBarAttribute = document.head.getElementsByTagName('meta')
|
|
72
|
+
const statusBarAttribute = document.head.getElementsByTagName('meta').namedItem('theme-color');
|
|
80
73
|
if (statusBarAttribute) {
|
|
81
74
|
statusBarAttribute.setAttribute('content', value ? '#FF5722' : '#E91E63');
|
|
82
75
|
}
|
|
@@ -86,26 +79,20 @@ export function setAltTheme(value, button) {
|
|
|
86
79
|
|
|
87
80
|
/**
|
|
88
81
|
* @param {string} value
|
|
89
|
-
* @param {Element
|
|
82
|
+
* @param {Element} [button]
|
|
90
83
|
* @return {void}
|
|
91
84
|
*/
|
|
92
85
|
export function setFontSize(value, button) {
|
|
93
86
|
if (value) {
|
|
94
87
|
document.documentElement.style.setProperty('font-size', value);
|
|
95
|
-
if (button) {
|
|
96
|
-
button.setAttribute('aria-pressed', 'true');
|
|
97
|
-
}
|
|
98
|
-
// element.setAttribute('mdw-active', '');
|
|
99
|
-
// Poor visibility even though spec says 70% opacity
|
|
100
88
|
setStorageItem('fontsize', value);
|
|
101
89
|
} else {
|
|
102
90
|
document.documentElement.style.removeProperty('font-size');
|
|
103
|
-
if (button) {
|
|
104
|
-
button.setAttribute('aria-pressed', 'false');
|
|
105
|
-
}
|
|
106
|
-
// element.removeAttribute('mdw-active');
|
|
107
91
|
removeStorageItem('fontsize');
|
|
108
92
|
}
|
|
93
|
+
if (button) {
|
|
94
|
+
button.setAttribute('aria-pressed', value ? 'true' : 'false');
|
|
95
|
+
}
|
|
109
96
|
}
|
|
110
97
|
|
|
111
98
|
/**
|
|
@@ -120,7 +107,7 @@ function setupRTLMode(element) {
|
|
|
120
107
|
return;
|
|
121
108
|
}
|
|
122
109
|
element.addEventListener('click', () => {
|
|
123
|
-
if (document.documentElement.
|
|
110
|
+
if (document.documentElement.dir === 'rtl') {
|
|
124
111
|
setRTLMode(false, element);
|
|
125
112
|
} else {
|
|
126
113
|
setRTLMode(true, element);
|
|
@@ -9,7 +9,9 @@ mixin androidstatusbar(surfaceColor, lightness)
|
|
|
9
9
|
i.material-icons(style="letter-spacing:2px;padding:0 2px") 
|
|
10
10
|
|
|
11
11
|
mixin appbar(surfaceColor, lightness, start, end)
|
|
12
|
-
.mdw-appbar.mdw-theme(
|
|
12
|
+
.mdw-appbar.mdw-elevation.mdw-theme(
|
|
13
|
+
style="z-index:4"
|
|
14
|
+
mdw-elevation="4"
|
|
13
15
|
mdw-surface=(surfaceColor ? surfaceColor : false)
|
|
14
16
|
mdw-light=(lightness=='light' ? '' : false)
|
|
15
17
|
mdw-dark=(lightness=='dark' ? '' : false))
|
|
@@ -33,19 +35,20 @@ mixin target(url)
|
|
|
33
35
|
mixin navListItem(key, icon, name, activatedKey, color="secondary contrast")
|
|
34
36
|
li.mdw-list__item
|
|
35
37
|
a.mdw-list__content.mdw-overlay.mdw-ripple.mdw-theme(
|
|
36
|
-
aria-current=(activatedKey==key ? 'page' : false)
|
|
37
38
|
aria-selected=(activatedKey==key ? 'true' : 'false')
|
|
39
|
+
aria-current=(activatedKey==key ? 'page' : false)
|
|
38
40
|
href=(key + ".html")
|
|
39
41
|
mdw-ink=color
|
|
40
42
|
)
|
|
41
|
-
|
|
43
|
+
if (icon)
|
|
44
|
+
.mdw-list__icon.mdw-theme.material-icons(mdw-ink="medium")=icon
|
|
42
45
|
.mdw-list__text
|
|
43
46
|
.mdw-list__text-block=name
|
|
44
47
|
|
|
45
48
|
|
|
46
49
|
mixin header(activated)
|
|
47
50
|
doctype html
|
|
48
|
-
html.mdw-layout.mdw-theme(lang='en')
|
|
51
|
+
html.mdw-layout.mdw-theme(lang='en' mdw-surface="binary" mdw-light)
|
|
49
52
|
head
|
|
50
53
|
title Material Design Web
|
|
51
54
|
meta(charset='utf-8')
|
|
@@ -60,36 +63,38 @@ mixin header(activated)
|
|
|
60
63
|
link(rel='stylesheet' href='//fonts.googleapis.com/css?family=Merriweather:300,400,500')
|
|
61
64
|
link(rel='stylesheet' href='docs.min.css')
|
|
62
65
|
link(rel='stylesheet' href='spec.min.css')
|
|
63
|
-
link(rel='stylesheet' href='theme-default.min.css')
|
|
64
|
-
link(rel='stylesheet' href='theme-default-fallbacks.min.css' media="
|
|
65
|
-
link(rel='stylesheet' disabled href='theme-colored.min.css' title="
|
|
66
|
-
link(rel='stylesheet' disabled href='theme-colored-fallbacks.min.css' media="
|
|
67
|
-
|
|
68
|
-
script(src='prerender.common.min.js')
|
|
66
|
+
link(rel='stylesheet' href='theme-default.min.css' title="Default Theme")
|
|
67
|
+
link(rel='stylesheet' href='theme-default-fallbacks.min.css' media="all\\0" title="Default Theme")
|
|
68
|
+
link(rel='stylesheet' disabled href='theme-colored.min.css' title="Colored Theme")
|
|
69
|
+
link(rel='stylesheet' disabled href='theme-colored-fallbacks.min.css' media="all\\0" title="Colored Theme")
|
|
69
70
|
script(src='prerender.min.js')
|
|
70
71
|
body.mdw-layout__body.mdw-theme(mdw-surface="background" mdw-sidesheet-toggle="dismissible" mdw-sidesheet-style="modal")
|
|
71
72
|
.mdw-layout__menus
|
|
72
73
|
.mdw-layout__dialogs
|
|
73
|
-
nav.mdw-layout__navdrawer
|
|
74
|
+
nav#docs-navdrawer.mdw-layout__navdrawer
|
|
74
75
|
.mdw-layout__sheet-content.mdw-theme(mdw-surface="background" mdw-border-ink)
|
|
75
|
-
ul.mdw-list(
|
|
76
|
+
ul.mdw-list(style="padding-bottom:64px")
|
|
76
77
|
li.mdw-list__item
|
|
77
|
-
a.mdw-list__content.mdw-overlay.mdw-ripple.mdw-theme(
|
|
78
|
+
a.mdw-list__content.mdw-overlay.mdw-ripple.mdw-theme(
|
|
79
|
+
aria-current=activated=='Home'
|
|
80
|
+
aria-selected=(activatedKey=='Home' ? 'true' : 'false')
|
|
81
|
+
href='index.html'
|
|
82
|
+
mdw-ink="default")
|
|
78
83
|
.mdw-list__text Home
|
|
79
|
-
li.mdw-
|
|
80
|
-
|
|
84
|
+
li.mdw-list__item(aria-expanded="true")
|
|
85
|
+
.mdw-list__content.mdw-list__subheader
|
|
81
86
|
.mdw-list__text.mdw-theme(mdw-ink="medium") Core
|
|
82
87
|
.mdw-list__secondary.mdw-theme.material-icons(mdw-ink="medium") expand_more
|
|
83
|
-
ul.mdw-
|
|
88
|
+
ul.mdw-list
|
|
84
89
|
+navListItem('color', 'compare', 'Color', activated, 'primary contrast')
|
|
85
90
|
+navListItem('overlay', 'tonality', 'Overlay', activated, 'primary contrast')
|
|
86
91
|
+navListItem('ripple', 'center_focus_strong', 'Ripple', activated, 'primary contrast')
|
|
87
92
|
+navListItem('transition', 'open_in_new', 'Transition', activated, 'primary contrast')
|
|
88
|
-
li.mdw-
|
|
89
|
-
|
|
93
|
+
li.mdw-list__item.mdw-theme(aria-expanded="true")
|
|
94
|
+
.mdw-list__content.mdw-list__subheader
|
|
90
95
|
.mdw-list__text.mdw-theme(mdw-ink="medium") Components
|
|
91
96
|
.mdw-list__secondary.mdw-theme.material-icons(mdw-ink="medium") expand_more
|
|
92
|
-
ul.mdw-
|
|
97
|
+
ul.mdw-list
|
|
93
98
|
+navListItem('appbar', 'web_asset', 'App Bar', activated)
|
|
94
99
|
+navListItem('bottomnav', 'call_to_action', 'Bottom Navigation', activated)
|
|
95
100
|
+navListItem('button', 'crop_landscape', 'Button', activated)
|
|
@@ -104,7 +109,6 @@ mixin header(activated)
|
|
|
104
109
|
+navListItem('list', 'view_list', 'List', activated)
|
|
105
110
|
+navListItem('menu', 'picture_in_picture', 'Menu', activated)
|
|
106
111
|
+navListItem('progress', 'timelapse', 'Progress', activated)
|
|
107
|
-
+navListItem('search', 'search', 'Search', activated)
|
|
108
112
|
+navListItem('selection', 'toggle_on', 'Selection', activated)
|
|
109
113
|
+navListItem('slider', 'tune', 'Slider', activated)
|
|
110
114
|
+navListItem('snackbar', 'video_label', 'Snackbar', activated)
|
|
@@ -112,7 +116,14 @@ mixin header(activated)
|
|
|
112
116
|
+navListItem('textfield', 'text_fields', 'Text Field', activated)
|
|
113
117
|
+navListItem('tooltip', 'info', 'Tooltip', activated)
|
|
114
118
|
+navListItem('type', 'font_download', 'Typography', activated)
|
|
115
|
-
|
|
119
|
+
li.mdw-list__item(aria-expanded="true")
|
|
120
|
+
.mdw-list__content.mdw-list__subheader
|
|
121
|
+
.mdw-list__text.mdw-theme(mdw-ink="medium") Adapters
|
|
122
|
+
.mdw-list__secondary.mdw-theme.material-icons(mdw-ink="medium") expand_more
|
|
123
|
+
ul.mdw-list
|
|
124
|
+
+navListItem('dom', 'calendar_view_day', 'DOM', activated)
|
|
125
|
+
+navListItem('search', 'search', 'Search', activated)
|
|
126
|
+
a.mdw-layout__scrim(href='#' tabindex="-1")
|
|
116
127
|
.mdw-layout__appbar.mdw-appbar.mdw-theme(mdw-autohide="mobile tablet" mdw-surface="secondary 500" mdw-dark)
|
|
117
128
|
.mdw-layout__appbar-shape
|
|
118
129
|
.mdw-appbar__action
|
|
@@ -123,20 +134,22 @@ mixin header(activated)
|
|
|
123
134
|
.mdw-appbar__title=activated
|
|
124
135
|
#docs-menu-buttons.mdw-appbar__end
|
|
125
136
|
.mdw-tooltip__wrapper
|
|
126
|
-
+mdwButton({ icon: true })#altThemeButton.mdw-tooltip__target.material-icons(mdw-overlay-default="medium" mdw-overlay-
|
|
137
|
+
+mdwButton({ icon: true })#altThemeButton.mdw-tooltip__target.material-icons(mdw-overlay-default="medium" mdw-overlay-off="activated" aria-pressed="false") palette
|
|
127
138
|
.mdw-tooltip.mdw-theme(mdw-surface="background 700" mdw-dark mdw-align="end") Alt Theme
|
|
128
139
|
.mdw-tooltip__wrapper
|
|
129
|
-
+mdwButton({ icon: true })#darkModeButton.mdw-tooltip__target.material-icons(mdw-overlay-default="medium" mdw-overlay-
|
|
140
|
+
+mdwButton({ icon: true })#darkModeButton.mdw-tooltip__target.material-icons(mdw-overlay-default="medium" mdw-overlay-off="activated" aria-pressed="false") brightness_3
|
|
130
141
|
.mdw-tooltip.mdw-theme(mdw-surface="background 700" mdw-dark mdw-align="end") Dark Mode
|
|
131
142
|
.mdw-tooltip__wrapper
|
|
132
|
-
+mdwButton({ icon: true })#rtlButton.mdw-tooltip__target.material-icons(mdw-overlay-default="medium" mdw-overlay-
|
|
143
|
+
+mdwButton({ icon: true })#rtlButton.mdw-tooltip__target.material-icons(mdw-overlay-default="medium" mdw-overlay-off="activated" aria-pressed="false") format_align_right
|
|
133
144
|
.mdw-tooltip.mdw-theme(mdw-surface="background 700" mdw-dark mdw-align="end") Right-to-Left
|
|
134
145
|
.mdw-tooltip__wrapper
|
|
135
|
-
+mdwButton({ icon: true })#largeFontButton.mdw-tooltip__target.material-icons(mdw-overlay-default="medium" mdw-overlay-
|
|
146
|
+
+mdwButton({ icon: true })#largeFontButton.mdw-tooltip__target.material-icons(mdw-overlay-default="medium" mdw-overlay-off="activated" aria-pressed="false") format_size
|
|
136
147
|
.mdw-tooltip.mdw-theme(mdw-surface="background 700" mdw-dark mdw-align="end") 200% Text
|
|
137
148
|
.mdw-layout__fab
|
|
138
149
|
.mdw-layout__snackbar
|
|
139
150
|
.mdw-layout__content
|
|
140
151
|
.mdw-layout__content-page
|
|
141
152
|
block
|
|
142
|
-
script(src='
|
|
153
|
+
script(src='postrender.min.js')
|
|
154
|
+
script(src='entire-framework.min.js')
|
|
155
|
+
script(src='docs.common.min.js')
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<div <%~ Object.entries({
|
|
2
|
+
'class': 'androidstatusbar mdw-theme',
|
|
3
|
+
'mdw-surface': it?.surface,
|
|
4
|
+
'mdw-light': it?.light,
|
|
5
|
+
'mdw-dark': it?.dark
|
|
6
|
+
}).map(([key, value]) => {
|
|
7
|
+
if (value === true) return key;
|
|
8
|
+
if (value === false || value == null) return false;
|
|
9
|
+
return `${key}="${value}"`
|
|
10
|
+
}).filter(v=>v).join(' ')-%>>
|
|
11
|
+
<div>12:30</div>
|
|
12
|
+
<i class="material-icons" style="letter-spacing:2px;padding:0 2px;"></i>
|
|
13
|
+
</div>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<% var T = '../../templates/index.eta'; %>
|
|
2
|
+
<div <%~ Object.entries({
|
|
3
|
+
'class': 'mdw-appbar mdw-elevation mdw-theme',
|
|
4
|
+
'style': 'z-index:4',
|
|
5
|
+
'mdw-elevation': 4,
|
|
6
|
+
'mdw-surface': it?.surface,
|
|
7
|
+
'mdw-light': it?.light,
|
|
8
|
+
'mdw-dark': it?.dark
|
|
9
|
+
}).map(([key, value]) => {
|
|
10
|
+
if (value === true) return key;
|
|
11
|
+
if (value === false || value == null) return false;
|
|
12
|
+
return `${key}="${value}"`
|
|
13
|
+
}).filter(v=>v).join(' ')-%>>
|
|
14
|
+
<div class="mdw-appbar__action">
|
|
15
|
+
<div class="mdw-appbar__start">
|
|
16
|
+
<%_~ it?.start?.map((icon) => includeFile(T, { button: {
|
|
17
|
+
class:'material-icons', icon:true, text:icon }})).join(' ') ?? '' _%>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="mdw-appbar__title">
|
|
20
|
+
<%_~ it?.body ?? '' %><%= it?.text ?? '' _%>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="mdw-appbar__end">
|
|
23
|
+
<%_~ it?.end?.map((icon) => includeFile(T, { button:{
|
|
24
|
+
class:'material-icons', icon:true, text:icon,
|
|
25
|
+
attributes: { 'mdw-more-button': icon === 'more_vert' }
|
|
26
|
+
}})).join(' ') ?? '' _%>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<% var T = '../../templates/index.eta'; %>
|
|
2
|
+
<div class="display-flex flex-wrap">
|
|
3
|
+
<%~ includeFile(T, {button: { text: 'Text' }}) %>
|
|
4
|
+
<%~ includeFile(T, {button: { raised:true, text: 'Contained' }}) %>
|
|
5
|
+
<%~ includeFile(T, {button: { raised:true, disabled:true, text: 'Disabled' }}) %>
|
|
6
|
+
<%~ includeFile(T, {button: { borderInk:'default', text: 'Outlined' }}) %>
|
|
7
|
+
</div>
|
|
8
|
+
<div style="height:24px;"></div>
|
|
9
|
+
<div class="display-flex flex-wrap">
|
|
10
|
+
<%~ includeFile(T, {button: { ink:'primary', text:'Text' }}) %>
|
|
11
|
+
<%~ includeFile(T, {button: { ink:'primary', raised:true, text: 'Contained' }}) %>
|
|
12
|
+
<%~ includeFile(T, {button: { ink:'primary', raised:true, disabled:true, text:'Disabled' }}) %>
|
|
13
|
+
<%~ includeFile(T, {button: { ink:'secondary', text:'Secondary' }}) %>
|
|
14
|
+
<%~ includeFile(T, {button: { ink:'secondary', borderInk:true, text:'Outlined' }}) %>
|
|
15
|
+
</div>
|
|
16
|
+
<div style="height:24px;"></div>
|
|
17
|
+
<div class="display-flex flex-wrap">
|
|
18
|
+
<%~ includeFile(T, { button: { surface:'primary 500', dark:true, text:'Text' }}) %>
|
|
19
|
+
<%~ includeFile(T, { button: { surface:'primary 500', dark:true, raised:true, text:'Contained' }}) %>
|
|
20
|
+
<%~ includeFile(T, { button: { surface:'primary 500', dark:true, raised:true, disabled:true, text:'Disabled' }}) %>
|
|
21
|
+
<%~ includeFile(T, { button: { surface:'secondary 100', light:true, raised:true, text:'Outlined' }}) %>
|
|
22
|
+
</div>
|
|
23
|
+
<div style="height:24px;"></div>
|
|
24
|
+
<div class="display-flex flex-wrap">
|
|
25
|
+
<%~ includeFile(T, { button: { class:'material-icons', text:'favorite', icon:true }}) %>
|
|
26
|
+
<%~ includeFile(T, { button: { class:'material-icons', text:'favorite', ink:"warn", dark:true, icon:true }}) %>
|
|
27
|
+
<%~ includeFile(T, { button: { class:'material-icons', text:'favorite', surface:"warn 500", dark:true, icon:true }}) %>
|
|
28
|
+
<%~ includeFile(T, { button: { class:'material-icons', text:'favorite', surface:"warn 500", dark:true, icon:true, raised:true }}) %>
|
|
29
|
+
<%~ includeFile(T, { button: { class:'material-icons', text:'favorite', surface:"warn 500", dark:true, icon:true, raised:true, disabled:true }}) %>
|
|
30
|
+
<%~ includeFile(T, { button: { class:'material-icons', text:'favorite', icon:true, disabled:true }}) %>
|
|
31
|
+
</div>
|