This commit is contained in:
2025-09-19 14:25:20 +08:00
parent 269893a435
commit fbf3f77229
24949 changed files with 2839404 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
import Link from './src/link.vue';
import type { SFCWithInstall } from 'element-plus/es/utils';
export declare const ElLink: SFCWithInstall<typeof Link>;
export default ElLink;
export * from './src/link';

15
node_modules/element-plus/lib/components/link/index.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var link$1 = require('./src/link2.js');
var link = require('./src/link.js');
var install = require('../../utils/vue/install.js');
const ElLink = install.withInstall(link$1["default"]);
exports.linkEmits = link.linkEmits;
exports.linkProps = link.linkProps;
exports.ElLink = ElLink;
exports["default"] = ElLink;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","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"],"names":["withInstall","Link"],"mappings":";;;;;;;;AAEY,MAAC,MAAM,GAAGA,mBAAW,CAACC,iBAAI;;;;;;;"}

View File

@@ -0,0 +1,26 @@
import type { ExtractPropTypes, PropType, __ExtractPublicPropTypes } from 'vue';
import type Link from './link.vue';
export declare const linkProps: {
readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "default" | "primary" | "success" | "warning" | "info" | "danger", unknown, undefined, boolean>;
readonly underline: import("element-plus/es/utils").EpPropFinalized<readonly [BooleanConstructor, StringConstructor], boolean | "always" | "never" | "hover", unknown, undefined, boolean>;
readonly disabled: BooleanConstructor;
readonly href: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly target: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string) | (() => string) | ((new (...args: any[]) => string) | (() => string))[], unknown, unknown, "_self", boolean>;
readonly icon: {
readonly type: PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
};
export type LinkProps = ExtractPropTypes<typeof linkProps>;
export type LinkPropsPublic = __ExtractPublicPropTypes<typeof linkProps>;
export declare const linkEmits: {
click: (evt: MouseEvent) => boolean;
};
export type LinkEmits = typeof linkEmits;
export type LinkInstance = InstanceType<typeof Link> & unknown;
export interface LinkConfigContext {
type?: string;
underline?: string | boolean;
}

View File

@@ -0,0 +1,35 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var runtime = require('../../../utils/vue/props/runtime.js');
var icon = require('../../../utils/vue/icon.js');
const linkProps = runtime.buildProps({
type: {
type: String,
values: ["primary", "success", "warning", "info", "danger", "default"],
default: void 0
},
underline: {
type: [Boolean, String],
values: [true, false, "always", "never", "hover"],
default: void 0
},
disabled: Boolean,
href: { type: String, default: "" },
target: {
type: String,
default: "_self"
},
icon: {
type: icon.iconPropType
}
});
const linkEmits = {
click: (evt) => evt instanceof MouseEvent
};
exports.linkEmits = linkEmits;
exports.linkProps = linkProps;
//# sourceMappingURL=link.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"link.js","sources":["../../../../../../packages/components/link/src/link.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, PropType, __ExtractPublicPropTypes } from 'vue'\nimport type Link from './link.vue'\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)\nexport type LinkProps = ExtractPropTypes<typeof linkProps>\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?: string\n underline?: string | boolean\n}\n"],"names":["buildProps","iconPropType"],"mappings":";;;;;;;AACY,MAAC,SAAS,GAAGA,kBAAU,CAAC;AACpC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC;AAC1E,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;AAC3B,IAAI,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC;AACrD,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;AACrC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,iBAAY;AACtB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,SAAS,GAAG;AACzB,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C;;;;;"}

View File

@@ -0,0 +1,46 @@
declare function __VLS_template(): {
default?(_: {}): any;
icon?(_: {}): any;
};
declare const __VLS_component: import("vue").DefineComponent<{
readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "default" | "primary" | "success" | "warning" | "info" | "danger", unknown, undefined, boolean>;
readonly underline: import("element-plus/es/utils").EpPropFinalized<readonly [BooleanConstructor, StringConstructor], boolean | "always" | "never" | "hover", unknown, undefined, boolean>;
readonly disabled: BooleanConstructor;
readonly href: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly target: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string) | (() => string) | ((new (...args: any[]) => string) | (() => string))[], unknown, unknown, "_self", boolean>;
readonly icon: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
click: (evt: MouseEvent) => void;
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "default" | "primary" | "success" | "warning" | "info" | "danger", unknown, undefined, boolean>;
readonly underline: import("element-plus/es/utils").EpPropFinalized<readonly [BooleanConstructor, StringConstructor], boolean | "always" | "never" | "hover", unknown, undefined, boolean>;
readonly disabled: BooleanConstructor;
readonly href: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly target: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string) | (() => string) | ((new (...args: any[]) => string) | (() => string))[], unknown, unknown, "_self", boolean>;
readonly icon: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}>> & {
onClick?: ((evt: MouseEvent) => any) | undefined;
}, {
readonly disabled: boolean;
readonly underline: import("element-plus/es/utils").EpPropMergeType<readonly [BooleanConstructor, StringConstructor], boolean | "always" | "never" | "hover", unknown>;
readonly type: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "default" | "primary" | "success" | "warning" | "info" | "danger", unknown>;
readonly target: string;
readonly href: string;
}>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};

View File

@@ -0,0 +1,80 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var index$2 = require('../../icon/index.js');
var link = require('./link.js');
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
var useGlobalConfig = require('../../config-provider/src/hooks/use-global-config.js');
var index = require('../../../hooks/use-deprecated/index.js');
var types = require('../../../utils/types.js');
var index$1 = require('../../../hooks/use-namespace/index.js');
const __default__ = vue.defineComponent({
name: "ElLink"
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: link.linkProps,
emits: link.linkEmits,
setup(__props, { emit }) {
const props = __props;
const globalConfig = useGlobalConfig.useGlobalConfig("link");
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"
}, vue.computed(() => types.isBoolean(props.underline)));
const ns = index$1.useNamespace("link");
const linkKls = vue.computed(() => {
var _a, _b, _c;
return [
ns.b(),
ns.m((_c = (_b = props.type) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.type) != null ? _c : "default"),
ns.is("disabled", props.disabled),
ns.is("underline", underline.value === "always"),
ns.is("hover-underline", underline.value === "hover" && !props.disabled)
];
});
const underline = vue.computed(() => {
var _a, _b, _c;
if (types.isBoolean(props.underline)) {
return props.underline ? "hover" : "never";
} else
return (_c = (_b = props.underline) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.underline) != null ? _c : "hover";
});
function handleClick(event) {
if (!props.disabled)
emit("click", event);
}
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("a", {
class: vue.normalizeClass(vue.unref(linkKls)),
href: _ctx.disabled || !_ctx.href ? void 0 : _ctx.href,
target: _ctx.disabled || !_ctx.href ? void 0 : _ctx.target,
onClick: handleClick
}, [
_ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.ElIcon), { key: 0 }, {
default: vue.withCtx(() => [
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
]),
_: 1
})) : vue.createCommentVNode("v-if", true),
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("span", {
key: 1,
class: vue.normalizeClass(vue.unref(ns).e("inner"))
}, [
vue.renderSlot(_ctx.$slots, "default")
], 2)) : vue.createCommentVNode("v-if", true),
_ctx.$slots.icon ? vue.renderSlot(_ctx.$slots, "icon", { key: 2 }) : vue.createCommentVNode("v-if", true)
], 10, ["href", "target"]);
};
}
});
var Link = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "link.vue"]]);
exports["default"] = Link;
//# sourceMappingURL=link2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"link2.js","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, linkProps } from './link'\n\ndefineOptions({\n name: 'ElLink',\n})\nconst props = defineProps(linkProps)\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"],"names":["useGlobalConfig","useDeprecated","computed","isBoolean","useNamespace"],"mappings":";;;;;;;;;;;;;uCAwBc,CAAA;AAAA,EACZ,IAAM,EAAA,QAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAGA,IAAM,MAAA,YAAA,GAAeA,gCAAgB,MAAM,CAAA,CAAA;AAE3C,IAAAC,mBAAA,CAAA;AAAA,MACE,KAAA,EAAA,SAAA;AAAA,MAAA,IACS,EAAA,gCAAA;AAAA,M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,CAAA,EAAA,GAAA,YAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,SAAA,KAAA,IAAA,GAAA,EAAA,GAAA,OAAA,CAAA;AACtC,KAAA,CAAA,CAAA;AAAwC,IAC1C,SAAA,WAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,2 @@
import 'element-plus/es/components/base/style/css';
import 'element-plus/theme-chalk/el-link.css';

View File

@@ -0,0 +1,6 @@
'use strict';
require('../../base/style/css.js');
require('element-plus/theme-chalk/el-link.css');
//# sourceMappingURL=css.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}

View File

@@ -0,0 +1,2 @@
import 'element-plus/es/components/base/style';
import 'element-plus/theme-chalk/src/link.scss';

View File

@@ -0,0 +1,6 @@
'use strict';
require('../../base/style/index.js');
require('element-plus/theme-chalk/src/link.scss');
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}