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 Result from './src/result.vue';
import type { SFCWithInstall } from 'element-plus/es/utils';
export declare const ElResult: SFCWithInstall<typeof Result>;
export default ElResult;
export * from './src/result';

View File

@@ -0,0 +1,8 @@
import Result from './src/result2.mjs';
export { IconComponentMap, IconMap, resultProps } from './src/result.mjs';
import { withInstall } from '../../utils/vue/install.mjs';
const ElResult = withInstall(Result);
export { ElResult, ElResult as default };
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/result/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\nimport Result from './src/result.vue'\n\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElResult: SFCWithInstall<typeof Result> = withInstall(Result)\n\nexport default ElResult\n\nexport * from './src/result'\n"],"names":[],"mappings":";;;;AAEY,MAAC,QAAQ,GAAG,WAAW,CAAC,MAAM;;;;"}

View File

@@ -0,0 +1,18 @@
import type { Component, ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
import type Result from './result.vue';
export declare const IconMap: {
readonly primary: "icon-primary";
readonly success: "icon-success";
readonly warning: "icon-warning";
readonly error: "icon-error";
readonly info: "icon-info";
};
export declare const IconComponentMap: Record<typeof IconMap[keyof typeof IconMap], Component>;
export declare const resultProps: {
readonly title: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly subTitle: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly icon: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "error" | "primary" | "success" | "warning" | "info", unknown, "info", boolean>;
};
export type ResultProps = ExtractPropTypes<typeof resultProps>;
export type ResultPropsPublic = __ExtractPublicPropTypes<typeof resultProps>;
export type ResultInstance = InstanceType<typeof Result> & unknown;

View File

@@ -0,0 +1,35 @@
import { InfoFilled, CircleCheckFilled, WarningFilled, CircleCloseFilled } from '@element-plus/icons-vue';
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
const IconMap = {
primary: "icon-primary",
success: "icon-success",
warning: "icon-warning",
error: "icon-error",
info: "icon-info"
};
const IconComponentMap = {
[IconMap.primary]: InfoFilled,
[IconMap.success]: CircleCheckFilled,
[IconMap.warning]: WarningFilled,
[IconMap.error]: CircleCloseFilled,
[IconMap.info]: InfoFilled
};
const resultProps = buildProps({
title: {
type: String,
default: ""
},
subTitle: {
type: String,
default: ""
},
icon: {
type: String,
values: ["primary", "success", "warning", "info", "error"],
default: "info"
}
});
export { IconComponentMap, IconMap, resultProps };
//# sourceMappingURL=result.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"result.mjs","sources":["../../../../../../packages/components/result/src/result.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport {\n CircleCheckFilled,\n CircleCloseFilled,\n InfoFilled,\n WarningFilled,\n} from '@element-plus/icons-vue'\n\nimport type { Component, ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type Result from './result.vue'\n\nexport const IconMap = {\n primary: 'icon-primary',\n success: 'icon-success',\n warning: 'icon-warning',\n error: 'icon-error',\n info: 'icon-info',\n} as const\n\nexport const IconComponentMap: Record<\n typeof IconMap[keyof typeof IconMap],\n Component\n> = {\n [IconMap.primary]: InfoFilled,\n [IconMap.success]: CircleCheckFilled,\n [IconMap.warning]: WarningFilled,\n [IconMap.error]: CircleCloseFilled,\n [IconMap.info]: InfoFilled,\n}\n\nexport const resultProps = buildProps({\n /**\n * @description title of result\n */\n title: {\n type: String,\n default: '',\n },\n /**\n * @description sub title of result\n */\n subTitle: {\n type: String,\n default: '',\n },\n /**\n * @description icon type of result\n */\n icon: {\n type: String,\n values: ['primary', 'success', 'warning', 'info', 'error'],\n default: 'info',\n },\n} as const)\n\nexport type ResultProps = ExtractPropTypes<typeof resultProps>\nexport type ResultPropsPublic = __ExtractPublicPropTypes<typeof resultProps>\n\nexport type ResultInstance = InstanceType<typeof Result> & unknown\n"],"names":[],"mappings":";;;AAOY,MAAC,OAAO,GAAG;AACvB,EAAE,OAAO,EAAE,cAAc;AACzB,EAAE,OAAO,EAAE,cAAc;AACzB,EAAE,OAAO,EAAE,cAAc;AACzB,EAAE,KAAK,EAAE,YAAY;AACrB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE;AACU,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAAC,OAAO,CAAC,OAAO,GAAG,UAAU;AAC/B,EAAE,CAAC,OAAO,CAAC,OAAO,GAAG,iBAAiB;AACtC,EAAE,CAAC,OAAO,CAAC,OAAO,GAAG,aAAa;AAClC,EAAE,CAAC,OAAO,CAAC,KAAK,GAAG,iBAAiB;AACpC,EAAE,CAAC,OAAO,CAAC,IAAI,GAAG,UAAU;AAC5B,EAAE;AACU,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;AAC9D,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,CAAC;;;;"}

View File

@@ -0,0 +1,26 @@
declare function __VLS_template(): {
icon?(_: {}): any;
title?(_: {}): any;
"sub-title"?(_: {}): any;
extra?(_: {}): any;
};
declare const __VLS_component: import("vue").DefineComponent<{
readonly title: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly subTitle: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly icon: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "error" | "primary" | "success" | "warning" | "info", unknown, "info", boolean>;
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
readonly title: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly subTitle: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly icon: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "error" | "primary" | "success" | "warning" | "info", unknown, "info", boolean>;
}>>, {
readonly title: string;
readonly icon: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "error" | "primary" | "success" | "warning" | "info", unknown>;
readonly subTitle: 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,67 @@
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode, toDisplayString } from 'vue';
import { resultProps, IconMap, IconComponentMap } from './result.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
const __default__ = defineComponent({
name: "ElResult"
});
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
props: resultProps,
setup(__props) {
const props = __props;
const ns = useNamespace("result");
const resultIcon = computed(() => {
const icon = props.icon;
const iconClass = icon && IconMap[icon] ? IconMap[icon] : "icon-info";
const iconComponent = IconComponentMap[iconClass] || IconComponentMap["icon-info"];
return {
class: iconClass,
component: iconComponent
};
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(unref(ns).b())
}, [
createElementVNode("div", {
class: normalizeClass(unref(ns).e("icon"))
}, [
renderSlot(_ctx.$slots, "icon", {}, () => [
unref(resultIcon).component ? (openBlock(), createBlock(resolveDynamicComponent(unref(resultIcon).component), {
key: 0,
class: normalizeClass(unref(resultIcon).class)
}, null, 8, ["class"])) : createCommentVNode("v-if", true)
])
], 2),
_ctx.title || _ctx.$slots.title ? (openBlock(), createElementBlock("div", {
key: 0,
class: normalizeClass(unref(ns).e("title"))
}, [
renderSlot(_ctx.$slots, "title", {}, () => [
createElementVNode("p", null, toDisplayString(_ctx.title), 1)
])
], 2)) : createCommentVNode("v-if", true),
_ctx.subTitle || _ctx.$slots["sub-title"] ? (openBlock(), createElementBlock("div", {
key: 1,
class: normalizeClass(unref(ns).e("subtitle"))
}, [
renderSlot(_ctx.$slots, "sub-title", {}, () => [
createElementVNode("p", null, toDisplayString(_ctx.subTitle), 1)
])
], 2)) : createCommentVNode("v-if", true),
_ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
key: 2,
class: normalizeClass(unref(ns).e("extra"))
}, [
renderSlot(_ctx.$slots, "extra")
], 2)) : createCommentVNode("v-if", true)
], 2);
};
}
});
var Result = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "result.vue"]]);
export { Result as default };
//# sourceMappingURL=result2.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"result2.mjs","sources":["../../../../../../packages/components/result/src/result.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <div :class=\"ns.e('icon')\">\n <slot name=\"icon\">\n <component\n :is=\"resultIcon.component\"\n v-if=\"resultIcon.component\"\n :class=\"resultIcon.class\"\n />\n </slot>\n </div>\n <div v-if=\"title || $slots.title\" :class=\"ns.e('title')\">\n <slot name=\"title\">\n <p>{{ title }}</p>\n </slot>\n </div>\n <div v-if=\"subTitle || $slots['sub-title']\" :class=\"ns.e('subtitle')\">\n <slot name=\"sub-title\">\n <p>{{ subTitle }}</p>\n </slot>\n </div>\n <div v-if=\"$slots.extra\" :class=\"ns.e('extra')\">\n <slot name=\"extra\" />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { IconComponentMap, IconMap, resultProps } from './result'\n\ndefineOptions({\n name: 'ElResult',\n})\n\nconst props = defineProps(resultProps)\n\nconst ns = useNamespace('result')\n\nconst resultIcon = computed(() => {\n const icon = props.icon\n const iconClass = icon && IconMap[icon] ? IconMap[icon] : 'icon-info'\n const iconComponent =\n IconComponentMap[iconClass] || IconComponentMap['icon-info']\n\n return {\n class: iconClass,\n component: iconComponent,\n }\n})\n</script>\n"],"names":[],"mappings":";;;;;mCAgCc,CAAA;AAAA,EACZ,IAAM,EAAA,UAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAM,MAAA,EAAA,GAAK,aAAa,QAAQ,CAAA,CAAA;AAEhC,IAAM,MAAA,UAAA,GAAa,SAAS,MAAM;AAChC,MAAA,MAAM,OAAO,KAAM,CAAA,IAAA,CAAA;AACnB,MAAA,MAAM,YAAY,IAAQ,IAAA,OAAA,CAAQ,IAAI,CAAI,GAAA,OAAA,CAAQ,IAAI,CAAI,GAAA,WAAA,CAAA;AAC1D,MAAA,MAAM,aACJ,GAAA,gBAAA,CAAiB,SAAS,CAAA,IAAK,iBAAiB,WAAW,CAAA,CAAA;AAE7D,MAAO,OAAA;AAAA,QACL,KAAO,EAAA,SAAA;AAAA,QACP,SAAW,EAAA,aAAA;AAAA,OACb,CAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

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

View File

@@ -0,0 +1,3 @@
import '../../base/style/css.mjs';
import 'element-plus/theme-chalk/el-result.css';
//# sourceMappingURL=css.mjs.map

View File

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

View File

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

View File

@@ -0,0 +1,3 @@
import '../../base/style/index.mjs';
import 'element-plus/theme-chalk/src/result.scss';
//# sourceMappingURL=index.mjs.map

View File

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