@minilo/ui 0.0.1
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/README.md +44 -0
- package/minilo/dist/index.css +1 -0
- package/minilo/dist/index.full.js +7054 -0
- package/minilo/dist/index.full.min.js +2 -0
- package/minilo/dist/index.full.min.js.map +1 -0
- package/minilo/dist/index.full.min.mjs +2 -0
- package/minilo/dist/index.full.min.mjs.map +1 -0
- package/minilo/dist/index.full.mjs +7041 -0
- package/minilo/es/components/button/index.d.ts +47 -0
- package/minilo/es/components/button/index.mjs +6 -0
- package/minilo/es/components/button/index.vue.d.ts +29 -0
- package/minilo/es/components/button/index.vue.mjs +5 -0
- package/minilo/es/components/button/index.vue2.mjs +67 -0
- package/minilo/es/components/button/type.d.ts +10 -0
- package/minilo/es/components/button/type.mjs +1 -0
- package/minilo/es/components/chart/index.d.ts +49 -0
- package/minilo/es/components/chart/index.mjs +6 -0
- package/minilo/es/components/chart/index.vue.d.ts +33 -0
- package/minilo/es/components/chart/index.vue.mjs +5 -0
- package/minilo/es/components/chart/index.vue2.mjs +124 -0
- package/minilo/es/components/chart/type.d.ts +7 -0
- package/minilo/es/components/chart/type.mjs +1 -0
- package/minilo/es/components/detail/index.d.ts +37 -0
- package/minilo/es/components/detail/index.mjs +6 -0
- package/minilo/es/components/detail/index.vue.d.ts +23 -0
- package/minilo/es/components/detail/index.vue.mjs +5 -0
- package/minilo/es/components/detail/index.vue2.mjs +194 -0
- package/minilo/es/components/detail/renderLabel.vue.d.ts +8 -0
- package/minilo/es/components/detail/renderLabel.vue.mjs +5 -0
- package/minilo/es/components/detail/renderLabel.vue2.mjs +23 -0
- package/minilo/es/components/detail/renderTooltip.vue.d.ts +8 -0
- package/minilo/es/components/detail/renderTooltip.vue.mjs +5 -0
- package/minilo/es/components/detail/renderTooltip.vue2.mjs +23 -0
- package/minilo/es/components/detail/type.d.ts +27 -0
- package/minilo/es/components/detail/type.mjs +1 -0
- package/minilo/es/components/index.d.ts +7 -0
- package/minilo/es/components/index.mjs +7 -0
- package/minilo/es/components/number-range-input/index.d.ts +41 -0
- package/minilo/es/components/number-range-input/index.mjs +6 -0
- package/minilo/es/components/number-range-input/index.vue.d.ts +33 -0
- package/minilo/es/components/number-range-input/index.vue.mjs +5 -0
- package/minilo/es/components/number-range-input/index.vue2.mjs +150 -0
- package/minilo/es/components/number-range-input/props.d.ts +10 -0
- package/minilo/es/components/number-range-input/props.mjs +1 -0
- package/minilo/es/components/search/index.d.ts +586 -0
- package/minilo/es/components/search/index.mjs +6 -0
- package/minilo/es/components/search/index.vue.d.ts +750 -0
- package/minilo/es/components/search/index.vue.mjs +5 -0
- package/minilo/es/components/search/index.vue2.mjs +298 -0
- package/minilo/es/components/search/props.d.ts +107 -0
- package/minilo/es/components/search/props.mjs +55 -0
- package/minilo/es/components/search-table/index.d.ts +274 -0
- package/minilo/es/components/search-table/index.mjs +6 -0
- package/minilo/es/components/search-table/index.vue.d.ts +173 -0
- package/minilo/es/components/search-table/index.vue.mjs +5 -0
- package/minilo/es/components/search-table/index.vue2.mjs +195 -0
- package/minilo/es/components/search-table/props.d.ts +69 -0
- package/minilo/es/components/search-table/props.mjs +69 -0
- package/minilo/es/components/search-table/render.d.ts +11 -0
- package/minilo/es/components/search-table/render.mjs +19 -0
- package/minilo/es/components/virtual-list/index.d.ts +59 -0
- package/minilo/es/components/virtual-list/index.mjs +6 -0
- package/minilo/es/components/virtual-list/index.vue.d.ts +39 -0
- package/minilo/es/components/virtual-list/index.vue.mjs +5 -0
- package/minilo/es/components/virtual-list/index.vue2.mjs +421 -0
- package/minilo/es/components/virtual-list/type.d.ts +20 -0
- package/minilo/es/components/virtual-list/type.mjs +1 -0
- package/minilo/es/index.d.ts +1087 -0
- package/minilo/es/node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.17_typescript@5.8.3_/node_modules/@element-plus/icons-vue/dist/index.mjs +25 -0
- package/minilo/es/node_modules/.pnpm/@vueuse_core@13.6.0_vue@3.5.17_typescript@5.9.3_/node_modules/@vueuse/core/index.mjs +73 -0
- package/minilo/es/node_modules/.pnpm/@vueuse_shared@13.6.0_vue@3.5.17_typescript@5.9.3_/node_modules/@vueuse/shared/index.mjs +76 -0
- package/minilo/es/packages/utils/dist/func/common.mjs +14 -0
- package/minilo/es/packages/utils/dist/request/index.mjs +110 -0
- package/minilo/es/resolver/index.d.ts +8 -0
- package/minilo/es/resolver/index.mjs +26 -0
- package/minilo/es/utils/index.d.ts +28 -0
- package/minilo/es/utils/index.mjs +30 -0
- package/minilo/lib/components/button/index.d.ts +47 -0
- package/minilo/lib/components/button/index.js +11 -0
- package/minilo/lib/components/button/index.vue.d.ts +29 -0
- package/minilo/lib/components/button/index.vue.js +9 -0
- package/minilo/lib/components/button/index.vue2.js +71 -0
- package/minilo/lib/components/button/type.d.ts +10 -0
- package/minilo/lib/components/button/type.js +2 -0
- package/minilo/lib/components/chart/index.d.ts +49 -0
- package/minilo/lib/components/chart/index.js +11 -0
- package/minilo/lib/components/chart/index.vue.d.ts +33 -0
- package/minilo/lib/components/chart/index.vue.js +9 -0
- package/minilo/lib/components/chart/index.vue2.js +128 -0
- package/minilo/lib/components/chart/type.d.ts +7 -0
- package/minilo/lib/components/chart/type.js +2 -0
- package/minilo/lib/components/detail/index.d.ts +37 -0
- package/minilo/lib/components/detail/index.js +11 -0
- package/minilo/lib/components/detail/index.vue.d.ts +23 -0
- package/minilo/lib/components/detail/index.vue.js +9 -0
- package/minilo/lib/components/detail/index.vue2.js +198 -0
- package/minilo/lib/components/detail/renderLabel.vue.d.ts +8 -0
- package/minilo/lib/components/detail/renderLabel.vue.js +9 -0
- package/minilo/lib/components/detail/renderLabel.vue2.js +27 -0
- package/minilo/lib/components/detail/renderTooltip.vue.d.ts +8 -0
- package/minilo/lib/components/detail/renderTooltip.vue.js +9 -0
- package/minilo/lib/components/detail/renderTooltip.vue2.js +27 -0
- package/minilo/lib/components/detail/type.d.ts +27 -0
- package/minilo/lib/components/detail/type.js +2 -0
- package/minilo/lib/components/index.d.ts +7 -0
- package/minilo/lib/components/index.js +19 -0
- package/minilo/lib/components/number-range-input/index.d.ts +41 -0
- package/minilo/lib/components/number-range-input/index.js +11 -0
- package/minilo/lib/components/number-range-input/index.vue.d.ts +33 -0
- package/minilo/lib/components/number-range-input/index.vue.js +9 -0
- package/minilo/lib/components/number-range-input/index.vue2.js +154 -0
- package/minilo/lib/components/number-range-input/props.d.ts +10 -0
- package/minilo/lib/components/number-range-input/props.js +2 -0
- package/minilo/lib/components/search/index.d.ts +586 -0
- package/minilo/lib/components/search/index.js +11 -0
- package/minilo/lib/components/search/index.vue.d.ts +750 -0
- package/minilo/lib/components/search/index.vue.js +9 -0
- package/minilo/lib/components/search/index.vue2.js +302 -0
- package/minilo/lib/components/search/props.d.ts +107 -0
- package/minilo/lib/components/search/props.js +58 -0
- package/minilo/lib/components/search-table/index.d.ts +274 -0
- package/minilo/lib/components/search-table/index.js +11 -0
- package/minilo/lib/components/search-table/index.vue.d.ts +173 -0
- package/minilo/lib/components/search-table/index.vue.js +9 -0
- package/minilo/lib/components/search-table/index.vue2.js +199 -0
- package/minilo/lib/components/search-table/props.d.ts +69 -0
- package/minilo/lib/components/search-table/props.js +72 -0
- package/minilo/lib/components/search-table/render.d.ts +11 -0
- package/minilo/lib/components/search-table/render.js +23 -0
- package/minilo/lib/components/virtual-list/index.d.ts +59 -0
- package/minilo/lib/components/virtual-list/index.js +11 -0
- package/minilo/lib/components/virtual-list/index.vue.d.ts +39 -0
- package/minilo/lib/components/virtual-list/index.vue.js +9 -0
- package/minilo/lib/components/virtual-list/index.vue2.js +425 -0
- package/minilo/lib/components/virtual-list/type.d.ts +20 -0
- package/minilo/lib/components/virtual-list/type.js +2 -0
- package/minilo/lib/index.d.ts +1087 -0
- package/minilo/lib/node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.17_typescript@5.8.3_/node_modules/@element-plus/icons-vue/dist/index.js +27 -0
- package/minilo/lib/node_modules/.pnpm/@vueuse_core@13.6.0_vue@3.5.17_typescript@5.9.3_/node_modules/@vueuse/core/index.js +84 -0
- package/minilo/lib/node_modules/.pnpm/@vueuse_shared@13.6.0_vue@3.5.17_typescript@5.9.3_/node_modules/@vueuse/shared/index.js +83 -0
- package/minilo/lib/packages/utils/dist/func/common.js +16 -0
- package/minilo/lib/packages/utils/dist/request/index.js +120 -0
- package/minilo/lib/resolver/index.d.ts +8 -0
- package/minilo/lib/resolver/index.js +28 -0
- package/minilo/lib/utils/index.d.ts +28 -0
- package/minilo/lib/utils/index.js +34 -0
- package/minilo/theme-chalk/index.css +1 -0
- package/minilo/theme-chalk/ml-button.css +1 -0
- package/minilo/theme-chalk/ml-chart.css +1 -0
- package/minilo/theme-chalk/ml-detail.css +1 -0
- package/minilo/theme-chalk/ml-number-range-input.css +1 -0
- package/minilo/theme-chalk/ml-search-table.css +1 -0
- package/minilo/theme-chalk/ml-search.css +1 -0
- package/minilo/theme-chalk/ml-virtual-list.css +1 -0
- package/minilo/theme-chalk/src/button.scss +22 -0
- package/minilo/theme-chalk/src/chart.scss +11 -0
- package/minilo/theme-chalk/src/default/variable.scss +1 -0
- package/minilo/theme-chalk/src/detail.scss +9 -0
- package/minilo/theme-chalk/src/index.scss +12 -0
- package/minilo/theme-chalk/src/mixins/mixin.scss +273 -0
- package/minilo/theme-chalk/src/number-range-input.scss +9 -0
- package/minilo/theme-chalk/src/search-table.scss +47 -0
- package/minilo/theme-chalk/src/search.scss +20 -0
- package/minilo/theme-chalk/src/virtual-list.scss +49 -0
- package/package.json +107 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const MlButton: {
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./type').MlButtonSelfProps> & Readonly<{
|
|
3
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
4
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
+
click: (...args: any[]) => void;
|
|
6
|
+
}, import('vue').PublicProps, {
|
|
7
|
+
time: number;
|
|
8
|
+
placement: string;
|
|
9
|
+
tip: string;
|
|
10
|
+
tipProps: Record<string, any>;
|
|
11
|
+
isDebounce: boolean;
|
|
12
|
+
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
13
|
+
P: {};
|
|
14
|
+
B: {};
|
|
15
|
+
D: {};
|
|
16
|
+
C: {};
|
|
17
|
+
M: {};
|
|
18
|
+
Defaults: {};
|
|
19
|
+
}, Readonly<import('./type').MlButtonSelfProps> & Readonly<{
|
|
20
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, {
|
|
22
|
+
time: number;
|
|
23
|
+
placement: string;
|
|
24
|
+
tip: string;
|
|
25
|
+
tipProps: Record<string, any>;
|
|
26
|
+
isDebounce: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
__isFragment?: never;
|
|
29
|
+
__isTeleport?: never;
|
|
30
|
+
__isSuspense?: never;
|
|
31
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('./type').MlButtonSelfProps> & Readonly<{
|
|
32
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
33
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
34
|
+
click: (...args: any[]) => void;
|
|
35
|
+
}, string, {
|
|
36
|
+
time: number;
|
|
37
|
+
placement: string;
|
|
38
|
+
tip: string;
|
|
39
|
+
tipProps: Record<string, any>;
|
|
40
|
+
isDebounce: boolean;
|
|
41
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
42
|
+
$slots: {
|
|
43
|
+
default?(_: {}): any;
|
|
44
|
+
default?(_: {}): any;
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
export default MlButton;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { MlButtonSelfProps as MlButtonProps } from './type';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
default?(_: {}): any;
|
|
7
|
+
};
|
|
8
|
+
refs: {};
|
|
9
|
+
rootEl: any;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
+
declare const __VLS_component: import('vue').DefineComponent<MlButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
click: (...args: any[]) => void;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<MlButtonProps> & Readonly<{
|
|
15
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
time: number;
|
|
18
|
+
placement: string;
|
|
19
|
+
tip: string;
|
|
20
|
+
tipProps: Record<string, any>;
|
|
21
|
+
isDebounce: boolean;
|
|
22
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineComponent, ref, createBlock, openBlock, unref, mergeProps, withCtx, createVNode, renderSlot } from 'vue';
|
|
2
|
+
import { bem } from '../../utils/index.mjs';
|
|
3
|
+
import { ElTooltip, ElButton } from 'element-plus';
|
|
4
|
+
|
|
5
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
...{
|
|
7
|
+
name: "MlButton"
|
|
8
|
+
},
|
|
9
|
+
__name: "index",
|
|
10
|
+
props: {
|
|
11
|
+
time: { type: Number, required: false, default: 1e3 },
|
|
12
|
+
tip: { type: String, required: false, default: "" },
|
|
13
|
+
placement: { type: String, required: false, default: "top" },
|
|
14
|
+
tipProps: { type: Object, required: false, default: () => ({}) },
|
|
15
|
+
isDebounce: { type: Boolean, required: false, default: true }
|
|
16
|
+
},
|
|
17
|
+
emits: ["click"],
|
|
18
|
+
setup(__props, { emit: __emit }) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const emits = __emit;
|
|
21
|
+
const record = ref(0);
|
|
22
|
+
const handleClick = () => {
|
|
23
|
+
if (!props.isDebounce) return emits("click");
|
|
24
|
+
const newTime = /* @__PURE__ */ new Date();
|
|
25
|
+
if (newTime.getTime() - record.value > props.time) {
|
|
26
|
+
emits("click");
|
|
27
|
+
}
|
|
28
|
+
record.value = newTime.getTime();
|
|
29
|
+
};
|
|
30
|
+
return (_ctx, _cache) => {
|
|
31
|
+
return __props.tip ? (openBlock(), createBlock(unref(ElTooltip), mergeProps({
|
|
32
|
+
key: 0,
|
|
33
|
+
content: __props.tip,
|
|
34
|
+
placement: __props.placement
|
|
35
|
+
}, __props.tipProps), {
|
|
36
|
+
default: withCtx(() => [
|
|
37
|
+
createVNode(unref(ElButton), mergeProps(_ctx.$attrs, {
|
|
38
|
+
class: unref(bem)("button", "tip"),
|
|
39
|
+
onClick: handleClick
|
|
40
|
+
}), {
|
|
41
|
+
default: withCtx(() => [
|
|
42
|
+
renderSlot(_ctx.$slots, "default")
|
|
43
|
+
]),
|
|
44
|
+
_: 3
|
|
45
|
+
/* FORWARDED */
|
|
46
|
+
}, 16, ["class"])
|
|
47
|
+
]),
|
|
48
|
+
_: 3
|
|
49
|
+
/* FORWARDED */
|
|
50
|
+
}, 16, ["content", "placement"])) : (openBlock(), createBlock(
|
|
51
|
+
unref(ElButton),
|
|
52
|
+
mergeProps({ key: 1 }, _ctx.$attrs, { onClick: handleClick }),
|
|
53
|
+
{
|
|
54
|
+
default: withCtx(() => [
|
|
55
|
+
renderSlot(_ctx.$slots, "default")
|
|
56
|
+
]),
|
|
57
|
+
_: 3
|
|
58
|
+
/* FORWARDED */
|
|
59
|
+
},
|
|
60
|
+
16
|
|
61
|
+
/* FULL_PROPS */
|
|
62
|
+
));
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ButtonProps } from 'element-plus';
|
|
2
|
+
import { Mutable } from 'element-plus/es/utils';
|
|
3
|
+
export interface MlButtonSelfProps {
|
|
4
|
+
time?: number;
|
|
5
|
+
tip?: string;
|
|
6
|
+
placement?: string;
|
|
7
|
+
tipProps?: Record<string, any>;
|
|
8
|
+
isDebounce?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type MlButtonProps = MlButtonSelfProps & Partial<Mutable<ButtonProps>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare const MlChart: {
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./type').MlChartProps> & Readonly<{
|
|
3
|
+
[x: `on${Capitalize<string>}`]: ((...args: unknown[] & []) => any) | undefined;
|
|
4
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
+
[x: string]: ((...args: unknown[]) => any) | (() => any);
|
|
6
|
+
}, import('vue').PublicProps, {
|
|
7
|
+
options: Record<string, any>;
|
|
8
|
+
id: string;
|
|
9
|
+
theme: string;
|
|
10
|
+
isEmpty: boolean | ((options: Record<string, any>) => boolean);
|
|
11
|
+
description: string;
|
|
12
|
+
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
13
|
+
echartRef: HTMLDivElement;
|
|
14
|
+
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
15
|
+
P: {};
|
|
16
|
+
B: {};
|
|
17
|
+
D: {};
|
|
18
|
+
C: {};
|
|
19
|
+
M: {};
|
|
20
|
+
Defaults: {};
|
|
21
|
+
}, Readonly<import('./type').MlChartProps> & Readonly<{
|
|
22
|
+
[x: `on${Capitalize<string>}`]: ((...args: unknown[] & []) => any) | undefined;
|
|
23
|
+
}>, {}, {}, {}, {}, {
|
|
24
|
+
options: Record<string, any>;
|
|
25
|
+
id: string;
|
|
26
|
+
theme: string;
|
|
27
|
+
isEmpty: boolean | ((options: Record<string, any>) => boolean);
|
|
28
|
+
description: string;
|
|
29
|
+
}>;
|
|
30
|
+
__isFragment?: never;
|
|
31
|
+
__isTeleport?: never;
|
|
32
|
+
__isSuspense?: never;
|
|
33
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('./type').MlChartProps> & Readonly<{
|
|
34
|
+
[x: `on${Capitalize<string>}`]: ((...args: unknown[] & []) => any) | undefined;
|
|
35
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
36
|
+
[x: string]: ((...args: unknown[]) => any) | (() => any);
|
|
37
|
+
}, string, {
|
|
38
|
+
options: Record<string, any>;
|
|
39
|
+
id: string;
|
|
40
|
+
theme: string;
|
|
41
|
+
isEmpty: boolean | ((options: Record<string, any>) => boolean);
|
|
42
|
+
description: string;
|
|
43
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
44
|
+
$slots: {
|
|
45
|
+
empty?(_: {}): any;
|
|
46
|
+
default?(_: {}): any;
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
export default MlChart;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MlChartProps } from './type';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
empty?(_: {}): any;
|
|
6
|
+
default?(_: {}): any;
|
|
7
|
+
};
|
|
8
|
+
refs: {
|
|
9
|
+
echartRef: HTMLDivElement;
|
|
10
|
+
};
|
|
11
|
+
rootEl: HTMLDivElement;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
+
declare const __VLS_component: import('vue').DefineComponent<MlChartProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
15
|
+
[x: string]: ((...args: unknown[]) => any) | (() => any);
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<MlChartProps> & Readonly<{
|
|
17
|
+
[x: `on${Capitalize<string>}`]: ((...args: unknown[] & []) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
options: Record<string, any>;
|
|
20
|
+
id: string;
|
|
21
|
+
theme: string;
|
|
22
|
+
isEmpty: boolean | ((options: Record<string, any>) => boolean);
|
|
23
|
+
description: string;
|
|
24
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
25
|
+
echartRef: HTMLDivElement;
|
|
26
|
+
}, HTMLDivElement>;
|
|
27
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { defineComponent, getCurrentInstance, ref, useAttrs, computed, watch, nextTick, onMounted, onBeforeUnmount, createElementBlock, openBlock, mergeProps, unref, withDirectives, renderSlot, createCommentVNode, createElementVNode, normalizeClass, vShow, createVNode, markRaw } from 'vue';
|
|
2
|
+
import { ElEmpty } from 'element-plus';
|
|
3
|
+
import { useResizeObserver } from '../../node_modules/.pnpm/@vueuse_core@13.6.0_vue@3.5.17_typescript@5.9.3_/node_modules/@vueuse/core/index.mjs';
|
|
4
|
+
import { bem } from '../../utils/index.mjs';
|
|
5
|
+
import { useDebounceFn } from '../../node_modules/.pnpm/@vueuse_shared@13.6.0_vue@3.5.17_typescript@5.9.3_/node_modules/@vueuse/shared/index.mjs';
|
|
6
|
+
|
|
7
|
+
const _hoisted_1 = ["id"];
|
|
8
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
...{
|
|
10
|
+
name: "MlChart"
|
|
11
|
+
},
|
|
12
|
+
__name: "index",
|
|
13
|
+
props: {
|
|
14
|
+
options: { type: Object, required: false, default: () => ({}) },
|
|
15
|
+
id: { type: String, required: false, default: () => Math.random().toString(36).substring(2, 8) },
|
|
16
|
+
theme: { type: String, required: false, default: "" },
|
|
17
|
+
isEmpty: { type: [Boolean, Function], required: false, default: false },
|
|
18
|
+
description: { type: String, required: false, default: "\u6682\u65E0\u6570\u636E" }
|
|
19
|
+
},
|
|
20
|
+
emits: ["chart"],
|
|
21
|
+
setup(__props, { emit: __emit }) {
|
|
22
|
+
const { proxy } = getCurrentInstance();
|
|
23
|
+
const props = __props;
|
|
24
|
+
const echartRef = ref();
|
|
25
|
+
const chart = ref();
|
|
26
|
+
const emits = __emit;
|
|
27
|
+
const events = Object.entries(useAttrs());
|
|
28
|
+
const renderChart = async () => {
|
|
29
|
+
await nextTick();
|
|
30
|
+
if (!echartRef.value) return;
|
|
31
|
+
const { clientWidth, clientHeight } = echartRef.value;
|
|
32
|
+
if (clientWidth === 0 || clientHeight === 0) {
|
|
33
|
+
console.warn("[MlChart] DOM width or height is 0, waiting for next frame...");
|
|
34
|
+
requestAnimationFrame(() => {
|
|
35
|
+
requestAnimationFrame(() => {
|
|
36
|
+
initChart();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
initChart();
|
|
42
|
+
};
|
|
43
|
+
const initChart = () => {
|
|
44
|
+
if (!echartRef.value) return;
|
|
45
|
+
chart.value = markRaw(proxy.$echarts.init(echartRef.value, props.theme));
|
|
46
|
+
setOption(props.options);
|
|
47
|
+
emits("chart", chart.value);
|
|
48
|
+
events.forEach(([key]) => {
|
|
49
|
+
if (key.startsWith("on") && !key.startsWith("onChart")) {
|
|
50
|
+
const on = key.toLowerCase().substring(2);
|
|
51
|
+
chart.value.on(on, (...args) => emits(on, ...args));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
useResizeObserver(echartRef.value, resizeChart);
|
|
55
|
+
};
|
|
56
|
+
const resizeChart = useDebounceFn(() => {
|
|
57
|
+
chart.value?.resize();
|
|
58
|
+
}, 300);
|
|
59
|
+
const setOption = useDebounceFn(async (data) => {
|
|
60
|
+
if (!chart.value) return;
|
|
61
|
+
chart.value.setOption(data, true, true);
|
|
62
|
+
await nextTick();
|
|
63
|
+
resizeChart();
|
|
64
|
+
}, 300);
|
|
65
|
+
const formatEmpty = computed(() => {
|
|
66
|
+
if (typeof props.isEmpty === "function") {
|
|
67
|
+
return props.isEmpty(props.options);
|
|
68
|
+
}
|
|
69
|
+
return props.isEmpty;
|
|
70
|
+
});
|
|
71
|
+
watch(
|
|
72
|
+
() => props.options,
|
|
73
|
+
async (nw) => {
|
|
74
|
+
await nextTick();
|
|
75
|
+
setOption(nw);
|
|
76
|
+
},
|
|
77
|
+
{ deep: true }
|
|
78
|
+
);
|
|
79
|
+
watch(
|
|
80
|
+
() => props.theme,
|
|
81
|
+
async () => {
|
|
82
|
+
if (chart.value) {
|
|
83
|
+
chart.value.dispose();
|
|
84
|
+
}
|
|
85
|
+
await renderChart();
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
onMounted(async () => {
|
|
89
|
+
await renderChart();
|
|
90
|
+
});
|
|
91
|
+
onBeforeUnmount(() => {
|
|
92
|
+
if (chart.value) {
|
|
93
|
+
chart.value.dispose();
|
|
94
|
+
chart.value = null;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
return (_ctx, _cache) => {
|
|
98
|
+
return openBlock(), createElementBlock(
|
|
99
|
+
"div",
|
|
100
|
+
mergeProps({
|
|
101
|
+
class: unref(bem)("chart")
|
|
102
|
+
}, _ctx.$attrs),
|
|
103
|
+
[
|
|
104
|
+
withDirectives(createElementVNode("div", {
|
|
105
|
+
class: normalizeClass(unref(bem)("chart", "container")),
|
|
106
|
+
id: __props.id,
|
|
107
|
+
ref_key: "echartRef",
|
|
108
|
+
ref: echartRef
|
|
109
|
+
}, null, 10, _hoisted_1), [
|
|
110
|
+
[vShow, !formatEmpty.value]
|
|
111
|
+
]),
|
|
112
|
+
formatEmpty.value ? renderSlot(_ctx.$slots, "empty", { key: 0 }, () => [
|
|
113
|
+
createVNode(unref(ElEmpty), mergeProps(_ctx.$attrs, { description: __props.description }), null, 16, ["description"])
|
|
114
|
+
]) : createCommentVNode("v-if", true),
|
|
115
|
+
renderSlot(_ctx.$slots, "default")
|
|
116
|
+
],
|
|
117
|
+
16
|
|
118
|
+
/* FULL_PROPS */
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const MlDetail: {
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./type').MlDetailProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
3
|
+
descColumn: number;
|
|
4
|
+
dataList: Record<string, any>;
|
|
5
|
+
listTypeInfo: Record<string, any>;
|
|
6
|
+
descData: import('./type').DescItem[];
|
|
7
|
+
isColon: boolean;
|
|
8
|
+
isLabelBold: boolean;
|
|
9
|
+
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
10
|
+
P: {};
|
|
11
|
+
B: {};
|
|
12
|
+
D: {};
|
|
13
|
+
C: {};
|
|
14
|
+
M: {};
|
|
15
|
+
Defaults: {};
|
|
16
|
+
}, Readonly<import('./type').MlDetailProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
17
|
+
descColumn: number;
|
|
18
|
+
dataList: Record<string, any>;
|
|
19
|
+
listTypeInfo: Record<string, any>;
|
|
20
|
+
descData: import('./type').DescItem[];
|
|
21
|
+
isColon: boolean;
|
|
22
|
+
isLabelBold: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
__isFragment?: never;
|
|
25
|
+
__isTeleport?: never;
|
|
26
|
+
__isSuspense?: never;
|
|
27
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('./type').MlDetailProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
28
|
+
descColumn: number;
|
|
29
|
+
dataList: Record<string, any>;
|
|
30
|
+
listTypeInfo: Record<string, any>;
|
|
31
|
+
descData: import('./type').DescItem[];
|
|
32
|
+
isColon: boolean;
|
|
33
|
+
isLabelBold: boolean;
|
|
34
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
35
|
+
$slots: Partial<Record<string, (_: {}) => any>>;
|
|
36
|
+
});
|
|
37
|
+
export default MlDetail;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MlDetailProps } from './type';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: Partial<Record<string, (_: {}) => any>>;
|
|
5
|
+
refs: {};
|
|
6
|
+
rootEl: any;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
9
|
+
declare const __VLS_component: import('vue').DefineComponent<MlDetailProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<MlDetailProps> & Readonly<{}>, {
|
|
10
|
+
descColumn: number;
|
|
11
|
+
dataList: Record<string, any>;
|
|
12
|
+
listTypeInfo: Record<string, any>;
|
|
13
|
+
descData: import('./type').DescItem[];
|
|
14
|
+
isColon: boolean;
|
|
15
|
+
isLabelBold: boolean;
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|