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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8bf6da79da1bf273f083fdb0c44be82c99cf040d
4
- data.tar.gz: 3ca862e3c95f40121e0542a827ef2e39972e4ec0
3
+ metadata.gz: aff99f073ff52ad07423f91f0e80ddf980bca4c1
4
+ data.tar.gz: c9b69348aa8e8ff4f72e53c6ea4d37d12a6f1f62
5
5
  SHA512:
6
- metadata.gz: d40d80e66d98f8923e1a4aba2bf1e8e20b1a06e006526482dd3de71b001843f95a4040e0a630fc4c33773ae7e2c01f300e1e468f1d6d9b257acbf54d8ea47431
7
- data.tar.gz: 5723cc10dd16233816d64d92a3546f11c39a0b8080344b2438b0de55456d87c0fa43deff6a6c799df0a2b89a89239e5663b77c4fbc9f7f7134321f696554cda7
6
+ metadata.gz: f0dd54dac34f4b3ff3e20785e0e79504c85da5f53dcc76e5fb8fcd30c8b16b22a0e0dd4b0bd2be3b02d84656f2cec1066bf497e50725e62ffe875dbbe5a88911
7
+ data.tar.gz: c393fab81a5391254dcd74da843bf22026ff5bf012cf4126bdf500da3456ea8e1c9000671f566f43479dfb2cda9f6aea24916ea3a63f105d40cdeb1ad66698f5
@@ -1,3 +1,3 @@
1
1
  module Dlegr250MaterialDesign
2
- VERSION = "0.1.59"
2
+ VERSION = "0.1.61"
3
3
  end
@@ -11,5 +11,6 @@ $(document).on "ready page:load", ->
11
11
  App.MD.Dialog.init()
12
12
  App.MD.Tabs.init()
13
13
  App.MD.Forms.init()
14
- # App.MD.InputMasks.init()
14
+ App.MD.InputMasks.init()
15
+ App.MD.Toggles.init()
15
16
  App.MD.SnackbarHandler.init()
@@ -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")
@@ -15,5 +15,7 @@
15
15
  //= require components/dialog
16
16
  //= require components/tabs
17
17
  //= require components/forms
18
+ //= require components/input_masks
19
+ //= require components/toggles
18
20
  //= require components/snackbar_handler
19
21
  //= require components/utility
@@ -3,7 +3,7 @@
3
3
 
4
4
  select {
5
5
  border: 1px solid rgba(0, 0, 0, .12);
6
- height: $input-height - 4;
6
+ height: $input-height;
7
7
  min-height: $button-height;
8
8
  outline: none;
9
9
  @include rounded-corners;
@@ -1,6 +1,6 @@
1
1
  //======================================================================
2
2
  // EXAMPLE:
3
- // <div class="list list-bordered list-hoverable rounded-corners constrained constrained-large">
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
- &.bordered {
80
- border: 1px solid color("divider");
81
- }
80
+ .list-bordered {
81
+ border: 1px solid color("divider");
82
+ }
82
83
 
83
- &.divided {
84
- .list-header,
85
- .list-item {
86
- border-bottom: 1px solid color("divider");
87
- }
84
+ .list-divided {
85
+ .list-header,
86
+ .list-item {
87
+ border-bottom: 1px solid color("divider");
88
88
  }
89
+ }
89
90
 
90
- // Don't have double lines on last item for bordered and divided
91
- &.bordered .list-item:last-child {
92
- border-bottom: none;
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
- &.dense {
193
- .list-header {
194
- min-height: 40px;
195
-
196
- .list-header-title,
197
- .list-header-secondary {
198
- padding-bottom: $spacing-small;
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
- .list-item {
204
- .list-item-icon,
205
- .list-item-primary,
206
- .list-item-secondary {
207
- padding-bottom: $spacing-small;
208
- padding-top: $spacing-small;
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.hoverable .list-item {
191
+ .list-hoverable .list-item {
218
192
  &:hover,
219
193
  :active {
220
194
  background-color: color("hover");
@@ -77,7 +77,8 @@
77
77
 
78
78
  .tabs.disabled .tab,
79
79
  .tab:disabled,
80
- .tab.disabled {
80
+ .tab.disabled,
81
+ .tab.disabled .tab-icon {
81
82
  color: color("disabled");
82
83
  cursor: default;
83
84
  pointer-events: none;
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.59
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-05 00:00:00.000000000 Z
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