@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,2 +1,2 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
1
|
+
@forward './_spec.scss';
|
|
2
|
+
@forward './_theme.scss';
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '../../core/_length.scss' as *;
|
|
2
2
|
|
|
3
3
|
.mdw-divider {
|
|
4
|
-
|
|
5
|
-
min-height: dp(1);
|
|
6
|
-
height: dp(1);
|
|
7
4
|
width: 100%;
|
|
8
5
|
margin-top: dp(-1);
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
border-bottom: dp(1) solid;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.mdw-divider__vertical {
|
|
10
|
+
height: 100%;
|
|
11
|
+
margin-right: dp(-1);
|
|
12
|
+
border-left: dp(1) solid;
|
|
11
13
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
1
|
+
@forward './_spec.scss';
|
|
2
|
+
@forward './_theme.scss';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '../../core/_elevation.scss' as elevation;
|
|
2
2
|
|
|
3
3
|
.mdw-elevation {
|
|
4
4
|
@each $value in (1, 2, 3, 4, 6, 8, 9, 12, 16, 24) {
|
|
5
5
|
&[mdw-elevation="#{$value}"] {
|
|
6
|
-
box-shadow:
|
|
6
|
+
box-shadow: elevation.boxShadow($value);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
1
|
+
@forward './_spec.scss';
|
|
2
|
+
@forward './_theme.scss';
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
// https://material.io/guidelines/components/buttons-floating-action-button.html
|
|
2
2
|
|
|
3
|
-
@
|
|
4
|
-
@
|
|
5
|
-
@
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
$
|
|
9
|
-
$
|
|
10
|
-
$
|
|
11
|
-
$
|
|
12
|
-
$
|
|
13
|
-
$mdw-fab__icon-size: dp(24) !default;
|
|
3
|
+
@use '../../core/_elevation.scss' as elevation;
|
|
4
|
+
@use '../../core/_length.scss' as *;
|
|
5
|
+
@use '../../core/_motion.scss' as motion;
|
|
6
|
+
|
|
7
|
+
$delay: 40ms !default;
|
|
8
|
+
$padding: dp(16) !default;
|
|
9
|
+
$size: dp(56) !default;
|
|
10
|
+
$miniSize: dp(40) !default;
|
|
11
|
+
$miniPadding: dp(8) !default;
|
|
12
|
+
$iconSize: dp(24) !default;
|
|
14
13
|
|
|
15
14
|
.mdw-fab {
|
|
16
15
|
display: flex;
|
|
@@ -55,10 +54,10 @@ $mdw-fab__icon-size: dp(24) !default;
|
|
|
55
54
|
pointer-events: auto;
|
|
56
55
|
|
|
57
56
|
border-radius: dp(32);
|
|
58
|
-
box-shadow:
|
|
57
|
+
box-shadow: elevation.boxShadow(6);
|
|
59
58
|
|
|
60
59
|
&:active {
|
|
61
|
-
box-shadow:
|
|
60
|
+
box-shadow: elevation.boxShadow(12);
|
|
62
61
|
}
|
|
63
62
|
|
|
64
63
|
&[mdw-extended] {
|
|
@@ -91,9 +90,9 @@ $mdw-fab__icon-size: dp(24) !default;
|
|
|
91
90
|
& > .mdw-fab__button.mdw-button {
|
|
92
91
|
margin: 0 0 dp(16) 0;
|
|
93
92
|
|
|
94
|
-
transition-duration:
|
|
93
|
+
transition-duration: motion.$collapseDuration;
|
|
95
94
|
transition-property: transform, opacity;
|
|
96
|
-
transition-timing-function:
|
|
95
|
+
transition-timing-function: motion.$accelerateEasing;
|
|
97
96
|
|
|
98
97
|
opacity: 0;
|
|
99
98
|
transform: scale(0);
|
|
@@ -111,7 +110,7 @@ $mdw-fab__icon-size: dp(24) !default;
|
|
|
111
110
|
}
|
|
112
111
|
@for $i from 1 through 7 {
|
|
113
112
|
&:nth-last-child(#{$i}) {
|
|
114
|
-
transition-delay: #{($i - 1) * $
|
|
113
|
+
transition-delay: #{($i - 1) * $delay};
|
|
115
114
|
}
|
|
116
115
|
}
|
|
117
116
|
}
|
|
@@ -120,8 +119,8 @@ $mdw-fab__icon-size: dp(24) !default;
|
|
|
120
119
|
.mdw-fab__icon {
|
|
121
120
|
position: relative;
|
|
122
121
|
|
|
123
|
-
height: $
|
|
124
|
-
width: $
|
|
122
|
+
height: $iconSize;
|
|
123
|
+
width: $iconSize;
|
|
125
124
|
|
|
126
125
|
transition-duration: 200ms;
|
|
127
126
|
transition-property: margin;
|
|
@@ -141,7 +140,7 @@ $mdw-fab__icon-size: dp(24) !default;
|
|
|
141
140
|
}
|
|
142
141
|
|
|
143
142
|
.mdw-fab__button[mdw-extended]:not([mdw-extended="hover"]),
|
|
144
|
-
.mdw-fab__button[mdw-extended="hover"]:hover
|
|
143
|
+
.mdw-fab__button[mdw-extended="hover"]:hover {
|
|
145
144
|
padding: dp(12) dp(16);
|
|
146
145
|
|
|
147
146
|
.mdw-fab__text {
|
|
@@ -202,20 +201,20 @@ $mdw-fab__icon-size: dp(24) !default;
|
|
|
202
201
|
pointer-events: auto;
|
|
203
202
|
|
|
204
203
|
> .mdw-fab__button.mdw-button {
|
|
205
|
-
transition-duration:
|
|
206
|
-
transition-timing-function:
|
|
204
|
+
transition-duration: motion.$expandDuration;
|
|
205
|
+
transition-timing-function: motion.$decelerateEasing;
|
|
207
206
|
|
|
208
207
|
opacity: 1;
|
|
209
208
|
transform: scale(1);
|
|
210
209
|
|
|
211
|
-
box-shadow:
|
|
210
|
+
box-shadow: elevation.boxShadow(6);
|
|
212
211
|
|
|
213
212
|
&:active {
|
|
214
|
-
box-shadow:
|
|
213
|
+
box-shadow: elevation.boxShadow(12);
|
|
215
214
|
}
|
|
216
215
|
@for $i from 1 through 6 {
|
|
217
216
|
&:nth-child(#{$i}) {
|
|
218
|
-
transition-delay: #{($i - 1) * $
|
|
217
|
+
transition-delay: #{($i - 1) * $delay};
|
|
219
218
|
}
|
|
220
219
|
}
|
|
221
220
|
}
|
package/components/fab/index.js
CHANGED
|
@@ -1,32 +1,37 @@
|
|
|
1
|
-
import { findElementParentByClassName } from '../../core/dom';
|
|
1
|
+
import { findElementParentByClassName } from '../../core/dom.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @param {Element} fabElement
|
|
5
|
-
* @return {
|
|
5
|
+
* @return {boolean} handled
|
|
6
6
|
*/
|
|
7
|
-
export function
|
|
8
|
-
let
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
fabElement.appendChild(closer);
|
|
7
|
+
export function show(fabElement) {
|
|
8
|
+
let changed = false;
|
|
9
|
+
if (fabElement.hasAttribute('mdw-hide')) {
|
|
10
|
+
fabElement.removeAttribute('mdw-hide');
|
|
11
|
+
changed = true;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
if (!fabElement.hasAttribute('mdw-show')) {
|
|
14
|
+
fabElement.setAttribute('mdw-show', '');
|
|
15
|
+
changed = true;
|
|
16
|
+
}
|
|
17
|
+
return changed;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* @param {Element} fabElement
|
|
21
|
-
* @return {
|
|
22
|
+
* @return {boolean} handled
|
|
22
23
|
*/
|
|
23
|
-
export function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
export function hide(fabElement) {
|
|
25
|
+
if (!fabElement.hasAttribute('mdw-hide')) {
|
|
26
|
+
fabElement.setAttribute('mdw-hide', '');
|
|
27
|
+
} else {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
if (fabElement.hasAttribute('mdw-show')) {
|
|
31
|
+
fabElement.removeAttribute('mdw-show');
|
|
32
|
+
return true;
|
|
29
33
|
}
|
|
34
|
+
return false;
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
/**
|
|
@@ -43,6 +48,17 @@ export function onCloserClicked(event) {
|
|
|
43
48
|
hide(fabElement);
|
|
44
49
|
}
|
|
45
50
|
|
|
51
|
+
/**
|
|
52
|
+
* @param {Element} fabElement
|
|
53
|
+
* @return {void}
|
|
54
|
+
*/
|
|
55
|
+
export function toggle(fabElement) {
|
|
56
|
+
if (hide(fabElement)) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
show(fabElement);
|
|
60
|
+
}
|
|
61
|
+
|
|
46
62
|
/**
|
|
47
63
|
* @param {MouseEvent} event
|
|
48
64
|
* @return {void}
|
|
@@ -59,45 +75,29 @@ export function onFabButtonClicked(event) {
|
|
|
59
75
|
|
|
60
76
|
/**
|
|
61
77
|
* @param {Element} fabElement
|
|
62
|
-
* @return {
|
|
63
|
-
*/
|
|
64
|
-
export function show(fabElement) {
|
|
65
|
-
let changed = false;
|
|
66
|
-
if (fabElement.hasAttribute('mdw-hide')) {
|
|
67
|
-
fabElement.removeAttribute('mdw-hide');
|
|
68
|
-
changed = true;
|
|
69
|
-
}
|
|
70
|
-
if (!fabElement.hasAttribute('mdw-show')) {
|
|
71
|
-
fabElement.setAttribute('mdw-show', '');
|
|
72
|
-
changed = true;
|
|
73
|
-
}
|
|
74
|
-
return changed;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* @param {Element} fabElement
|
|
79
|
-
* @return {boolean} handled
|
|
78
|
+
* @return {void}
|
|
80
79
|
*/
|
|
81
|
-
export function
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
if (fabElement.hasAttribute('mdw-show')) {
|
|
88
|
-
fabElement.removeAttribute('mdw-show');
|
|
89
|
-
return true;
|
|
80
|
+
export function attach(fabElement) {
|
|
81
|
+
let closer = fabElement.getElementsByClassName('mdw-fab__close')[0];
|
|
82
|
+
if (!closer) {
|
|
83
|
+
closer = document.createElement('div');
|
|
84
|
+
closer.classList.add('mdw-fab__close');
|
|
85
|
+
fabElement.appendChild(closer);
|
|
90
86
|
}
|
|
91
|
-
|
|
87
|
+
closer.addEventListener('click', onCloserClicked);
|
|
88
|
+
const fabButton = fabElement.getElementsByClassName('mdw-fab__button')[0];
|
|
89
|
+
fabButton.addEventListener('click', onFabButtonClicked);
|
|
92
90
|
}
|
|
93
91
|
|
|
94
92
|
/**
|
|
95
93
|
* @param {Element} fabElement
|
|
96
94
|
* @return {void}
|
|
97
95
|
*/
|
|
98
|
-
export function
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
export function detach(fabElement) {
|
|
97
|
+
const fabButton = fabElement.getElementsByClassName('mdw-fab__button')[0];
|
|
98
|
+
fabButton.removeEventListener('click', onFabButtonClicked);
|
|
99
|
+
const closer = fabElement.getElementsByClassName('mdw-fab__close')[0];
|
|
100
|
+
if (closer) {
|
|
101
|
+
closer.removeEventListener('click', onCloserClicked);
|
|
101
102
|
}
|
|
102
|
-
show(fabElement);
|
|
103
103
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
1
|
+
@forward './_spec.scss';
|
|
2
|
+
@forward './_theme.scss';
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
// https://material.io/guidelines/layout/responsive-ui.html
|
|
2
2
|
// https://material.io/archive/guidelines/layout/responsive-ui.html
|
|
3
3
|
|
|
4
|
-
@
|
|
5
|
-
@import '../../core/_platform.scss';
|
|
6
|
-
@import '../../core/_breakpoint.scss';
|
|
4
|
+
@use "sass:math";
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
@use '../../core/_breakpoint.scss' as breakpoint;
|
|
7
|
+
@use '../../core/_length.scss' as *;
|
|
8
|
+
@use '../../core/_motion.scss' as motion;
|
|
9
|
+
|
|
10
|
+
$margin: dp(24) !default;
|
|
11
|
+
$gutter: dp(24) !default;
|
|
10
12
|
|
|
11
13
|
.mdw-grid {
|
|
12
14
|
display: flex;
|
|
@@ -15,12 +17,12 @@ $mdw-grid__gutter: dp(24) !default;
|
|
|
15
17
|
grid-auto-rows: auto;
|
|
16
18
|
grid-template-columns: repeat(12, 1fr);
|
|
17
19
|
|
|
18
|
-
margin-top: -$
|
|
20
|
+
margin-top: -$gutter;
|
|
19
21
|
|
|
20
|
-
margin-left: -$
|
|
21
|
-
padding-right: $
|
|
22
|
+
margin-left: -$gutter;
|
|
23
|
+
padding-right: $margin;
|
|
22
24
|
|
|
23
|
-
padding-left: $
|
|
25
|
+
padding-left: $margin;
|
|
24
26
|
-ms-grid-columns: unquote("(1fr)[12]");
|
|
25
27
|
-ms-grid-rows: auto;
|
|
26
28
|
|
|
@@ -39,19 +41,19 @@ $mdw-grid__gutter: dp(24) !default;
|
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
&[mdw-margin-top] {
|
|
42
|
-
padding-top: $
|
|
44
|
+
padding-top: $margin;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
&[mdw-margin-bottom] {
|
|
46
|
-
padding-bottom: $
|
|
48
|
+
padding-bottom: $margin;
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
@mixin
|
|
53
|
+
@mixin item($columnCount) {
|
|
52
54
|
&[mdw-colspan="1"],
|
|
53
55
|
&:not([mdw-colspan]) {
|
|
54
|
-
width:
|
|
56
|
+
width: #{math.div(100%, $columnCount)};
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
&[mdw-stretch] {
|
|
@@ -65,13 +67,13 @@ $mdw-grid__gutter: dp(24) !default;
|
|
|
65
67
|
|
|
66
68
|
width: 100%;
|
|
67
69
|
} @else {
|
|
68
|
-
width:
|
|
70
|
+
width: #{math.div($i * 100%, $columnCount)};
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
74
|
@each $percent in (25, 50, 75, 100) {
|
|
73
75
|
&[mdw-colspan="#{$percent}%"] {
|
|
74
|
-
$value: $percent
|
|
76
|
+
$value: $percent * 0.01 * $columnCount;
|
|
75
77
|
-ms-grid-column-span: #{$value};
|
|
76
78
|
grid-column-end: span #{$value};
|
|
77
79
|
@if ($value < 1) {
|
|
@@ -84,17 +86,17 @@ $mdw-grid__gutter: dp(24) !default;
|
|
|
84
86
|
|
|
85
87
|
.mdw-grid__item {
|
|
86
88
|
|
|
87
|
-
@include
|
|
89
|
+
@include item(12);
|
|
88
90
|
box-sizing: border-box;
|
|
89
91
|
max-width: 100%;
|
|
90
92
|
flex-grow: 0;
|
|
91
93
|
flex-shrink: 1;
|
|
92
|
-
padding-top: $
|
|
93
|
-
padding-left: $
|
|
94
|
+
padding-top: $gutter;
|
|
95
|
+
padding-left: $gutter;
|
|
94
96
|
|
|
95
|
-
transition-duration:
|
|
97
|
+
transition-duration: motion.$shapeChangeDuration;
|
|
96
98
|
transition-property: flex, width, padding;
|
|
97
|
-
transition-timing-function:
|
|
99
|
+
transition-timing-function: motion.$standardEasing;
|
|
98
100
|
|
|
99
101
|
.mdw-grid[mdw-grid] > & {
|
|
100
102
|
min-width: 100%;
|
|
@@ -133,7 +135,7 @@ $mdw-grid__gutter: dp(24) !default;
|
|
|
133
135
|
}
|
|
134
136
|
}
|
|
135
137
|
|
|
136
|
-
@include
|
|
138
|
+
@include breakpoint.has16DPMargin() {
|
|
137
139
|
.mdw-grid {
|
|
138
140
|
margin-top: dp(-16);
|
|
139
141
|
margin-left: dp(-16);
|
|
@@ -170,17 +172,17 @@ $mdw-grid__gutter: dp(24) !default;
|
|
|
170
172
|
-ms-grid-columns: unquote("(1fr)[8]");
|
|
171
173
|
|
|
172
174
|
& > .mdw-grid__item {
|
|
173
|
-
@include
|
|
175
|
+
@include item(8);
|
|
174
176
|
}
|
|
175
177
|
}
|
|
176
|
-
@include
|
|
178
|
+
@include breakpoint.max8Columns() {
|
|
177
179
|
.mdw-grid {
|
|
178
180
|
grid-template-columns: repeat(8, 1fr);
|
|
179
181
|
-ms-grid-columns: unquote("(1fr)[8]");
|
|
180
182
|
}
|
|
181
183
|
|
|
182
184
|
.mdw-grid__item {
|
|
183
|
-
@include
|
|
185
|
+
@include item(8);
|
|
184
186
|
}
|
|
185
187
|
}
|
|
186
188
|
|
|
@@ -190,11 +192,11 @@ $mdw-grid__gutter: dp(24) !default;
|
|
|
190
192
|
-ms-grid-columns: unquote("(1fr)[4]");
|
|
191
193
|
|
|
192
194
|
& > .mdw-grid__item {
|
|
193
|
-
@include
|
|
195
|
+
@include item(4);
|
|
194
196
|
}
|
|
195
197
|
}
|
|
196
198
|
|
|
197
|
-
@include
|
|
199
|
+
@include breakpoint.is4Columns() {
|
|
198
200
|
.mdw-grid,
|
|
199
201
|
.mdw-grid[mdw-columns="8"] {
|
|
200
202
|
grid-template-columns: repeat(4, 1fr);
|
|
@@ -203,7 +205,7 @@ $mdw-grid__gutter: dp(24) !default;
|
|
|
203
205
|
|
|
204
206
|
.mdw-grid__item,
|
|
205
207
|
.mdw-grid[mdw-columns="8"] > .mdw-grid__item {
|
|
206
|
-
@include
|
|
208
|
+
@include item(4);
|
|
207
209
|
}
|
|
208
210
|
}
|
|
209
211
|
|
|
@@ -213,7 +215,7 @@ $mdw-grid__gutter: dp(24) !default;
|
|
|
213
215
|
-ms-grid-columns: 1fr;
|
|
214
216
|
|
|
215
217
|
& > .mdw-grid__item {
|
|
216
|
-
@include
|
|
218
|
+
@include item(1);
|
|
217
219
|
}
|
|
218
220
|
}
|
|
219
221
|
|
|
@@ -222,7 +224,7 @@ $mdw-grid__gutter: dp(24) !default;
|
|
|
222
224
|
.mdw-grid[mdw-margin="#{$value}"],
|
|
223
225
|
.mdw-grid[mdw-columns="1"][mdw-margin="#{$value}"],
|
|
224
226
|
.mdw-grid[mdw-columns="8"][mdw-margin-8col="#{$value}"],
|
|
225
|
-
.mdw-grid[mdw-columns="4"][mdw-margin-4col="#{$value}"]
|
|
227
|
+
.mdw-grid[mdw-columns="4"][mdw-margin-4col="#{$value}"] {
|
|
226
228
|
padding-right: dp($value);
|
|
227
229
|
padding-left: dp($value);
|
|
228
230
|
|
|
@@ -250,7 +252,7 @@ $mdw-grid__gutter: dp(24) !default;
|
|
|
250
252
|
}
|
|
251
253
|
|
|
252
254
|
// 8-col grids use 8col variable
|
|
253
|
-
@include
|
|
255
|
+
@include breakpoint.max8Columns() {
|
|
254
256
|
@each $value in (0, 8, 16, 24, 40) {
|
|
255
257
|
.mdw-grid[mdw-margin-8col="#{$value}"] {
|
|
256
258
|
padding-right: dp($value);
|
|
@@ -279,7 +281,7 @@ $mdw-grid__gutter: dp(24) !default;
|
|
|
279
281
|
|
|
280
282
|
// 4col grids use 4col variable
|
|
281
283
|
// Overrides 8col and 12col
|
|
282
|
-
@include
|
|
284
|
+
@include breakpoint.is4Columns() {
|
|
283
285
|
@each $value in (0, 8, 16, 24, 40) {
|
|
284
286
|
.mdw-grid,
|
|
285
287
|
.mdw-grid[mdw-columns="8"] {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
1
|
+
@forward './_spec.scss';
|
|
2
|
+
@forward './_theme.scss';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '../../core/_breakpoint.scss' as breakpoint;
|
|
2
2
|
|
|
3
|
-
@mixin
|
|
3
|
+
@mixin modal($side) {
|
|
4
4
|
.mdw-layout__body[mdw-#{$side}-style='modal'] {
|
|
5
5
|
@content;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
@include
|
|
8
|
+
@include breakpoint.maxSmallWindow {
|
|
9
9
|
@content;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
@mixin
|
|
13
|
+
@mixin gridColumn($start, $end: null) {
|
|
14
14
|
@if ($end == null) {
|
|
15
15
|
$end: $start;
|
|
16
16
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
@mixin
|
|
24
|
+
@mixin gridRow($top, $bottom: null) {
|
|
25
25
|
@if ($bottom == null) {
|
|
26
26
|
$bottom: $top;
|
|
27
27
|
}
|