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 { IconInstance, IconProps, IconPropsPublic, iconProps } from "./src/icon.js";
import { _default } from "./src/icon.vue.js";
//#region ../../packages/components/icon/index.d.ts
declare const ElIcon: SFCWithInstall<typeof _default>;
//#endregion
export { ElIcon, ElIcon as default, IconInstance, IconProps, IconPropsPublic, iconProps };
+10
View File
@@ -0,0 +1,10 @@
import { withInstall } from "../../utils/vue/install.mjs";
import { iconProps } from "./src/icon.mjs";
import icon_default from "./src/icon2.mjs";
//#region ../../packages/components/icon/index.ts
const ElIcon = withInstall(icon_default);
//#endregion
export { ElIcon, ElIcon as default, iconProps };
//# sourceMappingURL=index.mjs.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","names":["Icon"],"sources":["../../../../../packages/components/icon/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\nimport Icon from './src/icon.vue'\n\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElIcon: SFCWithInstall<typeof Icon> = withInstall(Icon)\nexport default ElIcon\n\nexport * from './src/icon'\n"],"mappings":";;;;;AAKA,MAAa,SAAsC,YAAYA,aAAK"}
+41
View File
@@ -0,0 +1,41 @@
import { EpPropMergeType } from "../../../utils/vue/props/types.js";
import "../../../utils/index.js";
import { _default } from "./icon.vue.js";
import * as vue from "vue";
import { ExtractPublicPropTypes } from "vue";
//#region ../../packages/components/icon/src/icon.d.ts
interface IconProps {
/**
* @description SVG icon size, size x size
*/
size?: number | string;
/**
* @description SVG tag's fill attribute
*/
color?: string;
}
/**
* @deprecated Removed after 3.0.0, Use `IconProps` instead.
*/
declare const iconProps: {
readonly size: {
readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly color: {
readonly type: vue.PropType<string>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
};
/**
* @deprecated Removed after 3.0.0, Use `IconProps` instead.
*/
type IconPropsPublic = ExtractPublicPropTypes<typeof iconProps>;
type IconInstance = InstanceType<typeof _default> & unknown;
//#endregion
export { IconInstance, IconProps, IconPropsPublic, iconProps };
+14
View File
@@ -0,0 +1,14 @@
import { buildProps, definePropType } from "../../../utils/vue/props/runtime.mjs";
//#region ../../packages/components/icon/src/icon.ts
/**
* @deprecated Removed after 3.0.0, Use `IconProps` instead.
*/
const iconProps = buildProps({
size: { type: definePropType([Number, String]) },
color: { type: String }
});
//#endregion
export { iconProps };
//# sourceMappingURL=icon.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"icon.mjs","names":[],"sources":["../../../../../../packages/components/icon/src/icon.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPublicPropTypes } from 'vue'\nimport type Icon from './icon.vue'\n\nexport interface IconProps {\n /**\n * @description SVG icon size, size x size\n */\n size?: number | string\n /**\n * @description SVG tag's fill attribute\n */\n color?: string\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `IconProps` instead.\n */\nexport const iconProps = buildProps({\n /**\n * @description SVG icon size, size x size\n */\n size: {\n type: definePropType<number | string>([Number, String]),\n },\n /**\n * @description SVG tag's fill attribute\n */\n color: {\n type: String,\n },\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `IconProps` instead.\n */\nexport type IconPropsPublic = ExtractPublicPropTypes<typeof iconProps>\nexport type IconInstance = InstanceType<typeof Icon> & unknown\n"],"mappings":";;;;;;AAmBA,MAAa,YAAY,WAAW;CAIlC,MAAM,EACJ,MAAM,eAAgC,CAAC,QAAQ,OAAO,CAAC,EACxD;CAID,OAAO,EACL,MAAM,QACP;CACF,CAAU"}
@@ -0,0 +1,18 @@
import { IconProps } from "./icon.js";
import * as vue from "vue";
//#region ../../packages/components/icon/src/icon.vue.d.ts
declare var __VLS_1: {};
type __VLS_Slots = {} & {
default?: (props: typeof __VLS_1) => any;
};
declare const __VLS_base: vue.DefineComponent<IconProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, 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,35 @@
import { addUnit } from "../../../utils/dom/style.mjs";
import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
import { iconProps } from "./icon.mjs";
import { computed, createElementBlock, defineComponent, mergeProps, openBlock, renderSlot, unref } from "vue";
//#region ../../packages/components/icon/src/icon.vue?vue&type=script&setup=true&lang.ts
var icon_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
name: "ElIcon",
inheritAttrs: false,
__name: "icon",
props: iconProps,
setup(__props) {
const props = __props;
const ns = useNamespace("icon");
const style = computed(() => {
const { size, color } = props;
const fontSize = addUnit(size);
if (!fontSize && !color) return {};
return {
fontSize,
"--color": color
};
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("i", mergeProps({
class: unref(ns).b(),
style: style.value
}, _ctx.$attrs), [renderSlot(_ctx.$slots, "default")], 16);
};
}
});
//#endregion
export { icon_vue_vue_type_script_setup_true_lang_default as default };
//# sourceMappingURL=icon.vue_vue_type_script_setup_true_lang.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"icon.vue_vue_type_script_setup_true_lang.mjs","names":["$attrs"],"sources":["../../../../../../packages/components/icon/src/icon.vue"],"sourcesContent":["<template>\n <i :class=\"ns.b()\" :style=\"style\" v-bind=\"$attrs\">\n <slot />\n </i>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { addUnit } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\n\nimport type { CSSProperties } from 'vue'\nimport type { IconProps } from './icon'\n\ndefineOptions({\n name: 'ElIcon',\n inheritAttrs: false,\n})\nconst props = defineProps<IconProps>()\nconst ns = useNamespace('icon')\n\nconst style = computed<CSSProperties>(() => {\n const { size, color } = props\n const fontSize = addUnit(size)\n if (!fontSize && !color) return {}\n\n return {\n fontSize,\n '--color': color,\n }\n})\n</script>\n"],"mappings":";;;;;;;;;;;;EAkBA,MAAM,QAAQ;EACd,MAAM,KAAK,aAAa,OAAM;EAE9B,MAAM,QAAQ,eAA8B;GAC1C,MAAM,EAAE,MAAM,UAAU;GACxB,MAAM,WAAW,QAAQ,KAAI;AAC7B,OAAI,CAAC,YAAY,CAAC,MAAO,QAAO,EAAC;AAEjC,UAAO;IACL;IACA,WAAW;IACb;IACD;;uBA7BC,mBAEI,KAFJ,WAEI;IAFA,OAAO,MAAA,GAAE,CAAC,GAAC;IAAK,OAAO,MAAA;MAAeA,KAAAA,OAAM,EAAA,CAC9C,WAAQ,KAAA,QAAA,UAAA"}
+8
View File
@@ -0,0 +1,8 @@
import icon_vue_vue_type_script_setup_true_lang_default from "./icon.vue_vue_type_script_setup_true_lang.mjs";
//#region ../../packages/components/icon/src/icon.vue
var icon_default = icon_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { icon_default as default };
//# sourceMappingURL=icon2.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"icon2.mjs","names":[],"sources":["../../../../../../packages/components/icon/src/icon.vue"],"sourcesContent":["<template>\n <i :class=\"ns.b()\" :style=\"style\" v-bind=\"$attrs\">\n <slot />\n </i>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { addUnit } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\n\nimport type { CSSProperties } from 'vue'\nimport type { IconProps } from './icon'\n\ndefineOptions({\n name: 'ElIcon',\n inheritAttrs: false,\n})\nconst props = defineProps<IconProps>()\nconst ns = useNamespace('icon')\n\nconst style = computed<CSSProperties>(() => {\n const { size, color } = props\n const fontSize = addUnit(size)\n if (!fontSize && !color) return {}\n\n return {\n fontSize,\n '--color': color,\n }\n})\n</script>\n"],"mappings":""}
+1
View File
@@ -0,0 +1 @@
import "../../base/style/css.mjs";
@@ -0,0 +1 @@
import "../../base/style/index.mjs";