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
+10
View File
@@ -0,0 +1,10 @@
import { SFCWithInstall } from "../../utils/vue/typescript.js";
import "../../utils/index.js";
import { CardConfigContext, CardProps, CardPropsPublic, cardContextKey, cardProps } from "./src/card.js";
import { _default } from "./src/card.vue.js";
import { CardInstance } from "./src/instance.js";
//#region ../../packages/components/card/index.d.ts
declare const ElCard: SFCWithInstall<typeof _default>;
//#endregion
export { CardConfigContext, type CardInstance, CardProps, CardPropsPublic, ElCard, ElCard as default, cardContextKey, cardProps };
+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_card = require('./src/card.js');
const require_card$1 = require('./src/card2.js');
//#region ../../packages/components/card/index.ts
const ElCard = require_install.withInstall(require_card$1.default);
//#endregion
exports.ElCard = ElCard;
exports.default = ElCard;
exports.cardContextKey = require_card.cardContextKey;
exports.cardProps = require_card.cardProps;
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["withInstall","Card"],"sources":["../../../../../packages/components/card/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\nimport Card from './src/card.vue'\n\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElCard: SFCWithInstall<typeof Card> = withInstall(Card)\nexport default ElCard\n\nexport * from './src/card'\nexport type { CardInstance } from './src/instance'\n"],"mappings":";;;;;;AAKA,MAAa,SAAsCA,4BAAYC,uBAAK"}
+58
View File
@@ -0,0 +1,58 @@
import { EpPropFinalized } from "../../../utils/vue/props/types.js";
import "../../../utils/index.js";
import * as vue from "vue";
import { ExtractPublicPropTypes, InjectionKey, StyleValue } from "vue";
//#region ../../packages/components/card/src/card.d.ts
interface CardProps {
/**
* @description title of the card. Also accepts a DOM passed by `slot#header`
*/
header?: string;
/**
* @description content of footer. Also accepts a DOM passed by `slot#footer`
*/
footer?: string;
/**
* @description CSS style of card body
*/
bodyStyle?: StyleValue;
/**
* @description custom class name of card header
*/
headerClass?: string;
/**
* @description custom class name of card body
*/
bodyClass?: string;
/**
* @description custom class name of card footer
*/
footerClass?: string;
/**
* @description when to show card shadows
*/
shadow?: 'always' | 'hover' | 'never';
}
/**
* @deprecated Removed after 3.0.0, Use `CardProps` instead.
*/
declare const cardProps: {
readonly header: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly footer: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly bodyStyle: EpPropFinalized<(new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, "", boolean>;
readonly headerClass: StringConstructor;
readonly bodyClass: StringConstructor;
readonly footerClass: StringConstructor;
readonly shadow: EpPropFinalized<StringConstructor, "always" | "never" | "hover", unknown, undefined, boolean>;
};
/**
* @deprecated Removed after 3.0.0, Use `CardProps` instead.
*/
type CardPropsPublic = ExtractPublicPropTypes<typeof cardProps>;
interface CardConfigContext {
shadow?: CardProps['shadow'];
}
declare const cardContextKey: InjectionKey<CardConfigContext>;
//#endregion
export { CardConfigContext, CardProps, CardPropsPublic, cardContextKey, cardProps };
+43
View File
@@ -0,0 +1,43 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../../../utils/vue/props/runtime.js');
//#region ../../packages/components/card/src/card.ts
/**
* @deprecated Removed after 3.0.0, Use `CardProps` instead.
*/
const cardProps = require_runtime.buildProps({
header: {
type: String,
default: ""
},
footer: {
type: String,
default: ""
},
bodyStyle: {
type: require_runtime.definePropType([
String,
Object,
Array
]),
default: ""
},
headerClass: String,
bodyClass: String,
footerClass: String,
shadow: {
type: String,
values: [
"always",
"hover",
"never"
],
default: void 0
}
});
const cardContextKey = Symbol("cardContextKey");
//#endregion
exports.cardContextKey = cardContextKey;
exports.cardProps = cardProps;
//# sourceMappingURL=card.js.map
@@ -0,0 +1 @@
{"version":3,"file":"card.js","names":["buildProps","definePropType"],"sources":["../../../../../../packages/components/card/src/card.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPublicPropTypes, InjectionKey, StyleValue } from 'vue'\n\nexport interface CardProps {\n /**\n * @description title of the card. Also accepts a DOM passed by `slot#header`\n */\n header?: string\n /**\n * @description content of footer. Also accepts a DOM passed by `slot#footer`\n */\n footer?: string\n /**\n * @description CSS style of card body\n */\n bodyStyle?: StyleValue\n /**\n * @description custom class name of card header\n */\n headerClass?: string\n /**\n * @description custom class name of card body\n */\n bodyClass?: string\n /**\n * @description custom class name of card footer\n */\n footerClass?: string\n /**\n * @description when to show card shadows\n */\n shadow?: 'always' | 'hover' | 'never'\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `CardProps` instead.\n */\nexport const cardProps = buildProps({\n /**\n * @description title of the card. Also accepts a DOM passed by `slot#header`\n */\n header: {\n type: String,\n default: '',\n },\n /**\n * @description content of footer. Also accepts a DOM passed by `slot#footer`\n */\n footer: {\n type: String,\n default: '',\n },\n /**\n * @description CSS style of card body\n */\n bodyStyle: {\n type: definePropType<StyleValue>([String, Object, Array]),\n default: '',\n },\n /**\n * @description custom class name of card footer\n */\n headerClass: String,\n /**\n * @description custom class name of card body\n */\n bodyClass: String,\n /**\n * @description custom class name of card footer\n */\n footerClass: String,\n /**\n * @description when to show card shadows\n */\n shadow: {\n type: String,\n values: ['always', 'hover', 'never'],\n default: undefined,\n },\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `CardProps` instead.\n */\nexport type CardPropsPublic = ExtractPublicPropTypes<typeof cardProps>\nexport interface CardConfigContext {\n shadow?: CardProps['shadow']\n}\n\nexport const cardContextKey: InjectionKey<CardConfigContext> =\n Symbol('cardContextKey')\n"],"mappings":";;;;;;;AAsCA,MAAa,YAAYA,2BAAW;CAIlC,QAAQ;EACN,MAAM;EACN,SAAS;EACV;CAID,QAAQ;EACN,MAAM;EACN,SAAS;EACV;CAID,WAAW;EACT,MAAMC,+BAA2B;GAAC;GAAQ;GAAQ;GAAM,CAAC;EACzD,SAAS;EACV;CAID,aAAa;CAIb,WAAW;CAIX,aAAa;CAIb,QAAQ;EACN,MAAM;EACN,QAAQ;GAAC;GAAU;GAAS;GAAQ;EACpC,SAAS;EACV;CACF,CAAU;AAUX,MAAa,iBACX,OAAO,iBAAiB"}
@@ -0,0 +1,27 @@
import { CardProps } from "./card.js";
import * as vue from "vue";
//#region ../../packages/components/card/src/card.vue.d.ts
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
type __VLS_Slots = {} & {
header?: (props: typeof __VLS_1) => any;
} & {
default?: (props: typeof __VLS_3) => any;
} & {
footer?: (props: typeof __VLS_5) => any;
};
declare const __VLS_base: vue.DefineComponent<CardProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<CardProps> & Readonly<{}>, {
header: string;
footer: string;
bodyStyle: string | false | vue.CSSProperties | vue.StyleValue[] | null;
shadow: "always" | "hover" | "never";
}, {}, {}, {}, 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,36 @@
const require_runtime = require('../../../_virtual/_rolldown/runtime.js');
const require_index = require('../../../hooks/use-namespace/index.js');
const require_use_global_config = require('../../config-provider/src/hooks/use-global-config.js');
const require_card = require('./card.js');
let vue = require("vue");
//#region ../../packages/components/card/src/card.vue?vue&type=script&setup=true&lang.ts
var card_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
name: "ElCard",
__name: "card",
props: require_card.cardProps,
setup(__props) {
const globalConfig = require_use_global_config.useGlobalConfig("card");
const ns = require_index.useNamespace("card");
return (_ctx, _cache) => {
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).b(), (0, vue.unref)(ns).is(`${__props.shadow || (0, vue.unref)(globalConfig)?.shadow || "always"}-shadow`)]) }, [
_ctx.$slots.header || __props.header ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
key: 0,
class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("header"), __props.headerClass])
}, [(0, vue.renderSlot)(_ctx.$slots, "header", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.header), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true),
(0, vue.createElementVNode)("div", {
class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("body"), __props.bodyClass]),
style: (0, vue.normalizeStyle)(__props.bodyStyle)
}, [(0, vue.renderSlot)(_ctx.$slots, "default")], 6),
_ctx.$slots.footer || __props.footer ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
key: 1,
class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("footer"), __props.footerClass])
}, [(0, vue.renderSlot)(_ctx.$slots, "footer", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.footer), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true)
], 2);
};
}
});
//#endregion
exports.default = card_vue_vue_type_script_setup_true_lang_default;
//# sourceMappingURL=card.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
{"version":3,"file":"card.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../../../../packages/components/card/src/card.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ns.b(),\n ns.is(`${shadow || globalConfig?.shadow || 'always'}-shadow`),\n ]\"\n >\n <div v-if=\"$slots.header || header\" :class=\"[ns.e('header'), headerClass]\">\n <slot name=\"header\">{{ header }}</slot>\n </div>\n <div :class=\"[ns.e('body'), bodyClass]\" :style=\"bodyStyle\">\n <slot />\n </div>\n <div v-if=\"$slots.footer || footer\" :class=\"[ns.e('footer'), footerClass]\">\n <slot name=\"footer\">{{ footer }}</slot>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useNamespace } from '@element-plus/hooks'\nimport { useGlobalConfig } from '@element-plus/components/config-provider'\n\nimport type { CardProps } from './card'\n\nconst globalConfig = useGlobalConfig('card')\n\ndefineOptions({\n name: 'ElCard',\n})\n\nwithDefaults(defineProps<CardProps>(), {\n header: '',\n footer: '',\n bodyStyle: '',\n shadow: undefined,\n})\n\nconst ns = useNamespace('card')\n</script>\n"],"mappings":";;;;;;;;;;;;EAyBA,MAAM,eAAe,0CAAgB,OAAM;EAa3C,MAAM,KAAK,2BAAa,OAAM;;4DAtBtB,OAAA,EAdH,+BAAK,gBAAU,GAAE,CAAC,GAAC,iBAAU,GAAE,CAAC,GAAE,GAAI,QAAA,yBAAU,aAAY,EAAE,UAAM,SAAA,SAAA;IAK1DA,KAAAA,OAAO,UAAU,QAAA,4DAEtB,OAAA;;KAF+B,+BAAK,gBAAG,GAAE,CAAC,EAAC,SAAA,EAAY,QAAA,YAAW,CAAA;4BAC/B,KAAA,QAAA,UAAA,EAAA,QAAA,mDAAhB,QAAA,OAAM,EAAA,EAAA;gCAIzB,OAAA;KAFA,+BAAK,gBAAG,GAAE,CAAC,EAAC,OAAA,EAAU,QAAA,UAAS,CAAA;KAAI,+BAAO,QAAA,UAAS;4BAC/C,KAAA,QAAA,UAAA;IAECA,KAAAA,OAAO,UAAU,QAAA,4DAEtB,OAAA;;KAF+B,+BAAK,gBAAG,GAAE,CAAC,EAAC,SAAA,EAAY,QAAA,YAAW,CAAA;4BAC/B,KAAA,QAAA,UAAA,EAAA,QAAA,mDAAhB,QAAA,OAAM,EAAA,EAAA"}
+9
View File
@@ -0,0 +1,9 @@
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
const require_card_vue_vue_type_script_setup_true_lang = require('./card.vue_vue_type_script_setup_true_lang.js');
//#region ../../packages/components/card/src/card.vue
var card_default = require_card_vue_vue_type_script_setup_true_lang.default;
//#endregion
exports.default = card_default;
//# sourceMappingURL=card2.js.map
@@ -0,0 +1 @@
{"version":3,"file":"card2.js","names":[],"sources":["../../../../../../packages/components/card/src/card.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ns.b(),\n ns.is(`${shadow || globalConfig?.shadow || 'always'}-shadow`),\n ]\"\n >\n <div v-if=\"$slots.header || header\" :class=\"[ns.e('header'), headerClass]\">\n <slot name=\"header\">{{ header }}</slot>\n </div>\n <div :class=\"[ns.e('body'), bodyClass]\" :style=\"bodyStyle\">\n <slot />\n </div>\n <div v-if=\"$slots.footer || footer\" :class=\"[ns.e('footer'), footerClass]\">\n <slot name=\"footer\">{{ footer }}</slot>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useNamespace } from '@element-plus/hooks'\nimport { useGlobalConfig } from '@element-plus/components/config-provider'\n\nimport type { CardProps } from './card'\n\nconst globalConfig = useGlobalConfig('card')\n\ndefineOptions({\n name: 'ElCard',\n})\n\nwithDefaults(defineProps<CardProps>(), {\n header: '',\n footer: '',\n bodyStyle: '',\n shadow: undefined,\n})\n\nconst ns = useNamespace('card')\n</script>\n"],"mappings":""}
@@ -0,0 +1,6 @@
import { _default } from "./card.vue.js";
//#region ../../packages/components/card/src/instance.d.ts
type CardInstance = InstanceType<typeof _default> & unknown;
//#endregion
export { CardInstance };
@@ -0,0 +1 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+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-card.css");
@@ -0,0 +1,3 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
require('../../base/style/index.js');
require("element-plus/theme-chalk/src/card.scss");