完全跑通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,9 @@
import { SFCWithInstall } from "../../utils/vue/typescript.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 };

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_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

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,gBAAAA,YAAYC,eAAAA,QAAK"}

View File

@@ -0,0 +1,57 @@
import { EpPropFinalized } from "../../../utils/vue/props/types.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 };

View File

@@ -0,0 +1,64 @@
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({
/**
* @description title of the card. Also accepts a DOM passed by `slot#header`
*/
header: {
type: String,
default: ""
},
/**
* @description content of footer. Also accepts a DOM passed by `slot#footer`
*/
footer: {
type: String,
default: ""
},
/**
* @description CSS style of card body
*/
bodyStyle: {
type: require_runtime.definePropType([
String,
Object,
Array,
Boolean
]),
default: ""
},
/**
* @description custom class name of card footer
*/
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: {
type: String,
values: [
"always",
"hover",
"never"
],
default: void 0
}
});
const cardContextKey = Symbol("cardContextKey");
//#endregion
exports.cardContextKey = cardContextKey;
exports.cardProps = cardProps;
//# sourceMappingURL=card.js.map

View File

@@ -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, Boolean]),\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,gBAAAA,WAAW;;;;CAIlC,QAAQ;EACN,MAAM;EACN,SAAS;EACV;;;;CAID,QAAQ;EACN,MAAM;EACN,SAAS;EACV;;;;CAID,WAAW;EACT,MAAMC,gBAAAA,eAA2B;GAAC;GAAQ;GAAQ;GAAO;GAAQ,CAAC;EAClE,SAAS;EACV;;;;CAID,aAAa;;;;CAIb,WAAW;;;;CAIX,aAAa;;;;CAIb,QAAQ;EACN,MAAM;EACN,QAAQ;GAAC;GAAU;GAAS;GAAQ;EACpC,SAAS,KAAA;EACV;CACF,CAAU;AAUX,MAAa,iBACX,OAAO,iBAAiB"}

View File

@@ -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 as default };

View File

@@ -0,0 +1,35 @@
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

View File

@@ -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,0BAAA,gBAAgB,OAAM;EAa3C,MAAM,KAAK,cAAA,aAAa,OAAM;;4DAtBtB,OAAA,EAdH,QAAA,GAAA,IAAA,gBAAK,EAAA,GAAA,IAAA,OAAU,GAAE,CAAC,GAAC,GAAA,GAAA,IAAA,OAAU,GAAE,CAAC,GAAE,GAAI,QAAA,WAAA,GAAA,IAAA,OAAU,aAAY,EAAE,UAAM,SAAA,SAAA,CAAA,CAAA,EAAA,EAAA;IAK1DA,KAAAA,OAAO,UAAU,QAAA,WAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAEtB,OAAA;;KAF+B,QAAA,GAAA,IAAA,gBAAK,EAAA,GAAA,IAAA,OAAG,GAAE,CAAC,EAAC,SAAA,EAAY,QAAA,YAAW,CAAA;4BAC/B,KAAA,QAAA,UAAA,EAAA,QAAA,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,iBAAhB,QAAA,OAAM,EAAA,EAAA,CAAA,CAAA,CAAA,EAAA,EAAA,KAAA,GAAA,IAAA,oBAAA,QAAA,KAAA;gCAIzB,OAAA;KAFA,QAAA,GAAA,IAAA,gBAAK,EAAA,GAAA,IAAA,OAAG,GAAE,CAAC,EAAC,OAAA,EAAU,QAAA,UAAS,CAAA;KAAI,QAAA,GAAA,IAAA,gBAAO,QAAA,UAAS;4BAC/C,KAAA,QAAA,UAAA,CAAA,EAAA,EAAA;IAECA,KAAAA,OAAO,UAAU,QAAA,WAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAEtB,OAAA;;KAF+B,QAAA,GAAA,IAAA,gBAAK,EAAA,GAAA,IAAA,OAAG,GAAE,CAAC,EAAC,SAAA,EAAY,QAAA,YAAW,CAAA;4BAC/B,KAAA,QAAA,UAAA,EAAA,QAAA,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,iBAAhB,QAAA,OAAM,EAAA,EAAA,CAAA,CAAA,CAAA,EAAA,EAAA,KAAA,GAAA,IAAA,oBAAA,QAAA,KAAA"}

View File

@@ -0,0 +1,10 @@
Object.defineProperties(exports, {
__esModule: { value: true },
[Symbol.toStringTag]: { value: "Module" }
});
//#region ../../packages/components/card/src/card.vue
var card_default = require("./card.vue_vue_type_script_setup_true_lang.js").default;
//#endregion
exports.default = card_default;
//# sourceMappingURL=card2.js.map

View File

@@ -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":""}

View File

@@ -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 };

View File

@@ -0,0 +1 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });

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");

View File

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