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,8 @@
import type SkeletonItem from './skeleton-item.vue';
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
export declare const skeletonItemProps: {
readonly variant: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "button" | "caption" | "h1" | "h3" | "p" | "circle" | "image" | "rect" | "text", unknown, "text", boolean>;
};
export type SkeletonItemProps = ExtractPropTypes<typeof skeletonItemProps>;
export type SkeletonItemPropsPublic = __ExtractPublicPropTypes<typeof skeletonItemProps>;
export type SkeletonItemInstance = InstanceType<typeof SkeletonItem> & unknown;

View File

@@ -0,0 +1,22 @@
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
const skeletonItemProps = buildProps({
variant: {
type: String,
values: [
"circle",
"rect",
"h1",
"h3",
"text",
"caption",
"p",
"image",
"button"
],
default: "text"
}
});
export { skeletonItemProps };
//# sourceMappingURL=skeleton-item.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"skeleton-item.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton-item.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\n\nimport type SkeletonItem from './skeleton-item.vue'\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\n\nexport const skeletonItemProps = buildProps({\n /**\n * @description the current rendering skeleton type\n */\n variant: {\n type: String,\n values: [\n 'circle',\n 'rect',\n 'h1',\n 'h3',\n 'text',\n 'caption',\n 'p',\n 'image',\n 'button',\n ],\n default: 'text',\n },\n} as const)\nexport type SkeletonItemProps = ExtractPropTypes<typeof skeletonItemProps>\nexport type SkeletonItemPropsPublic = __ExtractPublicPropTypes<\n typeof skeletonItemProps\n>\n\nexport type SkeletonItemInstance = InstanceType<typeof SkeletonItem> & unknown\n"],"names":[],"mappings":";;AACY,MAAC,iBAAiB,GAAG,UAAU,CAAC;AAC5C,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE;AACZ,MAAM,QAAQ;AACd,MAAM,MAAM;AACZ,MAAM,IAAI;AACV,MAAM,IAAI;AACV,MAAM,MAAM;AACZ,MAAM,SAAS;AACf,MAAM,GAAG;AACT,MAAM,OAAO;AACb,MAAM,QAAQ;AACd,KAAK;AACL,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,CAAC;;;;"}

View File

@@ -0,0 +1,8 @@
declare const _default: import("vue").DefineComponent<{
readonly variant: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "button" | "caption" | "h1" | "h3" | "p" | "circle" | "image" | "rect" | "text", unknown, "text", 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 variant: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "button" | "caption" | "h1" | "h3" | "p" | "circle" | "image" | "rect" | "text", unknown, "text", boolean>;
}>>, {
readonly variant: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "button" | "caption" | "h1" | "h3" | "p" | "circle" | "image" | "rect" | "text", unknown>;
}>;
export default _default;

View File

@@ -0,0 +1,27 @@
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createBlock, createCommentVNode } from 'vue';
import { PictureFilled } from '@element-plus/icons-vue';
import { skeletonItemProps } from './skeleton-item.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
const __default__ = defineComponent({
name: "ElSkeletonItem"
});
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
props: skeletonItemProps,
setup(__props) {
const ns = useNamespace("skeleton");
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass([unref(ns).e("item"), unref(ns).e(_ctx.variant)])
}, [
_ctx.variant === "image" ? (openBlock(), createBlock(unref(PictureFilled), { key: 0 })) : createCommentVNode("v-if", true)
], 2);
};
}
});
var SkeletonItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "skeleton-item.vue"]]);
export { SkeletonItem as default };
//# sourceMappingURL=skeleton-item2.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"skeleton-item2.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton-item.vue"],"sourcesContent":["<template>\n <div :class=\"[ns.e('item'), ns.e(variant)]\">\n <picture-filled v-if=\"variant === 'image'\" />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useNamespace } from '@element-plus/hooks'\nimport { PictureFilled } from '@element-plus/icons-vue'\nimport { skeletonItemProps } from './skeleton-item'\n\ndefineOptions({\n name: 'ElSkeletonItem',\n})\ndefineProps(skeletonItemProps)\nconst ns = useNamespace('skeleton')\n</script>\n"],"names":[],"mappings":";;;;;;mCAWc,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;AAEA,IAAM,MAAA,EAAA,GAAK,aAAa,UAAU,CAAA,CAAA;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,26 @@
import type Skeleton from './skeleton.vue';
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
import type { ThrottleType } from 'element-plus/es/hooks';
export declare const skeletonProps: {
readonly animated: BooleanConstructor;
readonly count: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
readonly rows: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 3, boolean>;
readonly loading: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
readonly throttle: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => number | {
leading?: number;
trailing?: number;
initVal?: boolean;
}) | (() => ThrottleType) | ((new (...args: any[]) => number | {
leading?: number;
trailing?: number;
initVal?: boolean;
}) | (() => ThrottleType))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
};
export type SkeletonProps = ExtractPropTypes<typeof skeletonProps>;
export type SkeletonPropsPublic = __ExtractPublicPropTypes<typeof skeletonProps>;
export type SkeletonInstance = InstanceType<typeof Skeleton> & unknown;

View File

@@ -0,0 +1,23 @@
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
const skeletonProps = buildProps({
animated: Boolean,
count: {
type: Number,
default: 1
},
rows: {
type: Number,
default: 3
},
loading: {
type: Boolean,
default: true
},
throttle: {
type: definePropType([Number, Object])
}
});
export { skeletonProps };
//# sourceMappingURL=skeleton.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"skeleton.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type Skeleton from './skeleton.vue'\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type { ThrottleType } from '@element-plus/hooks'\n\nexport const skeletonProps = buildProps({\n /**\n * @description whether showing the animation\n */\n animated: Boolean,\n /**\n * @description how many fake items to render to the DOM\n */\n count: {\n type: Number,\n default: 1,\n },\n /**\n * @description whether showing the real DOM\n */\n rows: {\n type: Number,\n default: 3,\n },\n /**\n * @description numbers of the row, only useful when no template slot were given\n */\n loading: {\n type: Boolean,\n default: true,\n },\n /**\n * @description rendering delay in milliseconds\n */\n throttle: {\n type: definePropType<ThrottleType>([Number, Object]),\n },\n} as const)\nexport type SkeletonProps = ExtractPropTypes<typeof skeletonProps>\nexport type SkeletonPropsPublic = __ExtractPublicPropTypes<typeof skeletonProps>\n\nexport type SkeletonInstance = InstanceType<typeof Skeleton> & unknown\n"],"names":[],"mappings":";;AACY,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,GAAG;AACH,CAAC;;;;"}

View File

@@ -0,0 +1,62 @@
declare function __VLS_template(): {
template?(_: {
key: number;
}): any;
default?(_: {
[x: string]: unknown;
}): any;
};
declare const __VLS_component: import("vue").DefineComponent<{
readonly animated: BooleanConstructor;
readonly count: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
readonly rows: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 3, boolean>;
readonly loading: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
readonly throttle: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => number | {
leading?: number;
trailing?: number;
initVal?: boolean;
}) | (() => import("element-plus/es/hooks").ThrottleType) | ((new (...args: any[]) => number | {
leading?: number;
trailing?: number;
initVal?: boolean;
}) | (() => import("element-plus/es/hooks").ThrottleType))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}, {
/** @description loading state */
uiLoading: import("vue").Ref<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 animated: BooleanConstructor;
readonly count: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
readonly rows: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 3, boolean>;
readonly loading: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
readonly throttle: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => number | {
leading?: number;
trailing?: number;
initVal?: boolean;
}) | (() => import("element-plus/es/hooks").ThrottleType) | ((new (...args: any[]) => number | {
leading?: number;
trailing?: number;
initVal?: boolean;
}) | (() => import("element-plus/es/hooks").ThrottleType))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}>>, {
readonly loading: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
readonly rows: number;
readonly count: number;
readonly animated: boolean;
}>;
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,53 @@
import { defineComponent, toRef, unref, openBlock, createElementBlock, mergeProps, Fragment, renderList, renderSlot, createVNode, normalizeClass, createBlock, createCommentVNode, normalizeProps } from 'vue';
import { skeletonProps } from './skeleton.mjs';
import SkeletonItem from './skeleton-item2.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import { useThrottleRender } from '../../../hooks/use-throttle-render/index.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
const __default__ = defineComponent({
name: "ElSkeleton"
});
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
props: skeletonProps,
setup(__props, { expose }) {
const props = __props;
const ns = useNamespace("skeleton");
const uiLoading = useThrottleRender(toRef(props, "loading"), props.throttle);
expose({
uiLoading
});
return (_ctx, _cache) => {
return unref(uiLoading) ? (openBlock(), createElementBlock("div", mergeProps({
key: 0,
class: [unref(ns).b(), unref(ns).is("animated", _ctx.animated)]
}, _ctx.$attrs), [
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.count, (i) => {
return openBlock(), createElementBlock(Fragment, { key: i }, [
unref(uiLoading) ? renderSlot(_ctx.$slots, "template", { key: i }, () => [
createVNode(SkeletonItem, {
class: normalizeClass(unref(ns).is("first")),
variant: "p"
}, null, 8, ["class"]),
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rows, (item) => {
return openBlock(), createBlock(SkeletonItem, {
key: item,
class: normalizeClass([
unref(ns).e("paragraph"),
unref(ns).is("last", item === _ctx.rows && _ctx.rows > 1)
]),
variant: "p"
}, null, 8, ["class"]);
}), 128))
]) : createCommentVNode("v-if", true)
], 64);
}), 128))
], 16)) : renderSlot(_ctx.$slots, "default", normalizeProps(mergeProps({ key: 1 }, _ctx.$attrs)));
};
}
});
var Skeleton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "skeleton.vue"]]);
export { Skeleton as default };
//# sourceMappingURL=skeleton2.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"skeleton2.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton.vue"],"sourcesContent":["<template>\n <template v-if=\"uiLoading\">\n <div :class=\"[ns.b(), ns.is('animated', animated)]\" v-bind=\"$attrs\">\n <template v-for=\"i in count\" :key=\"i\">\n <slot v-if=\"uiLoading\" :key=\"i\" name=\"template\">\n <el-skeleton-item :class=\"ns.is('first')\" variant=\"p\" />\n <el-skeleton-item\n v-for=\"item in rows\"\n :key=\"item\"\n :class=\"[\n ns.e('paragraph'),\n ns.is('last', item === rows && rows > 1),\n ]\"\n variant=\"p\"\n />\n </slot>\n </template>\n </div>\n </template>\n <template v-else>\n <slot v-bind=\"$attrs\" />\n </template>\n</template>\n\n<script lang=\"ts\" setup>\nimport { toRef } from 'vue'\nimport { useNamespace, useThrottleRender } from '@element-plus/hooks'\nimport { skeletonProps } from './skeleton'\nimport ElSkeletonItem from './skeleton-item.vue'\n\ndefineOptions({\n name: 'ElSkeleton',\n})\nconst props = defineProps(skeletonProps)\n\nconst ns = useNamespace('skeleton')\nconst uiLoading = useThrottleRender(toRef(props, 'loading'), props.throttle)\n\ndefineExpose({\n /** @description loading state */\n uiLoading,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;mCA8Bc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAGA,IAAM,MAAA,EAAA,GAAK,aAAa,UAAU,CAAA,CAAA;AAClC,IAAA,MAAM,YAAY,iBAAkB,CAAA,KAAA,CAAM,OAAO,SAAS,CAAA,EAAG,MAAM,QAAQ,CAAA,CAAA;AAE3E,IAAa,MAAA,CAAA;AAAA,MAAA,SAAA;AAAA,KAEX,CAAA,CAAA;AAAA,IACF,OAAC,CAAA,IAAA,EAAA,MAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}