| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  | /*! | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |   * Bootstrap offcanvas.js v5.3.0-alpha1 (https://getbootstrap.com/)
 | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |   * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
 | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 | 
					
						
							|  |  |  |   */ | 
					
						
							|  |  |  | (function (global, factory) { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |   typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./util/index.js'), require('./util/scrollbar.js'), require('./dom/event-handler.js'), require('./base-component.js'), require('./dom/selector-engine.js'), require('./util/backdrop.js'), require('./util/focustrap.js'), require('./util/component-functions.js')) : | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |   typeof define === 'function' && define.amd ? define(['./util/index', './util/scrollbar', './dom/event-handler', './base-component', './dom/selector-engine', './util/backdrop', './util/focustrap', './util/component-functions'], factory) : | 
					
						
							|  |  |  |   (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Offcanvas = factory(global.Index, global.Scrollbar, global.EventHandler, global.BaseComponent, global.SelectorEngine, global.Backdrop, global.Focustrap, global.ComponentFunctions)); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  | })(this, (function (index_js, ScrollBarHelper, EventHandler, BaseComponent, SelectorEngine, Backdrop, FocusTrap, componentFunctions_js) { 'use strict'; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-04 23:41:51 +08:00
										 |  |  |   /** | 
					
						
							|  |  |  |    * -------------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |    * Bootstrap (v5.3.0-alpha1): offcanvas.js | 
					
						
							| 
									
										
										
										
											2021-10-05 23:50:18 +08:00
										 |  |  |    * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |    * -------------------------------------------------------------------------- | 
					
						
							|  |  |  |    */ | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |   /** | 
					
						
							|  |  |  |    * Constants | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const NAME = 'offcanvas'; | 
					
						
							|  |  |  |   const DATA_KEY = 'bs.offcanvas'; | 
					
						
							|  |  |  |   const EVENT_KEY = `.${DATA_KEY}`; | 
					
						
							|  |  |  |   const DATA_API_KEY = '.data-api'; | 
					
						
							|  |  |  |   const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`; | 
					
						
							|  |  |  |   const ESCAPE_KEY = 'Escape'; | 
					
						
							|  |  |  |   const CLASS_NAME_SHOW = 'show'; | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |   const CLASS_NAME_SHOWING = 'showing'; | 
					
						
							|  |  |  |   const CLASS_NAME_HIDING = 'hiding'; | 
					
						
							| 
									
										
										
										
											2021-08-04 23:41:51 +08:00
										 |  |  |   const CLASS_NAME_BACKDROP = 'offcanvas-backdrop'; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |   const OPEN_SELECTOR = '.offcanvas.show'; | 
					
						
							|  |  |  |   const EVENT_SHOW = `show${EVENT_KEY}`; | 
					
						
							|  |  |  |   const EVENT_SHOWN = `shown${EVENT_KEY}`; | 
					
						
							|  |  |  |   const EVENT_HIDE = `hide${EVENT_KEY}`; | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |   const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |   const EVENT_HIDDEN = `hidden${EVENT_KEY}`; | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |   const EVENT_RESIZE = `resize${EVENT_KEY}`; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |   const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`; | 
					
						
							| 
									
										
										
										
											2021-05-06 03:32:12 +08:00
										 |  |  |   const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |   const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="offcanvas"]'; | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |   const Default = { | 
					
						
							|  |  |  |     backdrop: true, | 
					
						
							|  |  |  |     keyboard: true, | 
					
						
							|  |  |  |     scroll: false | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  |   const DefaultType = { | 
					
						
							|  |  |  |     backdrop: '(boolean|string)', | 
					
						
							|  |  |  |     keyboard: 'boolean', | 
					
						
							|  |  |  |     scroll: 'boolean' | 
					
						
							|  |  |  |   }; | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |   /** | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |    * Class definition | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |    */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |   class Offcanvas extends BaseComponent { | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     constructor(element, config) { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       super(element, config); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       this._isShown = false; | 
					
						
							| 
									
										
										
										
											2021-05-06 03:32:12 +08:00
										 |  |  |       this._backdrop = this._initializeBackDrop(); | 
					
						
							| 
									
										
										
										
											2021-08-04 23:41:51 +08:00
										 |  |  |       this._focustrap = this._initializeFocusTrap(); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       this._addEventListeners(); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     // Getters
 | 
					
						
							| 
									
										
										
										
											2021-05-14 00:22:20 +08:00
										 |  |  |     static get Default() { | 
					
						
							|  |  |  |       return Default; | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |     static get DefaultType() { | 
					
						
							|  |  |  |       return DefaultType; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     static get NAME() { | 
					
						
							|  |  |  |       return NAME; | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     // Public
 | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     toggle(relatedTarget) { | 
					
						
							|  |  |  |       return this._isShown ? this.hide() : this.show(relatedTarget); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     show(relatedTarget) { | 
					
						
							|  |  |  |       if (this._isShown) { | 
					
						
							|  |  |  |         return; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, { | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |         relatedTarget | 
					
						
							|  |  |  |       }); | 
					
						
							|  |  |  |       if (showEvent.defaultPrevented) { | 
					
						
							|  |  |  |         return; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |       this._isShown = true; | 
					
						
							| 
									
										
										
										
											2021-05-06 03:32:12 +08:00
										 |  |  |       this._backdrop.show(); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       if (!this._config.scroll) { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |         new ScrollBarHelper().hide(); | 
					
						
							| 
									
										
										
										
											2021-05-06 03:32:12 +08:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       this._element.setAttribute('aria-modal', true); | 
					
						
							|  |  |  |       this._element.setAttribute('role', 'dialog'); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       this._element.classList.add(CLASS_NAME_SHOWING); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       const completeCallBack = () => { | 
					
						
							| 
									
										
										
										
											2022-07-19 23:43:58 +08:00
										 |  |  |         if (!this._config.scroll || this._config.backdrop) { | 
					
						
							| 
									
										
										
										
											2021-08-04 23:41:51 +08:00
										 |  |  |           this._focustrap.activate(); | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         this._element.classList.add(CLASS_NAME_SHOW); | 
					
						
							|  |  |  |         this._element.classList.remove(CLASS_NAME_SHOWING); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |         EventHandler.trigger(this._element, EVENT_SHOWN, { | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |           relatedTarget | 
					
						
							|  |  |  |         }); | 
					
						
							|  |  |  |       }; | 
					
						
							| 
									
										
										
										
											2021-05-14 00:22:20 +08:00
										 |  |  |       this._queueCallback(completeCallBack, this._element, true); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |     hide() { | 
					
						
							|  |  |  |       if (!this._isShown) { | 
					
						
							|  |  |  |         return; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       if (hideEvent.defaultPrevented) { | 
					
						
							|  |  |  |         return; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2021-08-04 23:41:51 +08:00
										 |  |  |       this._focustrap.deactivate(); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       this._element.blur(); | 
					
						
							|  |  |  |       this._isShown = false; | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       this._element.classList.add(CLASS_NAME_HIDING); | 
					
						
							| 
									
										
										
										
											2021-05-06 03:32:12 +08:00
										 |  |  |       this._backdrop.hide(); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       const completeCallback = () => { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         this._element.classList.remove(CLASS_NAME_SHOW, CLASS_NAME_HIDING); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |         this._element.removeAttribute('aria-modal'); | 
					
						
							|  |  |  |         this._element.removeAttribute('role'); | 
					
						
							|  |  |  |         if (!this._config.scroll) { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |           new ScrollBarHelper().reset(); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |         EventHandler.trigger(this._element, EVENT_HIDDEN); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       }; | 
					
						
							| 
									
										
										
										
											2021-05-14 00:22:20 +08:00
										 |  |  |       this._queueCallback(completeCallback, this._element, true); | 
					
						
							| 
									
										
										
										
											2021-05-06 03:32:12 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |     dispose() { | 
					
						
							|  |  |  |       this._backdrop.dispose(); | 
					
						
							| 
									
										
										
										
											2021-08-04 23:41:51 +08:00
										 |  |  |       this._focustrap.deactivate(); | 
					
						
							| 
									
										
										
										
											2021-05-06 03:32:12 +08:00
										 |  |  |       super.dispose(); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     // Private
 | 
					
						
							| 
									
										
										
										
											2021-05-06 03:32:12 +08:00
										 |  |  |     _initializeBackDrop() { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       const clickCallback = () => { | 
					
						
							|  |  |  |         if (this._config.backdrop === 'static') { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |           EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |           return; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         this.hide(); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       }; | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       // 'static' option will be translated to true, and booleans will keep their value
 | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       const isVisible = Boolean(this._config.backdrop); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       return new Backdrop({ | 
					
						
							| 
									
										
										
										
											2021-08-04 23:41:51 +08:00
										 |  |  |         className: CLASS_NAME_BACKDROP, | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         isVisible, | 
					
						
							| 
									
										
										
										
											2021-05-06 03:32:12 +08:00
										 |  |  |         isAnimated: true, | 
					
						
							|  |  |  |         rootElement: this._element.parentNode, | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         clickCallback: isVisible ? clickCallback : null | 
					
						
							| 
									
										
										
										
											2021-05-06 03:32:12 +08:00
										 |  |  |       }); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-08-04 23:41:51 +08:00
										 |  |  |     _initializeFocusTrap() { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       return new FocusTrap({ | 
					
						
							| 
									
										
										
										
											2021-08-04 23:41:51 +08:00
										 |  |  |         trapElement: this._element | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       }); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     _addEventListeners() { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         if (event.key !== ESCAPE_KEY) { | 
					
						
							|  |  |  |           return; | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |         if (!this._config.keyboard) { | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |           EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |           return; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         this.hide(); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       }); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     // Static
 | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     static jQueryInterface(config) { | 
					
						
							|  |  |  |       return this.each(function () { | 
					
						
							| 
									
										
										
										
											2021-06-23 02:29:16 +08:00
										 |  |  |         const data = Offcanvas.getOrCreateInstance(this, config); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |         if (typeof config !== 'string') { | 
					
						
							|  |  |  |           return; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { | 
					
						
							|  |  |  |           throw new TypeError(`No method named "${config}"`); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         data[config](this); | 
					
						
							|  |  |  |       }); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |   /** | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |    * Data API implementation | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |    */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |   EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { | 
					
						
							|  |  |  |     const target = SelectorEngine.getElementFromSelector(this); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     if (['A', 'AREA'].includes(this.tagName)) { | 
					
						
							|  |  |  |       event.preventDefault(); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     if (index_js.isDisabled(this)) { | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       return; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     EventHandler.one(target, EVENT_HIDDEN, () => { | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |       // focus on trigger when it is closed
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |       if (index_js.isVisible(this)) { | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |         this.focus(); | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     }); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |     // avoid conflict when clicking a toggler of an offcanvas, while another is open
 | 
					
						
							|  |  |  |     const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR); | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |     if (alreadyOpen && alreadyOpen !== target) { | 
					
						
							|  |  |  |       Offcanvas.getInstance(alreadyOpen).hide(); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-06-23 02:29:16 +08:00
										 |  |  |     const data = Offcanvas.getOrCreateInstance(target); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |     data.toggle(this); | 
					
						
							|  |  |  |   }); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |   EventHandler.on(window, EVENT_LOAD_DATA_API, () => { | 
					
						
							|  |  |  |     for (const selector of SelectorEngine.find(OPEN_SELECTOR)) { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       Offcanvas.getOrCreateInstance(selector).show(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |   EventHandler.on(window, EVENT_RESIZE, () => { | 
					
						
							|  |  |  |     for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) { | 
					
						
							| 
									
										
										
										
											2022-05-13 14:07:23 +08:00
										 |  |  |       if (getComputedStyle(element).position !== 'fixed') { | 
					
						
							|  |  |  |         Offcanvas.getOrCreateInstance(element).hide(); | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }); | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |   componentFunctions_js.enableDismissTrigger(Offcanvas); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  |   /** | 
					
						
							|  |  |  |    * jQuery | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-25 00:37:22 +08:00
										 |  |  |   index_js.defineJQueryPlugin(Offcanvas); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   return Offcanvas; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-05 23:50:18 +08:00
										 |  |  | })); | 
					
						
							| 
									
										
										
										
											2021-03-24 00:26:54 +08:00
										 |  |  | //# sourceMappingURL=offcanvas.js.map
 |