@coreui/coreui 4.0.2

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 (203) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +183 -0
  3. package/dist/css/coreui-grid.css +5004 -0
  4. package/dist/css/coreui-grid.css.map +1 -0
  5. package/dist/css/coreui-grid.min.css +8 -0
  6. package/dist/css/coreui-grid.min.css.map +1 -0
  7. package/dist/css/coreui-grid.rtl.css +5011 -0
  8. package/dist/css/coreui-grid.rtl.css.map +1 -0
  9. package/dist/css/coreui-grid.rtl.min.css +14 -0
  10. package/dist/css/coreui-grid.rtl.min.css.map +1 -0
  11. package/dist/css/coreui-reboot.css +440 -0
  12. package/dist/css/coreui-reboot.css.map +1 -0
  13. package/dist/css/coreui-reboot.min.css +8 -0
  14. package/dist/css/coreui-reboot.min.css.map +1 -0
  15. package/dist/css/coreui-reboot.rtl.css +441 -0
  16. package/dist/css/coreui-reboot.rtl.css.map +1 -0
  17. package/dist/css/coreui-reboot.rtl.min.css +14 -0
  18. package/dist/css/coreui-reboot.rtl.min.css.map +1 -0
  19. package/dist/css/coreui-utilities.css +5030 -0
  20. package/dist/css/coreui-utilities.css.map +1 -0
  21. package/dist/css/coreui-utilities.min.css +8 -0
  22. package/dist/css/coreui-utilities.min.css.map +1 -0
  23. package/dist/css/coreui-utilities.rtl.css +5024 -0
  24. package/dist/css/coreui-utilities.rtl.css.map +1 -0
  25. package/dist/css/coreui-utilities.rtl.min.css +14 -0
  26. package/dist/css/coreui-utilities.rtl.min.css.map +1 -0
  27. package/dist/css/coreui.css +12152 -0
  28. package/dist/css/coreui.css.map +1 -0
  29. package/dist/css/coreui.min.css +8 -0
  30. package/dist/css/coreui.min.css.map +1 -0
  31. package/dist/css/coreui.rtl.css +12041 -0
  32. package/dist/css/coreui.rtl.css.map +1 -0
  33. package/dist/css/coreui.rtl.min.css +14 -0
  34. package/dist/css/coreui.rtl.min.css.map +1 -0
  35. package/dist/js/coreui.bundle.js +7437 -0
  36. package/dist/js/coreui.bundle.js.map +1 -0
  37. package/dist/js/coreui.bundle.min.js +7 -0
  38. package/dist/js/coreui.bundle.min.js.map +1 -0
  39. package/dist/js/coreui.esm.js +5622 -0
  40. package/dist/js/coreui.esm.js.map +1 -0
  41. package/dist/js/coreui.esm.min.js +7 -0
  42. package/dist/js/coreui.esm.min.js.map +1 -0
  43. package/dist/js/coreui.js +5673 -0
  44. package/dist/js/coreui.js.map +1 -0
  45. package/dist/js/coreui.min.js +7 -0
  46. package/dist/js/coreui.min.js.map +1 -0
  47. package/js/dist/alert.js +208 -0
  48. package/js/dist/alert.js.map +1 -0
  49. package/js/dist/base-component.js +181 -0
  50. package/js/dist/base-component.js.map +1 -0
  51. package/js/dist/button.js +142 -0
  52. package/js/dist/button.js.map +1 -0
  53. package/js/dist/carousel.js +724 -0
  54. package/js/dist/carousel.js.map +1 -0
  55. package/js/dist/collapse.js +515 -0
  56. package/js/dist/collapse.js.map +1 -0
  57. package/js/dist/dom/data.js +72 -0
  58. package/js/dist/dom/data.js.map +1 -0
  59. package/js/dist/dom/event-handler.js +319 -0
  60. package/js/dist/dom/event-handler.js.map +1 -0
  61. package/js/dist/dom/manipulator.js +92 -0
  62. package/js/dist/dom/manipulator.js.map +1 -0
  63. package/js/dist/dom/selector-engine.js +89 -0
  64. package/js/dist/dom/selector-engine.js.map +1 -0
  65. package/js/dist/dropdown.js +700 -0
  66. package/js/dist/dropdown.js.map +1 -0
  67. package/js/dist/modal.js +891 -0
  68. package/js/dist/modal.js.map +1 -0
  69. package/js/dist/offcanvas.js +724 -0
  70. package/js/dist/offcanvas.js.map +1 -0
  71. package/js/dist/popover.js +220 -0
  72. package/js/dist/popover.js.map +1 -0
  73. package/js/dist/scrollspy.js +387 -0
  74. package/js/dist/scrollspy.js.map +1 -0
  75. package/js/dist/tab.js +317 -0
  76. package/js/dist/tab.js.map +1 -0
  77. package/js/dist/toast.js +331 -0
  78. package/js/dist/toast.js.map +1 -0
  79. package/js/dist/tooltip.js +997 -0
  80. package/js/dist/tooltip.js.map +1 -0
  81. package/js/src/alert.js +128 -0
  82. package/js/src/base-component.js +78 -0
  83. package/js/src/button.js +89 -0
  84. package/js/src/carousel.js +589 -0
  85. package/js/src/collapse.js +391 -0
  86. package/js/src/dom/data.js +60 -0
  87. package/js/src/dom/event-handler.js +352 -0
  88. package/js/src/dom/manipulator.js +83 -0
  89. package/js/src/dom/selector-engine.js +78 -0
  90. package/js/src/dropdown.js +517 -0
  91. package/js/src/modal.js +451 -0
  92. package/js/src/navigation.js +298 -0
  93. package/js/src/offcanvas.js +277 -0
  94. package/js/src/popover.js +173 -0
  95. package/js/src/scrollspy.js +298 -0
  96. package/js/src/sidebar.js +347 -0
  97. package/js/src/tab.js +227 -0
  98. package/js/src/toast.js +245 -0
  99. package/js/src/tooltip.js +750 -0
  100. package/js/src/util/backdrop.js +129 -0
  101. package/js/src/util/index.js +327 -0
  102. package/js/src/util/sanitizer.js +130 -0
  103. package/js/src/util/scrollbar.js +97 -0
  104. package/package.json +166 -0
  105. package/scss/_accordion.scss +118 -0
  106. package/scss/_alert.scss +52 -0
  107. package/scss/_avatar.scss +49 -0
  108. package/scss/_badge.scss +38 -0
  109. package/scss/_breadcrumb.scss +33 -0
  110. package/scss/_button-group.scss +139 -0
  111. package/scss/_buttons.scss +143 -0
  112. package/scss/_callout.scss +16 -0
  113. package/scss/_card.scss +215 -0
  114. package/scss/_carousel.scss +231 -0
  115. package/scss/_close.scss +40 -0
  116. package/scss/_containers.scss +41 -0
  117. package/scss/_dropdown.scss +227 -0
  118. package/scss/_footer.scss +25 -0
  119. package/scss/_forms.scss +9 -0
  120. package/scss/_functions.scss +356 -0
  121. package/scss/_grid.scss +56 -0
  122. package/scss/_header.scss +170 -0
  123. package/scss/_helpers.scss +7 -0
  124. package/scss/_icon.scss +32 -0
  125. package/scss/_images.scss +42 -0
  126. package/scss/_list-group.scss +169 -0
  127. package/scss/_mixins.scss +50 -0
  128. package/scss/_modal.scss +219 -0
  129. package/scss/_nav.scss +140 -0
  130. package/scss/_navbar.scss +254 -0
  131. package/scss/_offcanvas.scss +79 -0
  132. package/scss/_pagination.scss +64 -0
  133. package/scss/_popover.scss +158 -0
  134. package/scss/_progress.scss +91 -0
  135. package/scss/_reboot.scss +632 -0
  136. package/scss/_root.scss +25 -0
  137. package/scss/_sidebar.scss +3 -0
  138. package/scss/_spinners.scss +69 -0
  139. package/scss/_subheader.scss +72 -0
  140. package/scss/_tables.scss +166 -0
  141. package/scss/_toasts.scss +52 -0
  142. package/scss/_tooltip.scss +115 -0
  143. package/scss/_transitions.scss +21 -0
  144. package/scss/_type.scss +104 -0
  145. package/scss/_utilities.scss +678 -0
  146. package/scss/_variables.scss +1801 -0
  147. package/scss/coreui-grid.rtl.scss +12 -0
  148. package/scss/coreui-grid.scss +67 -0
  149. package/scss/coreui-reboot.rtl.scss +12 -0
  150. package/scss/coreui-reboot.scss +15 -0
  151. package/scss/coreui-utilities.rtl.scss +12 -0
  152. package/scss/coreui-utilities.scss +19 -0
  153. package/scss/coreui.rtl.scss +12 -0
  154. package/scss/coreui.scss +61 -0
  155. package/scss/forms/_floating-labels.scss +63 -0
  156. package/scss/forms/_form-check.scss +188 -0
  157. package/scss/forms/_form-control.scss +219 -0
  158. package/scss/forms/_form-range.scss +91 -0
  159. package/scss/forms/_form-select.scss +70 -0
  160. package/scss/forms/_form-text.scss +11 -0
  161. package/scss/forms/_input-group.scss +121 -0
  162. package/scss/forms/_labels.scss +36 -0
  163. package/scss/forms/_validation.scss +12 -0
  164. package/scss/helpers/_clearfix.scss +3 -0
  165. package/scss/helpers/_colored-links.scss +12 -0
  166. package/scss/helpers/_position.scss +30 -0
  167. package/scss/helpers/_ratio.scss +26 -0
  168. package/scss/helpers/_stretched-link.scss +15 -0
  169. package/scss/helpers/_text-truncation.scss +7 -0
  170. package/scss/helpers/_visually-hidden.scss +8 -0
  171. package/scss/mixins/_alert.scss +15 -0
  172. package/scss/mixins/_avatar.scss +10 -0
  173. package/scss/mixins/_border-radius.scss +78 -0
  174. package/scss/mixins/_box-shadow.scss +18 -0
  175. package/scss/mixins/_breakpoints.scss +140 -0
  176. package/scss/mixins/_buttons.scss +101 -0
  177. package/scss/mixins/_caret.scss +64 -0
  178. package/scss/mixins/_clearfix.scss +9 -0
  179. package/scss/mixins/_color-scheme.scss +7 -0
  180. package/scss/mixins/_container.scss +9 -0
  181. package/scss/mixins/_css-vars.scss +87 -0
  182. package/scss/mixins/_deprecate.scss +10 -0
  183. package/scss/mixins/_forms.scss +144 -0
  184. package/scss/mixins/_gradients.scss +47 -0
  185. package/scss/mixins/_grid.scss +132 -0
  186. package/scss/mixins/_icon.scss +6 -0
  187. package/scss/mixins/_image.scss +16 -0
  188. package/scss/mixins/_list-group.scss +18 -0
  189. package/scss/mixins/_lists.scss +7 -0
  190. package/scss/mixins/_ltr-rtl.scss +60 -0
  191. package/scss/mixins/_pagination.scss +31 -0
  192. package/scss/mixins/_reset-text.scss +17 -0
  193. package/scss/mixins/_resize.scss +6 -0
  194. package/scss/mixins/_table-variants.scss +16 -0
  195. package/scss/mixins/_text-truncate.scss +8 -0
  196. package/scss/mixins/_transition.scss +26 -0
  197. package/scss/mixins/_utilities.scss +104 -0
  198. package/scss/mixins/_visually-hidden.scss +29 -0
  199. package/scss/sidebar/_sidebar-narrow.scss +106 -0
  200. package/scss/sidebar/_sidebar-nav.scss +165 -0
  201. package/scss/sidebar/_sidebar.scss +261 -0
  202. package/scss/utilities/_api.scss +47 -0
  203. package/scss/vendor/_rfs.scss +354 -0
@@ -0,0 +1,129 @@
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * Bootstrap (v5.0.2): util/backdrop.js
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+
8
+ import EventHandler from '../dom/event-handler'
9
+ import { execute, executeAfterTransition, getElement, reflow, typeCheckConfig } from './index'
10
+
11
+ const Default = {
12
+ isVisible: true, // if false, we use the backdrop helper without adding any element to the dom
13
+ isAnimated: false,
14
+ rootElement: 'body', // give the choice to place backdrop under different elements
15
+ clickCallback: null
16
+ }
17
+
18
+ const DefaultType = {
19
+ isVisible: 'boolean',
20
+ isAnimated: 'boolean',
21
+ rootElement: '(element|string)',
22
+ clickCallback: '(function|null)'
23
+ }
24
+ const NAME = 'backdrop'
25
+ const CLASS_NAME_BACKDROP = 'modal-backdrop'
26
+ const CLASS_NAME_FADE = 'fade'
27
+ const CLASS_NAME_SHOW = 'show'
28
+
29
+ const EVENT_MOUSEDOWN = `mousedown.coreui.${NAME}`
30
+
31
+ class Backdrop {
32
+ constructor(config) {
33
+ this._config = this._getConfig(config)
34
+ this._isAppended = false
35
+ this._element = null
36
+ }
37
+
38
+ show(callback) {
39
+ if (!this._config.isVisible) {
40
+ execute(callback)
41
+ return
42
+ }
43
+
44
+ this._append()
45
+
46
+ if (this._config.isAnimated) {
47
+ reflow(this._getElement())
48
+ }
49
+
50
+ this._getElement().classList.add(CLASS_NAME_SHOW)
51
+
52
+ this._emulateAnimation(() => {
53
+ execute(callback)
54
+ })
55
+ }
56
+
57
+ hide(callback) {
58
+ if (!this._config.isVisible) {
59
+ execute(callback)
60
+ return
61
+ }
62
+
63
+ this._getElement().classList.remove(CLASS_NAME_SHOW)
64
+
65
+ this._emulateAnimation(() => {
66
+ this.dispose()
67
+ execute(callback)
68
+ })
69
+ }
70
+
71
+ // Private
72
+
73
+ _getElement() {
74
+ if (!this._element) {
75
+ const backdrop = document.createElement('div')
76
+ backdrop.className = CLASS_NAME_BACKDROP
77
+ if (this._config.isAnimated) {
78
+ backdrop.classList.add(CLASS_NAME_FADE)
79
+ }
80
+
81
+ this._element = backdrop
82
+ }
83
+
84
+ return this._element
85
+ }
86
+
87
+ _getConfig(config) {
88
+ config = {
89
+ ...Default,
90
+ ...(typeof config === 'object' ? config : {})
91
+ }
92
+
93
+ // use getElement() with the default "body" to get a fresh Element on each instantiation
94
+ config.rootElement = getElement(config.rootElement)
95
+ typeCheckConfig(NAME, config, DefaultType)
96
+ return config
97
+ }
98
+
99
+ _append() {
100
+ if (this._isAppended) {
101
+ return
102
+ }
103
+
104
+ this._config.rootElement.appendChild(this._getElement())
105
+
106
+ EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {
107
+ execute(this._config.clickCallback)
108
+ })
109
+
110
+ this._isAppended = true
111
+ }
112
+
113
+ dispose() {
114
+ if (!this._isAppended) {
115
+ return
116
+ }
117
+
118
+ EventHandler.off(this._element, EVENT_MOUSEDOWN)
119
+
120
+ this._element.remove()
121
+ this._isAppended = false
122
+ }
123
+
124
+ _emulateAnimation(callback) {
125
+ executeAfterTransition(callback, this._getElement(), this._config.isAnimated)
126
+ }
127
+ }
128
+
129
+ export default Backdrop
@@ -0,0 +1,327 @@
1
+ import SelectorEngine from '../dom/selector-engine'
2
+
3
+ /**
4
+ * --------------------------------------------------------------------------
5
+ * CoreUI (v4.0.2): alert.js
6
+ * Licensed under MIT (https://coreui.io/license)
7
+ *
8
+ * This component is a modified version of the Bootstrap's util/index.js
9
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
10
+ * --------------------------------------------------------------------------
11
+ */
12
+
13
+ const MAX_UID = 1000000
14
+ const MILLISECONDS_MULTIPLIER = 1000
15
+ const TRANSITION_END = 'transitionend'
16
+
17
+ // Shoutout AngusCroll (https://goo.gl/pxwQGp)
18
+ const toType = obj => {
19
+ if (obj === null || obj === undefined) {
20
+ return `${obj}`
21
+ }
22
+
23
+ return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase()
24
+ }
25
+
26
+ /**
27
+ * --------------------------------------------------------------------------
28
+ * Public Util Api
29
+ * --------------------------------------------------------------------------
30
+ */
31
+
32
+ const getUID = prefix => {
33
+ do {
34
+ prefix += Math.floor(Math.random() * MAX_UID)
35
+ } while (document.getElementById(prefix))
36
+
37
+ return prefix
38
+ }
39
+
40
+ const getSelector = element => {
41
+ let selector = element.getAttribute('data-coreui-target')
42
+
43
+ if (!selector || selector === '#') {
44
+ let hrefAttr = element.getAttribute('href')
45
+
46
+ // The only valid content that could double as a selector are IDs or classes,
47
+ // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
48
+ // `document.querySelector` will rightfully complain it is invalid.
49
+ // See https://github.com/twbs/bootstrap/issues/32273
50
+ if (!hrefAttr || (!hrefAttr.includes('#') && !hrefAttr.startsWith('.'))) {
51
+ return null
52
+ }
53
+
54
+ // Just in case some CMS puts out a full URL with the anchor appended
55
+ if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
56
+ hrefAttr = `#${hrefAttr.split('#')[1]}`
57
+ }
58
+
59
+ selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null
60
+ }
61
+
62
+ return selector
63
+ }
64
+
65
+ const getSelectorFromElement = element => {
66
+ const selector = getSelector(element)
67
+
68
+ if (selector) {
69
+ return document.querySelector(selector) ? selector : null
70
+ }
71
+
72
+ return null
73
+ }
74
+
75
+ const getElementFromSelector = element => {
76
+ const selector = getSelector(element)
77
+
78
+ return selector ? document.querySelector(selector) : null
79
+ }
80
+
81
+ const getTransitionDurationFromElement = element => {
82
+ if (!element) {
83
+ return 0
84
+ }
85
+
86
+ // Get transition-duration of the element
87
+ let { transitionDuration, transitionDelay } = window.getComputedStyle(element)
88
+
89
+ const floatTransitionDuration = Number.parseFloat(transitionDuration)
90
+ const floatTransitionDelay = Number.parseFloat(transitionDelay)
91
+
92
+ // Return 0 if element or transition duration is not found
93
+ if (!floatTransitionDuration && !floatTransitionDelay) {
94
+ return 0
95
+ }
96
+
97
+ // If multiple durations are defined, take the first
98
+ transitionDuration = transitionDuration.split(',')[0]
99
+ transitionDelay = transitionDelay.split(',')[0]
100
+
101
+ return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER
102
+ }
103
+
104
+ const triggerTransitionEnd = element => {
105
+ element.dispatchEvent(new Event(TRANSITION_END))
106
+ }
107
+
108
+ const isElement = obj => {
109
+ if (!obj || typeof obj !== 'object') {
110
+ return false
111
+ }
112
+
113
+ if (typeof obj.jquery !== 'undefined') {
114
+ obj = obj[0]
115
+ }
116
+
117
+ return typeof obj.nodeType !== 'undefined'
118
+ }
119
+
120
+ const getElement = obj => {
121
+ if (isElement(obj)) { // it's a jQuery object or a node element
122
+ return obj.jquery ? obj[0] : obj
123
+ }
124
+
125
+ if (typeof obj === 'string' && obj.length > 0) {
126
+ return SelectorEngine.findOne(obj)
127
+ }
128
+
129
+ return null
130
+ }
131
+
132
+ const typeCheckConfig = (componentName, config, configTypes) => {
133
+ Object.keys(configTypes).forEach(property => {
134
+ const expectedTypes = configTypes[property]
135
+ const value = config[property]
136
+ const valueType = value && isElement(value) ? 'element' : toType(value)
137
+
138
+ if (!new RegExp(expectedTypes).test(valueType)) {
139
+ throw new TypeError(
140
+ `${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`
141
+ )
142
+ }
143
+ })
144
+ }
145
+
146
+ const isVisible = element => {
147
+ if (!isElement(element) || element.getClientRects().length === 0) {
148
+ return false
149
+ }
150
+
151
+ return getComputedStyle(element).getPropertyValue('visibility') === 'visible'
152
+ }
153
+
154
+ const isDisabled = element => {
155
+ if (!element || element.nodeType !== Node.ELEMENT_NODE) {
156
+ return true
157
+ }
158
+
159
+ if (element.classList.contains('disabled')) {
160
+ return true
161
+ }
162
+
163
+ if (typeof element.disabled !== 'undefined') {
164
+ return element.disabled
165
+ }
166
+
167
+ return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'
168
+ }
169
+
170
+ const findShadowRoot = element => {
171
+ if (!document.documentElement.attachShadow) {
172
+ return null
173
+ }
174
+
175
+ // Can find the shadow root otherwise it'll return the document
176
+ if (typeof element.getRootNode === 'function') {
177
+ const root = element.getRootNode()
178
+ return root instanceof ShadowRoot ? root : null
179
+ }
180
+
181
+ if (element instanceof ShadowRoot) {
182
+ return element
183
+ }
184
+
185
+ // when we don't find a shadow root
186
+ if (!element.parentNode) {
187
+ return null
188
+ }
189
+
190
+ return findShadowRoot(element.parentNode)
191
+ }
192
+
193
+ const noop = () => {}
194
+
195
+ const reflow = element => element.offsetHeight
196
+
197
+ const getjQuery = () => {
198
+ const { jQuery } = window
199
+
200
+ if (jQuery && !document.body.hasAttribute('data-coreui-no-jquery')) {
201
+ return jQuery
202
+ }
203
+
204
+ return null
205
+ }
206
+
207
+ const DOMContentLoadedCallbacks = []
208
+
209
+ const onDOMContentLoaded = callback => {
210
+ if (document.readyState === 'loading') {
211
+ // add listener on the first call when the document is in loading state
212
+ if (!DOMContentLoadedCallbacks.length) {
213
+ document.addEventListener('DOMContentLoaded', () => {
214
+ DOMContentLoadedCallbacks.forEach(callback => callback())
215
+ })
216
+ }
217
+
218
+ DOMContentLoadedCallbacks.push(callback)
219
+ } else {
220
+ callback()
221
+ }
222
+ }
223
+
224
+ const isRTL = () => document.documentElement.dir === 'rtl'
225
+
226
+ const defineJQueryPlugin = plugin => {
227
+ onDOMContentLoaded(() => {
228
+ const $ = getjQuery()
229
+ /* istanbul ignore if */
230
+ if ($) {
231
+ const name = plugin.NAME
232
+ const JQUERY_NO_CONFLICT = $.fn[name]
233
+ $.fn[name] = plugin.jQueryInterface
234
+ $.fn[name].Constructor = plugin
235
+ $.fn[name].noConflict = () => {
236
+ $.fn[name] = JQUERY_NO_CONFLICT
237
+ return plugin.jQueryInterface
238
+ }
239
+ }
240
+ })
241
+ }
242
+
243
+ const execute = callback => {
244
+ if (typeof callback === 'function') {
245
+ callback()
246
+ }
247
+ }
248
+
249
+ const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {
250
+ if (!waitForTransition) {
251
+ execute(callback)
252
+ return
253
+ }
254
+
255
+ const durationPadding = 5
256
+ const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding
257
+
258
+ let called = false
259
+
260
+ const handler = ({ target }) => {
261
+ if (target !== transitionElement) {
262
+ return
263
+ }
264
+
265
+ called = true
266
+ transitionElement.removeEventListener(TRANSITION_END, handler)
267
+ execute(callback)
268
+ }
269
+
270
+ transitionElement.addEventListener(TRANSITION_END, handler)
271
+ setTimeout(() => {
272
+ if (!called) {
273
+ triggerTransitionEnd(transitionElement)
274
+ }
275
+ }, emulatedDuration)
276
+ }
277
+
278
+ /**
279
+ * Return the previous/next element of a list.
280
+ *
281
+ * @param {array} list The list of elements
282
+ * @param activeElement The active element
283
+ * @param shouldGetNext Choose to get next or previous element
284
+ * @param isCycleAllowed
285
+ * @return {Element|elem} The proper element
286
+ */
287
+ const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {
288
+ let index = list.indexOf(activeElement)
289
+
290
+ // if the element does not exist in the list return an element depending on the direction and if cycle is allowed
291
+ if (index === -1) {
292
+ return list[!shouldGetNext && isCycleAllowed ? list.length - 1 : 0]
293
+ }
294
+
295
+ const listLength = list.length
296
+
297
+ index += shouldGetNext ? 1 : -1
298
+
299
+ if (isCycleAllowed) {
300
+ index = (index + listLength) % listLength
301
+ }
302
+
303
+ return list[Math.max(0, Math.min(index, listLength - 1))]
304
+ }
305
+
306
+ export {
307
+ getElement,
308
+ getUID,
309
+ getSelectorFromElement,
310
+ getElementFromSelector,
311
+ getTransitionDurationFromElement,
312
+ triggerTransitionEnd,
313
+ isElement,
314
+ typeCheckConfig,
315
+ isVisible,
316
+ isDisabled,
317
+ findShadowRoot,
318
+ noop,
319
+ getNextActiveElement,
320
+ reflow,
321
+ getjQuery,
322
+ onDOMContentLoaded,
323
+ isRTL,
324
+ defineJQueryPlugin,
325
+ execute,
326
+ executeAfterTransition
327
+ }