拿掉 build files

This commit is contained in:
2022-07-18 16:33:23 +08:00
parent 41e2287bcb
commit 3707f158a3
31953 changed files with 0 additions and 4411796 deletions
-27
View File
@@ -1,27 +0,0 @@
// linear
export const linear = t => t; // accelerating from zero velocity
export const easeInQuad = t => t ** 2; // decelerating to zero velocity
export const easeOutQuad = t => t * (2 - t); // acceleration until halfway, then deceleration
export const easeInOutQuad = t => t < 0.5 ? 2 * t ** 2 : -1 + (4 - 2 * t) * t; // accelerating from zero velocity
export const easeInCubic = t => t ** 3; // decelerating to zero velocity
export const easeOutCubic = t => --t ** 3 + 1; // acceleration until halfway, then deceleration
export const easeInOutCubic = t => t < 0.5 ? 4 * t ** 3 : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1; // accelerating from zero velocity
export const easeInQuart = t => t ** 4; // decelerating to zero velocity
export const easeOutQuart = t => 1 - --t ** 4; // acceleration until halfway, then deceleration
export const easeInOutQuart = t => t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t; // accelerating from zero velocity
export const easeInQuint = t => t ** 5; // decelerating to zero velocity
export const easeOutQuint = t => 1 + --t ** 5; // acceleration until halfway, then deceleration
export const easeInOutQuint = t => t < 0.5 ? 16 * t ** 5 : 1 + 16 * --t ** 5;
//# sourceMappingURL=easing-patterns.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/services/goto/easing-patterns.ts"],"names":[],"mappings":"AAEA;AACA,OAAO,MAAM,MAAM,GAAI,CAAD,IAAe,CAA9B,C,CACP;;AACA,OAAO,MAAM,UAAU,GAAI,CAAD,IAAe,CAAC,IAAI,CAAvC,C,CACP;;AACA,OAAO,MAAM,WAAW,GAAI,CAAD,IAAe,CAAC,IAAI,IAAI,CAAR,CAApC,C,CACP;;AACA,OAAO,MAAM,aAAa,GAAI,CAAD,IAAgB,CAAC,GAAG,GAAJ,GAAU,IAAI,CAAC,IAAI,CAAnB,GAAuB,CAAC,CAAD,GAAK,CAAC,IAAI,IAAI,CAAT,IAAc,CAAhF,C,CACP;;AACA,OAAO,MAAM,WAAW,GAAI,CAAD,IAAe,CAAC,IAAI,CAAxC,C,CACP;;AACA,OAAO,MAAM,YAAY,GAAI,CAAD,IAAe,EAAE,CAAF,IAAO,CAAP,GAAW,CAA/C,C,CACP;;AACA,OAAO,MAAM,cAAc,GAAI,CAAD,IAAe,CAAC,GAAG,GAAJ,GAAU,IAAI,CAAC,IAAI,CAAnB,GAAuB,CAAC,CAAC,GAAG,CAAL,KAAW,IAAI,CAAJ,GAAQ,CAAnB,KAAyB,IAAI,CAAJ,GAAQ,CAAjC,IAAsC,CAAnG,C,CACP;;AACA,OAAO,MAAM,WAAW,GAAI,CAAD,IAAe,CAAC,IAAI,CAAxC,C,CACP;;AACA,OAAO,MAAM,YAAY,GAAI,CAAD,IAAe,IAAI,EAAE,CAAF,IAAO,CAA/C,C,CACP;;AACA,OAAO,MAAM,cAAc,GAAI,CAAD,IAAgB,CAAC,GAAG,GAAJ,GAAU,IAAI,CAAJ,GAAQ,CAAR,GAAY,CAAZ,GAAgB,CAA1B,GAA8B,IAAI,IAAI,EAAE,CAAN,GAAU,CAAV,GAAc,CAAd,GAAkB,CAA3F,C,CACP;;AACA,OAAO,MAAM,WAAW,GAAI,CAAD,IAAe,CAAC,IAAI,CAAxC,C,CACP;;AACA,OAAO,MAAM,YAAY,GAAI,CAAD,IAAe,IAAI,EAAE,CAAF,IAAO,CAA/C,C,CACP;;AACA,OAAO,MAAM,cAAc,GAAI,CAAD,IAAe,CAAC,GAAG,GAAJ,GAAU,KAAK,CAAC,IAAI,CAApB,GAAwB,IAAI,KAAK,EAAE,CAAF,IAAO,CAA9E","sourcesContent":["export type EasingFunction = (t: number) => number\n\n// linear\nexport const linear = (t: number) => t\n// accelerating from zero velocity\nexport const easeInQuad = (t: number) => t ** 2\n// decelerating to zero velocity\nexport const easeOutQuad = (t: number) => t * (2 - t)\n// acceleration until halfway, then deceleration\nexport const easeInOutQuad = (t: number) => (t < 0.5 ? 2 * t ** 2 : -1 + (4 - 2 * t) * t)\n// accelerating from zero velocity\nexport const easeInCubic = (t: number) => t ** 3\n// decelerating to zero velocity\nexport const easeOutCubic = (t: number) => --t ** 3 + 1\n// acceleration until halfway, then deceleration\nexport const easeInOutCubic = (t: number) => t < 0.5 ? 4 * t ** 3 : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1\n// accelerating from zero velocity\nexport const easeInQuart = (t: number) => t ** 4\n// decelerating to zero velocity\nexport const easeOutQuart = (t: number) => 1 - --t ** 4\n// acceleration until halfway, then deceleration\nexport const easeInOutQuart = (t: number) => (t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t)\n// accelerating from zero velocity\nexport const easeInQuint = (t: number) => t ** 5\n// decelerating to zero velocity\nexport const easeOutQuint = (t: number) => 1 + --t ** 5\n// acceleration until halfway, then deceleration\nexport const easeInOutQuint = (t: number) => t < 0.5 ? 16 * t ** 5 : 1 + 16 * --t ** 5\n"],"sourceRoot":"","file":"easing-patterns.js"}
-75
View File
@@ -1,75 +0,0 @@
// Extensions
import { Service } from '../service'; // Utilities
import * as easingPatterns from './easing-patterns';
import { getContainer, getOffset } from './util';
export default function goTo(_target, _settings = {}) {
const settings = {
container: document.scrollingElement || document.body || document.documentElement,
duration: 500,
offset: 0,
easing: 'easeInOutCubic',
appOffset: true,
..._settings
};
const container = getContainer(settings.container);
/* istanbul ignore else */
if (settings.appOffset && goTo.framework.application) {
const isDrawer = container.classList.contains('v-navigation-drawer');
const isClipped = container.classList.contains('v-navigation-drawer--clipped');
const {
bar,
top
} = goTo.framework.application;
settings.offset += bar;
/* istanbul ignore else */
if (!isDrawer || isClipped) settings.offset += top;
}
const startTime = performance.now();
let targetLocation;
if (typeof _target === 'number') {
targetLocation = getOffset(_target) - settings.offset;
} else {
targetLocation = getOffset(_target) - getOffset(container) - settings.offset;
}
const startLocation = container.scrollTop;
if (targetLocation === startLocation) return Promise.resolve(targetLocation);
const ease = typeof settings.easing === 'function' ? settings.easing : easingPatterns[settings.easing];
/* istanbul ignore else */
if (!ease) throw new TypeError(`Easing function "${settings.easing}" not found.`); // Cannot be tested properly in jsdom
// tslint:disable-next-line:promise-must-complete
/* istanbul ignore next */
return new Promise(resolve => requestAnimationFrame(function step(currentTime) {
const timeElapsed = currentTime - startTime;
const progress = Math.abs(settings.duration ? Math.min(timeElapsed / settings.duration, 1) : 1);
container.scrollTop = Math.floor(startLocation + (targetLocation - startLocation) * ease(progress));
const clientHeight = container === document.body ? document.documentElement.clientHeight : container.clientHeight;
if (progress === 1 || clientHeight + container.scrollTop === container.scrollHeight) {
return resolve(targetLocation);
}
requestAnimationFrame(step);
}));
}
goTo.framework = {};
goTo.init = () => {};
export class Goto extends Service {
constructor() {
super();
return goTo;
}
}
Goto.property = 'goTo';
//# sourceMappingURL=index.js.map
File diff suppressed because one or more lines are too long
-43
View File
@@ -1,43 +0,0 @@
// Return target's cumulative offset from the top
export function getOffset(target) {
if (typeof target === 'number') {
return target;
}
let el = $(target);
if (!el) {
throw typeof target === 'string' ? new Error(`Target element "${target}" not found.`) : new TypeError(`Target must be a Number/Selector/HTMLElement/VueComponent, received ${type(target)} instead.`);
}
let totalOffset = 0;
while (el) {
totalOffset += el.offsetTop;
el = el.offsetParent;
}
return totalOffset;
}
export function getContainer(container) {
const el = $(container);
if (el) return el;
throw typeof container === 'string' ? new Error(`Container element "${container}" not found.`) : new TypeError(`Container must be a Selector/HTMLElement/VueComponent, received ${type(container)} instead.`);
}
function type(el) {
return el == null ? el : el.constructor.name;
}
function $(el) {
if (typeof el === 'string') {
return document.querySelector(el);
} else if (el && el._isVue) {
return el.$el;
} else if (el instanceof HTMLElement) {
return el;
} else {
return null;
}
}
//# sourceMappingURL=util.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/services/goto/util.ts"],"names":[],"mappings":"AAEA;AACA,OAAM,SAAU,SAAV,CAAqB,MAArB,EAAgC;AACpC,MAAI,OAAO,MAAP,KAAkB,QAAtB,EAAgC;AAC9B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top\nexport function getOffset (target: any): number {\n if (typeof target === 'number') {\n return target\n }\n\n let el = $(target)\n if (!el) {\n throw typeof target === 'string'\n ? new Error(`Target element \"${target}\" not found.`)\n : new TypeError(`Target must be a Number/Selector/HTMLElement/VueComponent, received ${type(target)} instead.`)\n }\n\n let totalOffset = 0\n while (el) {\n totalOffset += el.offsetTop\n el = el.offsetParent as HTMLElement\n }\n\n return totalOffset\n}\n\nexport function getContainer (container: any): HTMLElement {\n const el = $(container)\n\n if (el) return el\n\n throw typeof container === 'string'\n ? new Error(`Container element \"${container}\" not found.`)\n : new TypeError(`Container must be a Selector/HTMLElement/VueComponent, received ${type(container)} instead.`)\n}\n\nfunction type (el: any) {\n return el == null ? el : el.constructor.name\n}\n\nfunction $ (el: any): HTMLElement | null {\n if (typeof el === 'string') {\n return document.querySelector<HTMLElement>(el)\n } else if (el && el._isVue) {\n return (el as Vue).$el as HTMLElement\n } else if (el instanceof HTMLElement) {\n return el\n } else {\n return null\n }\n}\n"],"sourceRoot":"","file":"util.js"}