@shortfuse/materialdesignweb 0.0.9 → 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/.browserslistrc +3 -0
- package/.eslintrc.json +146 -27
- package/.stylelintrc.json +598 -2
- package/.vscode/launch.json +20 -5
- package/.vscode/settings.json +3 -0
- package/.vscode/tasks.json +19 -10
- package/CHANGELOG.md +24 -0
- package/README.md +84 -2
- package/adapters/datatable/column.js +203 -0
- package/adapters/datatable/index.js +972 -0
- package/adapters/dom/index.js +601 -0
- package/adapters/list/index.js +69 -0
- package/adapters/search/index.js +521 -0
- package/components/appbar/_spec.scss +225 -0
- package/components/appbar/_theme.scss +0 -0
- package/components/appbar/index.scss +2 -0
- package/components/banner/_spec.scss +118 -0
- package/components/banner/_theme.scss +0 -0
- package/components/banner/index.scss +2 -0
- package/components/bottomnav/README.md +85 -0
- package/components/bottomnav/_spec.scss +157 -0
- package/components/bottomnav/_theme.scss +0 -0
- package/components/bottomnav/index.js +122 -0
- package/components/bottomnav/index.scss +2 -0
- package/components/bottomnav/item.js +89 -0
- package/components/{core/button → button}/README.md +16 -22
- package/components/button/_spec.scss +161 -0
- package/components/button/_theme.scss +65 -0
- package/components/button/index.eta +32 -0
- package/components/button/index.js +43 -0
- package/components/button/index.pug +18 -0
- package/components/button/index.scss +2 -0
- package/components/card/_spec.scss +249 -0
- package/components/card/_theme.scss +0 -0
- package/components/card/index.scss +2 -0
- package/components/chip/_spec.scss +134 -0
- package/components/chip/_theme.scss +177 -0
- package/components/chip/index.js +21 -0
- package/components/chip/index.scss +2 -0
- package/components/chip/item.js +20 -0
- package/components/datatable/_spec.scss +288 -0
- package/components/datatable/_theme.scss +154 -0
- package/components/datatable/cell.js +45 -0
- package/components/datatable/columnheader.js +47 -0
- package/components/datatable/index.js +388 -0
- package/components/datatable/index.scss +2 -0
- package/components/datatable/row.js +49 -0
- package/components/datatable/rowheader.js +18 -0
- package/components/dialog/_spec.scss +213 -0
- package/components/dialog/_theme.scss +0 -0
- package/components/dialog/index.js +627 -0
- package/components/dialog/index.scss +2 -0
- package/components/divider/_spec.scss +13 -0
- package/components/divider/_theme.scss +0 -0
- package/components/divider/index.scss +2 -0
- package/components/elevation/_spec.scss +9 -0
- package/components/elevation/_theme.scss +0 -0
- package/components/elevation/index.scss +2 -0
- package/components/fab/_spec.scss +222 -0
- package/components/fab/_theme.scss +0 -0
- package/components/fab/index.js +103 -0
- package/components/fab/index.scss +2 -0
- package/components/grid/_spec.scss +312 -0
- package/components/grid/_theme.scss +0 -0
- package/components/grid/index.scss +2 -0
- package/components/layout/_mixins.scss +33 -0
- package/components/layout/_spec.scss +1012 -0
- package/components/layout/_theme.scss +44 -0
- package/components/layout/index.js +464 -0
- package/components/layout/index.scss +2 -0
- package/components/list/_spec.scss +397 -0
- package/components/list/_theme.scss +111 -0
- package/components/list/content.js +110 -0
- package/components/list/index.js +260 -0
- package/components/list/index.scss +2 -0
- package/components/list/item.js +170 -0
- package/components/list/secondary.js +46 -0
- package/components/menu/_spec.scss +362 -0
- package/components/menu/_theme.scss +0 -0
- package/components/menu/index.js +721 -0
- package/components/menu/index.scss +2 -0
- package/components/menu/item.js +239 -0
- package/components/{core/progress/style.scss → progress/_spec.scss} +36 -25
- package/components/progress/_theme.scss +0 -0
- package/components/progress/index.js +36 -0
- package/components/progress/index.scss +2 -0
- package/components/selection/_spec.scss +386 -0
- package/components/selection/_theme.scss +166 -0
- package/components/selection/index.eta +60 -0
- package/components/selection/index.js +76 -0
- package/components/selection/index.pug +30 -0
- package/components/selection/index.scss +2 -0
- package/components/selection/input.js +56 -0
- package/components/selection/radiogroup.js +47 -0
- package/components/slider/_spec.scss +64 -0
- package/components/slider/_theme.scss +0 -0
- package/components/slider/index.scss +2 -0
- package/components/snackbar/_spec.scss +195 -0
- package/components/snackbar/_theme.scss +0 -0
- package/components/snackbar/index.js +344 -0
- package/components/snackbar/index.scss +2 -0
- package/components/tab/_spec.scss +235 -0
- package/components/tab/_theme.scss +0 -0
- package/components/tab/content.js +205 -0
- package/components/tab/index.js +260 -0
- package/components/tab/index.scss +2 -0
- package/components/tab/item.js +89 -0
- package/components/tab/list.js +210 -0
- package/components/tab/panel.js +54 -0
- package/components/template/_theme.scss +27 -0
- package/components/{core/textfield → textfield}/README.md +70 -50
- package/components/textfield/_mixins.scss +52 -0
- package/components/textfield/_spec.scss +809 -0
- package/components/textfield/_theme.scss +299 -0
- package/components/textfield/index.eta +74 -0
- package/components/textfield/index.js +168 -0
- package/components/textfield/index.pug +30 -0
- package/components/textfield/index.scss +2 -0
- package/components/tooltip/_spec.scss +188 -0
- package/components/tooltip/_theme.scss +0 -0
- package/components/tooltip/index.scss +2 -0
- package/components/type/_spec.scss +224 -0
- package/components/type/_theme.scss +0 -0
- package/components/type/index.scss +2 -0
- package/core/_breakpoint.scss +189 -0
- package/core/_elevation.scss +38 -0
- package/core/_length.scss +9 -0
- package/core/_motion.scss +31 -0
- package/core/_platform.scss +34 -0
- package/core/_type.scss +127 -0
- package/core/aria/attributes.js +141 -0
- package/core/aria/button.js +50 -0
- package/core/aria/keyboard.js +93 -0
- package/core/aria/rovingtabindex.js +178 -0
- package/core/aria/tab.js +60 -0
- package/core/color/_spec.scss +0 -0
- package/core/color/_theme.scss +390 -0
- package/core/color/index.scss +2 -0
- package/core/document/index.js +39 -0
- package/core/dom.js +271 -0
- package/core/overlay/_spec.scss +31 -0
- package/core/overlay/_theme.scss +171 -0
- package/core/overlay/index.js +108 -0
- package/core/overlay/index.scss +2 -0
- package/core/ripple/_spec.scss +197 -0
- package/core/ripple/_theme.scss +40 -0
- package/core/ripple/index.js +294 -0
- package/core/ripple/index.scss +2 -0
- package/core/theme/_config.scss +2 -0
- package/core/theme/_mixins.scss +172 -0
- package/{components/theming/palettes.scss → core/theme/_palettes.scss} +173 -150
- package/core/theme/_variables.scss +24 -0
- package/core/theme/index.js +50 -0
- package/core/throttler.js +42 -0
- package/core/transition/index.js +468 -0
- package/docs/_flex.scss +22 -0
- package/docs/_menuoptions.js +183 -0
- package/docs/_mixins.pug +155 -0
- 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/_sample-utils.js +93 -0
- package/docs/_storage.js +33 -0
- package/docs/docs.scss +295 -0
- package/docs/index.eta +16 -0
- package/docs/index.js +0 -0
- package/docs/pages/appbar.eta +114 -0
- package/docs/pages/appbar.js +0 -0
- package/docs/pages/appbar.pug +78 -0
- package/docs/pages/bottomnav.eta +188 -0
- package/docs/pages/bottomnav.js +115 -0
- package/docs/pages/bottomnav.pug +137 -0
- package/docs/pages/button.eta +124 -0
- package/docs/pages/button.js +224 -0
- package/docs/pages/button.pug +121 -0
- package/docs/pages/card.eta +90 -0
- package/docs/pages/card.js +177 -0
- package/docs/pages/card.pug +74 -0
- package/docs/pages/chip.eta +122 -0
- package/docs/pages/chip.js +82 -0
- package/docs/pages/chip.pug +91 -0
- package/docs/pages/color.eta +143 -0
- package/docs/pages/color.js +262 -0
- package/docs/pages/color.pug +121 -0
- package/docs/pages/datatable.eta +323 -0
- package/docs/pages/datatable.js +164 -0
- package/docs/pages/datatable.pug +283 -0
- package/docs/pages/dialog.eta +186 -0
- package/docs/pages/dialog.js +177 -0
- package/docs/pages/dialog.pug +132 -0
- 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/pages/elevation.js +0 -0
- package/docs/pages/elevation.pug +25 -0
- package/docs/pages/fab.eta +99 -0
- package/docs/pages/fab.js +44 -0
- package/docs/pages/fab.pug +66 -0
- package/docs/pages/grid.eta +135 -0
- package/docs/pages/grid.js +128 -0
- package/docs/pages/grid.pug +95 -0
- package/docs/pages/layout.eta +8 -0
- package/docs/pages/layout.js +0 -0
- package/docs/pages/layout.pug +7 -0
- package/docs/pages/list.eta +465 -0
- package/docs/pages/list.js +9 -0
- package/docs/pages/list.pug +326 -0
- package/docs/pages/menu.eta +276 -0
- package/docs/pages/menu.js +217 -0
- package/docs/pages/menu.pug +205 -0
- package/docs/pages/overlay.eta +69 -0
- package/docs/pages/overlay.js +4 -0
- package/docs/pages/overlay.pug +55 -0
- package/docs/pages/progress.eta +23 -0
- package/docs/pages/progress.js +12 -0
- package/docs/pages/progress.pug +16 -0
- package/docs/pages/ripple.eta +27 -0
- package/docs/pages/ripple.js +4 -0
- package/docs/pages/ripple.pug +21 -0
- package/docs/pages/search.eta +246 -0
- package/docs/pages/search.js +243 -0
- package/docs/pages/search.pug +165 -0
- 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/pages/slider.js +0 -0
- package/docs/pages/slider.pug +17 -0
- package/docs/pages/snackbar.eta +83 -0
- package/docs/pages/snackbar.js +158 -0
- package/docs/pages/snackbar.pug +60 -0
- package/docs/pages/tab.eta +421 -0
- package/docs/pages/tab.js +151 -0
- package/docs/pages/tab.pug +304 -0
- package/docs/pages/textfield.eta +486 -0
- package/docs/pages/textfield.js +254 -0
- package/docs/pages/textfield.pug +360 -0
- package/docs/pages/tooltip.eta +94 -0
- package/docs/pages/tooltip.js +0 -0
- package/docs/pages/tooltip.pug +78 -0
- package/docs/pages/transition.eta +117 -0
- package/docs/pages/transition.js +54 -0
- package/docs/pages/transition.pug +76 -0
- package/docs/pages/type.eta +31 -0
- package/docs/pages/type.js +0 -0
- package/docs/pages/type.pug +29 -0
- package/docs/postrender.js +39 -0
- package/docs/prerender.js +16 -0
- package/docs/pwa/_dialogs.eta +143 -0
- package/docs/pwa/_dialogs.pug +96 -0
- package/docs/pwa/_menus.eta +16 -0
- package/docs/pwa/_menus.pug +11 -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/pwa/pwa.pug +325 -0
- 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 +43 -28
- package/scripts/deploy-docs.sh +9 -0
- package/templates/index.eta +2 -0
- package/templates/index.pug +3 -0
- package/utils/function.js +3 -0
- package/webpack.config.cjs +257 -0
- package/components/_index.scss +0 -4
- package/components/all-components.scss +0 -14
- package/components/common/functions.scss +0 -173
- package/components/common/mixins.scss +0 -107
- package/components/common/motion.scss +0 -36
- package/components/common/ripple.scss +0 -92
- package/components/common/variables.scss +0 -48
- package/components/complex/dialog/style.scss +0 -159
- package/components/complex/dialog/theming.scss +0 -29
- package/components/complex/navdrawer/style.scss +0 -477
- package/components/complex/navdrawer/theming.scss +0 -58
- package/components/complex/search/index.js +0 -492
- package/components/core/bottomnav/README.md +0 -85
- package/components/core/bottomnav/index.js +0 -140
- package/components/core/bottomnav/style.scss +0 -173
- package/components/core/bottomnav/theming.scss +0 -42
- package/components/core/button/index.js +0 -52
- package/components/core/button/style.scss +0 -283
- package/components/core/button/theming.scss +0 -131
- package/components/core/list/index.js +0 -94
- package/components/core/list/style.scss +0 -269
- package/components/core/list/theming.scss +0 -74
- package/components/core/menu/index.js +0 -127
- package/components/core/menu/style.scss +0 -239
- package/components/core/menu/theming.scss +0 -55
- package/components/core/progress/index.js +0 -33
- package/components/core/selection/style.scss +0 -249
- package/components/core/selection/theming.scss +0 -49
- package/components/core/switch/style.scss +0 -3
- package/components/core/tab/index.js +0 -174
- package/components/core/tab/style.scss +0 -202
- package/components/core/tab/theming.scss +0 -43
- package/components/core/textfield/index.js +0 -169
- package/components/core/textfield/style.scss +0 -672
- package/components/core/textfield/theming.scss +0 -262
- package/components/core/toolbar/style.scss +0 -109
- package/components/core/toolbar/theming.scss +0 -28
- package/components/core/tooltip/style.scss +0 -127
- package/components/core/type/style.scss +0 -133
- package/components/core/type/theming.scss +0 -25
- package/components/index.js +0 -24
- package/components/template/theming.scss +0 -31
- package/components/theming/theming.scss +0 -504
- package/docs/bottomnav.html +0 -171
- package/docs/bottomnav.min.js +0 -383
- package/docs/button.html +0 -322
- package/docs/button.min.js +0 -251
- package/docs/components.min.css +0 -1
- package/docs/components.min.js +0 -83
- package/docs/dialog.html +0 -103
- package/docs/dialog.min.js +0 -160
- package/docs/docs.min.css +0 -1
- package/docs/docs.min.js +0 -83
- package/docs/index.html +0 -55
- package/docs/index.min.js +0 -83
- package/docs/list.html +0 -442
- package/docs/list.min.js +0 -312
- package/docs/menu.html +0 -185
- package/docs/menu.min.js +0 -370
- package/docs/navdrawer.html +0 -199
- package/docs/navdrawer.min.js +0 -244
- package/docs/progress.html +0 -75
- package/docs/progress.min.js +0 -162
- package/docs/search.html +0 -230
- package/docs/search.min.js +0 -1202
- package/docs/selection.html +0 -188
- package/docs/selection.min.js +0 -160
- package/docs/src/complex/dialog.js +0 -3
- package/docs/src/complex/dialog.pug +0 -44
- package/docs/src/complex/navdrawer.js +0 -82
- package/docs/src/complex/navdrawer.pug +0 -109
- package/docs/src/complex/search.js +0 -207
- package/docs/src/complex/search.pug +0 -143
- package/docs/src/components.scss +0 -1
- package/docs/src/core/bottomnav.js +0 -22
- package/docs/src/core/bottomnav.pug +0 -93
- package/docs/src/core/button.js +0 -16
- package/docs/src/core/button.pug +0 -73
- package/docs/src/core/list.js +0 -21
- package/docs/src/core/list.pug +0 -246
- package/docs/src/core/menu.js +0 -33
- package/docs/src/core/menu.pug +0 -108
- package/docs/src/core/progress.js +0 -11
- package/docs/src/core/progress.pug +0 -17
- package/docs/src/core/selection.js +0 -4
- package/docs/src/core/selection.pug +0 -92
- package/docs/src/core/tab.js +0 -21
- package/docs/src/core/tab.pug +0 -180
- package/docs/src/core/textfield.js +0 -15
- package/docs/src/core/textfield.pug +0 -274
- package/docs/src/core/toolbar.js +0 -4
- package/docs/src/core/toolbar.pug +0 -79
- package/docs/src/core/tooltip.js +0 -4
- package/docs/src/core/tooltip.pug +0 -76
- package/docs/src/core/type.js +0 -4
- package/docs/src/core/type.pug +0 -36
- package/docs/src/docs.scss +0 -200
- package/docs/src/index.pug +0 -5
- package/docs/src/mixins.pug +0 -72
- package/docs/src/targetHandler.js +0 -50
- package/docs/src/theming.ie11.scss +0 -35
- package/docs/src/theming.scss +0 -36
- package/docs/tab.html +0 -301
- package/docs/tab.min.js +0 -397
- package/docs/textfield.html +0 -476
- package/docs/textfield.min.js +0 -381
- package/docs/theming.ie11.min.css +0 -1
- package/docs/theming.ie11.min.js +0 -83
- package/docs/theming.min.css +0 -1
- package/docs/theming.min.js +0 -83
- package/docs/toolbar.html +0 -213
- package/docs/toolbar.min.js +0 -160
- package/docs/tooltip.html +0 -138
- package/docs/tooltip.min.js +0 -160
- package/docs/type.html +0 -94
- package/docs/type.min.js +0 -160
- package/webpack.config.js +0 -176
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
// https://www.w3.org/TR/wai-aria-practices/#grid
|
|
2
|
+
|
|
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';
|
|
6
|
+
|
|
7
|
+
import * as DataTableCell from './cell.js';
|
|
8
|
+
import * as DataTableColumnHeader from './columnheader.js';
|
|
9
|
+
import * as DataTableRow from './row.js';
|
|
10
|
+
import * as DataTableRowHeader from './rowheader.js';
|
|
11
|
+
|
|
12
|
+
export const CELL_TABINDEX_QUERIES = [
|
|
13
|
+
'td:not([mdw-autofocus-widget])',
|
|
14
|
+
'th:not([mdw-autofocus-widget])',
|
|
15
|
+
'td[mdw-autofocus-widget] .mdw-datatable__widget',
|
|
16
|
+
'th[mdw-autofocus-widget] .mdw-datatable__widget',
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @param {CustomEvent} event
|
|
21
|
+
* @return {void}
|
|
22
|
+
*/
|
|
23
|
+
export function onSelectedChange(event) {
|
|
24
|
+
const selected = event.detail.value === 'true';
|
|
25
|
+
/** @type {HTMLElement} */
|
|
26
|
+
const dataTableElement = (event.currentTarget);
|
|
27
|
+
const hasSelection = selected || dataTableElement.querySelector('td[aria-selected="true"],tr[aria-selected="true"]');
|
|
28
|
+
if (hasSelection) {
|
|
29
|
+
dataTableElement.setAttribute('mdw-has-selection', '');
|
|
30
|
+
} else {
|
|
31
|
+
dataTableElement.removeAttribute('mdw-has-selection');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param {Element} datatableElement
|
|
37
|
+
* @return {HTMLElement}
|
|
38
|
+
*/
|
|
39
|
+
export function getScroller(datatableElement) {
|
|
40
|
+
/** @type {HTMLElement} */
|
|
41
|
+
let scroller = (datatableElement.getElementsByClassName('mdw-datatable__scroller')[0]);
|
|
42
|
+
if (!scroller) {
|
|
43
|
+
scroller = document.createElement('div');
|
|
44
|
+
scroller.classList.add('mdw-datatable__scroller');
|
|
45
|
+
const footer = datatableElement.getElementsByClassName('mdw-datatable__footer')[0];
|
|
46
|
+
if (footer) {
|
|
47
|
+
datatableElement.insertBefore(scroller, footer);
|
|
48
|
+
} else {
|
|
49
|
+
datatableElement.appendChild(scroller);
|
|
50
|
+
}
|
|
51
|
+
// Move table into scroller if it exists
|
|
52
|
+
const table = datatableElement.getElementsByTagName('table')[0];
|
|
53
|
+
if (table) {
|
|
54
|
+
table.parentElement.removeChild(table);
|
|
55
|
+
scroller.appendChild(table);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return scroller;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @param {Element} datatableElement
|
|
63
|
+
* @return {HTMLTableElement}
|
|
64
|
+
*/
|
|
65
|
+
export function getTable(datatableElement) {
|
|
66
|
+
if (datatableElement instanceof HTMLTableElement) {
|
|
67
|
+
return datatableElement;
|
|
68
|
+
}
|
|
69
|
+
let table = datatableElement.getElementsByTagName('table')[0];
|
|
70
|
+
if (!table) {
|
|
71
|
+
const scroller = getScroller(datatableElement);
|
|
72
|
+
table = document.createElement('table');
|
|
73
|
+
scroller.appendChild(table);
|
|
74
|
+
}
|
|
75
|
+
return table;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @param {Element} datatableElement
|
|
80
|
+
* @return {HTMLTableSectionElement}
|
|
81
|
+
*/
|
|
82
|
+
export function getTableBody(datatableElement) {
|
|
83
|
+
let tbody = datatableElement.getElementsByTagName('tbody')[0];
|
|
84
|
+
if (!tbody) {
|
|
85
|
+
const table = getTable(datatableElement);
|
|
86
|
+
tbody = document.createElement('tbody');
|
|
87
|
+
table.appendChild(tbody);
|
|
88
|
+
}
|
|
89
|
+
return tbody;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @param {Element} datatableElement
|
|
94
|
+
* @param {number} columnIndex
|
|
95
|
+
* @param {boolean} ascending
|
|
96
|
+
* @return {void}
|
|
97
|
+
*/
|
|
98
|
+
export function sortColumn(datatableElement, columnIndex, ascending = true) {
|
|
99
|
+
if (datatableElement.hasAttribute('mdw-datatable-adapter')) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
iterateArrayLike(datatableElement.getElementsByTagName('th'), (th) => {
|
|
103
|
+
if (th.cellIndex === columnIndex) {
|
|
104
|
+
th.setAttribute('aria-sort', ascending ? 'ascending' : 'descending');
|
|
105
|
+
} else if (th.hasAttribute('aria-sort')) {
|
|
106
|
+
th.setAttribute('aria-sort', 'none');
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
/** @type {HTMLTableSectionElement} */
|
|
111
|
+
const tbody = getTableBody(datatableElement);
|
|
112
|
+
const rows = [];
|
|
113
|
+
for (let i = tbody.rows.length - 1; i >= 0; i -= 1) {
|
|
114
|
+
rows.push(tbody.rows.item(i));
|
|
115
|
+
tbody.deleteRow(i);
|
|
116
|
+
}
|
|
117
|
+
rows.sort((a, b) => {
|
|
118
|
+
const aCell = a.cells.item(columnIndex);
|
|
119
|
+
const bCell = b.cells.item(columnIndex);
|
|
120
|
+
const aText = aCell.textContent;
|
|
121
|
+
const bText = bCell.textContent;
|
|
122
|
+
if (aCell.dataset.type === 'number') {
|
|
123
|
+
return parseFloat(bText) - parseFloat(aText);
|
|
124
|
+
}
|
|
125
|
+
return bText.localeCompare(aText);
|
|
126
|
+
});
|
|
127
|
+
if (ascending) {
|
|
128
|
+
rows.reverse();
|
|
129
|
+
}
|
|
130
|
+
const fragment = document.createDocumentFragment();
|
|
131
|
+
rows.forEach((row) => {
|
|
132
|
+
fragment.appendChild(row);
|
|
133
|
+
});
|
|
134
|
+
tbody.appendChild(fragment);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @param {CustomEvent} event
|
|
139
|
+
* @return {void}
|
|
140
|
+
*/
|
|
141
|
+
export function onItemFocus(event) {
|
|
142
|
+
/** @type {HTMLElement} */
|
|
143
|
+
const datatableElement = (event.currentTarget);
|
|
144
|
+
const onFocusInteraction = datatableElement.getAttribute('mdw-on-focus');
|
|
145
|
+
if (!onFocusInteraction) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
/** @type {HTMLElement} */
|
|
149
|
+
const itemElement = (event.target);
|
|
150
|
+
if (itemElement.getAttribute('aria-disabled') === 'true') {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
onFocusInteraction.split(' ').forEach((interaction) => {
|
|
154
|
+
switch (interaction) {
|
|
155
|
+
case 'select':
|
|
156
|
+
if (itemElement instanceof HTMLTableRowElement) {
|
|
157
|
+
DataTableRow.setSelected(itemElement, true);
|
|
158
|
+
} else {
|
|
159
|
+
DataTableCell.setSelected(itemElement, true);
|
|
160
|
+
}
|
|
161
|
+
break;
|
|
162
|
+
default:
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @param {CustomEvent} event
|
|
169
|
+
* @return {void}
|
|
170
|
+
*/
|
|
171
|
+
export function onSort(event) {
|
|
172
|
+
/** @type {HTMLElement} */
|
|
173
|
+
const datatableElement = (event.currentTarget);
|
|
174
|
+
/** @type {HTMLTableHeaderCellElement} */
|
|
175
|
+
const cell = (event.target);
|
|
176
|
+
sortColumn(datatableElement, cell.cellIndex, event.detail.sort === 'ascending');
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @param {CustomEvent} event
|
|
181
|
+
* @return {void}
|
|
182
|
+
*/
|
|
183
|
+
export function onRowHeaderCheckedChange(event) {
|
|
184
|
+
/** @type {HTMLTableHeaderCellElement} */
|
|
185
|
+
const cell = (event.target);
|
|
186
|
+
const row = cell.parentElement;
|
|
187
|
+
DataTableRow.setSelected(row, event.detail.value);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @param {Event} event
|
|
192
|
+
* @return {void}
|
|
193
|
+
*/
|
|
194
|
+
function onTabIndexZeroed(event) {
|
|
195
|
+
/** @type {HTMLElement} */
|
|
196
|
+
const dataTableElement = (event.currentTarget);
|
|
197
|
+
/** @type {HTMLElement} */
|
|
198
|
+
const emitter = (event.target);
|
|
199
|
+
|
|
200
|
+
const row = (emitter instanceof HTMLTableRowElement && emitter);
|
|
201
|
+
const cell = (!row && emitter instanceof HTMLTableCellElement && emitter);
|
|
202
|
+
if (!row && !cell) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
event.stopPropagation();
|
|
206
|
+
RovingTabIndex.removeTabIndex(dataTableElement.querySelectorAll(row ? 'tr' : CELL_TABINDEX_QUERIES.join(',')), [emitter]);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* @param {CustomEvent} event
|
|
211
|
+
* @return {void}
|
|
212
|
+
*/
|
|
213
|
+
export function onKeyboard(event) {
|
|
214
|
+
/** @type {HTMLElement} */
|
|
215
|
+
const dataTableElement = (event.currentTarget);
|
|
216
|
+
/** @type {HTMLElement} */
|
|
217
|
+
const emitter = (event.target);
|
|
218
|
+
let current = document.activeElement;
|
|
219
|
+
|
|
220
|
+
let row = (emitter instanceof HTMLTableRowElement && emitter);
|
|
221
|
+
const cell = (!row && emitter instanceof HTMLTableCellElement && emitter);
|
|
222
|
+
if (!row && !cell) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (!row) {
|
|
226
|
+
/** @type {HTMLTableRowElement} */
|
|
227
|
+
row = (cell.parentElement);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
let checkNavKeys = false;
|
|
231
|
+
switch (event.type) {
|
|
232
|
+
case Keyboard.SPACEBAR_KEY:
|
|
233
|
+
if (event.detail.ctrlKey || event.detail.altKey || event.detail.metaKey) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
if (!event.detail.shiftKey) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if (!row.hasAttribute('aria-selected')) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
DataTableRow.setSelected(row, row.getAttribute('aria-selected') !== 'true', true);
|
|
243
|
+
break;
|
|
244
|
+
default:
|
|
245
|
+
checkNavKeys = true;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (checkNavKeys) {
|
|
249
|
+
// Keyboard Navigation
|
|
250
|
+
/** @type {ArrayLike<HTMLElement>} */
|
|
251
|
+
let searchElements;
|
|
252
|
+
let reverse = false;
|
|
253
|
+
let loop = false;
|
|
254
|
+
switch (event.type) {
|
|
255
|
+
case Keyboard.UP_ARROW_KEY:
|
|
256
|
+
reverse = true;
|
|
257
|
+
// eslint-disable-next-line no-fallthrough
|
|
258
|
+
case Keyboard.DOWN_ARROW_KEY:
|
|
259
|
+
if (event.detail.ctrlKey || event.detail.altKey || event.detail.metaKey) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (cell) {
|
|
263
|
+
searchElements = getTableBody(dataTableElement).querySelectorAll(
|
|
264
|
+
CELL_TABINDEX_QUERIES.map((q) => `${q}:nth-child(${cell.cellIndex + 1})`).join(','),
|
|
265
|
+
);
|
|
266
|
+
} else {
|
|
267
|
+
searchElements = getTableBody(dataTableElement).getElementsByTagName('tr');
|
|
268
|
+
}
|
|
269
|
+
break;
|
|
270
|
+
case Keyboard.BACK_ARROW_KEY:
|
|
271
|
+
reverse = true;
|
|
272
|
+
// eslint-disable-next-line no-fallthrough
|
|
273
|
+
case Keyboard.FORWARD_ARROW_KEY:
|
|
274
|
+
if (event.detail.ctrlKey || event.detail.altKey || event.detail.metaKey) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
if (!cell) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
searchElements = cell.parentElement.querySelectorAll(CELL_TABINDEX_QUERIES.join(','));
|
|
281
|
+
break;
|
|
282
|
+
case Keyboard.END_KEY:
|
|
283
|
+
reverse = true;
|
|
284
|
+
// eslint-disable-next-line no-fallthrough
|
|
285
|
+
case Keyboard.HOME_KEY:
|
|
286
|
+
if (event.detail.altKey || event.detail.metaKey) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
if (!cell) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
if (event.detail.ctrlKey) {
|
|
293
|
+
searchElements = getTableBody(dataTableElement).querySelectorAll(CELL_TABINDEX_QUERIES.join(','));
|
|
294
|
+
} else {
|
|
295
|
+
searchElements = cell.parentElement.querySelectorAll(CELL_TABINDEX_QUERIES.join(','));
|
|
296
|
+
}
|
|
297
|
+
cell.setAttribute('tabindex', '-1');
|
|
298
|
+
current = null;
|
|
299
|
+
loop = true;
|
|
300
|
+
break;
|
|
301
|
+
default:
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
RovingTabIndex.selectNext(searchElements, current, loop, reverse);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
event.preventDefault();
|
|
308
|
+
event.stopPropagation();
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* @param {Element} element
|
|
313
|
+
* @return {void}
|
|
314
|
+
*/
|
|
315
|
+
export function detach(element) {
|
|
316
|
+
element.removeAttribute('mdw-datatable-js');
|
|
317
|
+
element.removeEventListener(DataTableRow.FOCUS_EVENT, onItemFocus);
|
|
318
|
+
element.removeEventListener(DataTableCell.FOCUS_EVENT, onItemFocus);
|
|
319
|
+
element.removeEventListener(DataTableColumnHeader.SORT_EVENT, onSort);
|
|
320
|
+
element.removeEventListener(Keyboard.UP_ARROW_KEY, onKeyboard);
|
|
321
|
+
element.removeEventListener(Keyboard.DOWN_ARROW_KEY, onKeyboard);
|
|
322
|
+
element.removeEventListener(Keyboard.FORWARD_ARROW_KEY, onKeyboard);
|
|
323
|
+
element.removeEventListener(Keyboard.BACK_ARROW_KEY, onKeyboard);
|
|
324
|
+
element.removeEventListener(Keyboard.HOME_KEY, onKeyboard);
|
|
325
|
+
element.removeEventListener(Keyboard.END_KEY, onKeyboard);
|
|
326
|
+
element.removeEventListener(RovingTabIndex.TABINDEX_ZEROED, onTabIndexZeroed);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @param {Element} tableElement
|
|
331
|
+
* @return {HTMLTableRowElement}
|
|
332
|
+
*/
|
|
333
|
+
export function getHeaderRow(tableElement) {
|
|
334
|
+
let thead = tableElement.getElementsByTagName('thead')[0];
|
|
335
|
+
if (!thead) {
|
|
336
|
+
const table = getTable(tableElement);
|
|
337
|
+
thead = document.createElement('thead');
|
|
338
|
+
table.appendChild(thead);
|
|
339
|
+
}
|
|
340
|
+
let headerRow = thead.getElementsByTagName('tr')[0];
|
|
341
|
+
if (!headerRow) {
|
|
342
|
+
headerRow = document.createElement('tr');
|
|
343
|
+
thead.appendChild(headerRow);
|
|
344
|
+
}
|
|
345
|
+
return headerRow;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* @param {Element} element
|
|
350
|
+
* @return {void}
|
|
351
|
+
*/
|
|
352
|
+
export function attach(element) {
|
|
353
|
+
element.setAttribute('mdw-datatable-js', '');
|
|
354
|
+
|
|
355
|
+
const table = getTable(element);
|
|
356
|
+
table.setAttribute('role', 'grid');
|
|
357
|
+
const headerRow = getHeaderRow(element);
|
|
358
|
+
const tbody = getTableBody(element);
|
|
359
|
+
|
|
360
|
+
iterateArrayLike(headerRow.getElementsByTagName('th'), DataTableColumnHeader.attach);
|
|
361
|
+
iterateArrayLike(tbody.getElementsByTagName('th'), DataTableRowHeader.attach);
|
|
362
|
+
|
|
363
|
+
const tableRows = tbody.getElementsByTagName('tr');
|
|
364
|
+
iterateArrayLike(tableRows, DataTableRow.attach);
|
|
365
|
+
|
|
366
|
+
const rowFocusable = element.hasAttribute('mdw-row-focusable');
|
|
367
|
+
if (rowFocusable) {
|
|
368
|
+
RovingTabIndex.setupTabIndexes(tableRows);
|
|
369
|
+
}
|
|
370
|
+
const cellFocusable = element.hasAttribute('mdw-cell-focusable');
|
|
371
|
+
if (cellFocusable) {
|
|
372
|
+
RovingTabIndex.setupTabIndexes(tbody.querySelectorAll(CELL_TABINDEX_QUERIES.join(',')));
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
element.addEventListener(DataTableRow.FOCUS_EVENT, onItemFocus);
|
|
376
|
+
element.addEventListener(DataTableRow.SELECTED_CHANGE_EVENT, onSelectedChange);
|
|
377
|
+
element.addEventListener(DataTableCell.FOCUS_EVENT, onItemFocus);
|
|
378
|
+
element.addEventListener(DataTableCell.SELECTED_CHANGE_EVENT, onSelectedChange);
|
|
379
|
+
element.addEventListener(DataTableColumnHeader.SORT_EVENT, onSort);
|
|
380
|
+
element.addEventListener(Keyboard.SPACEBAR_KEY, onKeyboard);
|
|
381
|
+
element.addEventListener(Keyboard.UP_ARROW_KEY, onKeyboard);
|
|
382
|
+
element.addEventListener(Keyboard.DOWN_ARROW_KEY, onKeyboard);
|
|
383
|
+
element.addEventListener(Keyboard.FORWARD_ARROW_KEY, onKeyboard);
|
|
384
|
+
element.addEventListener(Keyboard.BACK_ARROW_KEY, onKeyboard);
|
|
385
|
+
element.addEventListener(Keyboard.HOME_KEY, onKeyboard);
|
|
386
|
+
element.addEventListener(Keyboard.END_KEY, onKeyboard);
|
|
387
|
+
element.addEventListener(RovingTabIndex.TABINDEX_ZEROED, onTabIndexZeroed);
|
|
388
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as Attributes from '../../core/aria/attributes.js';
|
|
2
|
+
import * as Keyboard from '../../core/aria/keyboard.js';
|
|
3
|
+
import { dispatchDomEvent, iterateArrayLike } from '../../core/dom.js';
|
|
4
|
+
|
|
5
|
+
import * as DataTableCell from './cell.js';
|
|
6
|
+
|
|
7
|
+
export const FOCUS_EVENT = 'mdw:datatablerow-focus';
|
|
8
|
+
export const SELECTED_CHANGE_EVENT = 'mdw:datatablerow-selectedchange';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {FocusEvent} event
|
|
12
|
+
* @return {void}
|
|
13
|
+
*/
|
|
14
|
+
export function onFocus(event) {
|
|
15
|
+
/** @type {HTMLTableRowElement} */
|
|
16
|
+
const rowElement = (event.currentTarget);
|
|
17
|
+
dispatchDomEvent(rowElement, FOCUS_EVENT);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param {Element} element
|
|
22
|
+
* @param {string|boolean} value
|
|
23
|
+
* @param {boolean} [dispatchEvent=true]
|
|
24
|
+
* @return {boolean} successful
|
|
25
|
+
*/
|
|
26
|
+
export function setSelected(element, value, dispatchEvent = true) {
|
|
27
|
+
return Attributes.setSelected(element, value, dispatchEvent ? SELECTED_CHANGE_EVENT : null);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @param {HTMLTableRowElement} element
|
|
32
|
+
* @return {void}
|
|
33
|
+
*/
|
|
34
|
+
export function attach(element) {
|
|
35
|
+
Keyboard.attach(element);
|
|
36
|
+
element.setAttribute('role', 'row');
|
|
37
|
+
element.addEventListener('focus', onFocus);
|
|
38
|
+
iterateArrayLike(element.cells, DataTableCell.attach);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @param {HTMLTableRowElement} element
|
|
43
|
+
* @return {void}
|
|
44
|
+
*/
|
|
45
|
+
export function detach(element) {
|
|
46
|
+
element.removeEventListener('focus', onFocus);
|
|
47
|
+
Keyboard.detach(element);
|
|
48
|
+
iterateArrayLike(element.cells, DataTableCell.detach);
|
|
49
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as Keyboard from '../../core/aria/keyboard.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @param {HTMLTableHeaderCellElement} element
|
|
5
|
+
* @return {void}
|
|
6
|
+
*/
|
|
7
|
+
export function attach(element) {
|
|
8
|
+
Keyboard.attach(element);
|
|
9
|
+
element.setAttribute('role', 'rowheader');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {HTMLTableHeaderCellElement} element
|
|
14
|
+
* @return {void}
|
|
15
|
+
*/
|
|
16
|
+
export function detach(element) {
|
|
17
|
+
Keyboard.detach(element);
|
|
18
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
// https://material.io/guidelines/components/dialogs.html
|
|
2
|
+
// https://material.io/guidelines/motion/choreography.html#choreography-creation
|
|
3
|
+
|
|
4
|
+
@use '../../core/_elevation.scss' as elevation;
|
|
5
|
+
@use '../../core/_length.scss' as *;
|
|
6
|
+
@use '../../core/_motion.scss' as motion;
|
|
7
|
+
@use '../../core/_type.scss' as type;
|
|
8
|
+
|
|
9
|
+
$unitWidth: dp(56) !default;
|
|
10
|
+
|
|
11
|
+
.mdw-dialog__close {
|
|
12
|
+
position: absolute;
|
|
13
|
+
top: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
// Scroll mask
|
|
16
|
+
-ms-overflow-style: none;
|
|
17
|
+
overflow-y: scroll;
|
|
18
|
+
overscroll-behavior: none;
|
|
19
|
+
overscroll-behavior: contain;
|
|
20
|
+
-ms-scroll-chaining: none;
|
|
21
|
+
scrollbar-width: none;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
height: 100%;
|
|
25
|
+
width: 100%;
|
|
26
|
+
|
|
27
|
+
cursor: default;
|
|
28
|
+
-webkit-tap-highlight-color: transparent;
|
|
29
|
+
|
|
30
|
+
pointer-events: inherit;
|
|
31
|
+
visibility: hidden;
|
|
32
|
+
z-index: 8;
|
|
33
|
+
|
|
34
|
+
// Hide scrollbar
|
|
35
|
+
&::-webkit-scrollbar {
|
|
36
|
+
display: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&::after {
|
|
40
|
+
display: block;
|
|
41
|
+
content: '';
|
|
42
|
+
|
|
43
|
+
height: 200%;
|
|
44
|
+
width: 200%;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.mdw-dialog {
|
|
49
|
+
display: flex;
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 0;
|
|
52
|
+
left: 0;
|
|
53
|
+
align-items: center;
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
|
|
57
|
+
box-sizing: border-box;
|
|
58
|
+
height: 100%;
|
|
59
|
+
width: 100%;
|
|
60
|
+
padding: dp(84) dp(40);
|
|
61
|
+
|
|
62
|
+
transition-duration: motion.$fadeOutDuration;
|
|
63
|
+
transition-property: opacity;
|
|
64
|
+
transition-timing-function: motion.$accelerateEasing;
|
|
65
|
+
will-change: opacity;
|
|
66
|
+
|
|
67
|
+
opacity: 0;
|
|
68
|
+
pointer-events: none;
|
|
69
|
+
|
|
70
|
+
z-index: 24;
|
|
71
|
+
|
|
72
|
+
background-color: rgba(0, 0, 0, 0.50);
|
|
73
|
+
|
|
74
|
+
&:not([aria-hidden]) {
|
|
75
|
+
// Initial state
|
|
76
|
+
transition: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@for $i from 3 to 8 {
|
|
80
|
+
&[mdw-width-units="#{$i}"] {
|
|
81
|
+
.mdw-dialog__popup {
|
|
82
|
+
min-width: #{$unitWidth * $i};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.mdw-dialog__popup {
|
|
89
|
+
display: none;
|
|
90
|
+
position: relative;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
overflow-y: auto;
|
|
93
|
+
-webkit-overflow-scrolling: touch;
|
|
94
|
+
|
|
95
|
+
overscroll-behavior: none;
|
|
96
|
+
overscroll-behavior: contain;
|
|
97
|
+
-ms-scroll-chaining: none;
|
|
98
|
+
|
|
99
|
+
max-height: 100%;
|
|
100
|
+
min-width: dp(224);
|
|
101
|
+
max-width: 100%;
|
|
102
|
+
flex-shrink: 1;
|
|
103
|
+
|
|
104
|
+
will-change: display, transform;
|
|
105
|
+
|
|
106
|
+
transform: scale(1);
|
|
107
|
+
transform-origin: bottom center;
|
|
108
|
+
z-index: 24;
|
|
109
|
+
|
|
110
|
+
border-radius: dp(4);
|
|
111
|
+
box-shadow: elevation.boxShadow(24);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.mdw-dialog[aria-hidden="false"],
|
|
115
|
+
.mdw-dialog[id]:target {
|
|
116
|
+
transition-duration: motion.$fadeInDuration;
|
|
117
|
+
transition-property: opacity;
|
|
118
|
+
transition-timing-function: motion.$decelerateEasing;
|
|
119
|
+
|
|
120
|
+
opacity: 1;
|
|
121
|
+
pointer-events: auto;
|
|
122
|
+
|
|
123
|
+
.mdw-dialog__close {
|
|
124
|
+
visibility: visible;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.mdw-dialog__popup {
|
|
128
|
+
animation-name: scaleUpAnimation;
|
|
129
|
+
animation-duration: motion.$fadeInDuration;
|
|
130
|
+
animation-direction: forwards;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&:not([mdw-dialog-js]) .mdw-dialog__popup {
|
|
134
|
+
display: flex;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@keyframes scaleUpAnimation {
|
|
139
|
+
from {
|
|
140
|
+
transform: scale(0);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
to {
|
|
144
|
+
transform: scale(1);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.mdw-dialog__title {
|
|
149
|
+
@include type.textTopToTop(20);
|
|
150
|
+
@include type.addRules('h6');
|
|
151
|
+
@include type.baselineToBottom(36);
|
|
152
|
+
|
|
153
|
+
margin-bottom: dp(-36);
|
|
154
|
+
padding: 0 dp(24);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.mdw-dialog__body {
|
|
158
|
+
@include type.textTopToTop(20);
|
|
159
|
+
@include type.addRules('body');
|
|
160
|
+
@include type.baselineToBottom(28);
|
|
161
|
+
|
|
162
|
+
padding: 0 dp(24);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.mdw-dialog__header {
|
|
166
|
+
min-height: dp(64);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.mdw-dialog__scrolling {
|
|
170
|
+
overflow-y: auto;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.mdw-dialog__button-area {
|
|
174
|
+
display: flex;
|
|
175
|
+
flex-direction: row-reverse;
|
|
176
|
+
flex-wrap: wrap;
|
|
177
|
+
justify-content: flex-start;
|
|
178
|
+
|
|
179
|
+
flex: none;
|
|
180
|
+
margin-top: dp(8);
|
|
181
|
+
margin-bottom: dp(8);
|
|
182
|
+
|
|
183
|
+
&[mdw-stacked] {
|
|
184
|
+
margin-top: 0;
|
|
185
|
+
|
|
186
|
+
.mdw-button {
|
|
187
|
+
justify-content: flex-end;
|
|
188
|
+
|
|
189
|
+
min-height: dp(48);
|
|
190
|
+
flex-basis: 100%;
|
|
191
|
+
margin-right: 0;
|
|
192
|
+
padding-right: dp(16);
|
|
193
|
+
padding-left: dp(16);
|
|
194
|
+
|
|
195
|
+
&,
|
|
196
|
+
:root[dir="rtl"] & {
|
|
197
|
+
margin-left: 0;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.mdw-button {
|
|
203
|
+
margin-right: dp(8);
|
|
204
|
+
margin-left: 0;
|
|
205
|
+
|
|
206
|
+
text-align: end;
|
|
207
|
+
|
|
208
|
+
:root[dir="rtl"] & {
|
|
209
|
+
margin-right: 0;
|
|
210
|
+
margin-left: dp(8);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
File without changes
|