bootstrap 4.3.0 → 5.0.0.alpha1

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