material_design_lite-sass 1.0.4.2 → 1.0.5
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_design_lite/sass/engine.rb +2 -1
- data/lib/material_design_lite/sass/version.rb +1 -1
- data/vendor/assets/images/buffer.svg +9 -0
- data/vendor/assets/images/tick-mask.svg +30 -0
- data/vendor/assets/images/tick.svg +15 -0
- data/vendor/assets/javascripts/material.js +363 -139
- data/vendor/assets/javascripts/material/button.js +5 -3
- data/vendor/assets/javascripts/material/checkbox.js +14 -6
- data/vendor/assets/javascripts/material/data-table.js +23 -19
- data/vendor/assets/javascripts/material/icon-toggle.js +16 -6
- data/vendor/assets/javascripts/material/layout.js +32 -11
- data/vendor/assets/javascripts/material/mdlComponentHandler.js +160 -51
- data/vendor/assets/javascripts/material/menu.js +13 -9
- data/vendor/assets/javascripts/material/progress.js +10 -5
- data/vendor/assets/javascripts/material/rAF.js +19 -7
- data/vendor/assets/javascripts/material/radio.js +15 -7
- data/vendor/assets/javascripts/material/ripple.js +28 -3
- data/vendor/assets/javascripts/material/slider.js +10 -6
- data/vendor/assets/javascripts/material/spinner.js +8 -4
- data/vendor/assets/javascripts/material/switch.js +14 -5
- data/vendor/assets/javascripts/material/tabs.js +11 -3
- data/vendor/assets/javascripts/material/textfield.js +19 -6
- data/vendor/assets/javascripts/material/tooltip.js +4 -3
- data/vendor/assets/stylesheets/_material.scss +0 -0
- data/vendor/assets/stylesheets/material/_checkbox.scss +3 -3
- data/vendor/assets/stylesheets/material/_layout.scss +2 -2
- data/vendor/assets/stylesheets/material/_progress.scss +1 -1
- data/vendor/assets/stylesheets/material/_variables.scss +5 -0
- metadata +5 -2
@@ -32,12 +32,12 @@
|
|
32
32
|
// Initialize instance.
|
33
33
|
this.init();
|
34
34
|
};
|
35
|
-
window
|
35
|
+
window['MaterialSpinner'] = MaterialSpinner;
|
36
36
|
|
37
37
|
/**
|
38
38
|
* Store constants in one place so they can be updated easily.
|
39
39
|
*
|
40
|
-
* @enum {
|
40
|
+
* @enum {string | number}
|
41
41
|
* @private
|
42
42
|
*/
|
43
43
|
MaterialSpinner.prototype.Constant_ = {
|
@@ -49,7 +49,7 @@
|
|
49
49
|
* JavaScript. This allows us to simply change it in one place should we
|
50
50
|
* decide to modify at a later date.
|
51
51
|
*
|
52
|
-
* @enum {
|
52
|
+
* @enum {string}
|
53
53
|
* @private
|
54
54
|
*/
|
55
55
|
MaterialSpinner.prototype.CssClasses_ = {
|
@@ -64,7 +64,7 @@
|
|
64
64
|
/**
|
65
65
|
* Auxiliary method to create a spinner layer.
|
66
66
|
*
|
67
|
-
* @param {
|
67
|
+
* @param {number} index Index of the layer to be created.
|
68
68
|
* @public
|
69
69
|
*/
|
70
70
|
MaterialSpinner.prototype.createLayer = function(index) {
|
@@ -97,6 +97,8 @@
|
|
97
97
|
|
98
98
|
this.element_.appendChild(layer);
|
99
99
|
};
|
100
|
+
MaterialSpinner.prototype['createLayer'] =
|
101
|
+
MaterialSpinner.prototype.createLayer;
|
100
102
|
|
101
103
|
/**
|
102
104
|
* Stops the spinner animation.
|
@@ -107,6 +109,7 @@
|
|
107
109
|
MaterialSpinner.prototype.stop = function() {
|
108
110
|
this.element_.classList.remove('is-active');
|
109
111
|
};
|
112
|
+
MaterialSpinner.prototype['stop'] = MaterialSpinner.prototype.stop;
|
110
113
|
|
111
114
|
/**
|
112
115
|
* Starts the spinner animation.
|
@@ -118,6 +121,7 @@
|
|
118
121
|
MaterialSpinner.prototype.start = function() {
|
119
122
|
this.element_.classList.add('is-active');
|
120
123
|
};
|
124
|
+
MaterialSpinner.prototype['start'] = MaterialSpinner.prototype.start;
|
121
125
|
|
122
126
|
/**
|
123
127
|
* Initialize element.
|
@@ -23,6 +23,7 @@
|
|
23
23
|
* Implements MDL component design pattern defined at:
|
24
24
|
* https://github.com/jasonmayes/mdl-component-design-pattern
|
25
25
|
*
|
26
|
+
* @constructor
|
26
27
|
* @param {HTMLElement} element The element that will be upgraded.
|
27
28
|
*/
|
28
29
|
var MaterialSwitch = function MaterialSwitch(element) {
|
@@ -31,12 +32,12 @@
|
|
31
32
|
// Initialize instance.
|
32
33
|
this.init();
|
33
34
|
};
|
34
|
-
window
|
35
|
+
window['MaterialSwitch'] = MaterialSwitch;
|
35
36
|
|
36
37
|
/**
|
37
38
|
* Store constants in one place so they can be updated easily.
|
38
39
|
*
|
39
|
-
* @enum {
|
40
|
+
* @enum {string | number}
|
40
41
|
* @private
|
41
42
|
*/
|
42
43
|
MaterialSwitch.prototype.Constant_ = {
|
@@ -48,7 +49,7 @@
|
|
48
49
|
* JavaScript. This allows us to simply change it in one place should we
|
49
50
|
* decide to modify at a later date.
|
50
51
|
*
|
51
|
-
* @enum {
|
52
|
+
* @enum {string}
|
52
53
|
* @private
|
53
54
|
*/
|
54
55
|
MaterialSwitch.prototype.CssClasses_ = {
|
@@ -121,12 +122,12 @@
|
|
121
122
|
*
|
122
123
|
* @private
|
123
124
|
*/
|
124
|
-
MaterialSwitch.prototype.blur_ = function(
|
125
|
+
MaterialSwitch.prototype.blur_ = function() {
|
125
126
|
// TODO: figure out why there's a focus event being fired after our blur,
|
126
127
|
// so that we can avoid this hack.
|
127
128
|
window.setTimeout(function() {
|
128
129
|
this.inputElement_.blur();
|
129
|
-
}.bind(this), this.Constant_.TINY_TIMEOUT);
|
130
|
+
}.bind(this), /** @type {number} */ (this.Constant_.TINY_TIMEOUT));
|
130
131
|
};
|
131
132
|
|
132
133
|
// Public methods.
|
@@ -143,6 +144,8 @@
|
|
143
144
|
this.element_.classList.remove(this.CssClasses_.IS_DISABLED);
|
144
145
|
}
|
145
146
|
};
|
147
|
+
MaterialSwitch.prototype['checkDisabled'] =
|
148
|
+
MaterialSwitch.prototype.checkDisabled;
|
146
149
|
|
147
150
|
/**
|
148
151
|
* Check the components toggled state.
|
@@ -156,6 +159,8 @@
|
|
156
159
|
this.element_.classList.remove(this.CssClasses_.IS_CHECKED);
|
157
160
|
}
|
158
161
|
};
|
162
|
+
MaterialSwitch.prototype['checkToggleState'] =
|
163
|
+
MaterialSwitch.prototype.checkToggleState;
|
159
164
|
|
160
165
|
/**
|
161
166
|
* Disable switch.
|
@@ -166,6 +171,7 @@
|
|
166
171
|
this.inputElement_.disabled = true;
|
167
172
|
this.updateClasses_();
|
168
173
|
};
|
174
|
+
MaterialSwitch.prototype['disable'] = MaterialSwitch.prototype.disable;
|
169
175
|
|
170
176
|
/**
|
171
177
|
* Enable switch.
|
@@ -176,6 +182,7 @@
|
|
176
182
|
this.inputElement_.disabled = false;
|
177
183
|
this.updateClasses_();
|
178
184
|
};
|
185
|
+
MaterialSwitch.prototype['enable'] = MaterialSwitch.prototype.enable;
|
179
186
|
|
180
187
|
/**
|
181
188
|
* Activate switch.
|
@@ -186,6 +193,7 @@
|
|
186
193
|
this.inputElement_.checked = true;
|
187
194
|
this.updateClasses_();
|
188
195
|
};
|
196
|
+
MaterialSwitch.prototype['on'] = MaterialSwitch.prototype.on;
|
189
197
|
|
190
198
|
/**
|
191
199
|
* Deactivate switch.
|
@@ -196,6 +204,7 @@
|
|
196
204
|
this.inputElement_.checked = false;
|
197
205
|
this.updateClasses_();
|
198
206
|
};
|
207
|
+
MaterialSwitch.prototype['off'] = MaterialSwitch.prototype.off;
|
199
208
|
|
200
209
|
/**
|
201
210
|
* Initialize element.
|
@@ -23,6 +23,7 @@
|
|
23
23
|
* Implements MDL component design pattern defined at:
|
24
24
|
* https://github.com/jasonmayes/mdl-component-design-pattern
|
25
25
|
*
|
26
|
+
* @constructor
|
26
27
|
* @param {HTMLElement} element The element that will be upgraded.
|
27
28
|
*/
|
28
29
|
var MaterialTabs = function MaterialTabs(element) {
|
@@ -32,12 +33,12 @@
|
|
32
33
|
// Initialize instance.
|
33
34
|
this.init();
|
34
35
|
};
|
35
|
-
window
|
36
|
+
window['MaterialTabs'] = MaterialTabs;
|
36
37
|
|
37
38
|
/**
|
38
39
|
* Store constants in one place so they can be updated easily.
|
39
40
|
*
|
40
|
-
* @enum {
|
41
|
+
* @enum {string}
|
41
42
|
* @private
|
42
43
|
*/
|
43
44
|
MaterialTabs.prototype.Constant_ = {
|
@@ -49,7 +50,7 @@
|
|
49
50
|
* JavaScript. This allows us to simply change it in one place should we
|
50
51
|
* decide to modify at a later date.
|
51
52
|
*
|
52
|
-
* @enum {
|
53
|
+
* @enum {string}
|
53
54
|
* @private
|
54
55
|
*/
|
55
56
|
MaterialTabs.prototype.CssClasses_ = {
|
@@ -119,6 +120,13 @@
|
|
119
120
|
}
|
120
121
|
};
|
121
122
|
|
123
|
+
/**
|
124
|
+
* Constructor for an individual tab.
|
125
|
+
*
|
126
|
+
* @constructor
|
127
|
+
* @param {HTMLElement} tab The HTML element for the tab.
|
128
|
+
* @param {MaterialTabs} ctx The MaterialTabs object that owns the tab.
|
129
|
+
*/
|
122
130
|
function MaterialTab(tab, ctx) {
|
123
131
|
if (tab) {
|
124
132
|
if (ctx.element_.classList.contains(ctx.CssClasses_.MDL_JS_RIPPLE_EFFECT)) {
|
@@ -23,6 +23,7 @@
|
|
23
23
|
* Implements MDL component design pattern defined at:
|
24
24
|
* https://github.com/jasonmayes/mdl-component-design-pattern
|
25
25
|
*
|
26
|
+
* @constructor
|
26
27
|
* @param {HTMLElement} element The element that will be upgraded.
|
27
28
|
*/
|
28
29
|
var MaterialTextfield = function MaterialTextfield(element) {
|
@@ -31,12 +32,12 @@
|
|
31
32
|
// Initialize instance.
|
32
33
|
this.init();
|
33
34
|
};
|
34
|
-
window
|
35
|
+
window['MaterialTextfield'] = MaterialTextfield;
|
35
36
|
|
36
37
|
/**
|
37
38
|
* Store constants in one place so they can be updated easily.
|
38
39
|
*
|
39
|
-
* @enum {
|
40
|
+
* @enum {string | number}
|
40
41
|
* @private
|
41
42
|
*/
|
42
43
|
MaterialTextfield.prototype.Constant_ = {
|
@@ -49,7 +50,7 @@
|
|
49
50
|
* JavaScript. This allows us to simply change it in one place should we
|
50
51
|
* decide to modify at a later date.
|
51
52
|
*
|
52
|
-
* @enum {
|
53
|
+
* @enum {string}
|
53
54
|
* @private
|
54
55
|
*/
|
55
56
|
MaterialTextfield.prototype.CssClasses_ = {
|
@@ -122,6 +123,8 @@
|
|
122
123
|
this.element_.classList.remove(this.CssClasses_.IS_DISABLED);
|
123
124
|
}
|
124
125
|
};
|
126
|
+
MaterialTextfield.prototype['checkDisabled'] =
|
127
|
+
MaterialTextfield.prototype.checkDisabled;
|
125
128
|
|
126
129
|
/**
|
127
130
|
* Check the validity state and update field accordingly.
|
@@ -135,6 +138,8 @@
|
|
135
138
|
this.element_.classList.add(this.CssClasses_.IS_INVALID);
|
136
139
|
}
|
137
140
|
};
|
141
|
+
MaterialTextfield.prototype['checkValidity'] =
|
142
|
+
MaterialTextfield.prototype.checkValidity;
|
138
143
|
|
139
144
|
/**
|
140
145
|
* Check the dirty state and update field accordingly.
|
@@ -148,6 +153,8 @@
|
|
148
153
|
this.element_.classList.remove(this.CssClasses_.IS_DIRTY);
|
149
154
|
}
|
150
155
|
};
|
156
|
+
MaterialTextfield.prototype['checkDirty'] =
|
157
|
+
MaterialTextfield.prototype.checkDirty;
|
151
158
|
|
152
159
|
/**
|
153
160
|
* Disable text field.
|
@@ -158,6 +165,7 @@
|
|
158
165
|
this.input_.disabled = true;
|
159
166
|
this.updateClasses_();
|
160
167
|
};
|
168
|
+
MaterialTextfield.prototype['disable'] = MaterialTextfield.prototype.disable;
|
161
169
|
|
162
170
|
/**
|
163
171
|
* Enable text field.
|
@@ -168,20 +176,24 @@
|
|
168
176
|
this.input_.disabled = false;
|
169
177
|
this.updateClasses_();
|
170
178
|
};
|
179
|
+
MaterialTextfield.prototype['enable'] = MaterialTextfield.prototype.enable;
|
171
180
|
|
172
181
|
/**
|
173
182
|
* Update text field value.
|
174
183
|
*
|
175
|
-
* @param {
|
184
|
+
* @param {string} value The value to which to set the control (optional).
|
176
185
|
* @public
|
177
186
|
*/
|
178
187
|
MaterialTextfield.prototype.change = function(value) {
|
179
188
|
|
180
189
|
if (value) {
|
181
190
|
this.input_.value = value;
|
191
|
+
} else {
|
192
|
+
this.input_.value = '';
|
182
193
|
}
|
183
194
|
this.updateClasses_();
|
184
195
|
};
|
196
|
+
MaterialTextfield.prototype['change'] = MaterialTextfield.prototype.change;
|
185
197
|
|
186
198
|
/**
|
187
199
|
* Initialize element.
|
@@ -193,9 +205,10 @@
|
|
193
205
|
this.input_ = this.element_.querySelector('.' + this.CssClasses_.INPUT);
|
194
206
|
|
195
207
|
if (this.input_) {
|
196
|
-
if (this.input_.hasAttribute(
|
208
|
+
if (this.input_.hasAttribute(
|
209
|
+
/** @type {string} */ (this.Constant_.MAX_ROWS_ATTRIBUTE))) {
|
197
210
|
this.maxRows = parseInt(this.input_.getAttribute(
|
198
|
-
this.Constant_.MAX_ROWS_ATTRIBUTE), 10);
|
211
|
+
/** @type {string} */ (this.Constant_.MAX_ROWS_ATTRIBUTE)), 10);
|
199
212
|
if (isNaN(this.maxRows)) {
|
200
213
|
this.maxRows = this.Constant_.NO_MAX_ROWS;
|
201
214
|
}
|
@@ -23,6 +23,7 @@
|
|
23
23
|
* Implements MDL component design pattern defined at:
|
24
24
|
* https://github.com/jasonmayes/mdl-component-design-pattern
|
25
25
|
*
|
26
|
+
* @constructor
|
26
27
|
* @param {HTMLElement} element The element that will be upgraded.
|
27
28
|
*/
|
28
29
|
var MaterialTooltip = function MaterialTooltip(element) {
|
@@ -31,12 +32,12 @@
|
|
31
32
|
// Initialize instance.
|
32
33
|
this.init();
|
33
34
|
};
|
34
|
-
window
|
35
|
+
window['MaterialTooltip'] = MaterialTooltip;
|
35
36
|
|
36
37
|
/**
|
37
38
|
* Store constants in one place so they can be updated easily.
|
38
39
|
*
|
39
|
-
* @enum {
|
40
|
+
* @enum {string | number}
|
40
41
|
* @private
|
41
42
|
*/
|
42
43
|
MaterialTooltip.prototype.Constant_ = {
|
@@ -48,7 +49,7 @@
|
|
48
49
|
* JavaScript. This allows us to simply change it in one place should we
|
49
50
|
* decide to modify at a later date.
|
50
51
|
*
|
51
|
-
* @enum {
|
52
|
+
* @enum {string}
|
52
53
|
* @private
|
53
54
|
*/
|
54
55
|
MaterialTooltip.prototype.CssClasses_ = {
|
File without changes
|
@@ -117,18 +117,18 @@
|
|
117
117
|
left: 0;
|
118
118
|
height: 100%;
|
119
119
|
width: 100%;
|
120
|
-
mask: url("
|
120
|
+
mask: url("#{$checkbox-image-path}/tick-mask.svg?embed");
|
121
121
|
|
122
122
|
background: transparent;
|
123
123
|
@include material-animation-default(0.28s);
|
124
124
|
transition-property: background;
|
125
125
|
|
126
126
|
.mdl-checkbox.is-checked & {
|
127
|
-
background: $checkbox-color url("
|
127
|
+
background: $checkbox-color url("#{$checkbox-image-path}/tick.svg?embed");
|
128
128
|
}
|
129
129
|
|
130
130
|
.mdl-checkbox.is-checked.is-disabled & {
|
131
|
-
background: $checkbox-disabled-color url("
|
131
|
+
background: $checkbox-disabled-color url("#{$checkbox-image-path}/tick.svg?embed");
|
132
132
|
}
|
133
133
|
}
|
134
134
|
|
@@ -238,12 +238,12 @@
|
|
238
238
|
min-height: $layout-mobile-header-height;
|
239
239
|
}
|
240
240
|
|
241
|
-
.mdl-layout--fixed-drawer:not(.is-small-screen) > & {
|
241
|
+
.mdl-layout--fixed-drawer.is-upgraded:not(.is-small-screen) > & {
|
242
242
|
margin-left: $layout-drawer-width;
|
243
243
|
width: calc(100% - #{$layout-drawer-width});
|
244
244
|
}
|
245
245
|
|
246
|
-
@media screen and (min-width: $layout-screen-size-threshold) {
|
246
|
+
@media screen and (min-width: $layout-screen-size-threshold + 1px) {
|
247
247
|
.mdl-layout--fixed-drawer > & {
|
248
248
|
.mdl-layout__header-row {
|
249
249
|
padding-left: 40px;
|
@@ -54,7 +54,7 @@
|
|
54
54
|
.mdl-progress:not(.mdl-progress__indeterminate):not(.mdl-progress__indeterminate) > .auxbar {
|
55
55
|
background-image: linear-gradient(to right, $progress-secondary-color, $progress-secondary-color),
|
56
56
|
linear-gradient(to right, $progress-main-color, $progress-main-color);
|
57
|
-
mask: url(
|
57
|
+
mask: url('#{$progress-image-path}/buffer.svg?embed');
|
58
58
|
}
|
59
59
|
}
|
60
60
|
|
@@ -70,6 +70,9 @@ $performance_font: 'Helvetica', 'Arial', sans-serif !default;
|
|
70
70
|
@import "color-definitions";
|
71
71
|
@import "functions";
|
72
72
|
|
73
|
+
/* ========== IMAGES ========== */
|
74
|
+
$image_path: '/assets';
|
75
|
+
|
73
76
|
/* ========== Color & Themes ========== */
|
74
77
|
|
75
78
|
// Define whether individual color pallet items should have classes created.
|
@@ -204,6 +207,7 @@ $checkbox-color: unquote("rgb(#{$color-primary})") !default;
|
|
204
207
|
$checkbox-off-color: unquote("rgba(#{$color-black}, 0.54)") !default;
|
205
208
|
$checkbox-disabled-color: unquote("rgba(#{$color-black}, 0.26)") !default;
|
206
209
|
$checkbox-focus-color: unquote("rgba(#{$color-primary}, 0.26)") !default;
|
210
|
+
$checkbox-image-path: $image_path;
|
207
211
|
|
208
212
|
/* ========== Switches ========== */
|
209
213
|
|
@@ -255,6 +259,7 @@ $range-bg-focus-color: unquote("rgba(#{$color-black}, 0.12)") !default;
|
|
255
259
|
$progress-main-color: unquote("rgb(#{$color-primary})") !default;
|
256
260
|
$progress-secondary-color: unquote("rgba(#{$color-primary-contrast}, 0.7)") !default;
|
257
261
|
$progress-fallback-buffer-color: unquote("rgba(#{$color-primary-contrast}, 0.9)") !default;
|
262
|
+
$progress-image-path: $image_path;
|
258
263
|
|
259
264
|
/* ========== List ========== */
|
260
265
|
|
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.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitriy Tarasov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
@@ -109,6 +109,9 @@ files:
|
|
109
109
|
- vendor/assets/fonts/roboto/Roboto-Thin.ttf
|
110
110
|
- vendor/assets/fonts/roboto/Roboto-Thin.woff
|
111
111
|
- vendor/assets/fonts/roboto/Roboto-Thin.woff2
|
112
|
+
- vendor/assets/images/buffer.svg
|
113
|
+
- vendor/assets/images/tick-mask.svg
|
114
|
+
- vendor/assets/images/tick.svg
|
112
115
|
- vendor/assets/javascripts/material.js
|
113
116
|
- vendor/assets/javascripts/material/button.js
|
114
117
|
- vendor/assets/javascripts/material/checkbox.js
|