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
+9
View File
@@ -0,0 +1,9 @@
import { SFCWithInstall } from "../../utils/vue/typescript.js";
import "../../utils/index.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 };
+14
View File
@@ -0,0 +1,14 @@
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
+1
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,4BAAYC,uBAAK"}
+65
View File
@@ -0,0 +1,65 @@
import { IconPropType } from "../../../utils/vue/icon.js";
import { EpPropFinalized, EpPropMergeType } from "../../../utils/vue/props/types.js";
import "../../../utils/index.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 };
+49
View File
@@ -0,0 +1,49 @@
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({
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: require_icon.iconPropType }
});
const linkEmits = { click: (evt) => evt instanceof MouseEvent };
//#endregion
exports.linkEmits = linkEmits;
exports.linkProps = linkProps;
//# sourceMappingURL=link.js.map
@@ -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,2BAAW;CAIlC,MAAM;EACJ,MAAM;EACN,QAAQ;GAAC;GAAW;GAAW;GAAW;GAAQ;GAAU;GAAU;EACtE,SAAS;EACV;CAID,WAAW;EACT,MAAM,CAAC,SAAS,OAAO;EACvB,QAAQ;GAAC;GAAM;GAAO;GAAU;GAAS;GAAQ;EACjD,SAAS;EACV;CAID,UAAU;CAIV,MAAM;EAAE,MAAM;EAAQ,SAAS;EAAI;CAInC,QAAQ;EACN,MAAM;EACN,SAAS;EACV;CAID,MAAM,EACJ,MAAMC,2BACP;CACF,CAAU;AAOX,MAAa,YAAY,EACvB,QAAQ,QAAoB,eAAe,YAC5C"}
@@ -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;
}>, {
target: "_blank" | "_parent" | "_self" | "_top" | (string & NonNullable<unknown>);
type: "primary" | "success" | "warning" | "info" | "danger" | "default";
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 };
@@ -0,0 +1,66 @@
const require_runtime = 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
@@ -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,0CAAgB,OAAM;AAE3C,8BACE;GACE,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS;GACT,KAAK;GACN,0BACc,wBAAU,MAAM,UAAU,CAAA,CAC3C;EAEA,MAAM,KAAK,6BAAa,OAAM;EAE9B,MAAM,kCAAyB;GAC7B,GAAG,GAAG;GACN,GAAG,EAAE,MAAM,QAAQ,aAAa,OAAO,QAAQ,UAAU;GACzD,GAAG,GAAG,YAAY,MAAM,SAAS;GACjC,GAAG,GAAG,aAAa,UAAU,UAAU,SAAS;GAChD,GAAG,GAAG,mBAAmB,UAAU,UAAU,WAAW,CAAC,MAAM,SAAS;GACzE,CAAA;EAGD,MAAM,oCAA2B;AAC/B,OAAI,wBAAU,MAAM,UAAU,CAC5B,QAAO,MAAM,YAAY,UAAU;OAC9B,QAAO,MAAM,aAAa,aAAa,OAAO,aAAa;IACnE;EAED,SAAS,YAAY,OAAmB;AACtC,OAAI,CAAC,MAAM,SAAU,MAAK,SAAS,MAAK;;;4DAtDpC,KAAA;IAXD,+BAAO,QAAA,MAAO;IACd,MAAM,QAAA,YAAQ,CAAK,QAAA,OAAO,SAAY,QAAA;IACtC,QAAQ,QAAA,YAAQ,CAAK,QAAA,OAAO,SAAY,QAAA;IACxC,SAAO;;IAEO,QAAA,kEAAwC,uBAAA,EAAA,EAAA,KAAA,GAAA,EAAA;qCAAV,8EAAR,QAAA,KAAI,CAAA;;;IAC7BA,KAAAA,OAAO,6DAEZ,QAAA;;KAFsB,8CAAO,GAAE,CAAC,EAAC,QAAA,CAAA;4BAC9B,KAAA,QAAA,UAAA;IAGEA,KAAAA,OAAO,2BAAoB,KAAA,QAAA,QAAA,EAAA,KAAA,GAAA,CAAA"}
+9
View File
@@ -0,0 +1,9 @@
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
const require_link_vue_vue_type_script_setup_true_lang = require('./link.vue_vue_type_script_setup_true_lang.js');
//#region ../../packages/components/link/src/link.vue
var link_default = require_link_vue_vue_type_script_setup_true_lang.default;
//#endregion
exports.default = link_default;
//# sourceMappingURL=link2.js.map
@@ -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":""}
+3
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");
@@ -0,0 +1,3 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
require('../../base/style/index.js');
require("element-plus/theme-chalk/src/link.scss");