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,13 @@
import * as vue from "vue";
//#region ../../packages/hooks/use-popper-container/index.d.ts
declare const usePopperContainerId: () => {
id: vue.ComputedRef<string>;
selector: vue.ComputedRef<string>;
};
declare const usePopperContainer: () => {
id: vue.ComputedRef<string>;
selector: vue.ComputedRef<string>;
};
//#endregion
export { usePopperContainer, usePopperContainerId };
@@ -0,0 +1,41 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../../_virtual/_rolldown/runtime.js');
const require_index = require('../use-namespace/index.js');
const require_index$1 = require('../use-id/index.js');
let vue = require("vue");
let _vueuse_core = require("@vueuse/core");
//#region ../../packages/hooks/use-popper-container/index.ts
const usePopperContainerId = () => {
const namespace = require_index.useGetDerivedNamespace();
const idInjection = require_index$1.useIdInjection();
const id = (0, vue.computed)(() => {
return `${namespace.value}-popper-container-${idInjection.prefix}`;
});
return {
id,
selector: (0, vue.computed)(() => `#${id.value}`)
};
};
const createContainer = (id) => {
const container = document.createElement("div");
container.id = id;
document.body.appendChild(container);
return container;
};
const usePopperContainer = () => {
const { id, selector } = usePopperContainerId();
(0, vue.onBeforeMount)(() => {
if (!_vueuse_core.isClient) return;
if (process.env.NODE_ENV === "test" || !document.body.querySelector(selector.value)) createContainer(id.value);
});
return {
id,
selector
};
};
//#endregion
exports.usePopperContainer = usePopperContainer;
exports.usePopperContainerId = usePopperContainerId;
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["useGetDerivedNamespace","useIdInjection","isClient"],"sources":["../../../../../packages/hooks/use-popper-container/index.ts"],"sourcesContent":["import { computed, onBeforeMount } from 'vue'\nimport { isClient } from '@element-plus/utils'\nimport { useGetDerivedNamespace } from '../use-namespace'\nimport { useIdInjection } from '../use-id'\n\nexport const usePopperContainerId = () => {\n const namespace = useGetDerivedNamespace()\n const idInjection = useIdInjection()\n\n const id = computed(() => {\n return `${namespace.value}-popper-container-${idInjection.prefix}`\n })\n const selector = computed(() => `#${id.value}`)\n\n return {\n id,\n selector,\n }\n}\n\nconst createContainer = (id: string) => {\n const container = document.createElement('div')\n container.id = id\n document.body.appendChild(container)\n return container\n}\n\nexport const usePopperContainer = () => {\n const { id, selector } = usePopperContainerId()\n onBeforeMount(() => {\n if (!isClient) return\n\n // This is for bypassing the error that when under testing env, we often encounter\n // document.body.innerHTML = '' situation\n // for this we need to disable the caching since it's not really needed\n if (\n process.env.NODE_ENV === 'test' ||\n !document.body.querySelector(selector.value)\n ) {\n createContainer(id.value)\n }\n })\n\n return {\n id,\n selector,\n }\n}\n"],"mappings":";;;;;;;;AAKA,MAAa,6BAA6B;CACxC,MAAM,YAAYA,sCAAwB;CAC1C,MAAM,cAAcC,gCAAgB;CAEpC,MAAM,6BAAoB;AACxB,SAAO,GAAG,UAAU,MAAM,oBAAoB,YAAY;GAC1D;AAGF,QAAO;EACL;EACA,kCAJ8B,IAAI,GAAG,QAAQ;EAK9C;;AAGH,MAAM,mBAAmB,OAAe;CACtC,MAAM,YAAY,SAAS,cAAc,MAAM;AAC/C,WAAU,KAAK;AACf,UAAS,KAAK,YAAY,UAAU;AACpC,QAAO;;AAGT,MAAa,2BAA2B;CACtC,MAAM,EAAE,IAAI,aAAa,sBAAsB;AAC/C,8BAAoB;AAClB,MAAI,CAACC,sBAAU;AAKf,MACE,QAAQ,IAAI,aAAa,UACzB,CAAC,SAAS,KAAK,cAAc,SAAS,MAAM,CAE5C,iBAAgB,GAAG,MAAM;GAE3B;AAEF,QAAO;EACL;EACA;EACD"}