测试
This commit is contained in:
8
frontend/node_modules/element-plus/lib/hooks/use-popper-container/index.d.ts
generated
vendored
Normal file
8
frontend/node_modules/element-plus/lib/hooks/use-popper-container/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export declare const usePopperContainerId: () => {
|
||||
id: import("vue").ComputedRef<string>;
|
||||
selector: import("vue").ComputedRef<string>;
|
||||
};
|
||||
export declare const usePopperContainer: () => {
|
||||
id: import("vue").ComputedRef<string>;
|
||||
selector: import("vue").ComputedRef<string>;
|
||||
};
|
||||
45
frontend/node_modules/element-plus/lib/hooks/use-popper-container/index.js
generated
vendored
Normal file
45
frontend/node_modules/element-plus/lib/hooks/use-popper-container/index.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var vue = require('vue');
|
||||
var index = require('../use-namespace/index.js');
|
||||
var index$1 = require('../use-id/index.js');
|
||||
var core = require('@vueuse/core');
|
||||
|
||||
const usePopperContainerId = () => {
|
||||
const namespace = index.useGetDerivedNamespace();
|
||||
const idInjection = index$1.useIdInjection();
|
||||
const id = vue.computed(() => {
|
||||
return `${namespace.value}-popper-container-${idInjection.prefix}`;
|
||||
});
|
||||
const selector = vue.computed(() => `#${id.value}`);
|
||||
return {
|
||||
id,
|
||||
selector
|
||||
};
|
||||
};
|
||||
const createContainer = (id) => {
|
||||
const container = document.createElement("div");
|
||||
container.id = id;
|
||||
document.body.appendChild(container);
|
||||
return container;
|
||||
};
|
||||
const usePopperContainer = () => {
|
||||
const { id, selector } = usePopperContainerId();
|
||||
vue.onBeforeMount(() => {
|
||||
if (!core.isClient)
|
||||
return;
|
||||
if (!document.body.querySelector(selector.value)) {
|
||||
createContainer(id.value);
|
||||
}
|
||||
});
|
||||
return {
|
||||
id,
|
||||
selector
|
||||
};
|
||||
};
|
||||
|
||||
exports.usePopperContainer = usePopperContainer;
|
||||
exports.usePopperContainerId = usePopperContainerId;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
frontend/node_modules/element-plus/lib/hooks/use-popper-container/index.js.map
generated
vendored
Normal file
1
frontend/node_modules/element-plus/lib/hooks/use-popper-container/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","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"],"names":["useGetDerivedNamespace","useIdInjection","computed","onBeforeMount","isClient"],"mappings":";;;;;;;;;AAIY,MAAC,oBAAoB,GAAG,MAAM;AAC1C,EAAE,MAAM,SAAS,GAAGA,4BAAsB,EAAE,CAAC;AAC7C,EAAE,MAAM,WAAW,GAAGC,sBAAc,EAAE,CAAC;AACvC,EAAE,MAAM,EAAE,GAAGC,YAAQ,CAAC,MAAM;AAC5B,IAAI,OAAO,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AACvE,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,QAAQ,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