-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: ignore dist in eslint * fix: add `vite` as dependency in every workspaces to solve some type error in `vite.config.ts` * ci: replace `tsc` with `vue-tsc` to check `.vue` files correctly * fix: restore `vite` dependency in client package * build: disable some ESLint rules * build(deps): force downgrade typescript as it is not compatible with vue-tsc * build: optimize ESLint performance * build(deps): add `@vue-motion/core` to supress `template/src`'s `vue-tsc` errors. * fix: right operand of ?? is unreachable because the left operand is never nullish * fix: property 'forEach' does not exist on type 'Ref<Widget<any>[], Widget<any>[]>'. * build(deps): update lockfile * build: update tsconfig.json * fix: accidentially broke container.vue * fix: add wid and ReturnWidget * ci: move unused checks to ESLint * build: update tsconfig.json * fix: 'data' is possibly 'undefined'. * fix: ...
- Loading branch information
Showing
45 changed files
with
1,973 additions
and
2,354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
}, | ||
"devDependencies": { | ||
"@vitejs/plugin-vue": "^5.1.4", | ||
"vite": "catalog:", | ||
"vite-plugin-dts": "^3.9.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ | |
}, | ||
"devDependencies": { | ||
"@vitejs/plugin-vue": "^5.1.4", | ||
"vite": "catalog:", | ||
"vite-plugin-dts": "^3.9.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,48 @@ | ||
import { defineWidget } from '@vue-motion/core' | ||
import type { Ref } from 'vue' | ||
import { inject, provide, ref, unref } from 'vue' | ||
import { defineWidget } from "@vue-motion/core"; | ||
import type { Ref } from "vue"; | ||
import { inject, provide, ref, unref } from "vue"; | ||
|
||
import type { BaseSimpleChartData, BaseSimpleChartOptions } from '../widgets/baseSimpleChart.vue' | ||
import type { ChartLayoutConfig } from '../widgets/chartLayout.vue' | ||
import type { MixedChartData } from '../widgets/mixedChart.vue' | ||
import type { | ||
BaseSimpleChartData, | ||
BaseSimpleChartOptions, | ||
} from "../widgets/baseSimpleChart.vue"; | ||
import type { ChartLayoutConfig } from "../widgets/chartLayout.vue"; | ||
import type { MixedChartData } from "../widgets/mixedChart.vue"; | ||
|
||
export function useSimpleChart<T extends BaseSimpleChartOptions>(props: T) { | ||
const options = defineWidget<T>(props) | ||
const options = defineWidget<T>(props); | ||
|
||
const mixedData = inject<Ref<MixedChartData[]>>('mixedChartData', ref<MixedChartData[]>([])) | ||
let data = inject<Ref<BaseSimpleChartData>>('chartData') | ||
const mixedData = inject<Ref<MixedChartData[]>>( | ||
"mixedChartData", | ||
ref<MixedChartData[]>([]), | ||
Check failure on line 17 in extensions/chart/src/utils/useSimpleChart.ts
|
||
); | ||
let data = inject<Ref<BaseSimpleChartData>>("chartData"); | ||
if (!data) { | ||
data = ref<BaseSimpleChartData>({ | ||
Check failure on line 21 in extensions/chart/src/utils/useSimpleChart.ts
|
||
labels: (options as BaseSimpleChartOptions).labels, | ||
datasets: [], | ||
}) | ||
}); | ||
mixedData.value.push({ | ||
data: unref(data) as BaseSimpleChartData, | ||
options: options as BaseSimpleChartOptions, | ||
}) | ||
}); | ||
} | ||
provide('chartData', data) | ||
let layoutConfig = inject<Ref<ChartLayoutConfig>>('chartLayoutConfig') | ||
if (layoutConfig) | ||
options.layout = true | ||
else | ||
layoutConfig = ref<ChartLayoutConfig>({}) | ||
provide('chartLayoutConfig', layoutConfig) | ||
provide("chartData", data); | ||
let layoutConfig = inject<Ref<ChartLayoutConfig>>("chartLayoutConfig"); | ||
if (layoutConfig) options.layout = true; | ||
else layoutConfig = ref<ChartLayoutConfig>({}); | ||
provide("chartLayoutConfig", layoutConfig); | ||
|
||
data.value.style ??= {} | ||
data.value.style ??= {}; | ||
data.value.style = { | ||
...data.value.style, | ||
...data?.value.style, | ||
...options.style, | ||
} | ||
}; | ||
|
||
return { | ||
props, | ||
options: options as ReturnType<typeof defineWidget<T>>, | ||
data, | ||
layoutConfig, | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.