mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 23:31:13 -05:00
migrated to ASP.Net Core
This commit is contained in:
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "@popperjs/test-utils",
|
||||
"version": "1.0.0",
|
||||
"main": "setup.js",
|
||||
"description": "Test utils for Popper.js tests",
|
||||
"author": "Federico Zivolo <federico.zivolo@gmail.com>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "exit 0"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-eslint": "^7.2.3",
|
||||
"eslint-plugin-jasmine": "^2.6.2"
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
import simulateScroll from './utils/simulateScroll';
|
||||
|
||||
const wrapper = document.createElement('div');
|
||||
wrapper.id = 'jasmineWrapper';
|
||||
document.body.appendChild(wrapper);
|
||||
|
||||
beforeEach(function() {
|
||||
jasmine.addMatchers({
|
||||
toBeApprox: function() {
|
||||
return {
|
||||
compare: function(actual, expected, within) {
|
||||
within = within || 1.5;
|
||||
return {
|
||||
pass: actual >= expected - within && actual <= expected + within,
|
||||
};
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const reporterCurrentSpec = {
|
||||
specStarted: function(result) {
|
||||
window.testName = result.fullName;
|
||||
},
|
||||
};
|
||||
jasmine.getEnv().addReporter(reporterCurrentSpec);
|
||||
|
||||
const jasmineWrapper = document.getElementById('jasmineWrapper');
|
||||
jasmineWrapper.innerHTML = '';
|
||||
simulateScroll(document.body, 0);
|
||||
});
|
@ -0,0 +1,14 @@
|
||||
export default function appendNewPopper(id, text, container) {
|
||||
const jasmineWrapper = document.getElementById('jasmineWrapper');
|
||||
|
||||
const popper = document.createElement('div');
|
||||
popper.id = id;
|
||||
popper.className = 'popper';
|
||||
popper.textContent = text || 'popper';
|
||||
const arrow = document.createElement('div');
|
||||
arrow.className = 'popper__arrow';
|
||||
arrow.setAttribute('x-arrow', '');
|
||||
popper.appendChild(arrow);
|
||||
(container || jasmineWrapper).appendChild(popper);
|
||||
return popper;
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
export default function appendNewRef(id, text, container) {
|
||||
const jasmineWrapper = document.getElementById('jasmineWrapper');
|
||||
|
||||
const ref = document.createElement('div');
|
||||
ref.id = id;
|
||||
ref.className = 'ref';
|
||||
ref.textContent = text || 'reference';
|
||||
(container || jasmineWrapper).appendChild(ref);
|
||||
return ref;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
(function() {
|
||||
if (typeof window.CustomEvent === 'function') {
|
||||
return false;
|
||||
}
|
||||
|
||||
function CustomEvent(event, params) {
|
||||
params = params || { bubbles: false, cancelable: false, detail: undefined };
|
||||
const evt = document.createEvent('CustomEvent');
|
||||
evt.initCustomEvent(
|
||||
event,
|
||||
params.bubbles,
|
||||
params.cancelable,
|
||||
params.detail
|
||||
);
|
||||
return evt;
|
||||
}
|
||||
|
||||
CustomEvent.prototype = window.Event.prototype;
|
||||
|
||||
window.CustomEvent = CustomEvent;
|
||||
})();
|
@ -0,0 +1,3 @@
|
||||
export default function getRect(element) {
|
||||
return element.getBoundingClientRect();
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// https://codepen.io/FezVrasta/pen/YVBoEN
|
||||
export default function isMSBrowser() {
|
||||
const ua = window.navigator.userAgent;
|
||||
|
||||
const msie = ua.indexOf('MSIE ');
|
||||
if (msie > 0) {
|
||||
// IE 10 or older => return version number
|
||||
return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
|
||||
}
|
||||
|
||||
const trident = ua.indexOf('Trident/');
|
||||
if (trident > 0) {
|
||||
// IE 11 => return version number
|
||||
const rv = ua.indexOf('rv:');
|
||||
return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
|
||||
}
|
||||
|
||||
const edge = ua.indexOf('Edge/');
|
||||
if (edge > 0) {
|
||||
// Edge (IE 12+) => return version number
|
||||
return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);
|
||||
}
|
||||
|
||||
// other browser
|
||||
return false;
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
import makeElement from './makeElement';
|
||||
|
||||
/**
|
||||
* Create an element that's connected to the DOM.
|
||||
*/
|
||||
export default function makeConnectedElement() {
|
||||
const jasmineWrapper = document.getElementById('jasmineWrapper');
|
||||
return jasmineWrapper.appendChild(makeElement());
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
import makeConnectedElement from './makeConnectedElement';
|
||||
|
||||
/**
|
||||
* Create a scrollable element that's connected to the DOM.
|
||||
*/
|
||||
export default function makeConnectedScrollElement() {
|
||||
const elem = makeConnectedElement();
|
||||
elem.style.overflow = 'scroll';
|
||||
return elem;
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
/**
|
||||
* Create an element.
|
||||
*/
|
||||
export default function makeElement() {
|
||||
return document.createElement('div');
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
export default function prepend(node, parent) {
|
||||
parent.insertBefore(node, parent.firstChild);
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
export default function simulateScroll(
|
||||
element,
|
||||
{ scrollTop, scrollLeft, delay }
|
||||
) {
|
||||
const scrollingElement = element === document.body
|
||||
? document.scrollingElement || document.documentElement
|
||||
: element;
|
||||
|
||||
const applyScroll = () => {
|
||||
if (scrollTop !== undefined) {
|
||||
scrollingElement.scrollTop = scrollTop;
|
||||
}
|
||||
if (scrollLeft !== undefined) {
|
||||
scrollingElement.scrollLeft = scrollLeft;
|
||||
}
|
||||
};
|
||||
|
||||
if (delay !== undefined) {
|
||||
setTimeout(applyScroll, delay);
|
||||
} else {
|
||||
applyScroll();
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
export default function then(callback, delay = 100) {
|
||||
setTimeout(callback, jasmine.THEN_DELAY);
|
||||
jasmine.THEN_DELAY += delay;
|
||||
}
|
||||
|
||||
beforeEach(() => (jasmine.THEN_DELAY = 0));
|
152
WebfrontCore/wwwroot/lib/popper.js/packages/test-utils/yarn.lock
Normal file
152
WebfrontCore/wwwroot/lib/popper.js/packages/test-utils/yarn.lock
Normal file
@ -0,0 +1,152 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
ansi-regex@^2.0.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
|
||||
|
||||
ansi-styles@^2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
|
||||
|
||||
babel-code-frame@^6.22.0:
|
||||
version "6.22.0"
|
||||
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4"
|
||||
dependencies:
|
||||
chalk "^1.1.0"
|
||||
esutils "^2.0.2"
|
||||
js-tokens "^3.0.0"
|
||||
|
||||
babel-eslint@^7.2.3:
|
||||
version "7.2.3"
|
||||
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.3.tgz#b2fe2d80126470f5c19442dc757253a897710827"
|
||||
dependencies:
|
||||
babel-code-frame "^6.22.0"
|
||||
babel-traverse "^6.23.1"
|
||||
babel-types "^6.23.0"
|
||||
babylon "^6.17.0"
|
||||
|
||||
babel-messages@^6.23.0:
|
||||
version "6.23.0"
|
||||
resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e"
|
||||
dependencies:
|
||||
babel-runtime "^6.22.0"
|
||||
|
||||
babel-runtime@^6.22.0:
|
||||
version "6.25.0"
|
||||
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.25.0.tgz#33b98eaa5d482bb01a8d1aa6b437ad2b01aec41c"
|
||||
dependencies:
|
||||
core-js "^2.4.0"
|
||||
regenerator-runtime "^0.10.0"
|
||||
|
||||
babel-traverse@^6.23.1:
|
||||
version "6.25.0"
|
||||
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.25.0.tgz#2257497e2fcd19b89edc13c4c91381f9512496f1"
|
||||
dependencies:
|
||||
babel-code-frame "^6.22.0"
|
||||
babel-messages "^6.23.0"
|
||||
babel-runtime "^6.22.0"
|
||||
babel-types "^6.25.0"
|
||||
babylon "^6.17.2"
|
||||
debug "^2.2.0"
|
||||
globals "^9.0.0"
|
||||
invariant "^2.2.0"
|
||||
lodash "^4.2.0"
|
||||
|
||||
babel-types@^6.23.0, babel-types@^6.25.0:
|
||||
version "6.25.0"
|
||||
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.25.0.tgz#70afb248d5660e5d18f811d91c8303b54134a18e"
|
||||
dependencies:
|
||||
babel-runtime "^6.22.0"
|
||||
esutils "^2.0.2"
|
||||
lodash "^4.2.0"
|
||||
to-fast-properties "^1.0.1"
|
||||
|
||||
babylon@^6.17.0, babylon@^6.17.2:
|
||||
version "6.17.4"
|
||||
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.4.tgz#3e8b7402b88d22c3423e137a1577883b15ff869a"
|
||||
|
||||
chalk@^1.1.0:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
|
||||
dependencies:
|
||||
ansi-styles "^2.2.1"
|
||||
escape-string-regexp "^1.0.2"
|
||||
has-ansi "^2.0.0"
|
||||
strip-ansi "^3.0.0"
|
||||
supports-color "^2.0.0"
|
||||
|
||||
core-js@^2.4.0:
|
||||
version "2.5.0"
|
||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.0.tgz#569c050918be6486b3837552028ae0466b717086"
|
||||
|
||||
debug@^2.2.0:
|
||||
version "2.6.8"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc"
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
escape-string-regexp@^1.0.2:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||
|
||||
eslint-plugin-jasmine@^2.6.2:
|
||||
version "2.8.4"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-jasmine/-/eslint-plugin-jasmine-2.8.4.tgz#67a5551e3d1d5e0b8c6b54aaebab95370f5d37de"
|
||||
|
||||
esutils@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
|
||||
|
||||
globals@^9.0.0:
|
||||
version "9.18.0"
|
||||
resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a"
|
||||
|
||||
has-ansi@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
|
||||
dependencies:
|
||||
ansi-regex "^2.0.0"
|
||||
|
||||
invariant@^2.2.0:
|
||||
version "2.2.2"
|
||||
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360"
|
||||
dependencies:
|
||||
loose-envify "^1.0.0"
|
||||
|
||||
js-tokens@^3.0.0:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
|
||||
|
||||
lodash@^4.2.0:
|
||||
version "4.17.4"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
|
||||
|
||||
loose-envify@^1.0.0:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
|
||||
dependencies:
|
||||
js-tokens "^3.0.0"
|
||||
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
|
||||
regenerator-runtime@^0.10.0:
|
||||
version "0.10.5"
|
||||
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658"
|
||||
|
||||
strip-ansi@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
|
||||
dependencies:
|
||||
ansi-regex "^2.0.0"
|
||||
|
||||
supports-color@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
|
||||
|
||||
to-fast-properties@^1.0.1:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47"
|
Reference in New Issue
Block a user