bs5-lightbox
Advanced tools
Comparing version 1.6.2 to 1.6.3
@@ -54,2 +54,1 @@ export default Carousel; | ||
} | ||
//# sourceMappingURL=carousel.d.ts.map |
@@ -7,7 +7,11 @@ /** | ||
*/ | ||
import { getElementFromSelector, isRTL, isVisible, getNextActiveElement, reflow, triggerTransitionEnd, typeCheckConfig } from 'bootstrap/js/src/util/index'; | ||
import EventHandler from 'bootstrap/js/src/dom/event-handler'; | ||
import Manipulator from 'bootstrap/js/src/dom/manipulator'; | ||
import SelectorEngine from 'bootstrap/js/src/dom/selector-engine'; | ||
import BaseComponent from 'bootstrap/js/src/base-component'; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const index_1 = require("bootstrap/js/src/util/index"); | ||
const event_handler_1 = __importDefault(require("bootstrap/js/src/dom/event-handler")); | ||
const manipulator_1 = __importDefault(require("bootstrap/js/src/dom/manipulator")); | ||
const selector_engine_1 = __importDefault(require("bootstrap/js/src/dom/selector-engine")); | ||
const base_component_1 = __importDefault(require("bootstrap/js/src/base-component")); | ||
/** | ||
@@ -21,3 +25,2 @@ * ------------------------------------------------------------------------ | ||
const EVENT_KEY = `.${DATA_KEY}`; | ||
const DATA_API_KEY = '.data-api'; | ||
const ARROW_LEFT_KEY = 'ArrowLeft'; | ||
@@ -62,4 +65,2 @@ const ARROW_RIGHT_KEY = 'ArrowRight'; | ||
const EVENT_DRAG_START = `dragstart${EVENT_KEY}`; | ||
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`; | ||
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`; | ||
const CLASS_NAME_CAROUSEL = 'carousel'; | ||
@@ -80,4 +81,2 @@ const CLASS_NAME_ACTIVE = 'active'; | ||
const SELECTOR_INDICATOR = '[data-bs-target]'; | ||
const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'; | ||
const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; | ||
const POINTER_TYPE_TOUCH = 'touch'; | ||
@@ -90,3 +89,3 @@ const POINTER_TYPE_PEN = 'pen'; | ||
*/ | ||
class Carousel extends BaseComponent { | ||
class Carousel extends base_component_1.default { | ||
constructor(element, config) { | ||
@@ -103,3 +102,3 @@ super(element); | ||
this._config = this._getConfig(config); | ||
this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element); | ||
this._indicatorsElement = selector_engine_1.default.findOne(SELECTOR_INDICATORS, this._element); | ||
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; | ||
@@ -123,3 +122,3 @@ this._pointerEvent = Boolean(window.PointerEvent); | ||
// or the carousel or its parent isn't visible | ||
if (!document.hidden && isVisible(this._element)) { | ||
if (!document.hidden && (0, index_1.isVisible)(this._element)) { | ||
this.next(); | ||
@@ -135,4 +134,4 @@ } | ||
} | ||
if (SelectorEngine.findOne(SELECTOR_NEXT_PREV, this._element)) { | ||
triggerTransitionEnd(this._element); | ||
if (selector_engine_1.default.findOne(SELECTOR_NEXT_PREV, this._element)) { | ||
(0, index_1.triggerTransitionEnd)(this._element); | ||
this.cycle(true); | ||
@@ -157,3 +156,3 @@ } | ||
to(index) { | ||
this._activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); | ||
this._activeElement = selector_engine_1.default.findOne(SELECTOR_ACTIVE_ITEM, this._element); | ||
const activeIndex = this._getItemIndex(this._activeElement); | ||
@@ -164,3 +163,3 @@ if (index > this._items.length - 1 || index < 0) { | ||
if (this._isSliding) { | ||
EventHandler.one(this._element, EVENT_SLID, () => this.to(index)); | ||
event_handler_1.default.one(this._element, EVENT_SLID, () => this.to(index)); | ||
return; | ||
@@ -173,5 +172,3 @@ } | ||
} | ||
const order = index > activeIndex ? | ||
ORDER_NEXT : | ||
ORDER_PREV; | ||
const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV; | ||
this._slide(order, this._items[index]); | ||
@@ -181,4 +178,4 @@ } | ||
_getConfig(config) { | ||
config = Object.assign(Object.assign(Object.assign({}, Default), Manipulator.getDataAttributes(this._element)), (typeof config === 'object' ? config : {})); | ||
typeCheckConfig(NAME, config, DefaultType); | ||
config = Object.assign(Object.assign(Object.assign({}, Default), manipulator_1.default.getDataAttributes(this._element)), (typeof config === 'object' ? config : {})); | ||
(0, index_1.typeCheckConfig)(NAME, config, DefaultType); | ||
return config; | ||
@@ -200,7 +197,7 @@ } | ||
if (this._config.keyboard) { | ||
EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event)); | ||
event_handler_1.default.on(this._element, EVENT_KEYDOWN, (event) => this._keydown(event)); | ||
} | ||
if (this._config.pause === 'hover') { | ||
EventHandler.on(this._element, EVENT_MOUSEENTER, event => this.pause(event)); | ||
EventHandler.on(this._element, EVENT_MOUSELEAVE, event => this.cycle(event)); | ||
event_handler_1.default.on(this._element, EVENT_MOUSEENTER, (event) => this.pause(event)); | ||
event_handler_1.default.on(this._element, EVENT_MOUSELEAVE, (event) => this.cycle(event)); | ||
} | ||
@@ -213,4 +210,4 @@ if (this._config.touch && this._touchSupported) { | ||
Data.remove(this._element, this.constructor.DATA_KEY); | ||
EventHandler.off(this._element, this.constructor.EVENT_KEY); | ||
Object.getOwnPropertyNames(this).forEach(propertyName => { | ||
event_handler_1.default.off(this._element, this.constructor.EVENT_KEY); | ||
Object.getOwnPropertyNames(this).forEach((propertyName) => { | ||
this[propertyName] = null; | ||
@@ -220,7 +217,6 @@ }); | ||
_addTouchEventListeners() { | ||
const hasPointerPenTouch = event => { | ||
return this._pointerEvent && | ||
(event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH); | ||
const hasPointerPenTouch = (event) => { | ||
return this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH); | ||
}; | ||
const start = event => { | ||
const start = (event) => { | ||
if (hasPointerPenTouch(event)) { | ||
@@ -233,9 +229,7 @@ this.touchStartX = event.clientX; | ||
}; | ||
const move = event => { | ||
const move = (event) => { | ||
// ensure swiping with one touch and not pinching | ||
this.touchDeltaX = event.touches && event.touches.length > 1 ? | ||
0 : | ||
event.touches[0].clientX - this.touchStartX; | ||
this.touchDeltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this.touchStartX; | ||
}; | ||
const end = event => { | ||
const end = (event) => { | ||
if (hasPointerPenTouch(event)) { | ||
@@ -257,17 +251,17 @@ this.touchDeltaX = event.clientX - this.touchStartX; | ||
} | ||
this.touchTimeout = setTimeout(event => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval); | ||
this.touchTimeout = setTimeout((event) => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval); | ||
} | ||
}; | ||
SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => { | ||
EventHandler.on(itemImg, EVENT_DRAG_START, e => e.preventDefault()); | ||
selector_engine_1.default.find(SELECTOR_ITEM_IMG, this._element).forEach((itemImg) => { | ||
event_handler_1.default.on(itemImg, EVENT_DRAG_START, (e) => e.preventDefault()); | ||
}); | ||
if (this._pointerEvent) { | ||
EventHandler.on(this._element, EVENT_POINTERDOWN, event => start(event)); | ||
EventHandler.on(this._element, EVENT_POINTERUP, event => end(event)); | ||
event_handler_1.default.on(this._element, EVENT_POINTERDOWN, (event) => start(event)); | ||
event_handler_1.default.on(this._element, EVENT_POINTERUP, (event) => end(event)); | ||
this._element.classList.add(CLASS_NAME_POINTER_EVENT); | ||
} | ||
else { | ||
EventHandler.on(this._element, EVENT_TOUCHSTART, event => start(event)); | ||
EventHandler.on(this._element, EVENT_TOUCHMOVE, event => move(event)); | ||
EventHandler.on(this._element, EVENT_TOUCHEND, event => end(event)); | ||
event_handler_1.default.on(this._element, EVENT_TOUCHSTART, (event) => start(event)); | ||
event_handler_1.default.on(this._element, EVENT_TOUCHMOVE, (event) => move(event)); | ||
event_handler_1.default.on(this._element, EVENT_TOUCHEND, (event) => end(event)); | ||
} | ||
@@ -286,5 +280,3 @@ } | ||
_getItemIndex(element) { | ||
this._items = element && element.parentNode ? | ||
SelectorEngine.find(SELECTOR_ITEM, element.parentNode) : | ||
[]; | ||
this._items = element && element.parentNode ? selector_engine_1.default.find(SELECTOR_ITEM, element.parentNode) : []; | ||
return this._items.indexOf(element); | ||
@@ -294,8 +286,8 @@ } | ||
const isNext = order === ORDER_NEXT; | ||
return getNextActiveElement(this._items, activeElement, isNext, this._config.wrap); | ||
return (0, index_1.getNextActiveElement)(this._items, activeElement, isNext, this._config.wrap); | ||
} | ||
_triggerSlideEvent(relatedTarget, eventDirectionName) { | ||
const targetIndex = this._getItemIndex(relatedTarget); | ||
const fromIndex = this._getItemIndex(SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element)); | ||
return EventHandler.trigger(this._element, EVENT_SLIDE, { | ||
const fromIndex = this._getItemIndex(selector_engine_1.default.findOne(SELECTOR_ACTIVE_ITEM, this._element)); | ||
return event_handler_1.default.trigger(this._element, EVENT_SLIDE, { | ||
relatedTarget, | ||
@@ -309,6 +301,6 @@ direction: eventDirectionName, | ||
if (this._indicatorsElement) { | ||
const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement); | ||
const activeIndicator = selector_engine_1.default.findOne(SELECTOR_ACTIVE, this._indicatorsElement); | ||
activeIndicator.classList.remove(CLASS_NAME_ACTIVE); | ||
activeIndicator.removeAttribute('aria-current'); | ||
const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement); | ||
const indicators = selector_engine_1.default.find(SELECTOR_INDICATOR, this._indicatorsElement); | ||
for (let i = 0; i < indicators.length; i++) { | ||
@@ -324,3 +316,3 @@ if (Number.parseInt(indicators[i].getAttribute('data-bs-slide-to'), 10) === this._getItemIndex(element)) { | ||
_updateInterval() { | ||
const element = this._activeElement || SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); | ||
const element = this._activeElement || selector_engine_1.default.findOne(SELECTOR_ACTIVE_ITEM, this._element); | ||
if (!element) { | ||
@@ -340,3 +332,3 @@ return; | ||
const order = this._directionToOrder(directionOrOrder); | ||
const activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); | ||
const activeElement = selector_engine_1.default.findOne(SELECTOR_ACTIVE_ITEM, this._element); | ||
const activeElementIndex = this._getItemIndex(activeElement); | ||
@@ -372,3 +364,3 @@ const nextElement = element || this._getItemByOrder(order, activeElement); | ||
const triggerSlidEvent = () => { | ||
EventHandler.trigger(this._element, EVENT_SLID, { | ||
event_handler_1.default.trigger(this._element, EVENT_SLID, { | ||
relatedTarget: nextElement, | ||
@@ -382,3 +374,3 @@ direction: eventDirectionName, | ||
nextElement.classList.add(orderClassName); | ||
reflow(nextElement); | ||
(0, index_1.reflow)(nextElement); | ||
activeElement.classList.add(directionalClassName); | ||
@@ -409,3 +401,3 @@ nextElement.classList.add(directionalClassName); | ||
} | ||
if (isRTL()) { | ||
if ((0, index_1.isRTL)()) { | ||
return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT; | ||
@@ -419,3 +411,3 @@ } | ||
} | ||
if (isRTL()) { | ||
if ((0, index_1.isRTL)()) { | ||
return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT; | ||
@@ -453,7 +445,7 @@ } | ||
static dataApiClickHandler(event) { | ||
let target = getElementFromSelector(this); | ||
let target = (0, index_1.getElementFromSelector)(this); | ||
if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) { | ||
return; | ||
} | ||
const config = Object.assign(Object.assign({}, Manipulator.getDataAttributes(target)), Manipulator.getDataAttributes(this)); | ||
const config = Object.assign(Object.assign({}, manipulator_1.default.getDataAttributes(target)), manipulator_1.default.getDataAttributes(this)); | ||
console.log(config); | ||
@@ -471,2 +463,2 @@ const slideIndex = this.getAttribute('data-bs-slide-to'); | ||
} | ||
export default Carousel; | ||
exports.default = Carousel; |
@@ -42,2 +42,1 @@ export default Modal; | ||
} | ||
//# sourceMappingURL=modal.d.ts.map |
@@ -7,10 +7,14 @@ /** | ||
*/ | ||
import { isRTL, reflow, typeCheckConfig } from 'bootstrap/js/src/util/index'; | ||
import EventHandler from 'bootstrap/js/src/dom/event-handler'; | ||
import Manipulator from 'bootstrap/js/src/dom/manipulator'; | ||
import SelectorEngine from 'bootstrap/js/src/dom/selector-engine'; | ||
import ScrollBarHelper from 'bootstrap/js/src/util/scrollbar'; | ||
import BaseComponent from 'bootstrap/js/src/base-component'; | ||
import Backdrop from 'bootstrap/js/src/util/backdrop'; | ||
import FocusTrap from 'bootstrap/js/src/util/focustrap'; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const index_1 = require("bootstrap/js/src/util/index"); | ||
const event_handler_1 = __importDefault(require("bootstrap/js/src/dom/event-handler")); | ||
const manipulator_1 = __importDefault(require("bootstrap/js/src/dom/manipulator")); | ||
const selector_engine_1 = __importDefault(require("bootstrap/js/src/dom/selector-engine")); | ||
const scrollbar_1 = __importDefault(require("bootstrap/js/src/util/scrollbar")); | ||
const base_component_1 = __importDefault(require("bootstrap/js/src/base-component")); | ||
const backdrop_1 = __importDefault(require("bootstrap/js/src/util/backdrop")); | ||
const focustrap_1 = __importDefault(require("bootstrap/js/src/util/focustrap")); | ||
/** | ||
@@ -24,3 +28,2 @@ * ------------------------------------------------------------------------ | ||
const EVENT_KEY = `.${DATA_KEY}`; | ||
const DATA_API_KEY = '.data-api'; | ||
const ESCAPE_KEY = 'Escape'; | ||
@@ -47,3 +50,2 @@ const Default = { | ||
const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY}`; | ||
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`; | ||
const CLASS_NAME_OPEN = 'modal-open'; | ||
@@ -53,6 +55,4 @@ const CLASS_NAME_FADE = 'fade'; | ||
const CLASS_NAME_STATIC = 'modal-static'; | ||
const OPEN_SELECTOR = '.modal.show'; | ||
const SELECTOR_DIALOG = '.modal-dialog'; | ||
const SELECTOR_MODAL_BODY = '.modal-body'; | ||
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="modal"]'; | ||
/** | ||
@@ -63,7 +63,7 @@ * ------------------------------------------------------------------------ | ||
*/ | ||
class Modal extends BaseComponent { | ||
class Modal extends base_component_1.default { | ||
constructor(element, config) { | ||
super(element); | ||
this._config = this._getConfig(config); | ||
this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element); | ||
this._dialog = selector_engine_1.default.findOne(SELECTOR_DIALOG, this._element); | ||
this._backdrop = this._initializeBackDrop(); | ||
@@ -74,3 +74,3 @@ this._focustrap = this._initializeFocusTrap(); | ||
this._isTransitioning = false; | ||
this._scrollBar = new ScrollBarHelper(); | ||
this._scrollBar = new scrollbar_1.default(); | ||
} | ||
@@ -92,3 +92,3 @@ // Getters | ||
} | ||
const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, { | ||
const showEvent = event_handler_1.default.trigger(this._element, EVENT_SHOW, { | ||
relatedTarget | ||
@@ -108,4 +108,4 @@ }); | ||
this._setResizeEvent(); | ||
EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => { | ||
EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => { | ||
event_handler_1.default.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => { | ||
event_handler_1.default.one(this._element, EVENT_MOUSEUP_DISMISS, (event) => { | ||
if (event.target === this._element) { | ||
@@ -122,3 +122,3 @@ this._ignoreBackdropClick = true; | ||
} | ||
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE); | ||
const hideEvent = event_handler_1.default.trigger(this._element, EVENT_HIDE); | ||
if (hideEvent.defaultPrevented) { | ||
@@ -136,9 +136,8 @@ return; | ||
this._element.classList.remove(CLASS_NAME_SHOW); | ||
EventHandler.off(this._element, EVENT_CLICK_DISMISS); | ||
EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS); | ||
event_handler_1.default.off(this._element, EVENT_CLICK_DISMISS); | ||
event_handler_1.default.off(this._dialog, EVENT_MOUSEDOWN_DISMISS); | ||
this._queueCallback(() => this._hideModal(), this._element, isAnimated); | ||
} | ||
dispose() { | ||
[window, this._dialog] | ||
.forEach(htmlElement => EventHandler.off(htmlElement, EVENT_KEY)); | ||
[window, this._dialog].forEach((htmlElement) => event_handler_1.default.off(htmlElement, EVENT_KEY)); | ||
this._backdrop.dispose(); | ||
@@ -153,3 +152,3 @@ this._focustrap.deactivate(); | ||
_initializeBackDrop() { | ||
return new Backdrop({ | ||
return new backdrop_1.default({ | ||
isVisible: Boolean(this._config.backdrop), | ||
@@ -160,3 +159,3 @@ isAnimated: this._isAnimated() | ||
_initializeFocusTrap() { | ||
return new FocusTrap({ | ||
return new focustrap_1.default({ | ||
trapElement: this._element | ||
@@ -166,4 +165,4 @@ }); | ||
_getConfig(config) { | ||
config = Object.assign(Object.assign(Object.assign({}, Default), Manipulator.getDataAttributes(this._element)), (typeof config === 'object' ? config : {})); | ||
typeCheckConfig(NAME, config, DefaultType); | ||
config = Object.assign(Object.assign(Object.assign({}, Default), manipulator_1.default.getDataAttributes(this._element)), (typeof config === 'object' ? config : {})); | ||
(0, index_1.typeCheckConfig)(NAME, config, DefaultType); | ||
return config; | ||
@@ -173,3 +172,3 @@ } | ||
const isAnimated = this._isAnimated(); | ||
const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog); | ||
const modalBody = selector_engine_1.default.findOne(SELECTOR_MODAL_BODY, this._dialog); | ||
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { | ||
@@ -188,3 +187,3 @@ // Don't move modal's DOM position | ||
if (isAnimated) { | ||
reflow(this._element); | ||
(0, index_1.reflow)(this._element); | ||
} | ||
@@ -197,3 +196,3 @@ this._element.classList.add(CLASS_NAME_SHOW); | ||
this._isTransitioning = false; | ||
EventHandler.trigger(this._element, EVENT_SHOWN, { | ||
event_handler_1.default.trigger(this._element, EVENT_SHOWN, { | ||
relatedTarget | ||
@@ -206,3 +205,3 @@ }); | ||
if (this._isShown) { | ||
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => { | ||
event_handler_1.default.on(this._element, EVENT_KEYDOWN_DISMISS, (event) => { | ||
if (this._config.keyboard && event.key === ESCAPE_KEY) { | ||
@@ -218,3 +217,3 @@ event.preventDefault(); | ||
else { | ||
EventHandler.off(this._element, EVENT_KEYDOWN_DISMISS); | ||
event_handler_1.default.off(this._element, EVENT_KEYDOWN_DISMISS); | ||
} | ||
@@ -224,6 +223,6 @@ } | ||
if (this._isShown) { | ||
EventHandler.on(window, EVENT_RESIZE, () => this._adjustDialog()); | ||
event_handler_1.default.on(window, EVENT_RESIZE, () => this._adjustDialog()); | ||
} | ||
else { | ||
EventHandler.off(window, EVENT_RESIZE); | ||
event_handler_1.default.off(window, EVENT_RESIZE); | ||
} | ||
@@ -241,7 +240,7 @@ } | ||
this._scrollBar.reset(); | ||
EventHandler.trigger(this._element, EVENT_HIDDEN); | ||
event_handler_1.default.trigger(this._element, EVENT_HIDDEN); | ||
}); | ||
} | ||
_showBackdrop(callback) { | ||
EventHandler.on(this._element, EVENT_CLICK_DISMISS, event => { | ||
event_handler_1.default.on(this._element, EVENT_CLICK_DISMISS, (event) => { | ||
if (this._ignoreBackdropClick) { | ||
@@ -267,3 +266,3 @@ this._ignoreBackdropClick = false; | ||
_triggerBackdropTransition() { | ||
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); | ||
const hideEvent = event_handler_1.default.trigger(this._element, EVENT_HIDE_PREVENTED); | ||
if (hideEvent.defaultPrevented) { | ||
@@ -299,6 +298,6 @@ return; | ||
const isBodyOverflowing = scrollbarWidth > 0; | ||
if ((!isBodyOverflowing && isModalOverflowing && !isRTL()) || (isBodyOverflowing && !isModalOverflowing && isRTL())) { | ||
if ((!isBodyOverflowing && isModalOverflowing && !(0, index_1.isRTL)()) || (isBodyOverflowing && !isModalOverflowing && (0, index_1.isRTL)())) { | ||
this._element.style.paddingLeft = `${scrollbarWidth}px`; | ||
} | ||
if ((isBodyOverflowing && !isModalOverflowing && !isRTL()) || (!isBodyOverflowing && isModalOverflowing && isRTL())) { | ||
if ((isBodyOverflowing && !isModalOverflowing && !(0, index_1.isRTL)()) || (!isBodyOverflowing && isModalOverflowing && (0, index_1.isRTL)())) { | ||
this._element.style.paddingRight = `${scrollbarWidth}px`; | ||
@@ -325,2 +324,2 @@ } | ||
} | ||
export default Modal; | ||
exports.default = Modal; |
@@ -1,1 +0,164 @@ | ||
!function(){"use strict";var t,e={728:function(t,e,i){i.r(e);var s=i(360),n=i(127),o=i(591),r=i(802),a=i(642);const l="carousel",c={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},d={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},h="next",u="prev",m="left",g="right",f={ArrowLeft:g,ArrowRight:m},p="slid.bs.carousel",_="active",b=".active.carousel-item";class v extends a.Z{constructor(t,e){super(t),this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._indicatorsElement=r.Z.findOne(".carousel-indicators",this._element),this._touchSupported="ontouchstart"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent),this._addEventListeners()}static get Default(){return c}static get NAME(){return l}next(){this._slide(h)}nextWhenVisible(){!document.hidden&&(0,s.pn)(this._element)&&this.next()}prev(){this._slide(u)}pause(t){t||(this._isPaused=!0),r.Z.findOne(".carousel-item-next, .carousel-item-prev",this._element)&&((0,s.S3)(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null}cycle(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config&&this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))}to(t){this._activeElement=r.Z.findOne(b,this._element);const e=this._getItemIndex(this._activeElement);if(t>this._items.length-1||t<0)return;if(this._isSliding)return void n.Z.one(this._element,p,(()=>this.to(t)));if(e===t)return this.pause(),void this.cycle();const i=t>e?h:u;this._slide(i,this._items[t])}_getConfig(t){return t=Object.assign(Object.assign(Object.assign({},c),o.Z.getDataAttributes(this._element)),"object"==typeof t?t:{}),(0,s.zE)(l,t,d),t}_handleSwipe(){const t=Math.abs(this.touchDeltaX);if(t<=40)return;const e=t/this.touchDeltaX;this.touchDeltaX=0,e&&this._slide(e>0?g:m)}_addEventListeners(){this._config.keyboard&&n.Z.on(this._element,"keydown.bs.carousel",(t=>this._keydown(t))),"hover"===this._config.pause&&(n.Z.on(this._element,"mouseenter.bs.carousel",(t=>this.pause(t))),n.Z.on(this._element,"mouseleave.bs.carousel",(t=>this.cycle(t)))),this._config.touch&&this._touchSupported&&this._addTouchEventListeners()}dispose(){Data.remove(this._element,this.constructor.DATA_KEY),n.Z.off(this._element,this.constructor.EVENT_KEY),Object.getOwnPropertyNames(this).forEach((t=>{this[t]=null}))}_addTouchEventListeners(){const t=t=>this._pointerEvent&&("pen"===t.pointerType||"touch"===t.pointerType),e=e=>{t(e)?this.touchStartX=e.clientX:this._pointerEvent||(this.touchStartX=e.touches[0].clientX)},i=t=>{this.touchDeltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this.touchStartX},s=e=>{t(e)&&(this.touchDeltaX=e.clientX-this.touchStartX),this._handleSwipe(),"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((t=>this.cycle(t)),500+this._config.interval))};r.Z.find(".carousel-item img",this._element).forEach((t=>{n.Z.on(t,"dragstart.bs.carousel",(t=>t.preventDefault()))})),this._pointerEvent?(n.Z.on(this._element,"pointerdown.bs.carousel",(t=>e(t))),n.Z.on(this._element,"pointerup.bs.carousel",(t=>s(t))),this._element.classList.add("pointer-event")):(n.Z.on(this._element,"touchstart.bs.carousel",(t=>e(t))),n.Z.on(this._element,"touchmove.bs.carousel",(t=>i(t))),n.Z.on(this._element,"touchend.bs.carousel",(t=>s(t))))}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=f[t.key];e&&(t.preventDefault(),this._slide(e))}_getItemIndex(t){return this._items=t&&t.parentNode?r.Z.find(".carousel-item",t.parentNode):[],this._items.indexOf(t)}_getItemByOrder(t,e){const i=t===h;return(0,s.Fj)(this._items,e,i,this._config.wrap)}_triggerSlideEvent(t,e){const i=this._getItemIndex(t),s=this._getItemIndex(r.Z.findOne(b,this._element));return n.Z.trigger(this._element,"slide.bs.carousel",{relatedTarget:t,direction:e,from:s,to:i})}_setActiveIndicatorElement(t){if(this._indicatorsElement){const e=r.Z.findOne(".active",this._indicatorsElement);e.classList.remove(_),e.removeAttribute("aria-current");const i=r.Z.find("[data-bs-target]",this._indicatorsElement);for(let e=0;e<i.length;e++)if(Number.parseInt(i[e].getAttribute("data-bs-slide-to"),10)===this._getItemIndex(t)){i[e].classList.add(_),i[e].setAttribute("aria-current","true");break}}}_updateInterval(){const t=this._activeElement||r.Z.findOne(b,this._element);if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);e?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=e):this._config.interval=this._config.defaultInterval||this._config.interval}_slide(t,e){const i=this._directionToOrder(t),o=r.Z.findOne(b,this._element),a=this._getItemIndex(o),l=e||this._getItemByOrder(i,o),c=this._getItemIndex(l),d=Boolean(this._interval),u=i===h,m=u?"carousel-item-start":"carousel-item-end",g=u?"carousel-item-next":"carousel-item-prev",f=this._orderToDirection(i);if(l&&l.classList.contains(_))return void(this._isSliding=!1);if(this._isSliding)return;if(this._triggerSlideEvent(l,f).defaultPrevented)return;if(!o||!l)return;this._isSliding=!0,d&&this.pause(),this._setActiveIndicatorElement(l),this._activeElement=l;const v=()=>{n.Z.trigger(this._element,p,{relatedTarget:l,direction:f,from:a,to:c})};if(this._element.classList.contains("slide")){l.classList.add(g),(0,s.nq)(l),o.classList.add(m),l.classList.add(m);const t=()=>{l.classList.remove(m,g),l.classList.add(_),o.classList.remove(_,g,m),this._isSliding=!1,setTimeout(v,0)};this._queueCallback(t,o,!0)}else o.classList.remove(_),l.classList.add(_),this._isSliding=!1,v();d&&this.cycle()}_directionToOrder(t){return[g,m].includes(t)?(0,s.dZ)()?t===m?u:h:t===m?h:u:t}_orderToDirection(t){return[h,u].includes(t)?(0,s.dZ)()?t===u?m:g:t===u?g:m:t}static carouselInterface(t,e){const i=v.getOrCreateInstance(t,e);let{_config:s}=i;"object"==typeof e&&(s=Object.assign(Object.assign({},s),e));const n="string"==typeof e?e:s.slide;if("number"==typeof e)i.to(e);else if("string"==typeof n){if(void 0===i[n])throw new TypeError(`No method named "${n}"`);i[n]()}else s.interval&&s.ride&&(i.pause(),i.cycle())}static jQueryInterface(t){return this.each((function(){v.carouselInterface(this,t)}))}static dataApiClickHandler(t){let e=(0,s.dG)(this);if(!e||!e.classList.contains("carousel"))return;const i=Object.assign(Object.assign({},o.Z.getDataAttributes(e)),o.Z.getDataAttributes(this));console.log(i);const n=this.getAttribute("data-bs-slide-to");n&&(i.interval=!1),v.carouselInterface(e,i),n&&v.getInstance(e).to(n),t.preventDefault()}}e.default=v},112:function(t,e,i){i.r(e),i.d(e,{default:function(){return L}});var s=i(360),n=i(127),o=i(591),r=i(802);const a=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",l=".sticky-top";var c=i(642);const d={className:"modal-backdrop",isVisible:!0,isAnimated:!1,rootElement:"body",clickCallback:null},h={className:"string",isVisible:"boolean",isAnimated:"boolean",rootElement:"(element|string)",clickCallback:"(function|null)"},u="backdrop",m="show",g=`mousedown.bs.${u}`;const f={trapElement:null,autofocus:!0},p={trapElement:"element",autofocus:"boolean"},_=".bs.focustrap",b=`focusin${_}`,v=`keydown.tab${_}`,y="backward";const E="modal",w="Escape",A={backdrop:!0,keyboard:!0,focus:!0},k={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean"},O="resize.bs.modal",T="click.dismiss.bs.modal",x="keydown.dismiss.bs.modal",Z="mousedown.dismiss.bs.modal",S="modal-open",j="show",D="modal-static";class C extends c.Z{constructor(t,e){super(t),this._config=this._getConfig(e),this._dialog=r.Z.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollBar=new class{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,"paddingRight",(e=>e+t)),this._setElementAttributes(a,"paddingRight",(e=>e+t)),this._setElementAttributes(l,"marginRight",(e=>e-t))}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const s=this.getWidth();this._applyManipulationCallback(t,(t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+s)return;this._saveInitialAttribute(t,e);const n=window.getComputedStyle(t)[e];t.style[e]=`${i(Number.parseFloat(n))}px`}))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,"paddingRight"),this._resetElementAttributes(a,"paddingRight"),this._resetElementAttributes(l,"marginRight")}_saveInitialAttribute(t,e){const i=t.style[e];i&&o.Z.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,(t=>{const i=o.Z.getDataAttribute(t,e);void 0===i?t.style.removeProperty(e):(o.Z.removeDataAttribute(t,e),t.style[e]=i)}))}_applyManipulationCallback(t,e){(0,s.kK)(t)?e(t):r.Z.find(t,this._element).forEach(e)}isOverflowing(){return this.getWidth()>0}}}static get Default(){return A}static get NAME(){return E}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||n.Z.trigger(this._element,"show.bs.modal",{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isAnimated()&&(this._isTransitioning=!0),this._scrollBar.hide(),document.body.classList.add(S),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),n.Z.on(this._dialog,Z,(()=>{n.Z.one(this._element,"mouseup.dismiss.bs.modal",(t=>{t.target===this._element&&(this._ignoreBackdropClick=!0)}))})),this._showBackdrop((()=>this._showElement(t))))}hide(){if(!this._isShown||this._isTransitioning)return;if(n.Z.trigger(this._element,"hide.bs.modal").defaultPrevented)return;this._isShown=!1;const t=this._isAnimated();t&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),this._focustrap.deactivate(),this._element.classList.remove(j),n.Z.off(this._element,T),n.Z.off(this._dialog,Z),this._queueCallback((()=>this._hideModal()),this._element,t)}dispose(){[window,this._dialog].forEach((t=>n.Z.off(t,".bs.modal"))),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new class{constructor(t){this._config=this._getConfig(t),this._isAppended=!1,this._element=null}show(t){this._config.isVisible?(this._append(),this._config.isAnimated&&(0,s.nq)(this._getElement()),this._getElement().classList.add(m),this._emulateAnimation((()=>{(0,s.ht)(t)}))):(0,s.ht)(t)}hide(t){this._config.isVisible?(this._getElement().classList.remove(m),this._emulateAnimation((()=>{this.dispose(),(0,s.ht)(t)}))):(0,s.ht)(t)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_getConfig(t){return(t={...d,..."object"==typeof t?t:{}}).rootElement=(0,s.sb)(t.rootElement),(0,s.zE)(u,t,h),t}_append(){this._isAppended||(this._config.rootElement.append(this._getElement()),n.Z.on(this._getElement(),g,(()=>{(0,s.ht)(this._config.clickCallback)})),this._isAppended=!0)}dispose(){this._isAppended&&(n.Z.off(this._element,g),this._element.remove(),this._isAppended=!1)}_emulateAnimation(t){(0,s.e0)(t,this._getElement(),this._config.isAnimated)}}({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new class{constructor(t){this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}activate(){const{trapElement:t,autofocus:e}=this._config;this._isActive||(e&&t.focus(),n.Z.off(document,_),n.Z.on(document,b,(t=>this._handleFocusin(t))),n.Z.on(document,v,(t=>this._handleKeydown(t))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,n.Z.off(document,_))}_handleFocusin(t){const{target:e}=t,{trapElement:i}=this._config;if(e===document||e===i||i.contains(e))return;const s=r.Z.focusableChildren(i);0===s.length?i.focus():this._lastTabNavDirection===y?s[s.length-1].focus():s[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?y:"forward")}_getConfig(t){return t={...f,..."object"==typeof t?t:{}},(0,s.zE)("focustrap",t,p),t}}({trapElement:this._element})}_getConfig(t){return t=Object.assign(Object.assign(Object.assign({},A),o.Z.getDataAttributes(this._element)),"object"==typeof t?t:{}),(0,s.zE)(E,t,k),t}_showElement(t){const e=this._isAnimated(),i=r.Z.findOne(".modal-body",this._dialog);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0,i&&(i.scrollTop=0),e&&(0,s.nq)(this._element),this._element.classList.add(j),this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,n.Z.trigger(this._element,"shown.bs.modal",{relatedTarget:t})}),this._dialog,e)}_setEscapeEvent(){this._isShown?n.Z.on(this._element,x,(t=>{this._config.keyboard&&t.key===w?(t.preventDefault(),this.hide()):this._config.keyboard||t.key!==w||this._triggerBackdropTransition()})):n.Z.off(this._element,x)}_setResizeEvent(){this._isShown?n.Z.on(window,O,(()=>this._adjustDialog())):n.Z.off(window,O)}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(S),this._resetAdjustments(),this._scrollBar.reset(),n.Z.trigger(this._element,"hidden.bs.modal")}))}_showBackdrop(t){n.Z.on(this._element,T,(t=>{this._ignoreBackdropClick?this._ignoreBackdropClick=!1:t.target===t.currentTarget&&(!0===this._config.backdrop?this.hide():"static"===this._config.backdrop&&this._triggerBackdropTransition())})),this._backdrop.show(t)}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(n.Z.trigger(this._element,"hidePrevented.bs.modal").defaultPrevented)return;const{classList:t,scrollHeight:e,style:i}=this._element,s=e>document.documentElement.clientHeight;!s&&"hidden"===i.overflowY||t.contains(D)||(s||(i.overflowY="hidden"),t.add(D),this._queueCallback((()=>{t.remove(D),s||this._queueCallback((()=>{i.overflowY=""}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;(!i&&t&&!(0,s.dZ)()||i&&!t&&(0,s.dZ)())&&(this._element.style.paddingLeft=`${e}px`),(i&&!t&&!(0,s.dZ)()||!i&&t&&(0,s.dZ)())&&(this._element.style.paddingRight=`${e}px`)}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each((function(){const i=C.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}}))}}var L=C},338:function(t,e,i){e.Z=void 0;var s=o(i(112)),n=o(i(728));function o(t){return t&&t.__esModule?t:{default:t}}const r={Modal:s.default,Carousel:n.default};class a{constructor(t,e={}){this.hash=this.randomHash(),this.settings=Object.assign(Object.assign(Object.assign({},r.Modal.Default),r.Carousel.Default),{interval:!1,target:'[data-toggle="lightbox"]',gallery:""}),this.modalOptions=(()=>this.setOptionsFromSettings(r.Modal.Default))(),this.carouselOptions=(()=>this.setOptionsFromSettings(r.Carousel.Default))(),console.log(),"string"==typeof t&&(this.settings.target=t,t=document.querySelector(this.settings.target),e=void 0!==arguments[1]?arguments[1]:{}),this.settings=Object.assign(Object.assign({},this.settings),e),this.el=t,this.type=t.dataset.type||"image",this.src=this.getSrc(t),this.src="image"!==this.type?"embed"+this.src:this.src,this.sources=this.getGalleryItems(),this.createCarousel(),this.createModal()}show(){document.body.appendChild(this.modalElement),this.modal.show()}hide(){this.modal.hide()}setOptionsFromSettings(t){return Object.keys(t).reduce(((t,e)=>Object.assign(t,{[e]:this.settings[e]})),{})}getSrc(t){return t.dataset.src||t.dataset.remote||t.href||"http://via.placeholder.com/1600x900"}getGalleryItems(){let t;if(this.settings.gallery){if(Array.isArray(this.settings.gallery))return this.settings.gallery;t=this.settings.gallery}else this.el.dataset.gallery&&(t=this.el.dataset.gallery);return t?[...new Set(Array.from(document.querySelectorAll('[data-gallery="'.concat(t,'"]')),(t=>"".concat(t.dataset.type?"embed":"").concat(this.getSrc(t)))))]:[this.src]}getYoutubeId(t){if(!t)return!1;let e=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return!(!e||11!==e[2].length)&&e[2]}getInstagramEmbed(t){if(/instagram/.test(t))return t+=/\/embed$/.test(t)?"":"/embed",'<div class="ratio ratio-16x9" style="max-height: 100%;"><iframe src="'.concat(t,'" class="start-50 translate-middle-x" style="max-width: 500px" frameborder="0" scrolling="no" allowtransparency="true"></iframe></div>')}isEmbed(t){const e=new RegExp(a.allowedEmbedTypes.join("|")).test(t),i=/\.(png|jpe?g|gif|svg|webp)/.test(t);return e||!i}createCarousel(){const t=document.createElement("template"),e=this.sources.map(((t,e)=>{t=t.replace(/\/$/,"");let i="";i+=/\.png/.test(t)?"this.add.previousSibling.remove()":"";let s='<div class="ratio ratio-16x9"><img src="'.concat(t,'" class="d-block w-100 h-100 img-fluid" style="z-index: 1; object-fit: contain;" onload="').concat(i,'" /></div>'),n="";const o=this.getInstagramEmbed(t),r=this.getYoutubeId(t);return this.isEmbed(t)&&(/^embed/.test(t)&&(t=t.substring(5)),r&&(t="https://www.youtube.com/embed/".concat(r),n='title="YouTube video player" frameborder="0" allow="accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture"'),s=o||'<div class="ratio ratio-16x9"><iframe src="'.concat(t,'" ').concat(n," allowfullscreen></iframe></div>")),'<div class="carousel-item '.concat(e?"":"active",'" style="min-height: 100px">').concat('<div class="position-absolute top-50 start-50 translate-middle text-white"><div class="spinner-border" style="width: 3rem height: 3rem" role="status"></div></div>').concat(s,"</div>")})).join(""),i=this.sources.length<2?"":'\n\t\t\t<button class="carousel-control carousel-control-prev h-75 m-auto" type="button" data-bs-target="#lightboxCarousel-'.concat(this.hash,'" data-bs-slide="prev">\n\t\t\t\t<span class="carousel-control-prev-icon" aria-hidden="true"></span>\n\t\t\t\t<span class="visually-hidden">Previous</span>\n\t\t\t</button>\n\t\t\t<button class="carousel-control carousel-control-next h-75 m-auto" type="button" data-bs-target="#lightboxCarousel-').concat(this.hash,'" data-bs-slide="next">\n\t\t\t\t<span class="carousel-control-next-icon" aria-hidden="true"></span>\n\t\t\t\t<span class="visually-hidden">Next</span>\n\t\t\t</button>'),s='\n\t\t\t<div id="lightboxCarousel-'.concat(this.hash,'" class="lightbox-carousel carousel" data-bs-ride="carousel">\n\t\t\t\t<div class="carousel-inner">\n\t\t\t\t\t').concat(e,"\n\t\t\t\t</div>\n\t\t\t\t").concat(i,"\n\t\t\t</div>");return t.innerHTML=s.trim(),this.carouselElement=t.content.firstChild,this.carousel=new r.Carousel(this.carouselElement,this.carouselOptions),this.carousel.to(this.sources.includes(this.src)?this.sources.indexOf(this.src):0),this.carousel}createModal(){const t=document.createElement("template"),e='\n\t\t\t<div class="modal lightbox fade" id="lightboxModal-'.concat(this.hash,'" tabindex="-1" aria-hidden="true">\n\t\t\t\t<div class="modal-dialog modal-dialog-centered modal-xl">\n\t\t\t\t\t<div class="modal-content border-0" style="background: black">\n\t\t\t\t\t\t<div class="modal-body p-0">\n\t\t\t\t\t\t\t<button type="button" class="btn-close position-absolute top-0 end-0 p-3" data-bs-dismiss="modal" aria-label="Close" style="z-index: 2; background: none;">').concat('<svg xmlns="http://www.w3.org/2000/svg" style="position: relative; top: -5px;" viewBox="0 0 16 16" fill="#fff"><path d="M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z"/></svg>)',"</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>");return t.innerHTML=e.trim(),this.modalElement=t.content.firstChild,this.modalElement.querySelector(".modal-body").appendChild(this.carouselElement),this.modalElement.addEventListener("hidden.bs.modal",(t=>this.modalElement.remove())),this.modal=new r.Modal(this.modalElement,this.modalOptions),this.modal}randomHash(t=8){return Array.from({length:t},(()=>Math.floor(36*Math.random()).toString(36))).join("")}}a.allowedEmbedTypes=["embed","youtube","vimeo","instagram","url"],a.allowedMediaTypes=[...a.allowedEmbedTypes,"image"],a.defaultSelector='[data-toggle="lightbox"]',document.querySelectorAll(a.defaultSelector).forEach((t=>t.addEventListener("click",(e=>{e.preventDefault(),new a(t).show()}))));var l=a;e.Z=l},642:function(t,e,i){i.d(e,{Z:function(){return a}});const s=new Map;var n={set(t,e,i){s.has(t)||s.set(t,new Map);const n=s.get(t);n.has(e)||0===n.size?n.set(e,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(t,e)=>s.has(t)&&s.get(t).get(e)||null,remove(t,e){if(!s.has(t))return;const i=s.get(t);i.delete(e),0===i.size&&s.delete(t)}},o=i(360),r=i(127),a=class{constructor(t){(t=(0,o.sb)(t))&&(this._element=t,n.set(this._element,this.constructor.DATA_KEY,this))}dispose(){n.remove(this._element,this.constructor.DATA_KEY),r.Z.off(this._element,this.constructor.EVENT_KEY),Object.getOwnPropertyNames(this).forEach((t=>{this[t]=null}))}_queueCallback(t,e,i=!0){(0,o.e0)(t,e,i)}static getInstance(t){return n.get((0,o.sb)(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.1.1"}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}}},127:function(t,e,i){var s=i(360);const n=/[^.]*(?=\..*)\.|.*/,o=/\..*/,r=/::\d+$/,a={};let l=1;const c={mouseenter:"mouseover",mouseleave:"mouseout"},d=/^(mouseenter|mouseleave)/i,h=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function u(t,e){return e&&`${e}::${l++}`||t.uidEvent||l++}function m(t){const e=u(t);return t.uidEvent=e,a[e]=a[e]||{},a[e]}function g(t,e,i=null){const s=Object.keys(t);for(let n=0,o=s.length;n<o;n++){const o=t[s[n]];if(o.originalHandler===e&&o.delegationSelector===i)return o}return null}function f(t,e,i){const s="string"==typeof e,n=s?i:e;let o=b(t);return h.has(o)||(o=t),[s,n,o]}function p(t,e,i,s,o){if("string"!=typeof e||!t)return;if(i||(i=s,s=null),d.test(e)){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};s?s=t(s):i=t(i)}const[r,a,l]=f(e,i,s),c=m(t),h=c[l]||(c[l]={}),p=g(h,a,r?i:null);if(p)return void(p.oneOff=p.oneOff&&o);const _=u(a,e.replace(n,"")),b=r?function(t,e,i){return function s(n){const o=t.querySelectorAll(e);for(let{target:r}=n;r&&r!==this;r=r.parentNode)for(let a=o.length;a--;)if(o[a]===r)return n.delegateTarget=r,s.oneOff&&v.off(t,n.type,e,i),i.apply(r,[n]);return null}}(t,i,s):function(t,e){return function i(s){return s.delegateTarget=t,i.oneOff&&v.off(t,s.type,e),e.apply(t,[s])}}(t,i);b.delegationSelector=r?i:null,b.originalHandler=a,b.oneOff=o,b.uidEvent=_,h[_]=b,t.addEventListener(l,b,r)}function _(t,e,i,s,n){const o=g(e[i],s,n);o&&(t.removeEventListener(i,o,Boolean(n)),delete e[i][o.uidEvent])}function b(t){return t=t.replace(o,""),c[t]||t}const v={on(t,e,i,s){p(t,e,i,s,!1)},one(t,e,i,s){p(t,e,i,s,!0)},off(t,e,i,s){if("string"!=typeof e||!t)return;const[n,o,a]=f(e,i,s),l=a!==e,c=m(t),d=e.startsWith(".");if(void 0!==o){if(!c||!c[a])return;return void _(t,c,a,o,n?i:null)}d&&Object.keys(c).forEach((i=>{!function(t,e,i,s){const n=e[i]||{};Object.keys(n).forEach((o=>{if(o.includes(s)){const s=n[o];_(t,e,i,s.originalHandler,s.delegationSelector)}}))}(t,c,i,e.slice(1))}));const h=c[a]||{};Object.keys(h).forEach((i=>{const s=i.replace(r,"");if(!l||e.includes(s)){const e=h[i];_(t,c,a,e.originalHandler,e.delegationSelector)}}))},trigger(t,e,i){if("string"!=typeof e||!t)return null;const n=(0,s.KF)(),o=b(e),r=e!==o,a=h.has(o);let l,c=!0,d=!0,u=!1,m=null;return r&&n&&(l=n.Event(e,i),n(t).trigger(l),c=!l.isPropagationStopped(),d=!l.isImmediatePropagationStopped(),u=l.isDefaultPrevented()),a?(m=document.createEvent("HTMLEvents"),m.initEvent(o,c,!0)):m=new CustomEvent(e,{bubbles:c,cancelable:!0}),void 0!==i&&Object.keys(i).forEach((t=>{Object.defineProperty(m,t,{get:()=>i[t]})})),u&&m.preventDefault(),d&&t.dispatchEvent(m),m.defaultPrevented&&void 0!==l&&l.preventDefault(),m}};e.Z=v},591:function(t,e){function i(t){return"true"===t||"false"!==t&&(t===Number(t).toString()?Number(t):""===t||"null"===t?null:t)}function s(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}const n={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${s(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${s(e)}`)},getDataAttributes(t){if(!t)return{};const e={};return Object.keys(t.dataset).filter((t=>t.startsWith("bs"))).forEach((s=>{let n=s.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),e[n]=i(t.dataset[s])})),e},getDataAttribute:(t,e)=>i(t.getAttribute(`data-bs-${s(e)}`)),offset(t){const e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset,left:e.left+window.pageXOffset}},position:t=>({top:t.offsetTop,left:t.offsetLeft})};e.Z=n},802:function(t,e,i){var s=i(360);const n={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const i=[];let s=t.parentNode;for(;s&&s.nodeType===Node.ELEMENT_NODE&&3!==s.nodeType;)s.matches(e)&&i.push(s),s=s.parentNode;return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(", ");return this.find(e,t).filter((t=>!(0,s.pK)(t)&&(0,s.pn)(t)))}};e.Z=n},360:function(t,e,i){i.d(e,{sb:function(){return a},dG:function(){return n},S3:function(){return o},kK:function(){return r},zE:function(){return l},pn:function(){return c},pK:function(){return d},Fj:function(){return p},nq:function(){return h},KF:function(){return u},dZ:function(){return m},ht:function(){return g},e0:function(){return f}});const s="transitionend",n=t=>{const e=(t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():null}return e})(t);return e?document.querySelector(e):null},o=t=>{t.dispatchEvent(new Event(s))},r=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),a=t=>r(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(t):null,l=(t,e,i)=>{Object.keys(i).forEach((s=>{const n=i[s],o=e[s],a=o&&r(o)?"element":null==(l=o)?`${l}`:{}.toString.call(l).match(/\s([a-z]+)/i)[1].toLowerCase();var l;if(!new RegExp(n).test(a))throw new TypeError(`${t.toUpperCase()}: Option "${s}" provided type "${a}" but expected type "${n}".`)}))},c=t=>!(!r(t)||0===t.getClientRects().length)&&"visible"===getComputedStyle(t).getPropertyValue("visibility"),d=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),h=t=>{t.offsetHeight},u=()=>{const{jQuery:t}=window;return t&&!document.body.hasAttribute("data-bs-no-jquery")?t:null},m=()=>"rtl"===document.documentElement.dir,g=t=>{"function"==typeof t&&t()},f=(t,e,i=!0)=>{if(!i)return void g(t);const n=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const s=Number.parseFloat(e),n=Number.parseFloat(i);return s||n?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let r=!1;const a=({target:i})=>{i===e&&(r=!0,e.removeEventListener(s,a),g(t))};e.addEventListener(s,a),setTimeout((()=>{r||o(e)}),n)},p=(t,e,i,s)=>{let n=t.indexOf(e);if(-1===n)return t[!i&&s?t.length-1:0];const o=t.length;return n+=i?1:-1,s&&(n=(n+o)%o),t[Math.max(0,Math.min(n,o-1))]}}},i={};function s(t){var n=i[t];if(void 0!==n)return n.exports;var o=i[t]={exports:{}};return e[t](o,o.exports,s),o.exports}s.d=function(t,e){for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t=s(338),window.bootstrap&&(window.bootstrap.Lightbox=t.Z)}(); | ||
/** | ||
* Lightbox for Bootstrap 5 | ||
* | ||
* @file Creates a modal with a lightbox carousel. | ||
* @module bs5-lightbox | ||
*/ | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const modal_1 = __importDefault(require("./bootstrap/modal")); | ||
const carousel_1 = __importDefault(require("./bootstrap/carousel")); | ||
const bootstrap = { | ||
Modal: modal_1.default, | ||
Carousel: carousel_1.default | ||
}; | ||
class Lightbox { | ||
constructor(el, options = {}) { | ||
this.hash = this.randomHash(); | ||
this.settings = Object.assign(Object.assign(Object.assign({}, bootstrap.Modal.Default), bootstrap.Carousel.Default), { interval: false, target: '[data-toggle="lightbox"]', gallery: '' }); | ||
this.modalOptions = (() => this.setOptionsFromSettings(bootstrap.Modal.Default))(); | ||
this.carouselOptions = (() => this.setOptionsFromSettings(bootstrap.Carousel.Default))(); | ||
if (typeof el === 'string') { | ||
this.settings.target = el; | ||
el = document.querySelector(this.settings.target); | ||
} | ||
this.settings = Object.assign(Object.assign({}, this.settings), options); | ||
this.el = el; | ||
this.type = el.dataset.type || 'image'; | ||
this.src = this.getSrc(el); | ||
this.src = this.type !== 'image' ? 'embed' + this.src : this.src; | ||
this.sources = this.getGalleryItems(); | ||
this.createCarousel(); | ||
this.createModal(); | ||
} | ||
show() { | ||
document.body.appendChild(this.modalElement); | ||
this.modal.show(); | ||
} | ||
hide() { | ||
this.modal.hide(); | ||
} | ||
setOptionsFromSettings(obj) { | ||
return Object.keys(obj).reduce((p, c) => Object.assign(p, { [c]: this.settings[c] }), {}); | ||
} | ||
getSrc(el) { | ||
return el.dataset.src || el.dataset.remote || el.href || 'http://via.placeholder.com/1600x900'; | ||
} | ||
getGalleryItems() { | ||
let galleryTarget; | ||
if (this.settings.gallery) { | ||
if (Array.isArray(this.settings.gallery)) { | ||
return this.settings.gallery; | ||
} | ||
galleryTarget = this.settings.gallery; | ||
} | ||
else if (this.el.dataset.gallery) { | ||
galleryTarget = this.el.dataset.gallery; | ||
} | ||
const gallery = galleryTarget | ||
? [...new Set(Array.from(document.querySelectorAll(`[data-gallery="${galleryTarget}"]`), (v) => `${v.dataset.type ? 'embed' : ''}${this.getSrc(v)}`))] | ||
: [this.src]; | ||
return gallery; | ||
} | ||
getYoutubeId(src) { | ||
if (!src) | ||
return false; | ||
const matches = src.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/); | ||
return matches && matches[2].length === 11 ? matches[2] : false; | ||
} | ||
getInstagramEmbed(src) { | ||
if (/instagram/.test(src)) { | ||
src += /\/embed$/.test(src) ? '' : '/embed'; | ||
return `<div class="ratio ratio-16x9" style="max-height: 100%;"><iframe src="${src}" class="start-50 translate-middle-x" style="max-width: 500px" frameborder="0" scrolling="no" allowtransparency="true"></iframe></div>`; | ||
} | ||
} | ||
isEmbed(src) { | ||
const regex = new RegExp(Lightbox.allowedEmbedTypes.join('|')); | ||
const isEmbed = regex.test(src); | ||
const isImg = /\.(png|jpe?g|gif|svg|webp)/.test(src); | ||
return isEmbed || !isImg; | ||
} | ||
createCarousel() { | ||
const template = document.createElement('template'); | ||
const slidesHtml = this.sources | ||
.map((src, i) => { | ||
src = src.replace(/\/$/, ''); | ||
let onload = ''; | ||
onload += /\.png/.test(src) ? `this.add.previousSibling.remove()` : ''; | ||
let inner = `<div class="ratio ratio-16x9"><img src="${src}" class="d-block w-100 h-100 img-fluid" style="z-index: 1; object-fit: contain;" onload="${onload}" /></div>`; | ||
let attributes = ''; | ||
const instagramEmbed = this.getInstagramEmbed(src); | ||
const youtubeId = this.getYoutubeId(src); | ||
if (this.isEmbed(src)) { | ||
if (/^embed/.test(src)) | ||
src = src.substring(5); | ||
if (youtubeId) { | ||
src = `https://www.youtube.com/embed/${youtubeId}`; | ||
attributes = 'title="YouTube video player" frameborder="0" allow="accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture"'; | ||
} | ||
inner = instagramEmbed || `<div class="ratio ratio-16x9"><iframe src="${src}" ${attributes} allowfullscreen></iframe></div>`; | ||
} | ||
const spinner = `<div class="position-absolute top-50 start-50 translate-middle text-white"><div class="spinner-border" style="width: 3rem height: 3rem" role="status"></div></div>`; | ||
return `<div class="carousel-item ${!i ? 'active' : ''}" style="min-height: 100px">${spinner}${inner}</div>`; | ||
}) | ||
.join(''); | ||
const controlsHtml = this.sources.length < 2 | ||
? '' | ||
: ` | ||
<button class="carousel-control carousel-control-prev h-75 m-auto" type="button" data-bs-target="#lightboxCarousel-${this.hash}" data-bs-slide="prev"> | ||
<span class="carousel-control-prev-icon" aria-hidden="true"></span> | ||
<span class="visually-hidden">Previous</span> | ||
</button> | ||
<button class="carousel-control carousel-control-next h-75 m-auto" type="button" data-bs-target="#lightboxCarousel-${this.hash}" data-bs-slide="next"> | ||
<span class="carousel-control-next-icon" aria-hidden="true"></span> | ||
<span class="visually-hidden">Next</span> | ||
</button>`; | ||
const html = ` | ||
<div id="lightboxCarousel-${this.hash}" class="lightbox-carousel carousel" data-bs-ride="carousel"> | ||
<div class="carousel-inner"> | ||
${slidesHtml} | ||
</div> | ||
${controlsHtml} | ||
</div>`; | ||
template.innerHTML = html.trim(); | ||
this.carouselElement = template.content.firstChild; | ||
this.carousel = new bootstrap.Carousel(this.carouselElement, this.carouselOptions); | ||
this.carousel.to(this.sources.includes(this.src) ? this.sources.indexOf(this.src) : 0); | ||
// this.carouselElement.querySelector('[data-bs-slide="prev"]').addEventListener('click', this.carousel.prev) | ||
return this.carousel; | ||
} | ||
createModal() { | ||
const template = document.createElement('template'); | ||
const btnInner = '<svg xmlns="http://www.w3.org/2000/svg" style="position: relative; top: -5px;" viewBox="0 0 16 16" fill="#fff"><path d="M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z"/></svg>)'; | ||
const html = ` | ||
<div class="modal lightbox fade" id="lightboxModal-${this.hash}" tabindex="-1" aria-hidden="true"> | ||
<div class="modal-dialog modal-dialog-centered modal-xl"> | ||
<div class="modal-content border-0" style="background: black"> | ||
<div class="modal-body p-0"> | ||
<button type="button" class="btn-close position-absolute top-0 end-0 p-3" data-bs-dismiss="modal" aria-label="Close" style="z-index: 2; background: none;">${btnInner}</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div>`; | ||
template.innerHTML = html.trim(); | ||
this.modalElement = template.content.firstChild; | ||
this.modalElement.querySelector('.modal-body').appendChild(this.carouselElement); | ||
this.modalElement.addEventListener('hidden.bs.modal', () => this.modalElement.remove()); | ||
this.modal = new bootstrap.Modal(this.modalElement, this.modalOptions); | ||
return this.modal; | ||
} | ||
randomHash(length = 8) { | ||
return Array.from({ length }, () => Math.floor(Math.random() * 36).toString(36)).join(''); | ||
} | ||
} | ||
Lightbox.allowedEmbedTypes = ['embed', 'youtube', 'vimeo', 'instagram', 'url']; | ||
Lightbox.allowedMediaTypes = [...Lightbox.allowedEmbedTypes, 'image']; | ||
Lightbox.defaultSelector = '[data-toggle="lightbox"]'; | ||
document.querySelectorAll(Lightbox.defaultSelector).forEach((el) => el.addEventListener('click', (e) => { | ||
e.preventDefault(); | ||
const lightbox = new Lightbox(el); | ||
lightbox.show(); | ||
})); | ||
exports.default = Lightbox; |
{ | ||
"name": "bs5-lightbox", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"author": { | ||
@@ -21,3 +21,3 @@ "name": "Travis Aaron Wagner", | ||
"license": "MIT", | ||
"main": "dist/index.esm.js", | ||
"main": "dist/index.js", | ||
"repository": { | ||
@@ -27,5 +27,2 @@ "type": "git", | ||
}, | ||
"dependencies": { | ||
"@babel/preset-typescript": "^7.15.0" | ||
}, | ||
"peerDependencies": { | ||
@@ -35,17 +32,5 @@ "bootstrap": "^5.1.1" | ||
"scripts": { | ||
"bundle": "webpack --mode=production", | ||
"clean": "fse emptyDir --quiet dist/", | ||
"babel": "babel dist/index.esm.js -o dist/index.babel.js", | ||
"minify": "uglifyjs --compress --mangle --output dist/index.min.js -- dist/index.babel.js", | ||
"build": "run-s compile babel minify bundle", | ||
"compile": "tsc", | ||
"test": "jest --config jest.config.ts", | ||
"build+test": "run-s build test", | ||
"format": "prettier --write \"src/**/*.(js|ts)\"", | ||
"lint": "eslint src --ext .js,.ts", | ||
"lint:fix": "eslint src --fix --ext .js,.ts", | ||
"serve": "browser-sync start --server --files \"dist/*.css, dist/*.js, **/*.html, !node_modules/**/*.html\" --open false", | ||
"watch:ts": "npm run-s build; onchange \"src/*.ts\" -- run-s build -s", | ||
"watch": "run-p serve watch:*", | ||
"start": "run-s clean watch" | ||
"build": "tsc && webpack --mode=production", | ||
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"", | ||
"lint": "eslint src --ext .js,.ts" | ||
}, | ||
@@ -56,35 +41,9 @@ "bundleDependencies": false, | ||
"devDependencies": { | ||
"@atao60/fse-cli": "^0.1.7", | ||
"@babel/cli": "^7.15.7", | ||
"@babel/core": "^7.15.5", | ||
"@babel/plugin-transform-object-assign": "^7.14.5", | ||
"@babel/plugin-transform-runtime": "^7.15.0", | ||
"@babel/preset-env": "^7.15.6", | ||
"@types/isomorphic-fetch": "0.0.35", | ||
"@types/jest": "^27.0.2", | ||
"@types/regenerator-runtime": "^0.13.1", | ||
"@typescript-eslint/eslint-plugin": "^4.31.2", | ||
"@typescript-eslint/parser": "^4.31.2", | ||
"autoprefixer": "^10.3.5", | ||
"browser-sync": "^2.27.5", | ||
"@typescript-eslint/eslint-plugin": "^4.33.0", | ||
"@typescript-eslint/parser": "^4.33.0", | ||
"eslint": "^7.32.0", | ||
"eslint-config-standard": "^16.0.3", | ||
"eslint-plugin-import": "^2.24.2", | ||
"eslint-plugin-jest": "^24.4.2", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^5.1.0", | ||
"eslint-plugin-standard": "^5.0.0", | ||
"isomorphic-fetch": "^3.0.0", | ||
"jest": "^27.2.1", | ||
"node-sass": "^6.0.1", | ||
"npm-run-all": "^4.1.5", | ||
"onchange": "^7.1.0", | ||
"postcss": "^8.3.7", | ||
"postcss-cli": "^8.3.1", | ||
"prettier": "^2.4.1", | ||
"stylelint": "^13.13.1", | ||
"ts-jest": "^27.0.5", | ||
"terser-webpack-plugin": "^5.2.4", | ||
"typescript": "^4.4.3", | ||
"uglify-js": "^3.14.2", | ||
"webpack": "^5.56.0", | ||
"webpack": "^5.56.1", | ||
"webpack-cli": "^4.8.0" | ||
@@ -102,3 +61,4 @@ }, | ||
"not Explorer <= 11" | ||
] | ||
], | ||
"files": ["dist/**/*"] | ||
} |
@@ -16,3 +16,3 @@ # Lightbox for Bootstrap 5 | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/bs5-lightbox@1.6.0/dist/index.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/bs5-lightbox@1.6.3/dist/index.bundle.min.js"></script> | ||
``` | ||
@@ -19,0 +19,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
1
8
0
79629
10
1044
1
- Removed@babel/preset-typescript@^7.15.0
- Removed@ampproject/remapping@2.3.0(transitive)
- Removed@babel/code-frame@7.26.2(transitive)
- Removed@babel/compat-data@7.26.2(transitive)
- Removed@babel/core@7.26.0(transitive)
- Removed@babel/generator@7.26.2(transitive)
- Removed@babel/helper-annotate-as-pure@7.25.9(transitive)
- Removed@babel/helper-compilation-targets@7.25.9(transitive)
- Removed@babel/helper-create-class-features-plugin@7.25.9(transitive)
- Removed@babel/helper-member-expression-to-functions@7.25.9(transitive)
- Removed@babel/helper-module-imports@7.25.9(transitive)
- Removed@babel/helper-module-transforms@7.26.0(transitive)
- Removed@babel/helper-optimise-call-expression@7.25.9(transitive)
- Removed@babel/helper-plugin-utils@7.25.9(transitive)
- Removed@babel/helper-replace-supers@7.25.9(transitive)
- Removed@babel/helper-simple-access@7.25.9(transitive)
- Removed@babel/helper-skip-transparent-expression-wrappers@7.25.9(transitive)
- Removed@babel/helper-string-parser@7.25.9(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@babel/helper-validator-option@7.25.9(transitive)
- Removed@babel/helpers@7.26.0(transitive)
- Removed@babel/parser@7.26.2(transitive)
- Removed@babel/plugin-syntax-jsx@7.25.9(transitive)
- Removed@babel/plugin-syntax-typescript@7.25.9(transitive)
- Removed@babel/plugin-transform-modules-commonjs@7.25.9(transitive)
- Removed@babel/plugin-transform-typescript@7.25.9(transitive)
- Removed@babel/preset-typescript@7.26.0(transitive)
- Removed@babel/template@7.25.9(transitive)
- Removed@babel/traverse@7.25.9(transitive)
- Removed@babel/types@7.26.0(transitive)
- Removed@jridgewell/gen-mapping@0.3.5(transitive)
- Removed@jridgewell/resolve-uri@3.1.2(transitive)
- Removed@jridgewell/set-array@1.2.1(transitive)
- Removed@jridgewell/sourcemap-codec@1.5.0(transitive)
- Removed@jridgewell/trace-mapping@0.3.25(transitive)
- Removedbrowserslist@4.24.2(transitive)
- Removedcaniuse-lite@1.0.30001683(transitive)
- Removedconvert-source-map@2.0.0(transitive)
- Removeddebug@4.3.7(transitive)
- Removedelectron-to-chromium@1.5.64(transitive)
- Removedescalade@3.2.0(transitive)
- Removedgensync@1.0.0-beta.2(transitive)
- Removedglobals@11.12.0(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjsesc@3.0.2(transitive)
- Removedjson5@2.2.3(transitive)
- Removedlru-cache@5.1.1(transitive)
- Removedms@2.1.3(transitive)
- Removednode-releases@2.0.18(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedsemver@6.3.1(transitive)
- Removedupdate-browserslist-db@1.1.1(transitive)
- Removedyallist@3.1.1(transitive)