Skip to content

Commit

Permalink
Updated shorter-js
Browse files Browse the repository at this point in the history
  • Loading branch information
thednp committed Feb 14, 2022
1 parent ba090ff commit 4b1d28a
Show file tree
Hide file tree
Showing 34 changed files with 507 additions and 439 deletions.
10 changes: 5 additions & 5 deletions dist/bootstrap-native-v4-esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Native JavaScript for Bootstrap v4.1.0alpha6 (https://thednp.github.io/bootstrap.native/)
* Native JavaScript for Bootstrap v4.1.0alpha7 (https://thednp.github.io/bootstrap.native/)
* Copyright 2015-2022 © dnp_theme
* Licensed under MIT (https://github.com/thednp/bootstrap.native/blob/master/LICENSE)
*/
Expand Down Expand Up @@ -28,9 +28,9 @@ var transitionDelay = 'webkitTransition' in documentHead.style ? 'webkitTransiti

/**
* A global namespace for:
* * `transitionProperty` string for Firefox,
* * `webkitTransition` for older Chrome / Safari browsers,
* * `transition` property for all other browsers.
* * `transitionProperty` string for modern brosers,
* * `webkitTransition` for legacy Chrome / Safari browsers
*
* @type {string}
*/
var transitionProperty = 'webkitTransition' in documentHead.style ? 'webkitTransitionProperty' : 'transitionProperty';
Expand Down Expand Up @@ -2577,7 +2577,7 @@ function removeDataAPI(context) {
});
}

var version = "4.1.0alpha6";
var version = "4.1.0alpha7";

var Version = version;

Expand Down
4 changes: 2 additions & 2 deletions dist/bootstrap-native-v4-esm.min.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions dist/bootstrap-native-v4.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Native JavaScript for Bootstrap v4.1.0alpha6 (https://thednp.github.io/bootstrap.native/)
* Native JavaScript for Bootstrap v4.1.0alpha7 (https://thednp.github.io/bootstrap.native/)
* Copyright 2015-2022 © dnp_theme
* Licensed under MIT (https://github.com/thednp/bootstrap.native/blob/master/LICENSE)
*/
Expand Down Expand Up @@ -34,9 +34,9 @@

/**
* A global namespace for:
* * `transitionProperty` string for Firefox,
* * `webkitTransition` for older Chrome / Safari browsers,
* * `transition` property for all other browsers.
* * `transitionProperty` string for modern brosers,
* * `webkitTransition` for legacy Chrome / Safari browsers
*
* @type {string}
*/
var transitionProperty = 'webkitTransition' in documentHead.style ? 'webkitTransitionProperty' : 'transitionProperty';
Expand Down Expand Up @@ -2583,7 +2583,7 @@
});
}

var version = "4.1.0alpha6";
var version = "4.1.0alpha7";

var Version = version;

Expand Down
4 changes: 2 additions & 2 deletions dist/bootstrap-native-v4.min.js

Large diffs are not rendered by default.

72 changes: 38 additions & 34 deletions dist/bootstrap-native.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Native JavaScript for Bootstrap v4.1.0alpha6 (https://thednp.github.io/bootstrap.native/)
* Native JavaScript for Bootstrap v4.1.0alpha7 (https://thednp.github.io/bootstrap.native/)
* Copyright 2015-2022 © dnp_theme
* Licensed under MIT (https://github.com/thednp/bootstrap.native/blob/master/LICENSE)
*/
Expand Down Expand Up @@ -131,9 +131,7 @@ const transitionEndEvent = 'transitionend';
const transitionDelay = 'transitionDelay';

/**
* A global namespace for:
* * `transitionProperty` string for Firefox,
* * `transition` property for all other browsers.
* A global namespace for `transitionProperty` string for modern browsers.
*
* @type {string}
*/
Expand Down Expand Up @@ -215,7 +213,7 @@ function emulateTransitionEnd(element, handler) {
if (duration) {
/**
* Wrap the handler in on -> off callback
* @type {EventListenerObject['handleEvent']} e Event object
* @type {EventListener} e Event object
*/
const transitionEndWrapper = (e) => {
if (e.target === element) {
Expand Down Expand Up @@ -302,7 +300,7 @@ const ObjectAssign = (obj, source) => Object.assign(obj, source);
*
* @param {HTMLElement | Element} element target
* @param {string} classNAME to check
* @return {boolean}
* @returns {boolean}
*/
function hasClass(element, classNAME) {
return element.classList.contains(classNAME);
Expand All @@ -313,6 +311,7 @@ function hasClass(element, classNAME) {
*
* @param {HTMLElement | Element} element target
* @param {string} classNAME to remove
* @returns {void}
*/
function removeClass(element, classNAME) {
element.classList.remove(classNAME);
Expand Down Expand Up @@ -441,8 +440,9 @@ const alertComponent = 'Alert';

/**
* Shortcut for `HTMLElement.getAttribute()` method.
* @param {HTMLElement | Element} element target element
* @param {string} attribute attribute name
* @param {HTMLElement | Element} element target element
* @param {string} attribute attribute name
* @returns {string?} attribute value
*/
const getAttribute = (element, attribute) => element.getAttribute(attribute);

Expand Down Expand Up @@ -539,7 +539,7 @@ function normalizeOptions(element, defaultOps, inputOps, ns) {
return normalOps;
}

var version = "4.1.0alpha6";
var version = "4.1.0alpha7";

const Version = version;

Expand Down Expand Up @@ -736,6 +736,7 @@ const ariaPressed = 'aria-pressed';
* @param {HTMLElement | Element} element target element
* @param {string} attribute attribute name
* @param {string} value attribute value
* @returns {void}
*/
const setAttribute = (element, attribute, value) => element.setAttribute(attribute, value);

Expand All @@ -744,6 +745,7 @@ const setAttribute = (element, attribute, value) => element.setAttribute(attribu
*
* @param {HTMLElement | Element} element target
* @param {string} classNAME to add
* @returns {void}
*/
function addClass(element, classNAME) {
element.classList.add(classNAME);
Expand Down Expand Up @@ -1039,7 +1041,7 @@ const Timer = {
* @param {HTMLElement | Element | string} target target element
* @param {ReturnType<TimerHandler>} callback the callback
* @param {number} delay the execution delay
* @param {string=} key a unique
* @param {string=} key a unique key
*/
set: (target, callback, delay, key) => {
const element = querySelector(target);
Expand Down Expand Up @@ -2041,6 +2043,7 @@ const keyEscape = 'Escape';
* Shortcut for `HTMLElement.hasAttribute()` method.
* @param {HTMLElement | Element} element target element
* @param {string} attribute attribute name
* @returns {boolean} the query result
*/
const hasAttribute = (element, attribute) => element.hasAttribute(attribute);

Expand Down Expand Up @@ -2579,6 +2582,7 @@ const ariaModal = 'aria-modal';
* Shortcut for `HTMLElement.removeAttribute()` method.
* @param {HTMLElement | Element} element target element
* @param {string} attribute attribute name
* @returns {void}
*/
const removeAttribute = (element, attribute) => element.removeAttribute(attribute);

Expand Down Expand Up @@ -4045,30 +4049,6 @@ const focusoutEvent = 'focusout';
*/
const mousehoverEvent = 'hover';

// @ts-ignore
const { userAgentData: uaDATA } = navigator;

/**
* A global namespace for `userAgentData` object.
*/
const userAgentData = uaDATA;

const { userAgent: userAgentString } = navigator;

/**
* A global namespace for `navigator.userAgent` string.
*/
const userAgent = userAgentString;

const appleBrands = /(iPhone|iPod|iPad)/;

/**
* A global `boolean` for Apple browsers.
* @type {boolean}
*/
const isApple = !userAgentData ? appleBrands.test(userAgent)
: userAgentData.brands.some((/** @type {Record<string, any>} */x) => appleBrands.test(x.brand));

let elementUID = 1;
const elementIDMap = new Map();

Expand Down Expand Up @@ -4105,6 +4085,30 @@ function getUID(element, key) {
return result;
}

// @ts-ignore
const { userAgentData: uaDATA } = navigator;

/**
* A global namespace for `userAgentData` object.
*/
const userAgentData = uaDATA;

const { userAgent: userAgentString } = navigator;

/**
* A global namespace for `navigator.userAgent` string.
*/
const userAgent = userAgentString;

const appleBrands = /(iPhone|iPod|iPad)/;

/**
* A global `boolean` for Apple browsers.
* @type {boolean}
*/
const isApple = !userAgentData ? appleBrands.test(userAgent)
: userAgentData.brands.some((/** @type {Record<string, any>} */x) => appleBrands.test(x.brand));

/**
* Global namespace for `data-bs-title` attribute.
*/
Expand Down
4 changes: 2 additions & 2 deletions dist/bootstrap-native.esm.min.js

Large diffs are not rendered by default.

72 changes: 38 additions & 34 deletions dist/bootstrap-native.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Native JavaScript for Bootstrap v4.1.0alpha6 (https://thednp.github.io/bootstrap.native/)
* Native JavaScript for Bootstrap v4.1.0alpha7 (https://thednp.github.io/bootstrap.native/)
* Copyright 2015-2022 © dnp_theme
* Licensed under MIT (https://github.com/thednp/bootstrap.native/blob/master/LICENSE)
*/
Expand Down Expand Up @@ -137,9 +137,7 @@
const transitionDelay = 'transitionDelay';

/**
* A global namespace for:
* * `transitionProperty` string for Firefox,
* * `transition` property for all other browsers.
* A global namespace for `transitionProperty` string for modern browsers.
*
* @type {string}
*/
Expand Down Expand Up @@ -221,7 +219,7 @@
if (duration) {
/**
* Wrap the handler in on -> off callback
* @type {EventListenerObject['handleEvent']} e Event object
* @type {EventListener} e Event object
*/
const transitionEndWrapper = (e) => {
if (e.target === element) {
Expand Down Expand Up @@ -308,7 +306,7 @@
*
* @param {HTMLElement | Element} element target
* @param {string} classNAME to check
* @return {boolean}
* @returns {boolean}
*/
function hasClass(element, classNAME) {
return element.classList.contains(classNAME);
Expand All @@ -319,6 +317,7 @@
*
* @param {HTMLElement | Element} element target
* @param {string} classNAME to remove
* @returns {void}
*/
function removeClass(element, classNAME) {
element.classList.remove(classNAME);
Expand Down Expand Up @@ -447,8 +446,9 @@

/**
* Shortcut for `HTMLElement.getAttribute()` method.
* @param {HTMLElement | Element} element target element
* @param {string} attribute attribute name
* @param {HTMLElement | Element} element target element
* @param {string} attribute attribute name
* @returns {string?} attribute value
*/
const getAttribute = (element, attribute) => element.getAttribute(attribute);

Expand Down Expand Up @@ -545,7 +545,7 @@
return normalOps;
}

var version = "4.1.0alpha6";
var version = "4.1.0alpha7";

const Version = version;

Expand Down Expand Up @@ -742,6 +742,7 @@
* @param {HTMLElement | Element} element target element
* @param {string} attribute attribute name
* @param {string} value attribute value
* @returns {void}
*/
const setAttribute = (element, attribute, value) => element.setAttribute(attribute, value);

Expand All @@ -750,6 +751,7 @@
*
* @param {HTMLElement | Element} element target
* @param {string} classNAME to add
* @returns {void}
*/
function addClass(element, classNAME) {
element.classList.add(classNAME);
Expand Down Expand Up @@ -1045,7 +1047,7 @@
* @param {HTMLElement | Element | string} target target element
* @param {ReturnType<TimerHandler>} callback the callback
* @param {number} delay the execution delay
* @param {string=} key a unique
* @param {string=} key a unique key
*/
set: (target, callback, delay, key) => {
const element = querySelector(target);
Expand Down Expand Up @@ -2047,6 +2049,7 @@
* Shortcut for `HTMLElement.hasAttribute()` method.
* @param {HTMLElement | Element} element target element
* @param {string} attribute attribute name
* @returns {boolean} the query result
*/
const hasAttribute = (element, attribute) => element.hasAttribute(attribute);

Expand Down Expand Up @@ -2585,6 +2588,7 @@
* Shortcut for `HTMLElement.removeAttribute()` method.
* @param {HTMLElement | Element} element target element
* @param {string} attribute attribute name
* @returns {void}
*/
const removeAttribute = (element, attribute) => element.removeAttribute(attribute);

Expand Down Expand Up @@ -4051,30 +4055,6 @@
*/
const mousehoverEvent = 'hover';

// @ts-ignore
const { userAgentData: uaDATA } = navigator;

/**
* A global namespace for `userAgentData` object.
*/
const userAgentData = uaDATA;

const { userAgent: userAgentString } = navigator;

/**
* A global namespace for `navigator.userAgent` string.
*/
const userAgent = userAgentString;

const appleBrands = /(iPhone|iPod|iPad)/;

/**
* A global `boolean` for Apple browsers.
* @type {boolean}
*/
const isApple = !userAgentData ? appleBrands.test(userAgent)
: userAgentData.brands.some((/** @type {Record<string, any>} */x) => appleBrands.test(x.brand));

let elementUID = 1;
const elementIDMap = new Map();

Expand Down Expand Up @@ -4111,6 +4091,30 @@
return result;
}

// @ts-ignore
const { userAgentData: uaDATA } = navigator;

/**
* A global namespace for `userAgentData` object.
*/
const userAgentData = uaDATA;

const { userAgent: userAgentString } = navigator;

/**
* A global namespace for `navigator.userAgent` string.
*/
const userAgent = userAgentString;

const appleBrands = /(iPhone|iPod|iPad)/;

/**
* A global `boolean` for Apple browsers.
* @type {boolean}
*/
const isApple = !userAgentData ? appleBrands.test(userAgent)
: userAgentData.brands.some((/** @type {Record<string, any>} */x) => appleBrands.test(x.brand));

/**
* Global namespace for `data-bs-title` attribute.
*/
Expand Down
4 changes: 2 additions & 2 deletions dist/bootstrap-native.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 4b1d28a

Please sign in to comment.