bootstrap 4.4.1 → 5.0.0.alpha2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +12 -2
  3. data/README.md +1 -1
  4. data/assets/javascripts/bootstrap-sprockets.js +12 -8
  5. data/assets/javascripts/bootstrap.js +2094 -1562
  6. data/assets/javascripts/bootstrap.min.js +4 -4
  7. data/assets/javascripts/bootstrap/alert.js +145 -83
  8. data/assets/javascripts/bootstrap/button.js +66 -152
  9. data/assets/javascripts/bootstrap/carousel.js +307 -241
  10. data/assets/javascripts/bootstrap/collapse.js +287 -183
  11. data/assets/javascripts/bootstrap/dom/data.js +81 -0
  12. data/assets/javascripts/bootstrap/dom/event-handler.js +315 -0
  13. data/assets/javascripts/bootstrap/dom/manipulator.js +96 -0
  14. data/assets/javascripts/bootstrap/dom/polyfill.js +110 -0
  15. data/assets/javascripts/bootstrap/dom/selector-engine.js +98 -0
  16. data/assets/javascripts/bootstrap/dropdown.js +255 -261
  17. data/assets/javascripts/bootstrap/modal.js +364 -270
  18. data/assets/javascripts/bootstrap/popover.js +72 -113
  19. data/assets/javascripts/bootstrap/scrollspy.js +162 -147
  20. data/assets/javascripts/bootstrap/tab.js +176 -108
  21. data/assets/javascripts/bootstrap/toast.js +179 -139
  22. data/assets/javascripts/bootstrap/tooltip.js +369 -259
  23. data/assets/stylesheets/_bootstrap-grid.scss +54 -18
  24. data/assets/stylesheets/_bootstrap-reboot.scss +7 -4
  25. data/assets/stylesheets/_bootstrap.scss +17 -11
  26. data/assets/stylesheets/bootstrap/_alert.scss +6 -7
  27. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  28. data/assets/stylesheets/bootstrap/_breadcrumb.scss +5 -17
  29. data/assets/stylesheets/bootstrap/_button-group.scss +16 -38
  30. data/assets/stylesheets/bootstrap/_buttons.scss +25 -40
  31. data/assets/stylesheets/bootstrap/_card.scss +43 -79
  32. data/assets/stylesheets/bootstrap/_carousel.scss +30 -15
  33. data/assets/stylesheets/bootstrap/_close.scss +31 -31
  34. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  35. data/assets/stylesheets/bootstrap/_dropdown.scss +54 -9
  36. data/assets/stylesheets/bootstrap/_forms.scss +9 -338
  37. data/assets/stylesheets/bootstrap/_functions.scss +97 -25
  38. data/assets/stylesheets/bootstrap/_grid.scss +3 -50
  39. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  40. data/assets/stylesheets/bootstrap/_list-group.scss +16 -17
  41. data/assets/stylesheets/bootstrap/_mixins.scss +7 -13
  42. data/assets/stylesheets/bootstrap/_modal.scss +41 -45
  43. data/assets/stylesheets/bootstrap/_nav.scss +16 -9
  44. data/assets/stylesheets/bootstrap/_navbar.scss +43 -74
  45. data/assets/stylesheets/bootstrap/_pagination.scss +11 -20
  46. data/assets/stylesheets/bootstrap/_popover.scss +5 -5
  47. data/assets/stylesheets/bootstrap/_progress.scss +2 -3
  48. data/assets/stylesheets/bootstrap/_reboot.scss +310 -175
  49. data/assets/stylesheets/bootstrap/_root.scss +5 -9
  50. data/assets/stylesheets/bootstrap/_spinners.scss +5 -4
  51. data/assets/stylesheets/bootstrap/_tables.scss +80 -114
  52. data/assets/stylesheets/bootstrap/_toasts.scss +6 -2
  53. data/assets/stylesheets/bootstrap/_tooltip.scss +5 -5
  54. data/assets/stylesheets/bootstrap/_transitions.scss +0 -1
  55. data/assets/stylesheets/bootstrap/_type.scss +38 -59
  56. data/assets/stylesheets/bootstrap/_utilities.scss +531 -17
  57. data/assets/stylesheets/bootstrap/_variables.scss +609 -444
  58. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  59. data/assets/stylesheets/bootstrap/forms/_form-check.scss +142 -0
  60. data/assets/stylesheets/bootstrap/forms/_form-control.scss +116 -0
  61. data/assets/stylesheets/bootstrap/forms/_form-file.scss +91 -0
  62. data/assets/stylesheets/bootstrap/forms/_form-range.scss +136 -0
  63. data/assets/stylesheets/bootstrap/forms/_form-select.scss +82 -0
  64. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  65. data/assets/stylesheets/bootstrap/forms/_input-group.scss +140 -0
  66. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  67. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  68. data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
  69. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  70. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  71. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  72. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  73. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  74. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  75. data/assets/stylesheets/bootstrap/mixins/_alert.scss +0 -4
  76. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +35 -22
  77. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  78. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  79. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +69 -51
  80. data/assets/stylesheets/bootstrap/mixins/_caret.scss +4 -4
  81. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  82. data/assets/stylesheets/bootstrap/mixins/_container.scss +11 -0
  83. data/assets/stylesheets/bootstrap/mixins/_forms.scss +22 -66
  84. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +9 -11
  85. data/assets/stylesheets/bootstrap/mixins/_grid.scss +84 -33
  86. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  87. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +2 -1
  88. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  89. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +15 -8
  90. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  91. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  92. data/assets/stylesheets/bootstrap/mixins/_transition.scss +18 -8
  93. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +49 -0
  94. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +28 -0
  95. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  96. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +234 -126
  97. data/lib/bootstrap/version.rb +2 -2
  98. data/tasks/updater/js.rb +3 -3
  99. data/tasks/updater/network.rb +2 -2
  100. data/test/gemfiles/rails_6_0.gemfile +7 -0
  101. metadata +36 -41
  102. data/assets/javascripts/bootstrap/util.js +0 -188
  103. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  104. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -521
  105. data/assets/stylesheets/bootstrap/_input-group.scss +0 -191
  106. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  107. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  108. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  109. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -22
  110. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  111. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  112. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -71
  113. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  114. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  115. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  116. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  117. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  118. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  119. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  120. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  121. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  122. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  123. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  124. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  125. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  126. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  127. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  128. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  129. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  130. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  131. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  132. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  133. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  134. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  135. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  136. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
@@ -1,140 +1,177 @@
1
1
  /*!
2
- * Bootstrap tooltip.js v4.4.1 (https://getbootstrap.com/)
3
- * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2
+ * Bootstrap tooltip.js v5.0.0-alpha2 (https://getbootstrap.com/)
3
+ * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
6
6
  (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) :
8
- typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) :
9
- (global = global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util));
10
- }(this, (function ($, Popper, Util) { 'use strict';
11
-
12
- $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
13
- Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
14
- Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
15
-
16
- function _defineProperties(target, props) {
17
- for (var i = 0; i < props.length; i++) {
18
- var descriptor = props[i];
19
- descriptor.enumerable = descriptor.enumerable || false;
20
- descriptor.configurable = true;
21
- if ("value" in descriptor) descriptor.writable = true;
22
- Object.defineProperty(target, descriptor.key, descriptor);
23
- }
24
- }
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('popper.js'), require('./dom/selector-engine.js')) :
8
+ typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js', './dom/manipulator.js', 'popper.js', './dom/selector-engine.js'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.Data, global.EventHandler, global.Manipulator, global.Popper, global.SelectorEngine));
10
+ }(this, (function (Data, EventHandler, Manipulator, Popper, SelectorEngine) { 'use strict';
25
11
 
26
- function _createClass(Constructor, protoProps, staticProps) {
27
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
28
- if (staticProps) _defineProperties(Constructor, staticProps);
29
- return Constructor;
30
- }
12
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
31
13
 
32
- function _defineProperty(obj, key, value) {
33
- if (key in obj) {
34
- Object.defineProperty(obj, key, {
35
- value: value,
36
- enumerable: true,
37
- configurable: true,
38
- writable: true
39
- });
40
- } else {
41
- obj[key] = value;
14
+ var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
15
+ var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
16
+ var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
17
+ var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
18
+ var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
19
+
20
+ /**
21
+ * --------------------------------------------------------------------------
22
+ * Bootstrap (v5.0.0-alpha2): util/index.js
23
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
24
+ * --------------------------------------------------------------------------
25
+ */
26
+ var MAX_UID = 1000000;
27
+ var MILLISECONDS_MULTIPLIER = 1000;
28
+ var TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
29
+
30
+ var toType = function toType(obj) {
31
+ if (obj === null || obj === undefined) {
32
+ return "" + obj;
42
33
  }
43
34
 
44
- return obj;
45
- }
35
+ return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
36
+ };
37
+ /**
38
+ * --------------------------------------------------------------------------
39
+ * Public Util Api
40
+ * --------------------------------------------------------------------------
41
+ */
46
42
 
47
- function ownKeys(object, enumerableOnly) {
48
- var keys = Object.keys(object);
49
43
 
50
- if (Object.getOwnPropertySymbols) {
51
- var symbols = Object.getOwnPropertySymbols(object);
52
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
53
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
54
- });
55
- keys.push.apply(keys, symbols);
44
+ var getUID = function getUID(prefix) {
45
+ do {
46
+ prefix += Math.floor(Math.random() * MAX_UID);
47
+ } while (document.getElementById(prefix));
48
+
49
+ return prefix;
50
+ };
51
+
52
+ var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
53
+ if (!element) {
54
+ return 0;
55
+ } // Get transition-duration of the element
56
+
57
+
58
+ var _window$getComputedSt = window.getComputedStyle(element),
59
+ transitionDuration = _window$getComputedSt.transitionDuration,
60
+ transitionDelay = _window$getComputedSt.transitionDelay;
61
+
62
+ var floatTransitionDuration = parseFloat(transitionDuration);
63
+ var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
64
+
65
+ if (!floatTransitionDuration && !floatTransitionDelay) {
66
+ return 0;
67
+ } // If multiple durations are defined, take the first
68
+
69
+
70
+ transitionDuration = transitionDuration.split(',')[0];
71
+ transitionDelay = transitionDelay.split(',')[0];
72
+ return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
73
+ };
74
+
75
+ var triggerTransitionEnd = function triggerTransitionEnd(element) {
76
+ element.dispatchEvent(new Event(TRANSITION_END));
77
+ };
78
+
79
+ var isElement = function isElement(obj) {
80
+ return (obj[0] || obj).nodeType;
81
+ };
82
+
83
+ var emulateTransitionEnd = function emulateTransitionEnd(element, duration) {
84
+ var called = false;
85
+ var durationPadding = 5;
86
+ var emulatedDuration = duration + durationPadding;
87
+
88
+ function listener() {
89
+ called = true;
90
+ element.removeEventListener(TRANSITION_END, listener);
56
91
  }
57
92
 
58
- return keys;
59
- }
93
+ element.addEventListener(TRANSITION_END, listener);
94
+ setTimeout(function () {
95
+ if (!called) {
96
+ triggerTransitionEnd(element);
97
+ }
98
+ }, emulatedDuration);
99
+ };
60
100
 
61
- function _objectSpread2(target) {
62
- for (var i = 1; i < arguments.length; i++) {
63
- var source = arguments[i] != null ? arguments[i] : {};
101
+ var typeCheckConfig = function typeCheckConfig(componentName, config, configTypes) {
102
+ Object.keys(configTypes).forEach(function (property) {
103
+ var expectedTypes = configTypes[property];
104
+ var value = config[property];
105
+ var valueType = value && isElement(value) ? 'element' : toType(value);
64
106
 
65
- if (i % 2) {
66
- ownKeys(Object(source), true).forEach(function (key) {
67
- _defineProperty(target, key, source[key]);
68
- });
69
- } else if (Object.getOwnPropertyDescriptors) {
70
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
71
- } else {
72
- ownKeys(Object(source)).forEach(function (key) {
73
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
74
- });
107
+ if (!new RegExp(expectedTypes).test(valueType)) {
108
+ throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
75
109
  }
110
+ });
111
+ };
112
+
113
+ var findShadowRoot = function findShadowRoot(element) {
114
+ if (!document.documentElement.attachShadow) {
115
+ return null;
116
+ } // Can find the shadow root otherwise it'll return the document
117
+
118
+
119
+ if (typeof element.getRootNode === 'function') {
120
+ var root = element.getRootNode();
121
+ return root instanceof ShadowRoot ? root : null;
76
122
  }
77
123
 
78
- return target;
79
- }
124
+ if (element instanceof ShadowRoot) {
125
+ return element;
126
+ } // when we don't find a shadow root
127
+
128
+
129
+ if (!element.parentNode) {
130
+ return null;
131
+ }
132
+
133
+ return findShadowRoot(element.parentNode);
134
+ };
135
+
136
+ var noop = function noop() {
137
+ return function () {};
138
+ };
139
+
140
+ var getjQuery = function getjQuery() {
141
+ var _window = window,
142
+ jQuery = _window.jQuery;
143
+
144
+ if (jQuery && !document.body.hasAttribute('data-no-jquery')) {
145
+ return jQuery;
146
+ }
147
+
148
+ return null;
149
+ };
80
150
 
81
151
  /**
82
152
  * --------------------------------------------------------------------------
83
- * Bootstrap (v4.4.1): tools/sanitizer.js
84
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
153
+ * Bootstrap (v5.0.0-alpha2): util/sanitizer.js
154
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
85
155
  * --------------------------------------------------------------------------
86
156
  */
87
157
  var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
88
158
  var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
89
- var DefaultWhitelist = {
90
- // Global attributes allowed on any supplied element below.
91
- '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
92
- a: ['target', 'href', 'title', 'rel'],
93
- area: [],
94
- b: [],
95
- br: [],
96
- col: [],
97
- code: [],
98
- div: [],
99
- em: [],
100
- hr: [],
101
- h1: [],
102
- h2: [],
103
- h3: [],
104
- h4: [],
105
- h5: [],
106
- h6: [],
107
- i: [],
108
- img: ['src', 'alt', 'title', 'width', 'height'],
109
- li: [],
110
- ol: [],
111
- p: [],
112
- pre: [],
113
- s: [],
114
- small: [],
115
- span: [],
116
- sub: [],
117
- sup: [],
118
- strong: [],
119
- u: [],
120
- ul: []
121
- };
122
159
  /**
123
160
  * A pattern that recognizes a commonly useful subset of URLs that are safe.
124
161
  *
125
162
  * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
126
163
  */
127
164
 
128
- var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
165
+ var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
129
166
  /**
130
167
  * A pattern that matches safe data URLs. Only matches image, video and audio types.
131
168
  *
132
169
  * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
133
170
  */
134
171
 
135
- var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
172
+ var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
136
173
 
137
- function allowedAttribute(attr, allowedAttributeList) {
174
+ var allowedAttribute = function allowedAttribute(attr, allowedAttributeList) {
138
175
  var attrName = attr.nodeName.toLowerCase();
139
176
 
140
177
  if (allowedAttributeList.indexOf(attrName) !== -1) {
@@ -149,17 +186,52 @@
149
186
  return attrRegex instanceof RegExp;
150
187
  }); // Check if a regular expression validates the attribute.
151
188
 
152
- for (var i = 0, l = regExp.length; i < l; i++) {
189
+ for (var i = 0, len = regExp.length; i < len; i++) {
153
190
  if (attrName.match(regExp[i])) {
154
191
  return true;
155
192
  }
156
193
  }
157
194
 
158
195
  return false;
159
- }
196
+ };
197
+
198
+ var DefaultAllowlist = {
199
+ // Global attributes allowed on any supplied element below.
200
+ '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
201
+ a: ['target', 'href', 'title', 'rel'],
202
+ area: [],
203
+ b: [],
204
+ br: [],
205
+ col: [],
206
+ code: [],
207
+ div: [],
208
+ em: [],
209
+ hr: [],
210
+ h1: [],
211
+ h2: [],
212
+ h3: [],
213
+ h4: [],
214
+ h5: [],
215
+ h6: [],
216
+ i: [],
217
+ img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
218
+ li: [],
219
+ ol: [],
220
+ p: [],
221
+ pre: [],
222
+ s: [],
223
+ small: [],
224
+ span: [],
225
+ sub: [],
226
+ sup: [],
227
+ strong: [],
228
+ u: [],
229
+ ul: []
230
+ };
231
+ function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
232
+ var _ref;
160
233
 
161
- function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
162
- if (unsafeHtml.length === 0) {
234
+ if (!unsafeHtml.length) {
163
235
  return unsafeHtml;
164
236
  }
165
237
 
@@ -169,22 +241,26 @@
169
241
 
170
242
  var domParser = new window.DOMParser();
171
243
  var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
172
- var whitelistKeys = Object.keys(whiteList);
173
- var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
244
+ var allowlistKeys = Object.keys(allowList);
245
+
246
+ var elements = (_ref = []).concat.apply(_ref, createdDocument.body.querySelectorAll('*'));
174
247
 
175
248
  var _loop = function _loop(i, len) {
249
+ var _ref2;
250
+
176
251
  var el = elements[i];
177
252
  var elName = el.nodeName.toLowerCase();
178
253
 
179
- if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
254
+ if (allowlistKeys.indexOf(elName) === -1) {
180
255
  el.parentNode.removeChild(el);
181
256
  return "continue";
182
257
  }
183
258
 
184
- var attributeList = [].slice.call(el.attributes);
185
- var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
259
+ var attributeList = (_ref2 = []).concat.apply(_ref2, el.attributes);
260
+
261
+ var allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);
186
262
  attributeList.forEach(function (attr) {
187
- if (!allowedAttribute(attr, whitelistedAttributes)) {
263
+ if (!allowedAttribute(attr, allowedAttributes)) {
188
264
  el.removeAttribute(attr.nodeName);
189
265
  }
190
266
  });
@@ -199,6 +275,11 @@
199
275
  return createdDocument.body.innerHTML;
200
276
  }
201
277
 
278
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
279
+
280
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
281
+
282
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
202
283
  /**
203
284
  * ------------------------------------------------------------------------
204
285
  * Constants
@@ -206,13 +287,12 @@
206
287
  */
207
288
 
208
289
  var NAME = 'tooltip';
209
- var VERSION = '4.4.1';
290
+ var VERSION = '5.0.0-alpha2';
210
291
  var DATA_KEY = 'bs.tooltip';
211
292
  var EVENT_KEY = "." + DATA_KEY;
212
- var JQUERY_NO_CONFLICT = $.fn[NAME];
213
293
  var CLASS_PREFIX = 'bs-tooltip';
214
294
  var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
215
- var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
295
+ var DISALLOWED_ATTRIBUTES = ['sanitize', 'allowList', 'sanitizeFn'];
216
296
  var DefaultType = {
217
297
  animation: 'boolean',
218
298
  template: 'string',
@@ -228,7 +308,7 @@
228
308
  boundary: '(string|element)',
229
309
  sanitize: 'boolean',
230
310
  sanitizeFn: '(null|function)',
231
- whiteList: 'object',
311
+ allowList: 'object',
232
312
  popperConfig: '(null|object)'
233
313
  };
234
314
  var AttachmentMap = {
@@ -240,7 +320,7 @@
240
320
  };
241
321
  var Default = {
242
322
  animation: true,
243
- template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
323
+ template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div></div>',
244
324
  trigger: 'hover focus',
245
325
  title: '',
246
326
  delay: 0,
@@ -253,14 +333,10 @@
253
333
  boundary: 'scrollParent',
254
334
  sanitize: true,
255
335
  sanitizeFn: null,
256
- whiteList: DefaultWhitelist,
336
+ allowList: DefaultAllowlist,
257
337
  popperConfig: null
258
338
  };
259
- var HoverState = {
260
- SHOW: 'show',
261
- OUT: 'out'
262
- };
263
- var Event = {
339
+ var Event$1 = {
264
340
  HIDE: "hide" + EVENT_KEY,
265
341
  HIDDEN: "hidden" + EVENT_KEY,
266
342
  SHOW: "show" + EVENT_KEY,
@@ -272,33 +348,26 @@
272
348
  MOUSEENTER: "mouseenter" + EVENT_KEY,
273
349
  MOUSELEAVE: "mouseleave" + EVENT_KEY
274
350
  };
275
- var ClassName = {
276
- FADE: 'fade',
277
- SHOW: 'show'
278
- };
279
- var Selector = {
280
- TOOLTIP: '.tooltip',
281
- TOOLTIP_INNER: '.tooltip-inner',
282
- ARROW: '.arrow'
283
- };
284
- var Trigger = {
285
- HOVER: 'hover',
286
- FOCUS: 'focus',
287
- CLICK: 'click',
288
- MANUAL: 'manual'
289
- };
351
+ var CLASS_NAME_FADE = 'fade';
352
+ var CLASS_NAME_MODAL = 'modal';
353
+ var CLASS_NAME_SHOW = 'show';
354
+ var HOVER_STATE_SHOW = 'show';
355
+ var HOVER_STATE_OUT = 'out';
356
+ var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
357
+ var TRIGGER_HOVER = 'hover';
358
+ var TRIGGER_FOCUS = 'focus';
359
+ var TRIGGER_CLICK = 'click';
360
+ var TRIGGER_MANUAL = 'manual';
290
361
  /**
291
362
  * ------------------------------------------------------------------------
292
363
  * Class Definition
293
364
  * ------------------------------------------------------------------------
294
365
  */
295
366
 
296
- var Tooltip =
297
- /*#__PURE__*/
298
- function () {
367
+ var Tooltip = /*#__PURE__*/function () {
299
368
  function Tooltip(element, config) {
300
- if (typeof Popper === 'undefined') {
301
- throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
369
+ if (typeof Popper__default['default'] === 'undefined') {
370
+ throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org)');
302
371
  } // private
303
372
 
304
373
 
@@ -313,6 +382,8 @@
313
382
  this.tip = null;
314
383
 
315
384
  this._setListeners();
385
+
386
+ Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
316
387
  } // Getters
317
388
 
318
389
 
@@ -338,11 +409,11 @@
338
409
 
339
410
  if (event) {
340
411
  var dataKey = this.constructor.DATA_KEY;
341
- var context = $(event.currentTarget).data(dataKey);
412
+ var context = Data__default['default'].getData(event.delegateTarget, dataKey);
342
413
 
343
414
  if (!context) {
344
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
345
- $(event.currentTarget).data(dataKey, context);
415
+ context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
416
+ Data__default['default'].setData(event.delegateTarget, dataKey, context);
346
417
  }
347
418
 
348
419
  context._activeTrigger.click = !context._activeTrigger.click;
@@ -353,7 +424,7 @@
353
424
  context._leave(null, context);
354
425
  }
355
426
  } else {
356
- if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {
427
+ if (this.getTipElement().classList.contains(CLASS_NAME_SHOW)) {
357
428
  this._leave(null, this);
358
429
 
359
430
  return;
@@ -365,12 +436,12 @@
365
436
 
366
437
  _proto.dispose = function dispose() {
367
438
  clearTimeout(this._timeout);
368
- $.removeData(this.element, this.constructor.DATA_KEY);
369
- $(this.element).off(this.constructor.EVENT_KEY);
370
- $(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
439
+ Data__default['default'].removeData(this.element, this.constructor.DATA_KEY);
440
+ EventHandler__default['default'].off(this.element, this.constructor.EVENT_KEY);
441
+ EventHandler__default['default'].off(this.element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
371
442
 
372
443
  if (this.tip) {
373
- $(this.tip).remove();
444
+ this.tip.parentNode.removeChild(this.tip);
374
445
  }
375
446
 
376
447
  this._isEnabled = null;
@@ -391,54 +462,56 @@
391
462
  _proto.show = function show() {
392
463
  var _this = this;
393
464
 
394
- if ($(this.element).css('display') === 'none') {
465
+ if (this.element.style.display === 'none') {
395
466
  throw new Error('Please use show on visible elements');
396
467
  }
397
468
 
398
- var showEvent = $.Event(this.constructor.Event.SHOW);
399
-
400
469
  if (this.isWithContent() && this._isEnabled) {
401
- $(this.element).trigger(showEvent);
402
- var shadowRoot = Util.findShadowRoot(this.element);
403
- var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
470
+ var showEvent = EventHandler__default['default'].trigger(this.element, this.constructor.Event.SHOW);
471
+ var shadowRoot = findShadowRoot(this.element);
472
+ var isInTheDom = shadowRoot === null ? this.element.ownerDocument.documentElement.contains(this.element) : shadowRoot.contains(this.element);
404
473
 
405
- if (showEvent.isDefaultPrevented() || !isInTheDom) {
474
+ if (showEvent.defaultPrevented || !isInTheDom) {
406
475
  return;
407
476
  }
408
477
 
409
478
  var tip = this.getTipElement();
410
- var tipId = Util.getUID(this.constructor.NAME);
479
+ var tipId = getUID(this.constructor.NAME);
411
480
  tip.setAttribute('id', tipId);
412
481
  this.element.setAttribute('aria-describedby', tipId);
413
482
  this.setContent();
414
483
 
415
484
  if (this.config.animation) {
416
- $(tip).addClass(ClassName.FADE);
485
+ tip.classList.add(CLASS_NAME_FADE);
417
486
  }
418
487
 
419
488
  var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
420
489
 
421
490
  var attachment = this._getAttachment(placement);
422
491
 
423
- this.addAttachmentClass(attachment);
492
+ this._addAttachmentClass(attachment);
424
493
 
425
494
  var container = this._getContainer();
426
495
 
427
- $(tip).data(this.constructor.DATA_KEY, this);
496
+ Data__default['default'].setData(tip, this.constructor.DATA_KEY, this);
428
497
 
429
- if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
430
- $(tip).appendTo(container);
498
+ if (!this.element.ownerDocument.documentElement.contains(this.tip)) {
499
+ container.appendChild(tip);
431
500
  }
432
501
 
433
- $(this.element).trigger(this.constructor.Event.INSERTED);
434
- this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
435
- $(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra
502
+ EventHandler__default['default'].trigger(this.element, this.constructor.Event.INSERTED);
503
+ this._popper = new Popper__default['default'](this.element, tip, this._getPopperConfig(attachment));
504
+ tip.classList.add(CLASS_NAME_SHOW); // If this is a touch-enabled device we add extra
436
505
  // empty mouseover listeners to the body's immediate children;
437
506
  // only needed because of broken event delegation on iOS
438
507
  // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
439
508
 
440
509
  if ('ontouchstart' in document.documentElement) {
441
- $(document.body).children().on('mouseover', null, $.noop);
510
+ var _ref;
511
+
512
+ (_ref = []).concat.apply(_ref, document.body.children).forEach(function (element) {
513
+ EventHandler__default['default'].on(element, 'mouseover', noop());
514
+ });
442
515
  }
443
516
 
444
517
  var complete = function complete() {
@@ -448,30 +521,34 @@
448
521
 
449
522
  var prevHoverState = _this._hoverState;
450
523
  _this._hoverState = null;
451
- $(_this.element).trigger(_this.constructor.Event.SHOWN);
524
+ EventHandler__default['default'].trigger(_this.element, _this.constructor.Event.SHOWN);
452
525
 
453
- if (prevHoverState === HoverState.OUT) {
526
+ if (prevHoverState === HOVER_STATE_OUT) {
454
527
  _this._leave(null, _this);
455
528
  }
456
529
  };
457
530
 
458
- if ($(this.tip).hasClass(ClassName.FADE)) {
459
- var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
460
- $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
531
+ if (this.tip.classList.contains(CLASS_NAME_FADE)) {
532
+ var transitionDuration = getTransitionDurationFromElement(this.tip);
533
+ EventHandler__default['default'].one(this.tip, TRANSITION_END, complete);
534
+ emulateTransitionEnd(this.tip, transitionDuration);
461
535
  } else {
462
536
  complete();
463
537
  }
464
538
  }
465
539
  };
466
540
 
467
- _proto.hide = function hide(callback) {
541
+ _proto.hide = function hide() {
468
542
  var _this2 = this;
469
543
 
544
+ if (!this._popper) {
545
+ return;
546
+ }
547
+
470
548
  var tip = this.getTipElement();
471
- var hideEvent = $.Event(this.constructor.Event.HIDE);
472
549
 
473
550
  var complete = function complete() {
474
- if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
551
+ if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
475
552
  tip.parentNode.removeChild(tip);
476
553
  }
477
554
 
@@ -479,37 +556,36 @@
479
556
 
480
557
  _this2.element.removeAttribute('aria-describedby');
481
558
 
482
- $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
483
-
484
- if (_this2._popper !== null) {
485
- _this2._popper.destroy();
486
- }
559
+ EventHandler__default['default'].trigger(_this2.element, _this2.constructor.Event.HIDDEN);
487
560
 
488
- if (callback) {
489
- callback();
490
- }
561
+ _this2._popper.destroy();
491
562
  };
492
563
 
493
- $(this.element).trigger(hideEvent);
564
+ var hideEvent = EventHandler__default['default'].trigger(this.element, this.constructor.Event.HIDE);
494
565
 
495
- if (hideEvent.isDefaultPrevented()) {
566
+ if (hideEvent.defaultPrevented) {
496
567
  return;
497
568
  }
498
569
 
499
- $(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra
570
+ tip.classList.remove(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
500
571
  // empty mouseover listeners we added for iOS support
501
572
 
502
573
  if ('ontouchstart' in document.documentElement) {
503
- $(document.body).children().off('mouseover', null, $.noop);
574
+ var _ref2;
575
+
576
+ (_ref2 = []).concat.apply(_ref2, document.body.children).forEach(function (element) {
577
+ return EventHandler__default['default'].off(element, 'mouseover', noop);
578
+ });
504
579
  }
505
580
 
506
- this._activeTrigger[Trigger.CLICK] = false;
507
- this._activeTrigger[Trigger.FOCUS] = false;
508
- this._activeTrigger[Trigger.HOVER] = false;
581
+ this._activeTrigger[TRIGGER_CLICK] = false;
582
+ this._activeTrigger[TRIGGER_FOCUS] = false;
583
+ this._activeTrigger[TRIGGER_HOVER] = false;
509
584
 
510
- if ($(this.tip).hasClass(ClassName.FADE)) {
511
- var transitionDuration = Util.getTransitionDurationFromElement(tip);
512
- $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
585
+ if (this.tip.classList.contains(CLASS_NAME_FADE)) {
586
+ var transitionDuration = getTransitionDurationFromElement(tip);
587
+ EventHandler__default['default'].one(tip, TRANSITION_END, complete);
588
+ emulateTransitionEnd(tip, transitionDuration);
513
589
  } else {
514
590
  complete();
515
591
  }
@@ -528,30 +604,41 @@
528
604
  return Boolean(this.getTitle());
529
605
  };
530
606
 
531
- _proto.addAttachmentClass = function addAttachmentClass(attachment) {
532
- $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
533
- };
534
-
535
607
  _proto.getTipElement = function getTipElement() {
536
- this.tip = this.tip || $(this.config.template)[0];
608
+ if (this.tip) {
609
+ return this.tip;
610
+ }
611
+
612
+ var element = document.createElement('div');
613
+ element.innerHTML = this.config.template;
614
+ this.tip = element.children[0];
537
615
  return this.tip;
538
616
  };
539
617
 
540
618
  _proto.setContent = function setContent() {
541
619
  var tip = this.getTipElement();
542
- this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle());
543
- $(tip).removeClass(ClassName.FADE + " " + ClassName.SHOW);
620
+ this.setElementContent(SelectorEngine__default['default'].findOne(SELECTOR_TOOLTIP_INNER, tip), this.getTitle());
621
+ tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
544
622
  };
545
623
 
546
- _proto.setElementContent = function setElementContent($element, content) {
547
- if (typeof content === 'object' && (content.nodeType || content.jquery)) {
548
- // Content is a DOM node or a jQuery
624
+ _proto.setElementContent = function setElementContent(element, content) {
625
+ if (element === null) {
626
+ return;
627
+ }
628
+
629
+ if (typeof content === 'object' && isElement(content)) {
630
+ if (content.jquery) {
631
+ content = content[0];
632
+ } // content is a DOM node or a jQuery
633
+
634
+
549
635
  if (this.config.html) {
550
- if (!$(content).parent().is($element)) {
551
- $element.empty().append(content);
636
+ if (content.parentNode !== element) {
637
+ element.innerHTML = '';
638
+ element.appendChild(content);
552
639
  }
553
640
  } else {
554
- $element.text($(content).text());
641
+ element.textContent = content.textContent;
555
642
  }
556
643
 
557
644
  return;
@@ -559,12 +646,12 @@
559
646
 
560
647
  if (this.config.html) {
561
648
  if (this.config.sanitize) {
562
- content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
649
+ content = sanitizeHtml(content, this.config.allowList, this.config.sanitizeFn);
563
650
  }
564
651
 
565
- $element.html(content);
652
+ element.innerHTML = content;
566
653
  } else {
567
- $element.text(content);
654
+ element.textContent = content;
568
655
  }
569
656
  };
570
657
 
@@ -590,7 +677,7 @@
590
677
  behavior: this.config.fallbackPlacement
591
678
  },
592
679
  arrow: {
593
- element: Selector.ARROW
680
+ element: "." + this.constructor.NAME + "-arrow"
594
681
  },
595
682
  preventOverflow: {
596
683
  boundariesElement: this.config.boundary
@@ -605,7 +692,11 @@
605
692
  return _this3._handlePopperPlacementChange(data);
606
693
  }
607
694
  };
608
- return _objectSpread2({}, defaultBsConfig, {}, this.config.popperConfig);
695
+ return _extends({}, defaultBsConfig, this.config.popperConfig);
696
+ };
697
+
698
+ _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
699
+ this.getTipElement().classList.add(CLASS_PREFIX + "-" + attachment);
609
700
  };
610
701
 
611
702
  _proto._getOffset = function _getOffset() {
@@ -615,7 +706,7 @@
615
706
 
616
707
  if (typeof this.config.offset === 'function') {
617
708
  offset.fn = function (data) {
618
- data.offsets = _objectSpread2({}, data.offsets, {}, _this4.config.offset(data.offsets, _this4.element) || {});
709
+ data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});
619
710
  return data;
620
711
  };
621
712
  } else {
@@ -630,11 +721,11 @@
630
721
  return document.body;
631
722
  }
632
723
 
633
- if (Util.isElement(this.config.container)) {
634
- return $(this.config.container);
724
+ if (isElement(this.config.container)) {
725
+ return this.config.container;
635
726
  }
636
727
 
637
- return $(document).find(this.config.container);
728
+ return SelectorEngine__default['default'].findOne(this.config.container);
638
729
  };
639
730
 
640
731
  _proto._getAttachment = function _getAttachment(placement) {
@@ -647,15 +738,16 @@
647
738
  var triggers = this.config.trigger.split(' ');
648
739
  triggers.forEach(function (trigger) {
649
740
  if (trigger === 'click') {
650
- $(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
741
+ EventHandler__default['default'].on(_this5.element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
651
742
  return _this5.toggle(event);
652
743
  });
653
- } else if (trigger !== Trigger.MANUAL) {
654
- var eventIn = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
655
- var eventOut = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
656
- $(_this5.element).on(eventIn, _this5.config.selector, function (event) {
744
+ } else if (trigger !== TRIGGER_MANUAL) {
745
+ var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
746
+ var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
747
+ EventHandler__default['default'].on(_this5.element, eventIn, _this5.config.selector, function (event) {
657
748
  return _this5._enter(event);
658
- }).on(eventOut, _this5.config.selector, function (event) {
749
+ });
750
+ EventHandler__default['default'].on(_this5.element, eventOut, _this5.config.selector, function (event) {
659
751
  return _this5._leave(event);
660
752
  });
661
753
  }
@@ -667,10 +759,10 @@
667
759
  }
668
760
  };
669
761
 
670
- $(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
762
+ EventHandler__default['default'].on(this.element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
671
763
 
672
764
  if (this.config.selector) {
673
- this.config = _objectSpread2({}, this.config, {
765
+ this.config = _extends({}, this.config, {
674
766
  trigger: 'manual',
675
767
  selector: ''
676
768
  });
@@ -690,24 +782,24 @@
690
782
 
691
783
  _proto._enter = function _enter(event, context) {
692
784
  var dataKey = this.constructor.DATA_KEY;
693
- context = context || $(event.currentTarget).data(dataKey);
785
+ context = context || Data__default['default'].getData(event.delegateTarget, dataKey);
694
786
 
695
787
  if (!context) {
696
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
697
- $(event.currentTarget).data(dataKey, context);
788
+ context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
789
+ Data__default['default'].setData(event.delegateTarget, dataKey, context);
698
790
  }
699
791
 
700
792
  if (event) {
701
- context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
793
+ context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
702
794
  }
703
795
 
704
- if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
705
- context._hoverState = HoverState.SHOW;
796
+ if (context.getTipElement().classList.contains(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
797
+ context._hoverState = HOVER_STATE_SHOW;
706
798
  return;
707
799
  }
708
800
 
709
801
  clearTimeout(context._timeout);
710
- context._hoverState = HoverState.SHOW;
802
+ context._hoverState = HOVER_STATE_SHOW;
711
803
 
712
804
  if (!context.config.delay || !context.config.delay.show) {
713
805
  context.show();
@@ -715,7 +807,7 @@
715
807
  }
716
808
 
717
809
  context._timeout = setTimeout(function () {
718
- if (context._hoverState === HoverState.SHOW) {
810
+ if (context._hoverState === HOVER_STATE_SHOW) {
719
811
  context.show();
720
812
  }
721
813
  }, context.config.delay.show);
@@ -723,15 +815,15 @@
723
815
 
724
816
  _proto._leave = function _leave(event, context) {
725
817
  var dataKey = this.constructor.DATA_KEY;
726
- context = context || $(event.currentTarget).data(dataKey);
818
+ context = context || Data__default['default'].getData(event.delegateTarget, dataKey);
727
819
 
728
820
  if (!context) {
729
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
730
- $(event.currentTarget).data(dataKey, context);
821
+ context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
822
+ Data__default['default'].setData(event.delegateTarget, dataKey, context);
731
823
  }
732
824
 
733
825
  if (event) {
734
- context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
826
+ context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
735
827
  }
736
828
 
737
829
  if (context._isWithActiveTrigger()) {
@@ -739,7 +831,7 @@
739
831
  }
740
832
 
741
833
  clearTimeout(context._timeout);
742
- context._hoverState = HoverState.OUT;
834
+ context._hoverState = HOVER_STATE_OUT;
743
835
 
744
836
  if (!context.config.delay || !context.config.delay.hide) {
745
837
  context.hide();
@@ -747,7 +839,7 @@
747
839
  }
748
840
 
749
841
  context._timeout = setTimeout(function () {
750
- if (context._hoverState === HoverState.OUT) {
842
+ if (context._hoverState === HOVER_STATE_OUT) {
751
843
  context.hide();
752
844
  }
753
845
  }, context.config.delay.hide);
@@ -764,13 +856,18 @@
764
856
  };
765
857
 
766
858
  _proto._getConfig = function _getConfig(config) {
767
- var dataAttributes = $(this.element).data();
859
+ var dataAttributes = Manipulator__default['default'].getDataAttributes(this.element);
768
860
  Object.keys(dataAttributes).forEach(function (dataAttr) {
769
861
  if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
770
862
  delete dataAttributes[dataAttr];
771
863
  }
772
864
  });
773
- config = _objectSpread2({}, this.constructor.Default, {}, dataAttributes, {}, typeof config === 'object' && config ? config : {});
865
+
866
+ if (config && typeof config.container === 'object' && config.container.jquery) {
867
+ config.container = config.container[0];
868
+ }
869
+
870
+ config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
774
871
 
775
872
  if (typeof config.delay === 'number') {
776
873
  config.delay = {
@@ -787,10 +884,10 @@
787
884
  config.content = config.content.toString();
788
885
  }
789
886
 
790
- Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
887
+ typeCheckConfig(NAME, config, this.constructor.DefaultType);
791
888
 
792
889
  if (config.sanitize) {
793
- config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
890
+ config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn);
794
891
  }
795
892
 
796
893
  return config;
@@ -811,21 +908,24 @@
811
908
  };
812
909
 
813
910
  _proto._cleanTipClass = function _cleanTipClass() {
814
- var $tip = $(this.getTipElement());
815
- var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
911
+ var tip = this.getTipElement();
912
+ var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
816
913
 
817
- if (tabClass !== null && tabClass.length) {
818
- $tip.removeClass(tabClass.join(''));
914
+ if (tabClass !== null && tabClass.length > 0) {
915
+ tabClass.map(function (token) {
916
+ return token.trim();
917
+ }).forEach(function (tClass) {
918
+ return tip.classList.remove(tClass);
919
+ });
819
920
  }
820
921
  };
821
922
 
822
923
  _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
823
- var popperInstance = popperData.instance;
824
- this.tip = popperInstance.popper;
924
+ this.tip = popperData.instance.popper;
825
925
 
826
926
  this._cleanTipClass();
827
927
 
828
- this.addAttachmentClass(this._getAttachment(popperData.placement));
928
+ this._addAttachmentClass(this._getAttachment(popperData.placement));
829
929
  };
830
930
 
831
931
  _proto._fixTransition = function _fixTransition() {
@@ -836,7 +936,7 @@
836
936
  return;
837
937
  }
838
938
 
839
- $(tip).removeClass(ClassName.FADE);
939
+ tip.classList.remove(CLASS_NAME_FADE);
840
940
  this.config.animation = false;
841
941
  this.hide();
842
942
  this.show();
@@ -844,9 +944,9 @@
844
944
  } // Static
845
945
  ;
846
946
 
847
- Tooltip._jQueryInterface = function _jQueryInterface(config) {
947
+ Tooltip.jQueryInterface = function jQueryInterface(config) {
848
948
  return this.each(function () {
849
- var data = $(this).data(DATA_KEY);
949
+ var data = Data__default['default'].getData(this, DATA_KEY);
850
950
 
851
951
  var _config = typeof config === 'object' && config;
852
952
 
@@ -856,7 +956,6 @@
856
956
 
857
957
  if (!data) {
858
958
  data = new Tooltip(this, _config);
859
- $(this).data(DATA_KEY, data);
860
959
  }
861
960
 
862
961
  if (typeof config === 'string') {
@@ -869,6 +968,10 @@
869
968
  });
870
969
  };
871
970
 
971
+ Tooltip.getInstance = function getInstance(element) {
972
+ return Data__default['default'].getData(element, DATA_KEY);
973
+ };
974
+
872
975
  _createClass(Tooltip, null, [{
873
976
  key: "VERSION",
874
977
  get: function get() {
@@ -892,7 +995,7 @@
892
995
  }, {
893
996
  key: "Event",
894
997
  get: function get() {
895
- return Event;
998
+ return Event$1;
896
999
  }
897
1000
  }, {
898
1001
  key: "EVENT_KEY",
@@ -908,20 +1011,27 @@
908
1011
 
909
1012
  return Tooltip;
910
1013
  }();
1014
+
1015
+ var $ = getjQuery();
911
1016
  /**
912
1017
  * ------------------------------------------------------------------------
913
1018
  * jQuery
914
1019
  * ------------------------------------------------------------------------
1020
+ * add .tooltip to jQuery only if jQuery is present
915
1021
  */
916
1022
 
1023
+ /* istanbul ignore if */
917
1024
 
918
- $.fn[NAME] = Tooltip._jQueryInterface;
919
- $.fn[NAME].Constructor = Tooltip;
1025
+ if ($) {
1026
+ var JQUERY_NO_CONFLICT = $.fn[NAME];
1027
+ $.fn[NAME] = Tooltip.jQueryInterface;
1028
+ $.fn[NAME].Constructor = Tooltip;
920
1029
 
921
- $.fn[NAME].noConflict = function () {
922
- $.fn[NAME] = JQUERY_NO_CONFLICT;
923
- return Tooltip._jQueryInterface;
924
- };
1030
+ $.fn[NAME].noConflict = function () {
1031
+ $.fn[NAME] = JQUERY_NO_CONFLICT;
1032
+ return Tooltip.jQueryInterface;
1033
+ };
1034
+ }
925
1035
 
926
1036
  return Tooltip;
927
1037