@shortfuse/materialdesignweb 0.4.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 +59 -8
- package/.stylelintrc.json +94 -49
- package/CHANGELOG.md +12 -0
- package/README.md +1 -3
- package/adapters/datatable/column.js +27 -54
- package/adapters/datatable/index.js +69 -81
- package/adapters/dom/index.js +32 -47
- package/adapters/search/index.js +107 -133
- package/components/appbar/_spec.scss +77 -137
- package/components/banner/_spec.scss +28 -63
- package/components/bottomnav/_spec.scss +46 -54
- package/components/bottomnav/index.js +15 -20
- package/components/bottomnav/item.js +4 -5
- package/components/button/README.md +1 -1
- package/components/button/_spec.scss +43 -42
- package/components/button/_theme.scss +27 -50
- package/components/card/_spec.scss +61 -69
- package/components/chip/_spec.scss +21 -44
- package/components/chip/_theme.scss +79 -151
- package/components/chip/index.js +6 -4
- package/components/datatable/_spec.scss +36 -99
- package/components/datatable/_theme.scss +98 -124
- package/components/datatable/cell.js +1 -2
- package/components/datatable/columnheader.js +1 -2
- package/components/datatable/index.js +33 -47
- package/components/datatable/row.js +4 -5
- package/components/dialog/_spec.scss +53 -63
- package/components/dialog/_theme.scss +7 -0
- package/components/dialog/index.js +62 -88
- package/components/divider/_spec.scss +6 -8
- package/components/elevation/_spec.scss +1 -1
- package/components/fab/_spec.scss +30 -42
- package/components/fab/index.js +4 -8
- package/components/grid/_spec.scss +68 -211
- package/components/layout/_mixins.scss +0 -22
- package/components/layout/_spec.scss +267 -363
- package/components/layout/_theme.scss +10 -35
- package/components/layout/index.js +40 -50
- package/components/list/_spec.scss +57 -91
- package/components/list/_theme.scss +75 -84
- package/components/list/content.js +9 -13
- package/components/list/index.js +34 -38
- package/components/list/item.js +8 -11
- package/components/list/secondary.js +8 -9
- package/components/menu/_spec.scss +134 -167
- package/components/menu/index.js +45 -61
- package/components/menu/item.js +11 -19
- package/components/progress/_spec.scss +43 -34
- package/components/selection/_spec.scss +123 -133
- package/components/selection/_theme.scss +88 -120
- package/components/selection/index.js +9 -15
- package/components/selection/input.js +3 -5
- package/components/selection/radiogroup.js +8 -15
- package/components/slider/_spec.scss +23 -28
- package/components/snackbar/_spec.scss +17 -62
- package/components/snackbar/index.js +15 -21
- package/components/tab/_spec.scss +35 -50
- package/components/tab/content.js +33 -28
- package/components/tab/index.js +30 -33
- package/components/tab/item.js +4 -5
- package/components/tab/list.js +22 -36
- package/components/textfield/README.md +2 -2
- package/components/textfield/_spec.scss +241 -287
- package/components/textfield/_theme.scss +197 -232
- package/components/textfield/index.js +8 -16
- package/components/tooltip/_spec.scss +23 -26
- package/components/type/_spec.scss +19 -16
- package/core/_breakpoint.scss +33 -33
- package/core/_elevation.scss +40 -0
- package/core/_length.scss +0 -1
- package/core/_platform.scss +0 -22
- package/core/_type.scss +7 -6
- package/core/aria/button.js +4 -5
- package/core/aria/keyboard.js +1 -2
- package/core/aria/rovingtabindex.js +14 -17
- package/core/aria/tab.js +1 -2
- package/core/dom.js +18 -109
- package/core/overlay/_spec.scss +5 -8
- package/core/overlay/_theme.scss +126 -150
- package/core/overlay/index.js +19 -32
- package/core/ripple/_spec.scss +16 -17
- package/core/ripple/_theme.scss +13 -33
- package/core/ripple/index.js +36 -44
- package/core/theme/_aliases.scss +15 -0
- package/core/theme/_config.scss +8 -2
- package/core/theme/_functions.scss +22 -0
- package/core/theme/_palettes.scss +0 -1
- package/core/{color → theme}/_spec.scss +0 -0
- package/core/theme/_theme.scss +268 -0
- package/core/theme/index.scss +4 -0
- package/core/transition/index.js +73 -76
- package/docs/_flex.scss +7 -1
- package/docs/_menuoptions.js +2 -2
- package/docs/_partials/_appbar.eta +12 -14
- package/docs/_partials/_header.eta +41 -44
- package/docs/_sample-utils.js +15 -20
- package/docs/docs.scss +123 -87
- package/docs/framework.scss +26 -0
- package/docs/index.eta +2 -6
- package/docs/index.js +7 -0
- package/docs/pages/appbar.eta +22 -28
- package/docs/pages/bottomnav.js +17 -14
- package/docs/pages/button.js +10 -10
- package/docs/pages/card.js +20 -22
- package/docs/pages/chip.js +11 -13
- package/docs/pages/color.js +35 -36
- package/docs/pages/datatable.js +11 -15
- package/docs/pages/dialog.eta +9 -11
- package/docs/pages/dialog.js +6 -9
- package/docs/pages/dom.js +6 -9
- package/docs/pages/elevation.eta +10 -10
- package/docs/pages/fab.js +2 -3
- package/docs/pages/grid.js +5 -5
- package/docs/pages/list.js +1 -2
- package/docs/pages/menu.eta +17 -19
- package/docs/pages/menu.js +7 -11
- package/docs/pages/overlay.js +1 -2
- package/docs/pages/progress.eta +2 -2
- package/docs/pages/progress.js +1 -1
- package/docs/pages/ripple.js +1 -2
- package/docs/pages/search.eta +20 -24
- package/docs/pages/search.js +24 -41
- package/docs/pages/selection.eta +2 -6
- package/docs/pages/selection.js +3 -4
- package/docs/pages/snackbar.js +3 -4
- package/docs/pages/tab.eta +61 -75
- package/docs/pages/tab.js +16 -15
- package/docs/pages/textfield.eta +9 -8
- package/docs/pages/textfield.js +26 -23
- package/docs/pages/tooltip.eta +10 -12
- package/docs/pages/transition.js +5 -7
- package/docs/postrender.js +7 -5
- package/docs/pwa/pwa.eta +14 -16
- package/docs/pwa/pwa.js +19 -27
- package/docs/pwa/pwa.scss +12 -7
- package/docs/themes/theme-colored.scss +9 -11
- package/docs/themes/theme-default.scss +0 -14
- package/index.scss +27 -0
- package/jsconfig.json +7 -3
- package/package.json +26 -15
- package/tsconfig.json +16 -0
- package/{webpack.config.cjs → webpack.config.js} +105 -58
- package/components/template/_theme.scss +0 -27
- package/components/textfield/_mixins.scss +0 -52
- package/core/color/_theme.scss +0 -390
- package/core/color/index.scss +0 -2
- package/core/theme/_mixins.scss +0 -172
- package/core/theme/_variables.scss +0 -24
- package/docs/_mixins.pug +0 -155
- package/docs/pages/appbar.pug +0 -78
- package/docs/pages/bottomnav.pug +0 -137
- package/docs/pages/button.pug +0 -121
- package/docs/pages/card.pug +0 -74
- package/docs/pages/chip.pug +0 -91
- package/docs/pages/color.pug +0 -121
- package/docs/pages/datatable.pug +0 -283
- package/docs/pages/dialog.pug +0 -132
- package/docs/pages/dom.pug +0 -22
- package/docs/pages/elevation.pug +0 -25
- package/docs/pages/fab.pug +0 -66
- package/docs/pages/grid.pug +0 -95
- package/docs/pages/layout.pug +0 -7
- package/docs/pages/list.pug +0 -326
- package/docs/pages/menu.pug +0 -205
- package/docs/pages/overlay.pug +0 -55
- package/docs/pages/progress.pug +0 -16
- package/docs/pages/ripple.pug +0 -21
- package/docs/pages/search.pug +0 -165
- package/docs/pages/selection.pug +0 -74
- package/docs/pages/slider.pug +0 -17
- package/docs/pages/snackbar.pug +0 -60
- package/docs/pages/tab.pug +0 -304
- package/docs/pages/textfield.pug +0 -360
- package/docs/pages/tooltip.pug +0 -78
- package/docs/pages/transition.pug +0 -76
- package/docs/pages/type.pug +0 -29
- package/docs/pwa/_dialogs.pug +0 -96
- package/docs/pwa/_menus.pug +0 -11
- package/docs/pwa/pwa.pug +0 -325
- package/docs/spec.scss +0 -26
- package/docs/themes/_component-themes.scss +0 -26
- package/docs/themes/theme-colored-fallbacks.scss +0 -17
- package/docs/themes/theme-default-fallbacks.scss +0 -17
package/.browserslistrc
CHANGED
package/.eslintrc.json
CHANGED
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
"extends": [
|
|
7
7
|
"airbnb-base",
|
|
8
8
|
"plugin:@typescript-eslint/recommended",
|
|
9
|
-
"plugin:jsdoc/recommended"
|
|
9
|
+
"plugin:jsdoc/recommended",
|
|
10
|
+
"plugin:github/recommended",
|
|
11
|
+
"plugin:node/recommended",
|
|
12
|
+
"plugin:unicorn/recommended"
|
|
10
13
|
],
|
|
11
14
|
"parser": "@typescript-eslint/parser",
|
|
12
15
|
"parserOptions": {
|
|
@@ -14,19 +17,52 @@
|
|
|
14
17
|
"impliedStrict": true
|
|
15
18
|
},
|
|
16
19
|
"ecmaVersion": 2020,
|
|
17
|
-
"sourceType": "module"
|
|
20
|
+
"sourceType": "module",
|
|
21
|
+
"project": "./tsconfig.json"
|
|
18
22
|
},
|
|
19
23
|
"plugins": [
|
|
20
|
-
"jsdoc",
|
|
21
24
|
"@typescript-eslint",
|
|
25
|
+
"github",
|
|
26
|
+
"jsdoc",
|
|
27
|
+
"unicorn",
|
|
22
28
|
"eta"
|
|
23
29
|
],
|
|
24
30
|
"root": true,
|
|
25
31
|
"rules": {
|
|
32
|
+
"object-curly-newline": ["error", {
|
|
33
|
+
"ObjectExpression": { "multiline": true, "consistent": true },
|
|
34
|
+
"ObjectPattern": { "multiline": true, "consistent": true },
|
|
35
|
+
"ImportDeclaration": { "multiline": true, "consistent": true },
|
|
36
|
+
"ExportDeclaration": { "multiline": true, "consistent": true }
|
|
37
|
+
}],
|
|
38
|
+
"no-param-reassign": ["error", { "props": false }],
|
|
39
|
+
"no-continue": 0,
|
|
40
|
+
"no-restricted-syntax": 0,
|
|
41
|
+
"require-await": 0,
|
|
42
|
+
"no-return-await": 0,
|
|
43
|
+
"eslint-comments/no-use": 0,
|
|
44
|
+
"filenames/match-regex": 0,
|
|
45
|
+
"prettier/prettier": 0,
|
|
46
|
+
"i18n-text/no-en": 0,
|
|
47
|
+
"import/no-namespace": 0,
|
|
48
|
+
"no-unused-vars": 0,
|
|
49
|
+
"import/namespace": 0,
|
|
50
|
+
"no-constructor-return": 0,
|
|
51
|
+
"default-case-last": 0,
|
|
52
|
+
"no-undef": 0,
|
|
53
|
+
"import/named": 0,
|
|
54
|
+
"no-empty": ["error", {"allowEmptyCatch": true}],
|
|
55
|
+
"no-promise-executor-return": 0,
|
|
56
|
+
"github/no-then": 0,
|
|
26
57
|
"@typescript-eslint/ban-ts-comment": ["warn", {
|
|
27
58
|
"ts-ignore": "allow-with-description"
|
|
28
59
|
}],
|
|
29
60
|
"@typescript-eslint/explicit-module-boundary-types": 0,
|
|
61
|
+
"@typescript-eslint/require-await": "error",
|
|
62
|
+
"no-void": "off",
|
|
63
|
+
"@typescript-eslint/no-floating-promises": "error",
|
|
64
|
+
"@typescript-eslint/return-await": ["error", "always"],
|
|
65
|
+
|
|
30
66
|
"import/extensions": ["error", "always", {
|
|
31
67
|
"js": "always",
|
|
32
68
|
"mjs": "never"
|
|
@@ -55,6 +91,23 @@
|
|
|
55
91
|
"pathGroupsExcludedImportTypes": ["builtin"]
|
|
56
92
|
}],
|
|
57
93
|
"import/prefer-default-export": 0,
|
|
94
|
+
"unicorn/no-useless-undefined": 0,
|
|
95
|
+
"unicorn/no-array-for-each": 0,
|
|
96
|
+
"unicorn/prefer-spread": 0,
|
|
97
|
+
"unicorn/no-null": 0,
|
|
98
|
+
"unicorn/filename-case": 0,
|
|
99
|
+
"unicorn/prefer-dom-node-append": 0,
|
|
100
|
+
"unicorn/prevent-abbreviations": 0,
|
|
101
|
+
"unicorn/explicit-length-check": 0,
|
|
102
|
+
"unicorn/catch-error-name": 0,
|
|
103
|
+
"unicorn/prefer-dom-node-dataset": 0,
|
|
104
|
+
"unicorn/no-array-reduce": 0,
|
|
105
|
+
"unicorn/no-this-assignment": 0,
|
|
106
|
+
"unicorn/prefer-ternary": ["error", "only-single-line"],
|
|
107
|
+
"unicorn/no-empty-file": 0,
|
|
108
|
+
"unicorn/prefer-query-selector": 0,
|
|
109
|
+
"unicorn/prefer-dom-node-remove": 0,
|
|
110
|
+
"unicorn/no-for-loop": 0,
|
|
58
111
|
"jsdoc/newline-after-description": [
|
|
59
112
|
"warn",
|
|
60
113
|
"never"
|
|
@@ -62,10 +115,7 @@
|
|
|
62
115
|
"jsdoc/no-undefined-types": 0,
|
|
63
116
|
"jsdoc/require-param-description": 0,
|
|
64
117
|
"jsdoc/require-property-description": 0,
|
|
65
|
-
"jsdoc/require-returns":
|
|
66
|
-
"forceRequireReturn": true,
|
|
67
|
-
"forceReturnsWithAsync": true
|
|
68
|
-
}],
|
|
118
|
+
"jsdoc/require-returns": 0,
|
|
69
119
|
"jsdoc/require-returns-description": 0,
|
|
70
120
|
"jsdoc/valid-types": 0,
|
|
71
121
|
"max-len": ["error", 120, 2, {
|
|
@@ -75,6 +125,7 @@
|
|
|
75
125
|
"ignoreTemplateLiterals": true,
|
|
76
126
|
"ignoreUrls": true
|
|
77
127
|
}],
|
|
128
|
+
"consistent-return": "warn",
|
|
78
129
|
"no-console": ["error", {
|
|
79
130
|
"allow": [
|
|
80
131
|
"warn",
|
|
@@ -91,7 +142,7 @@
|
|
|
91
142
|
"prefer-destructuring": ["error", {
|
|
92
143
|
"AssignmentExpression": {
|
|
93
144
|
"array": false,
|
|
94
|
-
"object":
|
|
145
|
+
"object": false
|
|
95
146
|
},
|
|
96
147
|
"VariableDeclarator": {
|
|
97
148
|
"array": false,
|
package/.stylelintrc.json
CHANGED
|
@@ -1,15 +1,34 @@
|
|
|
1
1
|
{
|
|
2
|
+
"env": {
|
|
3
|
+
"browser": true
|
|
4
|
+
},
|
|
5
|
+
"ignorePatterns": ["*.min.js"],
|
|
6
|
+
"settings": {
|
|
7
|
+
"html/html-extensions": [
|
|
8
|
+
".html",
|
|
9
|
+
".eta"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
2
12
|
"extends": [
|
|
3
13
|
"stylelint-config-recommended-scss",
|
|
4
14
|
"stylelint-config-sass-guidelines"
|
|
5
15
|
],
|
|
6
16
|
"ignoreFiles": "test/**",
|
|
7
17
|
"plugins": [
|
|
8
|
-
"stylelint-scss"
|
|
18
|
+
"stylelint-scss",
|
|
19
|
+
"stylelint-use-logical-spec",
|
|
20
|
+
"stylelint-no-unsupported-browser-features"
|
|
9
21
|
],
|
|
22
|
+
"customSyntax": "postcss-scss",
|
|
10
23
|
"rules": {
|
|
24
|
+
"plugin/no-unsupported-browser-features": [ true, {
|
|
25
|
+
"ignore": ["css-appearance", "overscroll-behavior"]
|
|
26
|
+
}],
|
|
27
|
+
"liberty/use-logical-spec": [
|
|
28
|
+
"always"
|
|
29
|
+
],
|
|
11
30
|
"max-nesting-depth": null,
|
|
12
|
-
"declaration-property-value-
|
|
31
|
+
"declaration-property-value-disallowed-list": null,
|
|
13
32
|
"selector-no-vendor-prefix": null,
|
|
14
33
|
"property-no-vendor-prefix": null,
|
|
15
34
|
"value-no-vendor-prefix": null,
|
|
@@ -25,6 +44,19 @@
|
|
|
25
44
|
"no-empty-source": null,
|
|
26
45
|
"block-no-empty": true,
|
|
27
46
|
"no-extra-semicolons": true,
|
|
47
|
+
"rule-empty-line-before": [
|
|
48
|
+
"always",
|
|
49
|
+
{
|
|
50
|
+
"except": [
|
|
51
|
+
"first-nested"
|
|
52
|
+
],
|
|
53
|
+
"ignore": [
|
|
54
|
+
"after-comment"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"no-eol-whitespace": true,
|
|
59
|
+
"shorthand-property-no-redundant-values": null,
|
|
28
60
|
"selector-max-universal": 0,
|
|
29
61
|
"selector-attribute-brackets-space-inside": "never",
|
|
30
62
|
"selector-attribute-operator-space-after": "never",
|
|
@@ -38,25 +70,45 @@
|
|
|
38
70
|
"selector-type-case": "lower",
|
|
39
71
|
"selector-list-comma-space-before": "never",
|
|
40
72
|
"indentation": 2,
|
|
41
|
-
"max-empty-lines":
|
|
42
|
-
"selector-max-compound-selectors": [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
73
|
+
"max-empty-lines": 1,
|
|
74
|
+
"selector-max-compound-selectors": [
|
|
75
|
+
3,
|
|
76
|
+
{
|
|
77
|
+
"severity": "warning"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"no-descending-specificity": [
|
|
81
|
+
true,
|
|
82
|
+
{
|
|
83
|
+
"severity": "warning"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
50
86
|
"scss/at-import-no-partial-leading-underscore": null,
|
|
51
87
|
"scss/at-function-pattern": "^[a-z][a-zA-Z0-9]*$",
|
|
52
88
|
"scss/at-mixin-pattern": "^[a-z][a-zA-Z0-9]*$",
|
|
53
|
-
"scss/dollar-variable-default": [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
89
|
+
"scss/dollar-variable-default": [
|
|
90
|
+
true,
|
|
91
|
+
{
|
|
92
|
+
"ignore": "local"
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"scss/dollar-variable-pattern": "^[a-z][a-zA-Z0-9-]*$",
|
|
96
|
+
"order/order": [
|
|
97
|
+
"dollar-variables",
|
|
98
|
+
"custom-properties",
|
|
99
|
+
"declarations",
|
|
100
|
+
"rules"
|
|
101
|
+
],
|
|
58
102
|
"order/properties-alphabetical-order": null,
|
|
59
|
-
"order/properties-order": [
|
|
103
|
+
"order/properties-order": [
|
|
104
|
+
{
|
|
105
|
+
"groupName": "content",
|
|
106
|
+
"emptyLineBefore": "always",
|
|
107
|
+
"properties": [
|
|
108
|
+
"content"
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
60
112
|
"groupName": "layout",
|
|
61
113
|
"emptyLineBefore": "always",
|
|
62
114
|
"properties": [
|
|
@@ -66,6 +118,13 @@
|
|
|
66
118
|
"right",
|
|
67
119
|
"bottom",
|
|
68
120
|
"left",
|
|
121
|
+
"inset",
|
|
122
|
+
"inset-block",
|
|
123
|
+
"inset-block-start",
|
|
124
|
+
"inset-block-end",
|
|
125
|
+
"inset-inline",
|
|
126
|
+
"inset-inline-start",
|
|
127
|
+
"inset-inline-end",
|
|
69
128
|
"align-content",
|
|
70
129
|
"align-items",
|
|
71
130
|
"grid-column-align",
|
|
@@ -183,20 +242,22 @@
|
|
|
183
242
|
"emptyLineBefore": "always",
|
|
184
243
|
"properties": [
|
|
185
244
|
"box-sizing",
|
|
186
|
-
|
|
187
245
|
"min-height",
|
|
188
246
|
"max-height",
|
|
189
247
|
"height",
|
|
190
|
-
|
|
248
|
+
"min-block-size",
|
|
249
|
+
"max-block-size",
|
|
250
|
+
"block-size",
|
|
191
251
|
"min-width",
|
|
192
252
|
"max-width",
|
|
193
253
|
"width",
|
|
194
|
-
|
|
254
|
+
"min-inline-size",
|
|
255
|
+
"max-inline-size",
|
|
256
|
+
"inline-size",
|
|
195
257
|
"flex",
|
|
196
258
|
"flex-grow",
|
|
197
259
|
"flex-shrink",
|
|
198
260
|
"flex-basis",
|
|
199
|
-
|
|
200
261
|
"margin-block",
|
|
201
262
|
"margin-block-start",
|
|
202
263
|
"margin-block-end",
|
|
@@ -205,62 +266,47 @@
|
|
|
205
266
|
"margin-inline-start",
|
|
206
267
|
"margin-inline-end",
|
|
207
268
|
"margin-trim",
|
|
208
|
-
|
|
209
269
|
"margin",
|
|
210
270
|
"margin-top",
|
|
211
271
|
"margin-right",
|
|
212
272
|
"margin-bottom",
|
|
213
273
|
"margin-left",
|
|
214
|
-
|
|
215
274
|
"border-block",
|
|
216
275
|
"border-block-start",
|
|
217
276
|
"border-block-end",
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
277
|
"border-block-style",
|
|
222
278
|
"border-block-start-style",
|
|
223
279
|
"border-block-end-style",
|
|
224
|
-
|
|
225
280
|
"border-block-width",
|
|
226
281
|
"border-block-start-width",
|
|
227
282
|
"border-block-end-width",
|
|
228
|
-
|
|
229
283
|
"border-fit",
|
|
230
284
|
"border-fit-length",
|
|
231
285
|
"border-fit-width",
|
|
232
|
-
|
|
233
286
|
"border-corner-fit",
|
|
234
|
-
|
|
235
287
|
"border-top-left-fit-length",
|
|
236
288
|
"border-top-right-fit-length",
|
|
237
289
|
"border-bottom-right-fit-length",
|
|
238
290
|
"border-bottom-left-fit-length",
|
|
239
|
-
|
|
240
291
|
"border-top-left-fit-width",
|
|
241
292
|
"border-top-right-fit-width",
|
|
242
293
|
"border-bottom-right-fit-width",
|
|
243
294
|
"border-bottom-left-fit-width",
|
|
244
|
-
|
|
245
295
|
"border-top-fit-length",
|
|
246
296
|
"border-right-fit-length",
|
|
247
297
|
"border-bottom-fit-length",
|
|
248
298
|
"border-left-fit-length",
|
|
249
|
-
|
|
250
299
|
"border-top-fit-width",
|
|
251
300
|
"border-right-fit-width",
|
|
252
301
|
"border-bottom-fit-width",
|
|
253
302
|
"border-left-fit-width",
|
|
254
|
-
|
|
255
303
|
"border-image",
|
|
256
304
|
"border-image-source",
|
|
257
305
|
"border-image-slice",
|
|
258
306
|
"border-image-width",
|
|
259
307
|
"border-image-outset",
|
|
260
308
|
"border-image-repeat",
|
|
261
|
-
|
|
262
309
|
"border-image-transform",
|
|
263
|
-
|
|
264
310
|
"border-top-left-image",
|
|
265
311
|
"border-top-image",
|
|
266
312
|
"border-top-right-image",
|
|
@@ -268,27 +314,22 @@
|
|
|
268
314
|
"border-bottom-right-image",
|
|
269
315
|
"border-bottom-image",
|
|
270
316
|
"border-bottom-left-image",
|
|
271
|
-
|
|
272
317
|
"border",
|
|
273
|
-
|
|
274
318
|
"border-top",
|
|
275
319
|
"border-right",
|
|
276
320
|
"border-bottom",
|
|
277
321
|
"border-left",
|
|
278
322
|
"border-left-image",
|
|
279
|
-
|
|
280
323
|
"border-style",
|
|
281
324
|
"border-top-style",
|
|
282
325
|
"border-right-style",
|
|
283
326
|
"border-bottom-style",
|
|
284
327
|
"border-left-style",
|
|
285
|
-
|
|
286
328
|
"border-width",
|
|
287
329
|
"border-top-width",
|
|
288
330
|
"border-right-width",
|
|
289
331
|
"border-bottom-width",
|
|
290
332
|
"border-left-width",
|
|
291
|
-
|
|
292
333
|
"border-boundary",
|
|
293
334
|
"border-break",
|
|
294
335
|
"border-corner-image",
|
|
@@ -298,26 +339,20 @@
|
|
|
298
339
|
"border-end-start-radius",
|
|
299
340
|
"border-end-end-radius",
|
|
300
341
|
"border-inline",
|
|
301
|
-
|
|
302
342
|
"border-inline-style",
|
|
303
343
|
"border-inline-width",
|
|
304
344
|
"border-inline-start",
|
|
305
|
-
|
|
306
345
|
"border-inline-start-style",
|
|
307
346
|
"border-inline-start-width",
|
|
308
347
|
"border-inline-end",
|
|
309
|
-
|
|
310
348
|
"border-inline-end-style",
|
|
311
349
|
"border-inline-end-width",
|
|
312
|
-
|
|
313
|
-
|
|
314
350
|
"padding-block",
|
|
315
351
|
"padding-block-start",
|
|
316
352
|
"padding-block-end",
|
|
317
353
|
"padding-inline",
|
|
318
354
|
"padding-inline-start",
|
|
319
355
|
"padding-inline-end",
|
|
320
|
-
|
|
321
356
|
"padding",
|
|
322
357
|
"padding-top",
|
|
323
358
|
"padding-right",
|
|
@@ -343,6 +378,7 @@
|
|
|
343
378
|
"outline-offset",
|
|
344
379
|
"outline-style",
|
|
345
380
|
"outline-width",
|
|
381
|
+
"pointer-events",
|
|
346
382
|
"resize",
|
|
347
383
|
"tap-highlight-color",
|
|
348
384
|
"user-select"
|
|
@@ -409,7 +445,6 @@
|
|
|
409
445
|
"mask-type",
|
|
410
446
|
"mix-blend-mode",
|
|
411
447
|
"opacity",
|
|
412
|
-
"pointer-events",
|
|
413
448
|
"perspective",
|
|
414
449
|
"perspective-origin",
|
|
415
450
|
"transform",
|
|
@@ -596,5 +631,15 @@
|
|
|
596
631
|
]
|
|
597
632
|
}
|
|
598
633
|
]
|
|
599
|
-
}
|
|
634
|
+
},
|
|
635
|
+
"overrides": [
|
|
636
|
+
{
|
|
637
|
+
"files": [
|
|
638
|
+
"**/*.scss"
|
|
639
|
+
],
|
|
640
|
+
"rules": {
|
|
641
|
+
"selector-class-pattern": "^mdw-[a-z]+(__[a-z-]+)*$"
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
]
|
|
600
645
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
v0.5.0
|
|
2
|
+
------
|
|
3
|
+
|
|
4
|
+
* Drop IE11
|
|
5
|
+
* Drop Opera Mini
|
|
6
|
+
* Rewrite JS Syntax targetting >1% browsers
|
|
7
|
+
* Prefer modern DOM APIs
|
|
8
|
+
* Use CSS Logical properties and values
|
|
9
|
+
|
|
10
|
+
* Search: (BREAKING) Use Promises instead of NodeJS-style callbacks
|
|
11
|
+
* Elevation: Add Dark Theme opacity
|
|
12
|
+
|
|
1
13
|
v0.4.0
|
|
2
14
|
------
|
|
3
15
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
*Notice: This project is currently being maintained in an private fork. Changes will be pushed at a later date.*
|
|
2
|
-
|
|
3
1
|
# materialdesignweb
|
|
4
2
|
Material Design for Web
|
|
5
3
|
|
|
@@ -85,4 +83,4 @@ npm: `npm install @shortfuse/materialdesignweb`
|
|
|
85
83
|
|
|
86
84
|
* † - Required
|
|
87
85
|
|
|
88
|
-
* ‡ - Apply manually
|
|
86
|
+
* ‡ - Apply manually
|
|
@@ -5,11 +5,12 @@ import { setTextNode } from '../../core/dom.js';
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @template {Record<string, any>} T
|
|
8
|
-
* @template {keyof T & string} K
|
|
9
|
-
* @
|
|
10
|
-
* @
|
|
8
|
+
* @template {(keyof T & string)|string} K
|
|
9
|
+
* @template {any} [R=any]
|
|
10
|
+
* @callback DataTableAdapterColumnFormatter<T,K,R>
|
|
11
|
+
* @param {K extends keyof T ? T[K] : undefined} value
|
|
11
12
|
* @param {T} [object]
|
|
12
|
-
* @return {
|
|
13
|
+
* @return {R}
|
|
13
14
|
*/
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -22,10 +23,10 @@ import { setTextNode } from '../../core/dom.js';
|
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* @template {Record<string, any>} T
|
|
25
|
-
* @template {
|
|
26
|
-
* @callback DataTableAdapterColumnRenderer<T,
|
|
26
|
+
* @template {any} V
|
|
27
|
+
* @callback DataTableAdapterColumnRenderer<T,V>
|
|
27
28
|
* @param {HTMLTableCellElement} cell
|
|
28
|
-
* @param {
|
|
29
|
+
* @param {V} value
|
|
29
30
|
* @param {T} data
|
|
30
31
|
* @return {void}
|
|
31
32
|
*/
|
|
@@ -33,7 +34,8 @@ import { setTextNode } from '../../core/dom.js';
|
|
|
33
34
|
/**
|
|
34
35
|
* Constructor options for DataTableAdapterColumn
|
|
35
36
|
* @template {Record<string, any>} T
|
|
36
|
-
* @template {keyof T & string} K
|
|
37
|
+
* @template {(keyof T & string)|string} K
|
|
38
|
+
* @template {any} [R=any]
|
|
37
39
|
* @typedef DataTableAdapterColumnOptions<T,K>
|
|
38
40
|
* @prop {K} key
|
|
39
41
|
* @prop {(string|DocumentFragment)} [name='']
|
|
@@ -45,8 +47,8 @@ import { setTextNode } from '../../core/dom.js';
|
|
|
45
47
|
* @prop {HTMLElement} [customSortIcon]
|
|
46
48
|
* @prop {string} [innerHTML]
|
|
47
49
|
* @prop {DocumentFragment} [fragment]
|
|
48
|
-
* @prop {
|
|
49
|
-
* @prop {
|
|
50
|
+
* @prop {(value:K extends keyof T ? T[K] : undefined, object:T) => R} [formatter]
|
|
51
|
+
* @prop {(cell: HTMLTableCellElement, value: R, data: T) => any} [renderer]
|
|
50
52
|
* @prop {DataTableAdapterColumnSorter<T>} [sorter]
|
|
51
53
|
*/
|
|
52
54
|
|
|
@@ -55,20 +57,18 @@ function constructTableCheckbox() {
|
|
|
55
57
|
const element = document.createElement('div');
|
|
56
58
|
element.className = 'mdw-selection';
|
|
57
59
|
element.setAttribute('aria-checked', 'false');
|
|
58
|
-
const input = document.createElement('div');
|
|
60
|
+
const input = element.appendChild(document.createElement('div'));
|
|
59
61
|
input.className = 'mdw-selection__input mdw-datatable__widget';
|
|
60
|
-
const icon = document.createElement('div');
|
|
62
|
+
const icon = element.appendChild(document.createElement('div'));
|
|
61
63
|
icon.className = 'mdw-selection__icon';
|
|
62
64
|
icon.setAttribute('mdw-checkbox', '');
|
|
63
|
-
element.appendChild(input);
|
|
64
|
-
element.appendChild(icon);
|
|
65
65
|
Selection.attach(element);
|
|
66
66
|
return element;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* @template {Record<string, any>} T
|
|
71
|
-
* @template {keyof T & string} K
|
|
71
|
+
* @template {(keyof T & string)|string} K
|
|
72
72
|
*/
|
|
73
73
|
export default class DataTableAdapterColumn {
|
|
74
74
|
/** @param {DataTableAdapterColumnOptions<T,K>} options */
|
|
@@ -87,44 +87,25 @@ export default class DataTableAdapterColumn {
|
|
|
87
87
|
let sortIcon = options.customSortIcon;
|
|
88
88
|
if (!sortIcon) {
|
|
89
89
|
sortIcon = document.createElement('span');
|
|
90
|
-
sortIcon.
|
|
91
|
-
sortIcon.classList.add('material-icons');
|
|
90
|
+
sortIcon.className = 'mdw-datatable__sort-icon material-icons';
|
|
92
91
|
sortIcon.textContent = 'arrow_downward';
|
|
93
92
|
}
|
|
94
|
-
|
|
95
|
-
this.element.insertBefore(this.element.firstChild, options.customSortIcon);
|
|
96
|
-
} else {
|
|
97
|
-
this.element.appendChild(sortIcon);
|
|
98
|
-
}
|
|
93
|
+
this.element.prepend(sortIcon);
|
|
99
94
|
}
|
|
100
95
|
if (options.tooltip) {
|
|
101
96
|
const wrapper = document.createElement('span');
|
|
102
|
-
wrapper.
|
|
103
|
-
const target = document.createElement('span');
|
|
104
|
-
target.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
} else if (typeof options.name === 'string') {
|
|
108
|
-
target.textContent = options.name;
|
|
109
|
-
} else {
|
|
110
|
-
target.appendChild(options.name);
|
|
111
|
-
}
|
|
112
|
-
const tooltip = document.createElement('div');
|
|
97
|
+
wrapper.className = 'mdw-tooltip__wrapper';
|
|
98
|
+
const target = wrapper.appendChild(document.createElement('span'));
|
|
99
|
+
target.className = 'mdw-tooltip__target';
|
|
100
|
+
target.append(options.name || '');
|
|
101
|
+
const tooltip = wrapper.appendChild(document.createElement('span'));
|
|
113
102
|
tooltip.className = 'mdw-tooltip mdw-theme';
|
|
114
103
|
tooltip.setAttribute('mdw-surface', 'background 700');
|
|
115
104
|
tooltip.setAttribute('mdw-dark', '');
|
|
116
105
|
tooltip.textContent = options.tooltip;
|
|
117
|
-
wrapper.appendChild(target);
|
|
118
|
-
wrapper.appendChild(tooltip);
|
|
119
106
|
this.element.appendChild(wrapper);
|
|
120
107
|
} else if (options.name) {
|
|
121
|
-
|
|
122
|
-
if (typeof options.name === 'string') {
|
|
123
|
-
node = document.createTextNode(options.name);
|
|
124
|
-
} else {
|
|
125
|
-
node = options.name;
|
|
126
|
-
}
|
|
127
|
-
this.element.appendChild(node);
|
|
108
|
+
this.element.append(options.name);
|
|
128
109
|
}
|
|
129
110
|
|
|
130
111
|
this.primaryColumn = options.primaryColumn;
|
|
@@ -146,7 +127,7 @@ export default class DataTableAdapterColumn {
|
|
|
146
127
|
case 'text':
|
|
147
128
|
this.element.setAttribute('mdw-text', '');
|
|
148
129
|
break;
|
|
149
|
-
case 'checkbox':
|
|
130
|
+
// case 'checkbox':
|
|
150
131
|
default:
|
|
151
132
|
}
|
|
152
133
|
|
|
@@ -177,12 +158,9 @@ export default class DataTableAdapterColumn {
|
|
|
177
158
|
if (!cell.classList.contains('mdw-autofocus-widget')) {
|
|
178
159
|
cell.classList.add('mdw-autofocus-widget');
|
|
179
160
|
}
|
|
180
|
-
let selectionElement = cell.getElementsByClassName('mdw-selection')[0];
|
|
181
161
|
const checked = !!value;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
cell.appendChild(selectionElement);
|
|
185
|
-
}
|
|
162
|
+
const selectionElement = cell.getElementsByClassName('mdw-selection')[0]
|
|
163
|
+
|| cell.appendChild(constructTableCheckbox());
|
|
186
164
|
Attributes.setChecked(selectionElement, checked);
|
|
187
165
|
}
|
|
188
166
|
|
|
@@ -192,12 +170,7 @@ export default class DataTableAdapterColumn {
|
|
|
192
170
|
* @return {void}
|
|
193
171
|
*/
|
|
194
172
|
static defaultCellRenderer(cell, value) {
|
|
195
|
-
|
|
196
|
-
if (value == null) {
|
|
197
|
-
stringValue = '';
|
|
198
|
-
} else {
|
|
199
|
-
stringValue = value.toString();
|
|
200
|
-
}
|
|
173
|
+
const stringValue = (value == null) ? '' : value.toString();
|
|
201
174
|
setTextNode(cell, stringValue);
|
|
202
175
|
}
|
|
203
176
|
}
|