完全跑通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 { StatisticInstance, StatisticProps, StatisticPropsPublic, statisticProps } from "./src/statistic.js";
import _default from "./src/statistic.vue.js";
//#region ../../packages/components/statistic/index.d.ts
declare const ElStatistic: SFCWithInstall<typeof _default>;
//#endregion
export { ElStatistic, ElStatistic as default, StatisticInstance, StatisticProps, StatisticPropsPublic, statisticProps };

View File

@@ -0,0 +1,9 @@
import { withInstall } from "../../utils/vue/install.mjs";
import { statisticProps } from "./src/statistic.mjs";
import statistic_default from "./src/statistic2.mjs";
//#region ../../packages/components/statistic/index.ts
const ElStatistic = withInstall(statistic_default);
//#endregion
export { ElStatistic, ElStatistic as default, statisticProps };
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","names":["Statistic"],"sources":["../../../../../packages/components/statistic/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\nimport Statistic from './src/statistic.vue'\n\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElStatistic: SFCWithInstall<typeof Statistic> =\n withInstall(Statistic)\n\nexport default ElStatistic\nexport * from './src/statistic'\n"],"mappings":";;;;AAKA,MAAa,cACX,YAAYA,kBAAU"}

View File

@@ -0,0 +1,66 @@
import { EpPropFinalized } from "../../../utils/vue/props/types.js";
import _default from "./statistic.vue.js";
import * as _$vue from "vue";
import { ExtractPublicPropTypes, StyleValue } from "vue";
import { Dayjs } from "dayjs";
//#region ../../packages/components/statistic/src/statistic.d.ts
interface StatisticProps {
/**
* @description Setting the decimal point
*/
decimalSeparator?: string;
/**
* @description Sets the thousandth identifier
*/
groupSeparator?: string;
/**
* @description numerical precision
*/
precision?: number;
/**
* @description Custom numerical presentation
*/
formatter?: (...args: any[]) => string | number;
/**
* @description Numerical content
*/
value?: number | Dayjs;
/**
* @description Sets the prefix of a number
*/
prefix?: string;
/**
* @description Sets the suffix of a number
*/
suffix?: string;
/**
* @description Numeric titles
*/
title?: string;
/**
* @description Styles numeric values
*/
valueStyle?: StyleValue;
}
/**
* @deprecated Removed after 3.0.0, Use `StatisticProps` instead.
*/
declare const statisticProps: {
readonly decimalSeparator: EpPropFinalized<StringConstructor, unknown, unknown, ".", boolean>;
readonly groupSeparator: EpPropFinalized<StringConstructor, unknown, unknown, ",", boolean>;
readonly precision: EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
readonly formatter: FunctionConstructor;
readonly value: EpPropFinalized<(new (...args: any[]) => number | Dayjs) | (() => number | Dayjs) | (((new (...args: any[]) => number | Dayjs) | (() => number | Dayjs)) | null)[], unknown, unknown, 0, boolean>;
readonly prefix: StringConstructor;
readonly suffix: StringConstructor;
readonly title: StringConstructor;
readonly valueStyle: EpPropFinalized<(new (...args: any[]) => string | false | _$vue.CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | _$vue.CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
};
/**
* @deprecated Removed after 3.0.0, Use `StatisticProps` instead.
*/
type StatisticPropsPublic = ExtractPublicPropTypes<typeof statisticProps>;
type StatisticInstance = InstanceType<typeof _default> & unknown;
//#endregion
export { StatisticInstance, StatisticProps, StatisticPropsPublic, statisticProps };

View File

@@ -0,0 +1,67 @@
import { buildProps, definePropType } from "../../../utils/vue/props/runtime.mjs";
//#region ../../packages/components/statistic/src/statistic.ts
/**
* @deprecated Removed after 3.0.0, Use `StatisticProps` instead.
*/
const statisticProps = buildProps({
/**
* @description Setting the decimal point
*/
decimalSeparator: {
type: String,
default: "."
},
/**
* @description Sets the thousandth identifier
*/
groupSeparator: {
type: String,
default: ","
},
/**
* @description numerical precision
*/
precision: {
type: Number,
default: 0
},
/**
* @description Custom numerical presentation
*/
formatter: Function,
/**
* @description Numerical content
*/
value: {
type: definePropType([Number, Object]),
default: 0
},
/**
* @description Sets the prefix of a number
*/
prefix: String,
/**
* @description Sets the suffix of a number
*/
suffix: String,
/**
* @description Numeric titles
*/
title: String,
/**
* @description Styles numeric values
*/
valueStyle: {
type: definePropType([
String,
Object,
Array,
Boolean
]),
default: void 0
}
});
//#endregion
export { statisticProps };
//# sourceMappingURL=statistic.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"statistic.mjs","names":[],"sources":["../../../../../../packages/components/statistic/src/statistic.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPublicPropTypes, StyleValue } from 'vue'\nimport type { Dayjs } from 'dayjs'\nimport type Statistic from './statistic.vue'\n\nexport interface StatisticProps {\n /**\n * @description Setting the decimal point\n */\n decimalSeparator?: string\n /**\n * @description Sets the thousandth identifier\n */\n groupSeparator?: string\n /**\n * @description numerical precision\n */\n precision?: number\n /**\n * @description Custom numerical presentation\n */\n formatter?: (...args: any[]) => string | number\n /**\n * @description Numerical content\n */\n value?: number | Dayjs\n /**\n * @description Sets the prefix of a number\n */\n prefix?: string\n /**\n * @description Sets the suffix of a number\n */\n suffix?: string\n /**\n * @description Numeric titles\n */\n title?: string\n /**\n * @description Styles numeric values\n */\n valueStyle?: StyleValue\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `StatisticProps` instead.\n */\nexport const statisticProps = buildProps({\n /**\n * @description Setting the decimal point\n */\n decimalSeparator: {\n type: String,\n default: '.',\n },\n /**\n * @description Sets the thousandth identifier\n */\n groupSeparator: {\n type: String,\n default: ',',\n },\n /**\n * @description numerical precision\n */\n precision: {\n type: Number,\n default: 0,\n },\n /**\n * @description Custom numerical presentation\n */\n formatter: Function,\n /**\n * @description Numerical content\n */\n value: {\n type: definePropType<number | Dayjs>([Number, Object]),\n default: 0,\n },\n /**\n * @description Sets the prefix of a number\n */\n prefix: String,\n\n /**\n * @description Sets the suffix of a number\n */\n suffix: String,\n /**\n * @description Numeric titles\n */\n title: String,\n /**\n * @description Styles numeric values\n */\n valueStyle: {\n type: definePropType<StyleValue>([String, Object, Array, Boolean]),\n default: undefined,\n },\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `StatisticProps` instead.\n */\nexport type StatisticPropsPublic = ExtractPublicPropTypes<typeof statisticProps>\n\nexport type StatisticInstance = InstanceType<typeof Statistic> & unknown\n"],"mappings":";;;;;AAgDA,MAAa,iBAAiB,WAAW;;;;CAIvC,kBAAkB;EAChB,MAAM;EACN,SAAS;EACV;;;;CAID,gBAAgB;EACd,MAAM;EACN,SAAS;EACV;;;;CAID,WAAW;EACT,MAAM;EACN,SAAS;EACV;;;;CAID,WAAW;;;;CAIX,OAAO;EACL,MAAM,eAA+B,CAAC,QAAQ,OAAO,CAAC;EACtD,SAAS;EACV;;;;CAID,QAAQ;;;;CAKR,QAAQ;;;;CAIR,OAAO;;;;CAIP,YAAY;EACV,MAAM,eAA2B;GAAC;GAAQ;GAAQ;GAAO;GAAQ,CAAC;EAClE,SAAS,KAAA;EACV;CACF,CAAU"}

View File

@@ -0,0 +1,34 @@
import { StatisticProps } from "./statistic.js";
import * as _$vue from "vue";
import * as _$dayjs from "dayjs";
//#region ../../packages/components/statistic/src/statistic.vue.d.ts
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
type __VLS_Slots = {} & {
title?: (props: typeof __VLS_1) => any;
} & {
prefix?: (props: typeof __VLS_3) => any;
} & {
suffix?: (props: typeof __VLS_5) => any;
};
declare const __VLS_base: _$vue.DefineComponent<StatisticProps, {
/**
* @description current display value
*/
displayValue: _$vue.ComputedRef<string | number | _$dayjs.Dayjs>;
}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<StatisticProps> & Readonly<{}>, {
value: number | _$dayjs.Dayjs;
precision: number;
decimalSeparator: string;
groupSeparator: string;
valueStyle: string | false | _$vue.CSSProperties | _$vue.StyleValue[] | null;
}, {}, {}, {}, 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,51 @@
import { isFunction, isNumber } from "../../../utils/types.mjs";
import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
import { statisticProps } from "./statistic.mjs";
import { computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, renderSlot, toDisplayString, unref } from "vue";
//#region ../../packages/components/statistic/src/statistic.vue?vue&type=script&setup=true&lang.ts
var statistic_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
name: "ElStatistic",
__name: "statistic",
props: statisticProps,
setup(__props, { expose: __expose }) {
const props = __props;
const ns = useNamespace("statistic");
const displayValue = computed(() => {
const { value, formatter, precision, decimalSeparator, groupSeparator } = props;
if (isFunction(formatter)) return formatter(value);
if (!isNumber(value) || Number.isNaN(value)) return value;
let [integer, decimal = ""] = String(value).split(".");
decimal = decimal.padEnd(precision, "0").slice(0, precision > 0 ? precision : 0);
integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
return [integer, decimal].join(decimal ? decimalSeparator : "");
});
__expose({
/**
* @description current display value
*/
displayValue });
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b()) }, [_ctx.$slots.title || __props.title ? (openBlock(), createElementBlock("div", {
key: 0,
class: normalizeClass(unref(ns).e("head"))
}, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])], 2)) : createCommentVNode("v-if", true), createElementVNode("div", { class: normalizeClass(unref(ns).e("content")) }, [
_ctx.$slots.prefix || __props.prefix ? (openBlock(), createElementBlock("div", {
key: 0,
class: normalizeClass(unref(ns).e("prefix"))
}, [renderSlot(_ctx.$slots, "prefix", {}, () => [createElementVNode("span", null, toDisplayString(__props.prefix), 1)])], 2)) : createCommentVNode("v-if", true),
createElementVNode("span", {
class: normalizeClass(unref(ns).e("number")),
style: normalizeStyle(__props.valueStyle)
}, toDisplayString(displayValue.value), 7),
_ctx.$slots.suffix || __props.suffix ? (openBlock(), createElementBlock("div", {
key: 1,
class: normalizeClass(unref(ns).e("suffix"))
}, [renderSlot(_ctx.$slots, "suffix", {}, () => [createElementVNode("span", null, toDisplayString(__props.suffix), 1)])], 2)) : createCommentVNode("v-if", true)
], 2)], 2);
};
}
});
//#endregion
export { statistic_vue_vue_type_script_setup_true_lang_default as default };
//# sourceMappingURL=statistic.vue_vue_type_script_setup_true_lang.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"statistic.vue_vue_type_script_setup_true_lang.mjs","names":["$slots"],"sources":["../../../../../../packages/components/statistic/src/statistic.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <div v-if=\"$slots.title || title\" :class=\"ns.e('head')\">\n <slot name=\"title\">\n {{ title }}\n </slot>\n </div>\n <div :class=\"ns.e('content')\">\n <div v-if=\"$slots.prefix || prefix\" :class=\"ns.e('prefix')\">\n <slot name=\"prefix\">\n <span>{{ prefix }}</span>\n </slot>\n </div>\n <span :class=\"ns.e('number')\" :style=\"valueStyle\">\n {{ displayValue }}\n </span>\n <div v-if=\"$slots.suffix || suffix\" :class=\"ns.e('suffix')\">\n <slot name=\"suffix\">\n <span>{{ suffix }}</span>\n </slot>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { isFunction, isNumber } from '@element-plus/utils'\n\nimport type { StatisticProps } from './statistic'\n\ndefineOptions({\n name: 'ElStatistic',\n})\n\nconst props = withDefaults(defineProps<StatisticProps>(), {\n decimalSeparator: '.',\n groupSeparator: ',',\n precision: 0,\n value: 0,\n valueStyle: undefined,\n})\nconst ns = useNamespace('statistic')\n\nconst displayValue = computed(() => {\n const { value, formatter, precision, decimalSeparator, groupSeparator } =\n props\n\n if (isFunction(formatter)) return formatter(value)\n\n // https://github.com/element-plus/element-plus/issues/17784\n if (!isNumber(value) || Number.isNaN(value)) return value\n\n let [integer, decimal = ''] = String(value).split('.')\n decimal = decimal\n .padEnd(precision, '0')\n .slice(0, precision > 0 ? precision : 0)\n integer = integer.replace(/\\B(?=(\\d{3})+(?!\\d))/g, groupSeparator)\n return [integer, decimal].join(decimal ? decimalSeparator : '')\n})\n\ndefineExpose({\n /**\n * @description current display value\n */\n displayValue,\n})\n</script>\n"],"mappings":";;;;;;;;;;EAoCA,MAAM,QAAQ;EAOd,MAAM,KAAK,aAAa,YAAW;EAEnC,MAAM,eAAe,eAAe;GAClC,MAAM,EAAE,OAAO,WAAW,WAAW,kBAAkB,mBACrD;GAEF,IAAI,WAAW,UAAU,EAAE,OAAO,UAAU,MAAK;GAGjD,IAAI,CAAC,SAAS,MAAM,IAAI,OAAO,MAAM,MAAM,EAAE,OAAO;GAEpD,IAAI,CAAC,SAAS,UAAU,MAAM,OAAO,MAAM,CAAC,MAAM,IAAG;GACrD,UAAU,QACP,OAAO,WAAW,IAAG,CACrB,MAAM,GAAG,YAAY,IAAI,YAAY,EAAC;GACzC,UAAU,QAAQ,QAAQ,yBAAyB,eAAc;GACjE,OAAO,CAAC,SAAS,QAAQ,CAAC,KAAK,UAAU,mBAAmB,GAAE;IAC/D;EAED,SAAa;;;;AAIX,cACD,CAAA;;uBAlEC,mBAqBM,OAAA,EArBA,OAAK,eAAE,MAAA,GAAE,CAAC,GAAC,CAAA,EAAA,EAAA,CACJA,KAAAA,OAAO,SAAS,QAAA,SAAA,WAAA,EAA3B,mBAIM,OAAA;;IAJ6B,OAAK,eAAE,MAAA,GAAE,CAAC,EAAC,OAAA,CAAA;OAC5C,WAEO,KAAA,QAAA,SAAA,EAAA,QAAA,CAAA,gBAAA,gBADF,QAAA,MAAK,EAAA,EAAA,CAAA,CAAA,CAAA,EAAA,EAAA,IAAA,mBAAA,QAAA,KAAA,EAGZ,mBAcM,OAAA,EAdA,OAAK,eAAE,MAAA,GAAE,CAAC,EAAC,UAAA,CAAA,EAAA,EAAA;IACJA,KAAAA,OAAO,UAAU,QAAA,UAAA,WAAA,EAA5B,mBAIM,OAAA;;KAJ+B,OAAK,eAAE,MAAA,GAAE,CAAC,EAAC,SAAA,CAAA;QAC9C,WAEO,KAAA,QAAA,UAAA,EAAA,QAAA,CADL,mBAAyB,QAAA,MAAA,gBAAhB,QAAA,OAAM,EAAA,EAAA,CAAA,CAAA,CAAA,EAAA,EAAA,IAAA,mBAAA,QAAA,KAAA;IAGnB,mBAEO,QAAA;KAFA,OAAK,eAAE,MAAA,GAAE,CAAC,EAAC,SAAA,CAAA;KAAa,OAAK,eAAE,QAAA,WAAU;uBAC3C,aAAA,MAAY,EAAA,EAAA;IAENA,KAAAA,OAAO,UAAU,QAAA,UAAA,WAAA,EAA5B,mBAIM,OAAA;;KAJ+B,OAAK,eAAE,MAAA,GAAE,CAAC,EAAC,SAAA,CAAA;QAC9C,WAEO,KAAA,QAAA,UAAA,EAAA,QAAA,CADL,mBAAyB,QAAA,MAAA,gBAAhB,QAAA,OAAM,EAAA,EAAA,CAAA,CAAA,CAAA,EAAA,EAAA,IAAA,mBAAA,QAAA,KAAA"}

View File

@@ -0,0 +1,7 @@
import statistic_vue_vue_type_script_setup_true_lang_default from "./statistic.vue_vue_type_script_setup_true_lang.mjs";
//#region ../../packages/components/statistic/src/statistic.vue
var statistic_default = statistic_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { statistic_default as default };
//# sourceMappingURL=statistic2.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"statistic2.mjs","names":[],"sources":["../../../../../../packages/components/statistic/src/statistic.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <div v-if=\"$slots.title || title\" :class=\"ns.e('head')\">\n <slot name=\"title\">\n {{ title }}\n </slot>\n </div>\n <div :class=\"ns.e('content')\">\n <div v-if=\"$slots.prefix || prefix\" :class=\"ns.e('prefix')\">\n <slot name=\"prefix\">\n <span>{{ prefix }}</span>\n </slot>\n </div>\n <span :class=\"ns.e('number')\" :style=\"valueStyle\">\n {{ displayValue }}\n </span>\n <div v-if=\"$slots.suffix || suffix\" :class=\"ns.e('suffix')\">\n <slot name=\"suffix\">\n <span>{{ suffix }}</span>\n </slot>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { isFunction, isNumber } from '@element-plus/utils'\n\nimport type { StatisticProps } from './statistic'\n\ndefineOptions({\n name: 'ElStatistic',\n})\n\nconst props = withDefaults(defineProps<StatisticProps>(), {\n decimalSeparator: '.',\n groupSeparator: ',',\n precision: 0,\n value: 0,\n valueStyle: undefined,\n})\nconst ns = useNamespace('statistic')\n\nconst displayValue = computed(() => {\n const { value, formatter, precision, decimalSeparator, groupSeparator } =\n props\n\n if (isFunction(formatter)) return formatter(value)\n\n // https://github.com/element-plus/element-plus/issues/17784\n if (!isNumber(value) || Number.isNaN(value)) return value\n\n let [integer, decimal = ''] = String(value).split('.')\n decimal = decimal\n .padEnd(precision, '0')\n .slice(0, precision > 0 ? precision : 0)\n integer = integer.replace(/\\B(?=(\\d{3})+(?!\\d))/g, groupSeparator)\n return [integer, decimal].join(decimal ? decimalSeparator : '')\n})\n\ndefineExpose({\n /**\n * @description current display value\n */\n displayValue,\n})\n</script>\n"],"mappings":""}

View File

@@ -0,0 +1,2 @@
import "../../base/style/css.mjs";
import "element-plus/theme-chalk/el-statistic.css";

View File

@@ -0,0 +1,2 @@
import "../../base/style/index.mjs";
import "element-plus/theme-chalk/src/statistic.scss";