foundation-rails 6.3.0.0 → 6.3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +1 -1
  4. data/LICENSE.txt +1 -1
  5. data/Rakefile +1 -1
  6. data/bower.json +2 -2
  7. data/lib/foundation/rails/version.rb +1 -1
  8. data/lib/generators/foundation/templates/_settings.scss +0 -1
  9. data/vendor/assets/js/foundation.abide.js.es6 +26 -13
  10. data/vendor/assets/js/foundation.accordion.js.es6 +94 -5
  11. data/vendor/assets/js/foundation.accordionMenu.js.es6 +4 -2
  12. data/vendor/assets/js/foundation.core.js.es6 +1 -1
  13. data/vendor/assets/js/foundation.drilldown.js.es6 +44 -21
  14. data/vendor/assets/js/foundation.dropdown.js.es6 +26 -12
  15. data/vendor/assets/js/foundation.dropdownMenu.js.es6 +24 -13
  16. data/vendor/assets/js/foundation.equalizer.js.es6 +6 -3
  17. data/vendor/assets/js/foundation.interchange.js.es6 +5 -1
  18. data/vendor/assets/js/foundation.magellan.js.es6 +14 -7
  19. data/vendor/assets/js/foundation.offcanvas.js.es6 +70 -15
  20. data/vendor/assets/js/foundation.orbit.js.es6 +36 -18
  21. data/vendor/assets/js/foundation.responsiveMenu.js.es6 +0 -3
  22. data/vendor/assets/js/foundation.responsiveToggle.js.es6 +12 -16
  23. data/vendor/assets/js/foundation.reveal.js.es6 +39 -19
  24. data/vendor/assets/js/foundation.slider.js.es6 +37 -19
  25. data/vendor/assets/js/foundation.sticky.js.es6 +61 -25
  26. data/vendor/assets/js/foundation.tabs.js.es6 +74 -46
  27. data/vendor/assets/js/foundation.toggler.js.es6 +2 -1
  28. data/vendor/assets/js/foundation.tooltip.js.es6 +30 -15
  29. data/vendor/assets/js/foundation.util.timerAndImageLoader.js.es6 +1 -1
  30. data/vendor/assets/js/foundation.util.triggers.js.es6 +0 -47
  31. data/vendor/assets/scss/_global.scss +6 -0
  32. data/vendor/assets/scss/components/_accordion.scss +1 -1
  33. data/vendor/assets/scss/components/_breadcrumbs.scss +5 -2
  34. data/vendor/assets/scss/components/_button-group.scss +18 -8
  35. data/vendor/assets/scss/components/_button.scss +46 -8
  36. data/vendor/assets/scss/components/_card.scss +1 -1
  37. data/vendor/assets/scss/components/_flex.scss +6 -0
  38. data/vendor/assets/scss/components/_menu.scss +30 -3
  39. data/vendor/assets/scss/components/_responsive-embed.scss +6 -2
  40. data/vendor/assets/scss/components/_reveal.scss +2 -2
  41. data/vendor/assets/scss/foundation.scss +3 -3
  42. data/vendor/assets/scss/grid/_classes.scss +6 -2
  43. data/vendor/assets/scss/grid/_column.scss +1 -1
  44. data/vendor/assets/scss/grid/_flex-grid.scss +22 -2
  45. data/vendor/assets/scss/grid/_grid.scss +4 -0
  46. data/vendor/assets/scss/settings/_settings.scss +0 -1
  47. data/vendor/assets/scss/typography/_base.scss +1 -1
  48. data/vendor/assets/scss/typography/_print.scss +5 -0
  49. data/vendor/assets/scss/util/_direction.scss +31 -0
  50. data/vendor/assets/scss/util/_math.scss +1 -1
  51. data/vendor/assets/scss/util/_typography.scss +26 -0
  52. data/vendor/assets/scss/util/_util.scss +2 -0
  53. data/vendor/assets/scss/util/_value.scss +20 -0
  54. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1cedd7d0dcc15b46602aa8e14e7bdaedd57ae4e
4
- data.tar.gz: a283c3bd7399c328a21397ed7c6d364a0f937f82
3
+ metadata.gz: 44c6fa03a6aba665fa5a09ee0908e7af4abbc8d7
4
+ data.tar.gz: f787d99eb0247c1fc541610dfe367cc56a29c9f1
5
5
  SHA512:
6
- metadata.gz: b413a6f613d8f887507ad294dd7a804747ac3f71498e27a50ac4720d4b742283f5893d85e5b6f175dc9ff984d84f16e783b7cfddf55c51b94b70fc6a43459dc0
7
- data.tar.gz: dbaeefa8cc9fb6679c5b272978cc9ee0e7811523e71abb5900bf7c6b988b48e21008a91c4c08715079954741221d85c05300b6f6ebf68dfbd498669b66bf0390
6
+ metadata.gz: 81a54ac83a0ae2d36889c80067ce0750cc2f865780d0984dbbfcc6d7cb6ee865505ee9b9b229f51e02651b7cc83fd8a5af94b5938daa2ec590758da489c85e55
7
+ data.tar.gz: 5696ef58423e67802762a07e74e672f20b60bcd4cdb91593af817d50b5aeaac0cef673b8b098107081116586b8e541a233409ea1354f189f394b7af2c15e5364
@@ -1 +1 @@
1
- 2.1.2
1
+ 2.2.2
@@ -5,7 +5,7 @@ sudo: false
5
5
  cache: bundler
6
6
 
7
7
  rvm:
8
- - 2.2
8
+ - 2.2.2
9
9
 
10
10
  notifications:
11
11
  email: false
@@ -1,4 +1,4 @@
1
- Copyright (c) 2016 ZURB Inc.
1
+ Copyright (c) 2017 ZURB Inc.
2
2
 
3
3
  MIT License
4
4
 
data/Rakefile CHANGED
@@ -34,7 +34,7 @@ namespace :assets do
34
34
  desc 'Remove old Foundation for Sites assets'
35
35
  task :clean do
36
36
  sh 'rm -rf vendor'
37
- sh 'mkdir -p vendor/assets/js/ vendor/assets/scss vendor/assets/scss/motion-ui'
37
+ sh 'mkdir -p vendor/assets/js/ vendor/assets/scss vendor/assets/scss/motion-ui vendor/assets/_vendor'
38
38
  end
39
39
 
40
40
  end
data/bower.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "foundation-rails",
3
- "version": "6.3.0.0",
3
+ "version": "6.3.1.0",
4
4
  "dependencies": {
5
- "foundation-sites": "6.3.0",
5
+ "foundation-sites": "6.3.1",
6
6
  "motion-ui": "1.2.2"
7
7
  }
8
8
  }
@@ -1,5 +1,5 @@
1
1
  module Foundation
2
2
  module Rails
3
- VERSION = "6.3.0.0"
3
+ VERSION = "6.3.1.0"
4
4
  end
5
5
  end
@@ -618,4 +618,3 @@ $topbar-submenu-background: $topbar-background;
618
618
  $topbar-title-spacing: 0.5rem 1rem 0.5rem 0;
619
619
  $topbar-input-width: 200px;
620
620
  $topbar-unstack-breakpoint: medium;
621
-
@@ -110,9 +110,11 @@ class Abide {
110
110
  }
111
111
 
112
112
  /**
113
- * Based on $el, get the first element with selector in this order:
114
- * 1. The element's direct sibling('s).
115
- * 3. The element's parent's children.
113
+ * Get:
114
+ * - Based on $el, the first element(s) corresponding to `formErrorSelector` in this order:
115
+ * 1. The element's direct sibling('s).
116
+ * 2. The element's parent's children.
117
+ * - Element(s) with the attribute `[data-form-error-for]` set with the element's id.
116
118
  *
117
119
  * This allows for multiple form errors per input, though if none are found, no form errors will be shown.
118
120
  *
@@ -120,12 +122,15 @@ class Abide {
120
122
  * @returns {Object} jQuery object with the selector.
121
123
  */
122
124
  findFormError($el) {
125
+ var id = $el[0].id;
123
126
  var $error = $el.siblings(this.options.formErrorSelector);
124
127
 
125
128
  if (!$error.length) {
126
129
  $error = $el.parent().find(this.options.formErrorSelector);
127
130
  }
128
131
 
132
+ $error = $error.add(this.$element.find(`[data-form-error-for="${id}"]`));
133
+
129
134
  return $error;
130
135
  }
131
136
 
@@ -237,7 +242,8 @@ class Abide {
237
242
  }
238
243
 
239
244
  /**
240
- * Goes through a form to find inputs and proceeds to validate them in ways specific to their type
245
+ * Goes through a form to find inputs and proceeds to validate them in ways specific to their type.
246
+ * Ignores inputs with data-abide-ignore, type="hidden" or disabled attributes set
241
247
  * @fires Abide#invalid
242
248
  * @fires Abide#valid
243
249
  * @param {Object} element - jQuery object to validate, should be an HTML input
@@ -250,8 +256,8 @@ class Abide {
250
256
  validator = $el.attr('data-validator'),
251
257
  equalTo = true;
252
258
 
253
- // don't validate ignored inputs or hidden inputs
254
- if ($el.is('[data-abide-ignore]') || $el.is('[type="hidden"]')) {
259
+ // don't validate ignored inputs or hidden inputs or disabled inputs
260
+ if ($el.is('[data-abide-ignore]') || $el.is('[type="hidden"]') || $el.is('[disabled]')) {
255
261
  return true;
256
262
  }
257
263
 
@@ -472,49 +478,56 @@ Abide.defaults = {
472
478
  * The default event to validate inputs. Checkboxes and radios validate immediately.
473
479
  * Remove or change this value for manual validation.
474
480
  * @option
475
- * @example 'fieldChange'
481
+ * @type {?string}
482
+ * @default 'fieldChange'
476
483
  */
477
484
  validateOn: 'fieldChange',
478
485
 
479
486
  /**
480
487
  * Class to be applied to input labels on failed validation.
481
488
  * @option
482
- * @example 'is-invalid-label'
489
+ * @type {string}
490
+ * @default 'is-invalid-label'
483
491
  */
484
492
  labelErrorClass: 'is-invalid-label',
485
493
 
486
494
  /**
487
495
  * Class to be applied to inputs on failed validation.
488
496
  * @option
489
- * @example 'is-invalid-input'
497
+ * @type {string}
498
+ * @default 'is-invalid-input'
490
499
  */
491
500
  inputErrorClass: 'is-invalid-input',
492
501
 
493
502
  /**
494
503
  * Class selector to use to target Form Errors for show/hide.
495
504
  * @option
496
- * @example '.form-error'
505
+ * @type {string}
506
+ * @default '.form-error'
497
507
  */
498
508
  formErrorSelector: '.form-error',
499
509
 
500
510
  /**
501
511
  * Class added to Form Errors on failed validation.
502
512
  * @option
503
- * @example 'is-visible'
513
+ * @type {string}
514
+ * @default 'is-visible'
504
515
  */
505
516
  formErrorClass: 'is-visible',
506
517
 
507
518
  /**
508
519
  * Set to true to validate text inputs on any value change.
509
520
  * @option
510
- * @example false
521
+ * @type {boolean}
522
+ * @default false
511
523
  */
512
524
  liveValidate: false,
513
525
 
514
526
  /**
515
527
  * Set to true to validate inputs on blur.
516
528
  * @option
517
- * @example false
529
+ * @type {boolean}
530
+ * @default false
518
531
  */
519
532
  validateOnBlur: false,
520
533
 
@@ -57,9 +57,48 @@ class Accordion {
57
57
  $content.attr({'role': 'tabpanel', 'aria-labelledby': linkId, 'aria-hidden': true, 'id': id});
58
58
  });
59
59
  var $initActive = this.$element.find('.is-active').children('[data-tab-content]');
60
+ this.firstTimeInit = true;
60
61
  if($initActive.length){
61
- this.down($initActive, true);
62
+ this.down($initActive, this.firstTimeInit);
63
+ this.firstTimeInit = false;
62
64
  }
65
+
66
+ this._checkDeepLink = () => {
67
+ var anchor = window.location.hash;
68
+ //need a hash and a relevant anchor in this tabset
69
+ if(anchor.length) {
70
+ var $link = this.$element.find('[href$="'+anchor+'"]'),
71
+ $anchor = $(anchor);
72
+
73
+ if ($link.length && $anchor) {
74
+ if (!$link.parent('[data-accordion-item]').hasClass('is-active')) {
75
+ this.down($anchor, this.firstTimeInit);
76
+ this.firstTimeInit = false;
77
+ };
78
+
79
+ //roll up a little to show the titles
80
+ if (this.options.deepLinkSmudge) {
81
+ var _this = this;
82
+ $(window).load(function() {
83
+ var offset = _this.$element.offset();
84
+ $('html, body').animate({ scrollTop: offset.top }, _this.options.deepLinkSmudgeDelay);
85
+ });
86
+ }
87
+
88
+ /**
89
+ * Fires when the zplugin has deeplinked at pageload
90
+ * @event Accordion#deeplink
91
+ */
92
+ this.$element.trigger('deeplink.zf.accordion', [$link, $anchor]);
93
+ }
94
+ }
95
+ }
96
+
97
+ //use browser to open a tab, if it exists in this tabset
98
+ if (this.options.deepLink) {
99
+ this._checkDeepLink();
100
+ }
101
+
63
102
  this._events();
64
103
  }
65
104
 
@@ -103,6 +142,9 @@ class Accordion {
103
142
  });
104
143
  }
105
144
  });
145
+ if(this.options.deepLink) {
146
+ $(window).on('popstate', this._checkDeepLink);
147
+ }
106
148
  }
107
149
 
108
150
  /**
@@ -116,6 +158,16 @@ class Accordion {
116
158
  } else {
117
159
  this.down($target);
118
160
  }
161
+ //either replace or update browser history
162
+ if (this.options.deepLink) {
163
+ var anchor = $target.prev('a').attr('href');
164
+
165
+ if (this.options.updateHistory) {
166
+ history.pushState({}, '', anchor);
167
+ } else {
168
+ history.replaceState({}, '', anchor);
169
+ }
170
+ }
119
171
  }
120
172
 
121
173
  /**
@@ -194,6 +246,9 @@ class Accordion {
194
246
  destroy() {
195
247
  this.$element.find('[data-tab-content]').stop(true).slideUp(0).css('display', '');
196
248
  this.$element.find('a').off('.zf.accordion');
249
+ if(this.options.deepLink) {
250
+ $(window).off('popstate', this._checkDeepLink);
251
+ }
197
252
 
198
253
  Foundation.unregisterPlugin(this);
199
254
  }
@@ -203,21 +258,55 @@ Accordion.defaults = {
203
258
  /**
204
259
  * Amount of time to animate the opening of an accordion pane.
205
260
  * @option
206
- * @example 250
261
+ * @type {number}
262
+ * @default 250
207
263
  */
208
264
  slideSpeed: 250,
209
265
  /**
210
266
  * Allow the accordion to have multiple open panes.
211
267
  * @option
212
- * @example false
268
+ * @type {boolean}
269
+ * @default false
213
270
  */
214
271
  multiExpand: false,
215
272
  /**
216
273
  * Allow the accordion to close all panes.
217
274
  * @option
218
- * @example false
275
+ * @type {boolean}
276
+ * @default false
277
+ */
278
+ allowAllClosed: false,
279
+ /**
280
+ * Allows the window to scroll to content of pane specified by hash anchor
281
+ * @option
282
+ * @type {boolean}
283
+ * @default false
284
+ */
285
+ deepLink: false,
286
+
287
+ /**
288
+ * Adjust the deep link scroll to make sure the top of the accordion panel is visible
289
+ * @option
290
+ * @type {boolean}
291
+ * @default false
292
+ */
293
+ deepLinkSmudge: false,
294
+
295
+ /**
296
+ * Animation time (ms) for the deep link adjustment
297
+ * @option
298
+ * @type {number}
299
+ * @default 300
300
+ */
301
+ deepLinkSmudgeDelay: 300,
302
+
303
+ /**
304
+ * Update the browser history with the open accordion
305
+ * @option
306
+ * @type {boolean}
307
+ * @default false
219
308
  */
220
- allowAllClosed: false
309
+ updateHistory: false
221
310
  };
222
311
 
223
312
  // Window exports
@@ -264,13 +264,15 @@ AccordionMenu.defaults = {
264
264
  /**
265
265
  * Amount of time to animate the opening of a submenu in ms.
266
266
  * @option
267
- * @example 250
267
+ * @type {number}
268
+ * @default 250
268
269
  */
269
270
  slideSpeed: 250,
270
271
  /**
271
272
  * Allow the menu to have multiple open panes.
272
273
  * @option
273
- * @example true
274
+ * @type {boolean}
275
+ * @default true
274
276
  */
275
277
  multiOpen: true
276
278
  };
@@ -2,7 +2,7 @@
2
2
 
3
3
  "use strict";
4
4
 
5
- var FOUNDATION_VERSION = '6.3.0';
5
+ var FOUNDATION_VERSION = '6.3.1';
6
6
 
7
7
  // Global Foundation object
8
8
  // This is attached to the window, or used as a module for AMD/Browserify
@@ -100,15 +100,20 @@ class Drilldown {
100
100
  _this._back($menu);
101
101
  });
102
102
 
103
+ this.$submenus.addClass('invisible');
103
104
  if(!this.options.autoHeight) {
104
105
  this.$submenus.addClass('drilldown-submenu-cover-previous');
105
106
  }
106
107
 
108
+ // create a wrapper on element if it doesn't exist.
107
109
  if(!this.$element.parent().hasClass('is-drilldown')){
108
110
  this.$wrapper = $(this.options.wrapper).addClass('is-drilldown');
109
111
  if(this.options.animateHeight) this.$wrapper.addClass('animate-height');
110
- this.$wrapper = this.$element.wrap(this.$wrapper).parent().css(this._getMaxDims());
112
+ this.$element.wrap(this.$wrapper);
111
113
  }
114
+ // set wrapper
115
+ this.$wrapper = this.$element.parent();
116
+ this.$wrapper.css(this._getMaxDims());
112
117
  }
113
118
 
114
119
  _resize() {
@@ -223,15 +228,20 @@ class Drilldown {
223
228
  },
224
229
  up: function() {
225
230
  $prevElement.focus();
226
- return true;
231
+ // Don't tap focus on first element in root ul
232
+ return !$element.is(_this.$element.find('> li:first-child > a'));
227
233
  },
228
234
  down: function() {
229
235
  $nextElement.focus();
230
- return true;
236
+ // Don't tap focus on last element in root ul
237
+ return !$element.is(_this.$element.find('> li:last-child > a'));
231
238
  },
232
239
  close: function() {
233
- _this._back();
234
- //_this.$menuItems.first().focus(); // focus to first element
240
+ // Don't close on element in root ul
241
+ if (!$element.is(_this.$element.find('> li > a'))) {
242
+ _this._hide($element.parent().parent());
243
+ $element.parent().parent().siblings('a').focus();
244
+ }
235
245
  },
236
246
  open: function() {
237
247
  if (!$element.is(_this.$menuItems)) { // not menu item means back button
@@ -327,7 +337,7 @@ class Drilldown {
327
337
  _show($elem) {
328
338
  if(this.options.autoHeight) this.$wrapper.css({height:$elem.children('[data-submenu]').data('calcHeight')});
329
339
  $elem.attr('aria-expanded', true);
330
- $elem.children('[data-submenu]').addClass('is-active').attr('aria-hidden', false);
340
+ $elem.children('[data-submenu]').addClass('is-active').removeClass('invisible').attr('aria-hidden', false);
331
341
  /**
332
342
  * Fires when the submenu has opened.
333
343
  * @event Drilldown#open
@@ -349,7 +359,7 @@ class Drilldown {
349
359
  $elem.addClass('is-closing')
350
360
  .one(Foundation.transitionend($elem), function(){
351
361
  $elem.removeClass('is-active is-closing');
352
- $elem.blur();
362
+ $elem.blur().addClass('invisible');
353
363
  });
354
364
  /**
355
365
  * Fires when the submenu has closed.
@@ -417,73 +427,86 @@ Drilldown.defaults = {
417
427
  /**
418
428
  * Markup used for JS generated back button. Prepended or appended (see backButtonPosition) to submenu lists and deleted on `destroy` method, 'js-drilldown-back' class required. Remove the backslash (`\`) if copy and pasting.
419
429
  * @option
420
- * @example '<\li><\a>Back<\/a><\/li>'
430
+ * @type {string}
431
+ * @default '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>'
421
432
  */
422
433
  backButton: '<li class="js-drilldown-back"><a tabindex="0">Back</a></li>',
423
434
  /**
424
- * Position the back button either at the top or bottom of drilldown submenus.
435
+ * Position the back button either at the top or bottom of drilldown submenus. Can be `'left'` or `'bottom'`.
425
436
  * @option
426
- * @example bottom
437
+ * @type {string}
438
+ * @default top
427
439
  */
428
440
  backButtonPosition: 'top',
429
441
  /**
430
442
  * Markup used to wrap drilldown menu. Use a class name for independent styling; the JS applied class: `is-drilldown` is required. Remove the backslash (`\`) if copy and pasting.
431
443
  * @option
432
- * @example '<\div class="is-drilldown"><\/div>'
444
+ * @type {string}
445
+ * @default '<div></div>'
433
446
  */
434
447
  wrapper: '<div></div>',
435
448
  /**
436
449
  * Adds the parent link to the submenu.
437
450
  * @option
438
- * @example false
451
+ * @type {boolean}
452
+ * @default false
439
453
  */
440
454
  parentLink: false,
441
455
  /**
442
456
  * Allow the menu to return to root list on body click.
443
457
  * @option
444
- * @example false
458
+ * @type {boolean}
459
+ * @default false
445
460
  */
446
461
  closeOnClick: false,
447
462
  /**
448
463
  * Allow the menu to auto adjust height.
449
464
  * @option
450
- * @example false
465
+ * @type {boolean}
466
+ * @default false
451
467
  */
452
468
  autoHeight: false,
453
469
  /**
454
470
  * Animate the auto adjust height.
455
471
  * @option
456
- * @example false
472
+ * @type {boolean}
473
+ * @default false
457
474
  */
458
475
  animateHeight: false,
459
476
  /**
460
477
  * Scroll to the top of the menu after opening a submenu or navigating back using the menu back button
461
478
  * @option
462
- * @example false
479
+ * @type {boolean}
480
+ * @default false
463
481
  */
464
482
  scrollTop: false,
465
483
  /**
466
484
  * String jquery selector (for example 'body') of element to take offset().top from, if empty string the drilldown menu offset().top is taken
467
485
  * @option
468
- * @example ''
486
+ * @type {string}
487
+ * @default ''
469
488
  */
470
489
  scrollTopElement: '',
471
490
  /**
472
491
  * ScrollTop offset
473
492
  * @option
474
- * @example 100
493
+ * @type {number}
494
+ * @default 0
475
495
  */
476
496
  scrollTopOffset: 0,
477
497
  /**
478
498
  * Scroll animation duration
479
499
  * @option
480
- * @example 500
500
+ * @type {number}
501
+ * @default 500
481
502
  */
482
503
  animationDuration: 500,
483
504
  /**
484
- * Scroll animation easing
505
+ * Scroll animation easing. Can be `'swing'` or `'linear'`.
485
506
  * @option
486
- * @example 'swing'
507
+ * @type {string}
508
+ * @see {@link https://api.jquery.com/animate|JQuery animate}
509
+ * @default 'swing'
487
510
  */
488
511
  animationEasing: 'swing'
489
512
  // holdOpen: false