Latest updates from IceHrmPro
This commit is contained in:
264
web/node_modules/scroll-into-view-if-needed/umd/scroll-into-view-if-needed.js
generated
vendored
Normal file
264
web/node_modules/scroll-into-view-if-needed/umd/scroll-into-view-if-needed.js
generated
vendored
Normal file
@@ -0,0 +1,264 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = global || self, global.scrollIntoView = factory());
|
||||
}(this, (function () { 'use strict';
|
||||
|
||||
function isElement(el) {
|
||||
return el != null && typeof el === 'object' && el.nodeType === 1;
|
||||
}
|
||||
|
||||
function canOverflow(overflow, skipOverflowHiddenElements) {
|
||||
if (skipOverflowHiddenElements && overflow === 'hidden') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return overflow !== 'visible' && overflow !== 'clip';
|
||||
}
|
||||
|
||||
function getFrameElement(el) {
|
||||
if (!el.ownerDocument || !el.ownerDocument.defaultView) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return el.ownerDocument.defaultView.frameElement;
|
||||
}
|
||||
|
||||
function isHiddenByFrame(el) {
|
||||
var frame = getFrameElement(el);
|
||||
|
||||
if (!frame) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return frame.clientHeight < el.scrollHeight || frame.clientWidth < el.scrollWidth;
|
||||
}
|
||||
|
||||
function isScrollable(el, skipOverflowHiddenElements) {
|
||||
if (el.clientHeight < el.scrollHeight || el.clientWidth < el.scrollWidth) {
|
||||
var style = getComputedStyle(el, null);
|
||||
return canOverflow(style.overflowY, skipOverflowHiddenElements) || canOverflow(style.overflowX, skipOverflowHiddenElements) || isHiddenByFrame(el);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function alignNearest(scrollingEdgeStart, scrollingEdgeEnd, scrollingSize, scrollingBorderStart, scrollingBorderEnd, elementEdgeStart, elementEdgeEnd, elementSize) {
|
||||
if (elementEdgeStart < scrollingEdgeStart && elementEdgeEnd > scrollingEdgeEnd || elementEdgeStart > scrollingEdgeStart && elementEdgeEnd < scrollingEdgeEnd) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (elementEdgeStart <= scrollingEdgeStart && elementSize <= scrollingSize || elementEdgeEnd >= scrollingEdgeEnd && elementSize >= scrollingSize) {
|
||||
return elementEdgeStart - scrollingEdgeStart - scrollingBorderStart;
|
||||
}
|
||||
|
||||
if (elementEdgeEnd > scrollingEdgeEnd && elementSize < scrollingSize || elementEdgeStart < scrollingEdgeStart && elementSize > scrollingSize) {
|
||||
return elementEdgeEnd - scrollingEdgeEnd + scrollingBorderEnd;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
var compute = (function (target, options) {
|
||||
var scrollMode = options.scrollMode,
|
||||
block = options.block,
|
||||
inline = options.inline,
|
||||
boundary = options.boundary,
|
||||
skipOverflowHiddenElements = options.skipOverflowHiddenElements;
|
||||
var checkBoundary = typeof boundary === 'function' ? boundary : function (node) {
|
||||
return node !== boundary;
|
||||
};
|
||||
|
||||
if (!isElement(target)) {
|
||||
throw new TypeError('Invalid target');
|
||||
}
|
||||
|
||||
var scrollingElement = document.scrollingElement || document.documentElement;
|
||||
var frames = [];
|
||||
var cursor = target;
|
||||
|
||||
while (isElement(cursor) && checkBoundary(cursor)) {
|
||||
cursor = cursor.parentNode;
|
||||
|
||||
if (cursor === scrollingElement) {
|
||||
frames.push(cursor);
|
||||
break;
|
||||
}
|
||||
|
||||
if (cursor === document.body && isScrollable(cursor) && !isScrollable(document.documentElement)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isScrollable(cursor, skipOverflowHiddenElements)) {
|
||||
frames.push(cursor);
|
||||
}
|
||||
}
|
||||
|
||||
var viewportWidth = window.visualViewport ? visualViewport.width : innerWidth;
|
||||
var viewportHeight = window.visualViewport ? visualViewport.height : innerHeight;
|
||||
var viewportX = window.scrollX || pageXOffset;
|
||||
var viewportY = window.scrollY || pageYOffset;
|
||||
|
||||
var _target$getBoundingCl = target.getBoundingClientRect(),
|
||||
targetHeight = _target$getBoundingCl.height,
|
||||
targetWidth = _target$getBoundingCl.width,
|
||||
targetTop = _target$getBoundingCl.top,
|
||||
targetRight = _target$getBoundingCl.right,
|
||||
targetBottom = _target$getBoundingCl.bottom,
|
||||
targetLeft = _target$getBoundingCl.left;
|
||||
|
||||
var targetBlock = block === 'start' || block === 'nearest' ? targetTop : block === 'end' ? targetBottom : targetTop + targetHeight / 2;
|
||||
var targetInline = inline === 'center' ? targetLeft + targetWidth / 2 : inline === 'end' ? targetRight : targetLeft;
|
||||
var computations = [];
|
||||
|
||||
for (var index = 0; index < frames.length; index++) {
|
||||
var frame = frames[index];
|
||||
|
||||
var _frame$getBoundingCli = frame.getBoundingClientRect(),
|
||||
height = _frame$getBoundingCli.height,
|
||||
width = _frame$getBoundingCli.width,
|
||||
top = _frame$getBoundingCli.top,
|
||||
right = _frame$getBoundingCli.right,
|
||||
bottom = _frame$getBoundingCli.bottom,
|
||||
left = _frame$getBoundingCli.left;
|
||||
|
||||
if (scrollMode === 'if-needed' && targetTop >= 0 && targetLeft >= 0 && targetBottom <= viewportHeight && targetRight <= viewportWidth && targetTop >= top && targetBottom <= bottom && targetLeft >= left && targetRight <= right) {
|
||||
return computations;
|
||||
}
|
||||
|
||||
var frameStyle = getComputedStyle(frame);
|
||||
var borderLeft = parseInt(frameStyle.borderLeftWidth, 10);
|
||||
var borderTop = parseInt(frameStyle.borderTopWidth, 10);
|
||||
var borderRight = parseInt(frameStyle.borderRightWidth, 10);
|
||||
var borderBottom = parseInt(frameStyle.borderBottomWidth, 10);
|
||||
var blockScroll = 0;
|
||||
var inlineScroll = 0;
|
||||
var scrollbarWidth = 'offsetWidth' in frame ? frame.offsetWidth - frame.clientWidth - borderLeft - borderRight : 0;
|
||||
var scrollbarHeight = 'offsetHeight' in frame ? frame.offsetHeight - frame.clientHeight - borderTop - borderBottom : 0;
|
||||
|
||||
if (scrollingElement === frame) {
|
||||
if (block === 'start') {
|
||||
blockScroll = targetBlock;
|
||||
} else if (block === 'end') {
|
||||
blockScroll = targetBlock - viewportHeight;
|
||||
} else if (block === 'nearest') {
|
||||
blockScroll = alignNearest(viewportY, viewportY + viewportHeight, viewportHeight, borderTop, borderBottom, viewportY + targetBlock, viewportY + targetBlock + targetHeight, targetHeight);
|
||||
} else {
|
||||
blockScroll = targetBlock - viewportHeight / 2;
|
||||
}
|
||||
|
||||
if (inline === 'start') {
|
||||
inlineScroll = targetInline;
|
||||
} else if (inline === 'center') {
|
||||
inlineScroll = targetInline - viewportWidth / 2;
|
||||
} else if (inline === 'end') {
|
||||
inlineScroll = targetInline - viewportWidth;
|
||||
} else {
|
||||
inlineScroll = alignNearest(viewportX, viewportX + viewportWidth, viewportWidth, borderLeft, borderRight, viewportX + targetInline, viewportX + targetInline + targetWidth, targetWidth);
|
||||
}
|
||||
|
||||
blockScroll = Math.max(0, blockScroll + viewportY);
|
||||
inlineScroll = Math.max(0, inlineScroll + viewportX);
|
||||
} else {
|
||||
if (block === 'start') {
|
||||
blockScroll = targetBlock - top - borderTop;
|
||||
} else if (block === 'end') {
|
||||
blockScroll = targetBlock - bottom + borderBottom + scrollbarHeight;
|
||||
} else if (block === 'nearest') {
|
||||
blockScroll = alignNearest(top, bottom, height, borderTop, borderBottom + scrollbarHeight, targetBlock, targetBlock + targetHeight, targetHeight);
|
||||
} else {
|
||||
blockScroll = targetBlock - (top + height / 2) + scrollbarHeight / 2;
|
||||
}
|
||||
|
||||
if (inline === 'start') {
|
||||
inlineScroll = targetInline - left - borderLeft;
|
||||
} else if (inline === 'center') {
|
||||
inlineScroll = targetInline - (left + width / 2) + scrollbarWidth / 2;
|
||||
} else if (inline === 'end') {
|
||||
inlineScroll = targetInline - right + borderRight + scrollbarWidth;
|
||||
} else {
|
||||
inlineScroll = alignNearest(left, right, width, borderLeft, borderRight + scrollbarWidth, targetInline, targetInline + targetWidth, targetWidth);
|
||||
}
|
||||
|
||||
var scrollLeft = frame.scrollLeft,
|
||||
scrollTop = frame.scrollTop;
|
||||
blockScroll = Math.max(0, Math.min(scrollTop + blockScroll, frame.scrollHeight - height + scrollbarHeight));
|
||||
inlineScroll = Math.max(0, Math.min(scrollLeft + inlineScroll, frame.scrollWidth - width + scrollbarWidth));
|
||||
targetBlock += scrollTop - blockScroll;
|
||||
targetInline += scrollLeft - inlineScroll;
|
||||
}
|
||||
|
||||
computations.push({
|
||||
el: frame,
|
||||
top: blockScroll,
|
||||
left: inlineScroll
|
||||
});
|
||||
}
|
||||
|
||||
return computations;
|
||||
});
|
||||
|
||||
function isOptionsObject(options) {
|
||||
return options === Object(options) && Object.keys(options).length !== 0;
|
||||
}
|
||||
|
||||
function defaultBehavior(actions, behavior) {
|
||||
if (behavior === void 0) {
|
||||
behavior = 'auto';
|
||||
}
|
||||
|
||||
var canSmoothScroll = 'scrollBehavior' in document.body.style;
|
||||
actions.forEach(function (_ref) {
|
||||
var el = _ref.el,
|
||||
top = _ref.top,
|
||||
left = _ref.left;
|
||||
|
||||
if (el.scroll && canSmoothScroll) {
|
||||
el.scroll({
|
||||
top: top,
|
||||
left: left,
|
||||
behavior: behavior
|
||||
});
|
||||
} else {
|
||||
el.scrollTop = top;
|
||||
el.scrollLeft = left;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getOptions(options) {
|
||||
if (options === false) {
|
||||
return {
|
||||
block: 'end',
|
||||
inline: 'nearest'
|
||||
};
|
||||
}
|
||||
|
||||
if (isOptionsObject(options)) {
|
||||
return options;
|
||||
}
|
||||
|
||||
return {
|
||||
block: 'start',
|
||||
inline: 'nearest'
|
||||
};
|
||||
}
|
||||
|
||||
function scrollIntoView(target, options) {
|
||||
var targetIsDetached = !target.ownerDocument.documentElement.contains(target);
|
||||
|
||||
if (isOptionsObject(options) && typeof options.behavior === 'function') {
|
||||
return options.behavior(targetIsDetached ? [] : compute(target, options));
|
||||
}
|
||||
|
||||
if (targetIsDetached) {
|
||||
return;
|
||||
}
|
||||
|
||||
var computeOptions = getOptions(options);
|
||||
return defaultBehavior(compute(target, computeOptions), computeOptions.behavior);
|
||||
}
|
||||
|
||||
return scrollIntoView;
|
||||
|
||||
})));
|
||||
1
web/node_modules/scroll-into-view-if-needed/umd/scroll-into-view-if-needed.min.js
generated
vendored
Normal file
1
web/node_modules/scroll-into-view-if-needed/umd/scroll-into-view-if-needed.min.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).scrollIntoView=t()}(this,(function(){"use strict";function e(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function t(e,t){return(!t||"hidden"!==e)&&("visible"!==e&&"clip"!==e)}function n(e,n){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var o=getComputedStyle(e,null);return t(o.overflowY,n)||t(o.overflowX,n)||function(e){var t=function(e){return e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView.frameElement:null}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function o(e,t,n,o,r,i,l,c){return i<e&&l>t||i>e&&l<t?0:i<=e&&c<=n||l>=t&&c>=n?i-e-o:l>t&&c<n||i<e&&c>n?l-t+r:0}var r=function(t,r){var i=r.scrollMode,l=r.block,c=r.inline,d=r.boundary,u=r.skipOverflowHiddenElements,f="function"==typeof d?d:function(e){return e!==d};if(!e(t))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,s=[],h=t;e(h)&&f(h);){if((h=h.parentNode)===a){s.push(h);break}h===document.body&&n(h)&&!n(document.documentElement)||n(h,u)&&s.push(h)}for(var p=window.visualViewport?visualViewport.width:innerWidth,m=window.visualViewport?visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,g=window.scrollY||pageYOffset,w=t.getBoundingClientRect(),b=w.height,y=w.width,W=w.top,H=w.right,E=w.bottom,M=w.left,V="start"===l||"nearest"===l?W:"end"===l?E:W+b/2,k="center"===c?M+y/2:"end"===c?H:M,x=[],I=0;I<s.length;I++){var O=s[I],T=O.getBoundingClientRect(),j=T.height,B=T.width,C=T.top,D=T.right,L=T.bottom,R=T.left;if("if-needed"===i&&W>=0&&M>=0&&E<=m&&H<=p&&W>=C&&E<=L&&M>=R&&H<=D)return x;var X=getComputedStyle(O),Y=parseInt(X.borderLeftWidth,10),S=parseInt(X.borderTopWidth,10),N=parseInt(X.borderRightWidth,10),q=parseInt(X.borderBottomWidth,10),z=0,A=0,F="offsetWidth"in O?O.offsetWidth-O.clientWidth-Y-N:0,G="offsetHeight"in O?O.offsetHeight-O.clientHeight-S-q:0;if(a===O)z="start"===l?V:"end"===l?V-m:"nearest"===l?o(g,g+m,m,S,q,g+V,g+V+b,b):V-m/2,A="start"===c?k:"center"===c?k-p/2:"end"===c?k-p:o(v,v+p,p,Y,N,v+k,v+k+y,y),z=Math.max(0,z+g),A=Math.max(0,A+v);else{z="start"===l?V-C-S:"end"===l?V-L+q+G:"nearest"===l?o(C,L,j,S,q+G,V,V+b,b):V-(C+j/2)+G/2,A="start"===c?k-R-Y:"center"===c?k-(R+B/2)+F/2:"end"===c?k-D+N+F:o(R,D,B,Y,N+F,k,k+y,y);var J=O.scrollLeft,K=O.scrollTop;V+=K-(z=Math.max(0,Math.min(K+z,O.scrollHeight-j+G))),k+=J-(A=Math.max(0,Math.min(J+A,O.scrollWidth-B+F)))}x.push({el:O,top:z,left:A})}return x};function i(e){return e===Object(e)&&0!==Object.keys(e).length}return function(e,t){var n=!e.ownerDocument.documentElement.contains(e);if(i(t)&&"function"==typeof t.behavior)return t.behavior(n?[]:r(e,t));if(!n){var o=function(e){return!1===e?{block:"end",inline:"nearest"}:i(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach((function(e){var o=e.el,r=e.top,i=e.left;o.scroll&&n?o.scroll({top:r,left:i,behavior:t}):(o.scrollTop=r,o.scrollLeft=i)}))}(r(e,o),o.behavior)}}}));
|
||||
Reference in New Issue
Block a user