insights4you-jekyll-theme 0.2.2 → 0.4.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 (271) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +110 -0
  3. data/README.md +113 -30
  4. data/_data/i4y-colors.json +218 -0
  5. data/_data/i4y-social-media.yml +0 -2
  6. data/_includes/layout/footer.html +48 -0
  7. data/_includes/{head.html → layout/head.html} +40 -20
  8. data/_includes/layout/navbar-logo.html +137 -0
  9. data/_includes/layout/navbar.html +82 -0
  10. data/_includes/ui/button.html +13 -14
  11. data/_includes/ui/icon.html +24 -26
  12. data/_includes/ui/spinner.html +2 -0
  13. data/_includes/utils/banner.html +7 -0
  14. data/_includes/utils/settings.html +144 -0
  15. data/_layouts/base.html +63 -0
  16. data/_layouts/default.html +39 -16
  17. data/_sass/_bootstrap-components.scss +31 -0
  18. data/_sass/_bootstrap-config.scss +7 -0
  19. data/_sass/_bootstrap-override.scss +78 -0
  20. data/_sass/_config.scss +9 -0
  21. data/_sass/_core.scss +78 -0
  22. data/_sass/_debug.scss +49 -0
  23. data/_sass/_mixins.scss +2 -0
  24. data/_sass/_props.scss +91 -0
  25. data/_sass/_utilities-marketing.scss +209 -0
  26. data/_sass/_utilities.scss +135 -0
  27. data/_sass/_variables-dark.scss +19 -0
  28. data/_sass/_variables-marketing.scss +0 -0
  29. data/_sass/_variables.scss +1001 -0
  30. data/_sass/bootstrap/LICENSE +21 -0
  31. data/_sass/bootstrap/README.md +246 -0
  32. data/_sass/bootstrap/js/index.esm.js +19 -0
  33. data/_sass/bootstrap/js/index.umd.js +34 -0
  34. data/_sass/bootstrap/js/src/alert.js +87 -0
  35. data/_sass/bootstrap/js/src/base-component.js +85 -0
  36. data/_sass/bootstrap/js/src/button.js +72 -0
  37. data/_sass/bootstrap/js/src/carousel.js +474 -0
  38. data/_sass/bootstrap/js/src/collapse.js +297 -0
  39. data/_sass/bootstrap/js/src/dom/data.js +55 -0
  40. data/_sass/bootstrap/js/src/dom/event-handler.js +317 -0
  41. data/_sass/bootstrap/js/src/dom/manipulator.js +71 -0
  42. data/_sass/bootstrap/js/src/dom/selector-engine.js +126 -0
  43. data/_sass/bootstrap/js/src/dropdown.js +455 -0
  44. data/_sass/bootstrap/js/src/modal.js +378 -0
  45. data/_sass/bootstrap/js/src/offcanvas.js +282 -0
  46. data/_sass/bootstrap/js/src/popover.js +97 -0
  47. data/_sass/bootstrap/js/src/scrollspy.js +296 -0
  48. data/_sass/bootstrap/js/src/tab.js +315 -0
  49. data/_sass/bootstrap/js/src/toast.js +225 -0
  50. data/_sass/bootstrap/js/src/tooltip.js +633 -0
  51. data/_sass/bootstrap/js/src/util/backdrop.js +151 -0
  52. data/_sass/bootstrap/js/src/util/component-functions.js +35 -0
  53. data/_sass/bootstrap/js/src/util/config.js +65 -0
  54. data/_sass/bootstrap/js/src/util/focustrap.js +115 -0
  55. data/_sass/bootstrap/js/src/util/index.js +306 -0
  56. data/_sass/bootstrap/js/src/util/sanitizer.js +117 -0
  57. data/_sass/bootstrap/js/src/util/scrollbar.js +114 -0
  58. data/_sass/bootstrap/js/src/util/swipe.js +146 -0
  59. data/_sass/bootstrap/js/src/util/template-factory.js +160 -0
  60. data/_sass/bootstrap/package.json +184 -0
  61. data/_sass/bootstrap/scss/_accordion.scss +158 -0
  62. data/_sass/bootstrap/scss/_alert.scss +68 -0
  63. data/_sass/bootstrap/scss/_badge.scss +38 -0
  64. data/_sass/bootstrap/scss/_breadcrumb.scss +40 -0
  65. data/_sass/bootstrap/scss/_button-group.scss +142 -0
  66. data/_sass/bootstrap/scss/_buttons.scss +216 -0
  67. data/_sass/bootstrap/scss/_card.scss +239 -0
  68. data/_sass/bootstrap/scss/_carousel.scss +236 -0
  69. data/_sass/bootstrap/scss/_close.scss +63 -0
  70. data/_sass/bootstrap/scss/_containers.scss +41 -0
  71. data/_sass/bootstrap/scss/_dropdown.scss +250 -0
  72. data/_sass/bootstrap/scss/_forms.scss +9 -0
  73. data/_sass/bootstrap/scss/_functions.scss +302 -0
  74. data/_sass/bootstrap/scss/_grid.scss +39 -0
  75. data/_sass/bootstrap/scss/_helpers.scss +12 -0
  76. data/_sass/bootstrap/scss/_images.scss +42 -0
  77. data/_sass/bootstrap/scss/_list-group.scss +197 -0
  78. data/_sass/bootstrap/scss/_maps.scss +174 -0
  79. data/_sass/bootstrap/scss/_mixins.scss +42 -0
  80. data/_sass/bootstrap/scss/_modal.scss +236 -0
  81. data/_sass/bootstrap/scss/_nav.scss +197 -0
  82. data/_sass/bootstrap/scss/_navbar.scss +289 -0
  83. data/_sass/bootstrap/scss/_offcanvas.scss +143 -0
  84. data/_sass/bootstrap/scss/_pagination.scss +109 -0
  85. data/_sass/bootstrap/scss/_placeholders.scss +51 -0
  86. data/_sass/bootstrap/scss/_popover.scss +196 -0
  87. data/_sass/bootstrap/scss/_progress.scss +68 -0
  88. data/_sass/bootstrap/scss/_reboot.scss +611 -0
  89. data/_sass/bootstrap/scss/_root.scss +187 -0
  90. data/_sass/bootstrap/scss/_spinners.scss +85 -0
  91. data/_sass/bootstrap/scss/_tables.scss +171 -0
  92. data/_sass/bootstrap/scss/_toasts.scss +73 -0
  93. data/_sass/bootstrap/scss/_tooltip.scss +119 -0
  94. data/_sass/bootstrap/scss/_transitions.scss +27 -0
  95. data/_sass/bootstrap/scss/_type.scss +106 -0
  96. data/_sass/bootstrap/scss/_utilities.scss +806 -0
  97. data/_sass/bootstrap/scss/_variables-dark.scss +87 -0
  98. data/_sass/bootstrap/scss/_variables.scss +1751 -0
  99. data/_sass/bootstrap/scss/bootstrap-grid.scss +62 -0
  100. data/_sass/bootstrap/scss/bootstrap-reboot.scss +10 -0
  101. data/_sass/bootstrap/scss/bootstrap-utilities.scss +19 -0
  102. data/_sass/bootstrap/scss/bootstrap.scss +52 -0
  103. data/_sass/bootstrap/scss/forms/_floating-labels.scss +95 -0
  104. data/_sass/bootstrap/scss/forms/_form-check.scss +189 -0
  105. data/_sass/bootstrap/scss/forms/_form-control.scss +214 -0
  106. data/_sass/bootstrap/scss/forms/_form-range.scss +91 -0
  107. data/_sass/bootstrap/scss/forms/_form-select.scss +80 -0
  108. data/_sass/bootstrap/scss/forms/_form-text.scss +11 -0
  109. data/_sass/bootstrap/scss/forms/_input-group.scss +132 -0
  110. data/_sass/bootstrap/scss/forms/_labels.scss +36 -0
  111. data/_sass/bootstrap/scss/forms/_validation.scss +12 -0
  112. data/_sass/bootstrap/scss/helpers/_clearfix.scss +3 -0
  113. data/_sass/bootstrap/scss/helpers/_color-bg.scss +7 -0
  114. data/_sass/bootstrap/scss/helpers/_colored-links.scss +30 -0
  115. data/_sass/bootstrap/scss/helpers/_focus-ring.scss +5 -0
  116. data/_sass/bootstrap/scss/helpers/_icon-link.scss +25 -0
  117. data/_sass/bootstrap/scss/helpers/_position.scss +36 -0
  118. data/_sass/bootstrap/scss/helpers/_ratio.scss +26 -0
  119. data/_sass/bootstrap/scss/helpers/_stacks.scss +15 -0
  120. data/_sass/bootstrap/scss/helpers/_stretched-link.scss +15 -0
  121. data/_sass/bootstrap/scss/helpers/_text-truncation.scss +7 -0
  122. data/_sass/bootstrap/scss/helpers/_visually-hidden.scss +8 -0
  123. data/_sass/bootstrap/scss/helpers/_vr.scss +8 -0
  124. data/_sass/bootstrap/scss/mixins/_alert.scss +18 -0
  125. data/_sass/bootstrap/scss/mixins/_backdrop.scss +14 -0
  126. data/_sass/bootstrap/scss/mixins/_banner.scss +7 -0
  127. data/_sass/bootstrap/scss/mixins/_border-radius.scss +78 -0
  128. data/_sass/bootstrap/scss/mixins/_box-shadow.scss +18 -0
  129. data/_sass/bootstrap/scss/mixins/_breakpoints.scss +127 -0
  130. data/_sass/bootstrap/scss/mixins/_buttons.scss +70 -0
  131. data/_sass/bootstrap/scss/mixins/_caret.scss +69 -0
  132. data/_sass/bootstrap/scss/mixins/_clearfix.scss +9 -0
  133. data/_sass/bootstrap/scss/mixins/_color-mode.scss +21 -0
  134. data/_sass/bootstrap/scss/mixins/_color-scheme.scss +7 -0
  135. data/_sass/bootstrap/scss/mixins/_container.scss +11 -0
  136. data/_sass/bootstrap/scss/mixins/_deprecate.scss +10 -0
  137. data/_sass/bootstrap/scss/mixins/_forms.scss +163 -0
  138. data/_sass/bootstrap/scss/mixins/_gradients.scss +47 -0
  139. data/_sass/bootstrap/scss/mixins/_grid.scss +151 -0
  140. data/_sass/bootstrap/scss/mixins/_image.scss +16 -0
  141. data/_sass/bootstrap/scss/mixins/_list-group.scss +26 -0
  142. data/_sass/bootstrap/scss/mixins/_lists.scss +7 -0
  143. data/_sass/bootstrap/scss/mixins/_pagination.scss +10 -0
  144. data/_sass/bootstrap/scss/mixins/_reset-text.scss +17 -0
  145. data/_sass/bootstrap/scss/mixins/_resize.scss +6 -0
  146. data/_sass/bootstrap/scss/mixins/_table-variants.scss +24 -0
  147. data/_sass/bootstrap/scss/mixins/_text-truncate.scss +8 -0
  148. data/_sass/bootstrap/scss/mixins/_transition.scss +26 -0
  149. data/_sass/bootstrap/scss/mixins/_utilities.scss +97 -0
  150. data/_sass/bootstrap/scss/mixins/_visually-hidden.scss +33 -0
  151. data/_sass/bootstrap/scss/utilities/_api.scss +47 -0
  152. data/_sass/fonts/_webfonts.scss +15 -0
  153. data/_sass/helpers/_index.scss +143 -0
  154. data/_sass/layout/_animations.scss +63 -0
  155. data/_sass/layout/_core.scss +62 -0
  156. data/_sass/layout/_dark.scss +77 -0
  157. data/_sass/layout/_footer.scss +12 -0
  158. data/_sass/layout/_navbar.scss +392 -0
  159. data/_sass/layout/_page.scss +169 -0
  160. data/_sass/layout/_root.scss +64 -0
  161. data/_sass/marketing/_browser.scss +67 -0
  162. data/_sass/marketing/_core.scss +8 -0
  163. data/_sass/marketing/_filters.scss +0 -0
  164. data/_sass/marketing/_hero.scss +69 -0
  165. data/_sass/marketing/_pricing.scss +111 -0
  166. data/_sass/marketing/_sections.scss +124 -0
  167. data/_sass/marketing/_shape.scss +31 -0
  168. data/_sass/mixins/_functions.scss +96 -0
  169. data/_sass/mixins/_mixins.scss +68 -0
  170. data/_sass/tabler-flags.scss +2 -0
  171. data/_sass/tabler-marketing.scss +13 -0
  172. data/_sass/tabler-payments.scss +2 -0
  173. data/_sass/tabler-props.scss +1 -0
  174. data/_sass/tabler-socials.scss +2 -0
  175. data/_sass/tabler-themes.scss +121 -0
  176. data/_sass/tabler-vendors.scss +16 -0
  177. data/_sass/tabler.scss +2 -0
  178. data/_sass/ui/_accordion.scss +177 -0
  179. data/_sass/ui/_alerts.scss +99 -0
  180. data/_sass/ui/_avatars.scss +145 -0
  181. data/_sass/ui/_badges.scss +113 -0
  182. data/_sass/ui/_breadcrumbs.scss +50 -0
  183. data/_sass/ui/_button-group.scss +16 -0
  184. data/_sass/ui/_buttons.scss +261 -0
  185. data/_sass/ui/_calendars.scss +104 -0
  186. data/_sass/ui/_cards.scss +594 -0
  187. data/_sass/ui/_carousel.scss +68 -0
  188. data/_sass/ui/_charts.scss +61 -0
  189. data/_sass/ui/_chat.scss +38 -0
  190. data/_sass/ui/_chips.scss +0 -0
  191. data/_sass/ui/_close.scss +60 -0
  192. data/_sass/ui/_datagrid.scss +17 -0
  193. data/_sass/ui/_dropdowns.scss +120 -0
  194. data/_sass/ui/_empty.scss +60 -0
  195. data/_sass/ui/_flags.scss +31 -0
  196. data/_sass/ui/_forms.scss +241 -0
  197. data/_sass/ui/_grid.scss +115 -0
  198. data/_sass/ui/_icons.scss +72 -0
  199. data/_sass/ui/_images.scss +19 -0
  200. data/_sass/ui/_legend.scss +12 -0
  201. data/_sass/ui/_lists.scss +124 -0
  202. data/_sass/ui/_loaders.scss +72 -0
  203. data/_sass/ui/_login.scss +3 -0
  204. data/_sass/ui/_markdown.scss +43 -0
  205. data/_sass/ui/_modals.scss +67 -0
  206. data/_sass/ui/_nav.scss +96 -0
  207. data/_sass/ui/_offcanvas.scss +17 -0
  208. data/_sass/ui/_pagination.scss +58 -0
  209. data/_sass/ui/_payments.scss +28 -0
  210. data/_sass/ui/_placeholder.scss +9 -0
  211. data/_sass/ui/_popovers.scss +2 -0
  212. data/_sass/ui/_progress.scss +107 -0
  213. data/_sass/ui/_ribbons.scss +157 -0
  214. data/_sass/ui/_segmented.scss +101 -0
  215. data/_sass/ui/_signature.scss +15 -0
  216. data/_sass/ui/_social.scss +52 -0
  217. data/_sass/ui/_stars.scss +13 -0
  218. data/_sass/ui/_status.scss +163 -0
  219. data/_sass/ui/_steps.scss +156 -0
  220. data/_sass/ui/_switch-icon.scss +211 -0
  221. data/_sass/ui/_tables.scss +177 -0
  222. data/_sass/ui/_tags.scss +57 -0
  223. data/_sass/ui/_timeline.scss +61 -0
  224. data/_sass/ui/_toasts.scss +18 -0
  225. data/_sass/ui/_toolbar.scss +10 -0
  226. data/_sass/ui/_tracking.scss +29 -0
  227. data/_sass/ui/_type.scss +268 -0
  228. data/_sass/ui/forms/_form-check.scss +91 -0
  229. data/_sass/ui/forms/_form-colorinput.scss +54 -0
  230. data/_sass/ui/forms/_form-custom.scss +28 -0
  231. data/_sass/ui/forms/_form-icon.scss +35 -0
  232. data/_sass/ui/forms/_form-imagecheck.scss +105 -0
  233. data/_sass/ui/forms/_form-selectgroup.scss +153 -0
  234. data/_sass/ui/forms/_validation.scss +13 -0
  235. data/_sass/ui/typo/_hr.scss +77 -0
  236. data/_sass/utils/_background.scss +15 -0
  237. data/_sass/utils/_colors.scss +100 -0
  238. data/_sass/utils/_opacity.scss +7 -0
  239. data/_sass/utils/_scroll.scss +47 -0
  240. data/_sass/utils/_shadow.scss +9 -0
  241. data/_sass/utils/_sizing.scss +6 -0
  242. data/_sass/utils/_text.scss +15 -0
  243. data/_sass/vendors/_apexcharts.scss +48 -0
  244. data/_sass/vendors/_coloris.scss +72 -0
  245. data/_sass/vendors/_dropzone.scss +27 -0
  246. data/_sass/vendors/_fslightbox.scss +13 -0
  247. data/_sass/vendors/_jsvectormap.scss +47 -0
  248. data/_sass/vendors/_litepicker.scss +69 -0
  249. data/_sass/vendors/_nouislider.scss +49 -0
  250. data/_sass/vendors/_plyr.scss +3 -0
  251. data/_sass/vendors/_stars-rating.scss +22 -0
  252. data/_sass/vendors/_tinymce.scss +34 -0
  253. data/_sass/vendors/_tom-select.scss +81 -0
  254. data/_sass/vendors/_turbo.scss +3 -0
  255. data/_sass/vendors/_typed.scss +4 -0
  256. data/_sass/vendors/_wysiwyg.scss +34 -0
  257. data/assets/css/main.scss +10 -0
  258. data/assets/js/custom.js +175 -0
  259. data/assets/js/custom.min.js +1 -0
  260. data/assets/js/theme.js +12 -194
  261. data/assets/js/theme.min.js +12 -0
  262. data/insights4you-jekyll-theme.gemspec +93 -0
  263. metadata +386 -27
  264. data/_data/notifications.yml +0 -10
  265. data/_includes/footer.html +0 -48
  266. data/_includes/header-logo.html +0 -91
  267. data/_includes/header-navbar.html +0 -59
  268. data/_includes/header-svg.html +0 -275
  269. data/_layouts/home.html +0 -19
  270. data/_layouts/post.html +0 -19
  271. data/assets/css/theme.min.css +0 -120
@@ -0,0 +1,633 @@
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * Bootstrap tooltip.js
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+
8
+ import * as Popper from '@popperjs/core'
9
+ import BaseComponent from './base-component.js'
10
+ import EventHandler from './dom/event-handler.js'
11
+ import Manipulator from './dom/manipulator.js'
12
+ import {
13
+ defineJQueryPlugin, execute, findShadowRoot, getElement, getUID, isRTL, noop
14
+ } from './util/index.js'
15
+ import { DefaultAllowlist } from './util/sanitizer.js'
16
+ import TemplateFactory from './util/template-factory.js'
17
+
18
+ /**
19
+ * Constants
20
+ */
21
+
22
+ const NAME = 'tooltip'
23
+ const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn'])
24
+
25
+ const CLASS_NAME_FADE = 'fade'
26
+ const CLASS_NAME_MODAL = 'modal'
27
+ const CLASS_NAME_SHOW = 'show'
28
+
29
+ const SELECTOR_TOOLTIP_INNER = '.tooltip-inner'
30
+ const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`
31
+
32
+ const EVENT_MODAL_HIDE = 'hide.bs.modal'
33
+
34
+ const TRIGGER_HOVER = 'hover'
35
+ const TRIGGER_FOCUS = 'focus'
36
+ const TRIGGER_CLICK = 'click'
37
+ const TRIGGER_MANUAL = 'manual'
38
+
39
+ const EVENT_HIDE = 'hide'
40
+ const EVENT_HIDDEN = 'hidden'
41
+ const EVENT_SHOW = 'show'
42
+ const EVENT_SHOWN = 'shown'
43
+ const EVENT_INSERTED = 'inserted'
44
+ const EVENT_CLICK = 'click'
45
+ const EVENT_FOCUSIN = 'focusin'
46
+ const EVENT_FOCUSOUT = 'focusout'
47
+ const EVENT_MOUSEENTER = 'mouseenter'
48
+ const EVENT_MOUSELEAVE = 'mouseleave'
49
+
50
+ const AttachmentMap = {
51
+ AUTO: 'auto',
52
+ TOP: 'top',
53
+ RIGHT: isRTL() ? 'left' : 'right',
54
+ BOTTOM: 'bottom',
55
+ LEFT: isRTL() ? 'right' : 'left'
56
+ }
57
+
58
+ const Default = {
59
+ allowList: DefaultAllowlist,
60
+ animation: true,
61
+ boundary: 'clippingParents',
62
+ container: false,
63
+ customClass: '',
64
+ delay: 0,
65
+ fallbackPlacements: ['top', 'right', 'bottom', 'left'],
66
+ html: false,
67
+ offset: [0, 6],
68
+ placement: 'top',
69
+ popperConfig: null,
70
+ sanitize: true,
71
+ sanitizeFn: null,
72
+ selector: false,
73
+ template: '<div class="tooltip" role="tooltip">' +
74
+ '<div class="tooltip-arrow"></div>' +
75
+ '<div class="tooltip-inner"></div>' +
76
+ '</div>',
77
+ title: '',
78
+ trigger: 'hover focus'
79
+ }
80
+
81
+ const DefaultType = {
82
+ allowList: 'object',
83
+ animation: 'boolean',
84
+ boundary: '(string|element)',
85
+ container: '(string|element|boolean)',
86
+ customClass: '(string|function)',
87
+ delay: '(number|object)',
88
+ fallbackPlacements: 'array',
89
+ html: 'boolean',
90
+ offset: '(array|string|function)',
91
+ placement: '(string|function)',
92
+ popperConfig: '(null|object|function)',
93
+ sanitize: 'boolean',
94
+ sanitizeFn: '(null|function)',
95
+ selector: '(string|boolean)',
96
+ template: 'string',
97
+ title: '(string|element|function)',
98
+ trigger: 'string'
99
+ }
100
+
101
+ /**
102
+ * Class definition
103
+ */
104
+
105
+ class Tooltip extends BaseComponent {
106
+ constructor(element, config) {
107
+ if (typeof Popper === 'undefined') {
108
+ throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)')
109
+ }
110
+
111
+ super(element, config)
112
+
113
+ // Private
114
+ this._isEnabled = true
115
+ this._timeout = 0
116
+ this._isHovered = null
117
+ this._activeTrigger = {}
118
+ this._popper = null
119
+ this._templateFactory = null
120
+ this._newContent = null
121
+
122
+ // Protected
123
+ this.tip = null
124
+
125
+ this._setListeners()
126
+
127
+ if (!this._config.selector) {
128
+ this._fixTitle()
129
+ }
130
+ }
131
+
132
+ // Getters
133
+ static get Default() {
134
+ return Default
135
+ }
136
+
137
+ static get DefaultType() {
138
+ return DefaultType
139
+ }
140
+
141
+ static get NAME() {
142
+ return NAME
143
+ }
144
+
145
+ // Public
146
+ enable() {
147
+ this._isEnabled = true
148
+ }
149
+
150
+ disable() {
151
+ this._isEnabled = false
152
+ }
153
+
154
+ toggleEnabled() {
155
+ this._isEnabled = !this._isEnabled
156
+ }
157
+
158
+ toggle() {
159
+ if (!this._isEnabled) {
160
+ return
161
+ }
162
+
163
+ this._activeTrigger.click = !this._activeTrigger.click
164
+ if (this._isShown()) {
165
+ this._leave()
166
+ return
167
+ }
168
+
169
+ this._enter()
170
+ }
171
+
172
+ dispose() {
173
+ clearTimeout(this._timeout)
174
+
175
+ EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)
176
+
177
+ if (this._element.getAttribute('data-bs-original-title')) {
178
+ this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'))
179
+ }
180
+
181
+ this._disposePopper()
182
+ super.dispose()
183
+ }
184
+
185
+ show() {
186
+ if (this._element.style.display === 'none') {
187
+ throw new Error('Please use show on visible elements')
188
+ }
189
+
190
+ if (!(this._isWithContent() && this._isEnabled)) {
191
+ return
192
+ }
193
+
194
+ const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW))
195
+ const shadowRoot = findShadowRoot(this._element)
196
+ const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element)
197
+
198
+ if (showEvent.defaultPrevented || !isInTheDom) {
199
+ return
200
+ }
201
+
202
+ // TODO: v6 remove this or make it optional
203
+ this._disposePopper()
204
+
205
+ const tip = this._getTipElement()
206
+
207
+ this._element.setAttribute('aria-describedby', tip.getAttribute('id'))
208
+
209
+ const { container } = this._config
210
+
211
+ if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
212
+ container.append(tip)
213
+ EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED))
214
+ }
215
+
216
+ this._popper = this._createPopper(tip)
217
+
218
+ tip.classList.add(CLASS_NAME_SHOW)
219
+
220
+ // If this is a touch-enabled device we add extra
221
+ // empty mouseover listeners to the body's immediate children;
222
+ // only needed because of broken event delegation on iOS
223
+ // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
224
+ if ('ontouchstart' in document.documentElement) {
225
+ for (const element of [].concat(...document.body.children)) {
226
+ EventHandler.on(element, 'mouseover', noop)
227
+ }
228
+ }
229
+
230
+ const complete = () => {
231
+ EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN))
232
+
233
+ if (this._isHovered === false) {
234
+ this._leave()
235
+ }
236
+
237
+ this._isHovered = false
238
+ }
239
+
240
+ this._queueCallback(complete, this.tip, this._isAnimated())
241
+ }
242
+
243
+ hide() {
244
+ if (!this._isShown()) {
245
+ return
246
+ }
247
+
248
+ const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE))
249
+ if (hideEvent.defaultPrevented) {
250
+ return
251
+ }
252
+
253
+ const tip = this._getTipElement()
254
+ tip.classList.remove(CLASS_NAME_SHOW)
255
+
256
+ // If this is a touch-enabled device we remove the extra
257
+ // empty mouseover listeners we added for iOS support
258
+ if ('ontouchstart' in document.documentElement) {
259
+ for (const element of [].concat(...document.body.children)) {
260
+ EventHandler.off(element, 'mouseover', noop)
261
+ }
262
+ }
263
+
264
+ this._activeTrigger[TRIGGER_CLICK] = false
265
+ this._activeTrigger[TRIGGER_FOCUS] = false
266
+ this._activeTrigger[TRIGGER_HOVER] = false
267
+ this._isHovered = null // it is a trick to support manual triggering
268
+
269
+ const complete = () => {
270
+ if (this._isWithActiveTrigger()) {
271
+ return
272
+ }
273
+
274
+ if (!this._isHovered) {
275
+ this._disposePopper()
276
+ }
277
+
278
+ this._element.removeAttribute('aria-describedby')
279
+ EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN))
280
+ }
281
+
282
+ this._queueCallback(complete, this.tip, this._isAnimated())
283
+ }
284
+
285
+ update() {
286
+ if (this._popper) {
287
+ this._popper.update()
288
+ }
289
+ }
290
+
291
+ // Protected
292
+ _isWithContent() {
293
+ return Boolean(this._getTitle())
294
+ }
295
+
296
+ _getTipElement() {
297
+ if (!this.tip) {
298
+ this.tip = this._createTipElement(this._newContent || this._getContentForTemplate())
299
+ }
300
+
301
+ return this.tip
302
+ }
303
+
304
+ _createTipElement(content) {
305
+ const tip = this._getTemplateFactory(content).toHtml()
306
+
307
+ // TODO: remove this check in v6
308
+ if (!tip) {
309
+ return null
310
+ }
311
+
312
+ tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)
313
+ // TODO: v6 the following can be achieved with CSS only
314
+ tip.classList.add(`bs-${this.constructor.NAME}-auto`)
315
+
316
+ const tipId = getUID(this.constructor.NAME).toString()
317
+
318
+ tip.setAttribute('id', tipId)
319
+
320
+ if (this._isAnimated()) {
321
+ tip.classList.add(CLASS_NAME_FADE)
322
+ }
323
+
324
+ return tip
325
+ }
326
+
327
+ setContent(content) {
328
+ this._newContent = content
329
+ if (this._isShown()) {
330
+ this._disposePopper()
331
+ this.show()
332
+ }
333
+ }
334
+
335
+ _getTemplateFactory(content) {
336
+ if (this._templateFactory) {
337
+ this._templateFactory.changeContent(content)
338
+ } else {
339
+ this._templateFactory = new TemplateFactory({
340
+ ...this._config,
341
+ // the `content` var has to be after `this._config`
342
+ // to override config.content in case of popover
343
+ content,
344
+ extraClass: this._resolvePossibleFunction(this._config.customClass)
345
+ })
346
+ }
347
+
348
+ return this._templateFactory
349
+ }
350
+
351
+ _getContentForTemplate() {
352
+ return {
353
+ [SELECTOR_TOOLTIP_INNER]: this._getTitle()
354
+ }
355
+ }
356
+
357
+ _getTitle() {
358
+ return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title')
359
+ }
360
+
361
+ // Private
362
+ _initializeOnDelegatedTarget(event) {
363
+ return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig())
364
+ }
365
+
366
+ _isAnimated() {
367
+ return this._config.animation || (this.tip && this.tip.classList.contains(CLASS_NAME_FADE))
368
+ }
369
+
370
+ _isShown() {
371
+ return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW)
372
+ }
373
+
374
+ _createPopper(tip) {
375
+ const placement = execute(this._config.placement, [this, tip, this._element])
376
+ const attachment = AttachmentMap[placement.toUpperCase()]
377
+ return Popper.createPopper(this._element, tip, this._getPopperConfig(attachment))
378
+ }
379
+
380
+ _getOffset() {
381
+ const { offset } = this._config
382
+
383
+ if (typeof offset === 'string') {
384
+ return offset.split(',').map(value => Number.parseInt(value, 10))
385
+ }
386
+
387
+ if (typeof offset === 'function') {
388
+ return popperData => offset(popperData, this._element)
389
+ }
390
+
391
+ return offset
392
+ }
393
+
394
+ _resolvePossibleFunction(arg) {
395
+ return execute(arg, [this._element])
396
+ }
397
+
398
+ _getPopperConfig(attachment) {
399
+ const defaultBsPopperConfig = {
400
+ placement: attachment,
401
+ modifiers: [
402
+ {
403
+ name: 'flip',
404
+ options: {
405
+ fallbackPlacements: this._config.fallbackPlacements
406
+ }
407
+ },
408
+ {
409
+ name: 'offset',
410
+ options: {
411
+ offset: this._getOffset()
412
+ }
413
+ },
414
+ {
415
+ name: 'preventOverflow',
416
+ options: {
417
+ boundary: this._config.boundary
418
+ }
419
+ },
420
+ {
421
+ name: 'arrow',
422
+ options: {
423
+ element: `.${this.constructor.NAME}-arrow`
424
+ }
425
+ },
426
+ {
427
+ name: 'preSetPlacement',
428
+ enabled: true,
429
+ phase: 'beforeMain',
430
+ fn: data => {
431
+ // Pre-set Popper's placement attribute in order to read the arrow sizes properly.
432
+ // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement
433
+ this._getTipElement().setAttribute('data-popper-placement', data.state.placement)
434
+ }
435
+ }
436
+ ]
437
+ }
438
+
439
+ return {
440
+ ...defaultBsPopperConfig,
441
+ ...execute(this._config.popperConfig, [defaultBsPopperConfig])
442
+ }
443
+ }
444
+
445
+ _setListeners() {
446
+ const triggers = this._config.trigger.split(' ')
447
+
448
+ for (const trigger of triggers) {
449
+ if (trigger === 'click') {
450
+ EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK), this._config.selector, event => {
451
+ const context = this._initializeOnDelegatedTarget(event)
452
+ context.toggle()
453
+ })
454
+ } else if (trigger !== TRIGGER_MANUAL) {
455
+ const eventIn = trigger === TRIGGER_HOVER ?
456
+ this.constructor.eventName(EVENT_MOUSEENTER) :
457
+ this.constructor.eventName(EVENT_FOCUSIN)
458
+ const eventOut = trigger === TRIGGER_HOVER ?
459
+ this.constructor.eventName(EVENT_MOUSELEAVE) :
460
+ this.constructor.eventName(EVENT_FOCUSOUT)
461
+
462
+ EventHandler.on(this._element, eventIn, this._config.selector, event => {
463
+ const context = this._initializeOnDelegatedTarget(event)
464
+ context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true
465
+ context._enter()
466
+ })
467
+ EventHandler.on(this._element, eventOut, this._config.selector, event => {
468
+ const context = this._initializeOnDelegatedTarget(event)
469
+ context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] =
470
+ context._element.contains(event.relatedTarget)
471
+
472
+ context._leave()
473
+ })
474
+ }
475
+ }
476
+
477
+ this._hideModalHandler = () => {
478
+ if (this._element) {
479
+ this.hide()
480
+ }
481
+ }
482
+
483
+ EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)
484
+ }
485
+
486
+ _fixTitle() {
487
+ const title = this._element.getAttribute('title')
488
+
489
+ if (!title) {
490
+ return
491
+ }
492
+
493
+ if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {
494
+ this._element.setAttribute('aria-label', title)
495
+ }
496
+
497
+ this._element.setAttribute('data-bs-original-title', title) // DO NOT USE IT. Is only for backwards compatibility
498
+ this._element.removeAttribute('title')
499
+ }
500
+
501
+ _enter() {
502
+ if (this._isShown() || this._isHovered) {
503
+ this._isHovered = true
504
+ return
505
+ }
506
+
507
+ this._isHovered = true
508
+
509
+ this._setTimeout(() => {
510
+ if (this._isHovered) {
511
+ this.show()
512
+ }
513
+ }, this._config.delay.show)
514
+ }
515
+
516
+ _leave() {
517
+ if (this._isWithActiveTrigger()) {
518
+ return
519
+ }
520
+
521
+ this._isHovered = false
522
+
523
+ this._setTimeout(() => {
524
+ if (!this._isHovered) {
525
+ this.hide()
526
+ }
527
+ }, this._config.delay.hide)
528
+ }
529
+
530
+ _setTimeout(handler, timeout) {
531
+ clearTimeout(this._timeout)
532
+ this._timeout = setTimeout(handler, timeout)
533
+ }
534
+
535
+ _isWithActiveTrigger() {
536
+ return Object.values(this._activeTrigger).includes(true)
537
+ }
538
+
539
+ _getConfig(config) {
540
+ const dataAttributes = Manipulator.getDataAttributes(this._element)
541
+
542
+ for (const dataAttribute of Object.keys(dataAttributes)) {
543
+ if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) {
544
+ delete dataAttributes[dataAttribute]
545
+ }
546
+ }
547
+
548
+ config = {
549
+ ...dataAttributes,
550
+ ...(typeof config === 'object' && config ? config : {})
551
+ }
552
+ config = this._mergeConfigObj(config)
553
+ config = this._configAfterMerge(config)
554
+ this._typeCheckConfig(config)
555
+ return config
556
+ }
557
+
558
+ _configAfterMerge(config) {
559
+ config.container = config.container === false ? document.body : getElement(config.container)
560
+
561
+ if (typeof config.delay === 'number') {
562
+ config.delay = {
563
+ show: config.delay,
564
+ hide: config.delay
565
+ }
566
+ }
567
+
568
+ if (typeof config.title === 'number') {
569
+ config.title = config.title.toString()
570
+ }
571
+
572
+ if (typeof config.content === 'number') {
573
+ config.content = config.content.toString()
574
+ }
575
+
576
+ return config
577
+ }
578
+
579
+ _getDelegateConfig() {
580
+ const config = {}
581
+
582
+ for (const [key, value] of Object.entries(this._config)) {
583
+ if (this.constructor.Default[key] !== value) {
584
+ config[key] = value
585
+ }
586
+ }
587
+
588
+ config.selector = false
589
+ config.trigger = 'manual'
590
+
591
+ // In the future can be replaced with:
592
+ // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])
593
+ // `Object.fromEntries(keysWithDifferentValues)`
594
+ return config
595
+ }
596
+
597
+ _disposePopper() {
598
+ if (this._popper) {
599
+ this._popper.destroy()
600
+ this._popper = null
601
+ }
602
+
603
+ if (this.tip) {
604
+ this.tip.remove()
605
+ this.tip = null
606
+ }
607
+ }
608
+
609
+ // Static
610
+ static jQueryInterface(config) {
611
+ return this.each(function () {
612
+ const data = Tooltip.getOrCreateInstance(this, config)
613
+
614
+ if (typeof config !== 'string') {
615
+ return
616
+ }
617
+
618
+ if (typeof data[config] === 'undefined') {
619
+ throw new TypeError(`No method named "${config}"`)
620
+ }
621
+
622
+ data[config]()
623
+ })
624
+ }
625
+ }
626
+
627
+ /**
628
+ * jQuery
629
+ */
630
+
631
+ defineJQueryPlugin(Tooltip)
632
+
633
+ export default Tooltip