vertx-howtos-jekyll-theme 0.1.0

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 (164) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +52 -0
  4. data/_layouts/page.html +61 -0
  5. data/_sass/bootstrap/js/dist/alert.js +199 -0
  6. data/_sass/bootstrap/js/dist/alert.js.map +1 -0
  7. data/_sass/bootstrap/js/dist/button.js +187 -0
  8. data/_sass/bootstrap/js/dist/button.js.map +1 -0
  9. data/_sass/bootstrap/js/dist/carousel.js +666 -0
  10. data/_sass/bootstrap/js/dist/carousel.js.map +1 -0
  11. data/_sass/bootstrap/js/dist/collapse.js +428 -0
  12. data/_sass/bootstrap/js/dist/collapse.js.map +1 -0
  13. data/_sass/bootstrap/js/dist/dropdown.js +591 -0
  14. data/_sass/bootstrap/js/dist/dropdown.js.map +1 -0
  15. data/_sass/bootstrap/js/dist/index.js +23 -0
  16. data/_sass/bootstrap/js/dist/index.js.map +1 -0
  17. data/_sass/bootstrap/js/dist/modal.js +644 -0
  18. data/_sass/bootstrap/js/dist/modal.js.map +1 -0
  19. data/_sass/bootstrap/js/dist/popover.js +261 -0
  20. data/_sass/bootstrap/js/dist/popover.js.map +1 -0
  21. data/_sass/bootstrap/js/dist/scrollspy.js +375 -0
  22. data/_sass/bootstrap/js/dist/scrollspy.js.map +1 -0
  23. data/_sass/bootstrap/js/dist/tab.js +266 -0
  24. data/_sass/bootstrap/js/dist/tab.js.map +1 -0
  25. data/_sass/bootstrap/js/dist/toast.js +278 -0
  26. data/_sass/bootstrap/js/dist/toast.js.map +1 -0
  27. data/_sass/bootstrap/js/dist/tooltip.js +745 -0
  28. data/_sass/bootstrap/js/dist/tooltip.js.map +1 -0
  29. data/_sass/bootstrap/js/dist/util.js +168 -0
  30. data/_sass/bootstrap/js/dist/util.js.map +1 -0
  31. data/_sass/bootstrap/js/src/alert.js +179 -0
  32. data/_sass/bootstrap/js/src/button.js +171 -0
  33. data/_sass/bootstrap/js/src/carousel.js +604 -0
  34. data/_sass/bootstrap/js/src/collapse.js +402 -0
  35. data/_sass/bootstrap/js/src/dropdown.js +538 -0
  36. data/_sass/bootstrap/js/src/index.js +52 -0
  37. data/_sass/bootstrap/js/src/modal.js +587 -0
  38. data/_sass/bootstrap/js/src/popover.js +184 -0
  39. data/_sass/bootstrap/js/src/scrollspy.js +326 -0
  40. data/_sass/bootstrap/js/src/tab.js +257 -0
  41. data/_sass/bootstrap/js/src/toast.js +223 -0
  42. data/_sass/bootstrap/js/src/tooltip.js +735 -0
  43. data/_sass/bootstrap/js/src/util.js +173 -0
  44. data/_sass/bootstrap/js/tests/README.md +69 -0
  45. data/_sass/bootstrap/js/tests/browsers.js +82 -0
  46. data/_sass/bootstrap/js/tests/index.html +145 -0
  47. data/_sass/bootstrap/js/tests/integration/bundle.js +8 -0
  48. data/_sass/bootstrap/js/tests/integration/index.html +66 -0
  49. data/_sass/bootstrap/js/tests/integration/rollup.bundle.js +20 -0
  50. data/_sass/bootstrap/js/tests/karma.conf.js +145 -0
  51. data/_sass/bootstrap/js/tests/unit/.eslintrc.json +40 -0
  52. data/_sass/bootstrap/js/tests/unit/alert.js +123 -0
  53. data/_sass/bootstrap/js/tests/unit/button.js +222 -0
  54. data/_sass/bootstrap/js/tests/unit/carousel.js +1273 -0
  55. data/_sass/bootstrap/js/tests/unit/collapse.js +892 -0
  56. data/_sass/bootstrap/js/tests/unit/dropdown.js +1364 -0
  57. data/_sass/bootstrap/js/tests/unit/modal.js +796 -0
  58. data/_sass/bootstrap/js/tests/unit/popover.js +471 -0
  59. data/_sass/bootstrap/js/tests/unit/scrollspy.js +728 -0
  60. data/_sass/bootstrap/js/tests/unit/tab.js +462 -0
  61. data/_sass/bootstrap/js/tests/unit/toast.js +239 -0
  62. data/_sass/bootstrap/js/tests/unit/tooltip.js +1072 -0
  63. data/_sass/bootstrap/js/tests/unit/util.js +164 -0
  64. data/_sass/bootstrap/js/tests/visual/alert.html +58 -0
  65. data/_sass/bootstrap/js/tests/visual/button.html +51 -0
  66. data/_sass/bootstrap/js/tests/visual/carousel.html +66 -0
  67. data/_sass/bootstrap/js/tests/visual/collapse.html +78 -0
  68. data/_sass/bootstrap/js/tests/visual/dropdown.html +212 -0
  69. data/_sass/bootstrap/js/tests/visual/modal.html +268 -0
  70. data/_sass/bootstrap/js/tests/visual/popover.html +46 -0
  71. data/_sass/bootstrap/js/tests/visual/scrollspy.html +95 -0
  72. data/_sass/bootstrap/js/tests/visual/tab.html +234 -0
  73. data/_sass/bootstrap/js/tests/visual/toast.html +72 -0
  74. data/_sass/bootstrap/js/tests/visual/tooltip.html +106 -0
  75. data/_sass/bootstrap/scss/_alert.scss +51 -0
  76. data/_sass/bootstrap/scss/_badge.scss +53 -0
  77. data/_sass/bootstrap/scss/_breadcrumb.scss +41 -0
  78. data/_sass/bootstrap/scss/_button-group.scss +163 -0
  79. data/_sass/bootstrap/scss/_buttons.scss +140 -0
  80. data/_sass/bootstrap/scss/_card.scss +310 -0
  81. data/_sass/bootstrap/scss/_carousel.scss +198 -0
  82. data/_sass/bootstrap/scss/_close.scss +44 -0
  83. data/_sass/bootstrap/scss/_code.scss +48 -0
  84. data/_sass/bootstrap/scss/_custom-forms.scss +507 -0
  85. data/_sass/bootstrap/scss/_dropdown.scss +191 -0
  86. data/_sass/bootstrap/scss/_forms.scss +334 -0
  87. data/_sass/bootstrap/scss/_functions.scss +86 -0
  88. data/_sass/bootstrap/scss/_grid.scss +52 -0
  89. data/_sass/bootstrap/scss/_images.scss +42 -0
  90. data/_sass/bootstrap/scss/_input-group.scss +193 -0
  91. data/_sass/bootstrap/scss/_jumbotron.scss +16 -0
  92. data/_sass/bootstrap/scss/_list-group.scss +121 -0
  93. data/_sass/bootstrap/scss/_media.scss +8 -0
  94. data/_sass/bootstrap/scss/_mixins.scss +41 -0
  95. data/_sass/bootstrap/scss/_modal.scss +186 -0
  96. data/_sass/bootstrap/scss/_nav.scss +120 -0
  97. data/_sass/bootstrap/scss/_navbar.scss +299 -0
  98. data/_sass/bootstrap/scss/_pagination.scss +78 -0
  99. data/_sass/bootstrap/scss/_popover.scss +183 -0
  100. data/_sass/bootstrap/scss/_print.scss +141 -0
  101. data/_sass/bootstrap/scss/_progress.scss +34 -0
  102. data/_sass/bootstrap/scss/_reboot.scss +462 -0
  103. data/_sass/bootstrap/scss/_root.scss +19 -0
  104. data/_sass/bootstrap/scss/_spinners.scss +53 -0
  105. data/_sass/bootstrap/scss/_tables.scss +187 -0
  106. data/_sass/bootstrap/scss/_toasts.scss +43 -0
  107. data/_sass/bootstrap/scss/_tooltip.scss +115 -0
  108. data/_sass/bootstrap/scss/_transitions.scss +22 -0
  109. data/_sass/bootstrap/scss/_type.scss +125 -0
  110. data/_sass/bootstrap/scss/_utilities.scss +16 -0
  111. data/_sass/bootstrap/scss/_variables.scss +1091 -0
  112. data/_sass/bootstrap/scss/bootstrap-grid.scss +29 -0
  113. data/_sass/bootstrap/scss/bootstrap-reboot.scss +12 -0
  114. data/_sass/bootstrap/scss/bootstrap.scss +44 -0
  115. data/_sass/bootstrap/scss/mixins/_alert.scss +13 -0
  116. data/_sass/bootstrap/scss/mixins/_background-variant.scss +21 -0
  117. data/_sass/bootstrap/scss/mixins/_badge.scss +11 -0
  118. data/_sass/bootstrap/scss/mixins/_border-radius.scss +35 -0
  119. data/_sass/bootstrap/scss/mixins/_box-shadow.scss +5 -0
  120. data/_sass/bootstrap/scss/mixins/_breakpoints.scss +123 -0
  121. data/_sass/bootstrap/scss/mixins/_buttons.scss +111 -0
  122. data/_sass/bootstrap/scss/mixins/_caret.scss +62 -0
  123. data/_sass/bootstrap/scss/mixins/_clearfix.scss +7 -0
  124. data/_sass/bootstrap/scss/mixins/_float.scss +11 -0
  125. data/_sass/bootstrap/scss/mixins/_forms.scss +198 -0
  126. data/_sass/bootstrap/scss/mixins/_gradients.scss +45 -0
  127. data/_sass/bootstrap/scss/mixins/_grid-framework.scss +66 -0
  128. data/_sass/bootstrap/scss/mixins/_grid.scss +51 -0
  129. data/_sass/bootstrap/scss/mixins/_hover.scss +37 -0
  130. data/_sass/bootstrap/scss/mixins/_image.scss +36 -0
  131. data/_sass/bootstrap/scss/mixins/_list-group.scss +21 -0
  132. data/_sass/bootstrap/scss/mixins/_lists.scss +7 -0
  133. data/_sass/bootstrap/scss/mixins/_nav-divider.scss +10 -0
  134. data/_sass/bootstrap/scss/mixins/_pagination.scss +22 -0
  135. data/_sass/bootstrap/scss/mixins/_reset-text.scss +17 -0
  136. data/_sass/bootstrap/scss/mixins/_resize.scss +6 -0
  137. data/_sass/bootstrap/scss/mixins/_screen-reader.scss +33 -0
  138. data/_sass/bootstrap/scss/mixins/_size.scss +6 -0
  139. data/_sass/bootstrap/scss/mixins/_table-row.scss +39 -0
  140. data/_sass/bootstrap/scss/mixins/_text-emphasis.scss +14 -0
  141. data/_sass/bootstrap/scss/mixins/_text-hide.scss +13 -0
  142. data/_sass/bootstrap/scss/mixins/_text-truncate.scss +8 -0
  143. data/_sass/bootstrap/scss/mixins/_transition.scss +16 -0
  144. data/_sass/bootstrap/scss/mixins/_visibility.scss +7 -0
  145. data/_sass/bootstrap/scss/utilities/_align.scss +8 -0
  146. data/_sass/bootstrap/scss/utilities/_background.scss +19 -0
  147. data/_sass/bootstrap/scss/utilities/_borders.scss +63 -0
  148. data/_sass/bootstrap/scss/utilities/_clearfix.scss +3 -0
  149. data/_sass/bootstrap/scss/utilities/_display.scss +38 -0
  150. data/_sass/bootstrap/scss/utilities/_embed.scss +39 -0
  151. data/_sass/bootstrap/scss/utilities/_flex.scss +51 -0
  152. data/_sass/bootstrap/scss/utilities/_float.scss +9 -0
  153. data/_sass/bootstrap/scss/utilities/_overflow.scss +5 -0
  154. data/_sass/bootstrap/scss/utilities/_position.scss +32 -0
  155. data/_sass/bootstrap/scss/utilities/_screenreaders.scss +11 -0
  156. data/_sass/bootstrap/scss/utilities/_shadows.scss +6 -0
  157. data/_sass/bootstrap/scss/utilities/_sizing.scss +20 -0
  158. data/_sass/bootstrap/scss/utilities/_spacing.scss +73 -0
  159. data/_sass/bootstrap/scss/utilities/_text.scss +67 -0
  160. data/_sass/bootstrap/scss/utilities/_visibility.scss +11 -0
  161. data/_sass/custom.scss +1 -0
  162. data/assets/css/style.scss +65 -0
  163. data/assets/images/vertx-square.svg +1 -0
  164. metadata +248 -0
@@ -0,0 +1,735 @@
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * Bootstrap (v4.2.1): tooltip.js
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+
8
+ import $ from 'jquery'
9
+ import Popper from 'popper.js'
10
+ import Util from './util'
11
+
12
+ /**
13
+ * ------------------------------------------------------------------------
14
+ * Constants
15
+ * ------------------------------------------------------------------------
16
+ */
17
+
18
+ const NAME = 'tooltip'
19
+ const VERSION = '4.2.1'
20
+ const DATA_KEY = 'bs.tooltip'
21
+ const EVENT_KEY = `.${DATA_KEY}`
22
+ const JQUERY_NO_CONFLICT = $.fn[NAME]
23
+ const CLASS_PREFIX = 'bs-tooltip'
24
+ const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g')
25
+
26
+ const DefaultType = {
27
+ animation : 'boolean',
28
+ template : 'string',
29
+ title : '(string|element|function)',
30
+ trigger : 'string',
31
+ delay : '(number|object)',
32
+ html : 'boolean',
33
+ selector : '(string|boolean)',
34
+ placement : '(string|function)',
35
+ offset : '(number|string)',
36
+ container : '(string|element|boolean)',
37
+ fallbackPlacement : '(string|array)',
38
+ boundary : '(string|element)'
39
+ }
40
+
41
+ const AttachmentMap = {
42
+ AUTO : 'auto',
43
+ TOP : 'top',
44
+ RIGHT : 'right',
45
+ BOTTOM : 'bottom',
46
+ LEFT : 'left'
47
+ }
48
+
49
+ const Default = {
50
+ animation : true,
51
+ template : '<div class="tooltip" role="tooltip">' +
52
+ '<div class="arrow"></div>' +
53
+ '<div class="tooltip-inner"></div></div>',
54
+ trigger : 'hover focus',
55
+ title : '',
56
+ delay : 0,
57
+ html : false,
58
+ selector : false,
59
+ placement : 'top',
60
+ offset : 0,
61
+ container : false,
62
+ fallbackPlacement : 'flip',
63
+ boundary : 'scrollParent'
64
+ }
65
+
66
+ const HoverState = {
67
+ SHOW : 'show',
68
+ OUT : 'out'
69
+ }
70
+
71
+ const Event = {
72
+ HIDE : `hide${EVENT_KEY}`,
73
+ HIDDEN : `hidden${EVENT_KEY}`,
74
+ SHOW : `show${EVENT_KEY}`,
75
+ SHOWN : `shown${EVENT_KEY}`,
76
+ INSERTED : `inserted${EVENT_KEY}`,
77
+ CLICK : `click${EVENT_KEY}`,
78
+ FOCUSIN : `focusin${EVENT_KEY}`,
79
+ FOCUSOUT : `focusout${EVENT_KEY}`,
80
+ MOUSEENTER : `mouseenter${EVENT_KEY}`,
81
+ MOUSELEAVE : `mouseleave${EVENT_KEY}`
82
+ }
83
+
84
+ const ClassName = {
85
+ FADE : 'fade',
86
+ SHOW : 'show'
87
+ }
88
+
89
+ const Selector = {
90
+ TOOLTIP : '.tooltip',
91
+ TOOLTIP_INNER : '.tooltip-inner',
92
+ ARROW : '.arrow'
93
+ }
94
+
95
+ const Trigger = {
96
+ HOVER : 'hover',
97
+ FOCUS : 'focus',
98
+ CLICK : 'click',
99
+ MANUAL : 'manual'
100
+ }
101
+
102
+
103
+ /**
104
+ * ------------------------------------------------------------------------
105
+ * Class Definition
106
+ * ------------------------------------------------------------------------
107
+ */
108
+
109
+ class Tooltip {
110
+ constructor(element, config) {
111
+ /**
112
+ * Check for Popper dependency
113
+ * Popper - https://popper.js.org
114
+ */
115
+ if (typeof Popper === 'undefined') {
116
+ throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)')
117
+ }
118
+
119
+ // private
120
+ this._isEnabled = true
121
+ this._timeout = 0
122
+ this._hoverState = ''
123
+ this._activeTrigger = {}
124
+ this._popper = null
125
+
126
+ // Protected
127
+ this.element = element
128
+ this.config = this._getConfig(config)
129
+ this.tip = null
130
+
131
+ this._setListeners()
132
+ }
133
+
134
+ // Getters
135
+
136
+ static get VERSION() {
137
+ return VERSION
138
+ }
139
+
140
+ static get Default() {
141
+ return Default
142
+ }
143
+
144
+ static get NAME() {
145
+ return NAME
146
+ }
147
+
148
+ static get DATA_KEY() {
149
+ return DATA_KEY
150
+ }
151
+
152
+ static get Event() {
153
+ return Event
154
+ }
155
+
156
+ static get EVENT_KEY() {
157
+ return EVENT_KEY
158
+ }
159
+
160
+ static get DefaultType() {
161
+ return DefaultType
162
+ }
163
+
164
+ // Public
165
+
166
+ enable() {
167
+ this._isEnabled = true
168
+ }
169
+
170
+ disable() {
171
+ this._isEnabled = false
172
+ }
173
+
174
+ toggleEnabled() {
175
+ this._isEnabled = !this._isEnabled
176
+ }
177
+
178
+ toggle(event) {
179
+ if (!this._isEnabled) {
180
+ return
181
+ }
182
+
183
+ if (event) {
184
+ const dataKey = this.constructor.DATA_KEY
185
+ let context = $(event.currentTarget).data(dataKey)
186
+
187
+ if (!context) {
188
+ context = new this.constructor(
189
+ event.currentTarget,
190
+ this._getDelegateConfig()
191
+ )
192
+ $(event.currentTarget).data(dataKey, context)
193
+ }
194
+
195
+ context._activeTrigger.click = !context._activeTrigger.click
196
+
197
+ if (context._isWithActiveTrigger()) {
198
+ context._enter(null, context)
199
+ } else {
200
+ context._leave(null, context)
201
+ }
202
+ } else {
203
+ if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {
204
+ this._leave(null, this)
205
+ return
206
+ }
207
+
208
+ this._enter(null, this)
209
+ }
210
+ }
211
+
212
+ dispose() {
213
+ clearTimeout(this._timeout)
214
+
215
+ $.removeData(this.element, this.constructor.DATA_KEY)
216
+
217
+ $(this.element).off(this.constructor.EVENT_KEY)
218
+ $(this.element).closest('.modal').off('hide.bs.modal')
219
+
220
+ if (this.tip) {
221
+ $(this.tip).remove()
222
+ }
223
+
224
+ this._isEnabled = null
225
+ this._timeout = null
226
+ this._hoverState = null
227
+ this._activeTrigger = null
228
+ if (this._popper !== null) {
229
+ this._popper.destroy()
230
+ }
231
+
232
+ this._popper = null
233
+ this.element = null
234
+ this.config = null
235
+ this.tip = null
236
+ }
237
+
238
+ show() {
239
+ if ($(this.element).css('display') === 'none') {
240
+ throw new Error('Please use show on visible elements')
241
+ }
242
+
243
+ const showEvent = $.Event(this.constructor.Event.SHOW)
244
+ if (this.isWithContent() && this._isEnabled) {
245
+ $(this.element).trigger(showEvent)
246
+
247
+ const shadowRoot = Util.findShadowRoot(this.element)
248
+ const isInTheDom = $.contains(
249
+ shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement,
250
+ this.element
251
+ )
252
+
253
+ if (showEvent.isDefaultPrevented() || !isInTheDom) {
254
+ return
255
+ }
256
+
257
+ const tip = this.getTipElement()
258
+ const tipId = Util.getUID(this.constructor.NAME)
259
+
260
+ tip.setAttribute('id', tipId)
261
+ this.element.setAttribute('aria-describedby', tipId)
262
+
263
+ this.setContent()
264
+
265
+ if (this.config.animation) {
266
+ $(tip).addClass(ClassName.FADE)
267
+ }
268
+
269
+ const placement = typeof this.config.placement === 'function'
270
+ ? this.config.placement.call(this, tip, this.element)
271
+ : this.config.placement
272
+
273
+ const attachment = this._getAttachment(placement)
274
+ this.addAttachmentClass(attachment)
275
+
276
+ const container = this._getContainer()
277
+ $(tip).data(this.constructor.DATA_KEY, this)
278
+
279
+ if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
280
+ $(tip).appendTo(container)
281
+ }
282
+
283
+ $(this.element).trigger(this.constructor.Event.INSERTED)
284
+
285
+ this._popper = new Popper(this.element, tip, {
286
+ placement: attachment,
287
+ modifiers: {
288
+ offset: {
289
+ offset: this.config.offset
290
+ },
291
+ flip: {
292
+ behavior: this.config.fallbackPlacement
293
+ },
294
+ arrow: {
295
+ element: Selector.ARROW
296
+ },
297
+ preventOverflow: {
298
+ boundariesElement: this.config.boundary
299
+ }
300
+ },
301
+ onCreate: (data) => {
302
+ if (data.originalPlacement !== data.placement) {
303
+ this._handlePopperPlacementChange(data)
304
+ }
305
+ },
306
+ onUpdate: (data) => this._handlePopperPlacementChange(data)
307
+ })
308
+
309
+ $(tip).addClass(ClassName.SHOW)
310
+
311
+ // If this is a touch-enabled device we add extra
312
+ // empty mouseover listeners to the body's immediate children;
313
+ // only needed because of broken event delegation on iOS
314
+ // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
315
+ if ('ontouchstart' in document.documentElement) {
316
+ $(document.body).children().on('mouseover', null, $.noop)
317
+ }
318
+
319
+ const complete = () => {
320
+ if (this.config.animation) {
321
+ this._fixTransition()
322
+ }
323
+ const prevHoverState = this._hoverState
324
+ this._hoverState = null
325
+
326
+ $(this.element).trigger(this.constructor.Event.SHOWN)
327
+
328
+ if (prevHoverState === HoverState.OUT) {
329
+ this._leave(null, this)
330
+ }
331
+ }
332
+
333
+ if ($(this.tip).hasClass(ClassName.FADE)) {
334
+ const transitionDuration = Util.getTransitionDurationFromElement(this.tip)
335
+
336
+ $(this.tip)
337
+ .one(Util.TRANSITION_END, complete)
338
+ .emulateTransitionEnd(transitionDuration)
339
+ } else {
340
+ complete()
341
+ }
342
+ }
343
+ }
344
+
345
+ hide(callback) {
346
+ const tip = this.getTipElement()
347
+ const hideEvent = $.Event(this.constructor.Event.HIDE)
348
+ const complete = () => {
349
+ if (this._hoverState !== HoverState.SHOW && tip.parentNode) {
350
+ tip.parentNode.removeChild(tip)
351
+ }
352
+
353
+ this._cleanTipClass()
354
+ this.element.removeAttribute('aria-describedby')
355
+ $(this.element).trigger(this.constructor.Event.HIDDEN)
356
+ if (this._popper !== null) {
357
+ this._popper.destroy()
358
+ }
359
+
360
+ if (callback) {
361
+ callback()
362
+ }
363
+ }
364
+
365
+ $(this.element).trigger(hideEvent)
366
+
367
+ if (hideEvent.isDefaultPrevented()) {
368
+ return
369
+ }
370
+
371
+ $(tip).removeClass(ClassName.SHOW)
372
+
373
+ // If this is a touch-enabled device we remove the extra
374
+ // empty mouseover listeners we added for iOS support
375
+ if ('ontouchstart' in document.documentElement) {
376
+ $(document.body).children().off('mouseover', null, $.noop)
377
+ }
378
+
379
+ this._activeTrigger[Trigger.CLICK] = false
380
+ this._activeTrigger[Trigger.FOCUS] = false
381
+ this._activeTrigger[Trigger.HOVER] = false
382
+
383
+ if ($(this.tip).hasClass(ClassName.FADE)) {
384
+ const transitionDuration = Util.getTransitionDurationFromElement(tip)
385
+
386
+ $(tip)
387
+ .one(Util.TRANSITION_END, complete)
388
+ .emulateTransitionEnd(transitionDuration)
389
+ } else {
390
+ complete()
391
+ }
392
+
393
+ this._hoverState = ''
394
+ }
395
+
396
+ update() {
397
+ if (this._popper !== null) {
398
+ this._popper.scheduleUpdate()
399
+ }
400
+ }
401
+
402
+ // Protected
403
+
404
+ isWithContent() {
405
+ return Boolean(this.getTitle())
406
+ }
407
+
408
+ addAttachmentClass(attachment) {
409
+ $(this.getTipElement()).addClass(`${CLASS_PREFIX}-${attachment}`)
410
+ }
411
+
412
+ getTipElement() {
413
+ this.tip = this.tip || $(this.config.template)[0]
414
+ return this.tip
415
+ }
416
+
417
+ setContent() {
418
+ const tip = this.getTipElement()
419
+ this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle())
420
+ $(tip).removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)
421
+ }
422
+
423
+ setElementContent($element, content) {
424
+ const html = this.config.html
425
+ if (typeof content === 'object' && (content.nodeType || content.jquery)) {
426
+ // Content is a DOM node or a jQuery
427
+ if (html) {
428
+ if (!$(content).parent().is($element)) {
429
+ $element.empty().append(content)
430
+ }
431
+ } else {
432
+ $element.text($(content).text())
433
+ }
434
+ } else {
435
+ $element[html ? 'html' : 'text'](content)
436
+ }
437
+ }
438
+
439
+ getTitle() {
440
+ let title = this.element.getAttribute('data-original-title')
441
+
442
+ if (!title) {
443
+ title = typeof this.config.title === 'function'
444
+ ? this.config.title.call(this.element)
445
+ : this.config.title
446
+ }
447
+
448
+ return title
449
+ }
450
+
451
+ // Private
452
+
453
+ _getContainer() {
454
+ if (this.config.container === false) {
455
+ return document.body
456
+ }
457
+
458
+ if (Util.isElement(this.config.container)) {
459
+ return $(this.config.container)
460
+ }
461
+
462
+ return $(document).find(this.config.container)
463
+ }
464
+
465
+ _getAttachment(placement) {
466
+ return AttachmentMap[placement.toUpperCase()]
467
+ }
468
+
469
+ _setListeners() {
470
+ const triggers = this.config.trigger.split(' ')
471
+
472
+ triggers.forEach((trigger) => {
473
+ if (trigger === 'click') {
474
+ $(this.element).on(
475
+ this.constructor.Event.CLICK,
476
+ this.config.selector,
477
+ (event) => this.toggle(event)
478
+ )
479
+ } else if (trigger !== Trigger.MANUAL) {
480
+ const eventIn = trigger === Trigger.HOVER
481
+ ? this.constructor.Event.MOUSEENTER
482
+ : this.constructor.Event.FOCUSIN
483
+ const eventOut = trigger === Trigger.HOVER
484
+ ? this.constructor.Event.MOUSELEAVE
485
+ : this.constructor.Event.FOCUSOUT
486
+
487
+ $(this.element)
488
+ .on(
489
+ eventIn,
490
+ this.config.selector,
491
+ (event) => this._enter(event)
492
+ )
493
+ .on(
494
+ eventOut,
495
+ this.config.selector,
496
+ (event) => this._leave(event)
497
+ )
498
+ }
499
+ })
500
+
501
+ $(this.element).closest('.modal').on(
502
+ 'hide.bs.modal',
503
+ () => {
504
+ if (this.element) {
505
+ this.hide()
506
+ }
507
+ }
508
+ )
509
+
510
+ if (this.config.selector) {
511
+ this.config = {
512
+ ...this.config,
513
+ trigger: 'manual',
514
+ selector: ''
515
+ }
516
+ } else {
517
+ this._fixTitle()
518
+ }
519
+ }
520
+
521
+ _fixTitle() {
522
+ const titleType = typeof this.element.getAttribute('data-original-title')
523
+
524
+ if (this.element.getAttribute('title') || titleType !== 'string') {
525
+ this.element.setAttribute(
526
+ 'data-original-title',
527
+ this.element.getAttribute('title') || ''
528
+ )
529
+
530
+ this.element.setAttribute('title', '')
531
+ }
532
+ }
533
+
534
+ _enter(event, context) {
535
+ const dataKey = this.constructor.DATA_KEY
536
+ context = context || $(event.currentTarget).data(dataKey)
537
+
538
+ if (!context) {
539
+ context = new this.constructor(
540
+ event.currentTarget,
541
+ this._getDelegateConfig()
542
+ )
543
+ $(event.currentTarget).data(dataKey, context)
544
+ }
545
+
546
+ if (event) {
547
+ context._activeTrigger[
548
+ event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER
549
+ ] = true
550
+ }
551
+
552
+ if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
553
+ context._hoverState = HoverState.SHOW
554
+ return
555
+ }
556
+
557
+ clearTimeout(context._timeout)
558
+
559
+ context._hoverState = HoverState.SHOW
560
+
561
+ if (!context.config.delay || !context.config.delay.show) {
562
+ context.show()
563
+ return
564
+ }
565
+
566
+ context._timeout = setTimeout(() => {
567
+ if (context._hoverState === HoverState.SHOW) {
568
+ context.show()
569
+ }
570
+ }, context.config.delay.show)
571
+ }
572
+
573
+ _leave(event, context) {
574
+ const dataKey = this.constructor.DATA_KEY
575
+ context = context || $(event.currentTarget).data(dataKey)
576
+
577
+ if (!context) {
578
+ context = new this.constructor(
579
+ event.currentTarget,
580
+ this._getDelegateConfig()
581
+ )
582
+ $(event.currentTarget).data(dataKey, context)
583
+ }
584
+
585
+ if (event) {
586
+ context._activeTrigger[
587
+ event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER
588
+ ] = false
589
+ }
590
+
591
+ if (context._isWithActiveTrigger()) {
592
+ return
593
+ }
594
+
595
+ clearTimeout(context._timeout)
596
+
597
+ context._hoverState = HoverState.OUT
598
+
599
+ if (!context.config.delay || !context.config.delay.hide) {
600
+ context.hide()
601
+ return
602
+ }
603
+
604
+ context._timeout = setTimeout(() => {
605
+ if (context._hoverState === HoverState.OUT) {
606
+ context.hide()
607
+ }
608
+ }, context.config.delay.hide)
609
+ }
610
+
611
+ _isWithActiveTrigger() {
612
+ for (const trigger in this._activeTrigger) {
613
+ if (this._activeTrigger[trigger]) {
614
+ return true
615
+ }
616
+ }
617
+
618
+ return false
619
+ }
620
+
621
+ _getConfig(config) {
622
+ config = {
623
+ ...this.constructor.Default,
624
+ ...$(this.element).data(),
625
+ ...typeof config === 'object' && config ? config : {}
626
+ }
627
+
628
+ if (typeof config.delay === 'number') {
629
+ config.delay = {
630
+ show: config.delay,
631
+ hide: config.delay
632
+ }
633
+ }
634
+
635
+ if (typeof config.title === 'number') {
636
+ config.title = config.title.toString()
637
+ }
638
+
639
+ if (typeof config.content === 'number') {
640
+ config.content = config.content.toString()
641
+ }
642
+
643
+ Util.typeCheckConfig(
644
+ NAME,
645
+ config,
646
+ this.constructor.DefaultType
647
+ )
648
+
649
+ return config
650
+ }
651
+
652
+ _getDelegateConfig() {
653
+ const config = {}
654
+
655
+ if (this.config) {
656
+ for (const key in this.config) {
657
+ if (this.constructor.Default[key] !== this.config[key]) {
658
+ config[key] = this.config[key]
659
+ }
660
+ }
661
+ }
662
+
663
+ return config
664
+ }
665
+
666
+ _cleanTipClass() {
667
+ const $tip = $(this.getTipElement())
668
+ const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX)
669
+ if (tabClass !== null && tabClass.length) {
670
+ $tip.removeClass(tabClass.join(''))
671
+ }
672
+ }
673
+
674
+ _handlePopperPlacementChange(popperData) {
675
+ const popperInstance = popperData.instance
676
+ this.tip = popperInstance.popper
677
+ this._cleanTipClass()
678
+ this.addAttachmentClass(this._getAttachment(popperData.placement))
679
+ }
680
+
681
+ _fixTransition() {
682
+ const tip = this.getTipElement()
683
+ const initConfigAnimation = this.config.animation
684
+
685
+ if (tip.getAttribute('x-placement') !== null) {
686
+ return
687
+ }
688
+
689
+ $(tip).removeClass(ClassName.FADE)
690
+ this.config.animation = false
691
+ this.hide()
692
+ this.show()
693
+ this.config.animation = initConfigAnimation
694
+ }
695
+
696
+ // Static
697
+
698
+ static _jQueryInterface(config) {
699
+ return this.each(function () {
700
+ let data = $(this).data(DATA_KEY)
701
+ const _config = typeof config === 'object' && config
702
+
703
+ if (!data && /dispose|hide/.test(config)) {
704
+ return
705
+ }
706
+
707
+ if (!data) {
708
+ data = new Tooltip(this, _config)
709
+ $(this).data(DATA_KEY, data)
710
+ }
711
+
712
+ if (typeof config === 'string') {
713
+ if (typeof data[config] === 'undefined') {
714
+ throw new TypeError(`No method named "${config}"`)
715
+ }
716
+ data[config]()
717
+ }
718
+ })
719
+ }
720
+ }
721
+
722
+ /**
723
+ * ------------------------------------------------------------------------
724
+ * jQuery
725
+ * ------------------------------------------------------------------------
726
+ */
727
+
728
+ $.fn[NAME] = Tooltip._jQueryInterface
729
+ $.fn[NAME].Constructor = Tooltip
730
+ $.fn[NAME].noConflict = () => {
731
+ $.fn[NAME] = JQUERY_NO_CONFLICT
732
+ return Tooltip._jQueryInterface
733
+ }
734
+
735
+ export default Tooltip