mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-24 14:13:06 +02:00
Dist (#28392)
This commit is contained in:
82
js/dist/dom/data.js
vendored
Normal file
82
js/dist/dom/data.js
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
/*!
|
||||
* Bootstrap data.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = global || self, global.Data = factory());
|
||||
}(this, function () { 'use strict';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
var mapData = function () {
|
||||
var storeData = {};
|
||||
var id = 1;
|
||||
return {
|
||||
set: function set(element, key, data) {
|
||||
if (typeof element.key === 'undefined') {
|
||||
element.key = {
|
||||
key: key,
|
||||
id: id
|
||||
};
|
||||
id++;
|
||||
}
|
||||
|
||||
storeData[element.key.id] = data;
|
||||
},
|
||||
get: function get(element, key) {
|
||||
if (!element || typeof element.key === 'undefined') {
|
||||
return null;
|
||||
}
|
||||
|
||||
var keyProperties = element.key;
|
||||
|
||||
if (keyProperties.key === key) {
|
||||
return storeData[keyProperties.id];
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
delete: function _delete(element, key) {
|
||||
if (typeof element.key === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
var keyProperties = element.key;
|
||||
|
||||
if (keyProperties.key === key) {
|
||||
delete storeData[keyProperties.id];
|
||||
delete element.key;
|
||||
}
|
||||
}
|
||||
};
|
||||
}();
|
||||
|
||||
var Data = {
|
||||
setData: function setData(instance, key, data) {
|
||||
mapData.set(instance, key, data);
|
||||
},
|
||||
getData: function getData(instance, key) {
|
||||
return mapData.get(instance, key);
|
||||
},
|
||||
removeData: function removeData(instance, key) {
|
||||
mapData.delete(instance, key);
|
||||
}
|
||||
};
|
||||
|
||||
return Data;
|
||||
|
||||
}));
|
||||
//# sourceMappingURL=data.js.map
|
1
js/dist/dom/data.js.map
vendored
Normal file
1
js/dist/dom/data.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"data.js","sources":["../../src/dom/data.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst mapData = (() => {\n const storeData = {}\n let id = 1\n return {\n set(element, key, data) {\n if (typeof element.key === 'undefined') {\n element.key = {\n key,\n id\n }\n id++\n }\n\n storeData[element.key.id] = data\n },\n get(element, key) {\n if (!element || typeof element.key === 'undefined') {\n return null\n }\n\n const keyProperties = element.key\n if (keyProperties.key === key) {\n return storeData[keyProperties.id]\n }\n return null\n },\n delete(element, key) {\n if (typeof element.key === 'undefined') {\n return\n }\n\n const keyProperties = element.key\n if (keyProperties.key === key) {\n delete storeData[keyProperties.id]\n delete element.key\n }\n }\n }\n})()\n\nconst Data = {\n setData(instance, key, data) {\n mapData.set(instance, key, data)\n },\n getData(instance, key) {\n return mapData.get(instance, key)\n },\n removeData(instance, key) {\n mapData.delete(instance, key)\n }\n}\n\nexport default Data\n"],"names":["mapData","storeData","id","set","element","key","data","get","keyProperties","delete","Data","setData","instance","getData","removeData"],"mappings":";;;;;;;;;;;EAAA;;;;;;;EAOA;;;;;EAMA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EAC3BN,IAAAA,OAAO,CAACG,GAAR,CAAYS,QAAZ,EAAsBP,GAAtB,EAA2BC,IAA3B;EACD,GAHU;EAIXO,EAAAA,OAJW,mBAIHD,QAJG,EAIOP,GAJP,EAIY;EACrB,WAAOL,OAAO,CAACO,GAAR,CAAYK,QAAZ,EAAsBP,GAAtB,CAAP;EACD,GANU;EAOXS,EAAAA,UAPW,sBAOAF,QAPA,EAOUP,GAPV,EAOe;EACxBL,IAAAA,OAAO,CAACS,MAAR,CAAeG,QAAf,EAAyBP,GAAzB;EACD;EATU,CAAb;;;;;;;;"}
|
317
js/dist/dom/eventhandler.js
vendored
Normal file
317
js/dist/dom/eventhandler.js
vendored
Normal file
@@ -0,0 +1,317 @@
|
||||
/*!
|
||||
* Bootstrap eventhandler.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./polyfill.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./polyfill.js'], factory) :
|
||||
(global = global || self, global.EventHandler = factory(global.Polyfill));
|
||||
}(this, function (Polyfill) { 'use strict';
|
||||
|
||||
Polyfill = Polyfill && Polyfill.hasOwnProperty('default') ? Polyfill['default'] : Polyfill;
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
var jQuery = window.jQuery; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): dom/eventHandler.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var namespaceRegex = /[^.]*(?=\..*)\.|.*/;
|
||||
var stripNameRegex = /\..*/;
|
||||
var keyEventRegex = /^key/;
|
||||
var stripUidRegex = /::\d+$/;
|
||||
var eventRegistry = {}; // Events storage
|
||||
|
||||
var uidEvent = 1;
|
||||
var customEvents = {
|
||||
mouseenter: 'mouseover',
|
||||
mouseleave: 'mouseout'
|
||||
};
|
||||
var nativeEvents = ['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'];
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Private methods
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
function getUidEvent(element, uid) {
|
||||
return uid && uid + "::" + uidEvent++ || element.uidEvent || uidEvent++;
|
||||
}
|
||||
|
||||
function getEvent(element) {
|
||||
var uid = getUidEvent(element);
|
||||
element.uidEvent = uid;
|
||||
return eventRegistry[uid] = eventRegistry[uid] || {};
|
||||
}
|
||||
|
||||
function fixEvent(event, element) {
|
||||
// Add which for key events
|
||||
if (event.which === null && keyEventRegex.test(event.type)) {
|
||||
event.which = event.charCode !== null ? event.charCode : event.keyCode;
|
||||
}
|
||||
|
||||
event.delegateTarget = element;
|
||||
}
|
||||
|
||||
function bootstrapHandler(element, fn) {
|
||||
return function handler(event) {
|
||||
fixEvent(event, element);
|
||||
|
||||
if (handler.oneOff) {
|
||||
EventHandler.off(element, event.type, fn);
|
||||
}
|
||||
|
||||
return fn.apply(element, [event]);
|
||||
};
|
||||
}
|
||||
|
||||
function bootstrapDelegationHandler(element, selector, fn) {
|
||||
return function handler(event) {
|
||||
var domElements = element.querySelectorAll(selector);
|
||||
|
||||
for (var target = event.target; target && target !== this; target = target.parentNode) {
|
||||
for (var i = domElements.length; i--;) {
|
||||
if (domElements[i] === target) {
|
||||
fixEvent(event, target);
|
||||
|
||||
if (handler.oneOff) {
|
||||
EventHandler.off(element, event.type, fn);
|
||||
}
|
||||
|
||||
return fn.apply(target, [event]);
|
||||
}
|
||||
}
|
||||
} // To please ESLint
|
||||
|
||||
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
function findHandler(events, handler, delegationSelector) {
|
||||
if (delegationSelector === void 0) {
|
||||
delegationSelector = null;
|
||||
}
|
||||
|
||||
var uidList = Object.keys(events);
|
||||
|
||||
for (var i = 0; i < uidList.length; i++) {
|
||||
var uid = uidList[i];
|
||||
var event = events[uid];
|
||||
|
||||
if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {
|
||||
return events[uid];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function normalizeParams(originalTypeEvent, handler, delegationFn) {
|
||||
var delegation = typeof handler === 'string';
|
||||
var originalHandler = delegation ? delegationFn : handler; // allow to get the native events from namespaced events ('click.bs.button' --> 'click')
|
||||
|
||||
var typeEvent = originalTypeEvent.replace(stripNameRegex, '');
|
||||
var custom = customEvents[typeEvent];
|
||||
|
||||
if (custom) {
|
||||
typeEvent = custom;
|
||||
}
|
||||
|
||||
var isNative = nativeEvents.indexOf(typeEvent) > -1;
|
||||
|
||||
if (!isNative) {
|
||||
typeEvent = originalTypeEvent;
|
||||
}
|
||||
|
||||
return [delegation, originalHandler, typeEvent];
|
||||
}
|
||||
|
||||
function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {
|
||||
if (typeof originalTypeEvent !== 'string' || !element) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!handler) {
|
||||
handler = delegationFn;
|
||||
delegationFn = null;
|
||||
}
|
||||
|
||||
var _normalizeParams = normalizeParams(originalTypeEvent, handler, delegationFn),
|
||||
delegation = _normalizeParams[0],
|
||||
originalHandler = _normalizeParams[1],
|
||||
typeEvent = _normalizeParams[2];
|
||||
|
||||
var events = getEvent(element);
|
||||
var handlers = events[typeEvent] || (events[typeEvent] = {});
|
||||
var previousFn = findHandler(handlers, originalHandler, delegation ? handler : null);
|
||||
|
||||
if (previousFn) {
|
||||
previousFn.oneOff = previousFn.oneOff && oneOff;
|
||||
return;
|
||||
}
|
||||
|
||||
var uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''));
|
||||
var fn = !delegation ? bootstrapHandler(element, handler) : bootstrapDelegationHandler(element, handler, delegationFn);
|
||||
fn.delegationSelector = delegation ? handler : null;
|
||||
fn.originalHandler = originalHandler;
|
||||
fn.oneOff = oneOff;
|
||||
fn.uidEvent = uid;
|
||||
handlers[uid] = fn;
|
||||
element.addEventListener(typeEvent, fn, delegation);
|
||||
}
|
||||
|
||||
function removeHandler(element, events, typeEvent, handler, delegationSelector) {
|
||||
var fn = findHandler(events[typeEvent], handler, delegationSelector);
|
||||
|
||||
if (fn === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));
|
||||
delete events[typeEvent][fn.uidEvent];
|
||||
}
|
||||
|
||||
function removeNamespacedHandlers(element, events, typeEvent, namespace) {
|
||||
var storeElementEvent = events[typeEvent] || {};
|
||||
Object.keys(storeElementEvent).forEach(function (handlerKey) {
|
||||
if (handlerKey.indexOf(namespace) > -1) {
|
||||
var event = storeElementEvent[handlerKey];
|
||||
removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var EventHandler = {
|
||||
on: function on(element, event, handler, delegationFn) {
|
||||
addHandler(element, event, handler, delegationFn, false);
|
||||
},
|
||||
one: function one(element, event, handler, delegationFn) {
|
||||
addHandler(element, event, handler, delegationFn, true);
|
||||
},
|
||||
off: function off(element, originalTypeEvent, handler, delegationFn) {
|
||||
if (typeof originalTypeEvent !== 'string' || !element) {
|
||||
return;
|
||||
}
|
||||
|
||||
var _normalizeParams2 = normalizeParams(originalTypeEvent, handler, delegationFn),
|
||||
delegation = _normalizeParams2[0],
|
||||
originalHandler = _normalizeParams2[1],
|
||||
typeEvent = _normalizeParams2[2];
|
||||
|
||||
var inNamespace = typeEvent !== originalTypeEvent;
|
||||
var events = getEvent(element);
|
||||
var isNamespace = originalTypeEvent.charAt(0) === '.';
|
||||
|
||||
if (typeof originalHandler !== 'undefined') {
|
||||
// Simplest case: handler is passed, remove that listener ONLY.
|
||||
if (!events || !events[typeEvent]) {
|
||||
return;
|
||||
}
|
||||
|
||||
removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (isNamespace) {
|
||||
Object.keys(events).forEach(function (elementEvent) {
|
||||
removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.substr(1));
|
||||
});
|
||||
}
|
||||
|
||||
var storeElementEvent = events[typeEvent] || {};
|
||||
Object.keys(storeElementEvent).forEach(function (keyHandlers) {
|
||||
var handlerKey = keyHandlers.replace(stripUidRegex, '');
|
||||
|
||||
if (!inNamespace || originalTypeEvent.indexOf(handlerKey) > -1) {
|
||||
var event = storeElementEvent[keyHandlers];
|
||||
removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
|
||||
}
|
||||
});
|
||||
},
|
||||
trigger: function trigger(element, event, args) {
|
||||
if (typeof event !== 'string' || !element) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var typeEvent = event.replace(stripNameRegex, '');
|
||||
var inNamespace = event !== typeEvent;
|
||||
var isNative = nativeEvents.indexOf(typeEvent) > -1;
|
||||
var jQueryEvent;
|
||||
var bubbles = true;
|
||||
var nativeDispatch = true;
|
||||
var defaultPrevented = false;
|
||||
var evt = null;
|
||||
|
||||
if (inNamespace && typeof jQuery !== 'undefined') {
|
||||
jQueryEvent = jQuery.Event(event, args);
|
||||
jQuery(element).trigger(jQueryEvent);
|
||||
bubbles = !jQueryEvent.isPropagationStopped();
|
||||
nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
|
||||
defaultPrevented = jQueryEvent.isDefaultPrevented();
|
||||
}
|
||||
|
||||
if (isNative) {
|
||||
evt = document.createEvent('HTMLEvents');
|
||||
evt.initEvent(typeEvent, bubbles, true);
|
||||
} else {
|
||||
evt = new CustomEvent(event, {
|
||||
bubbles: bubbles,
|
||||
cancelable: true
|
||||
});
|
||||
} // merge custom informations in our event
|
||||
|
||||
|
||||
if (typeof args !== 'undefined') {
|
||||
Object.keys(args).forEach(function (key) {
|
||||
Object.defineProperty(evt, key, {
|
||||
get: function get() {
|
||||
return args[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (defaultPrevented) {
|
||||
evt.preventDefault();
|
||||
|
||||
if (!Polyfill.defaultPreventedPreservedOnDispatch) {
|
||||
Object.defineProperty(evt, 'defaultPrevented', {
|
||||
get: function get() {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (nativeDispatch) {
|
||||
element.dispatchEvent(evt);
|
||||
}
|
||||
|
||||
if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {
|
||||
jQueryEvent.preventDefault();
|
||||
}
|
||||
|
||||
return evt;
|
||||
}
|
||||
};
|
||||
|
||||
return EventHandler;
|
||||
|
||||
}));
|
||||
//# sourceMappingURL=eventhandler.js.map
|
1
js/dist/dom/eventhandler.js.map
vendored
Normal file
1
js/dist/dom/eventhandler.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
129
js/dist/dom/manipulator.js
vendored
Normal file
129
js/dist/dom/manipulator.js
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
/*!
|
||||
* Bootstrap manipulator.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = global || self, global.Manipulator = factory());
|
||||
}(this, function () { 'use strict';
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
}));
|
||||
}
|
||||
|
||||
ownKeys.forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): dom/manipulator.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
function normalizeData(val) {
|
||||
if (val === 'true') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (val === 'false') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (val === Number(val).toString()) {
|
||||
return Number(val);
|
||||
}
|
||||
|
||||
if (val === '' || val === 'null') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
function normalizeDataKey(key) {
|
||||
return key.replace(/[A-Z]/g, function (chr) {
|
||||
return chr.toLowerCase();
|
||||
});
|
||||
}
|
||||
|
||||
var Manipulator = {
|
||||
setDataAttribute: function setDataAttribute(element, key, value) {
|
||||
element.setAttribute("data-" + normalizeDataKey(key), value);
|
||||
},
|
||||
removeDataAttribute: function removeDataAttribute(element, key) {
|
||||
element.removeAttribute("data-" + normalizeDataKey(key));
|
||||
},
|
||||
getDataAttributes: function getDataAttributes(element) {
|
||||
if (!element) {
|
||||
return {};
|
||||
}
|
||||
|
||||
var attributes = _objectSpread({}, element.dataset);
|
||||
|
||||
Object.keys(attributes).forEach(function (key) {
|
||||
attributes[key] = normalizeData(attributes[key]);
|
||||
});
|
||||
return attributes;
|
||||
},
|
||||
getDataAttribute: function getDataAttribute(element, key) {
|
||||
return normalizeData(element.getAttribute("data-" + normalizeDataKey(key)));
|
||||
},
|
||||
offset: function offset(element) {
|
||||
var rect = element.getBoundingClientRect();
|
||||
return {
|
||||
top: rect.top + document.body.scrollTop,
|
||||
left: rect.left + document.body.scrollLeft
|
||||
};
|
||||
},
|
||||
position: function position(element) {
|
||||
return {
|
||||
top: element.offsetTop,
|
||||
left: element.offsetLeft
|
||||
};
|
||||
},
|
||||
toggleClass: function toggleClass(element, className) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.classList.contains(className)) {
|
||||
element.classList.remove(className);
|
||||
} else {
|
||||
element.classList.add(className);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return Manipulator;
|
||||
|
||||
}));
|
||||
//# sourceMappingURL=manipulator.js.map
|
1
js/dist/dom/manipulator.js.map
vendored
Normal file
1
js/dist/dom/manipulator.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"manipulator.js","sources":["../../src/dom/manipulator.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(val) {\n if (val === 'true') {\n return true\n }\n\n if (val === 'false') {\n return false\n }\n\n if (val === Number(val).toString()) {\n return Number(val)\n }\n\n if (val === '' || val === 'null') {\n return null\n }\n\n return val\n}\n\nfunction normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, (chr) => chr.toLowerCase())\n}\n\nconst Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-${normalizeDataKey(key)}`, value)\n },\n\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-${normalizeDataKey(key)}`)\n },\n\n getDataAttributes(element) {\n if (!element) {\n return {}\n }\n\n const attributes = {\n ...element.dataset\n }\n\n Object.keys(attributes).forEach((key) => {\n attributes[key] = normalizeData(attributes[key])\n })\n\n return attributes\n },\n\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-${normalizeDataKey(key)}`))\n },\n\n offset(element) {\n const rect = element.getBoundingClientRect()\n\n return {\n top: rect.top + document.body.scrollTop,\n left: rect.left + document.body.scrollLeft\n }\n },\n\n position(element) {\n return {\n top: element.offsetTop,\n left: element.offsetLeft\n }\n },\n\n toggleClass(element, className) {\n if (!element) {\n return\n }\n\n if (element.classList.contains(className)) {\n element.classList.remove(className)\n } else {\n element.classList.add(className)\n }\n }\n}\n\nexport default Manipulator\n"],"names":["normalizeData","val","Number","toString","normalizeDataKey","key","replace","chr","toLowerCase","Manipulator","setDataAttribute","element","value","setAttribute","removeDataAttribute","removeAttribute","getDataAttributes","attributes","dataset","Object","keys","forEach","getDataAttribute","getAttribute","offset","rect","getBoundingClientRect","top","document","body","scrollTop","left","scrollLeft","position","offsetTop","offsetLeft","toggleClass","className","classList","contains","remove","add"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAA/B;EACD,KAFD;EAIA,WAAOY,UAAP;EACD,GAvBiB;EAyBlBK,EAAAA,gBAzBkB,4BAyBDX,OAzBC,EAyBQN,GAzBR,EAyBa;EAC7B,WAAOL,aAAa,CAACW,OAAO,CAACY,YAAR,WAA6BnB,gBAAgB,CAACC,GAAD,CAA7C,CAAD,CAApB;EACD,GA3BiB;EA6BlBmB,EAAAA,MA7BkB,kBA6BXb,OA7BW,EA6BF;EACd,QAAMc,IAAI,GAAGd,OAAO,CAACe,qBAAR,EAAb;EAEA,WAAO;EACLC,MAAAA,GAAG,EAAEF,IAAI,CAACE,GAAL,GAAWC,QAAQ,CAACC,IAAT,CAAcC,SADzB;EAELC,MAAAA,IAAI,EAAEN,IAAI,CAACM,IAAL,GAAYH,QAAQ,CAACC,IAAT,CAAcG;EAF3B,KAAP;EAID,GApCiB;EAsClBC,EAAAA,QAtCkB,oBAsCTtB,OAtCS,EAsCA;EAChB,WAAO;EACLgB,MAAAA,GAAG,EAAEhB,OAAO,CAACuB,SADR;EAELH,MAAAA,IAAI,EAAEpB,OAAO,CAACwB;EAFT,KAAP;EAID,GA3CiB;EA6ClBC,EAAAA,WA7CkB,uBA6CNzB,OA7CM,EA6CG0B,SA7CH,EA6Cc;EAC9B,QAAI,CAAC1B,OAAL,EAAc;EACZ;EACD;;EAED,QAAIA,OAAO,CAAC2B,SAAR,CAAkBC,QAAlB,CAA2BF,SAA3B,CAAJ,EAA2C;EACzC1B,MAAAA,OAAO,CAAC2B,SAAR,CAAkBE,MAAlB,CAAyBH,SAAzB;EACD,KAFD,MAEO;EACL1B,MAAAA,OAAO,CAAC2B,SAAR,CAAkBG,GAAlB,CAAsBJ,SAAtB;EACD;EACF;EAvDiB,CAApB;;;;;;;;"}
|
126
js/dist/dom/polyfill.js
vendored
Normal file
126
js/dist/dom/polyfill.js
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
/*!
|
||||
* Bootstrap polyfill.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = global || self, global.Polyfill = factory());
|
||||
}(this, function () { 'use strict';
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
var MAX_UID = 1000000;
|
||||
var jQuery = window.jQuery; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Public Util Api
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
var getUID = function getUID(prefix) {
|
||||
do {
|
||||
// eslint-disable-next-line no-bitwise
|
||||
prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
|
||||
} while (document.getElementById(prefix));
|
||||
|
||||
return prefix;
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): dom/polyfill.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
/* istanbul ignore next */
|
||||
|
||||
var Polyfill = function () {
|
||||
// MSEdge resets defaultPrevented flag upon dispatchEvent call if at least one listener is attached
|
||||
var defaultPreventedPreservedOnDispatch = function () {
|
||||
var e = new CustomEvent('Bootstrap', {
|
||||
cancelable: true
|
||||
});
|
||||
var element = document.createElement('div');
|
||||
element.addEventListener('Bootstrap', function () {
|
||||
return null;
|
||||
});
|
||||
e.preventDefault();
|
||||
element.dispatchEvent(e);
|
||||
return e.defaultPrevented;
|
||||
}();
|
||||
|
||||
var find = Element.prototype.querySelectorAll;
|
||||
var findOne = Element.prototype.querySelector;
|
||||
var scopeSelectorRegex = /:scope\b/;
|
||||
|
||||
var supportScopeQuery = function () {
|
||||
var element = document.createElement('div');
|
||||
|
||||
try {
|
||||
element.querySelectorAll(':scope *');
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}();
|
||||
|
||||
if (!supportScopeQuery) {
|
||||
find = function find(selector) {
|
||||
if (!scopeSelectorRegex.test(selector)) {
|
||||
return this.querySelectorAll(selector);
|
||||
}
|
||||
|
||||
var hasId = Boolean(this.id);
|
||||
|
||||
if (!hasId) {
|
||||
this.id = getUID('scope');
|
||||
}
|
||||
|
||||
var nodeList = null;
|
||||
|
||||
try {
|
||||
selector = selector.replace(scopeSelectorRegex, "#" + this.id);
|
||||
nodeList = this.querySelectorAll(selector);
|
||||
} finally {
|
||||
if (!hasId) {
|
||||
this.removeAttribute('id');
|
||||
}
|
||||
}
|
||||
|
||||
return nodeList;
|
||||
};
|
||||
|
||||
findOne = function findOne(selector) {
|
||||
if (!scopeSelectorRegex.test(selector)) {
|
||||
return this.querySelector(selector);
|
||||
}
|
||||
|
||||
var matches = find.call(this, selector);
|
||||
|
||||
if (typeof matches[0] !== 'undefined') {
|
||||
return matches[0];
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
defaultPreventedPreservedOnDispatch: defaultPreventedPreservedOnDispatch,
|
||||
find: find,
|
||||
findOne: findOne
|
||||
};
|
||||
}();
|
||||
|
||||
return Polyfill;
|
||||
|
||||
}));
|
||||
//# sourceMappingURL=polyfill.js.map
|
1
js/dist/dom/polyfill.js.map
vendored
Normal file
1
js/dist/dom/polyfill.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
131
js/dist/dom/selectorengine.js
vendored
Normal file
131
js/dist/dom/selectorengine.js
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
/*!
|
||||
* Bootstrap selectorengine.js v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./polyfill.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./polyfill.js'], factory) :
|
||||
(global = global || self, global.SelectorEngine = factory(global.Polyfill));
|
||||
}(this, function (Polyfill) { 'use strict';
|
||||
|
||||
Polyfill = Polyfill && Polyfill.hasOwnProperty('default') ? Polyfill['default'] : Polyfill;
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
var jQuery = window.jQuery; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
||||
|
||||
var makeArray = function makeArray(nodeList) {
|
||||
if (!nodeList) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [].slice.call(nodeList);
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.3.1): dom/selectorEngine.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var findFn = Polyfill.find;
|
||||
var _findOne = Polyfill.findOne;
|
||||
var NODE_TEXT = 3;
|
||||
var SelectorEngine = {
|
||||
matches: function matches(element, selector) {
|
||||
return element.matches(selector);
|
||||
},
|
||||
find: function find(selector, element) {
|
||||
if (element === void 0) {
|
||||
element = document.documentElement;
|
||||
}
|
||||
|
||||
if (typeof selector !== 'string') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return findFn.call(element, selector);
|
||||
},
|
||||
findOne: function findOne(selector, element) {
|
||||
if (element === void 0) {
|
||||
element = document.documentElement;
|
||||
}
|
||||
|
||||
if (typeof selector !== 'string') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return _findOne.call(element, selector);
|
||||
},
|
||||
children: function children(element, selector) {
|
||||
var _this = this;
|
||||
|
||||
if (typeof selector !== 'string') {
|
||||
return null;
|
||||
}
|
||||
|
||||
var children = makeArray(element.children);
|
||||
return children.filter(function (child) {
|
||||
return _this.matches(child, selector);
|
||||
});
|
||||
},
|
||||
parents: function parents(element, selector) {
|
||||
if (typeof selector !== 'string') {
|
||||
return null;
|
||||
}
|
||||
|
||||
var parents = [];
|
||||
var ancestor = element.parentNode;
|
||||
|
||||
while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
|
||||
if (this.matches(ancestor, selector)) {
|
||||
parents.push(ancestor);
|
||||
}
|
||||
|
||||
ancestor = ancestor.parentNode;
|
||||
}
|
||||
|
||||
return parents;
|
||||
},
|
||||
closest: function closest(element, selector) {
|
||||
if (typeof selector !== 'string') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return element.closest(selector);
|
||||
},
|
||||
prev: function prev(element, selector) {
|
||||
if (typeof selector !== 'string') {
|
||||
return null;
|
||||
}
|
||||
|
||||
var siblings = [];
|
||||
var previous = element.previousSibling;
|
||||
|
||||
while (previous && previous.nodeType === Node.ELEMENT_NODE && previous.nodeType !== NODE_TEXT) {
|
||||
if (this.matches(previous, selector)) {
|
||||
siblings.push(previous);
|
||||
}
|
||||
|
||||
previous = previous.previousSibling;
|
||||
}
|
||||
|
||||
return siblings;
|
||||
}
|
||||
};
|
||||
|
||||
return SelectorEngine;
|
||||
|
||||
}));
|
||||
//# sourceMappingURL=selectorengine.js.map
|
1
js/dist/dom/selectorengine.js.map
vendored
Normal file
1
js/dist/dom/selectorengine.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user