dlegr250_material_design 0.1.59 → 0.1.61
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dlegr250_material_design/version.rb +1 -1
- data/vendor/assets/javascripts/base/init.js.coffee +2 -1
- data/vendor/assets/javascripts/components/forms.coffee +7 -0
- data/vendor/assets/javascripts/components/input_masks.coffee +47 -0
- data/vendor/assets/javascripts/components/toggles.coffee +19 -0
- data/vendor/assets/javascripts/dlegr250_material_design.js +2 -0
- data/vendor/assets/stylesheets/components/forms/selects.scss +1 -1
- data/vendor/assets/stylesheets/components/lists.scss +29 -55
- data/vendor/assets/stylesheets/components/tabs.scss +2 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aff99f073ff52ad07423f91f0e80ddf980bca4c1
|
4
|
+
data.tar.gz: c9b69348aa8e8ff4f72e53c6ea4d37d12a6f1f62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0dd54dac34f4b3ff3e20785e0e79504c85da5f53dcc76e5fb8fcd30c8b16b22a0e0dd4b0bd2be3b02d84656f2cec1066bf497e50725e62ffe875dbbe5a88911
|
7
|
+
data.tar.gz: c393fab81a5391254dcd74da843bf22026ff5bf012cf4126bdf500da3456ea8e1c9000671f566f43479dfb2cda9f6aea24916ea3a63f105d40cdeb1ad66698f5
|
@@ -9,6 +9,12 @@ class App.MD.Forms
|
|
9
9
|
@setVariables: () ->
|
10
10
|
|
11
11
|
@setEvents: () ->
|
12
|
+
# Autosubmit a parent form when a field changes
|
13
|
+
# (applied to individual fields)
|
14
|
+
$("body").on "change", ":input[data-auto-submit-on-change='true']", =>
|
15
|
+
$(this).parents("form").submit()
|
16
|
+
|
17
|
+
# Focus cursor
|
12
18
|
$(".auto-focus").focus()
|
13
19
|
|
14
20
|
# Mark changed inputs as dirty
|
@@ -27,4 +33,5 @@ class App.MD.Forms
|
|
27
33
|
$field.removeClass("has-errors")
|
28
34
|
$field.find(".error-messages").hide() #css("visibility", "hidden")
|
29
35
|
|
36
|
+
# Add class to style invalid inputs
|
30
37
|
$("select.invalid, input.invalid").closest(".field-with-validations").addClass("has-errors")
|
@@ -9,3 +9,50 @@ class App.MD.InputMasks
|
|
9
9
|
@setVariables: () ->
|
10
10
|
|
11
11
|
@setEvents: () ->
|
12
|
+
# Input masks
|
13
|
+
Inputmask.extendDefaults({
|
14
|
+
showMaskOnHover: false
|
15
|
+
})
|
16
|
+
|
17
|
+
$(":input").inputmask()
|
18
|
+
|
19
|
+
# Format: "[1-99]"
|
20
|
+
$(":input[data-mask='years']").inputmask("9[9]", {
|
21
|
+
placeholder: "",
|
22
|
+
greedy: false
|
23
|
+
})
|
24
|
+
|
25
|
+
# Format: "[1-11]"
|
26
|
+
# Do not let user put in 12 months because that is 1 year
|
27
|
+
$(":input[data-mask='months']").inputmask("Regex", {
|
28
|
+
regex: "[1-9]|1[0-1]"
|
29
|
+
})
|
30
|
+
|
31
|
+
# Format: "[1-168]" (24 hrs * 7 days = 168 max hours)
|
32
|
+
$(":input[data-mask='hours']").inputmask("Regex", {
|
33
|
+
regex: "[0-9][0-9]|1[0-5][0-9]|16[0-8]"
|
34
|
+
})
|
35
|
+
|
36
|
+
# Format: "123 - 45 - 6789"
|
37
|
+
$(":input[data-mask='ssn']").inputmask("999 - 99 - 9999")
|
38
|
+
|
39
|
+
# Format: "(123) 456 - 7890"
|
40
|
+
$(":input[data-mask='phone']").inputmask("(999) 999 - 9999")
|
41
|
+
|
42
|
+
# Format: "12/1975"
|
43
|
+
$(":input[data-mask='date-my']").inputmask("mm/yyyy", { placeholder: "__/____" })
|
44
|
+
|
45
|
+
# Format: "01/25/1947"
|
46
|
+
$(":input[data-mask='date-mdy']").inputmask("mm/dd/yyyy", { placeholder: "__/__/____" })
|
47
|
+
|
48
|
+
# Format: "$ 123,456"
|
49
|
+
$(":input[data-mask='currency']").inputmask("currency", {
|
50
|
+
rightAlign: false,
|
51
|
+
greedy: true,
|
52
|
+
placeholder: "",
|
53
|
+
digits: 0,
|
54
|
+
allowPlus: false,
|
55
|
+
allowMinus: false,
|
56
|
+
prefix: "$ ",
|
57
|
+
min: 0
|
58
|
+
})
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#======================================================================
|
2
|
+
# Add triggers to show/hide elements based on a provided DOM ID.
|
3
|
+
#======================================================================
|
4
|
+
class App.MD.Toggles
|
5
|
+
@init: () ->
|
6
|
+
@setVariables()
|
7
|
+
@setEvents()
|
8
|
+
|
9
|
+
@setVariables: () ->
|
10
|
+
|
11
|
+
@setEvents: () ->
|
12
|
+
# Toggle to show/hide elements
|
13
|
+
$("body").on "click select", "[data-show-element]", (event) =>
|
14
|
+
domId = $(event.target).data("show-element")
|
15
|
+
$("#{domId}").removeClass("hidden")
|
16
|
+
|
17
|
+
$("body").on "click select", "[data-hide-element]", (event) =>
|
18
|
+
domId = $(event.target).data("hide-element")
|
19
|
+
$("#{domId}").addClass("hidden")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
//======================================================================
|
2
2
|
// EXAMPLE:
|
3
|
-
// <div class="list list-bordered list-hoverable rounded-corners
|
3
|
+
// <div class="list list-bordered list-divided list-hoverable rounded-corners">
|
4
4
|
// <div class="list-item" id="list-item-ID">
|
5
5
|
// <div class="list-item-icon">
|
6
6
|
// <i class="zmdi zmdi-star"></i>
|
@@ -75,22 +75,22 @@ ol {
|
|
75
75
|
|
76
76
|
.list {
|
77
77
|
background-color: color("white");
|
78
|
+
}
|
78
79
|
|
79
|
-
|
80
|
-
|
81
|
-
|
80
|
+
.list-bordered {
|
81
|
+
border: 1px solid color("divider");
|
82
|
+
}
|
82
83
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
}
|
84
|
+
.list-divided {
|
85
|
+
.list-header,
|
86
|
+
.list-item {
|
87
|
+
border-bottom: 1px solid color("divider");
|
88
88
|
}
|
89
|
+
}
|
89
90
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
}
|
91
|
+
// Don't have double lines on last item for bordered and divided
|
92
|
+
.list-bordered .list-item:last-child {
|
93
|
+
border-bottom: none;
|
94
94
|
}
|
95
95
|
|
96
96
|
// Lists - list item
|
@@ -162,59 +162,33 @@ ol {
|
|
162
162
|
text-align: right;
|
163
163
|
}
|
164
164
|
|
165
|
-
// Lists - list item action
|
166
|
-
// For list items that are links/actions
|
167
|
-
//----------------------------------------------------------------------
|
168
|
-
|
169
|
-
.list-item-action {
|
170
|
-
color: color("primary");
|
171
|
-
font-weight: bold;
|
172
|
-
letter-spacing: 0.5px;
|
173
|
-
text-transform: uppercase;
|
174
|
-
|
175
|
-
.list-item-icon {
|
176
|
-
color: color("primary");
|
177
|
-
}
|
178
|
-
|
179
|
-
&:hover {
|
180
|
-
background-color: color("hover");
|
181
|
-
}
|
182
|
-
|
183
|
-
&:active {
|
184
|
-
background-color: darken(color("hover"), 10%);
|
185
|
-
}
|
186
|
-
}
|
187
|
-
|
188
165
|
// Lists - sizes
|
189
166
|
//----------------------------------------------------------------------
|
190
167
|
|
191
|
-
.list {
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
padding-top: $spacing-small;
|
200
|
-
}
|
168
|
+
.list-dense {
|
169
|
+
.list-header {
|
170
|
+
min-height: 40px;
|
171
|
+
|
172
|
+
.list-header-title,
|
173
|
+
.list-header-secondary {
|
174
|
+
padding-bottom: $spacing-small;
|
175
|
+
padding-top: $spacing-small;
|
201
176
|
}
|
177
|
+
}
|
202
178
|
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
}
|
179
|
+
.list-item {
|
180
|
+
.list-item-icon,
|
181
|
+
.list-item-primary,
|
182
|
+
.list-item-secondary {
|
183
|
+
padding-bottom: $spacing-small;
|
184
|
+
padding-top: $spacing-small;
|
210
185
|
}
|
211
186
|
}
|
212
187
|
}
|
213
|
-
|
214
188
|
// Lists - hoverable
|
215
189
|
//----------------------------------------------------------------------
|
216
190
|
|
217
|
-
.list
|
191
|
+
.list-hoverable .list-item {
|
218
192
|
&:hover,
|
219
193
|
:active {
|
220
194
|
background-color: color("hover");
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dlegr250_material_design
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.61
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel LeGrand
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- vendor/assets/javascripts/components/menus.coffee
|
85
85
|
- vendor/assets/javascripts/components/snackbar_handler.coffee
|
86
86
|
- vendor/assets/javascripts/components/tabs.coffee
|
87
|
+
- vendor/assets/javascripts/components/toggles.coffee
|
87
88
|
- vendor/assets/javascripts/components/utility.coffee
|
88
89
|
- vendor/assets/javascripts/dlegr250_material_design.js
|
89
90
|
- vendor/assets/javascripts/extensions/coffeescript.js.coffee
|