ep-craft 0.1.36 → 0.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/avatar/EpAvatar.vue.d.ts +20 -0
- package/dist/components/avatar/EpAvatar.vue.js +72 -0
- package/dist/components/avatar/EpAvatar2.vue.js +4 -0
- package/dist/components/avatar/avatar.d.ts +68 -0
- package/dist/components/avatar/avatar.js +59 -0
- package/dist/components/avatar/constants.d.ts +7 -0
- package/dist/components/avatar/constants.js +6 -0
- package/dist/components/avatar/index.d.ts +13 -2
- package/dist/components/avatar/index.js +8 -3
- package/dist/components/avatar/instance.d.ts +2 -0
- package/dist/components/badge/EpBadge.vue.d.ts +28 -0
- package/dist/components/badge/EpBadge.vue.js +75 -0
- package/dist/components/badge/EpBadge2.vue.js +4 -0
- package/dist/components/badge/badge.d.ts +67 -0
- package/dist/components/badge/badge.js +69 -0
- package/dist/components/badge/index.d.ts +11 -2
- package/dist/components/badge/index.js +8 -4
- package/dist/components/badge/instance.d.ts +2 -0
- package/dist/components/card/EpCard.vue.d.ts +22 -0
- package/dist/components/card/EpCard.vue.js +64 -0
- package/dist/components/card/EpCard2.vue.js +4 -0
- package/dist/components/card/card.d.ts +51 -0
- package/dist/components/card/card.js +49 -0
- package/dist/components/card/index.d.ts +11 -2
- package/dist/components/card/index.js +5 -4
- package/dist/components/card/instance.d.ts +2 -0
- package/dist/components/countdown/EpCountdown.vue.d.ts +28 -0
- package/dist/components/countdown/EpCountdown.vue.js +71 -0
- package/dist/components/countdown/EpCountdown2.vue.js +4 -0
- package/dist/components/countdown/countdown.d.ts +48 -0
- package/dist/components/countdown/countdown.js +50 -0
- package/dist/components/countdown/index.d.ts +11 -2
- package/dist/components/countdown/index.js +9 -4
- package/dist/components/countdown/instance.d.ts +2 -0
- package/dist/components/countdown/utils.d.ts +3 -0
- package/dist/components/countdown/utils.js +40 -0
- package/dist/components/dropdown/src/dropdown-item-impl2.vue.js +2 -2
- package/dist/components/dropdown/src/dropdown-item2.vue.js +2 -2
- package/dist/components/dropdown/src/dropdown-menu2.vue.js +2 -2
- package/dist/components/dropdown/src/dropdown2.vue.js +2 -2
- package/dist/components/empty/EpEmpty.vue.d.ts +20 -0
- package/dist/components/empty/EpEmpty.vue.js +62 -0
- package/dist/components/empty/EpEmpty2.vue.js +4 -0
- package/dist/components/empty/empty.d.ts +27 -0
- package/dist/components/empty/empty.js +26 -0
- package/dist/components/empty/img-empty.vue.d.ts +2 -0
- package/dist/components/empty/img-empty.vue.js +141 -0
- package/dist/components/empty/img-empty2.vue.js +4 -0
- package/dist/components/empty/index.d.ts +11 -2
- package/dist/components/empty/index.js +8 -4
- package/dist/components/empty/instance.d.ts +2 -0
- package/dist/components/link/EpLink.vue.d.ts +24 -0
- package/dist/components/link/EpLink.vue.js +86 -0
- package/dist/components/link/EpLink2.vue.js +4 -0
- package/dist/components/link/index.d.ts +11 -2
- package/dist/components/link/index.js +5 -3
- package/dist/components/link/instance.d.ts +2 -0
- package/dist/components/link/link.d.ts +56 -0
- package/dist/components/link/link.js +51 -0
- package/dist/components/result/EpResult.vue.d.ts +23 -0
- package/dist/components/result/EpResult.vue.js +71 -0
- package/dist/components/result/EpResult2.vue.js +4 -0
- package/dist/components/result/index.d.ts +11 -2
- package/dist/components/result/index.js +10 -4
- package/dist/components/result/instance.d.ts +2 -0
- package/dist/components/result/result.d.ts +35 -0
- package/dist/components/result/result.js +47 -0
- package/dist/components/roving-focus-group/index.js +2 -2
- package/dist/components/roving-focus-group/src/roving-focus-group.vue.js +11 -19
- package/dist/components/roving-focus-group/src/roving-focus-group2.vue.js +19 -11
- package/dist/components/roving-focus-group/src/roving-focus-item.vue.js +18 -76
- package/dist/components/roving-focus-group/src/roving-focus-item2.vue.js +76 -18
- package/dist/components/space/index.d.ts +15 -2
- package/dist/components/space/index.js +23 -4
- package/dist/components/space/instance.d.ts +2 -0
- package/dist/components/space/item.d.ts +29 -0
- package/dist/components/space/item.js +30 -0
- package/dist/components/space/space.d.ts +92 -0
- package/dist/components/space/space.js +182 -0
- package/dist/components/space/use-space.d.ts +7 -0
- package/dist/components/space/use-space.js +47 -0
- package/dist/components/statistic/EpStatistic.vue.d.ts +28 -0
- package/dist/components/statistic/EpStatistic.vue.js +82 -0
- package/dist/components/statistic/EpStatistic2.vue.js +4 -0
- package/dist/components/statistic/index.d.ts +11 -2
- package/dist/components/statistic/index.js +8 -4
- package/dist/components/statistic/instance.d.ts +2 -0
- package/dist/components/statistic/statistic.d.ts +58 -0
- package/dist/components/statistic/statistic.js +59 -0
- package/dist/utils/vue/vnode.js +32 -22
- package/dist/vendored-components.d.ts +1 -1
- package/dist/vendored-components.js +16 -3
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AvatarProps } from './avatar';
|
|
2
|
+
declare var __VLS_9: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_9) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<AvatarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
error: (evt: Event) => void;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<AvatarProps> & Readonly<{
|
|
9
|
+
onError?: ((evt: Event) => any) | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
src: string;
|
|
12
|
+
fit: import("csstype").Property.ObjectFit;
|
|
13
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { defineComponent as E, inject as k, ref as B, computed as a, watch as b, openBlock as l, createElementBlock as u, normalizeStyle as f, normalizeClass as C, createBlock as p, unref as g, withCtx as j, resolveDynamicComponent as w, renderSlot as A } from "vue";
|
|
2
|
+
import { ElIcon as L } from "../icon/index.js";
|
|
3
|
+
import { useNamespace as N } from "../../hooks/use-namespace/index.js";
|
|
4
|
+
import { isNumber as D } from "../../utils/types.js";
|
|
5
|
+
import "lodash-unified";
|
|
6
|
+
import "@vueuse/core";
|
|
7
|
+
import { isString as F } from "@vue/shared";
|
|
8
|
+
import { addUnit as I } from "../../utils/dom/style.js";
|
|
9
|
+
import "@element-plus/icons-vue";
|
|
10
|
+
import "../../hooks/use-size/index.js";
|
|
11
|
+
import "@popperjs/core";
|
|
12
|
+
import "../../hooks/use-z-index/index.js";
|
|
13
|
+
import "../../hooks/use-delayed-toggle/index.js";
|
|
14
|
+
import "../../hooks/use-aria/index.js";
|
|
15
|
+
import "../../hooks/use-model-toggle/index.js";
|
|
16
|
+
import "../../hooks/use-empty-values/index.js";
|
|
17
|
+
import { avatarEmits as K } from "./avatar.js";
|
|
18
|
+
import { avatarGroupContextKey as U } from "./constants.js";
|
|
19
|
+
const V = ["src", "alt", "srcset"], te = /* @__PURE__ */ E({
|
|
20
|
+
name: "EpAvatar",
|
|
21
|
+
__name: "EpAvatar",
|
|
22
|
+
props: {
|
|
23
|
+
size: {},
|
|
24
|
+
shape: {},
|
|
25
|
+
icon: {},
|
|
26
|
+
src: { default: "" },
|
|
27
|
+
alt: {},
|
|
28
|
+
srcSet: {},
|
|
29
|
+
fit: { default: "cover" }
|
|
30
|
+
},
|
|
31
|
+
emits: K,
|
|
32
|
+
setup(e, { emit: v }) {
|
|
33
|
+
const t = e, d = v, r = k(U, void 0), o = N("avatar"), n = B(!1), c = a(() => t.size ?? (r == null ? void 0 : r.size)), m = a(
|
|
34
|
+
() => t.shape ?? (r == null ? void 0 : r.shape) ?? "circle"
|
|
35
|
+
), h = a(() => {
|
|
36
|
+
const { icon: s } = t, i = [o.b()];
|
|
37
|
+
return F(c.value) && i.push(o.m(c.value)), s && i.push(o.m("icon")), m.value && i.push(o.m(m.value)), i;
|
|
38
|
+
}), y = a(() => D(c.value) ? o.cssVarBlock({
|
|
39
|
+
size: I(c.value)
|
|
40
|
+
}) : void 0), S = a(() => ({
|
|
41
|
+
objectFit: t.fit
|
|
42
|
+
}));
|
|
43
|
+
b(
|
|
44
|
+
() => [t.src, t.srcSet],
|
|
45
|
+
() => n.value = !1
|
|
46
|
+
);
|
|
47
|
+
function z(s) {
|
|
48
|
+
n.value = !0, d("error", s);
|
|
49
|
+
}
|
|
50
|
+
return (s, i) => (l(), u("span", {
|
|
51
|
+
class: C(h.value),
|
|
52
|
+
style: f(y.value)
|
|
53
|
+
}, [
|
|
54
|
+
(e.src || e.srcSet) && !n.value ? (l(), u("img", {
|
|
55
|
+
key: 0,
|
|
56
|
+
src: e.src,
|
|
57
|
+
alt: e.alt,
|
|
58
|
+
srcset: e.srcSet,
|
|
59
|
+
style: f(S.value),
|
|
60
|
+
onError: z
|
|
61
|
+
}, null, 44, V)) : e.icon ? (l(), p(g(L), { key: 1 }, {
|
|
62
|
+
default: j(() => [
|
|
63
|
+
(l(), p(w(e.icon)))
|
|
64
|
+
]),
|
|
65
|
+
_: 1
|
|
66
|
+
})) : A(s.$slots, "default", {}, void 0, void 0, 2)
|
|
67
|
+
], 6));
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
te as default
|
|
72
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
import type { ComponentSize } from '@element-plus/constants';
|
|
3
|
+
import type { IconPropType, ObjectFit } from '@element-plus/utils';
|
|
4
|
+
export interface AvatarProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description avatar size.
|
|
7
|
+
*/
|
|
8
|
+
size?: number | ComponentSize;
|
|
9
|
+
/**
|
|
10
|
+
* @description avatar shape.
|
|
11
|
+
*/
|
|
12
|
+
shape?: 'circle' | 'square';
|
|
13
|
+
/**
|
|
14
|
+
* @description representation type to icon, more info on icon component.
|
|
15
|
+
*/
|
|
16
|
+
icon?: IconPropType;
|
|
17
|
+
/**
|
|
18
|
+
* @description the source of the image for an image avatar.
|
|
19
|
+
*/
|
|
20
|
+
src?: string;
|
|
21
|
+
/**
|
|
22
|
+
* @description native attribute `alt` of image avatar.
|
|
23
|
+
*/
|
|
24
|
+
alt?: string;
|
|
25
|
+
/**
|
|
26
|
+
* @description native attribute srcset of image avatar.
|
|
27
|
+
*/
|
|
28
|
+
srcSet?: string;
|
|
29
|
+
/**
|
|
30
|
+
* @description set how the image fit its container for an image avatar.
|
|
31
|
+
*/
|
|
32
|
+
fit?: ObjectFit;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Removed after 3.0.0, Use `AvatarProps` instead.
|
|
36
|
+
*/
|
|
37
|
+
export declare const avatarProps: {
|
|
38
|
+
readonly size: {
|
|
39
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number>>;
|
|
40
|
+
readonly required: false;
|
|
41
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
42
|
+
__epPropKey: true;
|
|
43
|
+
};
|
|
44
|
+
readonly shape: {
|
|
45
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "square" | "circle", unknown>>;
|
|
46
|
+
readonly required: false;
|
|
47
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
48
|
+
__epPropKey: true;
|
|
49
|
+
};
|
|
50
|
+
readonly icon: {
|
|
51
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
|
|
52
|
+
readonly required: false;
|
|
53
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
54
|
+
__epPropKey: true;
|
|
55
|
+
};
|
|
56
|
+
readonly src: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
57
|
+
readonly alt: StringConstructor;
|
|
58
|
+
readonly srcSet: StringConstructor;
|
|
59
|
+
readonly fit: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => "fill" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "contain" | "cover" | "scale-down") | (() => import("csstype").Property.ObjectFit | undefined) | (((new (...args: any[]) => "fill" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "contain" | "cover" | "scale-down") | (() => import("csstype").Property.ObjectFit | undefined)) | null)[], unknown, unknown, "cover", boolean>;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated Removed after 3.0.0, Use `AvatarProps` instead.
|
|
63
|
+
*/
|
|
64
|
+
export type AvatarPropsPublic = ExtractPublicPropTypes<typeof avatarProps>;
|
|
65
|
+
export declare const avatarEmits: {
|
|
66
|
+
error: (evt: Event) => boolean;
|
|
67
|
+
};
|
|
68
|
+
export type AvatarEmits = typeof avatarEmits;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { isNumber as t } from "../../utils/types.js";
|
|
2
|
+
import "lodash-unified";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import "@vue/shared";
|
|
5
|
+
import { componentSizes as e } from "../../constants/size.js";
|
|
6
|
+
import { iconPropType as i } from "../../utils/vue/icon.js";
|
|
7
|
+
import "vue";
|
|
8
|
+
import { buildProps as o, definePropType as p } from "../../utils/vue/props/runtime.js";
|
|
9
|
+
o({
|
|
10
|
+
/**
|
|
11
|
+
* @description avatar size.
|
|
12
|
+
*/
|
|
13
|
+
size: {
|
|
14
|
+
type: [Number, String],
|
|
15
|
+
values: e,
|
|
16
|
+
validator: (r) => t(r)
|
|
17
|
+
},
|
|
18
|
+
/**
|
|
19
|
+
* @description avatar shape.
|
|
20
|
+
*/
|
|
21
|
+
shape: {
|
|
22
|
+
type: String,
|
|
23
|
+
values: ["circle", "square"]
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* @description representation type to icon, more info on icon component.
|
|
27
|
+
*/
|
|
28
|
+
icon: {
|
|
29
|
+
type: i
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* @description the source of the image for an image avatar.
|
|
33
|
+
*/
|
|
34
|
+
src: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ""
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* @description native attribute `alt` of image avatar.
|
|
40
|
+
*/
|
|
41
|
+
alt: String,
|
|
42
|
+
/**
|
|
43
|
+
* @description native attribute srcset of image avatar.
|
|
44
|
+
*/
|
|
45
|
+
srcSet: String,
|
|
46
|
+
/**
|
|
47
|
+
* @description set how the image fit its container for an image avatar.
|
|
48
|
+
*/
|
|
49
|
+
fit: {
|
|
50
|
+
type: p(String),
|
|
51
|
+
default: "cover"
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
const S = {
|
|
55
|
+
error: (r) => r instanceof Event
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
S as avatarEmits
|
|
59
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InjectionKey } from 'vue';
|
|
2
|
+
import type { AvatarProps } from './avatar';
|
|
3
|
+
export interface AvatarGroupContext {
|
|
4
|
+
size?: AvatarProps['size'];
|
|
5
|
+
shape?: AvatarProps['shape'];
|
|
6
|
+
}
|
|
7
|
+
export declare const avatarGroupContextKey: InjectionKey<AvatarGroupContext>;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import type { Plugin } from 'vue';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import _EpAvatar from './EpAvatar.vue';
|
|
3
|
+
/**
|
|
4
|
+
* avatar 自持 barrel(vendor-batch-5 产出)。
|
|
5
|
+
*
|
|
6
|
+
* 分组上下文键随本体落到本地;`AvatarGroup` 不在本库公开面,
|
|
7
|
+
* 本批不搬运、不挂载,也不导出 `ElAvatar` 别名。
|
|
8
|
+
*/
|
|
9
|
+
export declare const EpAvatar: typeof _EpAvatar & Plugin;
|
|
4
10
|
export default EpAvatar;
|
|
11
|
+
export { avatarEmits, avatarProps } from './avatar';
|
|
12
|
+
export { avatarGroupContextKey } from './constants';
|
|
13
|
+
export type { AvatarEmits, AvatarProps, AvatarPropsPublic, } from './avatar';
|
|
14
|
+
export type { AvatarGroupContext } from './constants';
|
|
15
|
+
export type { AvatarInstance } from './instance';
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { ElAvatar as a } from "element-plus";
|
|
2
1
|
import { withInstall as t } from "../../utils/with-install.js";
|
|
3
|
-
|
|
2
|
+
import a from "./EpAvatar.vue.js";
|
|
3
|
+
import { avatarEmits as f } from "./avatar.js";
|
|
4
|
+
const m = t(
|
|
5
|
+
a,
|
|
6
|
+
"ep-avatar"
|
|
7
|
+
);
|
|
4
8
|
export {
|
|
5
|
-
m as EpAvatar
|
|
9
|
+
m as EpAvatar,
|
|
10
|
+
f as avatarEmits
|
|
6
11
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { StyleValue } from 'vue';
|
|
2
|
+
import type { BadgeProps } from './badge';
|
|
3
|
+
declare var __VLS_1: {}, __VLS_7: {
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_1) => any;
|
|
8
|
+
} & {
|
|
9
|
+
content?: (props: typeof __VLS_7) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_component: import("vue").DefineComponent<BadgeProps, {
|
|
12
|
+
/** @description badge content */
|
|
13
|
+
content: import("vue").ComputedRef<string>;
|
|
14
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BadgeProps> & Readonly<{}>, {
|
|
15
|
+
offset: [number, number];
|
|
16
|
+
value: string | number;
|
|
17
|
+
type: "primary" | "success" | "warning" | "info" | "danger";
|
|
18
|
+
max: number;
|
|
19
|
+
showZero: boolean;
|
|
20
|
+
badgeStyle: string | false | import("vue").CSSProperties | StyleValue[] | null;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { defineComponent as g, computed as l, openBlock as i, createElementBlock as s, normalizeClass as m, unref as a, renderSlot as u, createVNode as v, Transition as y, withCtx as b, normalizeStyle as h, createTextVNode as B, toDisplayString as $, createCommentVNode as C } from "vue";
|
|
2
|
+
import { useNamespace as x } from "../../hooks/use-namespace/index.js";
|
|
3
|
+
import { isNumber as d } from "../../utils/types.js";
|
|
4
|
+
import "lodash-unified";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import "@vue/shared";
|
|
7
|
+
import { addUnit as c } from "../../utils/dom/style.js";
|
|
8
|
+
import "@element-plus/icons-vue";
|
|
9
|
+
import "../../hooks/use-size/index.js";
|
|
10
|
+
import "@popperjs/core";
|
|
11
|
+
import "../../hooks/use-z-index/index.js";
|
|
12
|
+
import "../../hooks/use-delayed-toggle/index.js";
|
|
13
|
+
import "../../hooks/use-aria/index.js";
|
|
14
|
+
import "../../hooks/use-model-toggle/index.js";
|
|
15
|
+
import "../../hooks/use-empty-values/index.js";
|
|
16
|
+
const F = /* @__PURE__ */ g({
|
|
17
|
+
name: "EpBadge",
|
|
18
|
+
__name: "EpBadge",
|
|
19
|
+
props: {
|
|
20
|
+
value: { default: "" },
|
|
21
|
+
max: { default: 99 },
|
|
22
|
+
isDot: { type: Boolean },
|
|
23
|
+
hidden: { type: Boolean },
|
|
24
|
+
type: { default: "danger" },
|
|
25
|
+
showZero: { type: Boolean, default: !0 },
|
|
26
|
+
color: {},
|
|
27
|
+
badgeStyle: { type: [Boolean, null, String, Object, Array], default: void 0 },
|
|
28
|
+
offset: { default: () => [0, 0] },
|
|
29
|
+
badgeClass: {}
|
|
30
|
+
},
|
|
31
|
+
setup(t, { expose: f }) {
|
|
32
|
+
const e = t, o = x("badge"), n = l(() => e.isDot ? "" : d(e.value) && d(e.max) ? e.max < e.value ? `${e.max}+` : `${e.value}` : `${e.value}`), p = l(() => [
|
|
33
|
+
{
|
|
34
|
+
backgroundColor: e.color,
|
|
35
|
+
marginRight: c(-e.offset[0]),
|
|
36
|
+
marginTop: c(e.offset[1])
|
|
37
|
+
},
|
|
38
|
+
e.badgeStyle ?? {}
|
|
39
|
+
]);
|
|
40
|
+
return f({
|
|
41
|
+
/** @description badge content */
|
|
42
|
+
content: n
|
|
43
|
+
}), (r, S) => (i(), s("div", {
|
|
44
|
+
class: m(a(o).b())
|
|
45
|
+
}, [
|
|
46
|
+
u(r.$slots, "default"),
|
|
47
|
+
v(y, {
|
|
48
|
+
name: `${a(o).namespace.value}-zoom-in-center`
|
|
49
|
+
}, {
|
|
50
|
+
default: b(() => [
|
|
51
|
+
!t.hidden && (n.value || t.isDot || r.$slots.content) ? (i(), s("sup", {
|
|
52
|
+
key: 0,
|
|
53
|
+
class: m([
|
|
54
|
+
a(o).e("content"),
|
|
55
|
+
a(o).em("content", t.type),
|
|
56
|
+
a(o).is("fixed", !!r.$slots.default),
|
|
57
|
+
a(o).is("dot", t.isDot),
|
|
58
|
+
a(o).is("hide-zero", !t.showZero && t.value === 0),
|
|
59
|
+
t.badgeClass
|
|
60
|
+
]),
|
|
61
|
+
style: h(p.value)
|
|
62
|
+
}, [
|
|
63
|
+
u(r.$slots, "content", { value: n.value }, () => [
|
|
64
|
+
B($(n.value), 1)
|
|
65
|
+
])
|
|
66
|
+
], 6)) : C("", !0)
|
|
67
|
+
]),
|
|
68
|
+
_: 3
|
|
69
|
+
}, 8, ["name"])
|
|
70
|
+
], 2));
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
export {
|
|
74
|
+
F as default
|
|
75
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ExtractPublicPropTypes, StyleValue } from 'vue';
|
|
2
|
+
export interface BadgeProps {
|
|
3
|
+
/**
|
|
4
|
+
* @description display value.
|
|
5
|
+
*/
|
|
6
|
+
value?: string | number;
|
|
7
|
+
/**
|
|
8
|
+
* @description maximum value, shows `{max}+` when exceeded. Only works if value is a number.
|
|
9
|
+
*/
|
|
10
|
+
max?: number;
|
|
11
|
+
/**
|
|
12
|
+
* @description if a little dot is displayed.
|
|
13
|
+
*/
|
|
14
|
+
isDot?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @description hidden badge.
|
|
17
|
+
*/
|
|
18
|
+
hidden?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @description badge type.
|
|
21
|
+
*/
|
|
22
|
+
type?: 'primary' | 'success' | 'warning' | 'info' | 'danger';
|
|
23
|
+
/**
|
|
24
|
+
* @description whether to show badge when value is zero.
|
|
25
|
+
*/
|
|
26
|
+
showZero?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @description customize dot background color
|
|
29
|
+
*/
|
|
30
|
+
color?: string;
|
|
31
|
+
/**
|
|
32
|
+
* @description CSS style of badge
|
|
33
|
+
*/
|
|
34
|
+
badgeStyle?: StyleValue;
|
|
35
|
+
/**
|
|
36
|
+
* @description set offset of the badge
|
|
37
|
+
*/
|
|
38
|
+
offset?: [number, number];
|
|
39
|
+
/**
|
|
40
|
+
* @description custom class name of badge
|
|
41
|
+
*/
|
|
42
|
+
badgeClass?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated Removed after 3.0.0, Use `BadgeProps` instead.
|
|
46
|
+
*/
|
|
47
|
+
export declare const badgeProps: {
|
|
48
|
+
readonly value: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
49
|
+
readonly max: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 99, boolean>;
|
|
50
|
+
readonly isDot: BooleanConstructor;
|
|
51
|
+
readonly hidden: BooleanConstructor;
|
|
52
|
+
readonly type: import("@element-plus/utils").EpPropFinalized<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown, "danger", boolean>;
|
|
53
|
+
readonly showZero: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
54
|
+
readonly color: StringConstructor;
|
|
55
|
+
readonly badgeStyle: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | false | import("vue").CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | import("vue").CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
|
|
56
|
+
readonly offset: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => [number, number]) | (() => [number, number]) | (((new (...args: any[]) => [number, number]) | (() => [number, number])) | null)[], unknown, unknown, () => number[], boolean>;
|
|
57
|
+
readonly badgeClass: {
|
|
58
|
+
readonly type: import("vue").PropType<string>;
|
|
59
|
+
readonly required: false;
|
|
60
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
61
|
+
__epPropKey: true;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated Removed after 3.0.0, Use `BadgeProps` instead.
|
|
66
|
+
*/
|
|
67
|
+
export type BadgePropsPublic = ExtractPublicPropTypes<typeof badgeProps>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import "@vue/shared";
|
|
2
|
+
import "lodash-unified";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import "@element-plus/icons-vue";
|
|
5
|
+
import { buildProps as t, definePropType as e } from "../../utils/vue/props/runtime.js";
|
|
6
|
+
import "vue";
|
|
7
|
+
t({
|
|
8
|
+
/**
|
|
9
|
+
* @description display value.
|
|
10
|
+
*/
|
|
11
|
+
value: {
|
|
12
|
+
type: [String, Number],
|
|
13
|
+
default: ""
|
|
14
|
+
},
|
|
15
|
+
/**
|
|
16
|
+
* @description maximum value, shows `{max}+` when exceeded. Only works if value is a number.
|
|
17
|
+
*/
|
|
18
|
+
max: {
|
|
19
|
+
type: Number,
|
|
20
|
+
default: 99
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* @description if a little dot is displayed.
|
|
24
|
+
*/
|
|
25
|
+
isDot: Boolean,
|
|
26
|
+
/**
|
|
27
|
+
* @description hidden badge.
|
|
28
|
+
*/
|
|
29
|
+
hidden: Boolean,
|
|
30
|
+
/**
|
|
31
|
+
* @description badge type.
|
|
32
|
+
*/
|
|
33
|
+
type: {
|
|
34
|
+
type: String,
|
|
35
|
+
values: ["primary", "success", "warning", "info", "danger"],
|
|
36
|
+
default: "danger"
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* @description whether to show badge when value is zero.
|
|
40
|
+
*/
|
|
41
|
+
showZero: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !0
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* @description customize dot background color
|
|
47
|
+
*/
|
|
48
|
+
color: String,
|
|
49
|
+
/**
|
|
50
|
+
* @description CSS style of badge
|
|
51
|
+
*/
|
|
52
|
+
badgeStyle: {
|
|
53
|
+
type: e([String, Object, Array, Boolean]),
|
|
54
|
+
default: void 0
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* @description set offset of the badge
|
|
58
|
+
*/
|
|
59
|
+
offset: {
|
|
60
|
+
type: e(Array),
|
|
61
|
+
default: () => [0, 0]
|
|
62
|
+
},
|
|
63
|
+
/**
|
|
64
|
+
* @description custom class name of badge
|
|
65
|
+
*/
|
|
66
|
+
badgeClass: {
|
|
67
|
+
type: String
|
|
68
|
+
}
|
|
69
|
+
});
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import type { Plugin } from 'vue';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import _EpBadge from './EpBadge.vue';
|
|
3
|
+
/**
|
|
4
|
+
* badge 自持 barrel(vendor-batch-5 产出)。
|
|
5
|
+
*
|
|
6
|
+
* 本体为本地 SFC,数值截断、圆点、显隐与偏移行为沿用上游语义。
|
|
7
|
+
* 保留 `content` 暴露契约,不导出 `ElBadge` 别名。
|
|
8
|
+
*/
|
|
9
|
+
export declare const EpBadge: typeof _EpBadge & Plugin;
|
|
4
10
|
export default EpBadge;
|
|
11
|
+
export { badgeProps } from './badge';
|
|
12
|
+
export type { BadgeProps, BadgePropsPublic } from './badge';
|
|
13
|
+
export type { BadgeInstance } from './instance';
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { withInstall as o } from "../../utils/with-install.js";
|
|
2
|
+
import t from "./EpBadge.vue.js";
|
|
3
|
+
import "./badge.js";
|
|
4
|
+
const i = o(
|
|
5
|
+
t,
|
|
6
|
+
"ep-badge"
|
|
7
|
+
);
|
|
4
8
|
export {
|
|
5
|
-
|
|
9
|
+
i as EpBadge
|
|
6
10
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CardProps } from './card';
|
|
2
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
header?: (props: typeof __VLS_1) => any;
|
|
5
|
+
} & {
|
|
6
|
+
default?: (props: typeof __VLS_3) => any;
|
|
7
|
+
} & {
|
|
8
|
+
footer?: (props: typeof __VLS_5) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_component: import("vue").DefineComponent<CardProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CardProps> & Readonly<{}>, {
|
|
11
|
+
footer: string;
|
|
12
|
+
header: string;
|
|
13
|
+
bodyStyle: string | false | import("vue").CSSProperties | import("vue").StyleValue[] | null;
|
|
14
|
+
shadow: "always" | "hover" | "never";
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { defineComponent as h, computed as p, openBlock as l, createElementBlock as d, normalizeClass as r, unref as a, renderSlot as i, createTextVNode as n, toDisplayString as m, createCommentVNode as f, createElementVNode as C, normalizeStyle as b } from "vue";
|
|
2
|
+
import { useNamespace as g } from "../../hooks/use-namespace/index.js";
|
|
3
|
+
import "@vue/shared";
|
|
4
|
+
import "lodash-unified";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import "@element-plus/icons-vue";
|
|
7
|
+
import "../../hooks/use-size/index.js";
|
|
8
|
+
import "@popperjs/core";
|
|
9
|
+
import "../../hooks/use-z-index/index.js";
|
|
10
|
+
import "../../hooks/use-delayed-toggle/index.js";
|
|
11
|
+
import "../../hooks/use-aria/index.js";
|
|
12
|
+
import "../../hooks/use-model-toggle/index.js";
|
|
13
|
+
import "../../hooks/use-empty-values/index.js";
|
|
14
|
+
import "../config-provider/index.js";
|
|
15
|
+
import { useGlobalConfig as v } from "../config-provider/src/hooks/use-global-config.js";
|
|
16
|
+
const q = /* @__PURE__ */ h({
|
|
17
|
+
name: "EpCard",
|
|
18
|
+
__name: "EpCard",
|
|
19
|
+
props: {
|
|
20
|
+
header: { default: "" },
|
|
21
|
+
footer: { default: "" },
|
|
22
|
+
bodyStyle: { type: [Boolean, null, String, Object, Array], default: "" },
|
|
23
|
+
headerClass: {},
|
|
24
|
+
bodyClass: {},
|
|
25
|
+
footerClass: {},
|
|
26
|
+
shadow: { default: void 0 }
|
|
27
|
+
},
|
|
28
|
+
setup(e) {
|
|
29
|
+
const c = v("card"), u = e, y = p(() => {
|
|
30
|
+
var s;
|
|
31
|
+
const o = (s = c.value) == null ? void 0 : s.shadow;
|
|
32
|
+
return u.shadow || (typeof o == "string" ? o : "") || "always";
|
|
33
|
+
}), t = g("card");
|
|
34
|
+
return (o, s) => (l(), d("div", {
|
|
35
|
+
class: r([a(t).b(), a(t).is(`${y.value}-shadow`)])
|
|
36
|
+
}, [
|
|
37
|
+
o.$slots.header || e.header ? (l(), d("div", {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: r([a(t).e("header"), e.headerClass])
|
|
40
|
+
}, [
|
|
41
|
+
i(o.$slots, "header", {}, () => [
|
|
42
|
+
n(m(e.header), 1)
|
|
43
|
+
])
|
|
44
|
+
], 2)) : f("", !0),
|
|
45
|
+
C("div", {
|
|
46
|
+
class: r([a(t).e("body"), e.bodyClass]),
|
|
47
|
+
style: b(e.bodyStyle)
|
|
48
|
+
}, [
|
|
49
|
+
i(o.$slots, "default")
|
|
50
|
+
], 6),
|
|
51
|
+
o.$slots.footer || e.footer ? (l(), d("div", {
|
|
52
|
+
key: 1,
|
|
53
|
+
class: r([a(t).e("footer"), e.footerClass])
|
|
54
|
+
}, [
|
|
55
|
+
i(o.$slots, "footer", {}, () => [
|
|
56
|
+
n(m(e.footer), 1)
|
|
57
|
+
])
|
|
58
|
+
], 2)) : f("", !0)
|
|
59
|
+
], 2));
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
q as default
|
|
64
|
+
};
|