feat: initial commit - Phase 1 & 2 core features

This commit is contained in:
hiderfong
2026-04-22 17:07:33 +08:00
commit 1773bda06b
25005 changed files with 6252106 additions and 0 deletions
@@ -0,0 +1,40 @@
//#region ../../packages/hooks/use-transition-fallthrough/index.d.ts
declare const useTransitionFallthroughEmits: readonly ["after-appear", "after-enter", "after-leave", "appear", "appear-cancelled", "before-enter", "before-leave", "enter", "enter-cancelled", "leave", "leave-cancelled"];
/**
* NOTE:
* This is only a delegator for delegating transition callbacks.
* Use this at your need.
*/
/**
* Simple usage
*
* In your setups:
*
* setup() {
* const fallthroughMethods = useTransitionFallthrough()
* return fallthrough
* }
*
* In your template:
*
* <template>
* <transition name="whatever" v-bind="fallthrough">
* <slot />
* </transition>
* </template>
*
*/
declare const useTransitionFallthrough: () => {
onAfterAppear: () => void;
onAfterEnter: () => void;
onAfterLeave: () => void;
onAppearCancelled: () => void;
onBeforeEnter: () => void;
onBeforeLeave: () => void;
onEnter: () => void;
onEnterCancelled: () => void;
onLeave: () => void;
onLeaveCancelled: () => void;
};
//#endregion
export { useTransitionFallthrough, useTransitionFallthroughEmits };
@@ -0,0 +1,94 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../../_virtual/_rolldown/runtime.js');
let vue = require("vue");
//#region ../../packages/hooks/use-transition-fallthrough/index.ts
/* istanbul ignore file */
const AFTER_APPEAR = "after-appear";
const AFTER_ENTER = "after-enter";
const AFTER_LEAVE = "after-leave";
const APPEAR = "appear";
const APPEAR_CANCELLED = "appear-cancelled";
const BEFORE_ENTER = "before-enter";
const BEFORE_LEAVE = "before-leave";
const ENTER = "enter";
const ENTER_CANCELLED = "enter-cancelled";
const LEAVE = "leave";
const LEAVE_CANCELLED = "leave-cancelled";
const useTransitionFallthroughEmits = [
AFTER_APPEAR,
AFTER_ENTER,
AFTER_LEAVE,
APPEAR,
APPEAR_CANCELLED,
BEFORE_ENTER,
BEFORE_LEAVE,
ENTER,
ENTER_CANCELLED,
LEAVE,
LEAVE_CANCELLED
];
/**
* NOTE:
* This is only a delegator for delegating transition callbacks.
* Use this at your need.
*/
/**
* Simple usage
*
* In your setups:
*
* setup() {
* const fallthroughMethods = useTransitionFallthrough()
* return fallthrough
* }
*
* In your template:
*
* <template>
* <transition name="whatever" v-bind="fallthrough">
* <slot />
* </transition>
* </template>
*
*/
const useTransitionFallthrough = () => {
const { emit } = (0, vue.getCurrentInstance)();
return {
onAfterAppear: () => {
emit(AFTER_APPEAR);
},
onAfterEnter: () => {
emit(AFTER_ENTER);
},
onAfterLeave: () => {
emit(AFTER_LEAVE);
},
onAppearCancelled: () => {
emit(APPEAR_CANCELLED);
},
onBeforeEnter: () => {
emit(BEFORE_ENTER);
},
onBeforeLeave: () => {
emit(BEFORE_LEAVE);
},
onEnter: () => {
emit(ENTER);
},
onEnterCancelled: () => {
emit(ENTER_CANCELLED);
},
onLeave: () => {
emit(LEAVE);
},
onLeaveCancelled: () => {
emit(LEAVE_CANCELLED);
}
};
};
//#endregion
exports.useTransitionFallthrough = useTransitionFallthrough;
exports.useTransitionFallthroughEmits = useTransitionFallthroughEmits;
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":[],"sources":["../../../../../packages/hooks/use-transition-fallthrough/index.ts"],"sourcesContent":["/* istanbul ignore file */\nimport { getCurrentInstance } from 'vue'\n\nconst AFTER_APPEAR = 'after-appear'\nconst AFTER_ENTER = 'after-enter'\nconst AFTER_LEAVE = 'after-leave'\nconst APPEAR = 'appear'\nconst APPEAR_CANCELLED = 'appear-cancelled'\nconst BEFORE_ENTER = 'before-enter'\nconst BEFORE_LEAVE = 'before-leave'\nconst ENTER = 'enter'\nconst ENTER_CANCELLED = 'enter-cancelled'\nconst LEAVE = 'leave'\nconst LEAVE_CANCELLED = 'leave-cancelled'\n\nexport const useTransitionFallthroughEmits = [\n AFTER_APPEAR,\n AFTER_ENTER,\n AFTER_LEAVE,\n APPEAR,\n APPEAR_CANCELLED,\n BEFORE_ENTER,\n BEFORE_LEAVE,\n ENTER,\n ENTER_CANCELLED,\n LEAVE,\n LEAVE_CANCELLED,\n] as const\n\n// Sometimes we want to delegate the transition emitted event\n// we have to right the function locally, which is not a good\n// approach to this, so we created this hook for the event\n// fallthrough\n\n/**\n * NOTE:\n * This is only a delegator for delegating transition callbacks.\n * Use this at your need.\n */\n\n/**\n * Simple usage\n *\n * In your setups:\n *\n * setup() {\n * const fallthroughMethods = useTransitionFallthrough()\n * return fallthrough\n * }\n *\n * In your template:\n *\n * <template>\n * <transition name=\"whatever\" v-bind=\"fallthrough\">\n * <slot />\n * </transition>\n * </template>\n *\n */\n\nexport const useTransitionFallthrough = () => {\n const { emit } = getCurrentInstance()!\n\n return {\n onAfterAppear: () => {\n emit(AFTER_APPEAR)\n },\n onAfterEnter: () => {\n emit(AFTER_ENTER)\n },\n onAfterLeave: () => {\n emit(AFTER_LEAVE)\n },\n onAppearCancelled: () => {\n emit(APPEAR_CANCELLED)\n },\n onBeforeEnter: () => {\n emit(BEFORE_ENTER)\n },\n onBeforeLeave: () => {\n emit(BEFORE_LEAVE)\n },\n onEnter: () => {\n emit(ENTER)\n },\n onEnterCancelled: () => {\n emit(ENTER_CANCELLED)\n },\n onLeave: () => {\n emit(LEAVE)\n },\n onLeaveCancelled: () => {\n emit(LEAVE_CANCELLED)\n },\n }\n}\n"],"mappings":";;;;;;AAGA,MAAM,eAAe;AACrB,MAAM,cAAc;AACpB,MAAM,cAAc;AACpB,MAAM,SAAS;AACf,MAAM,mBAAmB;AACzB,MAAM,eAAe;AACrB,MAAM,eAAe;AACrB,MAAM,QAAQ;AACd,MAAM,kBAAkB;AACxB,MAAM,QAAQ;AACd,MAAM,kBAAkB;AAExB,MAAa,gCAAgC;CAC3C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;;;;;;;;;;;;;;;;;;;AAiCD,MAAa,iCAAiC;CAC5C,MAAM,EAAE,sCAA6B;AAErC,QAAO;EACL,qBAAqB;AACnB,QAAK,aAAa;;EAEpB,oBAAoB;AAClB,QAAK,YAAY;;EAEnB,oBAAoB;AAClB,QAAK,YAAY;;EAEnB,yBAAyB;AACvB,QAAK,iBAAiB;;EAExB,qBAAqB;AACnB,QAAK,aAAa;;EAEpB,qBAAqB;AACnB,QAAK,aAAa;;EAEpB,eAAe;AACb,QAAK,MAAM;;EAEb,wBAAwB;AACtB,QAAK,gBAAgB;;EAEvB,eAAe;AACb,QAAK,MAAM;;EAEb,wBAAwB;AACtB,QAAK,gBAAgB;;EAExB"}