完全跑通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,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,68 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_runtime = require("../../../utils/vue/props/runtime.js");
//#region ../../packages/components/statistic/src/statistic.ts
/**
* @deprecated Removed after 3.0.0, Use `StatisticProps` instead.
*/
const statisticProps = require_runtime.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: require_runtime.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: require_runtime.definePropType([
String,
Object,
Array,
Boolean
]),
default: void 0
}
});
//#endregion
exports.statisticProps = statisticProps;
//# sourceMappingURL=statistic.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"statistic.js","names":["buildProps","definePropType"],"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,iBAAiBA,gBAAAA,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,MAAMC,gBAAAA,eAA+B,CAAC,QAAQ,OAAO,CAAC;EACtD,SAAS;EACV;;;;CAID,QAAQ;;;;CAKR,QAAQ;;;;CAIR,OAAO;;;;CAIP,YAAY;EACV,MAAMA,gBAAAA,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,53 @@
require("../../../_virtual/_rolldown/runtime.js");
const require_types = require("../../../utils/types.js");
const require_index = require("../../../hooks/use-namespace/index.js");
const require_statistic = require("./statistic.js");
let vue = require("vue");
let _vue_shared = require("@vue/shared");
//#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__ */ (0, vue.defineComponent)({
name: "ElStatistic",
__name: "statistic",
props: require_statistic.statisticProps,
setup(__props, { expose: __expose }) {
const props = __props;
const ns = require_index.useNamespace("statistic");
const displayValue = (0, vue.computed)(() => {
const { value, formatter, precision, decimalSeparator, groupSeparator } = props;
if ((0, _vue_shared.isFunction)(formatter)) return formatter(value);
if (!require_types.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 (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()) }, [_ctx.$slots.title || __props.title ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
key: 0,
class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("head"))
}, [(0, vue.renderSlot)(_ctx.$slots, "title", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.title), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("content")) }, [
_ctx.$slots.prefix || __props.prefix ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
key: 0,
class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("prefix"))
}, [(0, vue.renderSlot)(_ctx.$slots, "prefix", {}, () => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(__props.prefix), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true),
(0, vue.createElementVNode)("span", {
class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("number")),
style: (0, vue.normalizeStyle)(__props.valueStyle)
}, (0, vue.toDisplayString)(displayValue.value), 7),
_ctx.$slots.suffix || __props.suffix ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
key: 1,
class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("suffix"))
}, [(0, vue.renderSlot)(_ctx.$slots, "suffix", {}, () => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(__props.suffix), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true)
], 2)], 2);
};
}
});
//#endregion
exports.default = statistic_vue_vue_type_script_setup_true_lang_default;
//# sourceMappingURL=statistic.vue_vue_type_script_setup_true_lang.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"statistic.vue_vue_type_script_setup_true_lang.js","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,M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,GAAA,IAAA,OAAO,GAAE,CAAC,EAAC,SAAA,CAAA;4BAGvC,KAAA,QAAA,UAAA,EAAA,QAAA,EAAA,GAAA,IAAA,oBADoB,QAAA,OAAA,GAAA,IAAA,iBAAhB,QAAA,OAAM,EAAA,EAAA,CAAA,CAAA,CAAA,EAAA,EAAA,KAAA,GAAA,IAAA,oBAAA,QAAA,KAAA;gCAKZ,QAAA;KAFA,QAAA,GAAA,IAAA,iBAAA,GAAA,IAAA,OAAO,GAAE,CAAC,EAAC,SAAA,CAAA;KAAa,QAAA,GAAA,IAAA,gBAAO,QAAA,WAAU;gCAC3C,aAAA,MAAY,EAAA,EAAA;IAENA,KAAAA,OAAO,UAAU,QAAA,WAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAItB,OAAA;;KAJ+B,QAAA,GAAA,IAAA,iBAAA,GAAA,IAAA,OAAO,GAAE,CAAC,EAAC,SAAA,CAAA;4BAGvC,KAAA,QAAA,UAAA,EAAA,QAAA,EAAA,GAAA,IAAA,oBADoB,QAAA,OAAA,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/statistic/src/statistic.vue
var statistic_default = require("./statistic.vue_vue_type_script_setup_true_lang.js").default;
//#endregion
exports.default = statistic_default;
//# sourceMappingURL=statistic2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"statistic2.js","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":""}