offcanvas.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. /*!
  2. * Bootstrap offcanvas.js v5.0.2 (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('./dom/selector-engine.js'), require('./dom/manipulator.js'), require('./dom/event-handler.js'), require('./base-component.js')) :
  8. typeof define === 'function' && define.amd ? define(['./dom/selector-engine', './dom/manipulator', './dom/event-handler', './base-component'], factory) :
  9. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Offcanvas = factory(global.SelectorEngine, global.Manipulator, global.EventHandler, global.Base));
  10. }(this, (function (SelectorEngine, Manipulator, EventHandler, BaseComponent) { 'use strict';
  11. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  12. var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
  13. var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
  14. var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
  15. var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
  16. const MILLISECONDS_MULTIPLIER = 1000;
  17. const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
  18. const toType = obj => {
  19. if (obj === null || obj === undefined) {
  20. return `${obj}`;
  21. }
  22. return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  23. };
  24. const getSelector = element => {
  25. let selector = element.getAttribute('data-bs-target');
  26. if (!selector || selector === '#') {
  27. let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,
  28. // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
  29. // `document.querySelector` will rightfully complain it is invalid.
  30. // See https://github.com/twbs/bootstrap/issues/32273
  31. if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) {
  32. return null;
  33. } // Just in case some CMS puts out a full URL with the anchor appended
  34. if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
  35. hrefAttr = `#${hrefAttr.split('#')[1]}`;
  36. }
  37. selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
  38. }
  39. return selector;
  40. };
  41. const getElementFromSelector = element => {
  42. const selector = getSelector(element);
  43. return selector ? document.querySelector(selector) : null;
  44. };
  45. const getTransitionDurationFromElement = element => {
  46. if (!element) {
  47. return 0;
  48. } // Get transition-duration of the element
  49. let {
  50. transitionDuration,
  51. transitionDelay
  52. } = window.getComputedStyle(element);
  53. const floatTransitionDuration = Number.parseFloat(transitionDuration);
  54. const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
  55. if (!floatTransitionDuration && !floatTransitionDelay) {
  56. return 0;
  57. } // If multiple durations are defined, take the first
  58. transitionDuration = transitionDuration.split(',')[0];
  59. transitionDelay = transitionDelay.split(',')[0];
  60. return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
  61. };
  62. const triggerTransitionEnd = element => {
  63. element.dispatchEvent(new Event(TRANSITION_END));
  64. };
  65. const isElement = obj => {
  66. if (!obj || typeof obj !== 'object') {
  67. return false;
  68. }
  69. if (typeof obj.jquery !== 'undefined') {
  70. obj = obj[0];
  71. }
  72. return typeof obj.nodeType !== 'undefined';
  73. };
  74. const getElement = obj => {
  75. if (isElement(obj)) {
  76. // it's a jQuery object or a node element
  77. return obj.jquery ? obj[0] : obj;
  78. }
  79. if (typeof obj === 'string' && obj.length > 0) {
  80. return SelectorEngine__default['default'].findOne(obj);
  81. }
  82. return null;
  83. };
  84. const typeCheckConfig = (componentName, config, configTypes) => {
  85. Object.keys(configTypes).forEach(property => {
  86. const expectedTypes = configTypes[property];
  87. const value = config[property];
  88. const valueType = value && isElement(value) ? 'element' : toType(value);
  89. if (!new RegExp(expectedTypes).test(valueType)) {
  90. throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
  91. }
  92. });
  93. };
  94. const isVisible = element => {
  95. if (!isElement(element) || element.getClientRects().length === 0) {
  96. return false;
  97. }
  98. return getComputedStyle(element).getPropertyValue('visibility') === 'visible';
  99. };
  100. const isDisabled = element => {
  101. if (!element || element.nodeType !== Node.ELEMENT_NODE) {
  102. return true;
  103. }
  104. if (element.classList.contains('disabled')) {
  105. return true;
  106. }
  107. if (typeof element.disabled !== 'undefined') {
  108. return element.disabled;
  109. }
  110. return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';
  111. };
  112. const reflow = element => element.offsetHeight;
  113. const getjQuery = () => {
  114. const {
  115. jQuery
  116. } = window;
  117. if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
  118. return jQuery;
  119. }
  120. return null;
  121. };
  122. const DOMContentLoadedCallbacks = [];
  123. const onDOMContentLoaded = callback => {
  124. if (document.readyState === 'loading') {
  125. // add listener on the first call when the document is in loading state
  126. if (!DOMContentLoadedCallbacks.length) {
  127. document.addEventListener('DOMContentLoaded', () => {
  128. DOMContentLoadedCallbacks.forEach(callback => callback());
  129. });
  130. }
  131. DOMContentLoadedCallbacks.push(callback);
  132. } else {
  133. callback();
  134. }
  135. };
  136. const defineJQueryPlugin = plugin => {
  137. onDOMContentLoaded(() => {
  138. const $ = getjQuery();
  139. /* istanbul ignore if */
  140. if ($) {
  141. const name = plugin.NAME;
  142. const JQUERY_NO_CONFLICT = $.fn[name];
  143. $.fn[name] = plugin.jQueryInterface;
  144. $.fn[name].Constructor = plugin;
  145. $.fn[name].noConflict = () => {
  146. $.fn[name] = JQUERY_NO_CONFLICT;
  147. return plugin.jQueryInterface;
  148. };
  149. }
  150. });
  151. };
  152. const execute = callback => {
  153. if (typeof callback === 'function') {
  154. callback();
  155. }
  156. };
  157. const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {
  158. if (!waitForTransition) {
  159. execute(callback);
  160. return;
  161. }
  162. const durationPadding = 5;
  163. const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;
  164. let called = false;
  165. const handler = ({
  166. target
  167. }) => {
  168. if (target !== transitionElement) {
  169. return;
  170. }
  171. called = true;
  172. transitionElement.removeEventListener(TRANSITION_END, handler);
  173. execute(callback);
  174. };
  175. transitionElement.addEventListener(TRANSITION_END, handler);
  176. setTimeout(() => {
  177. if (!called) {
  178. triggerTransitionEnd(transitionElement);
  179. }
  180. }, emulatedDuration);
  181. };
  182. /**
  183. * --------------------------------------------------------------------------
  184. * Bootstrap (v5.0.2): util/scrollBar.js
  185. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  186. * --------------------------------------------------------------------------
  187. */
  188. const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
  189. const SELECTOR_STICKY_CONTENT = '.sticky-top';
  190. class ScrollBarHelper {
  191. constructor() {
  192. this._element = document.body;
  193. }
  194. getWidth() {
  195. // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
  196. const documentWidth = document.documentElement.clientWidth;
  197. return Math.abs(window.innerWidth - documentWidth);
  198. }
  199. hide() {
  200. const width = this.getWidth();
  201. this._disableOverFlow(); // give padding to element to balance the hidden scrollbar width
  202. this._setElementAttributes(this._element, 'paddingRight', calculatedValue => calculatedValue + width); // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
  203. this._setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width);
  204. this._setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width);
  205. }
  206. _disableOverFlow() {
  207. this._saveInitialAttribute(this._element, 'overflow');
  208. this._element.style.overflow = 'hidden';
  209. }
  210. _setElementAttributes(selector, styleProp, callback) {
  211. const scrollbarWidth = this.getWidth();
  212. const manipulationCallBack = element => {
  213. if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
  214. return;
  215. }
  216. this._saveInitialAttribute(element, styleProp);
  217. const calculatedValue = window.getComputedStyle(element)[styleProp];
  218. element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`;
  219. };
  220. this._applyManipulationCallback(selector, manipulationCallBack);
  221. }
  222. reset() {
  223. this._resetElementAttributes(this._element, 'overflow');
  224. this._resetElementAttributes(this._element, 'paddingRight');
  225. this._resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight');
  226. this._resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight');
  227. }
  228. _saveInitialAttribute(element, styleProp) {
  229. const actualValue = element.style[styleProp];
  230. if (actualValue) {
  231. Manipulator__default['default'].setDataAttribute(element, styleProp, actualValue);
  232. }
  233. }
  234. _resetElementAttributes(selector, styleProp) {
  235. const manipulationCallBack = element => {
  236. const value = Manipulator__default['default'].getDataAttribute(element, styleProp);
  237. if (typeof value === 'undefined') {
  238. element.style.removeProperty(styleProp);
  239. } else {
  240. Manipulator__default['default'].removeDataAttribute(element, styleProp);
  241. element.style[styleProp] = value;
  242. }
  243. };
  244. this._applyManipulationCallback(selector, manipulationCallBack);
  245. }
  246. _applyManipulationCallback(selector, callBack) {
  247. if (isElement(selector)) {
  248. callBack(selector);
  249. } else {
  250. SelectorEngine__default['default'].find(selector, this._element).forEach(callBack);
  251. }
  252. }
  253. isOverflowing() {
  254. return this.getWidth() > 0;
  255. }
  256. }
  257. /**
  258. * --------------------------------------------------------------------------
  259. * Bootstrap (v5.0.2): util/backdrop.js
  260. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  261. * --------------------------------------------------------------------------
  262. */
  263. const Default$1 = {
  264. isVisible: true,
  265. // if false, we use the backdrop helper without adding any element to the dom
  266. isAnimated: false,
  267. rootElement: 'body',
  268. // give the choice to place backdrop under different elements
  269. clickCallback: null
  270. };
  271. const DefaultType$1 = {
  272. isVisible: 'boolean',
  273. isAnimated: 'boolean',
  274. rootElement: '(element|string)',
  275. clickCallback: '(function|null)'
  276. };
  277. const NAME$1 = 'backdrop';
  278. const CLASS_NAME_BACKDROP = 'modal-backdrop';
  279. const CLASS_NAME_FADE = 'fade';
  280. const CLASS_NAME_SHOW$1 = 'show';
  281. const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$1}`;
  282. class Backdrop {
  283. constructor(config) {
  284. this._config = this._getConfig(config);
  285. this._isAppended = false;
  286. this._element = null;
  287. }
  288. show(callback) {
  289. if (!this._config.isVisible) {
  290. execute(callback);
  291. return;
  292. }
  293. this._append();
  294. if (this._config.isAnimated) {
  295. reflow(this._getElement());
  296. }
  297. this._getElement().classList.add(CLASS_NAME_SHOW$1);
  298. this._emulateAnimation(() => {
  299. execute(callback);
  300. });
  301. }
  302. hide(callback) {
  303. if (!this._config.isVisible) {
  304. execute(callback);
  305. return;
  306. }
  307. this._getElement().classList.remove(CLASS_NAME_SHOW$1);
  308. this._emulateAnimation(() => {
  309. this.dispose();
  310. execute(callback);
  311. });
  312. } // Private
  313. _getElement() {
  314. if (!this._element) {
  315. const backdrop = document.createElement('div');
  316. backdrop.className = CLASS_NAME_BACKDROP;
  317. if (this._config.isAnimated) {
  318. backdrop.classList.add(CLASS_NAME_FADE);
  319. }
  320. this._element = backdrop;
  321. }
  322. return this._element;
  323. }
  324. _getConfig(config) {
  325. config = { ...Default$1,
  326. ...(typeof config === 'object' ? config : {})
  327. }; // use getElement() with the default "body" to get a fresh Element on each instantiation
  328. config.rootElement = getElement(config.rootElement);
  329. typeCheckConfig(NAME$1, config, DefaultType$1);
  330. return config;
  331. }
  332. _append() {
  333. if (this._isAppended) {
  334. return;
  335. }
  336. this._config.rootElement.appendChild(this._getElement());
  337. EventHandler__default['default'].on(this._getElement(), EVENT_MOUSEDOWN, () => {
  338. execute(this._config.clickCallback);
  339. });
  340. this._isAppended = true;
  341. }
  342. dispose() {
  343. if (!this._isAppended) {
  344. return;
  345. }
  346. EventHandler__default['default'].off(this._element, EVENT_MOUSEDOWN);
  347. this._element.remove();
  348. this._isAppended = false;
  349. }
  350. _emulateAnimation(callback) {
  351. executeAfterTransition(callback, this._getElement(), this._config.isAnimated);
  352. }
  353. }
  354. /**
  355. * --------------------------------------------------------------------------
  356. * Bootstrap (v5.0.2): offcanvas.js
  357. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  358. * --------------------------------------------------------------------------
  359. */
  360. /**
  361. * ------------------------------------------------------------------------
  362. * Constants
  363. * ------------------------------------------------------------------------
  364. */
  365. const NAME = 'offcanvas';
  366. const DATA_KEY = 'bs.offcanvas';
  367. const EVENT_KEY = `.${DATA_KEY}`;
  368. const DATA_API_KEY = '.data-api';
  369. const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`;
  370. const ESCAPE_KEY = 'Escape';
  371. const Default = {
  372. backdrop: true,
  373. keyboard: true,
  374. scroll: false
  375. };
  376. const DefaultType = {
  377. backdrop: 'boolean',
  378. keyboard: 'boolean',
  379. scroll: 'boolean'
  380. };
  381. const CLASS_NAME_SHOW = 'show';
  382. const OPEN_SELECTOR = '.offcanvas.show';
  383. const EVENT_SHOW = `show${EVENT_KEY}`;
  384. const EVENT_SHOWN = `shown${EVENT_KEY}`;
  385. const EVENT_HIDE = `hide${EVENT_KEY}`;
  386. const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
  387. const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
  388. const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
  389. const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
  390. const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`;
  391. const SELECTOR_DATA_DISMISS = '[data-bs-dismiss="offcanvas"]';
  392. const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="offcanvas"]';
  393. /**
  394. * ------------------------------------------------------------------------
  395. * Class Definition
  396. * ------------------------------------------------------------------------
  397. */
  398. class Offcanvas extends BaseComponent__default['default'] {
  399. constructor(element, config) {
  400. super(element);
  401. this._config = this._getConfig(config);
  402. this._isShown = false;
  403. this._backdrop = this._initializeBackDrop();
  404. this._addEventListeners();
  405. } // Getters
  406. static get NAME() {
  407. return NAME;
  408. }
  409. static get Default() {
  410. return Default;
  411. } // Public
  412. toggle(relatedTarget) {
  413. return this._isShown ? this.hide() : this.show(relatedTarget);
  414. }
  415. show(relatedTarget) {
  416. if (this._isShown) {
  417. return;
  418. }
  419. const showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW, {
  420. relatedTarget
  421. });
  422. if (showEvent.defaultPrevented) {
  423. return;
  424. }
  425. this._isShown = true;
  426. this._element.style.visibility = 'visible';
  427. this._backdrop.show();
  428. if (!this._config.scroll) {
  429. new ScrollBarHelper().hide();
  430. this._enforceFocusOnElement(this._element);
  431. }
  432. this._element.removeAttribute('aria-hidden');
  433. this._element.setAttribute('aria-modal', true);
  434. this._element.setAttribute('role', 'dialog');
  435. this._element.classList.add(CLASS_NAME_SHOW);
  436. const completeCallBack = () => {
  437. EventHandler__default['default'].trigger(this._element, EVENT_SHOWN, {
  438. relatedTarget
  439. });
  440. };
  441. this._queueCallback(completeCallBack, this._element, true);
  442. }
  443. hide() {
  444. if (!this._isShown) {
  445. return;
  446. }
  447. const hideEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE);
  448. if (hideEvent.defaultPrevented) {
  449. return;
  450. }
  451. EventHandler__default['default'].off(document, EVENT_FOCUSIN);
  452. this._element.blur();
  453. this._isShown = false;
  454. this._element.classList.remove(CLASS_NAME_SHOW);
  455. this._backdrop.hide();
  456. const completeCallback = () => {
  457. this._element.setAttribute('aria-hidden', true);
  458. this._element.removeAttribute('aria-modal');
  459. this._element.removeAttribute('role');
  460. this._element.style.visibility = 'hidden';
  461. if (!this._config.scroll) {
  462. new ScrollBarHelper().reset();
  463. }
  464. EventHandler__default['default'].trigger(this._element, EVENT_HIDDEN);
  465. };
  466. this._queueCallback(completeCallback, this._element, true);
  467. }
  468. dispose() {
  469. this._backdrop.dispose();
  470. super.dispose();
  471. EventHandler__default['default'].off(document, EVENT_FOCUSIN);
  472. } // Private
  473. _getConfig(config) {
  474. config = { ...Default,
  475. ...Manipulator__default['default'].getDataAttributes(this._element),
  476. ...(typeof config === 'object' ? config : {})
  477. };
  478. typeCheckConfig(NAME, config, DefaultType);
  479. return config;
  480. }
  481. _initializeBackDrop() {
  482. return new Backdrop({
  483. isVisible: this._config.backdrop,
  484. isAnimated: true,
  485. rootElement: this._element.parentNode,
  486. clickCallback: () => this.hide()
  487. });
  488. }
  489. _enforceFocusOnElement(element) {
  490. EventHandler__default['default'].off(document, EVENT_FOCUSIN); // guard against infinite focus loop
  491. EventHandler__default['default'].on(document, EVENT_FOCUSIN, event => {
  492. if (document !== event.target && element !== event.target && !element.contains(event.target)) {
  493. element.focus();
  494. }
  495. });
  496. element.focus();
  497. }
  498. _addEventListeners() {
  499. EventHandler__default['default'].on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
  500. EventHandler__default['default'].on(this._element, EVENT_KEYDOWN_DISMISS, event => {
  501. if (this._config.keyboard && event.key === ESCAPE_KEY) {
  502. this.hide();
  503. }
  504. });
  505. } // Static
  506. static jQueryInterface(config) {
  507. return this.each(function () {
  508. const data = Offcanvas.getOrCreateInstance(this, config);
  509. if (typeof config !== 'string') {
  510. return;
  511. }
  512. if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
  513. throw new TypeError(`No method named "${config}"`);
  514. }
  515. data[config](this);
  516. });
  517. }
  518. }
  519. /**
  520. * ------------------------------------------------------------------------
  521. * Data Api implementation
  522. * ------------------------------------------------------------------------
  523. */
  524. EventHandler__default['default'].on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
  525. const target = getElementFromSelector(this);
  526. if (['A', 'AREA'].includes(this.tagName)) {
  527. event.preventDefault();
  528. }
  529. if (isDisabled(this)) {
  530. return;
  531. }
  532. EventHandler__default['default'].one(target, EVENT_HIDDEN, () => {
  533. // focus on trigger when it is closed
  534. if (isVisible(this)) {
  535. this.focus();
  536. }
  537. }); // avoid conflict when clicking a toggler of an offcanvas, while another is open
  538. const allReadyOpen = SelectorEngine__default['default'].findOne(OPEN_SELECTOR);
  539. if (allReadyOpen && allReadyOpen !== target) {
  540. Offcanvas.getInstance(allReadyOpen).hide();
  541. }
  542. const data = Offcanvas.getOrCreateInstance(target);
  543. data.toggle(this);
  544. });
  545. EventHandler__default['default'].on(window, EVENT_LOAD_DATA_API, () => SelectorEngine__default['default'].find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show()));
  546. /**
  547. * ------------------------------------------------------------------------
  548. * jQuery
  549. * ------------------------------------------------------------------------
  550. */
  551. defineJQueryPlugin(Offcanvas);
  552. return Offcanvas;
  553. })));
  554. //# sourceMappingURL=offcanvas.js.map