material-sass 4.0.0.beta3 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +11 -10
  3. data/assets/javascripts/material-sprockets.js +1 -5
  4. data/assets/javascripts/material.js +155 -109
  5. data/assets/javascripts/material.min.js +4 -5
  6. data/assets/javascripts/material/addons/pickadate.js +0 -1
  7. data/assets/javascripts/material/components/expansion-panel.js +4 -5
  8. data/assets/javascripts/material/components/floating-label.js +10 -10
  9. data/assets/javascripts/material/components/nav-drawer.js +94 -68
  10. data/assets/javascripts/material/components/selection-control-focus.js +4 -5
  11. data/assets/javascripts/material/components/tab-switch.js +22 -11
  12. data/assets/javascripts/material/components/util.js +4 -14
  13. data/assets/stylesheets/material/{_colours.scss → _colors.scss} +414 -6
  14. data/assets/stylesheets/material/_functions.scss +17 -5
  15. data/assets/stylesheets/material/base/_base.scss +24 -0
  16. data/assets/stylesheets/material/bootstrap/_alert.scss +2 -2
  17. data/assets/stylesheets/material/bootstrap/_badge.scss +4 -4
  18. data/assets/stylesheets/material/bootstrap/_carousel.scss +36 -0
  19. data/assets/stylesheets/material/bootstrap/_close.scss +1 -1
  20. data/assets/stylesheets/material/bootstrap/_form.scss +26 -25
  21. data/assets/stylesheets/material/bootstrap/_pagination.scss +1 -1
  22. data/assets/stylesheets/material/material.scss +1 -1
  23. data/assets/stylesheets/material/material/_button-flat.scss +1 -1
  24. data/assets/stylesheets/material/material/_button-float.scss +22 -0
  25. data/assets/stylesheets/material/material/_button-group.scss +2 -2
  26. data/assets/stylesheets/material/material/_button.scss +6 -6
  27. data/assets/stylesheets/material/material/_card.scss +4 -4
  28. data/assets/stylesheets/material/material/_chip.scss +2 -2
  29. data/assets/stylesheets/material/material/_data-table.scss +62 -35
  30. data/assets/stylesheets/material/material/_dialog.scss +1 -1
  31. data/assets/stylesheets/material/material/_expansion-panel.scss +6 -6
  32. data/assets/stylesheets/material/material/_menu.scss +14 -0
  33. data/assets/stylesheets/material/material/_navdrawer.scss +99 -90
  34. data/assets/stylesheets/material/material/_picker.scss +69 -10
  35. data/assets/stylesheets/material/material/_progress-circular.scss +3 -3
  36. data/assets/stylesheets/material/material/_progress.scss +7 -7
  37. data/assets/stylesheets/material/material/_tab.scss +4 -0
  38. data/assets/stylesheets/material/material/_text-field-box.scss +19 -19
  39. data/assets/stylesheets/material/material/_text-field-floating-label.scss +8 -8
  40. data/assets/stylesheets/material/material/_text-field-input-group.scss +3 -3
  41. data/assets/stylesheets/material/material/_text-field.scss +3 -3
  42. data/assets/stylesheets/material/material/_toolbar.scss +48 -65
  43. data/assets/stylesheets/material/mixins/_breakpoint.scss +40 -22
  44. data/assets/stylesheets/material/mixins/_grid-framework.scss +6 -2
  45. data/assets/stylesheets/material/mixins/_grid.scss +10 -19
  46. data/assets/stylesheets/material/utilities/_background.scss +1 -1
  47. data/assets/stylesheets/material/utilities/_border.scss +1 -2
  48. data/assets/stylesheets/material/utilities/_display.scss +24 -16
  49. data/assets/stylesheets/material/utilities/_flex.scss +4 -0
  50. data/assets/stylesheets/material/utilities/_text.scss +1 -1
  51. data/assets/stylesheets/material/variables/_elevation-shadow.scss +0 -6
  52. data/assets/stylesheets/material/variables/_grid.scss +10 -19
  53. data/assets/stylesheets/material/variables/_palette.scss +26 -25
  54. data/assets/stylesheets/material/variables/_spacer.scss +24 -21
  55. data/assets/stylesheets/material/variables/_typography.scss +0 -1
  56. data/assets/stylesheets/material/variables/_variable-bootstrap.scss +7 -9
  57. data/assets/stylesheets/material/variables/_variable-material.scss +34 -29
  58. data/lib/material-sass/version.rb +1 -1
  59. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7975e440c98db73c6dcd55aa6636168fed1cb2e90eb163faa1a50ea03f086c60
4
- data.tar.gz: 2e1ce900d97b2f11f14d19d60cc8156d8a30ec3e2ceaf2a2619d0b420900dd53
3
+ metadata.gz: 1ab9eb66a89bb88c010b5e5d0aabc6cfca4324d5915034c77306159f2b17dc67
4
+ data.tar.gz: 12a569451a59060b49c20776e90abde9d2195ce459ef8edc65183c58eb48a97a
5
5
  SHA512:
6
- metadata.gz: 16158469216238f4ce31a0225281a3a3fbe999baa9683ac79a20272203f2c40438f3affa6524a3dcde151a6db0b9ca6741e32fa9da35dde0a9a4c49fd7267d07
7
- data.tar.gz: bf550e98f868743d595038c754a50eddf62fce57e90d14a7bf613bbd3fec08c97182dc151bb67b150ab9b0379d85943b8e110860716f3ca65413c28ac9f4cb3e
6
+ metadata.gz: 890c2028bf72e347a313627d250bbbfa7e1ccafb4a9d5758e702ccc6954a9924bee59e83ca7e6716e1c6353f7f614bd6f460aa382b33b04115d1d61b16616465
7
+ data.tar.gz: f31621d65045fb90b1f89d61ee365730b246de3d53f38be238f52835dfdbdacf4ade1ab8ebe0343c62c966a350c2368cb3853aa54d4fbd7a0dc8d13f6a86aff7
data/Rakefile CHANGED
@@ -23,12 +23,20 @@ namespace :javascripts do
23
23
  tgt_dir = "assets/javascripts/material/addons"
24
24
  mkdir_p tgt_dir
25
25
  cp_r src_dir, tgt_dir
26
-
27
26
  end
28
-
27
+
28
+ desc "Remove map"
29
+ task :tidy do
30
+ Dir.glob('assets/javascripts/**/*.js').each do |tgt_file|
31
+ content = File.read(tgt_file)
32
+ removed_map_content = content.sub(%r{^//# sourceMappingURL=.*\n?\z}, '')
33
+ File.open(tgt_file, "w") { |f| f.puts removed_map_content}
34
+ end
35
+ end
36
+
29
37
 
30
38
  desc "Setup javascript assets"
31
- task setup: [:clean, :copy]
39
+ task setup: [:clean, :copy, :tidy]
32
40
  end
33
41
 
34
42
  namespace :stylesheets do
@@ -69,10 +77,3 @@ end
69
77
 
70
78
  desc "Setup or update assets files"
71
79
  task setup: ["javascripts:setup", "stylesheets:setup"]
72
-
73
- desc 'Update material from upstream'
74
- task :update, :branch do |t, args|
75
- require './tasks/updater'
76
- Updater.new(branch: args[:branch]).update_material
77
- end
78
-
@@ -1,6 +1,2 @@
1
1
  //= require_tree ./material/components
2
- //= require ./material/addons/picker
3
- //= require ./material/addons/picker.date
4
- //= require ./material/addons/textarea-autosize
5
- //= require ./material/addons/waves
6
- //= require_tree ./material/initializers
2
+ //= require ./material/addons/pickadate
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Daemonite Material v4.0.0-beta (http://daemonite.github.io/material/)
2
+ * Daemonite Material v4.0.0 (http://daemonite.github.io/material/)
3
3
  * Copyright 2011-2018 Daemon Pty Ltd
4
4
  * Licensed under MIT (https://github.com/Daemonite/material/blob/master/LICENSE)
5
5
  */
@@ -2541,6 +2541,24 @@ function _createClass(Constructor, protoProps, staticProps) {
2541
2541
  return Constructor;
2542
2542
  }
2543
2543
 
2544
+ function _extends() {
2545
+ _extends = Object.assign || function (target) {
2546
+ for (var i = 1; i < arguments.length; i++) {
2547
+ var source = arguments[i];
2548
+
2549
+ for (var key in source) {
2550
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
2551
+ target[key] = source[key];
2552
+ }
2553
+ }
2554
+ }
2555
+
2556
+ return target;
2557
+ };
2558
+
2559
+ return _extends.apply(this, arguments);
2560
+ }
2561
+
2544
2562
  /*
2545
2563
  * Customise pickadate JavaScript for Material
2546
2564
  */
@@ -2715,16 +2733,16 @@ var ExpansionPanel = function ($$$1) {
2715
2733
  PANEL_BODY: '.expansion-panel .collapse' // <<< constants
2716
2734
 
2717
2735
  };
2718
- $$$1(document).on("" + Event.HIDE, Selector.PANEL_BODY, function (event) {
2719
- var target = $$$1(event.target).closest(Selector.PANEL);
2736
+ $$$1(document).on("" + Event.HIDE, Selector.PANEL_BODY, function () {
2737
+ var target = $$$1(this).closest(Selector.PANEL);
2720
2738
  target.removeClass(ClassName.SHOW);
2721
2739
  var predecessor = target.prev(Selector.PANEL);
2722
2740
 
2723
2741
  if (predecessor.length) {
2724
2742
  predecessor.removeClass(ClassName.SHOW_PREDECESSOR);
2725
2743
  }
2726
- }).on("" + Event.SHOW, Selector.PANEL_BODY, function (event) {
2727
- var target = $$$1(event.target).closest(Selector.PANEL);
2744
+ }).on("" + Event.SHOW, Selector.PANEL_BODY, function () {
2745
+ var target = $$$1(this).closest(Selector.PANEL);
2728
2746
  target.addClass(ClassName.SHOW);
2729
2747
  var predecessor = target.prev(Selector.PANEL);
2730
2748
 
@@ -2766,24 +2784,25 @@ var FloatingLabel = function ($$$1) {
2766
2784
  function () {
2767
2785
  function FloatingLabel(element) {
2768
2786
  this._element = element;
2787
+ this._parent = $$$1(element).closest(Selector.DATA_PARENT)[0];
2769
2788
  }
2770
2789
 
2771
2790
  var _proto = FloatingLabel.prototype;
2772
2791
 
2773
- _proto.change = function change(relatedTarget) {
2792
+ _proto.change = function change() {
2774
2793
  if ($$$1(this._element).val() || $$$1(this._element).is('select') && $$$1('option:first-child', $$$1(this._element)).html().replace(' ', '') !== '') {
2775
- $$$1(relatedTarget).addClass(ClassName.HAS_VALUE);
2794
+ $$$1(this._parent).addClass(ClassName.HAS_VALUE);
2776
2795
  } else {
2777
- $$$1(relatedTarget).removeClass(ClassName.HAS_VALUE);
2796
+ $$$1(this._parent).removeClass(ClassName.HAS_VALUE);
2778
2797
  }
2779
2798
  };
2780
2799
 
2781
- _proto.focusin = function focusin(relatedTarget) {
2782
- $$$1(relatedTarget).addClass(ClassName.IS_FOCUSED);
2800
+ _proto.focusin = function focusin() {
2801
+ $$$1(this._parent).addClass(ClassName.IS_FOCUSED);
2783
2802
  };
2784
2803
 
2785
- _proto.focusout = function focusout(relatedTarget) {
2786
- $$$1(relatedTarget).removeClass(ClassName.IS_FOCUSED);
2804
+ _proto.focusout = function focusout() {
2805
+ $$$1(this._parent).removeClass(ClassName.IS_FOCUSED);
2787
2806
  };
2788
2807
 
2789
2808
  FloatingLabel._jQueryInterface = function _jQueryInterface(event) {
@@ -2798,11 +2817,11 @@ var FloatingLabel = function ($$$1) {
2798
2817
  }
2799
2818
 
2800
2819
  if (typeof _event === 'string') {
2801
- if (data[_event] === 'undefined') {
2820
+ if (typeof data[_event] === 'undefined') {
2802
2821
  throw new Error("No method named \"" + _event + "\"");
2803
2822
  }
2804
2823
 
2805
- data[_event]($$$1(this).closest(Selector.DATA_PARENT));
2824
+ data[_event]();
2806
2825
  }
2807
2826
  });
2808
2827
  };
@@ -2825,19 +2844,14 @@ var FloatingLabel = function ($$$1) {
2825
2844
  }($);
2826
2845
 
2827
2846
  /*
2828
- * global util js
2829
- * based on bootstrap's (v4.0.0-beta) util.js
2847
+ * Global util js
2848
+ * Based on Bootstrap's (v4.0.0) `util.js`
2830
2849
  */
2831
2850
 
2832
2851
  var Util = function ($$$1) {
2833
2852
  var MAX_UID = 1000000;
2834
2853
  var transition = false;
2835
2854
 
2836
- function escapeId(selector) {
2837
- selector = typeof $$$1.escapeSelector === 'function' ? $$$1.escapeSelector(selector).substr(1) : selector.replace(/(:|\.|\[|\]|,|=|@)/g, '\\$1');
2838
- return selector;
2839
- }
2840
-
2841
2855
  function getSpecialTransitionEndEvent() {
2842
2856
  return {
2843
2857
  bindType: transition.end,
@@ -2862,7 +2876,7 @@ var Util = function ($$$1) {
2862
2876
  }
2863
2877
 
2864
2878
  function toType(obj) {
2865
- return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
2879
+ return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
2866
2880
  }
2867
2881
 
2868
2882
  function transitionEndEmulator(duration) {
@@ -2881,7 +2895,7 @@ var Util = function ($$$1) {
2881
2895
  }
2882
2896
 
2883
2897
  function transitionEndTest() {
2884
- if (window.QUnit) {
2898
+ if (typeof window !== 'undefined' && window.QUnit) {
2885
2899
  return false;
2886
2900
  }
2887
2901
 
@@ -2899,10 +2913,6 @@ var Util = function ($$$1) {
2899
2913
  selector = element.getAttribute('href') || '';
2900
2914
  }
2901
2915
 
2902
- if (selector.charAt(0) === '#') {
2903
- selector = escapeId(selector);
2904
- }
2905
-
2906
2916
  try {
2907
2917
  var $selector = $$$1(document).find(selector);
2908
2918
  return $selector.length > 0 ? selector : null;
@@ -2949,8 +2959,8 @@ var Util = function ($$$1) {
2949
2959
  }($);
2950
2960
 
2951
2961
  /*
2952
- * navigation drawer
2953
- * based on bootstrap's (v4.0.0-beta) modal.js
2962
+ * Navigation drawer
2963
+ * Based on Bootstrap's (v4.0.0) `modal.js`
2954
2964
  */
2955
2965
 
2956
2966
  var NavDrawer = function ($$$1) {
@@ -2961,15 +2971,17 @@ var NavDrawer = function ($$$1) {
2961
2971
  var EVENT_KEY = "." + DATA_KEY;
2962
2972
  var NAME = 'navdrawer';
2963
2973
  var NO_CONFLICT = $$$1.fn[NAME];
2964
- var TRANSITION_DURATION = 292.5;
2965
- var TRANSITION_DURATION_BACKDROP = 487.5;
2974
+ var Breakpoints = {
2975
+ DESKTOP: 992,
2976
+ TABLET: 576
2977
+ };
2966
2978
  var ClassName = {
2967
2979
  BACKDROP: 'navdrawer-backdrop',
2968
2980
  OPEN: 'navdrawer-open',
2969
2981
  SHOW: 'show'
2970
2982
  };
2971
2983
  var Default = {
2972
- breakpoint: 1280,
2984
+ breakpoint: '',
2973
2985
  keyboard: true,
2974
2986
  show: true,
2975
2987
  type: 'default'
@@ -2994,7 +3006,17 @@ var NavDrawer = function ($$$1) {
2994
3006
  var Selector = {
2995
3007
  CONTENT: '.navdrawer-content',
2996
3008
  DATA_DISMISS: '[data-dismiss="navdrawer"]',
2997
- DATA_TOGGLE: '[data-toggle="navdrawer"]' // <<< constants
3009
+ DATA_TOGGLE: '[data-toggle="navdrawer"]'
3010
+ };
3011
+ var TransitionDurationEntering = {
3012
+ DESKTOP: 150,
3013
+ MOBILE: 225,
3014
+ TABLET: 292.5
3015
+ };
3016
+ var TransitionDurationLeaving = {
3017
+ DESKTOP: 130,
3018
+ MOBILE: 195,
3019
+ TABLET: 253.5 // <<< constants
2998
3020
 
2999
3021
  };
3000
3022
 
@@ -3008,16 +3030,22 @@ var NavDrawer = function ($$$1) {
3008
3030
  this._element = element;
3009
3031
  this._ignoreBackdropClick = false;
3010
3032
  this._isShown = false;
3033
+ this._typeBreakpoint = this._config.breakpoint === '' ? '' : "-" + this._config.breakpoint;
3011
3034
  }
3012
3035
 
3013
3036
  var _proto = NavDrawer.prototype;
3014
3037
 
3015
3038
  _proto.hide = function hide(event) {
3039
+ var _this = this;
3040
+
3016
3041
  if (event) {
3017
3042
  event.preventDefault();
3018
3043
  }
3019
3044
 
3020
- var hideClassName = ClassName.OPEN + "-" + this._config.type;
3045
+ if (this._isTransitioning || !this._isShown) {
3046
+ return;
3047
+ }
3048
+
3021
3049
  var hideEvent = $$$1.Event(Event.HIDE);
3022
3050
  $$$1(this._element).trigger(hideEvent);
3023
3051
 
@@ -3026,18 +3054,40 @@ var NavDrawer = function ($$$1) {
3026
3054
  }
3027
3055
 
3028
3056
  this._isShown = false;
3057
+ var supportsTransition = Util.supportsTransitionEnd();
3058
+
3059
+ if (supportsTransition) {
3060
+ this._isTransitioning = true;
3061
+ }
3029
3062
 
3030
3063
  this._setEscapeEvent();
3031
3064
 
3032
3065
  $$$1(document).off(Event.FOCUSIN);
3066
+ $$$1(this._element).removeClass(ClassName.SHOW);
3067
+ $$$1(this._element).off(Event.CLICK_DISMISS);
3033
3068
  $$$1(this._content).off(Event.MOUSEDOWN_DISMISS);
3034
- $$$1(this._element).off(Event.CLICK_DISMISS).removeClass(ClassName.SHOW);
3035
3069
 
3036
- this._hideNavdrawer(hideClassName);
3070
+ if (supportsTransition) {
3071
+ $$$1(this._element).one(Util.TRANSITION_END, function (event) {
3072
+ return _this._hideNavdrawer(event);
3073
+ }).emulateTransitionEnd(this._getTransitionDuration(TransitionDurationLeaving));
3074
+ } else {
3075
+ this._hideNavdrawer();
3076
+ }
3077
+
3078
+ this._showBackdrop();
3037
3079
  };
3038
3080
 
3039
3081
  _proto.show = function show(relatedTarget) {
3040
- var _this = this;
3082
+ var _this2 = this;
3083
+
3084
+ if (this._isTransitioning || this._isShown) {
3085
+ return;
3086
+ }
3087
+
3088
+ if (Util.supportsTransitionEnd()) {
3089
+ this._isTransitioning = true;
3090
+ }
3041
3091
 
3042
3092
  var showEvent = $$$1.Event(Event.SHOW, {
3043
3093
  relatedTarget: relatedTarget
@@ -3049,16 +3099,18 @@ var NavDrawer = function ($$$1) {
3049
3099
  }
3050
3100
 
3051
3101
  this._isShown = true;
3052
- $$$1(document.body).addClass(ClassName.OPEN + "-" + this._config.type);
3102
+ $$$1(document.body).addClass(ClassName.OPEN + "-" + this._config.type + this._typeBreakpoint);
3053
3103
 
3054
3104
  this._setEscapeEvent();
3055
3105
 
3056
- $$$1(this._element).addClass(NAME + "-" + this._config.type);
3057
- $$$1(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, $$$1.proxy(this.hide, this));
3106
+ $$$1(this._element).addClass(NAME + "-" + this._config.type + this._typeBreakpoint);
3107
+ $$$1(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {
3108
+ return _this2.hide(event);
3109
+ });
3058
3110
  $$$1(this._content).on(Event.MOUSEDOWN_DISMISS, function () {
3059
- $$$1(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {
3060
- if ($$$1(event.target).is(_this._element)) {
3061
- _this._ignoreBackdropClick = true;
3111
+ $$$1(_this2._element).one(Event.MOUSEUP_DISMISS, function (event) {
3112
+ if ($$$1(event.target).is(_this2._element)) {
3113
+ _this2._ignoreBackdropClick = true;
3062
3114
  }
3063
3115
  });
3064
3116
  });
@@ -3073,34 +3125,39 @@ var NavDrawer = function ($$$1) {
3073
3125
  };
3074
3126
 
3075
3127
  _proto._enforceFocus = function _enforceFocus() {
3076
- var _this2 = this;
3128
+ var _this3 = this;
3077
3129
 
3078
3130
  $$$1(document).off(Event.FOCUSIN).on(Event.FOCUSIN, function (event) {
3079
- if (_this2._config.type === 'default' || $$$1(window).width() <= _this2._config.breakpoint) {
3080
- if (_this2._element !== event.target && !$$$1(_this2._element).has(event.target).length) {
3081
- _this2._element.focus();
3082
- }
3131
+ if (document !== event.target && _this3._element !== event.target && $$$1(_this3._element).has(event.target).length === 0) {
3132
+ _this3._element.focus();
3083
3133
  }
3084
3134
  });
3085
3135
  };
3086
3136
 
3087
3137
  _proto._getConfig = function _getConfig(config) {
3088
- config = $$$1.extend({}, Default, config);
3138
+ config = _extends({}, Default, config);
3089
3139
  Util.typeCheckConfig(NAME, config, DefaultType);
3090
3140
  return config;
3091
3141
  };
3092
3142
 
3093
- _proto._hideNavdrawer = function _hideNavdrawer(className) {
3094
- var _this3 = this;
3143
+ _proto._getTransitionDuration = function _getTransitionDuration(duration) {
3144
+ if (window.innerWidth >= Breakpoints.DESKTOP) {
3145
+ return duration.DESKTOP;
3146
+ } else if (window.innerWidth >= Breakpoints.TABLET) {
3147
+ return duration.TABLET;
3148
+ }
3095
3149
 
3096
- this._showBackdrop(function () {
3097
- $$$1(document.body).removeClass(className);
3150
+ return duration.MOBILE;
3151
+ };
3098
3152
 
3099
- _this3._element.setAttribute('aria-hidden', 'true');
3153
+ _proto._hideNavdrawer = function _hideNavdrawer() {
3154
+ this._element.style.display = 'none';
3100
3155
 
3101
- _this3._element.style.display = 'none';
3102
- $$$1(_this3._element).trigger(Event.HIDDEN);
3103
- });
3156
+ this._element.setAttribute('aria-hidden', true);
3157
+
3158
+ this._isTransitioning = false;
3159
+ $$$1(document.body).removeClass(ClassName.OPEN + "-" + this._config.type + this._typeBreakpoint);
3160
+ $$$1(this._element).trigger(Event.HIDDEN);
3104
3161
  };
3105
3162
 
3106
3163
  _proto._removeBackdrop = function _removeBackdrop() {
@@ -3116,6 +3173,8 @@ var NavDrawer = function ($$$1) {
3116
3173
  if (this._isShown && this._config.keyboard) {
3117
3174
  $$$1(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
3118
3175
  if (event.which === ESCAPE_KEYCODE) {
3176
+ event.preventDefault();
3177
+
3119
3178
  _this4.hide();
3120
3179
  }
3121
3180
  });
@@ -3124,14 +3183,14 @@ var NavDrawer = function ($$$1) {
3124
3183
  }
3125
3184
  };
3126
3185
 
3127
- _proto._showBackdrop = function _showBackdrop(callback) {
3186
+ _proto._showBackdrop = function _showBackdrop() {
3128
3187
  var _this5 = this;
3129
3188
 
3130
3189
  var supportsTransition = Util.supportsTransitionEnd();
3131
3190
 
3132
3191
  if (this._isShown) {
3133
3192
  this._backdrop = document.createElement('div');
3134
- $$$1(this._backdrop).addClass(ClassName.BACKDROP).addClass(ClassName.BACKDROP + "-" + this._config.type).appendTo(document.body);
3193
+ $$$1(this._backdrop).addClass(ClassName.BACKDROP).addClass(ClassName.BACKDROP + "-" + this._config.type + this._typeBreakpoint).appendTo(document.body);
3135
3194
  $$$1(this._element).on(Event.CLICK_DISMISS, function (event) {
3136
3195
  if (_this5._ignoreBackdropClick) {
3137
3196
  _this5._ignoreBackdropClick = false;
@@ -3150,35 +3209,10 @@ var NavDrawer = function ($$$1) {
3150
3209
  }
3151
3210
 
3152
3211
  $$$1(this._backdrop).addClass(ClassName.SHOW);
3153
-
3154
- if (!callback) {
3155
- return;
3156
- }
3157
-
3158
- if (!supportsTransition) {
3159
- callback();
3160
- return;
3161
- }
3162
-
3163
- $$$1(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(TRANSITION_DURATION_BACKDROP);
3164
- } else if (this._backdrop && !this._isShown) {
3212
+ } else if (!this._isShown && this._backdrop) {
3165
3213
  $$$1(this._backdrop).removeClass(ClassName.SHOW);
3166
3214
 
3167
- var callbackRemove = function callbackRemove() {
3168
- _this5._removeBackdrop();
3169
-
3170
- if (callback) {
3171
- callback();
3172
- }
3173
- };
3174
-
3175
- if (supportsTransition) {
3176
- $$$1(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(TRANSITION_DURATION_BACKDROP);
3177
- } else {
3178
- callbackRemove();
3179
- }
3180
- } else if (callback) {
3181
- callback();
3215
+ this._removeBackdrop();
3182
3216
  }
3183
3217
  };
3184
3218
 
@@ -3191,10 +3225,10 @@ var NavDrawer = function ($$$1) {
3191
3225
  document.body.appendChild(this._element);
3192
3226
  }
3193
3227
 
3194
- this._element.removeAttribute('aria-hidden');
3195
-
3196
3228
  this._element.style.display = 'block';
3197
3229
 
3230
+ this._element.removeAttribute('aria-hidden');
3231
+
3198
3232
  if (supportsTransition) {
3199
3233
  Util.reflow(this._element);
3200
3234
  }
@@ -3210,11 +3244,12 @@ var NavDrawer = function ($$$1) {
3210
3244
  var transitionComplete = function transitionComplete() {
3211
3245
  _this6._element.focus();
3212
3246
 
3247
+ _this6._isTransitioning = false;
3213
3248
  $$$1(_this6._element).trigger(shownEvent);
3214
3249
  };
3215
3250
 
3216
3251
  if (supportsTransition) {
3217
- $$$1(this._content).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION);
3252
+ $$$1(this._content).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(this._getTransitionDuration(TransitionDurationEntering));
3218
3253
  } else {
3219
3254
  transitionComplete();
3220
3255
  }
@@ -3222,7 +3257,7 @@ var NavDrawer = function ($$$1) {
3222
3257
 
3223
3258
  NavDrawer._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
3224
3259
  return this.each(function () {
3225
- var _config = $$$1.extend({}, NavDrawer.Default, $$$1(this).data(), typeof config === 'object' && config);
3260
+ var _config = _extends({}, NavDrawer.Default, $$$1(this).data(), typeof config === 'object' && config);
3226
3261
 
3227
3262
  var data = $$$1(this).data(DATA_KEY);
3228
3263
 
@@ -3232,8 +3267,8 @@ var NavDrawer = function ($$$1) {
3232
3267
  }
3233
3268
 
3234
3269
  if (typeof config === 'string') {
3235
- if (data[config] === 'undefined') {
3236
- throw new Error("No method named \"" + config + "\"");
3270
+ if (typeof data[config] === 'undefined') {
3271
+ throw new TypeError("No method named \"" + config + "\"");
3237
3272
  }
3238
3273
 
3239
3274
  data[config](relatedTarget);
@@ -3262,9 +3297,9 @@ var NavDrawer = function ($$$1) {
3262
3297
  target = $$$1(selector)[0];
3263
3298
  }
3264
3299
 
3265
- var config = $$$1(target).data(DATA_KEY) ? 'toggle' : $$$1.extend({}, $$$1(target).data(), $$$1(this).data());
3300
+ var config = $$$1(target).data(DATA_KEY) ? 'toggle' : _extends({}, $$$1(target).data(), $$$1(this).data());
3266
3301
 
3267
- if (this.tagName === 'A') {
3302
+ if (this.tagName === 'A' || this.tagName === 'AREA') {
3268
3303
  event.preventDefault();
3269
3304
  }
3270
3305
 
@@ -3319,11 +3354,11 @@ var SelectionControlFocus = function ($$$1) {
3319
3354
  INPUT: '.custom-control-input' // <<< constants
3320
3355
 
3321
3356
  };
3322
- $$$1(document).on("" + Event.BLUR, Selector.INPUT, function (event) {
3323
- $$$1(event.target).removeClass(ClassName.FOCUS);
3324
- }).on("" + Event.FOCUS, Selector.INPUT, function (event) {
3357
+ $$$1(document).on("" + Event.BLUR, Selector.INPUT, function () {
3358
+ $$$1(this).removeClass(ClassName.FOCUS);
3359
+ }).on("" + Event.FOCUS, Selector.INPUT, function () {
3325
3360
  if (LastInteraction.IS_MOUSEDOWN === false) {
3326
- $$$1(event.target).addClass(ClassName.FOCUS);
3361
+ $$$1(this).addClass(ClassName.FOCUS);
3327
3362
  }
3328
3363
  }).on("" + Event.MOUSEDOWN, Selector.CONTROL, function () {
3329
3364
  LastInteraction.IS_MOUSEDOWN = true;
@@ -3335,8 +3370,8 @@ var SelectionControlFocus = function ($$$1) {
3335
3370
  }($);
3336
3371
 
3337
3372
  /*
3338
- * tab indicator animation
3339
- * requires bootstrap's (v4.0.0-beta) tab.js
3373
+ * Tab indicator animation
3374
+ * Requires Bootstrap's (v4.0.0) `tab.js`
3340
3375
  */
3341
3376
 
3342
3377
  var TabSwitch = function ($$$1) {
@@ -3344,7 +3379,10 @@ var TabSwitch = function ($$$1) {
3344
3379
  var DATA_KEY = 'md.tabswitch';
3345
3380
  var NAME = 'tabswitch';
3346
3381
  var NO_CONFLICT = $$$1.fn[NAME];
3347
- var TRANSITION_DURATION = 390;
3382
+ var Breakpoints = {
3383
+ DESKTOP: 992,
3384
+ TABLET: 576
3385
+ };
3348
3386
  var ClassName = {
3349
3387
  ANIMATE: 'animate',
3350
3388
  DROPDOWN_ITEM: 'dropdown-item',
@@ -3359,7 +3397,12 @@ var TabSwitch = function ($$$1) {
3359
3397
  var Selector = {
3360
3398
  DATA_TOGGLE: '.nav-tabs [data-toggle="tab"]',
3361
3399
  DROPDOWN: '.dropdown',
3362
- NAV: '.nav-tabs' // <<< constants
3400
+ NAV: '.nav-tabs'
3401
+ };
3402
+ var TransitionDuration = {
3403
+ DESKTOP: 200,
3404
+ MOBILE: 300,
3405
+ TABLET: 390 // <<< constants
3363
3406
 
3364
3407
  };
3365
3408
 
@@ -3367,10 +3410,6 @@ var TabSwitch = function ($$$1) {
3367
3410
  /*#__PURE__*/
3368
3411
  function () {
3369
3412
  function TabSwitch(nav) {
3370
- if (typeof $$$1.fn.tab === 'undefined') {
3371
- throw new Error('Material\'s JavaScript requires Bootstrap\'s tab.js');
3372
- }
3373
-
3374
3413
  this._nav = nav;
3375
3414
  this._navindicator = null;
3376
3415
  }
@@ -3417,7 +3456,15 @@ var TabSwitch = function ($$$1) {
3417
3456
  return;
3418
3457
  }
3419
3458
 
3420
- $$$1(this._navindicator).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
3459
+ var transitionDuration = TransitionDuration.MOBILE;
3460
+
3461
+ if (window.innerWidth >= Breakpoints.DESKTOP) {
3462
+ transitionDuration = TransitionDuration.DESKTOP;
3463
+ } else if (window.innerWidth >= Breakpoints.TABLET) {
3464
+ transitionDuration = TransitionDuration.TABLET;
3465
+ }
3466
+
3467
+ $$$1(this._navindicator).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
3421
3468
  };
3422
3469
 
3423
3470
  _proto._createIndicator = function _createIndicator(navLeft, navScrollLeft, navWidth, relatedTarget) {
@@ -3463,7 +3510,7 @@ var TabSwitch = function ($$$1) {
3463
3510
  }();
3464
3511
 
3465
3512
  $$$1(document).on(Event.SHOW_BS_TAB, Selector.DATA_TOGGLE, function (event) {
3466
- TabSwitch._jQueryInterface.call($$$1(event.target), event.relatedTarget);
3513
+ TabSwitch._jQueryInterface.call($$$1(this), event.relatedTarget);
3467
3514
  });
3468
3515
  $$$1.fn[NAME] = TabSwitch._jQueryInterface;
3469
3516
  $$$1.fn[NAME].Constructor = TabSwitch;
@@ -3488,4 +3535,3 @@ exports.TabSwitch = TabSwitch;
3488
3535
  Object.defineProperty(exports, '__esModule', { value: true });
3489
3536
 
3490
3537
  })));
3491
- //# sourceMappingURL=material.js.map