material_components_web-sass 0.16.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/material_components_web/sass/version.rb +1 -1
- data/vendor/assets/javascripts/material-components-web.js +60 -22
- data/vendor/assets/stylesheets/@material/button/mdc-button.scss +0 -2
- data/vendor/assets/stylesheets/@material/dialog/mdc-dialog.scss +4 -0
- data/vendor/assets/stylesheets/@material/textfield/mdc-textfield.scss +7 -7
- data/vendor/assets/stylesheets/@material/typography/_mixins.scss +2 -0
- data/vendor/assets/stylesheets/@material/typography/_variables.scss +42 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eac14048c740bfb8029b33e56a94a305d1e9bf2c
|
4
|
+
data.tar.gz: 343c168aaf1bd21c52eb02d3890bfe74cddc68cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b40fdc2774ef2fa9fbbb36a437e939f3e4935b13c0aec661f71d85c42c1d855af50ef8fde1463c7cc813d0eea11de0076751bf269f8548a1b7435265c6fde98d
|
7
|
+
data.tar.gz: 26cf7f78b33fc2a87db4a99699a1fb506ee261cd00ea24bca696813a6202b94692f10cee6e95bb35650d57088534ee8456350ddef5680b84cc6f11642b219b0a
|
data/CHANGELOG.md
CHANGED
@@ -993,14 +993,56 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
993
993
|
* limitations under the License.
|
994
994
|
*/
|
995
995
|
|
996
|
-
/**
|
996
|
+
/**
|
997
|
+
* Stores result from supportsCssVariables to avoid redundant processing to detect CSS custom variable support.
|
998
|
+
* @private {boolean|undefined}
|
999
|
+
*/
|
1000
|
+
var supportsCssVariables_ = void 0;
|
1001
|
+
|
1002
|
+
/**
|
1003
|
+
* Stores result from applyPassive to avoid redundant processing to detect passive event listener support.
|
1004
|
+
* @private {boolean|undefined}
|
1005
|
+
*/
|
997
1006
|
var supportsPassive_ = void 0;
|
998
1007
|
|
999
1008
|
/**
|
1000
1009
|
* @param {!Window} windowObj
|
1010
|
+
* @return {boolean}
|
1011
|
+
*/
|
1012
|
+
function detectEdgePseudoVarBug(windowObj) {
|
1013
|
+
// Detect versions of Edge with buggy var() support
|
1014
|
+
// See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11495448/
|
1015
|
+
var document = windowObj.document;
|
1016
|
+
var className = 'test-edge-css-var';
|
1017
|
+
var styleNode = document.createElement('style');
|
1018
|
+
document.head.appendChild(styleNode);
|
1019
|
+
var sheet = styleNode.sheet;
|
1020
|
+
// Internet Explorer 11 requires indices to always be specified to insertRule
|
1021
|
+
sheet.insertRule(':root { --' + className + ': 1px solid #000; }', 0);
|
1022
|
+
sheet.insertRule('.' + className + ' { visibility: hidden; }', 1);
|
1023
|
+
sheet.insertRule('.' + className + '::before { border: var(--' + className + '); }', 2);
|
1024
|
+
var node = document.createElement('div');
|
1025
|
+
node.className = className;
|
1026
|
+
document.body.appendChild(node);
|
1027
|
+
// Bug exists if ::before style ends up propagating to the parent element
|
1028
|
+
var hasPseudoVarBug = windowObj.getComputedStyle(node).borderTopStyle === 'solid';
|
1029
|
+
node.remove();
|
1030
|
+
styleNode.remove();
|
1031
|
+
return hasPseudoVarBug;
|
1032
|
+
}
|
1033
|
+
|
1034
|
+
/**
|
1035
|
+
* @param {!Window} windowObj
|
1036
|
+
* @param {boolean=} forceRefresh
|
1001
1037
|
* @return {boolean|undefined}
|
1002
1038
|
*/
|
1003
1039
|
function supportsCssVariables(windowObj) {
|
1040
|
+
var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
1041
|
+
|
1042
|
+
if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {
|
1043
|
+
return supportsCssVariables_;
|
1044
|
+
}
|
1045
|
+
|
1004
1046
|
var supportsFunctionPresent = windowObj.CSS && typeof windowObj.CSS.supports === 'function';
|
1005
1047
|
if (!supportsFunctionPresent) {
|
1006
1048
|
return;
|
@@ -1010,7 +1052,13 @@ function supportsCssVariables(windowObj) {
|
|
1010
1052
|
// See: https://bugs.webkit.org/show_bug.cgi?id=154669
|
1011
1053
|
// See: README section on Safari
|
1012
1054
|
var weAreFeatureDetectingSafari10plus = windowObj.CSS.supports('(--css-vars: yes)') && windowObj.CSS.supports('color', '#00000000');
|
1013
|
-
|
1055
|
+
|
1056
|
+
if (explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus) {
|
1057
|
+
supportsCssVariables_ = !detectEdgePseudoVarBug(windowObj);
|
1058
|
+
} else {
|
1059
|
+
supportsCssVariables_ = false;
|
1060
|
+
}
|
1061
|
+
return supportsCssVariables_;
|
1014
1062
|
}
|
1015
1063
|
|
1016
1064
|
//
|
@@ -4253,7 +4301,7 @@ module.exports = function(el) {
|
|
4253
4301
|
var candidate, candidateIndex;
|
4254
4302
|
for (var i = 0, l = candidates.length; i < l; i++) {
|
4255
4303
|
candidate = candidates[i];
|
4256
|
-
candidateIndex = candidate.tabIndex;
|
4304
|
+
candidateIndex = parseInt(candidate.getAttribute('tabindex'), 10) || candidate.tabIndex;
|
4257
4305
|
|
4258
4306
|
if (
|
4259
4307
|
candidateIndex < 0
|
@@ -9008,20 +9056,13 @@ var MDCSelectFoundation = function (_MDCFoundation) {
|
|
9008
9056
|
|
9009
9057
|
var focusIndex = this.selectedIndex_ < 0 ? 0 : this.selectedIndex_;
|
9010
9058
|
|
9011
|
-
|
9012
|
-
left = _computeMenuStylesFor.left,
|
9013
|
-
top = _computeMenuStylesFor.top,
|
9014
|
-
transformOrigin = _computeMenuStylesFor.transformOrigin;
|
9015
|
-
|
9016
|
-
this.adapter_.setMenuElStyle('left', left);
|
9017
|
-
this.adapter_.setMenuElStyle('top', top);
|
9018
|
-
this.adapter_.setMenuElStyle('transform-origin', transformOrigin);
|
9059
|
+
this.setMenuStylesForOpenAtIndex_(focusIndex);
|
9019
9060
|
this.adapter_.addClass(OPEN);
|
9020
9061
|
this.adapter_.openMenu(focusIndex);
|
9021
9062
|
}
|
9022
9063
|
}, {
|
9023
|
-
key: '
|
9024
|
-
value: function
|
9064
|
+
key: 'setMenuStylesForOpenAtIndex_',
|
9065
|
+
value: function setMenuStylesForOpenAtIndex_(index) {
|
9025
9066
|
var innerHeight = this.adapter_.getWindowInnerHeight();
|
9026
9067
|
|
9027
9068
|
var _adapter_$computeBoun = this.adapter_.computeBoundingRect(),
|
@@ -9036,20 +9077,17 @@ var MDCSelectFoundation = function (_MDCFoundation) {
|
|
9036
9077
|
this.adapter_.rmMenuElAttr('aria-hidden');
|
9037
9078
|
|
9038
9079
|
var adjustedTop = top - itemOffsetTop;
|
9039
|
-
var adjustedHeight = menuHeight - itemOffsetTop;
|
9040
9080
|
var overflowsTop = adjustedTop < 0;
|
9041
|
-
var overflowsBottom = adjustedTop +
|
9081
|
+
var overflowsBottom = adjustedTop + menuHeight > innerHeight;
|
9042
9082
|
if (overflowsTop) {
|
9043
9083
|
adjustedTop = 0;
|
9044
9084
|
} else if (overflowsBottom) {
|
9045
|
-
adjustedTop = Math.max(0,
|
9046
|
-
}
|
9047
|
-
|
9048
|
-
return {
|
9049
|
-
left: left + 'px',
|
9050
|
-
top: adjustedTop + 'px',
|
9051
|
-
transformOrigin: 'center ' + itemOffsetTop + 'px'
|
9085
|
+
adjustedTop = Math.max(0, innerHeight - menuHeight);
|
9052
9086
|
};
|
9087
|
+
|
9088
|
+
this.adapter_.setMenuElStyle('left', left + 'px');
|
9089
|
+
this.adapter_.setMenuElStyle('top', adjustedTop + 'px');
|
9090
|
+
this.adapter_.setMenuElStyle('transform-origin', 'center ' + itemOffsetTop + 'px');
|
9053
9091
|
}
|
9054
9092
|
}, {
|
9055
9093
|
key: 'close_',
|
@@ -35,20 +35,20 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
|
|
35
35
|
|
36
36
|
// postcss-bem-linter: define textfield
|
37
37
|
.mdc-textfield {
|
38
|
-
@include mdc-typography-base;
|
39
|
-
// We use only a subset of the MDC typography values here as changing things such as line-height
|
40
|
-
// affects how the labels are transformed.
|
41
|
-
@each $prop in (font-size, letter-spacing) {
|
42
|
-
#{$prop}: map-get(map-get($mdc-typography-styles, subheading2), $prop);
|
43
|
-
}
|
44
|
-
|
45
38
|
display: inline-block;
|
46
39
|
margin-bottom: 8px;
|
47
40
|
will-change: opacity, transform, color;
|
48
41
|
|
49
42
|
&__input {
|
50
43
|
@include mdc-theme-prop(color, text-primary-on-light);
|
44
|
+
@include mdc-typography-base;
|
45
|
+
// We use only a subset of the MDC typography values here as changing things such as line-height
|
46
|
+
// affects how the labels are transformed.
|
47
|
+
@each $prop in (font-size, letter-spacing) {
|
48
|
+
#{$prop}: map-get(map-get($mdc-typography-styles, subheading2), $prop);
|
49
|
+
}
|
51
50
|
|
51
|
+
width: 100%;
|
52
52
|
padding: 0 0 8px;
|
53
53
|
border: none;
|
54
54
|
background: none;
|
@@ -35,6 +35,8 @@
|
|
35
35
|
font-weight: #{map-get($style-props, font-weight)};
|
36
36
|
letter-spacing: map-get($style-props, letter-spacing);
|
37
37
|
line-height: map-get($style-props, line-height);
|
38
|
+
text-decoration: map-get($style-props, text-decoration);
|
39
|
+
text-transform: map-get($style-props, text-transform);
|
38
40
|
}
|
39
41
|
|
40
42
|
@mixin mdc-typography-adjust-margin($style) {
|
@@ -35,76 +35,107 @@ $mdc-typography-styles: (
|
|
35
35
|
line-height: 7rem, /* 112sp */
|
36
36
|
font-weight: map-get($mdc-typography-font-weight-values, light),
|
37
37
|
letter-spacing: -.04em,
|
38
|
-
margin: -1rem 0 3.5rem -.085em /* -16sp 0 56sp -.085em
|
38
|
+
margin: -1rem 0 3.5rem -.085em /* -16sp 0 56sp -.085em */,
|
39
|
+
text-decoration: inherit,
|
40
|
+
text-transform: inherit
|
39
41
|
),
|
40
42
|
display3: (
|
41
43
|
font-size: 3.5rem, /* 56px */
|
42
44
|
line-height: 3.5rem, /* 56px */
|
43
45
|
font-weight: map-get($mdc-typography-font-weight-values, regular),
|
44
46
|
letter-spacing: -.02em,
|
45
|
-
margin: -8px 0 64px -.07em
|
47
|
+
margin: -8px 0 64px -.07em,
|
48
|
+
text-decoration: inherit,
|
49
|
+
text-transform: inherit
|
46
50
|
),
|
47
51
|
display2: (
|
48
52
|
font-size: 2.813rem, /* 45px */
|
49
53
|
line-height: 3rem, /* 48px */
|
50
54
|
font-weight: map-get($mdc-typography-font-weight-values, regular),
|
51
55
|
letter-spacing: normal,
|
52
|
-
margin: -.5rem 0 4rem -.07em /* -8sp 0 64sp -.07em
|
56
|
+
margin: -.5rem 0 4rem -.07em /* -8sp 0 64sp -.07em */,
|
57
|
+
text-decoration: inherit,
|
58
|
+
text-transform: inherit
|
53
59
|
),
|
54
60
|
display1: (
|
55
61
|
font-size: 2.125rem, /* 34sp */
|
56
62
|
line-height: 2.5rem, /* 40sp */
|
57
63
|
font-weight: map-get($mdc-typography-font-weight-values, regular),
|
58
64
|
letter-spacing: normal,
|
59
|
-
margin: -.5rem 0 4rem -.07em /* -8sp 0 64sp -.07em
|
65
|
+
margin: -.5rem 0 4rem -.07em /* -8sp 0 64sp -.07em */,
|
66
|
+
text-decoration: inherit,
|
67
|
+
text-transform: inherit
|
60
68
|
),
|
61
69
|
headline: (
|
62
70
|
font-size: 1.5rem, /* 24sp */
|
63
71
|
line-height: 2rem, /* 32sp */
|
64
72
|
font-weight: map-get($mdc-typography-font-weight-values, regular),
|
65
73
|
letter-spacing: normal,
|
66
|
-
margin: -.5rem 0 1rem -.06em /* -8sp 0 16sp -.06em
|
74
|
+
margin: -.5rem 0 1rem -.06em /* -8sp 0 16sp -.06em */,
|
75
|
+
text-decoration: inherit,
|
76
|
+
text-transform: inherit
|
67
77
|
),
|
68
78
|
title: (
|
69
79
|
font-size: 1.25rem, /* 20sp */
|
70
80
|
line-height: 2rem, /* 32sp */
|
71
81
|
font-weight: map-get($mdc-typography-font-weight-values, medium),
|
72
82
|
letter-spacing: .02em,
|
73
|
-
margin: -.5rem 0 1rem -.05em /* -8sp 0 16sp -.05em
|
83
|
+
margin: -.5rem 0 1rem -.05em /* -8sp 0 16sp -.05em */,
|
84
|
+
text-decoration: inherit,
|
85
|
+
text-transform: inherit
|
74
86
|
),
|
75
87
|
subheading2: (
|
76
88
|
font-size: 1rem, /* 16sp */
|
77
89
|
line-height: 1.75rem, /* 28sp */
|
78
90
|
font-weight: map-get($mdc-typography-font-weight-values, regular),
|
79
91
|
letter-spacing: .04em,
|
80
|
-
margin: -.5rem 0 1rem -.06em /* -8sp 0 16sp -.06em
|
92
|
+
margin: -.5rem 0 1rem -.06em /* -8sp 0 16sp -.06em */,
|
93
|
+
text-decoration: inherit,
|
94
|
+
text-transform: inherit
|
81
95
|
),
|
82
96
|
subheading1: (
|
83
97
|
font-size: .938rem, /* 15sp */
|
84
98
|
line-height: 1.5rem, /* 24sp */
|
85
99
|
font-weight: map-get($mdc-typography-font-weight-values, regular),
|
86
100
|
letter-spacing: .04em,
|
87
|
-
margin: -.313rem 0 .813rem -.06em /* -5sp 0 13sp -.06em
|
101
|
+
margin: -.313rem 0 .813rem -.06em /* -5sp 0 13sp -.06em */,
|
102
|
+
text-decoration: inherit,
|
103
|
+
text-transform: inherit
|
88
104
|
),
|
89
105
|
body2: (
|
90
106
|
font-size: .875rem, /* 14sp */
|
91
107
|
line-height: 1.5rem, /* 24sp */
|
92
108
|
font-weight: map-get($mdc-typography-font-weight-values, medium),
|
93
109
|
letter-spacing: .04em,
|
94
|
-
margin: -.25rem 0 .75rem 0 /* -4sp 0 12sp 0
|
110
|
+
margin: -.25rem 0 .75rem 0 /* -4sp 0 12sp 0 */,
|
111
|
+
text-decoration: inherit,
|
112
|
+
text-transform: inherit
|
95
113
|
),
|
96
114
|
body1: (
|
97
115
|
font-size: .875rem, /* 14sp */
|
98
116
|
line-height: 1.25rem, /* 20sp */
|
99
117
|
font-weight: map-get($mdc-typography-font-weight-values, regular),
|
100
118
|
letter-spacing: .04em,
|
101
|
-
margin: -.25rem 0 .75rem 0 /* -4sp 0 12sp 0
|
119
|
+
margin: -.25rem 0 .75rem 0 /* -4sp 0 12sp 0 */,
|
120
|
+
text-decoration: inherit,
|
121
|
+
text-transform: inherit
|
102
122
|
),
|
103
123
|
caption: (
|
104
124
|
font-size: .75rem, /* 12sp */
|
105
125
|
line-height: 1.25rem, /* 20sp */
|
106
126
|
font-weight: map-get($mdc-typography-font-weight-values, regular),
|
107
127
|
letter-spacing: .08em,
|
108
|
-
margin: -.5rem 0 1rem -.04em /* -8sp 0 16sp -.04em
|
128
|
+
margin: -.5rem 0 1rem -.04em /* -8sp 0 16sp -.04em */,
|
129
|
+
text-decoration: inherit,
|
130
|
+
text-transform: inherit
|
131
|
+
),
|
132
|
+
button: (
|
133
|
+
font-size: .875rem, /* 14sp */
|
134
|
+
line-height: 2.25rem, /* 36sp */
|
135
|
+
font-weight: map-get($mdc-typography-font-weight-values, medium),
|
136
|
+
letter-spacing: .04em,
|
137
|
+
margin: inherit /* We do not have adjust margin for button */,
|
138
|
+
text-decoration: none,
|
139
|
+
text-transform: uppercase
|
109
140
|
)
|
110
141
|
) !default;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: material_components_web-sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitriy Tarasov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: autoprefixer-rails
|