material_design_lite-sass 1.1.1 → 1.1.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/material_design_lite/sass/version.rb +1 -1
- data/vendor/assets/fonts/material-icons/MaterialIcons-Regular.eot +0 -0
- data/vendor/assets/fonts/material-icons/MaterialIcons-Regular.ttf +0 -0
- data/vendor/assets/fonts/material-icons/MaterialIcons-Regular.woff +0 -0
- data/vendor/assets/fonts/material-icons/MaterialIcons-Regular.woff2 +0 -0
- data/vendor/assets/javascripts/material.js +40 -15
- data/vendor/assets/javascripts/material/layout.js +30 -5
- data/vendor/assets/javascripts/material/mdlComponentHandler.js +11 -9
- data/vendor/assets/javascripts/material/textfield.js +6 -1
- data/vendor/assets/stylesheets/material/_data-table.scss +13 -8
- data/vendor/assets/stylesheets/material/_snackbar.scss +10 -7
- data/vendor/assets/stylesheets/material/_textfield.scss +10 -3
- data/vendor/assets/stylesheets/material/_variables.scss +1 -0
- data/vendor/assets/stylesheets/material/resets/_h5bp.scss +1 -3
- 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: 4cbccd8bb0315b89d19cda7f3ae15954acbc09b3
|
4
|
+
data.tar.gz: f520969a2be4971d18ad2149a253131733f0f4b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bde90ce203444754ace504ba94a6e916b88fc0afbe5d9317c63a7099cb675037b6b370d1b016650077e8e5b5a03902a14926c919905d7e547baabd8ce98f1576
|
7
|
+
data.tar.gz: 7bc2f86ce72d2eb95cc9e476737a9c8968abae6962834761f68716c351312125ea03750ad1384b78decd18845634172d0a4a81ef19d5b4ee0efde3ecbad627f1
|
data/CHANGELOG.md
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -345,17 +345,19 @@ componentHandler = (function() {
|
|
345
345
|
* @param {?componentHandler.Component} component
|
346
346
|
*/
|
347
347
|
function deconstructComponentInternal(component) {
|
348
|
-
|
349
|
-
|
348
|
+
if (component) {
|
349
|
+
var componentIndex = createdComponents_.indexOf(component);
|
350
|
+
createdComponents_.splice(componentIndex, 1);
|
350
351
|
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
352
|
+
var upgrades = component.element_.getAttribute('data-upgraded').split(',');
|
353
|
+
var componentPlace = upgrades.indexOf(component[componentConfigProperty_].classAsString);
|
354
|
+
upgrades.splice(componentPlace, 1);
|
355
|
+
component.element_.setAttribute('data-upgraded', upgrades.join(','));
|
355
356
|
|
356
|
-
|
357
|
-
|
358
|
-
|
357
|
+
var ev = document.createEvent('Events');
|
358
|
+
ev.initEvent('mdl-componentdowngraded', true, true);
|
359
|
+
component.element_.dispatchEvent(ev);
|
360
|
+
}
|
359
361
|
}
|
360
362
|
|
361
363
|
/**
|
@@ -2774,7 +2776,8 @@ MaterialTextfield.prototype.CssClasses_ = {
|
|
2774
2776
|
IS_FOCUSED: 'is-focused',
|
2775
2777
|
IS_DISABLED: 'is-disabled',
|
2776
2778
|
IS_INVALID: 'is-invalid',
|
2777
|
-
IS_UPGRADED: 'is-upgraded'
|
2779
|
+
IS_UPGRADED: 'is-upgraded',
|
2780
|
+
HAS_PLACEHOLDER: 'has-placeholder'
|
2778
2781
|
};
|
2779
2782
|
/**
|
2780
2783
|
* Handle input being entered.
|
@@ -2928,6 +2931,9 @@ MaterialTextfield.prototype.init = function () {
|
|
2928
2931
|
this.maxRows = this.Constant_.NO_MAX_ROWS;
|
2929
2932
|
}
|
2930
2933
|
}
|
2934
|
+
if (this.input_.hasAttribute('placeholder')) {
|
2935
|
+
this.element_.classList.add(this.CssClasses_.HAS_PLACEHOLDER);
|
2936
|
+
}
|
2931
2937
|
this.boundUpdateClassesHandler = this.updateClasses_.bind(this);
|
2932
2938
|
this.boundFocusHandler = this.onFocus_.bind(this);
|
2933
2939
|
this.boundBlurHandler = this.onBlur_.bind(this);
|
@@ -3133,6 +3139,7 @@ window['MaterialLayout'] = MaterialLayout;
|
|
3133
3139
|
MaterialLayout.prototype.Constant_ = {
|
3134
3140
|
MAX_WIDTH: '(max-width: 1024px)',
|
3135
3141
|
TAB_SCROLL_PIXELS: 100,
|
3142
|
+
RESIZE_TIMEOUT: 100,
|
3136
3143
|
MENU_ICON: '',
|
3137
3144
|
CHEVRON_LEFT: 'chevron_left',
|
3138
3145
|
CHEVRON_RIGHT: 'chevron_right'
|
@@ -3235,7 +3242,8 @@ MaterialLayout.prototype.contentScrollHandler_ = function () {
|
|
3235
3242
|
* @private
|
3236
3243
|
*/
|
3237
3244
|
MaterialLayout.prototype.keyboardEventHandler_ = function (evt) {
|
3238
|
-
|
3245
|
+
// Only react when the drawer is open.
|
3246
|
+
if (evt.keyCode === this.Keycodes_.ESCAPE && this.drawer_.classList.contains(this.CssClasses_.IS_DRAWER_OPEN)) {
|
3239
3247
|
this.toggleDrawer();
|
3240
3248
|
}
|
3241
3249
|
};
|
@@ -3339,9 +3347,13 @@ MaterialLayout.prototype.init = function () {
|
|
3339
3347
|
if (this.element_) {
|
3340
3348
|
var container = document.createElement('div');
|
3341
3349
|
container.classList.add(this.CssClasses_.CONTAINER);
|
3350
|
+
var focusedElement = this.element_.querySelector(':focus');
|
3342
3351
|
this.element_.parentElement.insertBefore(container, this.element_);
|
3343
3352
|
this.element_.parentElement.removeChild(this.element_);
|
3344
3353
|
container.appendChild(this.element_);
|
3354
|
+
if (focusedElement) {
|
3355
|
+
focusedElement.focus();
|
3356
|
+
}
|
3345
3357
|
var directChildren = this.element_.childNodes;
|
3346
3358
|
var numChildren = directChildren.length;
|
3347
3359
|
for (var c = 0; c < numChildren; c++) {
|
@@ -3476,8 +3488,9 @@ MaterialLayout.prototype.init = function () {
|
|
3476
3488
|
tabContainer.appendChild(leftButton);
|
3477
3489
|
tabContainer.appendChild(this.tabBar_);
|
3478
3490
|
tabContainer.appendChild(rightButton);
|
3479
|
-
// Add and remove buttons depending on scroll position
|
3480
|
-
|
3491
|
+
// Add and remove tab buttons depending on scroll position and total
|
3492
|
+
// window size.
|
3493
|
+
var tabUpdateHandler = function () {
|
3481
3494
|
if (this.tabBar_.scrollLeft > 0) {
|
3482
3495
|
leftButton.classList.add(this.CssClasses_.IS_ACTIVE);
|
3483
3496
|
} else {
|
@@ -3489,8 +3502,20 @@ MaterialLayout.prototype.init = function () {
|
|
3489
3502
|
rightButton.classList.remove(this.CssClasses_.IS_ACTIVE);
|
3490
3503
|
}
|
3491
3504
|
}.bind(this);
|
3492
|
-
this.tabBar_.addEventListener('scroll',
|
3493
|
-
|
3505
|
+
this.tabBar_.addEventListener('scroll', tabUpdateHandler);
|
3506
|
+
tabUpdateHandler();
|
3507
|
+
// Update tabs when the window resizes.
|
3508
|
+
var windowResizeHandler = function () {
|
3509
|
+
// Use timeouts to make sure it doesn't happen too often.
|
3510
|
+
if (this.resizeTimeoutId_) {
|
3511
|
+
clearTimeout(this.resizeTimeoutId_);
|
3512
|
+
}
|
3513
|
+
this.resizeTimeoutId_ = setTimeout(function () {
|
3514
|
+
tabUpdateHandler();
|
3515
|
+
this.resizeTimeoutId_ = null;
|
3516
|
+
}.bind(this), this.Constant_.RESIZE_TIMEOUT);
|
3517
|
+
}.bind(this);
|
3518
|
+
window.addEventListener('resize', windowResizeHandler);
|
3494
3519
|
if (this.tabBar_.classList.contains(this.CssClasses_.JS_RIPPLE_EFFECT)) {
|
3495
3520
|
this.tabBar_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS);
|
3496
3521
|
}
|
@@ -43,6 +43,7 @@
|
|
43
43
|
MaterialLayout.prototype.Constant_ = {
|
44
44
|
MAX_WIDTH: '(max-width: 1024px)',
|
45
45
|
TAB_SCROLL_PIXELS: 100,
|
46
|
+
RESIZE_TIMEOUT: 100,
|
46
47
|
|
47
48
|
MENU_ICON: '',
|
48
49
|
CHEVRON_LEFT: 'chevron_left',
|
@@ -165,7 +166,9 @@
|
|
165
166
|
* @private
|
166
167
|
*/
|
167
168
|
MaterialLayout.prototype.keyboardEventHandler_ = function(evt) {
|
168
|
-
|
169
|
+
// Only react when the drawer is open.
|
170
|
+
if (evt.keyCode === this.Keycodes_.ESCAPE &&
|
171
|
+
this.drawer_.classList.contains(this.CssClasses_.IS_DRAWER_OPEN)) {
|
169
172
|
this.toggleDrawer();
|
170
173
|
}
|
171
174
|
};
|
@@ -280,10 +283,17 @@
|
|
280
283
|
if (this.element_) {
|
281
284
|
var container = document.createElement('div');
|
282
285
|
container.classList.add(this.CssClasses_.CONTAINER);
|
286
|
+
|
287
|
+
var focusedElement = this.element_.querySelector(':focus');
|
288
|
+
|
283
289
|
this.element_.parentElement.insertBefore(container, this.element_);
|
284
290
|
this.element_.parentElement.removeChild(this.element_);
|
285
291
|
container.appendChild(this.element_);
|
286
292
|
|
293
|
+
if (focusedElement) {
|
294
|
+
focusedElement.focus();
|
295
|
+
}
|
296
|
+
|
287
297
|
var directChildren = this.element_.childNodes;
|
288
298
|
var numChildren = directChildren.length;
|
289
299
|
for (var c = 0; c < numChildren; c++) {
|
@@ -453,8 +463,9 @@
|
|
453
463
|
tabContainer.appendChild(this.tabBar_);
|
454
464
|
tabContainer.appendChild(rightButton);
|
455
465
|
|
456
|
-
// Add and remove buttons depending on scroll position
|
457
|
-
|
466
|
+
// Add and remove tab buttons depending on scroll position and total
|
467
|
+
// window size.
|
468
|
+
var tabUpdateHandler = function() {
|
458
469
|
if (this.tabBar_.scrollLeft > 0) {
|
459
470
|
leftButton.classList.add(this.CssClasses_.IS_ACTIVE);
|
460
471
|
} else {
|
@@ -469,8 +480,22 @@
|
|
469
480
|
}
|
470
481
|
}.bind(this);
|
471
482
|
|
472
|
-
this.tabBar_.addEventListener('scroll',
|
473
|
-
|
483
|
+
this.tabBar_.addEventListener('scroll', tabUpdateHandler);
|
484
|
+
tabUpdateHandler();
|
485
|
+
|
486
|
+
// Update tabs when the window resizes.
|
487
|
+
var windowResizeHandler = function() {
|
488
|
+
// Use timeouts to make sure it doesn't happen too often.
|
489
|
+
if (this.resizeTimeoutId_) {
|
490
|
+
clearTimeout(this.resizeTimeoutId_);
|
491
|
+
}
|
492
|
+
this.resizeTimeoutId_ = setTimeout(function() {
|
493
|
+
tabUpdateHandler();
|
494
|
+
this.resizeTimeoutId_ = null;
|
495
|
+
}.bind(this), /** @type {number} */ (this.Constant_.RESIZE_TIMEOUT));
|
496
|
+
}.bind(this);
|
497
|
+
|
498
|
+
window.addEventListener('resize', windowResizeHandler);
|
474
499
|
|
475
500
|
if (this.tabBar_.classList.contains(this.CssClasses_.JS_RIPPLE_EFFECT)) {
|
476
501
|
this.tabBar_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS);
|
@@ -342,17 +342,19 @@ componentHandler = (function() {
|
|
342
342
|
* @param {?componentHandler.Component} component
|
343
343
|
*/
|
344
344
|
function deconstructComponentInternal(component) {
|
345
|
-
|
346
|
-
|
345
|
+
if (component) {
|
346
|
+
var componentIndex = createdComponents_.indexOf(component);
|
347
|
+
createdComponents_.splice(componentIndex, 1);
|
347
348
|
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
349
|
+
var upgrades = component.element_.getAttribute('data-upgraded').split(',');
|
350
|
+
var componentPlace = upgrades.indexOf(component[componentConfigProperty_].classAsString);
|
351
|
+
upgrades.splice(componentPlace, 1);
|
352
|
+
component.element_.setAttribute('data-upgraded', upgrades.join(','));
|
352
353
|
|
353
|
-
|
354
|
-
|
355
|
-
|
354
|
+
var ev = document.createEvent('Events');
|
355
|
+
ev.initEvent('mdl-componentdowngraded', true, true);
|
356
|
+
component.element_.dispatchEvent(ev);
|
357
|
+
}
|
356
358
|
}
|
357
359
|
|
358
360
|
/**
|
@@ -60,7 +60,8 @@
|
|
60
60
|
IS_FOCUSED: 'is-focused',
|
61
61
|
IS_DISABLED: 'is-disabled',
|
62
62
|
IS_INVALID: 'is-invalid',
|
63
|
-
IS_UPGRADED: 'is-upgraded'
|
63
|
+
IS_UPGRADED: 'is-upgraded',
|
64
|
+
HAS_PLACEHOLDER: 'has-placeholder'
|
64
65
|
};
|
65
66
|
|
66
67
|
/**
|
@@ -238,6 +239,10 @@
|
|
238
239
|
}
|
239
240
|
}
|
240
241
|
|
242
|
+
if (this.input_.hasAttribute('placeholder')) {
|
243
|
+
this.element_.classList.add(this.CssClasses_.HAS_PLACEHOLDER);
|
244
|
+
}
|
245
|
+
|
241
246
|
this.boundUpdateClassesHandler = this.updateClasses_.bind(this);
|
242
247
|
this.boundFocusHandler = this.onFocus_.bind(this);
|
243
248
|
this.boundBlurHandler = this.onBlur_.bind(this);
|
@@ -88,19 +88,24 @@
|
|
88
88
|
padding-bottom: 8px;
|
89
89
|
box-sizing: border-box;
|
90
90
|
|
91
|
-
|
91
|
+
&.mdl-data-table__header--sorted-ascending,
|
92
|
+
&.mdl-data-table__header--sorted-descending {
|
92
93
|
color: $data-table-header-sorted-color;
|
93
94
|
&:before {
|
94
|
-
font-size: $data-table-header-sort-icon-size;
|
95
95
|
@include typo-icon;
|
96
|
+
font-size: $data-table-header-sort-icon-size;
|
97
|
+
content: "\e5d8";
|
98
|
+
margin-right: 5px;
|
99
|
+
vertical-align: sub;
|
100
|
+
}
|
101
|
+
&:hover {
|
102
|
+
cursor: pointer;
|
103
|
+
&:before {
|
104
|
+
color: $data-table-header-sorted-icon-hover-color;
|
105
|
+
}
|
96
106
|
}
|
97
107
|
}
|
98
|
-
|
99
|
-
.mdl-data-table__header--sorted-ascending:before {
|
100
|
-
content: "\e5d8";
|
101
|
-
}
|
102
|
-
|
103
|
-
.mdl-data-table__header--sorted-descending:before {
|
108
|
+
&.mdl-data-table__header--sorted-descending:before {
|
104
109
|
content: "\e5db";
|
105
110
|
}
|
106
111
|
}
|
@@ -21,14 +21,15 @@
|
|
21
21
|
position: fixed;
|
22
22
|
bottom: 0;
|
23
23
|
left: 50%;
|
24
|
-
margin-right: -50%;
|
25
24
|
cursor: default;
|
26
25
|
background-color: $snackbar-background-color;
|
27
|
-
z-index:
|
26
|
+
z-index: 3;
|
27
|
+
display: block;
|
28
28
|
display: flex;
|
29
|
+
justify-content: space-between;
|
29
30
|
font-family: $preferred_font;
|
30
31
|
will-change: transform;
|
31
|
-
transform: translate(
|
32
|
+
transform: translate(-50%, 80px);
|
32
33
|
transition: transform 0.25s $animation-curve-fast-out-linear-in;
|
33
34
|
pointer-events: none;
|
34
35
|
@media(max-width: $snackbar-tablet-breakpoint - 1) {
|
@@ -43,23 +44,25 @@
|
|
43
44
|
border-radius: 2px;
|
44
45
|
}
|
45
46
|
&--active {
|
46
|
-
transform: translate(
|
47
|
+
transform: translate(-50%, 0);
|
47
48
|
pointer-events: auto;
|
48
49
|
transition: transform 0.25s $animation-curve-linear-out-slow-in;
|
49
50
|
}
|
50
51
|
|
51
52
|
&__text {
|
52
|
-
padding: 14px 24px;
|
53
|
+
padding: 14px 12px 14px 24px;
|
53
54
|
vertical-align: middle;
|
54
55
|
color: white;
|
56
|
+
float: left;
|
55
57
|
}
|
56
58
|
|
57
59
|
&__action {
|
58
60
|
background: transparent;
|
59
61
|
border: none;
|
60
62
|
color: $snackbar-action-color;
|
63
|
+
float: right;
|
61
64
|
text-transform: uppercase;
|
62
|
-
padding: 14px 24px;
|
65
|
+
padding: 14px 24px 14px 12px;
|
63
66
|
@include typo-button();
|
64
67
|
overflow: hidden;
|
65
68
|
outline: none;
|
@@ -68,7 +71,7 @@
|
|
68
71
|
cursor: pointer;
|
69
72
|
text-decoration: none;
|
70
73
|
text-align: center;
|
71
|
-
|
74
|
+
align-self: center;
|
72
75
|
|
73
76
|
&::-moz-focus-inner {
|
74
77
|
border: 0;
|
@@ -113,7 +113,8 @@
|
|
113
113
|
white-space: nowrap;
|
114
114
|
text-align: left;
|
115
115
|
|
116
|
-
.mdl-textfield.is-dirty
|
116
|
+
.mdl-textfield.is-dirty &,
|
117
|
+
.mdl-textfield.has-placeholder & {
|
117
118
|
visibility: hidden;
|
118
119
|
}
|
119
120
|
|
@@ -122,13 +123,18 @@
|
|
122
123
|
@include material-animation-default();
|
123
124
|
}
|
124
125
|
|
126
|
+
.mdl-textfield--floating-label.has-placeholder & {
|
127
|
+
transition: none;
|
128
|
+
}
|
129
|
+
|
125
130
|
fieldset[disabled] .mdl-textfield &,
|
126
131
|
.mdl-textfield.is-disabled.is-disabled & {
|
127
132
|
color: $input-text-disabled-text-color;
|
128
133
|
}
|
129
134
|
|
130
135
|
.mdl-textfield--floating-label.is-focused &,
|
131
|
-
.mdl-textfield--floating-label.is-dirty
|
136
|
+
.mdl-textfield--floating-label.is-dirty &,
|
137
|
+
.mdl-textfield--floating-label.has-placeholder & {
|
132
138
|
color: $input-text-highlight-color;
|
133
139
|
font-size : $input-text-floating-label-fontsize;
|
134
140
|
top: $input-text-vertical-spacing - ($input-text-floating-label-fontsize + $input-text-padding);
|
@@ -136,7 +142,8 @@
|
|
136
142
|
}
|
137
143
|
|
138
144
|
.mdl-textfield--floating-label.is-focused .mdl-textfield__expandable-holder &,
|
139
|
-
.mdl-textfield--floating-label.is-dirty .mdl-textfield__expandable-holder
|
145
|
+
.mdl-textfield--floating-label.is-dirty .mdl-textfield__expandable-holder &,
|
146
|
+
.mdl-textfield--floating-label.has-placeholder .mdl-textfield__expandable-holder & {
|
140
147
|
top: -($input-text-floating-label-fontsize + $input-text-padding);
|
141
148
|
}
|
142
149
|
|
@@ -548,6 +548,7 @@ $data-table-header-sort-icon-size: 16px !default;
|
|
548
548
|
|
549
549
|
$data-table-header-color: rgba(#000, 0.54) !default;
|
550
550
|
$data-table-header-sorted-color: rgba(#000, 0.87) !default;
|
551
|
+
$data-table-header-sorted-icon-hover-color: rgba(#000, 0.26) !default;
|
551
552
|
$data-table-divider-color: rgba(#000, 0.12) !default;
|
552
553
|
|
553
554
|
$data-table-hover-color: #eeeeee !default;
|
@@ -222,12 +222,10 @@ textarea {
|
|
222
222
|
*,
|
223
223
|
*:before,
|
224
224
|
*:after,
|
225
|
-
*:first-letter
|
226
|
-
*:first-line {
|
225
|
+
*:first-letter {
|
227
226
|
background: transparent !important;
|
228
227
|
color: #000 !important; /* Black prints faster: http://www.sanbeiji.com/archives/953 */
|
229
228
|
box-shadow: none !important;
|
230
|
-
text-shadow: none !important;
|
231
229
|
}
|
232
230
|
|
233
231
|
a,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: material_design_lite-sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitriy Tarasov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|