@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,25 +1,10 @@
|
|
|
1
1
|
// https://www.w3.org/TR/wai-aria-practices/#tabpanel
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as Keyboard from '../../core/aria/keyboard.js';
|
|
4
|
+
import * as RovingTabIndex from '../../core/aria/rovingtabindex.js';
|
|
5
|
+
import { iterateArrayLike } from '../../core/dom.js';
|
|
4
6
|
|
|
5
|
-
import * as
|
|
6
|
-
import * as RovingTabIndex from '../../core/aria/rovingtabindex';
|
|
7
|
-
import * as BottomNavItem from './item';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @param {Element} bottomnavElement
|
|
11
|
-
* @return {void}
|
|
12
|
-
*/
|
|
13
|
-
export function attach(bottomnavElement) {
|
|
14
|
-
bottomnavElement.classList.add('mdw-overlay__group');
|
|
15
|
-
iterateArrayLike(bottomnavElement.getElementsByClassName('mdw-bottomnav__item'), BottomNavItem.attach);
|
|
16
|
-
bottomnavElement.addEventListener(AriaAttributes.SELECTED_CHANGED_EVENT, onSelectedChangedEvent);
|
|
17
|
-
setupARIA(bottomnavElement);
|
|
18
|
-
RovingTabIndex.setupTabIndexes(bottomnavElement, '[role="tab"]');
|
|
19
|
-
bottomnavElement.addEventListener(RovingTabIndex.FORWARDS_REQUESTED, onForwardsRequested);
|
|
20
|
-
bottomnavElement.addEventListener(RovingTabIndex.BACKWARDS_REQUESTED, onBackwardsRequested);
|
|
21
|
-
bottomnavElement.addEventListener(RovingTabIndex.TABINDEX_ZEROED, onTabIndexZeroed);
|
|
22
|
-
}
|
|
7
|
+
import * as BottomNavItem from './item.js';
|
|
23
8
|
|
|
24
9
|
/**
|
|
25
10
|
* @param {Event} event
|
|
@@ -33,11 +18,17 @@ function onTabIndexZeroed(event) {
|
|
|
33
18
|
const currentItem = (event.target);
|
|
34
19
|
RovingTabIndex.removeTabIndex(bottomnavElement.querySelectorAll('[role="tab"]'), [currentItem]);
|
|
35
20
|
}
|
|
21
|
+
|
|
36
22
|
/**
|
|
37
|
-
* @param {
|
|
23
|
+
* @param {CustomEvent} event
|
|
38
24
|
* @return {void}
|
|
39
25
|
*/
|
|
40
26
|
function onForwardsRequested(event) {
|
|
27
|
+
if (event.detail.ctrlKey || event.detail.altKey
|
|
28
|
+
|| event.detail.shiftKey || event.detail.metaKey) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
event.preventDefault();
|
|
41
32
|
event.stopPropagation();
|
|
42
33
|
/** @type {HTMLElement} */
|
|
43
34
|
const bottomnavElement = (event.currentTarget);
|
|
@@ -45,10 +36,15 @@ function onForwardsRequested(event) {
|
|
|
45
36
|
}
|
|
46
37
|
|
|
47
38
|
/**
|
|
48
|
-
* @param {
|
|
39
|
+
* @param {CustomEvent} event
|
|
49
40
|
* @return {void}
|
|
50
41
|
*/
|
|
51
42
|
function onBackwardsRequested(event) {
|
|
43
|
+
if (event.detail.ctrlKey || event.detail.altKey
|
|
44
|
+
|| event.detail.shiftKey || event.detail.metaKey) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
event.preventDefault();
|
|
52
48
|
event.stopPropagation();
|
|
53
49
|
/** @type {HTMLElement} */
|
|
54
50
|
const bottomnavElement = (event.currentTarget);
|
|
@@ -60,54 +56,67 @@ function onBackwardsRequested(event) {
|
|
|
60
56
|
* @return {void}
|
|
61
57
|
*/
|
|
62
58
|
export function setupARIA(bottomnavElement) {
|
|
63
|
-
if (bottomnavElement.hasAttribute('mdw-no-aria')) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
59
|
bottomnavElement.setAttribute('role', 'tablist');
|
|
67
60
|
bottomnavElement.setAttribute('aria-multiselectable', 'false');
|
|
68
61
|
bottomnavElement.setAttribute('aria-orientation', 'horizontal');
|
|
69
62
|
}
|
|
70
63
|
|
|
71
64
|
/**
|
|
72
|
-
* @param {
|
|
65
|
+
* @param {CustomEvent} event
|
|
73
66
|
* @return {void}
|
|
74
67
|
*/
|
|
75
|
-
export function
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
68
|
+
export function onSelectedChangeEvent(event) {
|
|
69
|
+
/** @type {HTMLElement} */
|
|
70
|
+
const itemElement = (event.target);
|
|
71
|
+
if (event.detail.value !== 'true') {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
/** @type {HTMLElement} */
|
|
75
|
+
const bottomnavElement = (event.currentTarget);
|
|
76
|
+
iterateArrayLike(bottomnavElement.querySelectorAll('[role="tab"]'), (item) => {
|
|
77
|
+
if (item !== itemElement) {
|
|
78
|
+
BottomNavItem.setSelected(item, false);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
82
81
|
}
|
|
83
82
|
|
|
84
|
-
|
|
85
83
|
/**
|
|
86
84
|
* @param {Element} bottomnavElement
|
|
87
85
|
* @return {void}
|
|
88
86
|
*/
|
|
89
|
-
export function
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
);
|
|
87
|
+
export function attach(bottomnavElement) {
|
|
88
|
+
setupARIA(bottomnavElement);
|
|
89
|
+
/** @type {Element} */
|
|
90
|
+
let selectedItem;
|
|
91
|
+
const items = bottomnavElement.getElementsByClassName('mdw-bottomnav__item');
|
|
92
|
+
|
|
93
|
+
iterateArrayLike(items, (item) => {
|
|
94
|
+
BottomNavItem.attach(item);
|
|
95
|
+
if (!selectedItem && item.getAttribute('aria-selected') === 'true') {
|
|
96
|
+
selectedItem = item;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
if (!selectedItem) {
|
|
100
|
+
selectedItem = items[0];
|
|
101
|
+
}
|
|
102
|
+
if (selectedItem) {
|
|
103
|
+
BottomNavItem.setSelected(selectedItem, true, true);
|
|
104
|
+
}
|
|
105
|
+
RovingTabIndex.setupTabIndexes(bottomnavElement.querySelectorAll('[role="tab"]'));
|
|
106
|
+
bottomnavElement.addEventListener(BottomNavItem.SELECTED_CHANGE_EVENT, onSelectedChangeEvent);
|
|
107
|
+
bottomnavElement.addEventListener(Keyboard.FORWARD_ARROW_KEY, onForwardsRequested);
|
|
108
|
+
bottomnavElement.addEventListener(Keyboard.BACK_ARROW_KEY, onBackwardsRequested);
|
|
109
|
+
bottomnavElement.addEventListener(RovingTabIndex.TABINDEX_ZEROED, onTabIndexZeroed);
|
|
94
110
|
}
|
|
95
111
|
|
|
96
112
|
/**
|
|
97
|
-
* @param {
|
|
113
|
+
* @param {Element} bottomnavElement
|
|
98
114
|
* @return {void}
|
|
99
115
|
*/
|
|
100
|
-
export function
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
/** @type {HTMLElement} */
|
|
107
|
-
const bottomnavElement = (event.currentTarget);
|
|
108
|
-
iterateArrayLike(bottomnavElement.querySelectorAll('[role="tab"]'), (item) => {
|
|
109
|
-
if (item !== itemElement) {
|
|
110
|
-
item.setAttribute('aria-selected', 'false');
|
|
111
|
-
}
|
|
112
|
-
});
|
|
116
|
+
export function detach(bottomnavElement) {
|
|
117
|
+
bottomnavElement.removeEventListener(BottomNavItem.SELECTED_CHANGE_EVENT, onSelectedChangeEvent);
|
|
118
|
+
bottomnavElement.removeEventListener(Keyboard.FORWARD_ARROW_KEY, onForwardsRequested);
|
|
119
|
+
bottomnavElement.removeEventListener(Keyboard.BACK_ARROW_KEY, onBackwardsRequested);
|
|
120
|
+
bottomnavElement.removeEventListener(RovingTabIndex.TABINDEX_ZEROED, onTabIndexZeroed);
|
|
121
|
+
iterateArrayLike(bottomnavElement.getElementsByClassName('mdw-bottomnav__item'), BottomNavItem.detach);
|
|
113
122
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
1
|
+
@forward './_spec.scss';
|
|
2
|
+
@forward './_theme.scss';
|
|
@@ -1,36 +1,33 @@
|
|
|
1
1
|
// https://www.w3.org/TR/wai-aria-1.1/#tab
|
|
2
2
|
|
|
3
|
-
import * as AriaTab from '../../core/aria/tab';
|
|
4
|
-
import { iterateArrayLike } from '../../core/dom';
|
|
5
|
-
import * as Overlay from '../../core/overlay/index';
|
|
6
|
-
import * as Ripple from '../../core/ripple/index';
|
|
3
|
+
import * as AriaTab from '../../core/aria/tab.js';
|
|
4
|
+
import { iterateArrayLike } from '../../core/dom.js';
|
|
5
|
+
import * as Overlay from '../../core/overlay/index.js';
|
|
6
|
+
import * as Ripple from '../../core/ripple/index.js';
|
|
7
|
+
|
|
8
|
+
export const SELECTED_CHANGE_EVENT = 'mdw:bottomnavitem-selectedchange';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* @param {Element} element
|
|
10
|
-
* @
|
|
12
|
+
* @param {string|boolean} value
|
|
13
|
+
* @param {boolean} [dispatchEvent=true]
|
|
14
|
+
* @return {boolean} successful
|
|
11
15
|
*/
|
|
12
|
-
export function
|
|
13
|
-
|
|
14
|
-
if (!element.hasAttribute('mdw-overlay-off')) {
|
|
15
|
-
element.setAttribute('mdw-overlay-off', 'selected');
|
|
16
|
-
}
|
|
17
|
-
if (!element.hasAttribute('mdw-overlay-default')) {
|
|
18
|
-
element.setAttribute('mdw-overlay-default', 'medium');
|
|
19
|
-
}
|
|
20
|
-
Overlay.attach(element);
|
|
21
|
-
|
|
22
|
-
element.classList.add('mdw-ripple');
|
|
23
|
-
Ripple.attach(element);
|
|
24
|
-
|
|
25
|
-
attachCore(element);
|
|
16
|
+
export function setSelected(element, value, dispatchEvent = true) {
|
|
17
|
+
return AriaTab.setSelected(element, value, dispatchEvent ? SELECTED_CHANGE_EVENT : null);
|
|
26
18
|
}
|
|
27
19
|
|
|
28
20
|
/**
|
|
29
|
-
* @param {
|
|
21
|
+
* @param {MouseEvent} event
|
|
30
22
|
* @return {void}
|
|
31
23
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
function onClick(event) {
|
|
25
|
+
/** @type {HTMLElement} */
|
|
26
|
+
const element = (event.currentTarget);
|
|
27
|
+
if (element.getAttribute('aria-disabled') === 'true') {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
setSelected(element, true);
|
|
34
31
|
}
|
|
35
32
|
|
|
36
33
|
/**
|
|
@@ -40,15 +37,36 @@ export function attachCore(element) {
|
|
|
40
37
|
export function attachAria(element) {
|
|
41
38
|
AriaTab.attach(element);
|
|
42
39
|
iterateArrayLike(element.getElementsByClassName('mdw-bottomnav__icon'),
|
|
43
|
-
el => el.setAttribute('aria-hidden', 'true'));
|
|
40
|
+
(el) => el.setAttribute('aria-hidden', 'true'));
|
|
44
41
|
}
|
|
45
42
|
|
|
46
43
|
/**
|
|
47
44
|
* @param {Element} element
|
|
48
45
|
* @return {void}
|
|
49
46
|
*/
|
|
50
|
-
export function
|
|
51
|
-
|
|
47
|
+
export function attachCore(element) {
|
|
48
|
+
attachAria(element);
|
|
49
|
+
element.addEventListener('click', onClick);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @param {Element} element
|
|
54
|
+
* @return {void}
|
|
55
|
+
*/
|
|
56
|
+
export function attach(element) {
|
|
57
|
+
element.classList.add('mdw-overlay');
|
|
58
|
+
if (!element.hasAttribute('mdw-overlay-off')) {
|
|
59
|
+
element.setAttribute('mdw-overlay-off', 'selected activated');
|
|
60
|
+
}
|
|
61
|
+
if (!element.hasAttribute('mdw-overlay-default')) {
|
|
62
|
+
element.setAttribute('mdw-overlay-default', 'medium');
|
|
63
|
+
}
|
|
64
|
+
Overlay.attach(element);
|
|
65
|
+
|
|
66
|
+
element.classList.add('mdw-ripple');
|
|
67
|
+
Ripple.attach(element);
|
|
68
|
+
|
|
69
|
+
attachCore(element);
|
|
52
70
|
}
|
|
53
71
|
|
|
54
72
|
/**
|
|
@@ -57,6 +75,7 @@ export function detachAria(element) {
|
|
|
57
75
|
*/
|
|
58
76
|
export function detachCore(element) {
|
|
59
77
|
AriaTab.detach(element);
|
|
78
|
+
element.removeEventListener('click', onClick);
|
|
60
79
|
}
|
|
61
80
|
|
|
62
81
|
/**
|
|
@@ -11,34 +11,36 @@
|
|
|
11
11
|
.mdw-button(mdw-raised)
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
## Colored
|
|
14
|
+
## Colored (Primary)
|
|
15
15
|
```
|
|
16
|
-
.mdw-button.mdw-theme(mdw-ink="primary
|
|
16
|
+
.mdw-button.mdw-theme(mdw-ink="primary contrast")
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Colored (Custom)
|
|
20
20
|
```
|
|
21
|
-
.mdw-button.mdw-theme(mdw-ink="green
|
|
21
|
+
.mdw-button.mdw-theme(mdw-ink="green contrast")
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## Filled Light
|
|
25
25
|
```
|
|
26
|
-
.mdw-button.mdw-theme(mdw-
|
|
26
|
+
.mdw-button.mdw-theme(mdw-surface="primary 100" mdw-light)
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
## Filled
|
|
29
|
+
## Filled Dark
|
|
30
30
|
```
|
|
31
|
-
.mdw-button.mdw-theme(mdw-surface="
|
|
31
|
+
.mdw-button.mdw-theme(mdw-surface="secondary 600" mdw-dark)
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## Toggled
|
|
35
35
|
```
|
|
36
|
-
.mdw-button
|
|
36
|
+
.mdw-button(aria-pressed="true")
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## Disabled
|
|
40
40
|
```
|
|
41
|
-
.mdw-button(disabled)
|
|
41
|
+
a.mdw-button(disabled)
|
|
42
|
+
button.mdw-button(disabled)
|
|
43
|
+
.mdw-button(aria-disabled="true")
|
|
42
44
|
```
|
|
43
45
|
|
|
44
46
|
## Icon Button
|
|
@@ -49,9 +51,7 @@
|
|
|
49
51
|
# Javascript
|
|
50
52
|
|
|
51
53
|
```
|
|
52
|
-
[...document.getElementsByClassName("mdw-button")].forEach(
|
|
53
|
-
Button.attach(element);
|
|
54
|
-
});
|
|
54
|
+
[...document.getElementsByClassName("mdw-button")].forEach(Button.attach);
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
# Notes
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
// https://material.io/guidelines/components/buttons.html#buttons-raised-buttons
|
|
2
2
|
// https://material.io/guidelines/style/icons.html#
|
|
3
3
|
|
|
4
|
-
@
|
|
5
|
-
@
|
|
6
|
-
@
|
|
7
|
-
@
|
|
8
|
-
@
|
|
4
|
+
@use '../../core/_breakpoint.scss' as breakpoint;
|
|
5
|
+
@use '../../core/_elevation.scss' as elevation;
|
|
6
|
+
@use '../../core/_length.scss' as *;
|
|
7
|
+
@use '../../core/_motion.scss' as motion;
|
|
8
|
+
@use '../../core/_platform.scss' as platform;
|
|
9
|
+
@use '../../core/_type.scss' as type;
|
|
9
10
|
|
|
10
|
-
$
|
|
11
|
-
$
|
|
12
|
-
$
|
|
11
|
+
$externalPadding: dp(8) !default;
|
|
12
|
+
$minimumClickTarget: dp(48) !default;
|
|
13
|
+
$outlineSize: dp(1) !default;
|
|
13
14
|
|
|
14
15
|
.mdw-button {
|
|
15
16
|
display: inline-flex;
|
|
@@ -35,9 +36,9 @@ $mdw-button__outline-size: dp(1) !default;
|
|
|
35
36
|
-webkit-user-select: none;
|
|
36
37
|
user-select: none;
|
|
37
38
|
|
|
38
|
-
transition-duration:
|
|
39
|
+
transition-duration: motion.$shapeChangeDuration, motion.$simpleDuration;
|
|
39
40
|
transition-property: box-shadow, background-color, color;
|
|
40
|
-
transition-timing-function:
|
|
41
|
+
transition-timing-function: motion.$standardEasing;
|
|
41
42
|
|
|
42
43
|
z-index: 0;
|
|
43
44
|
|
|
@@ -63,24 +64,24 @@ $mdw-button__outline-size: dp(1) !default;
|
|
|
63
64
|
|
|
64
65
|
// Don't override font icon properties
|
|
65
66
|
&:not([mdw-icon]) {
|
|
66
|
-
@include type
|
|
67
|
+
@include type.addRules('button');
|
|
67
68
|
font-family: inherit;
|
|
68
69
|
word-spacing: normal;
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
&[mdw-border-ink] {
|
|
72
73
|
border-style: solid;
|
|
73
|
-
border-width: $
|
|
74
|
+
border-width: $outlineSize;
|
|
74
75
|
|
|
75
76
|
&::before,
|
|
76
77
|
& > .mdw-ripple {
|
|
77
78
|
box-sizing: content-box;
|
|
78
79
|
height: 100%;
|
|
79
80
|
width: 100%;
|
|
80
|
-
margin-top: -$
|
|
81
|
-
margin-left: -$
|
|
82
|
-
padding-right: 2 * $
|
|
83
|
-
padding-bottom: 2 * $
|
|
81
|
+
margin-top: -$outlineSize;
|
|
82
|
+
margin-left: -$outlineSize;
|
|
83
|
+
padding-right: 2 * $outlineSize;
|
|
84
|
+
padding-bottom: 2 * $outlineSize;
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
|
|
@@ -125,15 +126,15 @@ $mdw-button__outline-size: dp(1) !default;
|
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
// Extended touch target
|
|
128
|
-
@mixin
|
|
129
|
-
@include
|
|
129
|
+
@mixin touchTarget {
|
|
130
|
+
@include platform.ifHasTouch() {
|
|
130
131
|
content: "";
|
|
131
132
|
|
|
132
133
|
position: absolute;
|
|
133
134
|
top: 50%;
|
|
134
135
|
left: 0;
|
|
135
136
|
|
|
136
|
-
height: $
|
|
137
|
+
height: $minimumClickTarget;
|
|
137
138
|
width: 100%;
|
|
138
139
|
|
|
139
140
|
transform: translateY(-50%);
|
|
@@ -142,10 +143,10 @@ $mdw-button__outline-size: dp(1) !default;
|
|
|
142
143
|
|
|
143
144
|
// Raised
|
|
144
145
|
.mdw-button[mdw-raised] {
|
|
145
|
-
box-shadow:
|
|
146
|
+
box-shadow: elevation.boxShadow(2);
|
|
146
147
|
|
|
147
148
|
&:active {
|
|
148
|
-
box-shadow:
|
|
149
|
+
box-shadow: elevation.boxShadow(8);
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
|
|
@@ -155,6 +156,6 @@ $mdw-button__outline-size: dp(1) !default;
|
|
|
155
156
|
|
|
156
157
|
&,
|
|
157
158
|
&[mdw-raised] {
|
|
158
|
-
box-shadow:
|
|
159
|
+
box-shadow: elevation.boxShadow(0);
|
|
159
160
|
}
|
|
160
161
|
}
|
|
@@ -2,33 +2,49 @@
|
|
|
2
2
|
// https://material.io/design/components/buttons.html
|
|
3
3
|
// https://material.io/design/iconography/system-icons.html#color
|
|
4
4
|
|
|
5
|
-
@
|
|
5
|
+
@use '../../core/theme/_mixins.scss' as theme;
|
|
6
6
|
|
|
7
|
-
$
|
|
8
|
-
|
|
9
|
-
disabled-text-
|
|
10
|
-
disabled-
|
|
11
|
-
|
|
7
|
+
$themeValues: (
|
|
8
|
+
default-text-rgb: theme.$foreground,
|
|
9
|
+
disabled-text-rgb: theme.$foreground,
|
|
10
|
+
disabled-surface-text-rgb: theme.$foreground,
|
|
11
|
+
disabled-surface-background-rgb: theme.$foreground,
|
|
12
|
+
default-text-alpha: theme.$high-opacity,
|
|
13
|
+
disabled-text-alpha: theme.$inactive-opacity,
|
|
14
|
+
disabled-surface-text-alpha: theme.$high-opacity,
|
|
15
|
+
disabled-surface-background-alpha: theme.$inactive-opacity,
|
|
12
16
|
) !default;
|
|
13
17
|
|
|
14
|
-
@function
|
|
15
|
-
@return
|
|
18
|
+
@function getThemeValue($key, $type) {
|
|
19
|
+
@return theme.getThemeValue('button', $themeValues, $key, $type);
|
|
16
20
|
}
|
|
17
21
|
|
|
18
|
-
@mixin
|
|
22
|
+
@mixin addThemeRules($type: 'var') {
|
|
19
23
|
.mdw-button {
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
&:disabled:not([aria-disabled="true"]) {
|
|
25
|
+
color: RGBA(getThemeValue("disabled-text-rgb", $type), getThemeValue("disabled-text-alpha", $type));
|
|
26
|
+
|
|
27
|
+
&.mdw-overlay::before {
|
|
28
|
+
display: none;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&.mdw-overlay[aria-disabled="true"] {
|
|
33
|
+
// Sets foreground to default ink color
|
|
34
|
+
color: RGBA(getThemeValue("default-text-rgb", $type), getThemeValue("default-text-alpha", $type));
|
|
35
|
+
|
|
22
36
|
&[mdw-surface] {
|
|
23
|
-
background-color:
|
|
24
|
-
color:
|
|
37
|
+
background-color: RGBA(getThemeValue("disabled-surface-background-rgb", $type), getThemeValue("disabled-surface-background-alpha", $type));
|
|
38
|
+
color: RGBA(getThemeValue("disabled-surface-text-rgb", $type), getThemeValue("disabled-surface-text-alpha", $type));
|
|
25
39
|
|
|
26
40
|
// Disabled filled buttons use parent's theming context
|
|
27
41
|
@if ($type == 'var') {
|
|
28
42
|
&[mdw-dark],
|
|
29
43
|
&[mdw-light] {
|
|
30
|
-
--button__disabled-text-
|
|
31
|
-
--button__disabled-
|
|
44
|
+
--mdw-button__disabled-surface-text-rgb: inherit;
|
|
45
|
+
--mdw-button__disabled-surface-text-opacity: inherit;
|
|
46
|
+
--mdw-button__disabled-surface-background-rgb: inherit;
|
|
47
|
+
--mdw-button__disabled-surface-background-opacity: inherit;
|
|
32
48
|
}
|
|
33
49
|
}
|
|
34
50
|
}
|
|
@@ -37,13 +53,13 @@ $mdw-button__theme-values: (
|
|
|
37
53
|
}
|
|
38
54
|
|
|
39
55
|
|
|
40
|
-
@include
|
|
41
|
-
@include
|
|
56
|
+
@include theme.addComponentFallbackRules('light') {
|
|
57
|
+
@include addThemeRules('light');
|
|
42
58
|
}
|
|
43
|
-
@include
|
|
44
|
-
@include
|
|
59
|
+
@include theme.addComponentFallbackRules('dark') {
|
|
60
|
+
@include addThemeRules('dark');
|
|
45
61
|
}
|
|
46
62
|
|
|
47
|
-
@include
|
|
48
|
-
@include
|
|
63
|
+
@include theme.addComponentCSSVariableRules('button', $themeValues) {
|
|
64
|
+
@include addThemeRules();
|
|
49
65
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<a <%~ Object.entries({
|
|
2
|
+
'class': [
|
|
3
|
+
'mdw-button',
|
|
4
|
+
it?.overlay != false ? 'mdw-overlay' : '',
|
|
5
|
+
it?.ripple != false ? 'mdw-ripple' : '',
|
|
6
|
+
it?.ink || it?.surface || it?.light || it?.dark || it?.borderInk || it?.theme ? 'mdw-theme' : '',
|
|
7
|
+
it?.class,
|
|
8
|
+
].filter(v=>v).join(' '),
|
|
9
|
+
id: it?.id,
|
|
10
|
+
'mdw-ink': it?.ink,
|
|
11
|
+
'mdw-surface': it?.surface,
|
|
12
|
+
'mdw-border-ink': it?.borderInk,
|
|
13
|
+
'mdw-light': it?.light,
|
|
14
|
+
'mdw-dark': it?.dark,
|
|
15
|
+
'mdw-icon': it?.icon,
|
|
16
|
+
'mdw-raised': it?.raised,
|
|
17
|
+
'mdw-more-button': it?.moreButton ?? (
|
|
18
|
+
it?.icon && (it?.text === 'more_vert' || it?.body === 'more_vert') && it?.class?.split(' ').includes('material-icons')),
|
|
19
|
+
'disabled': it?.disabled && it?.disabled !== 'false',
|
|
20
|
+
'aria-disabled': it?.disabled === true ? 'true' : it?.disabled,
|
|
21
|
+
'tabindex': it?.tabindex || '0',
|
|
22
|
+
'href': it?.href,
|
|
23
|
+
...it?.attributes,
|
|
24
|
+
}).map(([key, value]) => {
|
|
25
|
+
if (value === true) return key;
|
|
26
|
+
if (value === false || value == null) return false;
|
|
27
|
+
return `${key}="${value}"`
|
|
28
|
+
}).filter(v=>v).join(' ')-%>>
|
|
29
|
+
|
|
30
|
+
<%_~ it?.body ?? '' %><%= it?.text ?? '' _%>
|
|
31
|
+
|
|
32
|
+
</a>
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
/** @see https://www.w3.org/TR/wai-aria-practices/#button */
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import * as Overlay from '../../core/overlay/index';
|
|
5
|
-
import * as
|
|
3
|
+
import * as AriaButton from '../../core/aria/button.js';
|
|
4
|
+
import * as Overlay from '../../core/overlay/index.js';
|
|
5
|
+
import * as Ripple from '../../core/ripple/index.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @param {Element} element
|
|
9
9
|
* @return {void}
|
|
10
10
|
*/
|
|
11
|
-
export function
|
|
12
|
-
|
|
13
|
-
Ripple.attach(element);
|
|
14
|
-
element.classList.add('mdw-ripple');
|
|
15
|
-
Overlay.attach(element);
|
|
16
|
-
attachCore(element);
|
|
11
|
+
export function attachCore(element) {
|
|
12
|
+
AriaButton.attach(element);
|
|
17
13
|
}
|
|
18
14
|
|
|
19
15
|
/**
|
|
20
16
|
* @param {Element} element
|
|
21
17
|
* @return {void}
|
|
22
18
|
*/
|
|
23
|
-
export function
|
|
24
|
-
|
|
19
|
+
export function attach(element) {
|
|
20
|
+
element.classList.add('mdw-overlay');
|
|
21
|
+
Ripple.attach(element);
|
|
22
|
+
element.classList.add('mdw-ripple');
|
|
23
|
+
Overlay.attach(element);
|
|
24
|
+
attachCore(element);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
1
|
+
@forward './_spec.scss';
|
|
2
|
+
@forward './_theme.scss';
|