完全跑通1.0版本

This commit is contained in:
2026-05-26 12:56:03 +08:00
parent 2ece5174a7
commit 93c714a93b
11557 changed files with 1648225 additions and 36 deletions

View File

@@ -0,0 +1,8 @@
import { SFCWithInstall } from "../../utils/vue/typescript.js";
import { LinkConfigContext, LinkEmits, LinkInstance, LinkProps, LinkPropsPublic, linkEmits, linkProps } from "./src/link.js";
import _default from "./src/link.vue.js";
//#region ../../packages/components/link/index.d.ts
declare const ElLink: SFCWithInstall<typeof _default>;
//#endregion
export { ElLink, ElLink as default, LinkConfigContext, LinkEmits, LinkInstance, LinkProps, LinkPropsPublic, linkEmits, linkProps };

View File

@@ -0,0 +1,16 @@
Object.defineProperties(exports, {
__esModule: { value: true },
[Symbol.toStringTag]: { value: "Module" }
});
const require_install = require("../../utils/vue/install.js");
const require_link = require("./src/link.js");
const require_link$1 = require("./src/link2.js");
//#region ../../packages/components/link/index.ts
const ElLink = require_install.withInstall(require_link$1.default);
//#endregion
exports.ElLink = ElLink;
exports.default = ElLink;
exports.linkEmits = require_link.linkEmits;
exports.linkProps = require_link.linkProps;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["withInstall","Link"],"sources":["../../../../../packages/components/link/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\nimport Link from './src/link.vue'\n\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElLink: SFCWithInstall<typeof Link> = withInstall(Link)\nexport default ElLink\n\nexport * from './src/link'\n"],"mappings":";;;;;;;;AAKA,MAAa,SAAsCA,gBAAAA,YAAYC,eAAAA,QAAK"}

View File

@@ -0,0 +1,64 @@
import { IconPropType } from "../../../utils/vue/icon.js";
import { EpPropFinalized, EpPropMergeType } from "../../../utils/vue/props/types.js";
import _default from "./link.vue.js";
import * as _$vue from "vue";
import { ExtractPublicPropTypes, PropType } from "vue";
//#region ../../packages/components/link/src/link.d.ts
interface LinkProps {
/**
* @description type
*/
type?: 'primary' | 'success' | 'warning' | 'info' | 'danger' | 'default';
/**
* @description when underlines should appear
*/
underline?: boolean | 'always' | 'never' | 'hover';
/**
* @description whether the component is disabled
*/
disabled?: boolean;
/**
* @description same as native hyperlink's `href`
*/
href?: string;
/**
* @description same as native hyperlink's `target`
*/
target?: '_blank' | '_parent' | '_self' | '_top' | (string & NonNullable<unknown>);
/**
* @description icon component
*/
icon?: IconPropType;
}
/**
* @deprecated Removed after 3.0.0, Use `LinkProps` instead.
*/
declare const linkProps: {
readonly type: EpPropFinalized<StringConstructor, "default" | "info" | "primary" | "success" | "warning" | "danger", unknown, undefined, boolean>;
readonly underline: EpPropFinalized<readonly [BooleanConstructor, StringConstructor], boolean | "always" | "never" | "hover", unknown, undefined, boolean>;
readonly disabled: BooleanConstructor;
readonly href: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly target: EpPropFinalized<(new (...args: any[]) => string) | (() => string) | (((new (...args: any[]) => string) | (() => string)) | null)[], unknown, unknown, "_self", boolean>;
readonly icon: {
readonly type: PropType<EpPropMergeType<(new (...args: any[]) => (string | _$vue.Component) & {}) | (() => string | _$vue.Component) | (((new (...args: any[]) => (string | _$vue.Component) & {}) | (() => string | _$vue.Component)) | null)[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
};
/**
* @deprecated Removed after 3.0.0, Use `LinkProps` instead.
*/
type LinkPropsPublic = ExtractPublicPropTypes<typeof linkProps>;
declare const linkEmits: {
click: (evt: MouseEvent) => boolean;
};
type LinkEmits = typeof linkEmits;
type LinkInstance = InstanceType<typeof _default> & unknown;
interface LinkConfigContext {
type?: LinkProps['type'];
underline?: LinkProps['underline'];
}
//#endregion
export { LinkConfigContext, LinkEmits, LinkInstance, LinkProps, LinkPropsPublic, linkEmits, linkProps };

View File

@@ -0,0 +1,66 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_runtime = require("../../../utils/vue/props/runtime.js");
const require_icon = require("../../../utils/vue/icon.js");
//#region ../../packages/components/link/src/link.ts
/**
* @deprecated Removed after 3.0.0, Use `LinkProps` instead.
*/
const linkProps = require_runtime.buildProps({
/**
* @description type
*/
type: {
type: String,
values: [
"primary",
"success",
"warning",
"info",
"danger",
"default"
],
default: void 0
},
/**
* @description when underlines should appear
*/
underline: {
type: [Boolean, String],
values: [
true,
false,
"always",
"never",
"hover"
],
default: void 0
},
/**
* @description whether the component is disabled
*/
disabled: Boolean,
/**
* @description same as native hyperlink's `href`
*/
href: {
type: String,
default: ""
},
/**
* @description same as native hyperlink's `target`
*/
target: {
type: String,
default: "_self"
},
/**
* @description icon component
*/
icon: { type: require_icon.iconPropType }
});
const linkEmits = { click: (evt) => evt instanceof MouseEvent };
//#endregion
exports.linkEmits = linkEmits;
exports.linkProps = linkProps;
//# sourceMappingURL=link.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"link.js","names":["buildProps","iconPropType"],"sources":["../../../../../../packages/components/link/src/link.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\n\nimport type { ExtractPublicPropTypes, PropType } from 'vue'\nimport type { IconPropType } from '@element-plus/utils'\nimport type Link from './link.vue'\n\nexport interface LinkProps {\n /**\n * @description type\n */\n type?: 'primary' | 'success' | 'warning' | 'info' | 'danger' | 'default'\n /**\n * @description when underlines should appear\n */\n underline?: boolean | 'always' | 'never' | 'hover'\n\n /**\n * @description whether the component is disabled\n */\n disabled?: boolean\n /**\n * @description same as native hyperlink's `href`\n */\n href?: string\n /**\n * @description same as native hyperlink's `target`\n */\n target?:\n | '_blank'\n | '_parent'\n | '_self'\n | '_top'\n | (string & NonNullable<unknown>)\n\n /**\n * @description icon component\n */\n icon?: IconPropType\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `LinkProps` instead.\n */\nexport const linkProps = buildProps({\n /**\n * @description type\n */\n type: {\n type: String,\n values: ['primary', 'success', 'warning', 'info', 'danger', 'default'],\n default: undefined,\n },\n /**\n * @description when underlines should appear\n */\n underline: {\n type: [Boolean, String],\n values: [true, false, 'always', 'never', 'hover'],\n default: undefined,\n },\n /**\n * @description whether the component is disabled\n */\n disabled: Boolean,\n /**\n * @description same as native hyperlink's `href`\n */\n href: { type: String, default: '' },\n /**\n * @description same as native hyperlink's `target`\n */\n target: {\n type: String as PropType<'_blank' | '_parent' | '_self' | '_top' | string>,\n default: '_self',\n },\n /**\n * @description icon component\n */\n icon: {\n type: iconPropType,\n },\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `LinkProps` instead.\n */\nexport type LinkPropsPublic = ExtractPublicPropTypes<typeof linkProps>\n\nexport const linkEmits = {\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\nexport type LinkEmits = typeof linkEmits\n\nexport type LinkInstance = InstanceType<typeof Link> & unknown\nexport interface LinkConfigContext {\n type?: LinkProps['type']\n underline?: LinkProps['underline']\n}\n"],"mappings":";;;;;;;AA2CA,MAAa,YAAYA,gBAAAA,WAAW;;;;CAIlC,MAAM;EACJ,MAAM;EACN,QAAQ;GAAC;GAAW;GAAW;GAAW;GAAQ;GAAU;GAAU;EACtE,SAAS,KAAA;EACV;;;;CAID,WAAW;EACT,MAAM,CAAC,SAAS,OAAO;EACvB,QAAQ;GAAC;GAAM;GAAO;GAAU;GAAS;GAAQ;EACjD,SAAS,KAAA;EACV;;;;CAID,UAAU;;;;CAIV,MAAM;EAAE,MAAM;EAAQ,SAAS;EAAI;;;;CAInC,QAAQ;EACN,MAAM;EACN,SAAS;EACV;;;;CAID,MAAM,EACJ,MAAMC,aAAAA,cACP;CACF,CAAU;AAOX,MAAa,YAAY,EACvB,QAAQ,QAAoB,eAAe,YAC5C"}

View File

@@ -0,0 +1,29 @@
import { LinkProps } from "./link.js";
import * as _$vue from "vue";
//#region ../../packages/components/link/src/link.vue.d.ts
declare var __VLS_12: {}, __VLS_14: {};
type __VLS_Slots = {} & {
default?: (props: typeof __VLS_12) => any;
} & {
icon?: (props: typeof __VLS_14) => any;
};
declare const __VLS_base: _$vue.DefineComponent<LinkProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
click: (evt: MouseEvent) => void;
}, string, _$vue.PublicProps, Readonly<LinkProps> & Readonly<{
onClick?: ((evt: MouseEvent) => any) | undefined;
}>, {
type: "primary" | "success" | "warning" | "info" | "danger" | "default";
target: "_blank" | "_parent" | "_self" | "_top" | (string & NonNullable<unknown>);
underline: boolean | "always" | "never" | "hover";
href: string;
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
declare const _default: typeof __VLS_export;
type __VLS_WithSlots<T, S> = T & {
new (): {
$slots: S;
};
};
//#endregion
export { _default as default };

View File

@@ -0,0 +1,65 @@
require("../../../_virtual/_rolldown/runtime.js");
const require_types = require("../../../utils/types.js");
const require_index = require("../../../hooks/use-deprecated/index.js");
const require_index$1 = require("../../../hooks/use-namespace/index.js");
const require_index$2 = require("../../icon/index.js");
const require_use_global_config = require("../../config-provider/src/hooks/use-global-config.js");
const require_link = require("./link.js");
let vue = require("vue");
//#region ../../packages/components/link/src/link.vue?vue&type=script&setup=true&lang.ts
const _hoisted_1 = ["href", "target"];
var link_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
name: "ElLink",
__name: "link",
props: require_link.linkProps,
emits: require_link.linkEmits,
setup(__props, { emit: __emit }) {
const props = __props;
const emit = __emit;
const globalConfig = require_use_global_config.useGlobalConfig("link");
require_index.useDeprecated({
scope: "el-link",
from: "The underline option (boolean)",
replacement: "'always' | 'hover' | 'never'",
version: "3.0.0",
ref: "https://element-plus.org/en-US/component/link.html#underline"
}, (0, vue.computed)(() => require_types.isBoolean(props.underline)));
const ns = require_index$1.useNamespace("link");
const linkKls = (0, vue.computed)(() => [
ns.b(),
ns.m(props.type ?? globalConfig.value?.type ?? "default"),
ns.is("disabled", props.disabled),
ns.is("underline", underline.value === "always"),
ns.is("hover-underline", underline.value === "hover" && !props.disabled)
]);
const underline = (0, vue.computed)(() => {
if (require_types.isBoolean(props.underline)) return props.underline ? "hover" : "never";
else return props.underline ?? globalConfig.value?.underline ?? "hover";
});
function handleClick(event) {
if (!props.disabled) emit("click", event);
}
return (_ctx, _cache) => {
return (0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
class: (0, vue.normalizeClass)(linkKls.value),
href: __props.disabled || !__props.href ? void 0 : __props.href,
target: __props.disabled || !__props.href ? void 0 : __props.target,
onClick: handleClick
}, [
__props.icon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_index$2.ElIcon), { key: 0 }, {
default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.icon)))]),
_: 1
})) : (0, vue.createCommentVNode)("v-if", true),
_ctx.$slots.default ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
key: 1,
class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("inner"))
}, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2)) : (0, vue.createCommentVNode)("v-if", true),
_ctx.$slots.icon ? (0, vue.renderSlot)(_ctx.$slots, "icon", { key: 2 }) : (0, vue.createCommentVNode)("v-if", true)
], 10, _hoisted_1);
};
}
});
//#endregion
exports.default = link_vue_vue_type_script_setup_true_lang_default;
//# sourceMappingURL=link.vue_vue_type_script_setup_true_lang.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"link.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../../../../packages/components/link/src/link.vue"],"sourcesContent":["<template>\n <a\n :class=\"linkKls\"\n :href=\"disabled || !href ? undefined : href\"\n :target=\"disabled || !href ? undefined : target\"\n @click=\"handleClick\"\n >\n <el-icon v-if=\"icon\"><component :is=\"icon\" /></el-icon>\n <span v-if=\"$slots.default\" :class=\"ns.e('inner')\">\n <slot />\n </span>\n\n <slot v-if=\"$slots.icon\" name=\"icon\" />\n </a>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useGlobalConfig } from '@element-plus/components/config-provider'\nimport { useDeprecated, useNamespace } from '@element-plus/hooks'\nimport { isBoolean } from '@element-plus/utils'\nimport { linkEmits } from './link'\n\nimport type { LinkProps } from './link'\n\ndefineOptions({\n name: 'ElLink',\n})\nconst props = withDefaults(defineProps<LinkProps>(), {\n type: undefined,\n underline: undefined,\n href: '',\n target: '_self',\n})\nconst emit = defineEmits(linkEmits)\nconst globalConfig = useGlobalConfig('link')\n\nuseDeprecated(\n {\n scope: 'el-link',\n from: 'The underline option (boolean)',\n replacement: \"'always' | 'hover' | 'never'\",\n version: '3.0.0',\n ref: 'https://element-plus.org/en-US/component/link.html#underline',\n },\n computed(() => isBoolean(props.underline))\n)\n\nconst ns = useNamespace('link')\n\nconst linkKls = computed(() => [\n ns.b(),\n ns.m(props.type ?? globalConfig.value?.type ?? 'default'),\n ns.is('disabled', props.disabled),\n ns.is('underline', underline.value === 'always'),\n ns.is('hover-underline', underline.value === 'hover' && !props.disabled),\n])\n\n// Boolean compatibility\nconst underline = computed(() => {\n if (isBoolean(props.underline)) {\n return props.underline ? 'hover' : 'never'\n } else return props.underline ?? globalConfig.value?.underline ?? 'hover'\n})\n\nfunction handleClick(event: MouseEvent) {\n if (!props.disabled) emit('click', event)\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;EA6BA,MAAM,QAAQ;EAMd,MAAM,OAAO;EACb,MAAM,eAAe,0BAAA,gBAAgB,OAAM;EAE3C,cAAA,cACE;GACE,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS;GACT,KAAK;GACN,GAAA,GAAA,IAAA,gBACc,cAAA,UAAU,MAAM,UAAU,CAAA,CAC3C;EAEA,MAAM,KAAK,gBAAA,aAAa,OAAM;EAE9B,MAAM,WAAA,GAAA,IAAA,gBAAyB;GAC7B,GAAG,GAAG;GACN,GAAG,EAAE,MAAM,QAAQ,aAAa,OAA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
__esModule: { value: true },
[Symbol.toStringTag]: { value: "Module" }
});
//#region ../../packages/components/link/src/link.vue
var link_default = require("./link.vue_vue_type_script_setup_true_lang.js").default;
//#endregion
exports.default = link_default;
//# sourceMappingURL=link2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"link2.js","names":[],"sources":["../../../../../../packages/components/link/src/link.vue"],"sourcesContent":["<template>\n <a\n :class=\"linkKls\"\n :href=\"disabled || !href ? undefined : href\"\n :target=\"disabled || !href ? undefined : target\"\n @click=\"handleClick\"\n >\n <el-icon v-if=\"icon\"><component :is=\"icon\" /></el-icon>\n <span v-if=\"$slots.default\" :class=\"ns.e('inner')\">\n <slot />\n </span>\n\n <slot v-if=\"$slots.icon\" name=\"icon\" />\n </a>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useGlobalConfig } from '@element-plus/components/config-provider'\nimport { useDeprecated, useNamespace } from '@element-plus/hooks'\nimport { isBoolean } from '@element-plus/utils'\nimport { linkEmits } from './link'\n\nimport type { LinkProps } from './link'\n\ndefineOptions({\n name: 'ElLink',\n})\nconst props = withDefaults(defineProps<LinkProps>(), {\n type: undefined,\n underline: undefined,\n href: '',\n target: '_self',\n})\nconst emit = defineEmits(linkEmits)\nconst globalConfig = useGlobalConfig('link')\n\nuseDeprecated(\n {\n scope: 'el-link',\n from: 'The underline option (boolean)',\n replacement: \"'always' | 'hover' | 'never'\",\n version: '3.0.0',\n ref: 'https://element-plus.org/en-US/component/link.html#underline',\n },\n computed(() => isBoolean(props.underline))\n)\n\nconst ns = useNamespace('link')\n\nconst linkKls = computed(() => [\n ns.b(),\n ns.m(props.type ?? globalConfig.value?.type ?? 'default'),\n ns.is('disabled', props.disabled),\n ns.is('underline', underline.value === 'always'),\n ns.is('hover-underline', underline.value === 'hover' && !props.disabled),\n])\n\n// Boolean compatibility\nconst underline = computed(() => {\n if (isBoolean(props.underline)) {\n return props.underline ? 'hover' : 'never'\n } else return props.underline ?? globalConfig.value?.underline ?? 'hover'\n})\n\nfunction handleClick(event: MouseEvent) {\n if (!props.disabled) emit('click', event)\n}\n</script>\n"],"mappings":""}

View File

@@ -0,0 +1,3 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../../base/style/css.js");
require("element-plus/theme-chalk/el-link.css");

View File

@@ -0,0 +1,3 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../../base/style/index.js");
require("element-plus/theme-chalk/src/link.scss");