@shortfuse/materialdesignweb 0.2.0 → 0.5.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 +2 -1
- package/.eslintrc.json +188 -30
- package/.stylelintrc.json +643 -2
- package/.vscode/launch.json +20 -5
- package/.vscode/settings.json +3 -0
- package/CHANGELOG.md +36 -0
- package/README.md +82 -2
- package/adapters/datatable/column.js +176 -0
- package/adapters/datatable/index.js +253 -437
- package/adapters/dom/index.js +586 -0
- package/adapters/list/index.js +36 -113
- package/adapters/search/index.js +153 -180
- package/components/appbar/_spec.scss +165 -0
- package/components/appbar/_theme.scss +0 -0
- package/components/appbar/index.scss +2 -0
- package/components/banner/_spec.scss +83 -0
- package/components/banner/_theme.scss +0 -0
- package/components/banner/index.scss +2 -0
- package/components/bottomnav/README.md +4 -4
- package/components/bottomnav/_spec.scss +149 -0
- package/components/bottomnav/_theme.scss +0 -0
- package/components/bottomnav/index.js +100 -120
- package/components/bottomnav/index.scss +2 -0
- package/components/bottomnav/item.js +88 -0
- package/components/button/README.md +16 -22
- package/components/button/_spec.scss +162 -0
- package/components/button/_theme.scss +42 -0
- package/components/button/index.eta +32 -0
- package/components/button/index.js +37 -48
- package/components/button/index.pug +18 -0
- package/components/button/index.scss +2 -0
- package/components/card/_spec.scss +241 -0
- package/components/card/_theme.scss +0 -0
- package/components/card/index.scss +2 -0
- package/components/chip/_spec.scss +111 -0
- package/components/chip/_theme.scss +105 -0
- package/components/chip/index.js +23 -0
- package/components/chip/index.scss +2 -0
- package/components/chip/item.js +20 -0
- package/components/datatable/_spec.scss +225 -0
- package/components/datatable/_theme.scss +128 -0
- package/components/datatable/cell.js +44 -0
- package/components/datatable/columnheader.js +46 -0
- package/components/datatable/index.js +339 -443
- package/components/datatable/index.scss +2 -0
- package/components/datatable/row.js +48 -0
- package/components/datatable/rowheader.js +18 -0
- package/components/dialog/_spec.scss +203 -0
- package/components/dialog/_theme.scss +7 -0
- package/components/dialog/index.js +512 -437
- package/components/dialog/index.scss +2 -0
- package/components/divider/_spec.scss +11 -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/{style.scss → _spec.scss} +104 -79
- package/components/fab/_theme.scss +0 -0
- package/components/fab/index.js +85 -79
- package/components/fab/index.scss +2 -0
- package/components/grid/_spec.scss +169 -0
- package/components/grid/_theme.scss +0 -0
- package/components/grid/index.scss +2 -0
- package/components/layout/_mixins.scss +11 -0
- package/components/layout/_spec.scss +916 -0
- package/components/layout/_theme.scss +19 -0
- package/components/layout/index.js +454 -0
- package/components/layout/index.scss +2 -0
- package/components/list/_spec.scss +363 -0
- package/components/list/_theme.scss +102 -0
- package/components/list/content.js +106 -0
- package/components/list/index.js +234 -79
- package/components/list/index.scss +2 -0
- package/components/list/item.js +167 -0
- package/components/list/secondary.js +45 -0
- package/components/menu/_spec.scss +329 -0
- package/components/menu/_theme.scss +0 -0
- package/components/menu/index.js +636 -651
- package/components/menu/index.scss +2 -0
- package/components/menu/item.js +231 -0
- package/components/progress/_spec.scss +156 -0
- package/components/progress/_theme.scss +0 -0
- package/components/progress/index.js +29 -13
- package/components/progress/index.scss +2 -0
- package/components/selection/_spec.scss +376 -0
- package/components/selection/_theme.scss +134 -0
- package/components/selection/index.eta +60 -0
- package/components/selection/index.js +70 -0
- package/components/selection/index.pug +30 -0
- package/components/selection/index.scss +2 -0
- package/components/selection/input.js +54 -0
- package/components/selection/radiogroup.js +40 -0
- package/components/slider/{style.scss → _spec.scss} +31 -34
- package/components/slider/_theme.scss +0 -0
- package/components/slider/index.scss +2 -0
- package/components/snackbar/_spec.scss +150 -0
- package/components/snackbar/_theme.scss +0 -0
- package/components/snackbar/index.js +293 -206
- package/components/snackbar/index.scss +2 -0
- package/components/tab/_spec.scss +220 -0
- package/components/tab/_theme.scss +0 -0
- package/components/tab/content.js +210 -0
- package/components/tab/index.js +229 -213
- package/components/tab/index.scss +2 -0
- package/components/tab/item.js +88 -0
- package/components/tab/list.js +196 -0
- package/components/tab/panel.js +54 -0
- package/components/textfield/README.md +4 -4
- package/components/textfield/_spec.scss +763 -0
- package/components/textfield/_theme.scss +264 -0
- package/components/textfield/index.eta +74 -0
- package/components/textfield/index.js +132 -138
- package/components/textfield/index.pug +30 -0
- package/components/textfield/index.scss +2 -0
- package/components/tooltip/_spec.scss +185 -0
- package/components/tooltip/_theme.scss +0 -0
- package/components/tooltip/index.scss +2 -0
- package/components/type/_spec.scss +227 -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 +78 -0
- package/core/_length.scss +8 -0
- package/core/_motion.scss +31 -0
- package/core/_platform.scss +12 -0
- package/core/_type.scss +128 -0
- package/core/aria/attributes.js +141 -0
- package/core/aria/button.js +49 -0
- package/core/aria/keyboard.js +92 -0
- package/core/aria/rovingtabindex.js +175 -0
- package/core/aria/tab.js +59 -0
- package/core/document/index.js +39 -0
- package/core/dom.js +180 -0
- package/core/overlay/_spec.scss +28 -0
- package/core/overlay/_theme.scss +147 -0
- package/core/overlay/index.js +95 -0
- package/core/overlay/index.scss +2 -0
- package/core/ripple/_spec.scss +196 -0
- package/core/ripple/_theme.scss +20 -0
- package/core/ripple/index.js +286 -0
- package/core/ripple/index.scss +2 -0
- package/core/theme/_aliases.scss +15 -0
- package/core/theme/_config.scss +8 -0
- package/core/theme/_functions.scss +22 -0
- package/{components/theming/palettes.scss → core/theme/_palettes.scss} +173 -151
- package/core/theme/_spec.scss +0 -0
- package/core/theme/_theme.scss +268 -0
- package/core/theme/index.js +50 -0
- package/core/theme/index.scss +4 -0
- package/core/throttler.js +42 -0
- package/core/transition/index.js +465 -0
- package/docs/_flex.scss +28 -0
- package/docs/_menuoptions.js +183 -0
- package/docs/_partials/_androidnavbar.eta +5 -0
- package/docs/_partials/_androidstatusbar.eta +13 -0
- package/docs/_partials/_appbar.eta +27 -0
- package/docs/_partials/_buttontest.eta +31 -0
- package/docs/_partials/_header.eta +146 -0
- package/docs/_partials/_navlistitem.eta +16 -0
- package/docs/_partials/_target.eta +1 -0
- package/docs/_sample-utils.js +88 -0
- package/docs/{src/storage.js → _storage.js} +0 -0
- package/docs/docs.scss +331 -0
- package/docs/framework.scss +26 -0
- package/docs/index.eta +12 -0
- package/docs/index.js +7 -0
- package/docs/pages/appbar.eta +108 -0
- package/docs/pages/appbar.js +0 -0
- package/docs/pages/bottomnav.eta +188 -0
- package/docs/pages/bottomnav.js +118 -0
- package/docs/pages/button.eta +124 -0
- package/docs/pages/button.js +224 -0
- package/docs/pages/card.eta +90 -0
- package/docs/pages/card.js +175 -0
- package/docs/pages/chip.eta +122 -0
- package/docs/pages/chip.js +80 -0
- package/docs/pages/color.eta +143 -0
- package/docs/pages/color.js +261 -0
- package/docs/pages/datatable.eta +323 -0
- package/docs/pages/datatable.js +160 -0
- package/docs/pages/dialog.eta +184 -0
- package/docs/{src/components → pages}/dialog.js +35 -48
- package/docs/pages/dom.eta +26 -0
- package/docs/pages/dom.js +140 -0
- package/docs/pages/elevation.eta +35 -0
- package/docs/pages/elevation.js +0 -0
- package/docs/pages/fab.eta +99 -0
- package/docs/{src/components → pages}/fab.js +6 -13
- package/docs/pages/grid.eta +135 -0
- package/docs/pages/grid.js +128 -0
- package/docs/pages/layout.eta +8 -0
- package/docs/pages/layout.js +0 -0
- package/docs/pages/list.eta +465 -0
- package/docs/pages/list.js +8 -0
- package/docs/pages/menu.eta +274 -0
- package/docs/{src/components → pages}/menu.js +26 -42
- package/docs/pages/overlay.eta +69 -0
- package/docs/pages/overlay.js +3 -0
- package/docs/pages/progress.eta +23 -0
- package/docs/{src/components → pages}/progress.js +2 -4
- package/docs/pages/ripple.eta +27 -0
- package/docs/pages/ripple.js +3 -0
- package/docs/pages/search.eta +242 -0
- package/docs/pages/search.js +226 -0
- package/docs/pages/selection.eta +107 -0
- package/docs/pages/selection.js +12 -0
- package/docs/pages/slider.eta +23 -0
- package/docs/pages/slider.js +0 -0
- package/docs/pages/snackbar.eta +83 -0
- package/docs/{src/components → pages}/snackbar.js +31 -36
- package/docs/pages/tab.eta +407 -0
- package/docs/pages/tab.js +152 -0
- package/docs/pages/textfield.eta +487 -0
- package/docs/{src/components → pages}/textfield.js +41 -45
- package/docs/pages/tooltip.eta +92 -0
- package/docs/pages/tooltip.js +0 -0
- package/docs/pages/transition.eta +117 -0
- package/docs/pages/transition.js +52 -0
- package/docs/pages/type.eta +31 -0
- package/docs/pages/type.js +0 -0
- package/docs/postrender.js +41 -0
- package/docs/prerender.js +16 -0
- package/docs/pwa/_dialogs.eta +143 -0
- package/docs/pwa/_menus.eta +16 -0
- package/docs/pwa/pwa-prerender.js +3 -0
- package/docs/pwa/pwa.eta +478 -0
- package/docs/pwa/pwa.js +298 -0
- package/docs/pwa/pwa.scss +31 -0
- package/docs/themes/theme-colored.scss +15 -0
- package/docs/themes/theme-default.scss +3 -0
- package/index.scss +27 -0
- package/jsconfig.json +8 -2
- package/package.json +54 -27
- package/scripts/deploy-docs.sh +9 -0
- package/templates/index.eta +2 -0
- package/templates/index.pug +3 -0
- package/tsconfig.json +16 -0
- package/utils/function.js +3 -0
- package/webpack.config.js +224 -68
- package/_index.scss +0 -4
- package/components/all-components.scss +0 -21
- package/components/bottomnav/style.scss +0 -190
- package/components/bottomnav/theming.scss +0 -76
- package/components/button/style.scss +0 -315
- package/components/button/theming.scss +0 -134
- package/components/card/style.scss +0 -175
- package/components/card/theming.scss +0 -43
- package/components/common/dom.js +0 -51
- package/components/common/functions.scss +0 -174
- package/components/common/mixins.scss +0 -122
- package/components/common/motion.scss +0 -36
- package/components/common/type.scss +0 -104
- package/components/common/variables.scss +0 -46
- package/components/datatable/style.scss +0 -257
- package/components/datatable/theming.scss +0 -119
- package/components/dialog/style.scss +0 -159
- package/components/dialog/theming.scss +0 -29
- package/components/divider/style.scss +0 -7
- package/components/divider/theming.scss +0 -20
- package/components/elevation/style.scss +0 -32
- package/components/layout/style.scss +0 -223
- package/components/list/style.scss +0 -358
- package/components/list/theming.scss +0 -83
- package/components/menu/style.scss +0 -280
- package/components/menu/theming.scss +0 -80
- package/components/navdrawer/index.js +0 -200
- package/components/navdrawer/style.scss +0 -595
- package/components/navdrawer/theming.scss +0 -62
- package/components/progress/style.scss +0 -136
- package/components/ripple/index.js +0 -63
- package/components/ripple/ripple.scss +0 -122
- package/components/selection/style.scss +0 -320
- package/components/selection/theming.scss +0 -98
- package/components/snackbar/style.scss +0 -212
- package/components/switch/style.scss +0 -3
- package/components/tab/style.scss +0 -275
- package/components/tab/theming.scss +0 -34
- package/components/template/theming.scss +0 -31
- package/components/textfield/style.scss +0 -795
- package/components/textfield/theming.scss +0 -256
- package/components/theming/globals.scss +0 -25
- package/components/theming/theming.scss +0 -559
- package/components/toolbar/style.scss +0 -190
- package/components/toolbar/theming.scss +0 -32
- package/components/tooltip/style.scss +0 -135
- package/components/type/style.scss +0 -167
- package/components/type/theming.scss +0 -25
- 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/components.min.css +0 -1
- package/docs/components.min.js +0 -2
- package/docs/components.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/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/index.html +0 -1
- package/docs/index.min.js +0 -2
- package/docs/index.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/navdrawer.html +0 -1
- package/docs/navdrawer.min.js +0 -2
- package/docs/navdrawer.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/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/src/components/bottomnav.js +0 -16
- package/docs/src/components/bottomnav.pug +0 -112
- package/docs/src/components/button.js +0 -156
- package/docs/src/components/button.pug +0 -194
- package/docs/src/components/card.js +0 -136
- package/docs/src/components/card.pug +0 -133
- package/docs/src/components/datatable.js +0 -183
- package/docs/src/components/datatable.pug +0 -324
- package/docs/src/components/dialog.pug +0 -138
- package/docs/src/components/elevation.js +0 -3
- package/docs/src/components/elevation.pug +0 -17
- package/docs/src/components/fab.pug +0 -84
- package/docs/src/components/layout.js +0 -116
- package/docs/src/components/layout.pug +0 -104
- package/docs/src/components/list.js +0 -15
- package/docs/src/components/list.pug +0 -293
- package/docs/src/components/menu.pug +0 -292
- package/docs/src/components/navdrawer.js +0 -112
- package/docs/src/components/navdrawer.pug +0 -113
- package/docs/src/components/progress.pug +0 -17
- package/docs/src/components/search.js +0 -206
- package/docs/src/components/search.pug +0 -149
- package/docs/src/components/selection.js +0 -6
- package/docs/src/components/selection.pug +0 -116
- package/docs/src/components/slider.js +0 -3
- package/docs/src/components/slider.pug +0 -19
- package/docs/src/components/snackbar.pug +0 -145
- package/docs/src/components/tab.js +0 -137
- package/docs/src/components/tab.pug +0 -329
- package/docs/src/components/textfield.pug +0 -416
- package/docs/src/components/toolbar.js +0 -6
- package/docs/src/components/toolbar.pug +0 -86
- package/docs/src/components/tooltip.js +0 -6
- package/docs/src/components/tooltip.pug +0 -76
- package/docs/src/components/type.js +0 -6
- package/docs/src/components/type.pug +0 -34
- package/docs/src/components.scss +0 -1
- package/docs/src/docs.scss +0 -284
- package/docs/src/index.js +0 -3
- package/docs/src/index.pug +0 -6
- package/docs/src/menuoptions.js +0 -136
- package/docs/src/mixins.pug +0 -139
- package/docs/src/prerender.js +0 -26
- package/docs/src/sample-utils.js +0 -108
- package/docs/src/targetHandler.js +0 -50
- package/docs/src/theming.ie11.scss +0 -18
- package/docs/src/theming.scss +0 -18
- 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/theming.ie11.min.css +0 -1
- package/docs/theming.ie11.min.js +0 -2
- package/docs/theming.ie11.min.js.map +0 -1
- package/docs/theming.min.css +0 -1
- package/docs/theming.min.js +0 -2
- package/docs/theming.min.js.map +0 -1
- package/docs/toolbar.html +0 -1
- package/docs/toolbar.min.js +0 -2
- package/docs/toolbar.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/type.html +0 -1
- package/docs/type.min.js +0 -2
- package/docs/type.min.js.map +0 -1
- package/index.js +0 -16
package/docs/src/docs.scss
DELETED
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
html {
|
|
2
|
-
font-family: Roboto, sans-serif;
|
|
3
|
-
height: 100%;
|
|
4
|
-
|
|
5
|
-
// Prefer iOS Dynamic Type for accessibility support
|
|
6
|
-
font: -apple-system-body;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// Material Icon incorrectly changes RTL direction
|
|
10
|
-
.material-icons {
|
|
11
|
-
direction: inherit;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
body {
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: row;
|
|
18
|
-
margin: 0;
|
|
19
|
-
height: 100%;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.nav {
|
|
23
|
-
min-width: 150px;
|
|
24
|
-
max-width: 150px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.comparison {
|
|
28
|
-
display: flex;
|
|
29
|
-
flex-direction: row;
|
|
30
|
-
position: relative;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.androidstatusbar {
|
|
34
|
-
z-index: 1;
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
flex-direction: row-reverse;
|
|
38
|
-
height: 24px;
|
|
39
|
-
padding: 0 8px;
|
|
40
|
-
font-size: 14px;
|
|
41
|
-
color: white;
|
|
42
|
-
[mdw-theme-fill~="light"] &:not([mdw-theme-fill]) {
|
|
43
|
-
background-color: #E0E0E0;
|
|
44
|
-
color: rgba(0, 0, 0, 0.87);
|
|
45
|
-
}
|
|
46
|
-
[mdw-theme-fill~="dark"] &:not([mdw-theme-fill]) {
|
|
47
|
-
background-color: black;
|
|
48
|
-
color: rgba(255, 255, 255, 1);
|
|
49
|
-
}
|
|
50
|
-
.material-icons {
|
|
51
|
-
font-size: 18px;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.content {
|
|
56
|
-
flex: 1;
|
|
57
|
-
overflow-y: auto;
|
|
58
|
-
-ms-overflow-style: -ms-autohiding-scrollbar;
|
|
59
|
-
flex-direction: column;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.render {
|
|
63
|
-
max-width: 360px;
|
|
64
|
-
max-height: 640px;
|
|
65
|
-
border-color: #eee;
|
|
66
|
-
border-width: 1px;
|
|
67
|
-
border-style: solid;
|
|
68
|
-
box-sizing: border-box;
|
|
69
|
-
[mdw-theme-fill~="light"] & {
|
|
70
|
-
border-color: rgba(0,0,0,0.12);
|
|
71
|
-
}
|
|
72
|
-
[mdw-theme-fill~="dark"] & {
|
|
73
|
-
border-color: rgba(255,255,255,0.12);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.render,
|
|
78
|
-
.target {
|
|
79
|
-
position: relative;
|
|
80
|
-
margin: 8px;
|
|
81
|
-
min-width: 360px;
|
|
82
|
-
height: 640px;
|
|
83
|
-
background-size: cover;
|
|
84
|
-
background-repeat: no-repeat;
|
|
85
|
-
|
|
86
|
-
display: flex;
|
|
87
|
-
flex-direction: column;
|
|
88
|
-
.clipped & {
|
|
89
|
-
max-height: 190px;
|
|
90
|
-
}
|
|
91
|
-
.clipped-236 & {
|
|
92
|
-
max-height: 236px;
|
|
93
|
-
}
|
|
94
|
-
.clipped-300 & {
|
|
95
|
-
max-height: 300px;
|
|
96
|
-
}
|
|
97
|
-
.clipped-304 & {
|
|
98
|
-
max-height: 304px;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
.horizontal-controls {
|
|
104
|
-
display:inline-flex;
|
|
105
|
-
width:100%;
|
|
106
|
-
& > :not(:last-child) {
|
|
107
|
-
margin-right: 16px;
|
|
108
|
-
margin-left: 0;
|
|
109
|
-
}
|
|
110
|
-
[dir=rtl] & > :not(:last-child) {
|
|
111
|
-
margin-left: 16px;
|
|
112
|
-
margin-right: 0;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.display-flex {
|
|
117
|
-
display: flex;
|
|
118
|
-
}
|
|
119
|
-
[flex-column] {
|
|
120
|
-
flex-direction: column;
|
|
121
|
-
}
|
|
122
|
-
[flex-justify-content="center"] {
|
|
123
|
-
justify-content: center;
|
|
124
|
-
}
|
|
125
|
-
[flex-align-items="center"] {
|
|
126
|
-
align-items: center;
|
|
127
|
-
}
|
|
128
|
-
.flex-wrap {
|
|
129
|
-
flex-wrap: wrap;
|
|
130
|
-
}
|
|
131
|
-
.flex-1 {
|
|
132
|
-
flex: 1;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.docs-render-overlay {
|
|
136
|
-
position:absolute;
|
|
137
|
-
left:0;
|
|
138
|
-
right:0;
|
|
139
|
-
bottom:0;
|
|
140
|
-
flex-direction:row-reverse
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.component-sample {
|
|
144
|
-
position: relative;
|
|
145
|
-
display: flex;
|
|
146
|
-
align-items: center;
|
|
147
|
-
justify-content: center;
|
|
148
|
-
padding: 24px;
|
|
149
|
-
border-style: solid;
|
|
150
|
-
border-radius: 2px;
|
|
151
|
-
border-width: 1px;
|
|
152
|
-
min-height: 360px;
|
|
153
|
-
[mdw-theme-fill~="light"] & {
|
|
154
|
-
border-color: rgba(0,0,0,0.12);
|
|
155
|
-
}
|
|
156
|
-
[mdw-theme-fill~="dark"] & {
|
|
157
|
-
border-color: rgba(255,255,255,0.12);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.component-sample__container {
|
|
162
|
-
display: inline-flex;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.component-code {
|
|
166
|
-
display: flex;
|
|
167
|
-
align-items: flex-start;
|
|
168
|
-
justify-content: center;
|
|
169
|
-
padding: 24px;
|
|
170
|
-
white-space: pre-wrap;
|
|
171
|
-
font-family: monospace;
|
|
172
|
-
flex-grow: 1;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
.androidnavbar {
|
|
177
|
-
display: flex;
|
|
178
|
-
flex-direction: row;
|
|
179
|
-
justify-content: space-around;
|
|
180
|
-
align-items: center;
|
|
181
|
-
min-height: 48px;
|
|
182
|
-
height: 48px;
|
|
183
|
-
padding: 0 30px;
|
|
184
|
-
background-color: black;
|
|
185
|
-
color: white;
|
|
186
|
-
.material-icons {
|
|
187
|
-
font-size: 20px;
|
|
188
|
-
}
|
|
189
|
-
.material-icons.back-button {
|
|
190
|
-
transform: rotate(90deg);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
#horizontalLine {
|
|
196
|
-
position: fixed;
|
|
197
|
-
width: 100%;
|
|
198
|
-
background-color: #0FF;
|
|
199
|
-
height: 1px;
|
|
200
|
-
left: 0px;
|
|
201
|
-
z-index: 25;
|
|
202
|
-
pointer-events: none;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.custom-no-results-indicator {
|
|
206
|
-
margin: 8px;
|
|
207
|
-
min-height: 48px;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
#verticalLineLeft,
|
|
211
|
-
#verticalLineRight {
|
|
212
|
-
height: 100%;
|
|
213
|
-
background-color: #0FF;
|
|
214
|
-
width: 1px;
|
|
215
|
-
top: 0px;
|
|
216
|
-
z-index: 25;
|
|
217
|
-
pointer-events: none;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
#verticalLineLeft {
|
|
221
|
-
position: absolute;
|
|
222
|
-
margin-left: 8px;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
#verticalLineRight {
|
|
226
|
-
position: fixed;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
#Vintage50Input {
|
|
231
|
-
font-size: sp(34);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.type-comparison {
|
|
235
|
-
.content {
|
|
236
|
-
margin: 8px;
|
|
237
|
-
align-items: flex-start;
|
|
238
|
-
flex-direction: column;
|
|
239
|
-
display: flex;
|
|
240
|
-
}
|
|
241
|
-
.target {
|
|
242
|
-
margin-top: 42px;
|
|
243
|
-
background-position-x: -200px;
|
|
244
|
-
width: 760px;
|
|
245
|
-
height: 568px;
|
|
246
|
-
}
|
|
247
|
-
.mdw-type {
|
|
248
|
-
position: relative; // For tooltip position
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
.type-comparison-2 {
|
|
252
|
-
.target {
|
|
253
|
-
width: 760px;
|
|
254
|
-
height: 208px;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
.type-comparison-3 {
|
|
258
|
-
.target {
|
|
259
|
-
width: 360px;
|
|
260
|
-
height: 300px;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.docs-layout {
|
|
265
|
-
.mdw-card {
|
|
266
|
-
padding: 16px 8px;
|
|
267
|
-
display: flex;
|
|
268
|
-
justify-content: center;
|
|
269
|
-
align-items: center;
|
|
270
|
-
cursor: pointer;
|
|
271
|
-
-webkit-tap-highlight-color: transparent;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.mdw-button.docs-rtl:not([mdw-icon]) {
|
|
276
|
-
border-radius: 50%;
|
|
277
|
-
box-sizing: content-box;
|
|
278
|
-
max-width: 24px;
|
|
279
|
-
max-height: 24px;
|
|
280
|
-
min-width: 24px;
|
|
281
|
-
min-height: 24px;
|
|
282
|
-
padding: 8px;
|
|
283
|
-
font-size: 14px; // Don't scale
|
|
284
|
-
}
|
package/docs/src/index.js
DELETED
package/docs/src/index.pug
DELETED
package/docs/src/menuoptions.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { setStorageItem, removeStorageItem, getStorageItem } from './storage';
|
|
2
|
-
|
|
3
|
-
const darkAttribute = 'black dark';
|
|
4
|
-
const lightAttribute = 'white light';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @param {boolean} value
|
|
8
|
-
* @param {Element=} button
|
|
9
|
-
* @return {void}
|
|
10
|
-
*/
|
|
11
|
-
export function setRTLMode(value, button) {
|
|
12
|
-
if (value) {
|
|
13
|
-
document.documentElement.setAttribute('dir', 'rtl');
|
|
14
|
-
if (button) {
|
|
15
|
-
button.removeAttribute('mdw-inactive');
|
|
16
|
-
}
|
|
17
|
-
// element.setAttribute('mdw-active', '');
|
|
18
|
-
// Poor visibility even though spec says 70% opacity
|
|
19
|
-
setStorageItem('rtlmode', 'true');
|
|
20
|
-
} else {
|
|
21
|
-
document.documentElement.removeAttribute('dir');
|
|
22
|
-
if (button) {
|
|
23
|
-
button.setAttribute('mdw-inactive', '');
|
|
24
|
-
}
|
|
25
|
-
// element.removeAttribute('mdw-active');
|
|
26
|
-
removeStorageItem('rtlmode');
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @param {boolean} value
|
|
32
|
-
* @param {Element=} button
|
|
33
|
-
* @return {void}
|
|
34
|
-
*/
|
|
35
|
-
export function setDarkMode(value, button) {
|
|
36
|
-
if (value) {
|
|
37
|
-
document.documentElement.setAttribute('mdw-theme-fill', darkAttribute);
|
|
38
|
-
if (button) {
|
|
39
|
-
button.removeAttribute('mdw-inactive');
|
|
40
|
-
}
|
|
41
|
-
// element.setAttribute('mdw-active', '');
|
|
42
|
-
// Poor visibility even though spec says 70% opacity
|
|
43
|
-
} else {
|
|
44
|
-
document.documentElement.setAttribute('mdw-theme-fill', lightAttribute);
|
|
45
|
-
if (button) {
|
|
46
|
-
button.setAttribute('mdw-inactive', '');
|
|
47
|
-
}
|
|
48
|
-
// element.removeAttribute('mdw-active');
|
|
49
|
-
}
|
|
50
|
-
setStorageItem('darkmode', value ? 'true' : 'false');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @param {string} value
|
|
55
|
-
* @param {Element=} button
|
|
56
|
-
* @return {void}
|
|
57
|
-
*/
|
|
58
|
-
export function setFontSize(value, button) {
|
|
59
|
-
if (value) {
|
|
60
|
-
document.documentElement.style.setProperty('font-size', value);
|
|
61
|
-
if (button) {
|
|
62
|
-
button.removeAttribute('mdw-inactive');
|
|
63
|
-
}
|
|
64
|
-
// element.setAttribute('mdw-active', '');
|
|
65
|
-
// Poor visibility even though spec says 70% opacity
|
|
66
|
-
setStorageItem('fontsize', value);
|
|
67
|
-
} else {
|
|
68
|
-
document.documentElement.style.removeProperty('font-size');
|
|
69
|
-
if (button) {
|
|
70
|
-
button.setAttribute('mdw-inactive', '');
|
|
71
|
-
}
|
|
72
|
-
// element.removeAttribute('mdw-active');
|
|
73
|
-
removeStorageItem('fontsize');
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* @param {Element} element
|
|
79
|
-
* @return {void}
|
|
80
|
-
*/
|
|
81
|
-
function setupRTLMode(element) {
|
|
82
|
-
if (getStorageItem('rtlmode') === 'true') {
|
|
83
|
-
setRTLMode(true, element);
|
|
84
|
-
}
|
|
85
|
-
element.addEventListener('click', () => {
|
|
86
|
-
if (document.documentElement.getAttribute('dir') === 'rtl') {
|
|
87
|
-
setRTLMode(false, element);
|
|
88
|
-
} else {
|
|
89
|
-
setRTLMode(true, element);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* @param {Element} element
|
|
96
|
-
* @return {void}
|
|
97
|
-
*/
|
|
98
|
-
function setupDarkMode(element) {
|
|
99
|
-
if (getStorageItem('darkmode') === 'true') {
|
|
100
|
-
setDarkMode(true, element);
|
|
101
|
-
}
|
|
102
|
-
element.addEventListener('click', () => {
|
|
103
|
-
if (document.documentElement.getAttribute('mdw-theme-fill') === darkAttribute) {
|
|
104
|
-
setDarkMode(false, element);
|
|
105
|
-
} else {
|
|
106
|
-
setDarkMode(true, element);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* @param {Element} element
|
|
113
|
-
* @return {void}
|
|
114
|
-
*/
|
|
115
|
-
function setupLargeFontMode(element) {
|
|
116
|
-
const fontsize = getStorageItem('fontsize');
|
|
117
|
-
setFontSize(fontsize, element);
|
|
118
|
-
element.addEventListener('click', () => {
|
|
119
|
-
if (document.documentElement.style.getPropertyValue('font-size')) {
|
|
120
|
-
setFontSize(null, element);
|
|
121
|
-
} else {
|
|
122
|
-
setFontSize('125%', element);
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/** @return {void} */
|
|
128
|
-
export function setupMenuOptions() {
|
|
129
|
-
const buttons = document.getElementById('docs-menu-buttons').getElementsByClassName('mdw-button');
|
|
130
|
-
const buttonRTLMode = buttons[0];
|
|
131
|
-
const buttonDarkMode = buttons[1];
|
|
132
|
-
const largeFontMode = buttons[2];
|
|
133
|
-
setupRTLMode(buttonRTLMode);
|
|
134
|
-
setupDarkMode(buttonDarkMode);
|
|
135
|
-
setupLargeFontMode(largeFontMode);
|
|
136
|
-
}
|
package/docs/src/mixins.pug
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
mixin androidstatusbar(fillColor)
|
|
2
|
-
.androidstatusbar(mdw-theme-fill=(fillColor ? fillColor : false))
|
|
3
|
-
div 12:30
|
|
4
|
-
i.material-icons(style="letter-spacing:2px;padding:0 2px") 
|
|
5
|
-
|
|
6
|
-
mixin toolbar(fillColor, start, end)
|
|
7
|
-
.mdw-toolbar(mdw-theme-fill=(fillColor ? fillColor : false))
|
|
8
|
-
.mdw-toolbar__action
|
|
9
|
-
.mdw-toolbar__start
|
|
10
|
-
each icon in start
|
|
11
|
-
.mdw-button.material-icons(mdw-icon)= icon
|
|
12
|
-
.mdw-toolbar__title
|
|
13
|
-
block
|
|
14
|
-
.mdw-toolbar__end
|
|
15
|
-
each icon in end
|
|
16
|
-
.mdw-button.material-icons(mdw-icon mdw-more-button=(icon === 'more_vert'))= icon
|
|
17
|
-
mixin androidnavbar
|
|
18
|
-
.androidnavbar
|
|
19
|
-
i.material-icons.back-button 
|
|
20
|
-
i.material-icons 
|
|
21
|
-
i.material-icons 
|
|
22
|
-
mixin target(url)
|
|
23
|
-
.target(style=`background-image: url(${url})`)
|
|
24
|
-
|
|
25
|
-
mixin header()
|
|
26
|
-
doctype html
|
|
27
|
-
html(lang='en')
|
|
28
|
-
head
|
|
29
|
-
title Material Design Web
|
|
30
|
-
meta(charset='utf-8')
|
|
31
|
-
meta(content='IE=edge', http-equiv='X-UA-Compatible')
|
|
32
|
-
meta(content='', name='description')
|
|
33
|
-
meta(content="width=device-width, initial-scale=1, viewport-fit=cover", name='viewport')
|
|
34
|
-
meta(name="theme-color" content="#E91E63")
|
|
35
|
-
meta(name="apple-mobile-web-app-status-bar-style" content="black-translucent")
|
|
36
|
-
meta(name="apple-mobile-web-app-capable" content="yes")
|
|
37
|
-
link(rel='stylesheet' href="https://fonts.googleapis.com/icon?family=Material+Icons")
|
|
38
|
-
link(rel='stylesheet' href='//fonts.googleapis.com/css?family=Roboto:300,400,500,700')
|
|
39
|
-
link(rel='stylesheet' href='docs.min.css')
|
|
40
|
-
link(rel='stylesheet' href='components.min.css')
|
|
41
|
-
link(rel='stylesheet' href='theming.min.css')
|
|
42
|
-
link(rel='stylesheet' href='theming.ie11.min.css' media="screen and (-ms-high-contrast: active), (-ms-high-contrast: none)")
|
|
43
|
-
script(src='prerender.min.js')
|
|
44
|
-
body.mdw-type
|
|
45
|
-
block
|
|
46
|
-
|
|
47
|
-
mixin navdrawer(selected)
|
|
48
|
-
.mdw-navdrawer#docs-navdrawer
|
|
49
|
-
a.mdw-navdrawer__scrim(href="#")
|
|
50
|
-
.mdw-navdrawer__toolbar
|
|
51
|
-
.mdw-toolbar(mdw-theme-fill="accent-500 dark" mdw-app-bar)
|
|
52
|
-
.mdw-toolbar__action
|
|
53
|
-
.mdw-toolbar__start
|
|
54
|
-
.mdw-tooltip__wrapper
|
|
55
|
-
a.mdw-tooltip__target.mdw-button(mdw-icon href="#docs-navdrawer").material-icons menu
|
|
56
|
-
.mdw-tooltip Menu
|
|
57
|
-
.mdw-toolbar__title=selected
|
|
58
|
-
#docs-menu-buttons.mdw-toolbar__end
|
|
59
|
-
.mdw-tooltip__wrapper
|
|
60
|
-
.mdw-tooltip__target.mdw-button(mdw-inactive).docs-rtl RTL
|
|
61
|
-
.mdw-tooltip Right-to-Left
|
|
62
|
-
.mdw-tooltip__wrapper
|
|
63
|
-
.mdw-tooltip__target.mdw-button.material-icons(mdw-icon mdw-inactive) brightness_3
|
|
64
|
-
.mdw-tooltip Dark Mode
|
|
65
|
-
.mdw-tooltip__wrapper
|
|
66
|
-
.mdw-tooltip__target.mdw-button.material-icons(mdw-icon mdw-inactive) format_size
|
|
67
|
-
.mdw-tooltip Large Font
|
|
68
|
-
.mdw-navdrawer__drawer
|
|
69
|
-
.mdw-list
|
|
70
|
-
a.mdw-list__item(mdw-selected=selected=='Home' href='index.html' mdw-theme-color="primary")
|
|
71
|
-
.mdw-list__text Home
|
|
72
|
-
.mdw-list__subheader Components
|
|
73
|
-
a.mdw-list__item(mdw-selected=selected=='bottomnav' href="bottomnav.html" mdw-theme-color="accent")
|
|
74
|
-
.mdw-list__icon.material-icons call_to_action
|
|
75
|
-
.mdw-list__text Bottom Navigation
|
|
76
|
-
a.mdw-list__item(mdw-selected=selected=='button' href="button.html" mdw-theme-color="accent")
|
|
77
|
-
.mdw-list__icon.material-icons crop_landscape
|
|
78
|
-
.mdw-list__text Button
|
|
79
|
-
a.mdw-list__item(mdw-selected=selected=='card' href="card.html" mdw-theme-color="accent")
|
|
80
|
-
.mdw-list__icon.material-icons crop_square
|
|
81
|
-
.mdw-list__text Card
|
|
82
|
-
a.mdw-list__item(mdw-selected=selected=='dialog' href="dialog.html" mdw-theme-color="accent")
|
|
83
|
-
.mdw-list__icon.material-icons select_all
|
|
84
|
-
.mdw-list__text Dialog
|
|
85
|
-
a.mdw-list__item(mdw-selected=selected=='datatable' href="datatable.html" mdw-theme-color="accent")
|
|
86
|
-
.mdw-list__icon.material-icons format_align_justify
|
|
87
|
-
.mdw-list__text Data Table
|
|
88
|
-
a.mdw-list__item(mdw-selected=selected=='elevation' href="elevation.html" mdw-theme-color="accent")
|
|
89
|
-
.mdw-list__icon.material-icons layers
|
|
90
|
-
.mdw-list__text Elevation
|
|
91
|
-
a.mdw-list__item(mdw-selected=selected=='fab' href="fab.html" mdw-theme-color="accent")
|
|
92
|
-
.mdw-list__icon.material-icons add_circle
|
|
93
|
-
.mdw-list__text Floating Action Button
|
|
94
|
-
a.mdw-list__item(mdw-selected=selected=='layout' href="layout.html" mdw-theme-color="accent")
|
|
95
|
-
.mdw-list__icon.material-icons view_compact
|
|
96
|
-
.mdw-list__text Layout
|
|
97
|
-
a.mdw-list__item(mdw-selected=selected=='list' href="list.html" mdw-theme-color="accent")
|
|
98
|
-
.mdw-list__icon.material-icons view_list
|
|
99
|
-
.mdw-list__text List
|
|
100
|
-
a.mdw-list__item(mdw-selected=selected=='menu' href="menu.html" mdw-theme-color="accent")
|
|
101
|
-
.mdw-list__icon.material-icons picture_in_picture
|
|
102
|
-
.mdw-list__text Menu
|
|
103
|
-
a.mdw-list__item(mdw-selected=selected=='navdrawer' href="navdrawer.html" mdw-theme-color="accent")
|
|
104
|
-
.mdw-list__icon.material-icons menu
|
|
105
|
-
.mdw-list__text Navigation Drawer
|
|
106
|
-
a.mdw-list__item(mdw-selected=selected=='progress' href="progress.html" mdw-theme-color="accent")
|
|
107
|
-
.mdw-list__icon.material-icons timelapse
|
|
108
|
-
.mdw-list__text Progress
|
|
109
|
-
a.mdw-list__item(mdw-selected=selected=='search' href="search.html" mdw-theme-color="accent")
|
|
110
|
-
.mdw-list__icon.material-icons search
|
|
111
|
-
.mdw-list__text Search
|
|
112
|
-
a.mdw-list__item(mdw-selected=selected=='selection' href="selection.html" mdw-theme-color="accent")
|
|
113
|
-
.mdw-list__icon.material-icons toggle_on
|
|
114
|
-
.mdw-list__text Selection
|
|
115
|
-
a.mdw-list__item(mdw-selected=selected=='slider' href="slider.html" mdw-theme-color="accent")
|
|
116
|
-
.mdw-list__icon.material-icons tune
|
|
117
|
-
.mdw-list__text Slider
|
|
118
|
-
a.mdw-list__item(mdw-selected=selected=='snackbar' href="snackbar.html" mdw-theme-color="accent")
|
|
119
|
-
.mdw-list__icon.material-icons video_label
|
|
120
|
-
.mdw-list__text Snackbar
|
|
121
|
-
a.mdw-list__item(mdw-selected=selected=='tab' href="tab.html" mdw-theme-color="accent")
|
|
122
|
-
.mdw-list__icon.material-icons tab
|
|
123
|
-
.mdw-list__text Tab
|
|
124
|
-
a.mdw-list__item(mdw-selected=selected=='textfield' href="textfield.html" mdw-theme-color="accent")
|
|
125
|
-
.mdw-list__icon.material-icons text_fields
|
|
126
|
-
.mdw-list__text Text Field
|
|
127
|
-
a.mdw-list__item(mdw-selected=selected=='toolbar' href="toolbar.html" mdw-theme-color="accent")
|
|
128
|
-
.mdw-list__icon.material-icons web_asset
|
|
129
|
-
.mdw-list__text Toolbar
|
|
130
|
-
a.mdw-list__item(mdw-selected=selected=='tooltip' href="tooltip.html" mdw-theme-color="accent")
|
|
131
|
-
.mdw-list__icon.material-icons info
|
|
132
|
-
.mdw-list__text Tooltip
|
|
133
|
-
a.mdw-list__item(mdw-selected=selected=='type' href="type.html" mdw-theme-color="accent")
|
|
134
|
-
.mdw-list__icon.material-icons font_download
|
|
135
|
-
.mdw-list__text Typography
|
|
136
|
-
.mdw-navdrawer__content(style="padding-bottom:24px")
|
|
137
|
-
block
|
|
138
|
-
|
|
139
|
-
|
package/docs/src/prerender.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { setRTLMode, setDarkMode, setFontSize } from './menuoptions';
|
|
2
|
-
import { getStorageItem } from './storage';
|
|
3
|
-
|
|
4
|
-
const useRTLMode = getStorageItem('rtlmode') === 'true';
|
|
5
|
-
const useDarkMode = getStorageItem('darkmode') === 'true';
|
|
6
|
-
const fontsize = getStorageItem('fontsize');
|
|
7
|
-
|
|
8
|
-
/** @return {boolean} */
|
|
9
|
-
function checkIsStandaloneIOS() {
|
|
10
|
-
if (!navigator.standalone) {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
const ua = navigator.userAgent.toLowerCase();
|
|
14
|
-
const isIPhone = /iphone/.test(ua);
|
|
15
|
-
const isIPad = /ipad/.test(ua);
|
|
16
|
-
return (isIPhone || isIPad);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
setRTLMode(useRTLMode);
|
|
20
|
-
setDarkMode(useDarkMode);
|
|
21
|
-
setFontSize(fontsize);
|
|
22
|
-
|
|
23
|
-
if (checkIsStandaloneIOS()) {
|
|
24
|
-
document.documentElement.setAttribute('mdw-ios', '');
|
|
25
|
-
document.documentElement.setAttribute('mdw-standalone', '');
|
|
26
|
-
}
|
package/docs/src/sample-utils.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {HTMLElement} element
|
|
3
|
-
* @param {string=} linePrefix
|
|
4
|
-
* @return {string}
|
|
5
|
-
*/
|
|
6
|
-
function convertElementToCode(element, linePrefix = '') {
|
|
7
|
-
const htmlType = element.tagName.toLowerCase();
|
|
8
|
-
const attributes = [];
|
|
9
|
-
for (let i = 0; i < element.attributes.length; i += 1) {
|
|
10
|
-
const attribute = element.attributes.item(i);
|
|
11
|
-
if (attribute.value.length) {
|
|
12
|
-
attributes.push(`${attribute.name}="${attribute.value}"`);
|
|
13
|
-
} else {
|
|
14
|
-
attributes.push(attribute.name);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
attributes.sort();
|
|
18
|
-
const syntaxItems = [htmlType, attributes.join(' ')];
|
|
19
|
-
const openingHTMLLine = `<${syntaxItems.filter(item => item).join(' ').trim()}>`;
|
|
20
|
-
const closingHTMLLine = `</${htmlType}>`;
|
|
21
|
-
const lines = [openingHTMLLine];
|
|
22
|
-
const innerLines = [];
|
|
23
|
-
let onlyText = true;
|
|
24
|
-
for (let i = 0; i < element.childNodes.length; i += 1) {
|
|
25
|
-
const child = element.childNodes.item(i);
|
|
26
|
-
let lineText;
|
|
27
|
-
if (child instanceof HTMLElement) {
|
|
28
|
-
lineText = convertElementToCode(child, ` ${linePrefix}`);
|
|
29
|
-
if (lineText.trim()) {
|
|
30
|
-
onlyText = false;
|
|
31
|
-
}
|
|
32
|
-
} else if (child.nodeValue) {
|
|
33
|
-
lineText = ` ${child.nodeValue}`;
|
|
34
|
-
}
|
|
35
|
-
if (lineText && lineText.trim()) {
|
|
36
|
-
innerLines.push(lineText);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
if (onlyText) {
|
|
40
|
-
return linePrefix + lines.join('') + innerLines.join('').trim() + closingHTMLLine;
|
|
41
|
-
}
|
|
42
|
-
innerLines
|
|
43
|
-
.filter(line => line.trim())
|
|
44
|
-
.forEach(line => lines.push(line));
|
|
45
|
-
lines.push(linePrefix + closingHTMLLine);
|
|
46
|
-
return linePrefix + lines.join('\n');
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* @param {Element|NodeListOf<Element>} elements
|
|
51
|
-
* @param {string} event
|
|
52
|
-
* @param {Function} listener
|
|
53
|
-
* @return {void}
|
|
54
|
-
*/
|
|
55
|
-
function attachEventListener(elements, event, listener) {
|
|
56
|
-
let elementList;
|
|
57
|
-
if (elements instanceof Element) {
|
|
58
|
-
elementList = [elementList];
|
|
59
|
-
} else {
|
|
60
|
-
elementList = elements;
|
|
61
|
-
}
|
|
62
|
-
for (let i = 0; i < elementList.length; i += 1) {
|
|
63
|
-
const el = elementList[i];
|
|
64
|
-
el.addEventListener(event, listener);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @param {Element} node
|
|
70
|
-
* @return {Node}
|
|
71
|
-
*/
|
|
72
|
-
function getChildTextNode(node) {
|
|
73
|
-
for (let i = 0; i < node.childNodes.length; i += 1) {
|
|
74
|
-
const childNode = node.childNodes[i];
|
|
75
|
-
if (childNode.nodeType === Node.TEXT_NODE) {
|
|
76
|
-
return childNode;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
const textNode = document.createTextNode('');
|
|
80
|
-
node.appendChild(textNode);
|
|
81
|
-
return textNode;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* @param {Element} element
|
|
86
|
-
* @param {string} tagname
|
|
87
|
-
* @return {Element}
|
|
88
|
-
*/
|
|
89
|
-
function changeElementTagName(element, tagname) {
|
|
90
|
-
const newElement = document.createElement(tagname);
|
|
91
|
-
for (let i = element.attributes.length - 1; i >= 0; i -= 1) {
|
|
92
|
-
const attr = element.attributes.item(i);
|
|
93
|
-
newElement.attributes.setNamedItem(attr.cloneNode());
|
|
94
|
-
}
|
|
95
|
-
while (element.firstChild) {
|
|
96
|
-
newElement.appendChild(element.firstChild);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
element.parentElement.replaceChild(newElement, element);
|
|
100
|
-
return newElement;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export {
|
|
104
|
-
convertElementToCode,
|
|
105
|
-
attachEventListener,
|
|
106
|
-
getChildTextNode,
|
|
107
|
-
changeElementTagName,
|
|
108
|
-
};
|