@timescope/vue 0.0.0-alpha.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.
- package/index.d.ts +52 -0
- package/index.js +1 -0
- package/package.json +35 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as timescope0 from "timescope";
|
|
2
|
+
import { Decimal, Decimal as Decimal$1, FieldDefLike, Timescope, TimescopeNumberLike, TimescopeOptionsInitial, TimescopeOptionsSelection, TimescopeOptionsSeries, TimescopeOptionsSources, TimescopeOptionsTracks, TimescopeSourceInput, TimescopeTimeLike } from "timescope";
|
|
3
|
+
import * as vue0 from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/Timescope.vue.d.ts
|
|
6
|
+
declare const __VLS_export: <Source extends Record<string, TimescopeSourceInput>, SourceName extends Record<string, keyof Source>, TimeDef extends Record<string, FieldDefLike<TimescopeTimeLike<never>>>, ValueDef extends Record<string, FieldDefLike<TimescopeNumberLike | null>>, Track extends string>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
7
|
+
props: __VLS_PrettifyLocal<{
|
|
8
|
+
width?: string;
|
|
9
|
+
height?: string;
|
|
10
|
+
stack?: "vertical" | "horizontal";
|
|
11
|
+
time?: Decimal$1 | number | null | string | Date;
|
|
12
|
+
timeRange?: [Decimal$1 | number | null | string | Date | undefined, Decimal$1 | number | null | string | Date | undefined];
|
|
13
|
+
zoom?: number;
|
|
14
|
+
zoomRange?: [number | undefined, number | undefined];
|
|
15
|
+
sources?: TimescopeOptionsSources<Source>;
|
|
16
|
+
series?: TimescopeOptionsSeries<Source, SourceName, TimeDef, ValueDef, Track>;
|
|
17
|
+
tracks?: TimescopeOptionsTracks<Track>;
|
|
18
|
+
indicator?: boolean;
|
|
19
|
+
selection?: TimescopeOptionsSelection;
|
|
20
|
+
showFps?: boolean;
|
|
21
|
+
fonts?: TimescopeOptionsInitial<any, any, any, any, any>["fonts"];
|
|
22
|
+
} & {
|
|
23
|
+
onTimechanged?: ((args_0: Decimal$1 | null) => any) | undefined;
|
|
24
|
+
onTimechanging?: ((args_0: Decimal$1 | null) => any) | undefined;
|
|
25
|
+
onZoomchanged?: ((args_0: number) => any) | undefined;
|
|
26
|
+
onZoomchanging?: ((args_0: number) => any) | undefined;
|
|
27
|
+
onRangechanging?: ((args_0: [Decimal$1, Decimal$1]) => any) | undefined;
|
|
28
|
+
onRangechanged?: ((args_0: [Decimal$1, Decimal$1] | null) => any) | undefined;
|
|
29
|
+
"onUpdate:time"?: ((args_0: Decimal$1 | null) => any) | undefined;
|
|
30
|
+
"onUpdate:zoom"?: ((args_0: number) => any) | undefined;
|
|
31
|
+
}> & vue0.PublicProps & (typeof globalThis extends {
|
|
32
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
33
|
+
} ? P : {});
|
|
34
|
+
expose: (exposed: vue0.ShallowUnwrapRef<{
|
|
35
|
+
api: vue0.Raw<Timescope<Record<string, TimescopeSourceInput>, Record<string, string>, Record<string, FieldDefLike<TimescopeTimeLike<never>>>, Record<string, FieldDefLike<TimescopeNumberLike | null>>, string>>;
|
|
36
|
+
}>) => void;
|
|
37
|
+
attrs: any;
|
|
38
|
+
slots: {};
|
|
39
|
+
emit: ((evt: "timechanged", args_0: Decimal$1 | null) => void) & ((evt: "timechanging", args_0: Decimal$1 | null) => void) & ((evt: "zoomchanged", args_0: number) => void) & ((evt: "zoomchanging", args_0: number) => void) & ((evt: "rangechanging", args_0: [Decimal$1, Decimal$1]) => void) & ((evt: "rangechanged", args_0: [Decimal$1, Decimal$1] | null) => void) & ((evt: "update:time", args_0: Decimal$1 | null) => void) & ((evt: "update:zoom", args_0: number) => void);
|
|
40
|
+
}>) => vue0.VNode & {
|
|
41
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
42
|
+
};
|
|
43
|
+
declare const _default: typeof __VLS_export;
|
|
44
|
+
type __VLS_PrettifyLocal<T> = { [K in keyof T as K]: T[K] } & {};
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/index.d.ts
|
|
47
|
+
declare const defineTimescopeOptions: <Source extends Record<string, timescope0.TimescopeSourceInput>, SourceName extends Record<string, keyof Source>, TimeDef extends Record<string, timescope0.FieldDefLike<timescope0.TimescopeTimeLike<never>>>, ValueDef extends Record<string, timescope0.FieldDefLike<timescope0.TimescopeNumberLike | null>>, Track extends string>(opts: timescope0.TimescopeOptions<Source, SourceName, TimeDef, ValueDef, Track>) => typeof opts;
|
|
48
|
+
declare const defineTimescopeSources: <Source extends Record<string, timescope0.TimescopeSourceInput>>(opts: timescope0.TimescopeOptionsSources<Source>) => typeof opts;
|
|
49
|
+
declare const defineTimescopeTracks: <Track extends string>(opts: timescope0.TimescopeOptionsTracks<Track>) => typeof opts;
|
|
50
|
+
declare const defineTimescopeSeries: <Source extends Record<string, timescope0.TimescopeSourceInput>, SourceName extends Record<string, keyof Source>, TimeDef extends Record<string, timescope0.FieldDefLike<timescope0.TimescopeTimeLike<never>>>, ValueDef extends Record<string, timescope0.FieldDefLike<timescope0.TimescopeNumberLike | null>>, Track extends string = "default">(opts: timescope0.TimescopeOptionsSeries<Source, SourceName, TimeDef, ValueDef, Track>, sources?: timescope0.TimescopeOptionsSources<Source>, tracks?: timescope0.TimescopeOptionsTracks<Track>) => typeof opts;
|
|
51
|
+
//#endregion
|
|
52
|
+
export { Decimal, _default as Timescope, defineTimescopeOptions, defineTimescopeSeries, defineTimescopeSources, defineTimescopeTracks };
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Decimal as e,Decimal as t,Timescope as n,createDefineTimescopeOptions as r,createDefineTimescopeSeries as i,createDefineTimescopeSources as a,createDefineTimescopeTracks as o}from"timescope";import{createElementBlock as s,createElementVNode as c,defineComponent as l,markRaw as u,normalizeStyle as d,onBeforeUnmount as f,openBlock as p,provide as m,reactive as h,useTemplateRef as g,watch as _}from"vue";var v=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n};const y=l({__name:`Timescope`,props:{width:{type:String,required:!1,default:`100%`},height:{type:String,required:!1,default:`36px`},stack:{type:String,required:!1,default:`horizontal`},time:{type:[Object,Number,null,String,Date],required:!1},timeRange:{type:Array,required:!1},zoom:{type:Number,required:!1},zoomRange:{type:Array,required:!1},sources:{type:null,required:!1},series:{type:null,required:!1},tracks:{type:null,required:!1},indicator:{type:Boolean,required:!1,default:!0},selection:{type:[Boolean,Object],required:!1},showFps:{type:Boolean,required:!1},fonts:{type:Array,required:!1}},emits:[`timechanged`,`timechanging`,`zoomchanged`,`zoomchanging`,`rangechanging`,`rangechanged`,`update:time`,`update:zoom`],setup(e,{expose:t,emit:r}){let i=r,a=e,o=u(new n({time:a.time??null,timeRange:a.timeRange,zoom:a.zoom??0,zoomRange:a.zoomRange,fonts:a.fonts}));o.on(`timechanging`,e=>i(`timechanging`,e.value)),o.on(`timechanged`,e=>i(`timechanged`,e.value)),o.on(`zoomchanging`,e=>i(`zoomchanging`,e.value)),o.on(`zoomchanged`,e=>i(`zoomchanged`,e.value)),o.on(`rangechanging`,e=>i(`rangechanging`,e.value)),o.on(`rangechanged`,e=>i(`rangechanged`,e.value)),o.on(`timechanged`,e=>i(`update:time`,e.value)),o.on(`zoomchanged`,e=>i(`update:zoom`,e.value)),a.time===void 0&&i(`update:time`,o.time),a.zoom===void 0&&i(`update:zoom`,o.zoom),_(()=>a.time,()=>o?.setTime(a.time??null)),_(()=>a.timeRange,()=>o?.setTimeRange(a.timeRange)),_(()=>a.zoom,()=>o?.setZoom(a.zoom??0)),_(()=>a.zoomRange,()=>o?.setZoomRange(a.zoomRange)),_(()=>[a.width,a.height],()=>o.updateOptions({style:{width:a.width,height:a.height}}),{immediate:!0}),_(()=>a.sources,()=>o.updateOptions({sources:a.sources}),{immediate:!0,deep:!0}),_(()=>a.series,()=>o.updateOptions({series:a.series}),{immediate:!0,deep:!0}),_(()=>a.tracks,()=>o.updateOptions({tracks:a.tracks}),{immediate:!0,deep:!0}),_(()=>a.indicator,()=>o.updateOptions({indicator:a.indicator}),{immediate:!0,deep:!0}),_(()=>a.selection,()=>o.updateOptions({selection:a.selection}),{immediate:!0,deep:!0}),_(()=>a.showFps,()=>o.updateOptions({showFps:a.showFps}),{immediate:!0});let s=g(`container-ref`);_(s,()=>{o?.unmount(),s.value&&o?.mount(s.value)}),f(()=>{o?.dispose()});let c=o;m(`timescope-api`,c),t({api:c});let l={emit:i,props:a,timescope:o,el:s,api:c};return Object.defineProperty(l,`__isScriptSetup`,{enumerable:!1,value:!0}),l}});function b(e,t,n,r,i,a){return p(),s(`div`,{style:d([{display:`flex`},{width:r.props.width,height:r.props.height,flexDirection:n.stack===`vertical`?`column`:`row`}])},[c(`div`,{ref:`container-ref`,style:d([{flex:`1`,order:`0`},{width:n.stack===`vertical`?`100%`:`0`,height:n.stack===`vertical`?`0`:`100%`}])},null,4)],4)}var x=v(y,[[`render`,b],[`__file`,`/home/kikuchan/proj/timescope/packages/timescope-vue/src/Timescope.vue`]]);const S=r(h),C=a(h),w=o(h),T=i(h);export{e as Decimal,x as Timescope,S as defineTimescopeOptions,T as defineTimescopeSeries,C as defineTimescopeSources,w as defineTimescopeTracks};
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@timescope/vue",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.0-alpha.0",
|
|
5
|
+
"description": "",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"time-series",
|
|
8
|
+
"timeseries",
|
|
9
|
+
"timeline",
|
|
10
|
+
"chart",
|
|
11
|
+
"library",
|
|
12
|
+
"typescript",
|
|
13
|
+
"javascript",
|
|
14
|
+
"vue"
|
|
15
|
+
],
|
|
16
|
+
"author": "Xenodrive, Inc.",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"homepage": "https://xenodrive.github.io/timescope/",
|
|
19
|
+
"repository": {
|
|
20
|
+
"url": "https://github.com/xenodrive/timescope/"
|
|
21
|
+
},
|
|
22
|
+
"main": "./index.js",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./index.d.ts",
|
|
26
|
+
"import": "./index.js",
|
|
27
|
+
"require": "./index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"vue": "^3.5.25",
|
|
32
|
+
"timescope": "^0.0.0-alpha.1"
|
|
33
|
+
},
|
|
34
|
+
"types": "./index.d.ts"
|
|
35
|
+
}
|