完全跑通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,8 @@
import { SFCWithInstall } from "../../utils/vue/typescript.js";
import { TextProps, TextPropsPublic, textProps } from "./src/text.js";
import _default from "./src/text.vue.js";
//#region ../../packages/components/text/index.d.ts
declare const ElText: SFCWithInstall<typeof _default>;
//#endregion
export { ElText, ElText as default, TextProps, TextPropsPublic, textProps };

View File

@@ -0,0 +1,15 @@
Object.defineProperties(exports, {
__esModule: { value: true },
[Symbol.toStringTag]: { value: "Module" }
});
const require_install = require("../../utils/vue/install.js");
const require_text = require("./src/text.js");
const require_text$1 = require("./src/text2.js");
//#region ../../packages/components/text/index.ts
const ElText = require_install.withInstall(require_text$1.default);
//#endregion
exports.ElText = ElText;
exports.default = ElText;
exports.textProps = require_text.textProps;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["withInstall","Text"],"sources":["../../../../../packages/components/text/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\nimport Text from './src/text.vue'\n\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElText: SFCWithInstall<typeof Text> = withInstall(Text)\nexport default ElText\n\nexport * from './src/text'\n"],"mappings":";;;;;;;;AAKA,MAAa,SAAsCA,gBAAAA,YAAYC,eAAAA,QAAK"}

View File

@@ -0,0 +1,49 @@
import { EpPropFinalized, EpPropMergeType } from "../../../utils/vue/props/types.js";
import { ComponentSize } from "../../../constants/size.js";
import * as _$vue from "vue";
import { ExtractPublicPropTypes } from "vue";
//#region ../../packages/components/text/src/text.d.ts
interface TextProps {
/**
* @description text type
*/
type?: 'primary' | 'success' | 'info' | 'warning' | 'danger' | '';
/**
* @description text size
*/
size?: ComponentSize;
/**
* @description render ellipsis
*/
truncated?: boolean;
/**
* @description maximum lines
*/
lineClamp?: number | string;
/**
* @description custom element tag
*/
tag?: string;
}
/**
* @deprecated Removed after 3.0.0, Use `TextProps` instead.
*/
declare const textProps: {
readonly type: EpPropFinalized<StringConstructor, "" | "info" | "primary" | "success" | "warning" | "danger", unknown, "", boolean>;
readonly size: EpPropFinalized<StringConstructor, "" | "default" | "small" | "large", unknown, "", boolean>;
readonly truncated: BooleanConstructor;
readonly lineClamp: {
readonly type: _$vue.PropType<EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly tag: EpPropFinalized<StringConstructor, unknown, unknown, "span", boolean>;
};
/**
* @deprecated Removed after 3.0.0, Use `TextProps` instead.
*/
type TextPropsPublic = ExtractPublicPropTypes<typeof textProps>;
//#endregion
export { TextProps, TextPropsPublic, textProps };

View File

@@ -0,0 +1,50 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_size = require("../../../constants/size.js");
//#region ../../packages/components/text/src/text.ts
/**
* @deprecated Removed after 3.0.0, Use `TextProps` instead.
*/
const textProps = require("../../../utils/vue/props/runtime.js").buildProps({
/**
* @description text type
*/
type: {
type: String,
values: [
"primary",
"success",
"info",
"warning",
"danger",
""
],
default: ""
},
/**
* @description text size
*/
size: {
type: String,
values: require_size.componentSizes,
default: ""
},
/**
* @description render ellipsis
*/
truncated: Boolean,
/**
* @description maximum lines
*/
lineClamp: { type: [String, Number] },
/**
* @description custom element tag
*/
tag: {
type: String,
default: "span"
}
});
//#endregion
exports.textProps = textProps;
//# sourceMappingURL=text.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"text.js","names":["buildProps","componentSizes"],"sources":["../../../../../../packages/components/text/src/text.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport { componentSizes } from '@element-plus/constants'\n\nimport type { ExtractPublicPropTypes } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\n\nexport interface TextProps {\n /**\n * @description text type\n */\n type?: 'primary' | 'success' | 'info' | 'warning' | 'danger' | ''\n /**\n * @description text size\n */\n size?: ComponentSize\n /**\n * @description render ellipsis\n */\n truncated?: boolean\n /**\n * @description maximum lines\n */\n lineClamp?: number | string\n /**\n * @description custom element tag\n */\n tag?: string\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `TextProps` instead.\n */\nexport const textProps = buildProps({\n /**\n * @description text type\n */\n type: {\n type: String,\n values: ['primary', 'success', 'info', 'warning', 'danger', ''],\n default: '',\n },\n /**\n * @description text size\n */\n size: {\n type: String,\n values: componentSizes,\n default: '',\n },\n /**\n * @description render ellipsis\n */\n truncated: Boolean,\n /**\n * @description maximum lines\n */\n lineClamp: {\n type: [String, Number],\n },\n /**\n * @description custom element tag\n */\n tag: {\n type: String,\n default: 'span',\n },\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `TextProps` instead.\n */\nexport type TextPropsPublic = ExtractPublicPropTypes<typeof textProps>\n"],"mappings":";;;;;;AAgCA,MAAa,0DAAYA,CAAAA,WAAW;;;;CAIlC,MAAM;EACJ,MAAM;EACN,QAAQ;GAAC;GAAW;GAAW;GAAQ;GAAW;GAAU;GAAG;EAC/D,SAAS;EACV;;;;CAID,MAAM;EACJ,MAAM;EACN,QAAQC,aAAAA;EACR,SAAS;EACV;;;;CAID,WAAW;;;;CAIX,WAAW,EACT,MAAM,CAAC,QAAQ,OAAO,EACvB;;;;CAID,KAAK;EACH,MAAM;EACN,SAAS;EACV;CACF,CAAU"}

View File

@@ -0,0 +1,23 @@
import { ComponentSize } from "../../../constants/size.js";
import { TextProps } from "./text.js";
import * as _$vue from "vue";
//#region ../../packages/components/text/src/text.vue.d.ts
declare var __VLS_9: {};
type __VLS_Slots = {} & {
default?: (props: typeof __VLS_9) => any;
};
declare const __VLS_base: _$vue.DefineComponent<TextProps, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<TextProps> & Readonly<{}>, {
tag: string;
type: "primary" | "success" | "info" | "warning" | "danger" | "";
size: ComponentSize;
}, {}, {}, {}, 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,58 @@
require("../../../_virtual/_rolldown/runtime.js");
const require_types = require("../../../utils/types.js");
const require_index = require("../../../hooks/use-namespace/index.js");
const require_use_form_common_props = require("../../form/src/hooks/use-form-common-props.js");
const require_text = require("./text.js");
let vue = require("vue");
//#region ../../packages/components/text/src/text.vue?vue&type=script&setup=true&lang.ts
var text_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
name: "ElText",
__name: "text",
props: require_text.textProps,
setup(__props) {
const props = __props;
const textRef = (0, vue.ref)();
const textSize = require_use_form_common_props.useFormSize();
const ns = require_index.useNamespace("text");
const textKls = (0, vue.computed)(() => [
ns.b(),
ns.m(props.type),
ns.m(textSize.value),
ns.is("truncated", props.truncated),
ns.is("line-clamp", !require_types.isUndefined(props.lineClamp))
]);
const bindTitle = () => {
if ((0, vue.useAttrs)().title) return;
let shouldAddTitle = false;
const text = textRef.value?.textContent || "";
if (props.truncated) {
const width = textRef.value?.offsetWidth;
const scrollWidth = textRef.value?.scrollWidth;
if (width && scrollWidth && scrollWidth > width) shouldAddTitle = true;
} else if (!require_types.isUndefined(props.lineClamp)) {
const height = textRef.value?.offsetHeight;
const scrollHeight = textRef.value?.scrollHeight;
if (height && scrollHeight && scrollHeight > height) shouldAddTitle = true;
}
if (shouldAddTitle) textRef.value?.setAttribute("title", text);
else textRef.value?.removeAttribute("title");
};
(0, vue.onMounted)(bindTitle);
(0, vue.onUpdated)(bindTitle);
return (_ctx, _cache) => {
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.tag), {
ref_key: "textRef",
ref: textRef,
class: (0, vue.normalizeClass)(textKls.value),
style: (0, vue.normalizeStyle)({ "-webkit-line-clamp": __props.lineClamp })
}, {
default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
_: 3
}, 8, ["class", "style"]);
};
}
});
//#endregion
exports.default = text_vue_vue_type_script_setup_true_lang_default;
//# sourceMappingURL=text.vue_vue_type_script_setup_true_lang.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"text.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../../../packages/components/text/src/text.vue"],"sourcesContent":["<template>\n <component\n :is=\"tag\"\n ref=\"textRef\"\n :class=\"textKls\"\n :style=\"{ '-webkit-line-clamp': lineClamp }\"\n >\n <slot />\n </component>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, onMounted, onUpdated, ref, useAttrs } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useFormSize } from '@element-plus/components/form'\nimport { isUndefined } from '@element-plus/utils'\n\nimport type { TextProps } from './text'\n\ndefineOptions({\n name: 'ElText',\n})\n\nconst props = withDefaults(defineProps<TextProps>(), {\n type: '',\n size: '',\n tag: 'span',\n})\nconst textRef = ref<HTMLElement>()\n\nconst textSize = useFormSize()\nconst ns = useNamespace('text')\n\nconst textKls = computed(() => [\n ns.b(),\n ns.m(props.type),\n ns.m(textSize.value),\n ns.is('truncated', props.truncated),\n ns.is('line-clamp', !isUndefined(props.lineClamp)),\n])\n\nconst bindTitle = () => {\n const inheritTitle = useAttrs().title\n\n if (inheritTitle) return\n let shouldAddTitle = false\n const text = textRef.value?.textContent || ''\n\n if (props.truncated) {\n const width = textRef.value?.offsetWidth\n const scrollWidth = textRef.value?.scrollWidth\n if (width && scrollWidth && scrollWidth > width) {\n shouldAddTitle = true\n }\n } else if (!isUndefined(props.lineClamp)) {\n const height = textRef.value?.offsetHeight\n const scrollHeight = textRef.value?.scrollHeight\n if (height && scrollHeight && scrollHeight > height) {\n shouldAddTitle = true\n }\n }\n\n if (shouldAddTitle) {\n textRef.value?.setAttribute('title',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AAA,CAAA,CAAA"}

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"file":"text2.js","names":[],"sources":["../../../../../../packages/components/text/src/text.vue"],"sourcesContent":["<template>\n <component\n :is=\"tag\"\n ref=\"textRef\"\n :class=\"textKls\"\n :style=\"{ '-webkit-line-clamp': lineClamp }\"\n >\n <slot />\n </component>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, onMounted, onUpdated, ref, useAttrs } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useFormSize } from '@element-plus/components/form'\nimport { isUndefined } from '@element-plus/utils'\n\nimport type { TextProps } from './text'\n\ndefineOptions({\n name: 'ElText',\n})\n\nconst props = withDefaults(defineProps<TextProps>(), {\n type: '',\n size: '',\n tag: 'span',\n})\nconst textRef = ref<HTMLElement>()\n\nconst textSize = useFormSize()\nconst ns = useNamespace('text')\n\nconst textKls = computed(() => [\n ns.b(),\n ns.m(props.type),\n ns.m(textSize.value),\n ns.is('truncated', props.truncated),\n ns.is('line-clamp', !isUndefined(props.lineClamp)),\n])\n\nconst bindTitle = () => {\n const inheritTitle = useAttrs().title\n\n if (inheritTitle) return\n let shouldAddTitle = false\n const text = textRef.value?.textContent || ''\n\n if (props.truncated) {\n const width = textRef.value?.offsetWidth\n const scrollWidth = textRef.value?.scrollWidth\n if (width && scrollWidth && scrollWidth > width) {\n shouldAddTitle = true\n }\n } else if (!isUndefined(props.lineClamp)) {\n const height = textRef.value?.offsetHeight\n const scrollHeight = textRef.value?.scrollHeight\n if (height && scrollHeight && scrollHeight > height) {\n shouldAddTitle = true\n }\n }\n\n if (shouldAddTitle) {\n textRef.value?.setAttribute('title', text)\n } else {\n textRef.value?.removeAttribute('title')\n }\n}\n\nonMounted(bindTitle)\nonUpdated(bindTitle)\n</script>\n"],"mappings":""}

View File

@@ -0,0 +1,3 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../../base/style/css.js");
require("element-plus/theme-chalk/el-text.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/text.scss");