@dreamonkey/quasar-app-extension-animate
Advanced tools
Comparing version 2.2.2 to 2.3.0
@@ -1,10 +0,14 @@ | ||
import { getCurrentInstance, onMounted } from "vue"; | ||
import { hideAnimatableElements } from "../shared"; | ||
export function useAnimate() { | ||
const vm = getCurrentInstance()?.proxy; | ||
onMounted(() => { | ||
hideAnimatableElements(vm); | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.useAnimate = void 0; | ||
const vue_1 = require("vue"); | ||
const shared_1 = require("../shared"); | ||
function useAnimate() { | ||
const vm = (0, vue_1.getCurrentInstance)()?.proxy; | ||
(0, vue_1.onMounted)(() => { | ||
(0, shared_1.hideAnimatableElements)(vm); | ||
}); | ||
} | ||
export default useAnimate; | ||
exports.useAnimate = useAnimate; | ||
exports.default = useAnimate; | ||
//# sourceMappingURL=animate.js.map |
@@ -1,4 +0,23 @@ | ||
export { default as AnimateMixin } from "./mixins/animate"; | ||
export { default as useAnimate } from "./composables/animate"; | ||
export * from "./shared"; | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.useAnimate = exports.AnimateMixin = void 0; | ||
var animate_1 = require("./mixins/animate"); | ||
Object.defineProperty(exports, "AnimateMixin", { enumerable: true, get: function () { return animate_1.default; } }); | ||
var animate_2 = require("./composables/animate"); | ||
Object.defineProperty(exports, "useAnimate", { enumerable: true, get: function () { return animate_2.default; } }); | ||
__exportStar(require("./shared"), exports); | ||
//# sourceMappingURL=exports.js.map |
@@ -1,7 +0,9 @@ | ||
import { hideAnimatableElements } from "../shared"; | ||
export default { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const shared_1 = require("../shared"); | ||
exports.default = { | ||
mounted() { | ||
hideAnimatableElements(this); | ||
(0, shared_1.hideAnimatableElements)(this); | ||
}, | ||
}; | ||
//# sourceMappingURL=animate.js.map |
@@ -0,1 +1,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.hideAnimatableElements = exports.whenPast = exports.whenPastStart = exports.whenPastQuarter = exports.whenPastHalf = exports.whenPastEnd = exports.whenPastPercentage = exports.animateOut = exports.animateIn = exports.animate = void 0; | ||
const percentageKeywordMap = { | ||
@@ -7,3 +10,3 @@ end: 1.0, | ||
}; | ||
export function animate(animationClass, options = {}) { | ||
function animate(animationClass, options = {}) { | ||
const delay = options.delay || 0; | ||
@@ -21,10 +24,13 @@ const classes = ["animated", animationClass]; | ||
} | ||
export function animateIn(animationClass, options = {}) { | ||
exports.animate = animate; | ||
function animateIn(animationClass, options = {}) { | ||
return animate(animationClass, { easing: "decelerate", ...options }); | ||
} | ||
export function animateOut(animationClass, options = {}) { | ||
exports.animateIn = animateIn; | ||
function animateOut(animationClass, options = {}) { | ||
return animate(animationClass, { easing: "accelerate", ...options }); | ||
} | ||
exports.animateOut = animateOut; | ||
// v-intersection helpers | ||
export function whenPastPercentage(percentage, intersectionHandler) { | ||
function whenPastPercentage(percentage, intersectionHandler) { | ||
return { | ||
@@ -37,15 +43,20 @@ handler: function (entry) { | ||
} | ||
export function whenPastEnd(intersectionHandler) { | ||
exports.whenPastPercentage = whenPastPercentage; | ||
function whenPastEnd(intersectionHandler) { | ||
return whenPastPercentage(1, intersectionHandler); | ||
} | ||
export function whenPastHalf(intersectionHandler) { | ||
exports.whenPastEnd = whenPastEnd; | ||
function whenPastHalf(intersectionHandler) { | ||
return whenPastPercentage(0.5, intersectionHandler); | ||
} | ||
export function whenPastQuarter(intersectionHandler) { | ||
exports.whenPastHalf = whenPastHalf; | ||
function whenPastQuarter(intersectionHandler) { | ||
return whenPastPercentage(0.25, intersectionHandler); | ||
} | ||
export function whenPastStart(intersectionHandler) { | ||
exports.whenPastQuarter = whenPastQuarter; | ||
function whenPastStart(intersectionHandler) { | ||
return whenPastPercentage(0.0, intersectionHandler); | ||
} | ||
export function whenPast(percentageOrKeyword, intersectionHandler) { | ||
exports.whenPastStart = whenPastStart; | ||
function whenPast(percentageOrKeyword, intersectionHandler) { | ||
if (typeof percentageOrKeyword !== "number" && | ||
@@ -65,2 +76,3 @@ typeof percentageOrKeyword !== "string") { | ||
} | ||
exports.whenPast = whenPast; | ||
// Taken from https://github.com/vuejs/test-utils/blob/1b35e75868025ab1925c15208c55580e52b27326/src/vueWrapper.ts#L67 | ||
@@ -72,3 +84,3 @@ function getComponentRoot(vm) { | ||
} | ||
export function hideAnimatableElements(vm) { | ||
function hideAnimatableElements(vm) { | ||
const element = getComponentRoot(vm); | ||
@@ -79,2 +91,3 @@ element.querySelectorAll("[data-animate]").forEach((el) => { | ||
} | ||
exports.hideAnimatableElements = hideAnimatableElements; | ||
//# sourceMappingURL=shared.js.map |
{ | ||
"name": "@dreamonkey/quasar-app-extension-animate", | ||
"version": "2.2.2", | ||
"version": "2.3.0", | ||
"description": "Extend Quasar animation system", | ||
@@ -17,5 +17,6 @@ "keywords": [ | ||
"main": "dist/exports.js", | ||
"module": "dist/esm/exports.js", | ||
"typings": "dist/types/exports.d.ts", | ||
"scripts": { | ||
"build": "rm -rf dist && tsc --declaration --declarationDir dist/types && copyfiles -f src/css/animations.scss src/css/animations-utilities.scss dist", | ||
"build": "rm -rf dist && tsc --declaration --declarationDir dist/types && tsc --project tsconfig.esm.json && copyfiles -f src/css/animations.scss src/css/animations-utilities.scss dist", | ||
"install-build-clean": "yarn install && yarn build && rm -rf node_modules", | ||
@@ -22,0 +23,0 @@ "test": "echo \"No test specified\" && exit 0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
37427
33
420