mirror of
https://github.com/tabler/tabler.git
synced 2025-12-24 10:48:14 +04:00
Release 1.0.0-beta6
This commit is contained in:
158
demo/dist/js/tabler.esm.js
vendored
158
demo/dist/js/tabler.esm.js
vendored
@@ -1,9 +1,9 @@
|
||||
/*!
|
||||
* Tabler v1.0.0-beta5 (https://tabler.io)
|
||||
* @version 1.0.0-beta5
|
||||
* Tabler v1.0.0-beta6 (https://tabler.io)
|
||||
* @version 1.0.0-beta6
|
||||
* @link https://tabler.io
|
||||
* Copyright 2018-2021 The Tabler Authors
|
||||
* Copyright 2018-2021 codecalm.net Paweł Kuna
|
||||
* Copyright 2018-2022 The Tabler Authors
|
||||
* Copyright 2018-2022 codecalm.net Paweł Kuna
|
||||
* Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
|
||||
*/
|
||||
var e,t,n="function"==typeof Map?new Map:(e=[],t=[],{has:function(t){return e.indexOf(t)>-1},get:function(n){return t[e.indexOf(n)]},set:function(n,o){-1===e.indexOf(n)&&(e.push(n),t.push(o));},delete:function(n){var o=e.indexOf(n);o>-1&&(e.splice(o,1),t.splice(o,1));}}),o=function(e){return new Event(e,{bubbles:!0})};try{new Event("test");}catch(e){o=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t};}function r(e){var t=n.get(e);t&&t.destroy();}function i(e){var t=n.get(e);t&&t.update();}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return function(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!n.has(e)){var t,r=null,i=null,l=null,d=function(){e.clientWidth!==i&&c();},a=function(t){window.removeEventListener("resize",d,!1),e.removeEventListener("input",c,!1),e.removeEventListener("keyup",c,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",c,!1),Object.keys(t).forEach(function(n){e.style[n]=t[n];}),n.delete(e);}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",c,!1),window.addEventListener("resize",d,!1),e.addEventListener("input",c,!1),e.addEventListener("autosize:update",c,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",n.set(e,{destroy:a,update:c}),"vertical"===(t=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),r="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(r)&&(r=0),c();}function u(t){var n=e.style.width;e.style.width="0px",e.style.width=n,e.style.overflowY=t;}function s(){if(0!==e.scrollHeight){var t=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),n=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+r+"px",i=e.clientWidth,t.forEach(function(e){e.node.scrollTop=e.scrollTop;}),n&&(document.documentElement.scrollTop=n);}}function c(){s();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(u("scroll"),s(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(u("hidden"),s(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),l!==r){l=r;var i=o("autosize:resized");try{e.dispatchEvent(i);}catch(e){}}}}(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e});var d=l;
|
||||
@@ -2981,11 +2981,27 @@ function getBasePlacement(placement) {
|
||||
return placement.split('-')[0];
|
||||
}
|
||||
|
||||
function getBoundingClientRect(element,
|
||||
includeScale) {
|
||||
var max = Math.max;
|
||||
var min = Math.min;
|
||||
var round = Math.round;
|
||||
|
||||
function getBoundingClientRect(element, includeScale) {
|
||||
if (includeScale === void 0) {
|
||||
includeScale = false;
|
||||
}
|
||||
var rect = element.getBoundingClientRect();
|
||||
var scaleX = 1;
|
||||
var scaleY = 1;
|
||||
if (isHTMLElement(element) && includeScale) {
|
||||
var offsetHeight = element.offsetHeight;
|
||||
var offsetWidth = element.offsetWidth;
|
||||
if (offsetWidth > 0) {
|
||||
scaleX = round(rect.width) / offsetWidth || 1;
|
||||
}
|
||||
if (offsetHeight > 0) {
|
||||
scaleY = round(rect.height) / offsetHeight || 1;
|
||||
}
|
||||
}
|
||||
return {
|
||||
width: rect.width / scaleX,
|
||||
height: rect.height / scaleY,
|
||||
@@ -3101,13 +3117,13 @@ function getMainAxisFromPlacement(placement) {
|
||||
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
||||
}
|
||||
|
||||
var max = Math.max;
|
||||
var min = Math.min;
|
||||
var round = Math.round;
|
||||
|
||||
function within(min$1, value, max$1) {
|
||||
return max(min$1, min(value, max$1));
|
||||
}
|
||||
function withinMaxClamp(min, value, max) {
|
||||
var v = within(min, value, max);
|
||||
return v > max ? max : v;
|
||||
}
|
||||
|
||||
function getFreshSideObject() {
|
||||
return {
|
||||
@@ -3210,8 +3226,8 @@ function roundOffsetsByDPR(_ref) {
|
||||
var win = window;
|
||||
var dpr = win.devicePixelRatio || 1;
|
||||
return {
|
||||
x: round(round(x * dpr) / dpr) || 0,
|
||||
y: round(round(y * dpr) / dpr) || 0
|
||||
x: round(x * dpr) / dpr || 0,
|
||||
y: round(y * dpr) / dpr || 0
|
||||
};
|
||||
}
|
||||
function mapToStyles(_ref2) {
|
||||
@@ -3224,12 +3240,21 @@ function mapToStyles(_ref2) {
|
||||
position = _ref2.position,
|
||||
gpuAcceleration = _ref2.gpuAcceleration,
|
||||
adaptive = _ref2.adaptive,
|
||||
roundOffsets = _ref2.roundOffsets;
|
||||
var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
|
||||
_ref3$x = _ref3.x,
|
||||
x = _ref3$x === void 0 ? 0 : _ref3$x,
|
||||
_ref3$y = _ref3.y,
|
||||
y = _ref3$y === void 0 ? 0 : _ref3$y;
|
||||
roundOffsets = _ref2.roundOffsets,
|
||||
isFixed = _ref2.isFixed;
|
||||
var _offsets$x = offsets.x,
|
||||
x = _offsets$x === void 0 ? 0 : _offsets$x,
|
||||
_offsets$y = offsets.y,
|
||||
y = _offsets$y === void 0 ? 0 : _offsets$y;
|
||||
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
||||
x: x,
|
||||
y: y
|
||||
}) : {
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
x = _ref3.x;
|
||||
y = _ref3.y;
|
||||
var hasX = offsets.hasOwnProperty('x');
|
||||
var hasY = offsets.hasOwnProperty('y');
|
||||
var sideX = left;
|
||||
@@ -3249,27 +3274,40 @@ function mapToStyles(_ref2) {
|
||||
offsetParent = offsetParent;
|
||||
if (placement === top || (placement === left || placement === right) && variation === end) {
|
||||
sideY = bottom;
|
||||
y -= offsetParent[heightProp] - popperRect.height;
|
||||
var offsetY = isFixed && win.visualViewport ? win.visualViewport.height :
|
||||
offsetParent[heightProp];
|
||||
y -= offsetY - popperRect.height;
|
||||
y *= gpuAcceleration ? 1 : -1;
|
||||
}
|
||||
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
||||
sideX = right;
|
||||
x -= offsetParent[widthProp] - popperRect.width;
|
||||
var offsetX = isFixed && win.visualViewport ? win.visualViewport.width :
|
||||
offsetParent[widthProp];
|
||||
x -= offsetX - popperRect.width;
|
||||
x *= gpuAcceleration ? 1 : -1;
|
||||
}
|
||||
}
|
||||
var commonStyles = Object.assign({
|
||||
position: position
|
||||
}, adaptive && unsetSides);
|
||||
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
||||
x: x,
|
||||
y: y
|
||||
}) : {
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
x = _ref4.x;
|
||||
y = _ref4.y;
|
||||
if (gpuAcceleration) {
|
||||
var _Object$assign;
|
||||
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
||||
}
|
||||
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
||||
}
|
||||
function computeStyles(_ref4) {
|
||||
var state = _ref4.state,
|
||||
options = _ref4.options;
|
||||
function computeStyles(_ref5) {
|
||||
var state = _ref5.state,
|
||||
options = _ref5.options;
|
||||
var _options$gpuAccelerat = options.gpuAcceleration,
|
||||
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
||||
_options$adaptive = options.adaptive,
|
||||
@@ -3281,7 +3319,8 @@ function computeStyles(_ref4) {
|
||||
variation: getVariation(state.placement),
|
||||
popper: state.elements.popper,
|
||||
popperRect: state.rects.popper,
|
||||
gpuAcceleration: gpuAcceleration
|
||||
gpuAcceleration: gpuAcceleration,
|
||||
isFixed: state.options.strategy === 'fixed'
|
||||
};
|
||||
if (state.modifiersData.popperOffsets != null) {
|
||||
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
||||
@@ -3486,7 +3525,7 @@ function getInnerBoundingClientRect(element) {
|
||||
return rect;
|
||||
}
|
||||
function getClientRectFromMixedType(element, clippingParent) {
|
||||
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
||||
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement$1(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
||||
}
|
||||
function getClippingParents(element) {
|
||||
var clippingParents = listScrollParents(getParentNode(element));
|
||||
@@ -3929,6 +3968,14 @@ function preventOverflow(_ref) {
|
||||
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
||||
placement: state.placement
|
||||
})) : tetherOffset;
|
||||
var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
|
||||
mainAxis: tetherOffsetValue,
|
||||
altAxis: tetherOffsetValue
|
||||
} : Object.assign({
|
||||
mainAxis: 0,
|
||||
altAxis: 0
|
||||
}, tetherOffsetValue);
|
||||
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
||||
var data = {
|
||||
x: 0,
|
||||
y: 0
|
||||
@@ -3936,13 +3983,14 @@ function preventOverflow(_ref) {
|
||||
if (!popperOffsets) {
|
||||
return;
|
||||
}
|
||||
if (checkMainAxis || checkAltAxis) {
|
||||
if (checkMainAxis) {
|
||||
var _offsetModifierState$;
|
||||
var mainSide = mainAxis === 'y' ? top : left;
|
||||
var altSide = mainAxis === 'y' ? bottom : right;
|
||||
var len = mainAxis === 'y' ? 'height' : 'width';
|
||||
var offset = popperOffsets[mainAxis];
|
||||
var min$1 = popperOffsets[mainAxis] + overflow[mainSide];
|
||||
var max$1 = popperOffsets[mainAxis] - overflow[altSide];
|
||||
var min$1 = offset + overflow[mainSide];
|
||||
var max$1 = offset - overflow[altSide];
|
||||
var additive = tether ? -popperRect[len] / 2 : 0;
|
||||
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
||||
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
|
||||
@@ -3955,28 +4003,32 @@ function preventOverflow(_ref) {
|
||||
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
||||
var arrowPaddingMax = arrowPaddingObject[altSide];
|
||||
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
||||
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
|
||||
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
|
||||
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
||||
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
||||
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
||||
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
||||
var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
|
||||
var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
|
||||
var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
|
||||
if (checkMainAxis) {
|
||||
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
||||
popperOffsets[mainAxis] = preventedOffset;
|
||||
data[mainAxis] = preventedOffset - offset;
|
||||
}
|
||||
if (checkAltAxis) {
|
||||
var _mainSide = mainAxis === 'x' ? top : left;
|
||||
var _altSide = mainAxis === 'x' ? bottom : right;
|
||||
var _offset = popperOffsets[altAxis];
|
||||
var _min = _offset + overflow[_mainSide];
|
||||
var _max = _offset - overflow[_altSide];
|
||||
var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);
|
||||
popperOffsets[altAxis] = _preventedOffset;
|
||||
data[altAxis] = _preventedOffset - _offset;
|
||||
}
|
||||
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
||||
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
||||
var tetherMax = offset + maxOffset - offsetModifierValue;
|
||||
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
||||
popperOffsets[mainAxis] = preventedOffset;
|
||||
data[mainAxis] = preventedOffset - offset;
|
||||
}
|
||||
if (checkAltAxis) {
|
||||
var _offsetModifierState$2;
|
||||
var _mainSide = mainAxis === 'x' ? top : left;
|
||||
var _altSide = mainAxis === 'x' ? bottom : right;
|
||||
var _offset = popperOffsets[altAxis];
|
||||
var _len = altAxis === 'y' ? 'height' : 'width';
|
||||
var _min = _offset + overflow[_mainSide];
|
||||
var _max = _offset - overflow[_altSide];
|
||||
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
||||
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
||||
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
||||
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
||||
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
||||
popperOffsets[altAxis] = _preventedOffset;
|
||||
data[altAxis] = _preventedOffset - _offset;
|
||||
}
|
||||
state.modifiersData[name] = data;
|
||||
}
|
||||
@@ -4005,8 +4057,8 @@ function getNodeScroll(node) {
|
||||
|
||||
function isElementScaled(element) {
|
||||
var rect = element.getBoundingClientRect();
|
||||
var scaleX = rect.width / element.offsetWidth || 1;
|
||||
var scaleY = rect.height / element.offsetHeight || 1;
|
||||
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
||||
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
||||
return scaleX !== 1 || scaleY !== 1;
|
||||
}
|
||||
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
||||
@@ -4014,9 +4066,9 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
||||
isFixed = false;
|
||||
}
|
||||
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
||||
isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
||||
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
||||
var documentElement = getDocumentElement(offsetParent);
|
||||
var rect = getBoundingClientRect(elementOrVirtualElement);
|
||||
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
|
||||
var scroll = {
|
||||
scrollLeft: 0,
|
||||
scrollTop: 0
|
||||
@@ -4031,7 +4083,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
||||
scroll = getNodeScroll(offsetParent);
|
||||
}
|
||||
if (isHTMLElement(offsetParent)) {
|
||||
offsets = getBoundingClientRect(offsetParent);
|
||||
offsets = getBoundingClientRect(offsetParent, true);
|
||||
offsets.x += offsetParent.clientLeft;
|
||||
offsets.y += offsetParent.clientTop;
|
||||
} else if (documentElement) {
|
||||
|
||||
Reference in New Issue
Block a user