@shortfuse/materialdesignweb 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +136 -30
- package/.stylelintrc.json +6 -40
- package/.vscode/launch.json +20 -5
- package/CHANGELOG.md +24 -0
- package/README.md +12 -9
- package/adapters/datatable/column.js +82 -74
- package/adapters/datatable/index.js +173 -131
- package/adapters/dom/index.js +529 -75
- package/adapters/list/index.js +25 -12
- package/adapters/search/index.js +13 -13
- package/components/appbar/_spec.scss +87 -64
- package/components/appbar/index.scss +2 -2
- package/components/banner/_spec.scss +8 -8
- package/components/banner/index.scss +2 -2
- package/components/bottomnav/_spec.scss +22 -17
- package/components/bottomnav/index.js +61 -52
- package/components/bottomnav/index.scss +2 -2
- package/components/bottomnav/item.js +44 -25
- package/components/button/README.md +14 -14
- package/components/button/_spec.scss +23 -22
- package/components/button/_theme.scss +37 -21
- package/components/button/index.eta +32 -0
- package/components/button/index.js +12 -12
- package/components/button/index.scss +2 -2
- package/components/card/_spec.scss +40 -36
- package/components/card/index.scss +2 -2
- package/components/chip/_spec.scss +7 -8
- package/components/chip/_theme.scss +31 -31
- package/components/chip/index.js +3 -2
- package/components/chip/index.scss +2 -2
- package/components/chip/item.js +1 -16
- package/components/datatable/_spec.scss +71 -85
- package/components/datatable/_theme.scss +61 -156
- package/components/datatable/cell.js +45 -0
- package/components/datatable/columnheader.js +47 -0
- package/components/datatable/index.js +279 -366
- package/components/datatable/index.scss +2 -2
- package/components/datatable/row.js +49 -0
- package/components/datatable/rowheader.js +18 -0
- package/components/dialog/_spec.scss +61 -41
- package/components/dialog/index.js +325 -297
- package/components/dialog/index.scss +2 -2
- package/components/divider/_spec.scss +8 -6
- package/components/divider/index.scss +2 -2
- package/components/elevation/_spec.scss +2 -2
- package/components/elevation/index.scss +2 -2
- package/components/fab/_spec.scss +23 -24
- package/components/fab/index.js +50 -50
- package/components/fab/index.scss +2 -2
- package/components/grid/_spec.scss +33 -31
- package/components/grid/index.scss +2 -2
- package/components/layout/_mixins.scss +5 -5
- package/components/layout/_spec.scss +206 -176
- package/components/layout/_theme.scss +14 -16
- package/components/layout/index.js +181 -153
- package/components/layout/index.scss +2 -2
- package/components/list/_spec.scss +117 -104
- package/components/list/_theme.scss +31 -34
- package/components/list/content.js +68 -52
- package/components/list/index.js +194 -61
- package/components/list/index.scss +2 -2
- package/components/list/item.js +136 -12
- package/components/list/secondary.js +46 -0
- package/components/menu/_spec.scss +32 -19
- package/components/menu/index.js +242 -229
- package/components/menu/index.scss +2 -2
- package/components/menu/item.js +95 -110
- package/components/progress/_spec.scss +35 -27
- package/components/progress/index.js +21 -0
- package/components/progress/index.scss +2 -1
- package/components/selection/_spec.scss +242 -224
- package/components/selection/_theme.scss +100 -95
- package/components/selection/index.eta +60 -0
- package/components/selection/index.js +76 -0
- package/components/selection/index.pug +15 -8
- package/components/selection/index.scss +2 -2
- package/components/selection/input.js +56 -0
- package/components/selection/radiogroup.js +47 -0
- package/components/slider/_spec.scss +10 -8
- package/components/slider/index.scss +2 -2
- package/components/snackbar/_spec.scss +22 -21
- package/components/snackbar/index.js +102 -111
- package/components/snackbar/index.scss +2 -2
- package/components/tab/_spec.scss +20 -19
- package/components/tab/content.js +41 -40
- package/components/tab/index.js +192 -99
- package/components/tab/index.scss +2 -2
- package/components/tab/item.js +38 -55
- package/components/tab/list.js +96 -72
- package/components/tab/panel.js +12 -13
- package/components/template/_theme.scss +11 -11
- package/components/textfield/_mixins.scss +52 -0
- package/components/textfield/_spec.scss +215 -266
- package/components/textfield/_theme.scss +95 -72
- package/components/textfield/index.eta +74 -0
- package/components/textfield/index.js +63 -57
- package/components/textfield/index.scss +2 -2
- package/components/tooltip/_spec.scss +27 -25
- package/components/tooltip/index.scss +2 -2
- package/components/type/_spec.scss +51 -38
- package/components/type/index.scss +2 -2
- package/core/_breakpoint.scss +75 -91
- package/core/_elevation.scss +10 -10
- package/core/_length.scss +9 -0
- package/core/_motion.scss +14 -14
- package/core/_platform.scss +9 -15
- package/core/_type.scss +33 -32
- package/core/aria/attributes.js +125 -25
- package/core/aria/button.js +23 -23
- package/core/aria/keyboard.js +93 -0
- package/core/aria/rovingtabindex.js +69 -154
- package/core/aria/tab.js +31 -28
- package/core/color/_theme.scss +240 -280
- package/core/color/index.scss +2 -2
- package/core/document/index.js +39 -0
- package/core/dom.js +12 -12
- package/core/overlay/_spec.scss +0 -3
- package/core/overlay/_theme.scss +56 -74
- package/core/overlay/index.js +49 -18
- package/core/overlay/index.scss +2 -2
- package/core/ripple/_spec.scss +22 -39
- package/core/ripple/_theme.scss +13 -13
- package/core/ripple/index.js +137 -134
- package/core/ripple/index.scss +2 -2
- package/core/theme/_config.scss +2 -0
- package/core/theme/_mixins.scss +172 -0
- package/core/theme/_palettes.scss +155 -135
- package/core/theme/_variables.scss +24 -15
- package/core/theme/index.js +50 -0
- package/core/throttler.js +1 -1
- package/core/transition/index.js +36 -20
- package/{docs-src → docs}/_flex.scss +0 -0
- package/{docs-src → docs}/_menuoptions.js +21 -34
- package/{docs-src → docs}/_mixins.pug +39 -26
- package/docs/_partials/_androidnavbar.eta +5 -0
- package/docs/_partials/_androidstatusbar.eta +13 -0
- package/docs/_partials/_appbar.eta +29 -0
- package/docs/_partials/_buttontest.eta +31 -0
- package/docs/_partials/_header.eta +149 -0
- package/docs/_partials/_navlistitem.eta +16 -0
- package/docs/_partials/_target.eta +1 -0
- package/{docs-src → docs}/_sample-utils.js +8 -6
- package/{docs-src → docs}/_storage.js +0 -0
- package/{docs-src → docs}/docs.scss +5 -2
- package/docs/index.eta +16 -0
- package/{docs-src → docs}/index.js +0 -0
- package/docs/pages/appbar.eta +114 -0
- package/{docs-src/components → docs/pages}/appbar.js +0 -0
- package/{docs-src/components → docs/pages}/appbar.pug +15 -18
- package/docs/pages/bottomnav.eta +188 -0
- package/{docs-src/components → docs/pages}/bottomnav.js +23 -24
- package/{docs-src/components → docs/pages}/bottomnav.pug +4 -4
- package/docs/pages/button.eta +124 -0
- package/{docs-src/components → docs/pages}/button.js +19 -19
- package/{docs-src/components → docs/pages}/button.pug +15 -15
- package/docs/pages/card.eta +90 -0
- package/{docs-src/components → docs/pages}/card.js +3 -3
- package/{docs-src/components → docs/pages}/card.pug +7 -7
- package/docs/pages/chip.eta +122 -0
- package/{docs-src/components → docs/pages}/chip.js +3 -6
- package/{docs-src/components → docs/pages}/chip.pug +2 -2
- package/docs/pages/color.eta +143 -0
- package/{docs-src/core → docs/pages}/color.js +95 -20
- package/docs/pages/color.pug +121 -0
- package/docs/pages/datatable.eta +323 -0
- package/{docs-src/components → docs/pages}/datatable.js +26 -13
- package/docs/pages/datatable.pug +283 -0
- package/docs/pages/dialog.eta +186 -0
- package/{docs-src/components → docs/pages}/dialog.js +26 -13
- package/{docs-src/components → docs/pages}/dialog.pug +46 -28
- package/docs/pages/dom.eta +26 -0
- package/docs/pages/dom.js +143 -0
- package/docs/pages/dom.pug +22 -0
- package/docs/pages/elevation.eta +35 -0
- package/{docs-src/components → docs/pages}/elevation.js +0 -0
- package/{docs-src/components → docs/pages}/elevation.pug +0 -0
- package/docs/pages/fab.eta +99 -0
- package/{docs-src/components → docs/pages}/fab.js +3 -3
- package/{docs-src/components → docs/pages}/fab.pug +2 -2
- package/docs/pages/grid.eta +135 -0
- package/{docs-src/components → docs/pages}/grid.js +1 -1
- package/{docs-src/components → docs/pages}/grid.pug +3 -3
- package/docs/pages/layout.eta +8 -0
- package/{docs-src/components → docs/pages}/layout.js +0 -0
- package/{docs-src/components → docs/pages}/layout.pug +0 -0
- package/docs/pages/list.eta +465 -0
- package/{docs-src/components → docs/pages}/list.js +2 -2
- package/{docs-src/components → docs/pages}/list.pug +7 -14
- package/docs/pages/menu.eta +276 -0
- package/{docs-src/components → docs/pages}/menu.js +14 -10
- package/{docs-src/components → docs/pages}/menu.pug +0 -0
- package/docs/pages/overlay.eta +69 -0
- package/docs/pages/overlay.js +4 -0
- package/{docs-src/core → docs/pages}/overlay.pug +14 -11
- package/docs/pages/progress.eta +23 -0
- package/{docs-src/components → docs/pages}/progress.js +1 -1
- package/{docs-src/components → docs/pages}/progress.pug +1 -1
- package/docs/pages/ripple.eta +27 -0
- package/docs/pages/ripple.js +4 -0
- package/{docs-src/core → docs/pages}/ripple.pug +4 -4
- package/docs/pages/search.eta +246 -0
- package/{docs-src/components → docs/pages}/search.js +59 -42
- package/{docs-src/components → docs/pages}/search.pug +50 -51
- package/docs/pages/selection.eta +111 -0
- package/docs/pages/selection.js +13 -0
- package/docs/pages/selection.pug +74 -0
- package/docs/pages/slider.eta +23 -0
- package/{docs-src/components → docs/pages}/slider.js +0 -0
- package/{docs-src/components → docs/pages}/slider.pug +0 -0
- package/docs/pages/snackbar.eta +83 -0
- package/{docs-src/components → docs/pages}/snackbar.js +3 -3
- package/{docs-src/components → docs/pages}/snackbar.pug +0 -0
- package/docs/pages/tab.eta +421 -0
- package/{docs-src/components → docs/pages}/tab.js +18 -35
- package/{docs-src/components → docs/pages}/tab.pug +4 -4
- package/docs/pages/textfield.eta +486 -0
- package/{docs-src/components → docs/pages}/textfield.js +3 -4
- package/{docs-src/components → docs/pages}/textfield.pug +87 -35
- package/docs/pages/tooltip.eta +94 -0
- package/{docs-src/components → docs/pages}/tooltip.js +0 -0
- package/{docs-src/components → docs/pages}/tooltip.pug +0 -1
- package/docs/pages/transition.eta +117 -0
- package/{docs-src/core → docs/pages}/transition.js +7 -8
- package/{docs-src/core → docs/pages}/transition.pug +0 -0
- package/docs/pages/type.eta +31 -0
- package/{docs-src/components → docs/pages}/type.js +0 -0
- package/{docs-src/components → docs/pages}/type.pug +0 -1
- package/docs/postrender.js +39 -0
- package/{docs-src → docs}/prerender.js +3 -9
- package/docs/pwa/_dialogs.eta +143 -0
- package/docs/pwa/_dialogs.pug +96 -0
- package/docs/pwa/_menus.eta +16 -0
- package/{docs-src → docs}/pwa/_menus.pug +0 -0
- package/docs/pwa/pwa-prerender.js +3 -0
- package/docs/pwa/pwa.eta +480 -0
- package/docs/pwa/pwa.js +306 -0
- package/{docs-src → docs}/pwa/pwa.pug +166 -263
- package/docs/pwa/pwa.scss +26 -0
- package/docs/spec.scss +26 -0
- package/docs/themes/_component-themes.scss +26 -0
- package/docs/themes/theme-colored-fallbacks.scss +17 -0
- package/docs/themes/theme-colored.scss +17 -0
- package/docs/themes/theme-default-fallbacks.scss +17 -0
- package/docs/themes/theme-default.scss +17 -0
- package/jsconfig.json +4 -2
- package/package.json +40 -27
- package/scripts/deploy-docs.sh +9 -0
- package/templates/index.eta +2 -0
- package/utils/function.js +3 -0
- package/webpack.config.cjs +257 -0
- package/_spec.scss +0 -27
- package/_theme.scss +0 -27
- package/components/list/expander.js +0 -142
- package/components/list/itemgroup.js +0 -22
- package/core/theme/_builder.scss +0 -116
- package/core/theme/index.scss +0 -68
- package/docs/appbar.html +0 -1
- package/docs/appbar.min.js +0 -2
- package/docs/appbar.min.js.map +0 -1
- package/docs/bottomnav.html +0 -1
- package/docs/bottomnav.min.js +0 -2
- package/docs/bottomnav.min.js.map +0 -1
- package/docs/button.html +0 -1
- package/docs/button.min.js +0 -2
- package/docs/button.min.js.map +0 -1
- package/docs/card.html +0 -1
- package/docs/card.min.js +0 -2
- package/docs/card.min.js.map +0 -1
- package/docs/chip.html +0 -1
- package/docs/chip.min.js +0 -2
- package/docs/chip.min.js.map +0 -1
- package/docs/color.html +0 -1
- package/docs/color.min.js +0 -2
- package/docs/color.min.js.map +0 -1
- package/docs/datatable.html +0 -1
- package/docs/datatable.min.js +0 -2
- package/docs/datatable.min.js.map +0 -1
- package/docs/default.common.min.js +0 -2
- package/docs/default.common.min.js.map +0 -1
- package/docs/dialog.html +0 -1
- package/docs/dialog.min.js +0 -2
- package/docs/dialog.min.js.map +0 -1
- package/docs/docs.min.css +0 -1
- package/docs/docs.min.js +0 -2
- package/docs/docs.min.js.map +0 -1
- package/docs/elevation.html +0 -1
- package/docs/elevation.min.js +0 -2
- package/docs/elevation.min.js.map +0 -1
- package/docs/fab.html +0 -1
- package/docs/fab.min.js +0 -2
- package/docs/fab.min.js.map +0 -1
- package/docs/grid.html +0 -1
- package/docs/grid.min.js +0 -2
- package/docs/grid.min.js.map +0 -1
- package/docs/index.html +0 -1
- package/docs/index.min.js +0 -2
- package/docs/index.min.js.map +0 -1
- package/docs/ink.html +0 -1
- package/docs/ink.min.js +0 -2
- package/docs/ink.min.js.map +0 -1
- package/docs/layout.html +0 -1
- package/docs/layout.min.js +0 -2
- package/docs/layout.min.js.map +0 -1
- package/docs/list.html +0 -1
- package/docs/list.min.js +0 -2
- package/docs/list.min.js.map +0 -1
- package/docs/menu.html +0 -1
- package/docs/menu.min.js +0 -2
- package/docs/menu.min.js.map +0 -1
- package/docs/overlay.html +0 -1
- package/docs/overlay.min.js +0 -2
- package/docs/overlay.min.js.map +0 -1
- package/docs/prerender.common.min.js +0 -2
- package/docs/prerender.common.min.js.map +0 -1
- package/docs/prerender.min.js +0 -2
- package/docs/prerender.min.js.map +0 -1
- package/docs/progress.html +0 -1
- package/docs/progress.min.js +0 -2
- package/docs/progress.min.js.map +0 -1
- package/docs/pwa-prerender.min.js +0 -2
- package/docs/pwa-prerender.min.js.map +0 -1
- package/docs/pwa.html +0 -11
- package/docs/pwa.min.css +0 -1
- package/docs/pwa.min.js +0 -2
- package/docs/pwa.min.js.map +0 -1
- package/docs/ripple.html +0 -1
- package/docs/ripple.min.js +0 -2
- package/docs/ripple.min.js.map +0 -1
- package/docs/search.html +0 -1
- package/docs/search.min.js +0 -2
- package/docs/search.min.js.map +0 -1
- package/docs/selection.html +0 -1
- package/docs/selection.min.js +0 -2
- package/docs/selection.min.js.map +0 -1
- package/docs/slider.html +0 -1
- package/docs/slider.min.js +0 -2
- package/docs/slider.min.js.map +0 -1
- package/docs/snackbar.html +0 -1
- package/docs/snackbar.min.js +0 -2
- package/docs/snackbar.min.js.map +0 -1
- package/docs/spec.min.css +0 -1
- package/docs/spec.min.js +0 -2
- package/docs/spec.min.js.map +0 -1
- package/docs/surface.html +0 -1
- package/docs/surface.min.js +0 -2
- package/docs/surface.min.js.map +0 -1
- package/docs/tab.html +0 -1
- package/docs/tab.min.js +0 -2
- package/docs/tab.min.js.map +0 -1
- package/docs/textfield.html +0 -2
- package/docs/textfield.min.js +0 -2
- package/docs/textfield.min.js.map +0 -1
- package/docs/theme-colored-fallbacks.min.css +0 -1
- package/docs/theme-colored-fallbacks.min.js +0 -2
- package/docs/theme-colored-fallbacks.min.js.map +0 -1
- package/docs/theme-colored.min.css +0 -1
- package/docs/theme-colored.min.js +0 -2
- package/docs/theme-colored.min.js.map +0 -1
- package/docs/theme-default-fallbacks.min.css +0 -1
- package/docs/theme-default-fallbacks.min.js +0 -2
- package/docs/theme-default-fallbacks.min.js.map +0 -1
- package/docs/theme-default.min.css +0 -1
- package/docs/theme-default.min.js +0 -2
- package/docs/theme-default.min.js.map +0 -1
- package/docs/themes-fallbacks.min.css +0 -1
- package/docs/themes-fallbacks.min.js +0 -2
- package/docs/themes-fallbacks.min.js.map +0 -1
- package/docs/themes.min.css +0 -1
- package/docs/themes.min.js +0 -2
- package/docs/themes.min.js.map +0 -1
- package/docs/tooltip.html +0 -1
- package/docs/tooltip.min.js +0 -2
- package/docs/tooltip.min.js.map +0 -1
- package/docs/transition.html +0 -1
- package/docs/transition.min.js +0 -2
- package/docs/transition.min.js.map +0 -1
- package/docs/type.html +0 -1
- package/docs/type.min.js +0 -2
- package/docs/type.min.js.map +0 -1
- package/docs-src/components/datatable.pug +0 -327
- package/docs-src/components/selection.js +0 -9
- package/docs-src/components/selection.pug +0 -77
- package/docs-src/core/color.pug +0 -201
- package/docs-src/core/overlay.js +0 -4
- package/docs-src/core/ripple.js +0 -4
- package/docs-src/index.pug +0 -9
- package/docs-src/pwa/_dialogs.pug +0 -15
- package/docs-src/pwa/pwa-prerender.js +0 -3
- package/docs-src/pwa/pwa.js +0 -182
- package/docs-src/pwa/pwa.scss +0 -25
- package/docs-src/spec.scss +0 -1
- package/docs-src/themes/theme-colored-fallbacks.scss +0 -14
- package/docs-src/themes/theme-colored.scss +0 -14
- package/docs-src/themes/theme-default-fallbacks.scss +0 -14
- package/docs-src/themes/theme-default.scss +0 -14
- package/index.js +0 -51
- package/index.scss +0 -2
- package/webpack.config.js +0 -187
package/.eslintrc.json
CHANGED
|
@@ -1,47 +1,153 @@
|
|
|
1
1
|
{
|
|
2
|
+
"env": {
|
|
3
|
+
"browser": true
|
|
4
|
+
},
|
|
5
|
+
"ignorePatterns": ["*.min.js"],
|
|
2
6
|
"extends": [
|
|
3
|
-
"airbnb-base"
|
|
7
|
+
"airbnb-base",
|
|
8
|
+
"plugin:@typescript-eslint/recommended",
|
|
9
|
+
"plugin:jsdoc/recommended"
|
|
4
10
|
],
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
+
"parser": "@typescript-eslint/parser",
|
|
12
|
+
"parserOptions": {
|
|
13
|
+
"ecmaFeatures": {
|
|
14
|
+
"impliedStrict": true
|
|
15
|
+
},
|
|
16
|
+
"ecmaVersion": 2020,
|
|
17
|
+
"sourceType": "module"
|
|
11
18
|
},
|
|
19
|
+
"plugins": [
|
|
20
|
+
"jsdoc",
|
|
21
|
+
"@typescript-eslint",
|
|
22
|
+
"eta"
|
|
23
|
+
],
|
|
24
|
+
"root": true,
|
|
12
25
|
"rules": {
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
"@typescript-eslint/ban-ts-comment": ["warn", {
|
|
27
|
+
"ts-ignore": "allow-with-description"
|
|
28
|
+
}],
|
|
29
|
+
"@typescript-eslint/explicit-module-boundary-types": 0,
|
|
30
|
+
"import/extensions": ["error", "always", {
|
|
31
|
+
"js": "always",
|
|
32
|
+
"mjs": "never"
|
|
33
|
+
}],
|
|
34
|
+
"import/no-useless-path-segments": ["error", {
|
|
35
|
+
"noUselessIndex": false
|
|
36
|
+
}],
|
|
37
|
+
"import/order": ["error", {
|
|
38
|
+
"alphabetize": {
|
|
39
|
+
"caseInsensitive": false,
|
|
40
|
+
"order": "asc"
|
|
41
|
+
},
|
|
42
|
+
"groups": [
|
|
43
|
+
"builtin",
|
|
44
|
+
"external",
|
|
45
|
+
"parent",
|
|
46
|
+
"sibling",
|
|
47
|
+
"index"
|
|
48
|
+
],
|
|
49
|
+
"newlines-between": "always",
|
|
50
|
+
"pathGroups": [{
|
|
51
|
+
"group": "external",
|
|
52
|
+
"pattern": "@dataprocs/**",
|
|
53
|
+
"position": "after"
|
|
54
|
+
}],
|
|
55
|
+
"pathGroupsExcludedImportTypes": ["builtin"]
|
|
56
|
+
}],
|
|
57
|
+
"import/prefer-default-export": 0,
|
|
58
|
+
"jsdoc/newline-after-description": [
|
|
59
|
+
"warn",
|
|
60
|
+
"never"
|
|
61
|
+
],
|
|
62
|
+
"jsdoc/no-undefined-types": 0,
|
|
63
|
+
"jsdoc/require-param-description": 0,
|
|
64
|
+
"jsdoc/require-property-description": 0,
|
|
65
|
+
"jsdoc/require-returns": ["warn", {
|
|
66
|
+
"forceRequireReturn": true,
|
|
67
|
+
"forceReturnsWithAsync": true
|
|
68
|
+
}],
|
|
69
|
+
"jsdoc/require-returns-description": 0,
|
|
70
|
+
"jsdoc/valid-types": 0,
|
|
71
|
+
"max-len": ["error", 120, 2, {
|
|
72
|
+
"ignoreComments": true,
|
|
73
|
+
"ignoreRegExpLiterals": true,
|
|
74
|
+
"ignoreStrings": true,
|
|
75
|
+
"ignoreTemplateLiterals": true,
|
|
76
|
+
"ignoreUrls": true
|
|
77
|
+
}],
|
|
78
|
+
"no-console": ["error", {
|
|
79
|
+
"allow": [
|
|
80
|
+
"warn",
|
|
81
|
+
"error",
|
|
82
|
+
"time",
|
|
83
|
+
"timeEnd"
|
|
84
|
+
]
|
|
85
|
+
}],
|
|
86
|
+
"no-plusplus": ["off"],
|
|
87
|
+
"node/no-unsupported-features/es-syntax": ["off", {
|
|
88
|
+
"ignores": [],
|
|
89
|
+
"version": ">=14.0.0"
|
|
33
90
|
}],
|
|
34
91
|
"prefer-destructuring": ["error", {
|
|
35
|
-
"
|
|
92
|
+
"AssignmentExpression": {
|
|
36
93
|
"array": false,
|
|
37
94
|
"object": true
|
|
38
95
|
},
|
|
39
|
-
"
|
|
96
|
+
"VariableDeclarator": {
|
|
40
97
|
"array": false,
|
|
41
98
|
"object": true
|
|
42
99
|
}
|
|
43
100
|
}, {
|
|
44
101
|
"enforceForRenamedProperties": false
|
|
102
|
+
}],
|
|
103
|
+
"sort-imports": ["error", {
|
|
104
|
+
"ignoreDeclarationSort": true
|
|
105
|
+
}],
|
|
106
|
+
"spaced-comment": ["error", "always", {
|
|
107
|
+
"block": {
|
|
108
|
+
"balanced": true,
|
|
109
|
+
"exceptions": ["-", "+"],
|
|
110
|
+
"markers": ["=", "!", ":", "::"]
|
|
111
|
+
},
|
|
112
|
+
"line": {
|
|
113
|
+
"exceptions": ["-", "+"],
|
|
114
|
+
"markers": ["=", "!", "/"]
|
|
115
|
+
}
|
|
45
116
|
}]
|
|
46
|
-
}
|
|
117
|
+
},
|
|
118
|
+
"settings": {
|
|
119
|
+
"jsdoc": {
|
|
120
|
+
"preferredTypes": {
|
|
121
|
+
"array": "Array",
|
|
122
|
+
"object": "Object",
|
|
123
|
+
"object.": "Object<>",
|
|
124
|
+
"object<>": "Object<>",
|
|
125
|
+
"symbol": "Symbol"
|
|
126
|
+
},
|
|
127
|
+
"tagNamePreference": {
|
|
128
|
+
"augment": "extends",
|
|
129
|
+
"constant": "const",
|
|
130
|
+
"property": "prop",
|
|
131
|
+
"returns": "return"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"html/html-extensions": [
|
|
135
|
+
".html",
|
|
136
|
+
".eta"
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
"overrides": [
|
|
140
|
+
{
|
|
141
|
+
"files": [ "*.cjs"],
|
|
142
|
+
"rules": {
|
|
143
|
+
"import/no-nodejs-modules": 0,
|
|
144
|
+
"@typescript-eslint/no-var-requires": 0
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"files": ["**/*.eta"],
|
|
149
|
+
"processor": "eta/eta"
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
|
|
47
153
|
}
|
package/.stylelintrc.json
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"font-family-no-missing-generic-family-keyword": null,
|
|
22
22
|
"color-hex-length": null,
|
|
23
23
|
"color-hex-case": null,
|
|
24
|
-
"selector-nested-pattern": "^(\\s+|((:root|&|[a-z0-9A-Z._-])(\\[[^\\]]*\\])*([^\\s>~+])*)|&::?|[&+~>])*$",
|
|
25
|
-
"no-empty-source":
|
|
24
|
+
"selector-nested-pattern": "^(\\s+|((:root|&|[a-z0-9A-Z._-])(:not\\([^\\)]*\\))*(\\[[^\\]]*\\])*([^\\s>~+])*)|&::?|[&+~>])*$",
|
|
25
|
+
"no-empty-source": null,
|
|
26
26
|
"block-no-empty": true,
|
|
27
27
|
"no-extra-semicolons": true,
|
|
28
28
|
"selector-max-universal": 0,
|
|
@@ -48,47 +48,13 @@
|
|
|
48
48
|
"unit-blacklist": "px",
|
|
49
49
|
"selector-class-pattern": "^mdw-[a-z]+(__[a-z-]+)?$",
|
|
50
50
|
"scss/at-import-no-partial-leading-underscore": null,
|
|
51
|
-
"scss/at-function-pattern": "^
|
|
52
|
-
"scss/at-mixin-pattern": "^
|
|
51
|
+
"scss/at-function-pattern": "^[a-z][a-zA-Z0-9]*$",
|
|
52
|
+
"scss/at-mixin-pattern": "^[a-z][a-zA-Z0-9]*$",
|
|
53
53
|
"scss/dollar-variable-default": [true, {
|
|
54
54
|
"ignore": "local"
|
|
55
55
|
}],
|
|
56
|
-
"scss/dollar-variable-pattern":
|
|
57
|
-
|
|
58
|
-
}],
|
|
59
|
-
"order/order": [
|
|
60
|
-
[
|
|
61
|
-
"dollar-variables",
|
|
62
|
-
"custom-properties",
|
|
63
|
-
{
|
|
64
|
-
"type": "at-rule",
|
|
65
|
-
"name": "extend"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"type": "at-rule",
|
|
69
|
-
"name": "include",
|
|
70
|
-
"hasBlock": false
|
|
71
|
-
},
|
|
72
|
-
"declarations",
|
|
73
|
-
{
|
|
74
|
-
"type": "rule",
|
|
75
|
-
"selector": "^&$"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"type": "rule",
|
|
79
|
-
"selector": "^.+ &$"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"type": "rule",
|
|
83
|
-
"selector": "^&(:[^:]|\\[|-)[\\s]+$"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"type": "rule",
|
|
87
|
-
"selector": "^&::.+"
|
|
88
|
-
},
|
|
89
|
-
"rules"
|
|
90
|
-
]
|
|
91
|
-
],
|
|
56
|
+
"scss/dollar-variable-pattern": "^[a-z][a-zA-Z0-9]*$",
|
|
57
|
+
"order/order": null,
|
|
92
58
|
"order/properties-alphabetical-order": null,
|
|
93
59
|
"order/properties-order": [{
|
|
94
60
|
"groupName": "layout",
|
package/.vscode/launch.json
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "0.2.0",
|
|
3
|
-
"configurations": [
|
|
4
|
-
{
|
|
3
|
+
"configurations": [{
|
|
5
4
|
"name": "Chrome Docs Debug",
|
|
6
5
|
"type": "chrome",
|
|
7
6
|
"request": "launch",
|
|
8
7
|
"preLaunchTask": "npm: start:docs",
|
|
9
8
|
"url": "http://localhost:8080/",
|
|
10
|
-
"webRoot": "${workspaceFolder}/
|
|
9
|
+
"webRoot": "${workspaceFolder}/docs",
|
|
10
|
+
"sourceMapPathOverrides": {
|
|
11
|
+
"webpack:///*": "${webRoot}/*",
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "Chrome Docs Debug (WSL)",
|
|
16
|
+
"type": "chrome",
|
|
17
|
+
"request": "launch",
|
|
18
|
+
"preLaunchTask": "npm: start:docs",
|
|
19
|
+
"url": "http://localhost:8080/",
|
|
20
|
+
"runtimeExecutable": "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
21
|
+
"runtimeArgs": [
|
|
22
|
+
"--remote-debugging-port=9222",
|
|
23
|
+
"--user-data-dir=remote-profile"
|
|
24
|
+
],
|
|
25
|
+
"webRoot": "${workspaceFolder}/docs",
|
|
11
26
|
"sourceMapPathOverrides": {
|
|
12
|
-
"webpack
|
|
27
|
+
"webpack:///*": "${webRoot}/*",
|
|
13
28
|
}
|
|
14
|
-
|
|
29
|
+
},
|
|
15
30
|
]
|
|
16
31
|
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
v0.4.0
|
|
2
|
+
------
|
|
3
|
+
|
|
4
|
+
* Use passive listener for DOMAdapter scrolling
|
|
5
|
+
* Workaround Safari 12 negative vertical-align bug
|
|
6
|
+
* Add `"aria-hidden"` attributes for `.mdw-layout__appbar` and `.mdw-layout__bottomnav`
|
|
7
|
+
* Add `"aria-hidden"` attributes for `.mdw-menu__check` and `.mdw-menu__radio`
|
|
8
|
+
* Create `.mdw-menu__item-group` CSS
|
|
9
|
+
* Ignore case on user agent detection (`Document.onPrerender`)
|
|
10
|
+
* Add `core/theme` helper functions
|
|
11
|
+
|
|
12
|
+
* Deprecate IE11 support
|
|
13
|
+
* Deprecate `.pug`
|
|
14
|
+
|
|
15
|
+
* Refactor SCSS for proper `@use` support
|
|
16
|
+
* Refactor SCSS with `math.div`
|
|
17
|
+
* Add `.eta` templates
|
|
18
|
+
* Target ES2020 for `.js`
|
|
19
|
+
* Proper ES Module support
|
|
20
|
+
* Upgrade dev dependencies
|
|
21
|
+
* `webpack` from `4.x` to `5.x`
|
|
22
|
+
* `webpack-dev-server` from `3.x` to `4.x`
|
|
23
|
+
* `typescript` from `3.9.x` to `4.5.x`
|
|
24
|
+
|
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
*Notice: This project is currently being maintained in an private fork. Changes will be pushed at a later date.*
|
|
2
|
+
|
|
1
3
|
# materialdesignweb
|
|
2
4
|
Material Design for Web
|
|
3
5
|
|
|
@@ -13,6 +15,8 @@ npm: `npm install @shortfuse/materialdesignweb`
|
|
|
13
15
|
|
|
14
16
|
| Module | CSS-Only Support | Description | status
|
|
15
17
|
| :-------- | :-: | :- | :- |
|
|
18
|
+
| [aria](core/aria/) | :x: | Handles ARIA attributes, ARIA roles, tabindexes, and keyboard interaction | preRC
|
|
19
|
+
| [document](core/document/) | :white_check_mark: | Applies color-scheme, standalone-window, and user agents detection | RC
|
|
16
20
|
| [overlay](core/overlay/) | :white_check_mark: | Applies overlay states to components | RC
|
|
17
21
|
| [ripple](core/ripple/) | :white_check_mark: | Applies press ripple on interactions | preRC
|
|
18
22
|
| [theme](core/theme/) | :white_check_mark: | Applies ink and surface colors based on light/dark context | preRC
|
|
@@ -39,16 +43,15 @@ npm: `npm install @shortfuse/materialdesignweb`
|
|
|
39
43
|
| [grid](components/grid/) | | :white_check_mark:| | :x: | :x: | preRC
|
|
40
44
|
| imagelist | | | | | | *use grid*
|
|
41
45
|
| [layout](components/layout/) | | :white_check_mark: | :x: |:x: | :x: | beta
|
|
42
|
-
| [list](components/list/) | listitem† listexpander | :white_check_mark: | :white_check_mark: | list listbox tree | aria-orientation | preRC
|
|
43
|
-
| [listcontent](components/list/content.js) | overlay ripple | :white_check_mark: | :white_check_mark: | listitem link option treeitem | | preRC
|
|
44
|
-
| [
|
|
45
|
-
| [
|
|
46
|
-
| [listitemgroup](components/list/group.js) | | :white_check_mark: | :white_check_mark: | group | | preRC
|
|
46
|
+
| [list](components/list/) | listitem† listexpander | :white_check_mark: | :white_check_mark: | group list listbox radiogroup tree | aria-orientation | preRC
|
|
47
|
+
| [listcontent](components/list/content.js) | overlay ripple | :white_check_mark: | :white_check_mark: | listitem link option radio treeitem | aria-checked aria-selected | preRC
|
|
48
|
+
| [listitem](components/list/item.js) | | :white_check_mark: | :white_check_mark: | treeitem none | aria-expanded aria-hidden | preRC
|
|
49
|
+
| [listsecondary](components/list/secondary.js) | | :white_check_mark: | :white_check_mark: | none‡ | | preRC
|
|
47
50
|
| [menu](components/menu/) | divider menuitem† | :white_check_mark: | :white_check_mark: | menu | aria-hidden | preRC
|
|
48
51
|
| [menuitem](components/menu/item.js) | overlay ripple | :white_check_mark: | :white_check_mark:| menuitem menuitemradio menuitemcheckbox | aria-disabled aria-checked | stable
|
|
49
52
|
| navdrawer | | | | | | *use layout*
|
|
50
53
|
| [progress](components/progress/) | | :white_check_mark:| | :x: | :x: | beta
|
|
51
|
-
| [selection](components/selection/) | | :white_check_mark: | | checkbox‡ radio‡ |
|
|
54
|
+
| [selection](components/selection/) | | :white_check_mark: | :white_check_mark: | checkbox‡ radio‡ | aria-checked aria-disabled | preRC
|
|
52
55
|
| sidesheet | | | | | | *use layout*
|
|
53
56
|
| [slider](components/slider/) | | :white_check_mark: | :x: | :x: | :x: | alpha
|
|
54
57
|
| [snackbar](components/snackbar/) | button | :white_check_mark: | :white_check_mark: | alert | aria-hidden | RC
|
|
@@ -66,14 +69,14 @@ npm: `npm install @shortfuse/materialdesignweb`
|
|
|
66
69
|
| :-------- | :-- | :-
|
|
67
70
|
| [datatable](adapters/datatable/) | button datatable† | preRC
|
|
68
71
|
| [dom](adapters/dom/) | | preRC
|
|
69
|
-
| [list](adapters/list/) | listitem† | preRC
|
|
72
|
+
| [list](adapters/list/) | domadapter† listitem† | preRC
|
|
70
73
|
| [search](adapters/search/) | list† textfield† | preRC
|
|
71
74
|
|
|
72
75
|
## Legend
|
|
73
76
|
|
|
74
77
|
* planned - Planned for later
|
|
75
78
|
* draft - Not yet functional
|
|
76
|
-
* alpha -
|
|
79
|
+
* alpha - Partially working
|
|
77
80
|
* beta - Working but incomplete
|
|
78
81
|
* preRC - Needs minor changes
|
|
79
82
|
* RC - Needs testing as-is
|
|
@@ -82,4 +85,4 @@ npm: `npm install @shortfuse/materialdesignweb`
|
|
|
82
85
|
|
|
83
86
|
* † - Required
|
|
84
87
|
|
|
85
|
-
* ‡ - Apply manually
|
|
88
|
+
* ‡ - Apply manually
|
|
@@ -1,59 +1,77 @@
|
|
|
1
|
+
import * as DataTableColumnHeader from '../../components/datatable/columnheader.js';
|
|
2
|
+
import * as Selection from '../../components/selection/index.js';
|
|
3
|
+
import * as Attributes from '../../core/aria/attributes.js';
|
|
4
|
+
import { setTextNode } from '../../core/dom.js';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
|
-
* @
|
|
3
|
-
* @
|
|
7
|
+
* @template {Record<string, any>} T
|
|
8
|
+
* @template {keyof T & string} K
|
|
9
|
+
* @callback DataTableAdapterColumnFormatter<T,K>
|
|
10
|
+
* @param {T[K]} value
|
|
4
11
|
* @param {T} [object]
|
|
5
12
|
* @return {any}
|
|
6
|
-
* @template T
|
|
7
13
|
*/
|
|
8
14
|
|
|
9
15
|
/**
|
|
10
|
-
* @
|
|
11
|
-
* @
|
|
12
|
-
* @param {
|
|
16
|
+
* @template {Record<string, any>} T
|
|
17
|
+
* @callback DataTableAdapterColumnSorter<T>
|
|
18
|
+
* @param {T} a
|
|
19
|
+
* @param {T} b
|
|
20
|
+
* @return {number}
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @template {Record<string, any>} T
|
|
25
|
+
* @template {keyof T & string} K
|
|
26
|
+
* @callback DataTableAdapterColumnRenderer<T,K>
|
|
27
|
+
* @param {HTMLTableCellElement} cell
|
|
28
|
+
* @param {T[K]} value
|
|
13
29
|
* @param {T} data
|
|
14
30
|
* @return {void}
|
|
15
|
-
* @template T
|
|
16
31
|
*/
|
|
17
32
|
|
|
18
33
|
/**
|
|
19
34
|
* Constructor options for DataTableAdapterColumn
|
|
20
|
-
* @
|
|
21
|
-
* @
|
|
22
|
-
* @
|
|
23
|
-
* @
|
|
24
|
-
* @
|
|
25
|
-
* @
|
|
26
|
-
* @
|
|
27
|
-
* @
|
|
28
|
-
* @
|
|
29
|
-
* @
|
|
30
|
-
* @
|
|
31
|
-
* @
|
|
32
|
-
* @
|
|
33
|
-
* @
|
|
35
|
+
* @template {Record<string, any>} T
|
|
36
|
+
* @template {keyof T & string} K
|
|
37
|
+
* @typedef DataTableAdapterColumnOptions<T,K>
|
|
38
|
+
* @prop {K} key
|
|
39
|
+
* @prop {(string|DocumentFragment)} [name='']
|
|
40
|
+
* @prop {'number'|'text'|'checkbox'} [type]
|
|
41
|
+
* @prop {boolean} [rowSelector]
|
|
42
|
+
* @prop {string} [tooltip]
|
|
43
|
+
* @prop {boolean} [sortable]
|
|
44
|
+
* @prop {boolean} [primaryColumn]
|
|
45
|
+
* @prop {HTMLElement} [customSortIcon]
|
|
46
|
+
* @prop {string} [innerHTML]
|
|
47
|
+
* @prop {DocumentFragment} [fragment]
|
|
48
|
+
* @prop {DataTableAdapterColumnRenderer<T,K>} [renderer]
|
|
49
|
+
* @prop {DataTableAdapterColumnFormatter<T,K>} [formatter]
|
|
50
|
+
* @prop {DataTableAdapterColumnSorter<T>} [sorter]
|
|
34
51
|
*/
|
|
35
52
|
|
|
36
|
-
|
|
37
|
-
/** @return {HTMLLabelElement} */
|
|
53
|
+
/** @return {HTMLElement} */
|
|
38
54
|
function constructTableCheckbox() {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
input
|
|
43
|
-
input.
|
|
55
|
+
const element = document.createElement('div');
|
|
56
|
+
element.className = 'mdw-selection';
|
|
57
|
+
element.setAttribute('aria-checked', 'false');
|
|
58
|
+
const input = document.createElement('div');
|
|
59
|
+
input.className = 'mdw-selection__input mdw-datatable__widget';
|
|
44
60
|
const icon = document.createElement('div');
|
|
45
61
|
icon.className = 'mdw-selection__icon';
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
62
|
+
icon.setAttribute('mdw-checkbox', '');
|
|
63
|
+
element.appendChild(input);
|
|
64
|
+
element.appendChild(icon);
|
|
65
|
+
Selection.attach(element);
|
|
66
|
+
return element;
|
|
49
67
|
}
|
|
50
68
|
|
|
51
|
-
|
|
52
69
|
/**
|
|
53
|
-
* @template T
|
|
70
|
+
* @template {Record<string, any>} T
|
|
71
|
+
* @template {keyof T & string} K
|
|
54
72
|
*/
|
|
55
73
|
export default class DataTableAdapterColumn {
|
|
56
|
-
/** @param {DataTableAdapterColumnOptions<T>} options */
|
|
74
|
+
/** @param {DataTableAdapterColumnOptions<T,K>} options */
|
|
57
75
|
constructor(options) {
|
|
58
76
|
this.element = document.createElement('th');
|
|
59
77
|
if (options.innerHTML != null) {
|
|
@@ -65,10 +83,10 @@ export default class DataTableAdapterColumn {
|
|
|
65
83
|
this.element.dataset.key = options.key;
|
|
66
84
|
|
|
67
85
|
if (options.sortable) {
|
|
68
|
-
this.element.setAttribute('
|
|
86
|
+
this.element.setAttribute('aria-sort', 'none');
|
|
69
87
|
let sortIcon = options.customSortIcon;
|
|
70
88
|
if (!sortIcon) {
|
|
71
|
-
sortIcon = document.createElement('
|
|
89
|
+
sortIcon = document.createElement('span');
|
|
72
90
|
sortIcon.classList.add('mdw-datatable__sort-icon');
|
|
73
91
|
sortIcon.classList.add('material-icons');
|
|
74
92
|
sortIcon.textContent = 'arrow_downward';
|
|
@@ -92,7 +110,9 @@ export default class DataTableAdapterColumn {
|
|
|
92
110
|
target.appendChild(options.name);
|
|
93
111
|
}
|
|
94
112
|
const tooltip = document.createElement('div');
|
|
95
|
-
tooltip.
|
|
113
|
+
tooltip.className = 'mdw-tooltip mdw-theme';
|
|
114
|
+
tooltip.setAttribute('mdw-surface', 'background 700');
|
|
115
|
+
tooltip.setAttribute('mdw-dark', '');
|
|
96
116
|
tooltip.textContent = options.tooltip;
|
|
97
117
|
wrapper.appendChild(target);
|
|
98
118
|
wrapper.appendChild(tooltip);
|
|
@@ -117,13 +137,23 @@ export default class DataTableAdapterColumn {
|
|
|
117
137
|
if (this.rowSelector) {
|
|
118
138
|
this.element.setAttribute('mdw-selector', '');
|
|
119
139
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
140
|
+
|
|
141
|
+
this.type = options.type;
|
|
142
|
+
switch (options.type) {
|
|
143
|
+
case 'number':
|
|
144
|
+
this.element.setAttribute('mdw-number', '');
|
|
145
|
+
break;
|
|
146
|
+
case 'text':
|
|
147
|
+
this.element.setAttribute('mdw-text', '');
|
|
148
|
+
break;
|
|
149
|
+
case 'checkbox':
|
|
150
|
+
default:
|
|
123
151
|
}
|
|
152
|
+
|
|
124
153
|
if (this.rowSelector && this.type === 'checkbox') {
|
|
125
154
|
const checkboxLabel = constructTableCheckbox();
|
|
126
155
|
this.element.appendChild(checkboxLabel);
|
|
156
|
+
this.element.classList.add('mdw-autofocus-widget');
|
|
127
157
|
}
|
|
128
158
|
|
|
129
159
|
if (options.renderer) {
|
|
@@ -133,7 +163,9 @@ export default class DataTableAdapterColumn {
|
|
|
133
163
|
} else {
|
|
134
164
|
this.renderer = DataTableAdapterColumn.defaultCellRenderer;
|
|
135
165
|
}
|
|
136
|
-
this.formatter = options.formatter || (value => value);
|
|
166
|
+
this.formatter = options.formatter || ((/** @type {any} */ value) => value);
|
|
167
|
+
this.sorter = options.sorter;
|
|
168
|
+
DataTableColumnHeader.attach(this.element);
|
|
137
169
|
}
|
|
138
170
|
|
|
139
171
|
/**
|
|
@@ -142,24 +174,16 @@ export default class DataTableAdapterColumn {
|
|
|
142
174
|
* @return {void}
|
|
143
175
|
*/
|
|
144
176
|
static defaultCheckboxRenderer(cell, value) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
if (!input) {
|
|
148
|
-
const checkboxLabel = document.createElement('label');
|
|
149
|
-
checkboxLabel.className = 'mdw-selection';
|
|
150
|
-
input = document.createElement('input');
|
|
151
|
-
input.className = 'mdw-selection__input';
|
|
152
|
-
input.setAttribute('type', 'checkbox');
|
|
153
|
-
input.checked = checked;
|
|
154
|
-
const icon = document.createElement('div');
|
|
155
|
-
icon.className = 'mdw-selection__icon';
|
|
156
|
-
checkboxLabel.appendChild(input);
|
|
157
|
-
checkboxLabel.appendChild(icon);
|
|
158
|
-
cell.appendChild(checkboxLabel);
|
|
177
|
+
if (!cell.classList.contains('mdw-autofocus-widget')) {
|
|
178
|
+
cell.classList.add('mdw-autofocus-widget');
|
|
159
179
|
}
|
|
160
|
-
|
|
161
|
-
|
|
180
|
+
let selectionElement = cell.getElementsByClassName('mdw-selection')[0];
|
|
181
|
+
const checked = !!value;
|
|
182
|
+
if (!selectionElement) {
|
|
183
|
+
selectionElement = constructTableCheckbox();
|
|
184
|
+
cell.appendChild(selectionElement);
|
|
162
185
|
}
|
|
186
|
+
Attributes.setChecked(selectionElement, checked);
|
|
163
187
|
}
|
|
164
188
|
|
|
165
189
|
/**
|
|
@@ -174,22 +198,6 @@ export default class DataTableAdapterColumn {
|
|
|
174
198
|
} else {
|
|
175
199
|
stringValue = value.toString();
|
|
176
200
|
}
|
|
177
|
-
|
|
178
|
-
let foundTextNode = false;
|
|
179
|
-
for (let i = len - 1; i >= 0; i -= 1) {
|
|
180
|
-
const node = cell.childNodes.item(i);
|
|
181
|
-
if (!foundTextNode && node.nodeType === Node.TEXT_NODE) {
|
|
182
|
-
if (node.nodeValue !== stringValue) {
|
|
183
|
-
node.nodeValue = stringValue;
|
|
184
|
-
}
|
|
185
|
-
foundTextNode = true;
|
|
186
|
-
} else {
|
|
187
|
-
cell.removeChild(node);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
if (!foundTextNode) {
|
|
191
|
-
const node = document.createTextNode(stringValue);
|
|
192
|
-
cell.appendChild(node);
|
|
193
|
-
}
|
|
201
|
+
setTextNode(cell, stringValue);
|
|
194
202
|
}
|
|
195
203
|
}
|