nex-bootstrap 4.6.3

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 (163) hide show
  1. checksums.yaml +7 -0
  2. data/.gitattributes +14 -0
  3. data/.gitignore +19 -0
  4. data/.travis.yml +31 -0
  5. data/CHANGELOG.md +25 -0
  6. data/Gemfile +11 -0
  7. data/LICENSE +21 -0
  8. data/README.md +109 -0
  9. data/Rakefile +63 -0
  10. data/assets/javascripts/bootstrap/alert.js +183 -0
  11. data/assets/javascripts/bootstrap/button.js +225 -0
  12. data/assets/javascripts/bootstrap/carousel.js +640 -0
  13. data/assets/javascripts/bootstrap/collapse.js +394 -0
  14. data/assets/javascripts/bootstrap/dropdown.js +557 -0
  15. data/assets/javascripts/bootstrap/modal.js +660 -0
  16. data/assets/javascripts/bootstrap/popover.js +243 -0
  17. data/assets/javascripts/bootstrap/scrollspy.js +337 -0
  18. data/assets/javascripts/bootstrap/tab.js +259 -0
  19. data/assets/javascripts/bootstrap/toast.js +265 -0
  20. data/assets/javascripts/bootstrap/tooltip.js +886 -0
  21. data/assets/javascripts/bootstrap/util.js +189 -0
  22. data/assets/javascripts/bootstrap-sprockets.js +12 -0
  23. data/assets/javascripts/bootstrap.js +4356 -0
  24. data/assets/javascripts/bootstrap.min.js +6 -0
  25. data/assets/stylesheets/_bootstrap-grid.scss +30 -0
  26. data/assets/stylesheets/_bootstrap-reboot.scss +12 -0
  27. data/assets/stylesheets/_bootstrap.scss +44 -0
  28. data/assets/stylesheets/bootstrap/_alert.scss +52 -0
  29. data/assets/stylesheets/bootstrap/_badge.scss +54 -0
  30. data/assets/stylesheets/bootstrap/_breadcrumb.scss +42 -0
  31. data/assets/stylesheets/bootstrap/_button-group.scss +163 -0
  32. data/assets/stylesheets/bootstrap/_buttons.scss +142 -0
  33. data/assets/stylesheets/bootstrap/_card.scss +286 -0
  34. data/assets/stylesheets/bootstrap/_carousel.scss +200 -0
  35. data/assets/stylesheets/bootstrap/_close.scss +40 -0
  36. data/assets/stylesheets/bootstrap/_code.scss +48 -0
  37. data/assets/stylesheets/bootstrap/_custom-forms.scss +526 -0
  38. data/assets/stylesheets/bootstrap/_dropdown.scss +192 -0
  39. data/assets/stylesheets/bootstrap/_forms.scss +347 -0
  40. data/assets/stylesheets/bootstrap/_functions.scss +190 -0
  41. data/assets/stylesheets/bootstrap/_grid.scss +73 -0
  42. data/assets/stylesheets/bootstrap/_images.scss +42 -0
  43. data/assets/stylesheets/bootstrap/_input-group.scss +211 -0
  44. data/assets/stylesheets/bootstrap/_jumbotron.scss +17 -0
  45. data/assets/stylesheets/bootstrap/_list-group.scss +154 -0
  46. data/assets/stylesheets/bootstrap/_media.scss +8 -0
  47. data/assets/stylesheets/bootstrap/_mixins.scss +47 -0
  48. data/assets/stylesheets/bootstrap/_modal.scss +240 -0
  49. data/assets/stylesheets/bootstrap/_nav.scss +125 -0
  50. data/assets/stylesheets/bootstrap/_navbar.scss +332 -0
  51. data/assets/stylesheets/bootstrap/_pagination.scss +74 -0
  52. data/assets/stylesheets/bootstrap/_popover.scss +170 -0
  53. data/assets/stylesheets/bootstrap/_print.scss +132 -0
  54. data/assets/stylesheets/bootstrap/_progress.scss +47 -0
  55. data/assets/stylesheets/bootstrap/_reboot.scss +484 -0
  56. data/assets/stylesheets/bootstrap/_root.scss +19 -0
  57. data/assets/stylesheets/bootstrap/_spinners.scss +65 -0
  58. data/assets/stylesheets/bootstrap/_tables.scss +185 -0
  59. data/assets/stylesheets/bootstrap/_toasts.scss +46 -0
  60. data/assets/stylesheets/bootstrap/_tooltip.scss +115 -0
  61. data/assets/stylesheets/bootstrap/_transitions.scss +26 -0
  62. data/assets/stylesheets/bootstrap/_type.scss +125 -0
  63. data/assets/stylesheets/bootstrap/_utilities.scss +18 -0
  64. data/assets/stylesheets/bootstrap/_variables.scss +1149 -0
  65. data/assets/stylesheets/bootstrap/mixins/_alert.scss +13 -0
  66. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +23 -0
  67. data/assets/stylesheets/bootstrap/mixins/_badge.scss +17 -0
  68. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +76 -0
  69. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +20 -0
  70. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +123 -0
  71. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +110 -0
  72. data/assets/stylesheets/bootstrap/mixins/_caret.scss +62 -0
  73. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +7 -0
  74. data/assets/stylesheets/bootstrap/mixins/_deprecate.scss +10 -0
  75. data/assets/stylesheets/bootstrap/mixins/_float.scss +14 -0
  76. data/assets/stylesheets/bootstrap/mixins/_forms.scss +195 -0
  77. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +45 -0
  78. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +80 -0
  79. data/assets/stylesheets/bootstrap/mixins/_grid.scss +69 -0
  80. data/assets/stylesheets/bootstrap/mixins/_hover.scss +37 -0
  81. data/assets/stylesheets/bootstrap/mixins/_image.scss +36 -0
  82. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +21 -0
  83. data/assets/stylesheets/bootstrap/mixins/_lists.scss +7 -0
  84. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +11 -0
  85. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +22 -0
  86. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +17 -0
  87. data/assets/stylesheets/bootstrap/mixins/_resize.scss +6 -0
  88. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +34 -0
  89. data/assets/stylesheets/bootstrap/mixins/_size.scss +7 -0
  90. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +39 -0
  91. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +17 -0
  92. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +11 -0
  93. data/assets/stylesheets/bootstrap/mixins/_text-truncate.scss +8 -0
  94. data/assets/stylesheets/bootstrap/mixins/_transition.scss +26 -0
  95. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +8 -0
  96. data/assets/stylesheets/bootstrap/utilities/_align.scss +8 -0
  97. data/assets/stylesheets/bootstrap/utilities/_background.scss +19 -0
  98. data/assets/stylesheets/bootstrap/utilities/_borders.scss +75 -0
  99. data/assets/stylesheets/bootstrap/utilities/_clearfix.scss +3 -0
  100. data/assets/stylesheets/bootstrap/utilities/_display.scss +26 -0
  101. data/assets/stylesheets/bootstrap/utilities/_embed.scss +39 -0
  102. data/assets/stylesheets/bootstrap/utilities/_flex.scss +51 -0
  103. data/assets/stylesheets/bootstrap/utilities/_float.scss +11 -0
  104. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +5 -0
  105. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +5 -0
  106. data/assets/stylesheets/bootstrap/utilities/_position.scss +32 -0
  107. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +11 -0
  108. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +6 -0
  109. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +20 -0
  110. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +73 -0
  111. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +19 -0
  112. data/assets/stylesheets/bootstrap/utilities/_text.scss +72 -0
  113. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +13 -0
  114. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +228 -0
  115. data/bootstrap.gemspec +38 -0
  116. data/lib/bootstrap/engine.rb +15 -0
  117. data/lib/bootstrap/version.rb +6 -0
  118. data/lib/bootstrap.rb +75 -0
  119. data/tasks/updater/js.rb +68 -0
  120. data/tasks/updater/logger.rb +57 -0
  121. data/tasks/updater/network.rb +103 -0
  122. data/tasks/updater/scss.rb +26 -0
  123. data/tasks/updater.rb +67 -0
  124. data/test/dummy_rails/README.rdoc +3 -0
  125. data/test/dummy_rails/Rakefile +6 -0
  126. data/test/dummy_rails/app/assets/config/manifest.js +3 -0
  127. data/test/dummy_rails/app/assets/images/.keep +0 -0
  128. data/test/dummy_rails/app/assets/javascripts/application.js +7 -0
  129. data/test/dummy_rails/app/assets/stylesheets/.browserslistrc +1 -0
  130. data/test/dummy_rails/app/assets/stylesheets/application.sass +4 -0
  131. data/test/dummy_rails/app/controllers/application_controller.rb +5 -0
  132. data/test/dummy_rails/app/controllers/pages_controller.rb +4 -0
  133. data/test/dummy_rails/app/helpers/application_helper.rb +2 -0
  134. data/test/dummy_rails/app/views/layouts/application.html.erb +14 -0
  135. data/test/dummy_rails/app/views/pages/root.html.slim +58 -0
  136. data/test/dummy_rails/config/application.rb +35 -0
  137. data/test/dummy_rails/config/boot.rb +5 -0
  138. data/test/dummy_rails/config/environment.rb +5 -0
  139. data/test/dummy_rails/config/environments/development.rb +23 -0
  140. data/test/dummy_rails/config/environments/production.rb +82 -0
  141. data/test/dummy_rails/config/environments/test.rb +38 -0
  142. data/test/dummy_rails/config/initializers/backtrace_silencers.rb +7 -0
  143. data/test/dummy_rails/config/initializers/filter_parameter_logging.rb +4 -0
  144. data/test/dummy_rails/config/initializers/inflections.rb +16 -0
  145. data/test/dummy_rails/config/initializers/mime_types.rb +5 -0
  146. data/test/dummy_rails/config/initializers/secret_token.rb +18 -0
  147. data/test/dummy_rails/config/initializers/session_store.rb +3 -0
  148. data/test/dummy_rails/config/initializers/wrap_parameters.rb +14 -0
  149. data/test/dummy_rails/config/locales/en.yml +3 -0
  150. data/test/dummy_rails/config/locales/es.yml +3 -0
  151. data/test/dummy_rails/config/routes.rb +3 -0
  152. data/test/dummy_rails/config.ru +4 -0
  153. data/test/dummy_rails/log/.keep +0 -0
  154. data/test/gemfiles/rails_4_2.gemfile +7 -0
  155. data/test/gemfiles/rails_5_0.gemfile +8 -0
  156. data/test/gemfiles/rails_5_1.gemfile +8 -0
  157. data/test/gemfiles/rails_6_0.gemfile +7 -0
  158. data/test/rails_test.rb +24 -0
  159. data/test/support/dummy_rails_integration.rb +31 -0
  160. data/test/support/reporting.rb +27 -0
  161. data/test/test_helper.rb +41 -0
  162. data/test/test_helper_rails.rb +6 -0
  163. metadata +445 -0
@@ -0,0 +1,886 @@
1
+ /*!
2
+ * Bootstrap tooltip.js v4.6.1 (https://getbootstrap.com/)
3
+ * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
+ */
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'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util));
10
+ })(this, (function ($, Popper, Util) { 'use strict';
11
+
12
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
+
14
+ var $__default = /*#__PURE__*/_interopDefaultLegacy($);
15
+ var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
16
+ var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
17
+
18
+ function _defineProperties(target, props) {
19
+ for (var i = 0; i < props.length; i++) {
20
+ var descriptor = props[i];
21
+ descriptor.enumerable = descriptor.enumerable || false;
22
+ descriptor.configurable = true;
23
+ if ("value" in descriptor) descriptor.writable = true;
24
+ Object.defineProperty(target, descriptor.key, descriptor);
25
+ }
26
+ }
27
+
28
+ function _createClass(Constructor, protoProps, staticProps) {
29
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
30
+ if (staticProps) _defineProperties(Constructor, staticProps);
31
+ return Constructor;
32
+ }
33
+
34
+ function _extends() {
35
+ _extends = Object.assign || function (target) {
36
+ for (var i = 1; i < arguments.length; i++) {
37
+ var source = arguments[i];
38
+
39
+ for (var key in source) {
40
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
41
+ target[key] = source[key];
42
+ }
43
+ }
44
+ }
45
+
46
+ return target;
47
+ };
48
+
49
+ return _extends.apply(this, arguments);
50
+ }
51
+
52
+ /**
53
+ * --------------------------------------------------------------------------
54
+ * Bootstrap (v4.6.1): tools/sanitizer.js
55
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
56
+ * --------------------------------------------------------------------------
57
+ */
58
+ var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
59
+ var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
60
+ var DefaultWhitelist = {
61
+ // Global attributes allowed on any supplied element below.
62
+ '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
63
+ a: ['target', 'href', 'title', 'rel'],
64
+ area: [],
65
+ b: [],
66
+ br: [],
67
+ col: [],
68
+ code: [],
69
+ div: [],
70
+ em: [],
71
+ hr: [],
72
+ h1: [],
73
+ h2: [],
74
+ h3: [],
75
+ h4: [],
76
+ h5: [],
77
+ h6: [],
78
+ i: [],
79
+ img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
80
+ li: [],
81
+ ol: [],
82
+ p: [],
83
+ pre: [],
84
+ s: [],
85
+ small: [],
86
+ span: [],
87
+ sub: [],
88
+ sup: [],
89
+ strong: [],
90
+ u: [],
91
+ ul: []
92
+ };
93
+ /**
94
+ * A pattern that recognizes a commonly useful subset of URLs that are safe.
95
+ *
96
+ * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
97
+ */
98
+
99
+ var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
100
+ /**
101
+ * A pattern that matches safe data URLs. Only matches image, video and audio types.
102
+ *
103
+ * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
104
+ */
105
+
106
+ 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;
107
+
108
+ function allowedAttribute(attr, allowedAttributeList) {
109
+ var attrName = attr.nodeName.toLowerCase();
110
+
111
+ if (allowedAttributeList.indexOf(attrName) !== -1) {
112
+ if (uriAttrs.indexOf(attrName) !== -1) {
113
+ return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));
114
+ }
115
+
116
+ return true;
117
+ }
118
+
119
+ var regExp = allowedAttributeList.filter(function (attrRegex) {
120
+ return attrRegex instanceof RegExp;
121
+ }); // Check if a regular expression validates the attribute.
122
+
123
+ for (var i = 0, len = regExp.length; i < len; i++) {
124
+ if (regExp[i].test(attrName)) {
125
+ return true;
126
+ }
127
+ }
128
+
129
+ return false;
130
+ }
131
+
132
+ function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
133
+ if (unsafeHtml.length === 0) {
134
+ return unsafeHtml;
135
+ }
136
+
137
+ if (sanitizeFn && typeof sanitizeFn === 'function') {
138
+ return sanitizeFn(unsafeHtml);
139
+ }
140
+
141
+ var domParser = new window.DOMParser();
142
+ var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
143
+ var whitelistKeys = Object.keys(whiteList);
144
+ var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
145
+
146
+ var _loop = function _loop(i, len) {
147
+ var el = elements[i];
148
+ var elName = el.nodeName.toLowerCase();
149
+
150
+ if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
151
+ el.parentNode.removeChild(el);
152
+ return "continue";
153
+ }
154
+
155
+ var attributeList = [].slice.call(el.attributes); // eslint-disable-next-line unicorn/prefer-spread
156
+
157
+ var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
158
+ attributeList.forEach(function (attr) {
159
+ if (!allowedAttribute(attr, whitelistedAttributes)) {
160
+ el.removeAttribute(attr.nodeName);
161
+ }
162
+ });
163
+ };
164
+
165
+ for (var i = 0, len = elements.length; i < len; i++) {
166
+ var _ret = _loop(i);
167
+
168
+ if (_ret === "continue") continue;
169
+ }
170
+
171
+ return createdDocument.body.innerHTML;
172
+ }
173
+
174
+ /**
175
+ * Constants
176
+ */
177
+
178
+ var NAME = 'tooltip';
179
+ var VERSION = '4.6.1';
180
+ var DATA_KEY = 'bs.tooltip';
181
+ var EVENT_KEY = "." + DATA_KEY;
182
+ var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];
183
+ var CLASS_PREFIX = 'bs-tooltip';
184
+ var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
185
+ var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
186
+ var CLASS_NAME_FADE = 'fade';
187
+ var CLASS_NAME_SHOW = 'show';
188
+ var HOVER_STATE_SHOW = 'show';
189
+ var HOVER_STATE_OUT = 'out';
190
+ var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
191
+ var SELECTOR_ARROW = '.arrow';
192
+ var TRIGGER_HOVER = 'hover';
193
+ var TRIGGER_FOCUS = 'focus';
194
+ var TRIGGER_CLICK = 'click';
195
+ var TRIGGER_MANUAL = 'manual';
196
+ var AttachmentMap = {
197
+ AUTO: 'auto',
198
+ TOP: 'top',
199
+ RIGHT: 'right',
200
+ BOTTOM: 'bottom',
201
+ LEFT: 'left'
202
+ };
203
+ var Default = {
204
+ animation: true,
205
+ template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
206
+ trigger: 'hover focus',
207
+ title: '',
208
+ delay: 0,
209
+ html: false,
210
+ selector: false,
211
+ placement: 'top',
212
+ offset: 0,
213
+ container: false,
214
+ fallbackPlacement: 'flip',
215
+ boundary: 'scrollParent',
216
+ customClass: '',
217
+ sanitize: true,
218
+ sanitizeFn: null,
219
+ whiteList: DefaultWhitelist,
220
+ popperConfig: null
221
+ };
222
+ var DefaultType = {
223
+ animation: 'boolean',
224
+ template: 'string',
225
+ title: '(string|element|function)',
226
+ trigger: 'string',
227
+ delay: '(number|object)',
228
+ html: 'boolean',
229
+ selector: '(string|boolean)',
230
+ placement: '(string|function)',
231
+ offset: '(number|string|function)',
232
+ container: '(string|element|boolean)',
233
+ fallbackPlacement: '(string|array)',
234
+ boundary: '(string|element)',
235
+ customClass: '(string|function)',
236
+ sanitize: 'boolean',
237
+ sanitizeFn: '(null|function)',
238
+ whiteList: 'object',
239
+ popperConfig: '(null|object)'
240
+ };
241
+ var Event = {
242
+ HIDE: "hide" + EVENT_KEY,
243
+ HIDDEN: "hidden" + EVENT_KEY,
244
+ SHOW: "show" + EVENT_KEY,
245
+ SHOWN: "shown" + EVENT_KEY,
246
+ INSERTED: "inserted" + EVENT_KEY,
247
+ CLICK: "click" + EVENT_KEY,
248
+ FOCUSIN: "focusin" + EVENT_KEY,
249
+ FOCUSOUT: "focusout" + EVENT_KEY,
250
+ MOUSEENTER: "mouseenter" + EVENT_KEY,
251
+ MOUSELEAVE: "mouseleave" + EVENT_KEY
252
+ };
253
+ /**
254
+ * Class definition
255
+ */
256
+
257
+ var Tooltip = /*#__PURE__*/function () {
258
+ function Tooltip(element, config) {
259
+ if (typeof Popper__default["default"] === 'undefined') {
260
+ throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
261
+ } // Private
262
+
263
+
264
+ this._isEnabled = true;
265
+ this._timeout = 0;
266
+ this._hoverState = '';
267
+ this._activeTrigger = {};
268
+ this._popper = null; // Protected
269
+
270
+ this.element = element;
271
+ this.config = this._getConfig(config);
272
+ this.tip = null;
273
+
274
+ this._setListeners();
275
+ } // Getters
276
+
277
+
278
+ var _proto = Tooltip.prototype;
279
+
280
+ // Public
281
+ _proto.enable = function enable() {
282
+ this._isEnabled = true;
283
+ };
284
+
285
+ _proto.disable = function disable() {
286
+ this._isEnabled = false;
287
+ };
288
+
289
+ _proto.toggleEnabled = function toggleEnabled() {
290
+ this._isEnabled = !this._isEnabled;
291
+ };
292
+
293
+ _proto.toggle = function toggle(event) {
294
+ if (!this._isEnabled) {
295
+ return;
296
+ }
297
+
298
+ if (event) {
299
+ var dataKey = this.constructor.DATA_KEY;
300
+ var context = $__default["default"](event.currentTarget).data(dataKey);
301
+
302
+ if (!context) {
303
+ context = new this.constructor(event.currentTarget, this._getDelegateConfig());
304
+ $__default["default"](event.currentTarget).data(dataKey, context);
305
+ }
306
+
307
+ context._activeTrigger.click = !context._activeTrigger.click;
308
+
309
+ if (context._isWithActiveTrigger()) {
310
+ context._enter(null, context);
311
+ } else {
312
+ context._leave(null, context);
313
+ }
314
+ } else {
315
+ if ($__default["default"](this.getTipElement()).hasClass(CLASS_NAME_SHOW)) {
316
+ this._leave(null, this);
317
+
318
+ return;
319
+ }
320
+
321
+ this._enter(null, this);
322
+ }
323
+ };
324
+
325
+ _proto.dispose = function dispose() {
326
+ clearTimeout(this._timeout);
327
+ $__default["default"].removeData(this.element, this.constructor.DATA_KEY);
328
+ $__default["default"](this.element).off(this.constructor.EVENT_KEY);
329
+ $__default["default"](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
330
+
331
+ if (this.tip) {
332
+ $__default["default"](this.tip).remove();
333
+ }
334
+
335
+ this._isEnabled = null;
336
+ this._timeout = null;
337
+ this._hoverState = null;
338
+ this._activeTrigger = null;
339
+
340
+ if (this._popper) {
341
+ this._popper.destroy();
342
+ }
343
+
344
+ this._popper = null;
345
+ this.element = null;
346
+ this.config = null;
347
+ this.tip = null;
348
+ };
349
+
350
+ _proto.show = function show() {
351
+ var _this = this;
352
+
353
+ if ($__default["default"](this.element).css('display') === 'none') {
354
+ throw new Error('Please use show on visible elements');
355
+ }
356
+
357
+ var showEvent = $__default["default"].Event(this.constructor.Event.SHOW);
358
+
359
+ if (this.isWithContent() && this._isEnabled) {
360
+ $__default["default"](this.element).trigger(showEvent);
361
+ var shadowRoot = Util__default["default"].findShadowRoot(this.element);
362
+ var isInTheDom = $__default["default"].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
363
+
364
+ if (showEvent.isDefaultPrevented() || !isInTheDom) {
365
+ return;
366
+ }
367
+
368
+ var tip = this.getTipElement();
369
+ var tipId = Util__default["default"].getUID(this.constructor.NAME);
370
+ tip.setAttribute('id', tipId);
371
+ this.element.setAttribute('aria-describedby', tipId);
372
+ this.setContent();
373
+
374
+ if (this.config.animation) {
375
+ $__default["default"](tip).addClass(CLASS_NAME_FADE);
376
+ }
377
+
378
+ var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
379
+
380
+ var attachment = this._getAttachment(placement);
381
+
382
+ this.addAttachmentClass(attachment);
383
+
384
+ var container = this._getContainer();
385
+
386
+ $__default["default"](tip).data(this.constructor.DATA_KEY, this);
387
+
388
+ if (!$__default["default"].contains(this.element.ownerDocument.documentElement, this.tip)) {
389
+ $__default["default"](tip).appendTo(container);
390
+ }
391
+
392
+ $__default["default"](this.element).trigger(this.constructor.Event.INSERTED);
393
+ this._popper = new Popper__default["default"](this.element, tip, this._getPopperConfig(attachment));
394
+ $__default["default"](tip).addClass(CLASS_NAME_SHOW);
395
+ $__default["default"](tip).addClass(this.config.customClass); // If this is a touch-enabled device we add extra
396
+ // empty mouseover listeners to the body's immediate children;
397
+ // only needed because of broken event delegation on iOS
398
+ // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
399
+
400
+ if ('ontouchstart' in document.documentElement) {
401
+ $__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop);
402
+ }
403
+
404
+ var complete = function complete() {
405
+ if (_this.config.animation) {
406
+ _this._fixTransition();
407
+ }
408
+
409
+ var prevHoverState = _this._hoverState;
410
+ _this._hoverState = null;
411
+ $__default["default"](_this.element).trigger(_this.constructor.Event.SHOWN);
412
+
413
+ if (prevHoverState === HOVER_STATE_OUT) {
414
+ _this._leave(null, _this);
415
+ }
416
+ };
417
+
418
+ if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE)) {
419
+ var transitionDuration = Util__default["default"].getTransitionDurationFromElement(this.tip);
420
+ $__default["default"](this.tip).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
421
+ } else {
422
+ complete();
423
+ }
424
+ }
425
+ };
426
+
427
+ _proto.hide = function hide(callback) {
428
+ var _this2 = this;
429
+
430
+ var tip = this.getTipElement();
431
+ var hideEvent = $__default["default"].Event(this.constructor.Event.HIDE);
432
+
433
+ var complete = function complete() {
434
+ if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
435
+ tip.parentNode.removeChild(tip);
436
+ }
437
+
438
+ _this2._cleanTipClass();
439
+
440
+ _this2.element.removeAttribute('aria-describedby');
441
+
442
+ $__default["default"](_this2.element).trigger(_this2.constructor.Event.HIDDEN);
443
+
444
+ if (_this2._popper !== null) {
445
+ _this2._popper.destroy();
446
+ }
447
+
448
+ if (callback) {
449
+ callback();
450
+ }
451
+ };
452
+
453
+ $__default["default"](this.element).trigger(hideEvent);
454
+
455
+ if (hideEvent.isDefaultPrevented()) {
456
+ return;
457
+ }
458
+
459
+ $__default["default"](tip).removeClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
460
+ // empty mouseover listeners we added for iOS support
461
+
462
+ if ('ontouchstart' in document.documentElement) {
463
+ $__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop);
464
+ }
465
+
466
+ this._activeTrigger[TRIGGER_CLICK] = false;
467
+ this._activeTrigger[TRIGGER_FOCUS] = false;
468
+ this._activeTrigger[TRIGGER_HOVER] = false;
469
+
470
+ if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE)) {
471
+ var transitionDuration = Util__default["default"].getTransitionDurationFromElement(tip);
472
+ $__default["default"](tip).one(Util__default["default"].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
473
+ } else {
474
+ complete();
475
+ }
476
+
477
+ this._hoverState = '';
478
+ };
479
+
480
+ _proto.update = function update() {
481
+ if (this._popper !== null) {
482
+ this._popper.scheduleUpdate();
483
+ }
484
+ } // Protected
485
+ ;
486
+
487
+ _proto.isWithContent = function isWithContent() {
488
+ return Boolean(this.getTitle());
489
+ };
490
+
491
+ _proto.addAttachmentClass = function addAttachmentClass(attachment) {
492
+ $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
493
+ };
494
+
495
+ _proto.getTipElement = function getTipElement() {
496
+ this.tip = this.tip || $__default["default"](this.config.template)[0];
497
+ return this.tip;
498
+ };
499
+
500
+ _proto.setContent = function setContent() {
501
+ var tip = this.getTipElement();
502
+ this.setElementContent($__default["default"](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
503
+ $__default["default"](tip).removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
504
+ };
505
+
506
+ _proto.setElementContent = function setElementContent($element, content) {
507
+ if (typeof content === 'object' && (content.nodeType || content.jquery)) {
508
+ // Content is a DOM node or a jQuery
509
+ if (this.config.html) {
510
+ if (!$__default["default"](content).parent().is($element)) {
511
+ $element.empty().append(content);
512
+ }
513
+ } else {
514
+ $element.text($__default["default"](content).text());
515
+ }
516
+
517
+ return;
518
+ }
519
+
520
+ if (this.config.html) {
521
+ if (this.config.sanitize) {
522
+ content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
523
+ }
524
+
525
+ $element.html(content);
526
+ } else {
527
+ $element.text(content);
528
+ }
529
+ };
530
+
531
+ _proto.getTitle = function getTitle() {
532
+ var title = this.element.getAttribute('data-original-title');
533
+
534
+ if (!title) {
535
+ title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
536
+ }
537
+
538
+ return title;
539
+ } // Private
540
+ ;
541
+
542
+ _proto._getPopperConfig = function _getPopperConfig(attachment) {
543
+ var _this3 = this;
544
+
545
+ var defaultBsConfig = {
546
+ placement: attachment,
547
+ modifiers: {
548
+ offset: this._getOffset(),
549
+ flip: {
550
+ behavior: this.config.fallbackPlacement
551
+ },
552
+ arrow: {
553
+ element: SELECTOR_ARROW
554
+ },
555
+ preventOverflow: {
556
+ boundariesElement: this.config.boundary
557
+ }
558
+ },
559
+ onCreate: function onCreate(data) {
560
+ if (data.originalPlacement !== data.placement) {
561
+ _this3._handlePopperPlacementChange(data);
562
+ }
563
+ },
564
+ onUpdate: function onUpdate(data) {
565
+ return _this3._handlePopperPlacementChange(data);
566
+ }
567
+ };
568
+ return _extends({}, defaultBsConfig, this.config.popperConfig);
569
+ };
570
+
571
+ _proto._getOffset = function _getOffset() {
572
+ var _this4 = this;
573
+
574
+ var offset = {};
575
+
576
+ if (typeof this.config.offset === 'function') {
577
+ offset.fn = function (data) {
578
+ data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element));
579
+ return data;
580
+ };
581
+ } else {
582
+ offset.offset = this.config.offset;
583
+ }
584
+
585
+ return offset;
586
+ };
587
+
588
+ _proto._getContainer = function _getContainer() {
589
+ if (this.config.container === false) {
590
+ return document.body;
591
+ }
592
+
593
+ if (Util__default["default"].isElement(this.config.container)) {
594
+ return $__default["default"](this.config.container);
595
+ }
596
+
597
+ return $__default["default"](document).find(this.config.container);
598
+ };
599
+
600
+ _proto._getAttachment = function _getAttachment(placement) {
601
+ return AttachmentMap[placement.toUpperCase()];
602
+ };
603
+
604
+ _proto._setListeners = function _setListeners() {
605
+ var _this5 = this;
606
+
607
+ var triggers = this.config.trigger.split(' ');
608
+ triggers.forEach(function (trigger) {
609
+ if (trigger === 'click') {
610
+ $__default["default"](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
611
+ return _this5.toggle(event);
612
+ });
613
+ } else if (trigger !== TRIGGER_MANUAL) {
614
+ var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
615
+ var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
616
+ $__default["default"](_this5.element).on(eventIn, _this5.config.selector, function (event) {
617
+ return _this5._enter(event);
618
+ }).on(eventOut, _this5.config.selector, function (event) {
619
+ return _this5._leave(event);
620
+ });
621
+ }
622
+ });
623
+
624
+ this._hideModalHandler = function () {
625
+ if (_this5.element) {
626
+ _this5.hide();
627
+ }
628
+ };
629
+
630
+ $__default["default"](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
631
+
632
+ if (this.config.selector) {
633
+ this.config = _extends({}, this.config, {
634
+ trigger: 'manual',
635
+ selector: ''
636
+ });
637
+ } else {
638
+ this._fixTitle();
639
+ }
640
+ };
641
+
642
+ _proto._fixTitle = function _fixTitle() {
643
+ var titleType = typeof this.element.getAttribute('data-original-title');
644
+
645
+ if (this.element.getAttribute('title') || titleType !== 'string') {
646
+ this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
647
+ this.element.setAttribute('title', '');
648
+ }
649
+ };
650
+
651
+ _proto._enter = function _enter(event, context) {
652
+ var dataKey = this.constructor.DATA_KEY;
653
+ context = context || $__default["default"](event.currentTarget).data(dataKey);
654
+
655
+ if (!context) {
656
+ context = new this.constructor(event.currentTarget, this._getDelegateConfig());
657
+ $__default["default"](event.currentTarget).data(dataKey, context);
658
+ }
659
+
660
+ if (event) {
661
+ context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
662
+ }
663
+
664
+ if ($__default["default"](context.getTipElement()).hasClass(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
665
+ context._hoverState = HOVER_STATE_SHOW;
666
+ return;
667
+ }
668
+
669
+ clearTimeout(context._timeout);
670
+ context._hoverState = HOVER_STATE_SHOW;
671
+
672
+ if (!context.config.delay || !context.config.delay.show) {
673
+ context.show();
674
+ return;
675
+ }
676
+
677
+ context._timeout = setTimeout(function () {
678
+ if (context._hoverState === HOVER_STATE_SHOW) {
679
+ context.show();
680
+ }
681
+ }, context.config.delay.show);
682
+ };
683
+
684
+ _proto._leave = function _leave(event, context) {
685
+ var dataKey = this.constructor.DATA_KEY;
686
+ context = context || $__default["default"](event.currentTarget).data(dataKey);
687
+
688
+ if (!context) {
689
+ context = new this.constructor(event.currentTarget, this._getDelegateConfig());
690
+ $__default["default"](event.currentTarget).data(dataKey, context);
691
+ }
692
+
693
+ if (event) {
694
+ context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
695
+ }
696
+
697
+ if (context._isWithActiveTrigger()) {
698
+ return;
699
+ }
700
+
701
+ clearTimeout(context._timeout);
702
+ context._hoverState = HOVER_STATE_OUT;
703
+
704
+ if (!context.config.delay || !context.config.delay.hide) {
705
+ context.hide();
706
+ return;
707
+ }
708
+
709
+ context._timeout = setTimeout(function () {
710
+ if (context._hoverState === HOVER_STATE_OUT) {
711
+ context.hide();
712
+ }
713
+ }, context.config.delay.hide);
714
+ };
715
+
716
+ _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
717
+ for (var trigger in this._activeTrigger) {
718
+ if (this._activeTrigger[trigger]) {
719
+ return true;
720
+ }
721
+ }
722
+
723
+ return false;
724
+ };
725
+
726
+ _proto._getConfig = function _getConfig(config) {
727
+ var dataAttributes = $__default["default"](this.element).data();
728
+ Object.keys(dataAttributes).forEach(function (dataAttr) {
729
+ if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
730
+ delete dataAttributes[dataAttr];
731
+ }
732
+ });
733
+ config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
734
+
735
+ if (typeof config.delay === 'number') {
736
+ config.delay = {
737
+ show: config.delay,
738
+ hide: config.delay
739
+ };
740
+ }
741
+
742
+ if (typeof config.title === 'number') {
743
+ config.title = config.title.toString();
744
+ }
745
+
746
+ if (typeof config.content === 'number') {
747
+ config.content = config.content.toString();
748
+ }
749
+
750
+ Util__default["default"].typeCheckConfig(NAME, config, this.constructor.DefaultType);
751
+
752
+ if (config.sanitize) {
753
+ config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
754
+ }
755
+
756
+ return config;
757
+ };
758
+
759
+ _proto._getDelegateConfig = function _getDelegateConfig() {
760
+ var config = {};
761
+
762
+ if (this.config) {
763
+ for (var key in this.config) {
764
+ if (this.constructor.Default[key] !== this.config[key]) {
765
+ config[key] = this.config[key];
766
+ }
767
+ }
768
+ }
769
+
770
+ return config;
771
+ };
772
+
773
+ _proto._cleanTipClass = function _cleanTipClass() {
774
+ var $tip = $__default["default"](this.getTipElement());
775
+ var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
776
+
777
+ if (tabClass !== null && tabClass.length) {
778
+ $tip.removeClass(tabClass.join(''));
779
+ }
780
+ };
781
+
782
+ _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
783
+ this.tip = popperData.instance.popper;
784
+
785
+ this._cleanTipClass();
786
+
787
+ this.addAttachmentClass(this._getAttachment(popperData.placement));
788
+ };
789
+
790
+ _proto._fixTransition = function _fixTransition() {
791
+ var tip = this.getTipElement();
792
+ var initConfigAnimation = this.config.animation;
793
+
794
+ if (tip.getAttribute('x-placement') !== null) {
795
+ return;
796
+ }
797
+
798
+ $__default["default"](tip).removeClass(CLASS_NAME_FADE);
799
+ this.config.animation = false;
800
+ this.hide();
801
+ this.show();
802
+ this.config.animation = initConfigAnimation;
803
+ } // Static
804
+ ;
805
+
806
+ Tooltip._jQueryInterface = function _jQueryInterface(config) {
807
+ return this.each(function () {
808
+ var $element = $__default["default"](this);
809
+ var data = $element.data(DATA_KEY);
810
+
811
+ var _config = typeof config === 'object' && config;
812
+
813
+ if (!data && /dispose|hide/.test(config)) {
814
+ return;
815
+ }
816
+
817
+ if (!data) {
818
+ data = new Tooltip(this, _config);
819
+ $element.data(DATA_KEY, data);
820
+ }
821
+
822
+ if (typeof config === 'string') {
823
+ if (typeof data[config] === 'undefined') {
824
+ throw new TypeError("No method named \"" + config + "\"");
825
+ }
826
+
827
+ data[config]();
828
+ }
829
+ });
830
+ };
831
+
832
+ _createClass(Tooltip, null, [{
833
+ key: "VERSION",
834
+ get: function get() {
835
+ return VERSION;
836
+ }
837
+ }, {
838
+ key: "Default",
839
+ get: function get() {
840
+ return Default;
841
+ }
842
+ }, {
843
+ key: "NAME",
844
+ get: function get() {
845
+ return NAME;
846
+ }
847
+ }, {
848
+ key: "DATA_KEY",
849
+ get: function get() {
850
+ return DATA_KEY;
851
+ }
852
+ }, {
853
+ key: "Event",
854
+ get: function get() {
855
+ return Event;
856
+ }
857
+ }, {
858
+ key: "EVENT_KEY",
859
+ get: function get() {
860
+ return EVENT_KEY;
861
+ }
862
+ }, {
863
+ key: "DefaultType",
864
+ get: function get() {
865
+ return DefaultType;
866
+ }
867
+ }]);
868
+
869
+ return Tooltip;
870
+ }();
871
+ /**
872
+ * jQuery
873
+ */
874
+
875
+
876
+ $__default["default"].fn[NAME] = Tooltip._jQueryInterface;
877
+ $__default["default"].fn[NAME].Constructor = Tooltip;
878
+
879
+ $__default["default"].fn[NAME].noConflict = function () {
880
+ $__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;
881
+ return Tooltip._jQueryInterface;
882
+ };
883
+
884
+ return Tooltip;
885
+
886
+ }));