@topdatasec/report 1.0.0

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.
@@ -0,0 +1,41 @@
1
+ import { Ref } from 'vue';
2
+ export declare function dateFormat(value?: number | string | Date, format?: string): string;
3
+ export declare function formatNumber(value: number | string, precision?: number, separator?: string, decimal?: string, prefix?: string, suffix?: string): string;
4
+ export declare function rafTimeout(fn: Function, delay?: number, interval?: boolean): object;
5
+ export declare function cancelRaf(raf: {
6
+ id: number;
7
+ }): void;
8
+ export declare function throttle(fn: Function, delay?: number): any;
9
+ export declare function debounce(fn: Function, delay?: number): any;
10
+ export declare function add(num1: number, num2: number): number;
11
+ export declare function downloadFile(url: string, fileName?: string): void;
12
+ export declare function toggleDark(): void;
13
+ export declare function useMounted(): Ref<boolean, boolean>;
14
+ export declare function useSupported(callback: () => unknown): import('vue').ComputedRef<boolean>;
15
+ export declare function useEventListener(target: HTMLElement | Window | Document, event: string, callback: Function): void;
16
+ export declare function useMutationObserver(target: Ref | Ref[] | HTMLElement | HTMLElement[], callback: MutationCallback, options?: {}): {
17
+ stop: () => void;
18
+ start: () => void;
19
+ };
20
+ export declare function useScroll(target?: Ref | HTMLElement | Window | Document, throttleDelay?: number, onScroll?: (e: Event) => void, onStop?: (e: Event) => void): {
21
+ x: Ref<number, number>;
22
+ xScrollMax: Ref<number, number>;
23
+ y: Ref<number, number>;
24
+ yScrollMax: Ref<number, number>;
25
+ isScrolling: Ref<boolean, boolean>;
26
+ left: Ref<boolean, boolean>;
27
+ right: Ref<boolean, boolean>;
28
+ top: Ref<boolean, boolean>;
29
+ bottom: Ref<boolean, boolean>;
30
+ };
31
+ export declare function useFps(): {
32
+ fps: Ref<number, number>;
33
+ };
34
+ export declare function useMediaQuery(mediaQuery: string): {
35
+ match: Ref<boolean, boolean>;
36
+ };
37
+ export declare function useResizeObserver(target: Ref | Ref[] | HTMLElement | HTMLElement[], callback: ResizeObserverCallback, options?: object): {
38
+ stop: () => void;
39
+ start: () => void;
40
+ };
41
+ export declare function useSlotsExist(slotsName?: string | string[]): any;
@@ -0,0 +1,306 @@
1
+ import { onMounted as x, onUnmounted as N, ref as f, computed as g, toValue as E, watch as L, onBeforeUnmount as w, useSlots as O, reactive as R, getCurrentInstance as k, Comment as U, Text as V } from "vue";
2
+ function j(e = Date.now(), n = "YYYY-MM-DD HH:mm:ss") {
3
+ try {
4
+ let t;
5
+ if (typeof e == "number" || typeof e == "string") {
6
+ if (t = new Date(e), isNaN(t.getTime()))
7
+ throw new Error("Invalid date");
8
+ } else
9
+ t = e;
10
+ const r = (c, s = 2) => String(c).padStart(s, "0"), o = (c) => {
11
+ switch (c) {
12
+ case "YYYY":
13
+ return r(t.getFullYear());
14
+ case "YY":
15
+ return r(t.getFullYear()).slice(2, 4);
16
+ case "MM":
17
+ return r(t.getMonth() + 1);
18
+ case "M":
19
+ return String(t.getMonth() + 1);
20
+ case "DD":
21
+ return r(t.getDate());
22
+ case "D":
23
+ return String(t.getDate());
24
+ case "HH":
25
+ return r(t.getHours());
26
+ case "H":
27
+ return String(t.getHours());
28
+ case "mm":
29
+ return r(t.getMinutes());
30
+ case "m":
31
+ return String(t.getMinutes());
32
+ case "ss":
33
+ return r(t.getSeconds());
34
+ case "s":
35
+ return String(t.getSeconds());
36
+ case "SSS":
37
+ return r(t.getMilliseconds(), 3);
38
+ default:
39
+ return c;
40
+ }
41
+ };
42
+ return n.replace(/(YYYY|YY|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS)/g, o);
43
+ } catch (t) {
44
+ return console.error("Error formatting date:", t), "";
45
+ }
46
+ }
47
+ function P(e, n = 2, t = ",", r = ".", o, c) {
48
+ typeof e != "number" && typeof e != "string" && console.warn("Expected value to be of type number or string"), typeof n != "number" && console.warn("Expected precision to be of type number");
49
+ const s = Number(e);
50
+ if (isNaN(s) || !isFinite(s))
51
+ return "";
52
+ if (s === 0)
53
+ return s.toFixed(n);
54
+ let l = s.toFixed(n);
55
+ if (typeof t == "string" && t !== "") {
56
+ const [i, d] = l.split(".");
57
+ l = i.replace(/(\d)(?=(\d{3})+$)/g, "$1" + t) + (d ? r + d : "");
58
+ }
59
+ return (o || "") + l + (c || "");
60
+ }
61
+ function W(e, n = 0, t = !1) {
62
+ let r = null;
63
+ function o(s) {
64
+ if (r || (r = s), s - r >= n) {
65
+ try {
66
+ e();
67
+ } catch (i) {
68
+ console.error("Error executing rafTimeout function:", i);
69
+ }
70
+ t && (r = s, c.id = requestAnimationFrame(o));
71
+ } else
72
+ c.id = requestAnimationFrame(o);
73
+ }
74
+ const c = {
75
+ id: requestAnimationFrame(o)
76
+ };
77
+ return c;
78
+ }
79
+ function $(e) {
80
+ e && e.id && typeof e.id == "number" ? cancelAnimationFrame(e.id) : console.warn("cancelRaf received an invalid id:", e);
81
+ }
82
+ function q(e, n = 300) {
83
+ let t = !0;
84
+ return function(...r) {
85
+ return t && (e(...r), t = !1, setTimeout(() => {
86
+ t = !0;
87
+ }, n)), !1;
88
+ };
89
+ }
90
+ function I(e, n = 300) {
91
+ let t = null;
92
+ return function(...r) {
93
+ t && clearTimeout(t), t = setTimeout(() => {
94
+ e(...r);
95
+ }, n);
96
+ };
97
+ }
98
+ function Z(e, n) {
99
+ if (Number.isNaN(e) || Number.isNaN(n))
100
+ throw new Error("Both num1 and num2 must be valid numbers.");
101
+ const t = e % 1 !== 0, r = n % 1 !== 0;
102
+ if (!t && !r)
103
+ return e + n;
104
+ const o = String(e).split(".")[1] ?? "", c = String(n).split(".")[1] ?? "", s = Math.max(o.length, c.length), l = Math.pow(10, s), i = e.toFixed(s), d = n.toFixed(s);
105
+ return (+i.replace(".", "") + +d.replace(".", "")) / l;
106
+ }
107
+ function C(e, n) {
108
+ if (!e) {
109
+ console.error("无效的 url");
110
+ return;
111
+ }
112
+ const t = n || e.split("?")[0].split("/").pop() || "download";
113
+ try {
114
+ fetch(e).then((r) => {
115
+ r.ok ? r.blob().then((o) => {
116
+ const c = URL.createObjectURL(o), s = document.createElement("a");
117
+ s.href = c, s.download = t, document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(c);
118
+ }) : console.error("请求文件失败,状态码:", r.status);
119
+ });
120
+ } catch (r) {
121
+ console.error("文件下载失败:", r);
122
+ }
123
+ }
124
+ function G() {
125
+ const e = document.documentElement;
126
+ e.classList.toggle("dark"), e.classList.contains("dark") ? e.style.colorScheme = "dark" : e.style.colorScheme = "light";
127
+ }
128
+ function z() {
129
+ const e = f(!1), n = k();
130
+ return n && x(() => {
131
+ e.value = !0;
132
+ }, n), e;
133
+ }
134
+ function A(e) {
135
+ const n = z();
136
+ return g(() => (n.value, !!e()));
137
+ }
138
+ function J(e, n, t) {
139
+ x(() => e.addEventListener(n, t)), N(() => e.removeEventListener(n, t));
140
+ }
141
+ function K(e, n, t = {}) {
142
+ const r = A(() => window && "MutationObserver" in window), o = f(!1);
143
+ let c;
144
+ const s = g(() => {
145
+ const a = E(e);
146
+ return a ? Array.isArray(a) ? a.map((m) => E(m)).filter((m) => m) : [a] : [];
147
+ }), l = () => {
148
+ c && (c.disconnect(), c = void 0);
149
+ }, i = () => {
150
+ r.value && s.value.length && !o.value && (c = new MutationObserver(n), s.value.forEach((a) => c.observe(a, t)));
151
+ };
152
+ L(
153
+ () => s.value,
154
+ () => {
155
+ l(), i();
156
+ },
157
+ {
158
+ immediate: !0,
159
+ // 立即触发回调,以便初始状态也被观察
160
+ flush: "post"
161
+ }
162
+ );
163
+ const d = () => {
164
+ o.value = !0, l();
165
+ }, v = () => {
166
+ o.value = !1, i();
167
+ };
168
+ return w(() => l()), {
169
+ stop: d,
170
+ start: v
171
+ };
172
+ }
173
+ function X(e = window, n = 0, t, r) {
174
+ const o = f(0), c = f(0), s = f(0), l = f(0), i = f(!1), d = f(!1), v = f(!1), a = f(!1), m = f(!1), S = f(0), y = f(0);
175
+ function T(u) {
176
+ i.value = !0;
177
+ const p = u.target.documentElement ?? u.target;
178
+ o.value = p.scrollLeft, s.value = p.scrollTop, d.value = o.value < S.value, v.value = o.value > S.value, a.value = s.value < y.value, m.value = s.value > y.value, S.value = o.value, y.value = s.value, M(u), t && t(u);
179
+ }
180
+ const Y = q(T, n);
181
+ function H(u) {
182
+ i.value && (i.value = !1, d.value = !1, v.value = !1, a.value = !1, m.value = !1, r && r(u));
183
+ }
184
+ const M = I(H, n + 200), F = g(() => {
185
+ const u = E(e);
186
+ return u || null;
187
+ });
188
+ L(
189
+ () => F.value,
190
+ (u, p) => {
191
+ var b;
192
+ if (p && D(p), u) {
193
+ const h = ((b = u == null ? void 0 : u.document) == null ? void 0 : b.documentElement) || (u == null ? void 0 : u.documentElement) || u;
194
+ c.value = h.scrollWidth - h.clientWidth, l.value = h.scrollHeight - h.clientHeight, h.addEventListener("scroll", Y), h.addEventListener("scrollend", M);
195
+ }
196
+ },
197
+ {
198
+ immediate: !0,
199
+ flush: "post"
200
+ }
201
+ );
202
+ function D(u) {
203
+ var b;
204
+ const p = ((b = u == null ? void 0 : u.document) == null ? void 0 : b.documentElement) || (u == null ? void 0 : u.documentElement) || u;
205
+ p.removeEventListener("scroll", Y), p.removeEventListener("scrollend", M);
206
+ }
207
+ return w(() => D(F.value)), { x: o, xScrollMax: c, y: s, yScrollMax: l, isScrolling: i, left: d, right: v, top: a, bottom: m };
208
+ }
209
+ function _() {
210
+ const e = f(0), n = f(0);
211
+ let t = performance.now();
212
+ const r = 10, o = (c) => {
213
+ if (n.value++, n.value >= r) {
214
+ const s = c - t;
215
+ e.value = Math.round(1e3 / (s / r)), t = c, n.value = 0;
216
+ }
217
+ requestAnimationFrame(o);
218
+ };
219
+ return requestAnimationFrame(o), { fps: e };
220
+ }
221
+ function Q(e) {
222
+ if (!e || typeof e != "string" || e.trim() === "")
223
+ throw new Error("Invalid mediaQuery parameter. It must be a non-empty string.");
224
+ const n = f(window && window.matchMedia(e).matches), t = window.matchMedia(e), r = (o) => {
225
+ n.value = o.matches;
226
+ };
227
+ return x(() => {
228
+ t.addEventListener("change", r);
229
+ }), w(() => {
230
+ t.removeEventListener("change", r);
231
+ }), { match: n };
232
+ }
233
+ function ee(e, n, t = {}) {
234
+ const r = A(() => window && "ResizeObserver" in window);
235
+ let o;
236
+ const c = f(!1), s = g(() => {
237
+ const a = E(e);
238
+ return a ? Array.isArray(a) ? a.map((m) => E(m)).filter((m) => m) : [a] : [];
239
+ }), l = () => {
240
+ o && (o.disconnect(), o = void 0);
241
+ }, i = () => {
242
+ r.value && s.value.length && !c.value && (o = new ResizeObserver(n), s.value.forEach((a) => o.observe(a, t)));
243
+ };
244
+ L(
245
+ () => s.value,
246
+ () => {
247
+ l(), i();
248
+ },
249
+ {
250
+ immediate: !0,
251
+ // 立即触发回调,以便初始状态也被观察
252
+ flush: "post"
253
+ }
254
+ );
255
+ const d = () => {
256
+ c.value = !0, l();
257
+ }, v = () => {
258
+ c.value = !1, i();
259
+ };
260
+ return w(() => l()), {
261
+ stop: d,
262
+ start: v
263
+ };
264
+ }
265
+ function te(e = "default") {
266
+ const n = O(), t = (r) => {
267
+ var s;
268
+ const o = (s = n[r]) == null ? void 0 : s.call(n), c = (l) => {
269
+ if (l.type === U || Array.isArray(l.children) && !l.children.length)
270
+ return !1;
271
+ if (l.type !== V)
272
+ return !0;
273
+ if (typeof l.children == "string")
274
+ return l.children.trim() !== "";
275
+ };
276
+ return o && (o != null && o.length) ? o.some((i) => c(i)) : !1;
277
+ };
278
+ if (Array.isArray(e)) {
279
+ const r = R({});
280
+ return e.forEach((o) => {
281
+ const c = g(() => t(o));
282
+ r[o] = c;
283
+ }), r;
284
+ } else
285
+ return g(() => t(e));
286
+ }
287
+ export {
288
+ Z as add,
289
+ $ as cancelRaf,
290
+ j as dateFormat,
291
+ I as debounce,
292
+ C as downloadFile,
293
+ P as formatNumber,
294
+ W as rafTimeout,
295
+ q as throttle,
296
+ G as toggleDark,
297
+ J as useEventListener,
298
+ _ as useFps,
299
+ Q as useMediaQuery,
300
+ z as useMounted,
301
+ K as useMutationObserver,
302
+ ee as useResizeObserver,
303
+ X as useScroll,
304
+ te as useSlotsExist,
305
+ A as useSupported
306
+ };
@@ -0,0 +1,11 @@
1
+ export interface VueAmazingUIResolverOptions {
2
+ cjs?: boolean;
3
+ }
4
+ export declare function VueAmazingUIResolver(options?: VueAmazingUIResolverOptions): {
5
+ type: "component";
6
+ resolve: (componentName: string) => {
7
+ name: string;
8
+ from: string;
9
+ sideEffects: string[];
10
+ } | undefined;
11
+ };
@@ -0,0 +1,36 @@
1
+ const n = {
2
+ TdsReportBar: "TdsReportBar"
3
+ }, i = {
4
+ BackTop: ["Tooltip"]
5
+ };
6
+ function o(s, e) {
7
+ if (["NumberAnimation", "Watermark"].includes(s))
8
+ return [];
9
+ const t = [s];
10
+ s in i && t.push(...i[s]);
11
+ const r = e != null && e.cjs ? "lib" : "es", c = [`@topdatasec/report/${r}/style/global.css`];
12
+ return t.forEach((f) => {
13
+ c.push(
14
+ `@topdatasec/report/${r}/${n[f]}/${f}.css`
15
+ );
16
+ }), c;
17
+ }
18
+ function a(s) {
19
+ return {
20
+ type: "component",
21
+ resolve: (e) => {
22
+ if (e in n)
23
+ return {
24
+ name: e,
25
+ // 组件名
26
+ from: "@topdatasec/report",
27
+ // 组件库名称
28
+ sideEffects: o(e, s)
29
+ // 组件样式文件
30
+ };
31
+ }
32
+ };
33
+ }
34
+ export {
35
+ a as VueAmazingUIResolver
36
+ };
@@ -0,0 +1,2 @@
1
+ import { Plugin, Component } from 'vue';
2
+ export declare const withInstall: <T extends Component>(comp: T) => T & Plugin;
@@ -0,0 +1,9 @@
1
+ const l = (n) => {
2
+ const t = n;
3
+ return t.install = function(e) {
4
+ e.component(t.__name, n);
5
+ }, n;
6
+ };
7
+ export {
8
+ l as withInstall
9
+ };
@@ -0,0 +1,52 @@
1
+ import { Slot } from 'vue';
2
+ export interface Props {
3
+ message?: string;
4
+ description?: string;
5
+ type?: 'default' | 'success' | 'info' | 'warning' | 'error';
6
+ bordered?: boolean;
7
+ closable?: boolean;
8
+ closeText?: string;
9
+ icon?: string;
10
+ showIcon?: boolean;
11
+ actions?: Slot;
12
+ }
13
+ declare function __VLS_template(): {
14
+ attrs: Partial<{}>;
15
+ slots: {
16
+ icon?(_: {}): any;
17
+ icon?(_: {}): any;
18
+ default?(_: {}): any;
19
+ description?(_: {}): any;
20
+ actions?(_: {}): any;
21
+ closeText?(_: {}): any;
22
+ };
23
+ refs: {
24
+ alertRef: HTMLDivElement;
25
+ };
26
+ rootEl: any;
27
+ };
28
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
29
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
30
+ close: (...args: any[]) => void;
31
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
32
+ onClose?: ((...args: any[]) => any) | undefined;
33
+ }>, {
34
+ type: "default" | "success" | "info" | "warning" | "error";
35
+ message: string;
36
+ description: string;
37
+ bordered: boolean;
38
+ closable: boolean;
39
+ closeText: string;
40
+ icon: string;
41
+ showIcon: boolean;
42
+ actions: Slot;
43
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
44
+ alertRef: HTMLDivElement;
45
+ }, any>;
46
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
47
+ export default _default;
48
+ type __VLS_WithTemplateSlots<T, S> = T & {
49
+ new (): {
50
+ $slots: S;
51
+ };
52
+ };
@@ -0,0 +1,66 @@
1
+ export type { Props } from './Alert';
2
+ declare const _default: {
3
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./Alert').Props> & Readonly<{
4
+ onClose?: ((...args: any[]) => any) | undefined;
5
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
6
+ close: (...args: any[]) => void;
7
+ }, import('vue').PublicProps, {
8
+ type: "default" | "success" | "info" | "warning" | "error";
9
+ message: string;
10
+ description: string;
11
+ bordered: boolean;
12
+ closable: boolean;
13
+ closeText: string;
14
+ icon: string;
15
+ showIcon: boolean;
16
+ actions: import('vue').Slot;
17
+ }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
18
+ alertRef: HTMLDivElement;
19
+ }, any, import('vue').ComponentProvideOptions, {
20
+ P: {};
21
+ B: {};
22
+ D: {};
23
+ C: {};
24
+ M: {};
25
+ Defaults: {};
26
+ }, Readonly<import('./Alert').Props> & Readonly<{
27
+ onClose?: ((...args: any[]) => any) | undefined;
28
+ }>, {}, {}, {}, {}, {
29
+ type: "default" | "success" | "info" | "warning" | "error";
30
+ message: string;
31
+ description: string;
32
+ bordered: boolean;
33
+ closable: boolean;
34
+ closeText: string;
35
+ icon: string;
36
+ showIcon: boolean;
37
+ actions: import('vue').Slot;
38
+ }>;
39
+ __isFragment?: never;
40
+ __isTeleport?: never;
41
+ __isSuspense?: never;
42
+ } & import('vue').ComponentOptionsBase<Readonly<import('./Alert').Props> & Readonly<{
43
+ onClose?: ((...args: any[]) => any) | undefined;
44
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
45
+ close: (...args: any[]) => void;
46
+ }, string, {
47
+ type: "default" | "success" | "info" | "warning" | "error";
48
+ message: string;
49
+ description: string;
50
+ bordered: boolean;
51
+ closable: boolean;
52
+ closeText: string;
53
+ icon: string;
54
+ showIcon: boolean;
55
+ actions: import('vue').Slot;
56
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
57
+ $slots: {
58
+ icon?(_: {}): any;
59
+ icon?(_: {}): any;
60
+ default?(_: {}): any;
61
+ description?(_: {}): any;
62
+ actions?(_: {}): any;
63
+ closeText?(_: {}): any;
64
+ };
65
+ }) & import('vue').Plugin;
66
+ export default _default;
@@ -0,0 +1,5 @@
1
+ export type Props = {
2
+ data: any;
3
+ };
4
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
5
+ export default _default;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("topdatasec-ui"),s={class:"chart-components"},a=e.defineComponent({name:"TdsReportBar",__name:"Bar",props:{data:{}},setup(t){const o=t,n=e.computed(()=>o.data.options);return(c,u)=>(e.openBlock(),e.createElementBlock("div",s,[e.createVNode(e.unref(r),{option:n.value},null,8,["option"])]))}});exports.default=a;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Bar.vue.cjs");exports.default=e.default;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Bar.vue.cjs"),t=require("../utils/type.cjs"),u=t.withInstall(e.default);exports.default=u;
@@ -0,0 +1,15 @@
1
+ export type { Props } from './Bar';
2
+ declare const _default: {
3
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./Bar').Props> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
4
+ P: {};
5
+ B: {};
6
+ D: {};
7
+ C: {};
8
+ M: {};
9
+ Defaults: {};
10
+ }, Readonly<import('./Bar').Props> & Readonly<{}>, {}, {}, {}, {}, {}>;
11
+ __isFragment?: never;
12
+ __isTeleport?: never;
13
+ __isSuspense?: never;
14
+ } & import('vue').ComponentOptionsBase<Readonly<import('./Bar').Props> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & import('vue').Plugin;
15
+ export default _default;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bar/index.cjs");exports.TdsReportBar=e.default;
@@ -0,0 +1,2 @@
1
+ export type { Props as TdsReportBarProps } from './bar';
2
+ export { default as TdsReportBar } from './bar';
package/lib/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */const u=require("./components.cjs"),e=require("./utils/index.cjs"),o=require("./utils/resolver.cjs"),a=require("./bar/index.cjs"),s=function(t){return Object.values(u).forEach(r=>{r&&r.install&&t.use(r)}),t},i={install:s};exports.add=e.add;exports.cancelRaf=e.cancelRaf;exports.dateFormat=e.dateFormat;exports.debounce=e.debounce;exports.downloadFile=e.downloadFile;exports.formatNumber=e.formatNumber;exports.rafTimeout=e.rafTimeout;exports.throttle=e.throttle;exports.toggleDark=e.toggleDark;exports.useEventListener=e.useEventListener;exports.useFps=e.useFps;exports.useMediaQuery=e.useMediaQuery;exports.useMutationObserver=e.useMutationObserver;exports.useResizeObserver=e.useResizeObserver;exports.useScroll=e.useScroll;exports.useSlotsExist=e.useSlotsExist;exports.VueAmazingUIResolver=o.VueAmazingUIResolver;exports.TdsReportBar=a.default;exports.default=i;exports.install=s;
package/lib/index.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { App } from 'vue';
2
+ export * from './components';
3
+ export { dateFormat, formatNumber, rafTimeout, cancelRaf, throttle, debounce, add, downloadFile, toggleDark, useEventListener, useMutationObserver, useScroll, useFps, useMediaQuery, useResizeObserver, useSlotsExist } from './utils';
4
+ export { VueAmazingUIResolver } from './utils/resolver';
5
+ export type { VueAmazingUIResolverOptions } from './utils/resolver';
6
+ export declare const install: (app: App) => App<any>;
7
+ declare const _default: {
8
+ install: (app: App) => App<any>;
9
+ };
10
+ export default _default;
@@ -0,0 +1 @@
1
+ *,*:before,*:after{box-sizing:border-box;margin:0;padding:0;caret-color:transparent}:root{--primary-color: #1677ff;--primary-color-hover: #4096ff}body{font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}input,textarea{caret-color:auto}a{color:var(--primary-color);text-decoration:none;background-color:transparent;-webkit-tap-highlight-color:transparent;outline:none;cursor:pointer;transition:color .3s ease}a:hover{color:var(--primary-color-hover)}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue");function O(e=Date.now(),n="YYYY-MM-DD HH:mm:ss"){try{let t;if(typeof e=="number"||typeof e=="string"){if(t=new Date(e),isNaN(t.getTime()))throw new Error("Invalid date")}else t=e;const r=(c,u=2)=>String(c).padStart(u,"0"),s=c=>{switch(c){case"YYYY":return r(t.getFullYear());case"YY":return r(t.getFullYear()).slice(2,4);case"MM":return r(t.getMonth()+1);case"M":return String(t.getMonth()+1);case"DD":return r(t.getDate());case"D":return String(t.getDate());case"HH":return r(t.getHours());case"H":return String(t.getHours());case"mm":return r(t.getMinutes());case"m":return String(t.getMinutes());case"ss":return r(t.getSeconds());case"s":return String(t.getSeconds());case"SSS":return r(t.getMilliseconds(),3);default:return c}};return n.replace(/(YYYY|YY|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS)/g,s)}catch(t){return console.error("Error formatting date:",t),""}}function T(e,n=2,t=",",r=".",s,c){typeof e!="number"&&typeof e!="string"&&console.warn("Expected value to be of type number or string"),typeof n!="number"&&console.warn("Expected precision to be of type number");const u=Number(e);if(isNaN(u)||!isFinite(u))return"";if(u===0)return u.toFixed(n);let a=u.toFixed(n);if(typeof t=="string"&&t!==""){const[i,d]=a.split(".");a=i.replace(/(\d)(?=(\d{3})+$)/g,"$1"+t)+(d?r+d:"")}return(s||"")+a+(c||"")}function R(e,n=0,t=!1){let r=null;function s(u){if(r||(r=u),u-r>=n){try{e()}catch(i){console.error("Error executing rafTimeout function:",i)}t&&(r=u,c.id=requestAnimationFrame(s))}else c.id=requestAnimationFrame(s)}const c={id:requestAnimationFrame(s)};return c}function N(e){e&&e.id&&typeof e.id=="number"?cancelAnimationFrame(e.id):console.warn("cancelRaf received an invalid id:",e)}function F(e,n=300){let t=!0;return function(...r){return t&&(e(...r),t=!1,setTimeout(()=>{t=!0},n)),!1}}function L(e,n=300){let t=null;return function(...r){t&&clearTimeout(t),t=setTimeout(()=>{e(...r)},n)}}function H(e,n){if(Number.isNaN(e)||Number.isNaN(n))throw new Error("Both num1 and num2 must be valid numbers.");const t=e%1!==0,r=n%1!==0;if(!t&&!r)return e+n;const s=String(e).split(".")[1]??"",c=String(n).split(".")[1]??"",u=Math.max(s.length,c.length),a=Math.pow(10,u),i=e.toFixed(u),d=n.toFixed(u);return(+i.replace(".","")+ +d.replace(".",""))/a}function U(e,n){if(!e){console.error("无效的 url");return}const t=n||e.split("?")[0].split("/").pop()||"download";try{fetch(e).then(r=>{r.ok?r.blob().then(s=>{const c=URL.createObjectURL(s),u=document.createElement("a");u.href=c,u.download=t,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(c)}):console.error("请求文件失败,状态码:",r.status)})}catch(r){console.error("文件下载失败:",r)}}function V(){const e=document.documentElement;e.classList.toggle("dark"),e.classList.contains("dark")?e.style.colorScheme="dark":e.style.colorScheme="light"}function Y(){const e=o.ref(!1),n=o.getCurrentInstance();return n&&o.onMounted(()=>{e.value=!0},n),e}function E(e){const n=Y();return o.computed(()=>(n.value,!!e()))}function k(e,n,t){o.onMounted(()=>e.addEventListener(n,t)),o.onUnmounted(()=>e.removeEventListener(n,t))}function q(e,n,t={}){const r=E(()=>window&&"MutationObserver"in window),s=o.ref(!1);let c;const u=o.computed(()=>{const f=o.toValue(e);return f?Array.isArray(f)?f.map(m=>o.toValue(m)).filter(m=>m):[f]:[]}),a=()=>{c&&(c.disconnect(),c=void 0)},i=()=>{r.value&&u.value.length&&!s.value&&(c=new MutationObserver(n),u.value.forEach(f=>c.observe(f,t)))};o.watch(()=>u.value,()=>{a(),i()},{immediate:!0,flush:"post"});const d=()=>{s.value=!0,a()},v=()=>{s.value=!1,i()};return o.onBeforeUnmount(()=>a()),{stop:d,start:v}}function B(e=window,n=0,t,r){const s=o.ref(0),c=o.ref(0),u=o.ref(0),a=o.ref(0),i=o.ref(!1),d=o.ref(!1),v=o.ref(!1),f=o.ref(!1),m=o.ref(!1),b=o.ref(0),S=o.ref(0);function D(l){i.value=!0;const p=l.target.documentElement??l.target;s.value=p.scrollLeft,u.value=p.scrollTop,d.value=s.value<b.value,v.value=s.value>b.value,f.value=u.value<S.value,m.value=u.value>S.value,b.value=s.value,S.value=u.value,w(l),t&&t(l)}const y=F(D,n);function A(l){i.value&&(i.value=!1,d.value=!1,v.value=!1,f.value=!1,m.value=!1,r&&r(l))}const w=L(A,n+200),M=o.computed(()=>{const l=o.toValue(e);return l||null});o.watch(()=>M.value,(l,p)=>{var g;if(p&&x(p),l){const h=((g=l==null?void 0:l.document)==null?void 0:g.documentElement)||(l==null?void 0:l.documentElement)||l;c.value=h.scrollWidth-h.clientWidth,a.value=h.scrollHeight-h.clientHeight,h.addEventListener("scroll",y),h.addEventListener("scrollend",w)}},{immediate:!0,flush:"post"});function x(l){var g;const p=((g=l==null?void 0:l.document)==null?void 0:g.documentElement)||(l==null?void 0:l.documentElement)||l;p.removeEventListener("scroll",y),p.removeEventListener("scrollend",w)}return o.onBeforeUnmount(()=>x(M.value)),{x:s,xScrollMax:c,y:u,yScrollMax:a,isScrolling:i,left:d,right:v,top:f,bottom:m}}function z(){const e=o.ref(0),n=o.ref(0);let t=performance.now();const r=10,s=c=>{if(n.value++,n.value>=r){const u=c-t;e.value=Math.round(1e3/(u/r)),t=c,n.value=0}requestAnimationFrame(s)};return requestAnimationFrame(s),{fps:e}}function I(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid mediaQuery parameter. It must be a non-empty string.");const n=o.ref(window&&window.matchMedia(e).matches),t=window.matchMedia(e),r=s=>{n.value=s.matches};return o.onMounted(()=>{t.addEventListener("change",r)}),o.onBeforeUnmount(()=>{t.removeEventListener("change",r)}),{match:n}}function j(e,n,t={}){const r=E(()=>window&&"ResizeObserver"in window);let s;const c=o.ref(!1),u=o.computed(()=>{const f=o.toValue(e);return f?Array.isArray(f)?f.map(m=>o.toValue(m)).filter(m=>m):[f]:[]}),a=()=>{s&&(s.disconnect(),s=void 0)},i=()=>{r.value&&u.value.length&&!c.value&&(s=new ResizeObserver(n),u.value.forEach(f=>s.observe(f,t)))};o.watch(()=>u.value,()=>{a(),i()},{immediate:!0,flush:"post"});const d=()=>{c.value=!0,a()},v=()=>{c.value=!1,i()};return o.onBeforeUnmount(()=>a()),{stop:d,start:v}}function P(e="default"){const n=o.useSlots(),t=r=>{var u;const s=(u=n[r])==null?void 0:u.call(n),c=a=>{if(a.type===o.Comment||Array.isArray(a.children)&&!a.children.length)return!1;if(a.type!==o.Text)return!0;if(typeof a.children=="string")return a.children.trim()!==""};return s&&(s!=null&&s.length)?s.some(i=>c(i)):!1};if(Array.isArray(e)){const r=o.reactive({});return e.forEach(s=>{const c=o.computed(()=>t(s));r[s]=c}),r}else return o.computed(()=>t(e))}exports.add=H;exports.cancelRaf=N;exports.dateFormat=O;exports.debounce=L;exports.downloadFile=U;exports.formatNumber=T;exports.rafTimeout=R;exports.throttle=F;exports.toggleDark=V;exports.useEventListener=k;exports.useFps=z;exports.useMediaQuery=I;exports.useMounted=Y;exports.useMutationObserver=q;exports.useResizeObserver=j;exports.useScroll=B;exports.useSlotsExist=P;exports.useSupported=E;
@@ -0,0 +1,41 @@
1
+ import { Ref } from 'vue';
2
+ export declare function dateFormat(value?: number | string | Date, format?: string): string;
3
+ export declare function formatNumber(value: number | string, precision?: number, separator?: string, decimal?: string, prefix?: string, suffix?: string): string;
4
+ export declare function rafTimeout(fn: Function, delay?: number, interval?: boolean): object;
5
+ export declare function cancelRaf(raf: {
6
+ id: number;
7
+ }): void;
8
+ export declare function throttle(fn: Function, delay?: number): any;
9
+ export declare function debounce(fn: Function, delay?: number): any;
10
+ export declare function add(num1: number, num2: number): number;
11
+ export declare function downloadFile(url: string, fileName?: string): void;
12
+ export declare function toggleDark(): void;
13
+ export declare function useMounted(): Ref<boolean, boolean>;
14
+ export declare function useSupported(callback: () => unknown): import('vue').ComputedRef<boolean>;
15
+ export declare function useEventListener(target: HTMLElement | Window | Document, event: string, callback: Function): void;
16
+ export declare function useMutationObserver(target: Ref | Ref[] | HTMLElement | HTMLElement[], callback: MutationCallback, options?: {}): {
17
+ stop: () => void;
18
+ start: () => void;
19
+ };
20
+ export declare function useScroll(target?: Ref | HTMLElement | Window | Document, throttleDelay?: number, onScroll?: (e: Event) => void, onStop?: (e: Event) => void): {
21
+ x: Ref<number, number>;
22
+ xScrollMax: Ref<number, number>;
23
+ y: Ref<number, number>;
24
+ yScrollMax: Ref<number, number>;
25
+ isScrolling: Ref<boolean, boolean>;
26
+ left: Ref<boolean, boolean>;
27
+ right: Ref<boolean, boolean>;
28
+ top: Ref<boolean, boolean>;
29
+ bottom: Ref<boolean, boolean>;
30
+ };
31
+ export declare function useFps(): {
32
+ fps: Ref<number, number>;
33
+ };
34
+ export declare function useMediaQuery(mediaQuery: string): {
35
+ match: Ref<boolean, boolean>;
36
+ };
37
+ export declare function useResizeObserver(target: Ref | Ref[] | HTMLElement | HTMLElement[], callback: ResizeObserverCallback, options?: object): {
38
+ stop: () => void;
39
+ start: () => void;
40
+ };
41
+ export declare function useSlotsExist(slotsName?: string | string[]): any;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o={TdsReportBar:"TdsReportBar"},n={BackTop:["Tooltip"]};function f(t,e){if(["NumberAnimation","Watermark"].includes(t))return[];const s=[t];t in n&&s.push(...n[t]);const r=e!=null&&e.cjs?"lib":"es",c=[`@topdatasec/report/${r}/style/global.css`];return s.forEach(i=>{c.push(`@topdatasec/report/${r}/${o[i]}/${i}.css`)}),c}function a(t){return{type:"component",resolve:e=>{if(e in o)return{name:e,from:"@topdatasec/report",sideEffects:f(e,t)}}}}exports.VueAmazingUIResolver=a;
@@ -0,0 +1,11 @@
1
+ export interface VueAmazingUIResolverOptions {
2
+ cjs?: boolean;
3
+ }
4
+ export declare function VueAmazingUIResolver(options?: VueAmazingUIResolverOptions): {
5
+ type: "component";
6
+ resolve: (componentName: string) => {
7
+ name: string;
8
+ from: string;
9
+ sideEffects: string[];
10
+ } | undefined;
11
+ };