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
+21
View File
@@ -0,0 +1,21 @@
import { MaybeRef } from "@vueuse/core";
//#region ../../packages/hooks/use-deprecated/index.d.ts
type DeprecationParam = {
from: string;
replacement: string;
scope: string;
version: string;
ref: string;
type?: 'API' | 'Attribute' | 'Event' | 'Slot';
};
declare const useDeprecated: ({
from,
replacement,
scope,
version,
ref,
type
}: DeprecationParam, condition: MaybeRef<boolean>) => void;
//#endregion
export { useDeprecated };
+15
View File
@@ -0,0 +1,15 @@
import { debugWarn } from "../../utils/error.mjs";
import { unref, watch } from "vue";
//#region ../../packages/hooks/use-deprecated/index.ts
const useDeprecated = ({ from, replacement, scope, version, ref, type = "API" }, condition) => {
watch(() => unref(condition), (val) => {
if (val) debugWarn(scope, `[${type}] ${from} is about to be deprecated in version ${version}, please use ${replacement} instead.
For more detail, please visit: ${ref}
`);
}, { immediate: true });
};
//#endregion
export { useDeprecated };
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../packages/hooks/use-deprecated/index.ts"],"sourcesContent":["import { unref, watch } from 'vue'\nimport { debugWarn } from '@element-plus/utils'\n\nimport type { MaybeRef } from '@vueuse/core'\n\ntype DeprecationParam = {\n from: string\n replacement: string\n scope: string\n version: string\n ref: string\n type?: 'API' | 'Attribute' | 'Event' | 'Slot'\n}\n\nexport const useDeprecated = (\n { from, replacement, scope, version, ref, type = 'API' }: DeprecationParam,\n condition: MaybeRef<boolean>\n) => {\n watch(\n () => unref(condition),\n (val) => {\n if (val) {\n debugWarn(\n scope,\n `[${type}] ${from} is about to be deprecated in version ${version}, please use ${replacement} instead.\nFor more detail, please visit: ${ref}\n`\n )\n }\n },\n {\n immediate: true,\n }\n )\n}\n"],"mappings":";;;;AAcA,MAAa,iBACX,EAAE,MAAM,aAAa,OAAO,SAAS,KAAK,OAAO,SACjD,cACG;AACH,aACQ,MAAM,UAAU,GACrB,QAAQ;AACP,MAAI,IACF,WACE,OACA,IAAI,KAAK,IAAI,KAAK,wCAAwC,QAAQ,eAAe,YAAY;iCACtE,IAAI;EAE5B;IAGL,EACE,WAAW,MACZ,CACF"}