@orbcharts/presets-basic 3.0.0-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. package/LICENSE +201 -0
  2. package/dist/orbcharts-presets-basic.es.js +347 -0
  3. package/dist/orbcharts-presets-basic.umd.js +1 -0
  4. package/dist/src/chartParamsFiles/CP_BOTTOM_LONG_PADDING.d.ts +3 -0
  5. package/dist/src/chartParamsFiles/CP_BOTTOM_PADDING.d.ts +3 -0
  6. package/dist/src/chartParamsFiles/CP_BOTTOM_PADDING_WITH_GROUP_HIGHLIGHT.d.ts +3 -0
  7. package/dist/src/chartParamsFiles/CP_LEFT_PADDING.d.ts +3 -0
  8. package/dist/src/chartParamsFiles/CP_RIGHT_PADDING.d.ts +3 -0
  9. package/dist/src/chartParamsFiles/index.d.ts +5 -0
  10. package/dist/src/createPreset.d.ts +9 -0
  11. package/dist/src/gridDataFormatterFiles/DF_BOTTOM_VALUE_AXIS.d.ts +3 -0
  12. package/dist/src/gridDataFormatterFiles/index.d.ts +1 -0
  13. package/dist/src/gridPluginParamsFiles/Bars/PP_BARS_ROUND.d.ts +4 -0
  14. package/dist/src/gridPluginParamsFiles/Bars/PP_BARS_THIN.d.ts +4 -0
  15. package/dist/src/gridPluginParamsFiles/Bars/index.d.ts +2 -0
  16. package/dist/src/gridPluginParamsFiles/Dots/PP_DOTS_ONLY_SHOW_HIGHLIGHTED.d.ts +4 -0
  17. package/dist/src/gridPluginParamsFiles/Dots/PP_DOTS_SOLID.d.ts +4 -0
  18. package/dist/src/gridPluginParamsFiles/Dots/index.d.ts +2 -0
  19. package/dist/src/gridPluginParamsFiles/GridLegend/PP_GRID_LEGEND_BOTTOM.d.ts +4 -0
  20. package/dist/src/gridPluginParamsFiles/GridLegend/PP_GRID_LEGEND_BOTTOM_WITH_LINE_LIST.d.ts +4 -0
  21. package/dist/src/gridPluginParamsFiles/GridLegend/index.d.ts +2 -0
  22. package/dist/src/gridPluginParamsFiles/GroupAxis/PP_GROUP_AXIS_ROTATE_LABEL.d.ts +4 -0
  23. package/dist/src/gridPluginParamsFiles/GroupAxis/index.d.ts +1 -0
  24. package/dist/src/gridPluginParamsFiles/Lines/PP_LINES_CURVE.d.ts +4 -0
  25. package/dist/src/gridPluginParamsFiles/Lines/index.d.ts +1 -0
  26. package/dist/src/gridPluginParamsFiles/index.d.ts +5 -0
  27. package/dist/src/index.d.ts +12 -0
  28. package/dist/src/multiGridDataFormatterFiles/index.d.ts +1 -0
  29. package/dist/src/multiGridPluginParamsFiles/index.d.ts +1 -0
  30. package/dist/src/multiValueDataFormatterFiles/index.d.ts +1 -0
  31. package/dist/src/multiValuePluginParamsFiles/index.d.ts +1 -0
  32. package/dist/src/relationshipDataFormatterFiles/index.d.ts +1 -0
  33. package/dist/src/relationshipPluginParamsFiles/index.d.ts +1 -0
  34. package/dist/src/seriesDataFormatterFiles/index.d.ts +1 -0
  35. package/dist/src/seriesPluginParamsFiles/Bubbles/PP_BUBBLES_SCALING_BY_RADIUS.d.ts +4 -0
  36. package/dist/src/seriesPluginParamsFiles/Bubbles/index.d.ts +1 -0
  37. package/dist/src/seriesPluginParamsFiles/Pie/PP_PIE_BLACK_STROKE.d.ts +0 -0
  38. package/dist/src/seriesPluginParamsFiles/Pie/PP_PIE_DONUT.d.ts +4 -0
  39. package/dist/src/seriesPluginParamsFiles/Pie/PP_PIE_HALF_DONUT.d.ts +4 -0
  40. package/dist/src/seriesPluginParamsFiles/Pie/index.d.ts +2 -0
  41. package/dist/src/seriesPluginParamsFiles/PieLabels/PP_PIE_LABELS_HALF_ANGLE.d.ts +4 -0
  42. package/dist/src/seriesPluginParamsFiles/PieLabels/PP_PIE_LABELS_INNER.d.ts +4 -0
  43. package/dist/src/seriesPluginParamsFiles/PieLabels/index.d.ts +2 -0
  44. package/dist/src/seriesPluginParamsFiles/SeriesLegend/PP_SERIES_LEGEND_ROUND.d.ts +4 -0
  45. package/dist/src/seriesPluginParamsFiles/SeriesLegend/index.d.ts +1 -0
  46. package/dist/src/seriesPluginParamsFiles/index.d.ts +4 -0
  47. package/dist/src/treeDataFormatterFiles/index.d.ts +1 -0
  48. package/dist/src/treePluginParamsFiles/index.d.ts +1 -0
  49. package/dist/src/types.d.ts +39 -0
  50. package/dist/vite.config.d.ts +2 -0
  51. package/package.json +43 -0
  52. package/src/chartParamsFiles/CP_BOTTOM_LONG_PADDING.ts +14 -0
  53. package/src/chartParamsFiles/CP_BOTTOM_PADDING.ts +14 -0
  54. package/src/chartParamsFiles/CP_BOTTOM_PADDING_WITH_GROUP_HIGHLIGHT.ts +15 -0
  55. package/src/chartParamsFiles/CP_LEFT_PADDING.ts +14 -0
  56. package/src/chartParamsFiles/CP_RIGHT_PADDING.ts +14 -0
  57. package/src/chartParamsFiles/index.ts +5 -0
  58. package/src/createPreset.ts +88 -0
  59. package/src/gridDataFormatterFiles/DF_BOTTOM_VALUE_AXIS.ts +16 -0
  60. package/src/gridDataFormatterFiles/index.ts +1 -0
  61. package/src/gridPluginParamsFiles/Bars/PP_BARS_ROUND.ts +15 -0
  62. package/src/gridPluginParamsFiles/Bars/PP_BARS_THIN.ts +14 -0
  63. package/src/gridPluginParamsFiles/Bars/index.ts +2 -0
  64. package/src/gridPluginParamsFiles/Dots/PP_DOTS_ONLY_SHOW_HIGHLIGHTED.ts +14 -0
  65. package/src/gridPluginParamsFiles/Dots/PP_DOTS_SOLID.ts +14 -0
  66. package/src/gridPluginParamsFiles/Dots/index.ts +2 -0
  67. package/src/gridPluginParamsFiles/GridLegend/PP_GRID_LEGEND_BOTTOM.ts +14 -0
  68. package/src/gridPluginParamsFiles/GridLegend/PP_GRID_LEGEND_BOTTOM_WITH_LINE_LIST.ts +15 -0
  69. package/src/gridPluginParamsFiles/GridLegend/index.ts +2 -0
  70. package/src/gridPluginParamsFiles/GroupAxis/PP_GROUP_AXIS_ROTATE_LABEL.ts +12 -0
  71. package/src/gridPluginParamsFiles/GroupAxis/index.ts +1 -0
  72. package/src/gridPluginParamsFiles/Lines/PP_LINES_CURVE.ts +13 -0
  73. package/src/gridPluginParamsFiles/Lines/index.ts +1 -0
  74. package/src/gridPluginParamsFiles/index.ts +6 -0
  75. package/src/index.ts +103 -0
  76. package/src/multiGridDataFormatterFiles/index.ts +1 -0
  77. package/src/multiGridPluginParamsFiles/index.ts +1 -0
  78. package/src/multiValueDataFormatterFiles/index.ts +1 -0
  79. package/src/multiValuePluginParamsFiles/index.ts +1 -0
  80. package/src/relationshipDataFormatterFiles/index.ts +1 -0
  81. package/src/relationshipPluginParamsFiles/index.ts +1 -0
  82. package/src/seriesDataFormatterFiles/index.ts +1 -0
  83. package/src/seriesPluginParamsFiles/Bubbles/PP_BUBBLES_SCALING_BY_RADIUS.ts +12 -0
  84. package/src/seriesPluginParamsFiles/Bubbles/index.ts +1 -0
  85. package/src/seriesPluginParamsFiles/Pie/PP_PIE_BLACK_STROKE.ts +0 -0
  86. package/src/seriesPluginParamsFiles/Pie/PP_PIE_DONUT.ts +12 -0
  87. package/src/seriesPluginParamsFiles/Pie/PP_PIE_HALF_DONUT.ts +14 -0
  88. package/src/seriesPluginParamsFiles/Pie/index.ts +2 -0
  89. package/src/seriesPluginParamsFiles/PieLabels/PP_PIE_LABELS_HALF_ANGLE.ts +13 -0
  90. package/src/seriesPluginParamsFiles/PieLabels/PP_PIE_LABELS_INNER.ts +13 -0
  91. package/src/seriesPluginParamsFiles/PieLabels/index.ts +2 -0
  92. package/src/seriesPluginParamsFiles/SeriesLegend/PP_SERIES_LEGEND_ROUND.ts +12 -0
  93. package/src/seriesPluginParamsFiles/SeriesLegend/index.ts +1 -0
  94. package/src/seriesPluginParamsFiles/index.ts +4 -0
  95. package/src/treeDataFormatterFiles/index.ts +1 -0
  96. package/src/treePluginParamsFiles/index.ts +1 -0
  97. package/src/types.ts +58 -0
  98. package/tsconfig.json +14 -0
  99. package/vite.config.js +45 -0
package/src/index.ts ADDED
@@ -0,0 +1,103 @@
1
+ import {
2
+ createSeriesPreset,
3
+ createGridPreset,
4
+ createMultiGridPreset,
5
+ createMultiValuePreset,
6
+ createRelationshipPreset,
7
+ createTreePreset } from './createPreset'
8
+
9
+ // -- series --
10
+ // 通用 - PRESET_SERIES_[name]
11
+ export const PRESET_SERIES_BASIC = createSeriesPreset({
12
+ // chartParamsId: 'CP_RIGHT_PADDING',
13
+ allPluginParamsIds: [],
14
+ description: '基本Series參數'
15
+ })
16
+ // Bubbles - PRESET_BUBBLES_[name]
17
+ export const PRESET_BUBBLES_SCALING_BY_RADIUS = createSeriesPreset({
18
+ // chartParamsId: 'CP_RIGHT_PADDING',
19
+ allPluginParamsIds: ['PP_BUBBLES_SCALING_BY_RADIUS', 'PP_SERIES_LEGEND_ROUND'],
20
+ description: '以半徑尺寸為比例的泡泡圖'
21
+ })
22
+ // Pie - PRESET_PIE_[name]
23
+ export const PRESET_PIE_WITH_INNER_LABELS = createSeriesPreset({
24
+ // chartParamsId: 'CP_RIGHT_PADDING',
25
+ allPluginParamsIds: ['PP_PIE_LABELS_INNER', 'PP_SERIES_LEGEND_ROUND'],
26
+ description: '圓餅圖及內部資料標籤'
27
+ })
28
+ export const PRESET_PIE_DONUT = createSeriesPreset({
29
+ // chartParamsId: 'CP_RIGHT_PADDING',
30
+ allPluginParamsIds: ['PP_PIE_DONUT', 'PP_SERIES_LEGEND_ROUND'],
31
+ description: '甜甜圈圖'
32
+ })
33
+ export const PRESET_PIE_HALF_DONUT = createSeriesPreset({
34
+ // chartParamsId: 'CP_RIGHT_PADDING',
35
+ allPluginParamsIds: ['PP_PIE_HALF_DONUT', 'PP_PIE_LABELS_HALF_ANGLE', 'PP_SERIES_LEGEND_ROUND'],
36
+ description: '半圓甜甜圈圖'
37
+ })
38
+
39
+ // -- grid --
40
+ // 通用 - PRESET_GRID_[name]
41
+ export const PRESET_GRID_BASIC = createGridPreset({
42
+ chartParamsId: 'CP_BOTTOM_LONG_PADDING',
43
+ allPluginParamsIds: ['PP_GRID_LEGEND_BOTTOM'],
44
+ description: '基本Grid參數'
45
+ })
46
+ export const PRESET_GRID_ROTATE_AXIS_LABEL = createGridPreset({
47
+ chartParamsId: 'CP_BOTTOM_PADDING',
48
+ allPluginParamsIds: ['PP_GROUP_AXIS_ROTATE_LABEL', 'PP_GRID_LEGEND_BOTTOM'],
49
+ description: '傾斜標籤'
50
+ })
51
+ // Bars - PRESET_BARS_[name]
52
+ export const PRESET_BARS_ROUND = createGridPreset({
53
+ chartParamsId: 'CP_BOTTOM_PADDING',
54
+ allPluginParamsIds: ['PP_BARS_ROUND', 'PP_GRID_LEGEND_BOTTOM'],
55
+ description: '圓角長條圖'
56
+ })
57
+ console.log(PRESET_BARS_ROUND)
58
+ export const PRESET_BARS_HORIZONTAL_AND_ROUND = createGridPreset({
59
+ chartParamsId: 'CP_BOTTOM_PADDING',
60
+ dataFormatterId: 'DF_BOTTOM_VALUE_AXIS',
61
+ allPluginParamsIds: ['PP_BARS_ROUND', 'PP_GRID_LEGEND_BOTTOM'],
62
+ description: '橫向圓角長條圖'
63
+ })
64
+ export const PRESET_BARS_THIN = createGridPreset({
65
+ chartParamsId: 'CP_BOTTOM_PADDING',
66
+ allPluginParamsIds: ['PP_BARS_THIN', 'PP_GRID_LEGEND_BOTTOM'],
67
+ description: '細長條圖'
68
+ })
69
+ // export const PRESET_BARS_HORIZONTAL_AND_THIN = createGridPreset({
70
+ // chartParamsId: 'CP_BOTTOM_PADDING',
71
+ // dataFormatterId: 'DF_BOTTOM_VALUE_AXIS',
72
+ // allPluginParamsIds: ['PP_BARS_THIN', 'PP_GRID_LEGEND_BOTTOM'],
73
+ // description: '橫向細長條圖'
74
+ // })
75
+ // Lines - PRESET_LINES_[name]
76
+ // export const PRESET_LINES_WITH_SOLID_DOTS = createGridPreset({
77
+ // chartParamsId: 'CP_BOTTOM_PADDING',
78
+ // allPluginParamsIds: ['PP_DOTS_SOLID', 'PP_GRID_LEGEND_BOTTOM_WITH_LINE_LIST'],
79
+ // description: '折線圖及實心圓點'
80
+ // })
81
+ export const PRESET_LINES_CURVE = createGridPreset({
82
+ chartParamsId: 'CP_BOTTOM_PADDING',
83
+ allPluginParamsIds: ['PP_LINES_CURVE', 'PP_GRID_LEGEND_BOTTOM_WITH_LINE_LIST'],
84
+ description: '弧線折線圖'
85
+ })
86
+ // export const PRESET_LINES_CURVES_WITH_SOLID_DOTS = createGridPreset({
87
+ // chartParamsId: 'CP_BOTTOM_PADDING',
88
+ // allPluginParamsIds: ['PP_LINES_CURVE', 'PP_DOTS_SOLID', 'PP_GRID_LEGEND_BOTTOM_WITH_LINE_LIST'],
89
+ // description: '弧線折線圖及實心圓點'
90
+ // })
91
+ export const PRESET_LINES_HIGHLIGHT_GROUP_DOTS = createGridPreset({
92
+ chartParamsId: 'CP_BOTTOM_PADDING_WITH_GROUP_HIGHLIGHT',
93
+ allPluginParamsIds: ['PP_DOTS_ONLY_SHOW_HIGHLIGHTED', 'PP_GRID_LEGEND_BOTTOM_WITH_LINE_LIST'],
94
+ description: '折線圖及Highlight Group圓點'
95
+ })
96
+ // -- multi-grid --
97
+
98
+ // -- multi-value --
99
+
100
+ // -- relationship --
101
+
102
+ // -- tree --
103
+
@@ -0,0 +1 @@
1
+ export const temp = {}
@@ -0,0 +1 @@
1
+ export const temp = {}
@@ -0,0 +1 @@
1
+ export const temp = {}
@@ -0,0 +1 @@
1
+ export const temp = {}
@@ -0,0 +1 @@
1
+ export const temp = {}
@@ -0,0 +1 @@
1
+ export const temp = {}
@@ -0,0 +1 @@
1
+ export const temp = {}
@@ -0,0 +1,12 @@
1
+ import type { PluginParamsFile } from '../../types'
2
+ import type { BubblesParams } from '@orbcharts/plugins-basic'
3
+
4
+ export const PP_BUBBLES_SCALING_BY_RADIUS: PluginParamsFile<BubblesParams> = {
5
+ id: 'PP_BUBBLES_SCALING_BY_RADIUS',
6
+ chartType: 'series',
7
+ pluginName: 'Bubbles',
8
+ description: '以半徑尺寸為比例的泡泡圖',
9
+ data: {
10
+ bubbleScaleType: 'radius'
11
+ }
12
+ }
@@ -0,0 +1 @@
1
+ export { PP_BUBBLES_SCALING_BY_RADIUS } from './PP_BUBBLES_SCALING_BY_RADIUS'
@@ -0,0 +1,12 @@
1
+ import type { PluginParamsFile } from '../../types'
2
+ import type { PieParams } from '@orbcharts/plugins-basic'
3
+
4
+ export const PP_PIE_DONUT: PluginParamsFile<PieParams> = {
5
+ id: 'PP_PIE_DONUT',
6
+ chartType: 'series',
7
+ pluginName: 'Pie',
8
+ description: '甜甜圈圖',
9
+ data: {
10
+ innerRadius: 0.5
11
+ }
12
+ }
@@ -0,0 +1,14 @@
1
+ import type { PluginParamsFile } from '../../types'
2
+ import type { PieParams } from '@orbcharts/plugins-basic'
3
+
4
+ export const PP_PIE_HALF_DONUT: PluginParamsFile<PieParams> = {
5
+ id: 'PP_PIE_HALF_DONUT',
6
+ chartType: 'series',
7
+ pluginName: 'Pie',
8
+ description: '半圓甜甜圈圖',
9
+ data: {
10
+ innerRadius: 0.5,
11
+ startAngle: - Math.PI / 2,
12
+ endAngle: Math.PI / 2,
13
+ }
14
+ }
@@ -0,0 +1,2 @@
1
+ export { PP_PIE_DONUT } from './PP_PIE_DONUT'
2
+ export { PP_PIE_HALF_DONUT } from './PP_PIE_HALF_DONUT'
@@ -0,0 +1,13 @@
1
+ import type { PluginParamsFile } from '../../types'
2
+ import type { PieLabelsParams } from '@orbcharts/plugins-basic'
3
+
4
+ export const PP_PIE_LABELS_HALF_ANGLE: PluginParamsFile<PieLabelsParams> = {
5
+ id: 'PP_PIE_LABELS_HALF_ANGLE',
6
+ chartType: 'series',
7
+ pluginName: 'PieLabels',
8
+ description: '半圓甜甜圈資料標籤',
9
+ data: {
10
+ startAngle: - Math.PI / 2,
11
+ endAngle: Math.PI / 2,
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ import type { PluginParamsFile } from '../../types'
2
+ import type { PieLabelsParams } from '@orbcharts/plugins-basic'
3
+
4
+ export const PP_PIE_LABELS_INNER: PluginParamsFile<PieLabelsParams> = {
5
+ id: 'PP_PIE_LABELS_INNER',
6
+ chartType: 'series',
7
+ pluginName: 'PieLabels',
8
+ description: '圖內資料標籤',
9
+ data: {
10
+ "labelCentroid": 1.3,
11
+ "labelColorType": "primary"
12
+ }
13
+ }
@@ -0,0 +1,2 @@
1
+ export { PP_PIE_LABELS_HALF_ANGLE } from './PP_PIE_LABELS_HALF_ANGLE'
2
+ export { PP_PIE_LABELS_INNER } from './PP_PIE_LABELS_INNER'
@@ -0,0 +1,12 @@
1
+ import type { PluginParamsFile } from '../../types'
2
+ import type { SeriesLegendParams } from '@orbcharts/plugins-basic'
3
+
4
+ export const PP_SERIES_LEGEND_ROUND: PluginParamsFile<SeriesLegendParams> = {
5
+ id: 'PP_SERIES_LEGEND_BOTTOM',
6
+ chartType: 'series',
7
+ pluginName: 'SeriesLegend',
8
+ description: '圓型圖例列點',
9
+ data: {
10
+ listRectRadius: 7
11
+ }
12
+ }
@@ -0,0 +1 @@
1
+ export { PP_SERIES_LEGEND_ROUND } from './PP_SERIES_LEGEND_ROUND'
@@ -0,0 +1,4 @@
1
+ export * from './Bubbles'
2
+ export * from './Pie'
3
+ export * from './PieLabels'
4
+ export * from './SeriesLegend'
@@ -0,0 +1 @@
1
+ export const temp = {}
@@ -0,0 +1 @@
1
+ export const temp = {}
package/src/types.ts ADDED
@@ -0,0 +1,58 @@
1
+ import type {
2
+ ChartParamsPartial,
3
+ DataFormatterPartialTypeMap,
4
+ ChartType,
5
+ Preset } from '@orbcharts/core'
6
+ import * as chartParams from './chartParamsFiles'
7
+ import * as seriesDataFormatters from './seriesDataFormatterFiles'
8
+ import * as seriesPluginParams from './seriesPluginParamsFiles'
9
+ import * as gridDataFormatters from './gridDataFormatterFiles'
10
+ import * as gridPluginParams from './gridPluginParamsFiles'
11
+ import * as multiGridDataFormatters from './multiGridDataFormatterFiles'
12
+ import * as multiGridPluginParams from './multiGridPluginParamsFiles'
13
+ import * as multiValueDataFormatters from './multiValueDataFormatterFiles'
14
+ import * as multiValuePluginParams from './multiValuePluginParamsFiles'
15
+ import * as relationshipDataFormatters from './relationshipDataFormatterFiles'
16
+ import * as relationshipPluginParams from './relationshipPluginParamsFiles'
17
+ import * as treeDataFormatters from './treeDataFormatterFiles'
18
+ import * as treePluginParams from './treePluginParamsFiles'
19
+
20
+ export interface ChartParamsFile {
21
+ id: string
22
+ description: string
23
+ data: ChartParamsPartial
24
+ }
25
+
26
+ export interface DataFormatterFile<T extends ChartType> {
27
+ id: string
28
+ chartType: T
29
+ description: string
30
+ data: DataFormatterPartialTypeMap<T>
31
+ }
32
+
33
+ export interface PluginParamsFile<PluginParams> {
34
+ id: string
35
+ chartType: ChartType
36
+ pluginName: string
37
+ description: string
38
+ data: Partial<PluginParams>
39
+ }
40
+
41
+ export interface PresetFile<T extends ChartType> {
42
+ chartParamsId?: keyof typeof chartParams
43
+ dataFormatterId?: T extends 'series' ? keyof typeof seriesDataFormatters
44
+ : T extends 'grid' ? keyof typeof gridDataFormatters
45
+ : T extends 'multiGrid' ? keyof typeof multiGridDataFormatters
46
+ : T extends 'multiValue' ? keyof typeof multiValueDataFormatters
47
+ : T extends 'relationship' ? keyof typeof relationshipDataFormatters
48
+ : T extends 'tree' ? keyof typeof treeDataFormatters
49
+ : undefined
50
+ allPluginParamsIds?: T extends 'series' ? (keyof typeof seriesPluginParams)[]
51
+ : T extends 'grid' ? (keyof typeof gridPluginParams)[]
52
+ : T extends 'multiGrid' ? (keyof typeof multiGridPluginParams)[]
53
+ : T extends 'multiValue' ? (keyof typeof multiValuePluginParams)[]
54
+ : T extends 'relationship' ? (keyof typeof relationshipPluginParams)[]
55
+ : T extends 'tree' ? (keyof typeof treePluginParams)[]
56
+ : undefined,
57
+ description: string
58
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": "./dist/",
4
+ "sourceMap": true,
5
+ "noImplicitAny": true,
6
+ "module": "es6",
7
+ "target": "es5",
8
+ "jsx": "react",
9
+ "allowJs": true,
10
+ "moduleResolution": "node",
11
+ "allowSyntheticDefaultImports" : true,
12
+ "esModuleInterop" : true
13
+ }
14
+ }
package/vite.config.js ADDED
@@ -0,0 +1,45 @@
1
+ // import { fileURLToPath, URL } from 'node:url'
2
+
3
+ // import { resolve } from 'path'
4
+ import { defineConfig } from 'vite'
5
+ import dts from 'vite-plugin-dts'
6
+
7
+ const releaseConfig = {
8
+ plugins: [
9
+ dts({
10
+ insertTypesEntry: true
11
+ })
12
+ ],
13
+ compilerOptions: {
14
+ composite: true
15
+ },
16
+ build: {
17
+ lib: {
18
+ entry: "src/index.ts",
19
+ name: 'orbcharts-presets-basic',
20
+ formats: ["es", "umd"],
21
+ fileName: format => `orbcharts-presets-basic.${format}.js`
22
+ },
23
+ // rollupOptions: {
24
+ // input: {
25
+ // main: resolve(__dirname, "src/index.ts")
26
+ // },
27
+ // external: ['vue'],
28
+ // output: {
29
+ // assetFileNames: 'my-library.css',
30
+ // exports: "named",
31
+ // globals: {
32
+ // vue: 'Vue',
33
+ // },
34
+ // },
35
+ // },
36
+ }
37
+ }
38
+
39
+ export default defineConfig(({ command, mode }) => {
40
+ if (mode === 'release') {
41
+ return releaseConfig
42
+ } else {
43
+ return releaseConfig
44
+ }
45
+ })