@mekari/pixel3-chart 0.0.1-dev.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,126 @@
1
+ import * as chart_js_dist_types_utils from 'chart.js/dist/types/utils';
2
+ import * as chart_js from 'chart.js';
3
+ import { ChartData } from 'chart.js';
4
+ import { PropType, ExtractPropTypes } from 'vue';
5
+
6
+ declare const chartProps: {
7
+ id: {
8
+ type: PropType<string>;
9
+ default: string;
10
+ };
11
+ title: {
12
+ type: PropType<string>;
13
+ default: string;
14
+ };
15
+ type: {
16
+ type: PropType<keyof chart_js.ChartTypeRegistry>;
17
+ default: string;
18
+ };
19
+ widthChart: {
20
+ type: PropType<string>;
21
+ default: string;
22
+ };
23
+ heightChart: {
24
+ type: PropType<string>;
25
+ default: string;
26
+ };
27
+ widthContainer: {
28
+ type: PropType<string>;
29
+ default: string;
30
+ };
31
+ heightContainer: {
32
+ type: PropType<string>;
33
+ default: string;
34
+ };
35
+ data: {
36
+ type: PropType<ChartData<keyof chart_js.ChartTypeRegistry, (number | [number, number] | chart_js.Point | chart_js.BubbleDataPoint | null)[], unknown>>;
37
+ default: () => {
38
+ labels: string;
39
+ dataSets: never[];
40
+ };
41
+ };
42
+ options: {
43
+ type: PropType<chart_js_dist_types_utils._DeepPartialObject<chart_js.CoreChartOptions<keyof chart_js.ChartTypeRegistry> & chart_js.ElementChartOptions<keyof chart_js.ChartTypeRegistry> & chart_js.PluginChartOptions<keyof chart_js.ChartTypeRegistry> & chart_js.DatasetChartOptions<keyof chart_js.ChartTypeRegistry> & chart_js.ScaleChartOptions<keyof chart_js.ChartTypeRegistry>>>;
44
+ default: () => void;
45
+ };
46
+ colorPattern: {
47
+ type: PropType<string>;
48
+ default: string;
49
+ };
50
+ colorStart: {
51
+ type: PropType<number>;
52
+ default: number;
53
+ };
54
+ colorRatio: {
55
+ type: PropType<number>;
56
+ default: number;
57
+ };
58
+ legendPosition: {
59
+ type: PropType<string>;
60
+ default: string;
61
+ };
62
+ legendDirection: {
63
+ type: PropType<string>;
64
+ default: string;
65
+ };
66
+ tooltipMarginTop: {
67
+ type: PropType<number>;
68
+ default: number;
69
+ };
70
+ tooltipMarginLeft: {
71
+ type: PropType<number>;
72
+ default: number;
73
+ };
74
+ tooltipOptions: {
75
+ type: ObjectConstructor;
76
+ default: () => {
77
+ offsetTop: number;
78
+ offsetLeft: number;
79
+ };
80
+ };
81
+ isShowLegend: {
82
+ type: PropType<boolean>;
83
+ default: boolean;
84
+ };
85
+ isShowTooltip: {
86
+ type: PropType<boolean>;
87
+ default: boolean;
88
+ };
89
+ isShowDataLabels: {
90
+ type: PropType<boolean>;
91
+ default: boolean;
92
+ };
93
+ isHorizontal: {
94
+ type: PropType<boolean>;
95
+ default: boolean;
96
+ };
97
+ isStacked: {
98
+ type: PropType<boolean>;
99
+ default: boolean;
100
+ };
101
+ isArea: {
102
+ type: PropType<boolean>;
103
+ default: boolean;
104
+ };
105
+ isDebug: {
106
+ type: PropType<boolean>;
107
+ default: boolean;
108
+ };
109
+ isShowBackgroundHover: {
110
+ type: PropType<boolean>;
111
+ default: boolean;
112
+ };
113
+ isShowGaugePointer: {
114
+ type: PropType<boolean>;
115
+ default: boolean;
116
+ };
117
+ isMixedChart: {
118
+ type: PropType<boolean>;
119
+ default: boolean;
120
+ };
121
+ };
122
+ declare const chartEmit: readonly ["show-tooltip", "hide-tooltip", "click-legend"];
123
+ type ChartProps = ExtractPropTypes<typeof chartProps>;
124
+ type ChartEmit = (event: (typeof chartEmit)[number], value?: unknown, value2?: unknown) => void;
125
+
126
+ export { ChartEmit, ChartProps, chartEmit, chartProps };
@@ -0,0 +1,126 @@
1
+ import * as chart_js_dist_types_utils from 'chart.js/dist/types/utils';
2
+ import * as chart_js from 'chart.js';
3
+ import { ChartData } from 'chart.js';
4
+ import { PropType, ExtractPropTypes } from 'vue';
5
+
6
+ declare const chartProps: {
7
+ id: {
8
+ type: PropType<string>;
9
+ default: string;
10
+ };
11
+ title: {
12
+ type: PropType<string>;
13
+ default: string;
14
+ };
15
+ type: {
16
+ type: PropType<keyof chart_js.ChartTypeRegistry>;
17
+ default: string;
18
+ };
19
+ widthChart: {
20
+ type: PropType<string>;
21
+ default: string;
22
+ };
23
+ heightChart: {
24
+ type: PropType<string>;
25
+ default: string;
26
+ };
27
+ widthContainer: {
28
+ type: PropType<string>;
29
+ default: string;
30
+ };
31
+ heightContainer: {
32
+ type: PropType<string>;
33
+ default: string;
34
+ };
35
+ data: {
36
+ type: PropType<ChartData<keyof chart_js.ChartTypeRegistry, (number | [number, number] | chart_js.Point | chart_js.BubbleDataPoint | null)[], unknown>>;
37
+ default: () => {
38
+ labels: string;
39
+ dataSets: never[];
40
+ };
41
+ };
42
+ options: {
43
+ type: PropType<chart_js_dist_types_utils._DeepPartialObject<chart_js.CoreChartOptions<keyof chart_js.ChartTypeRegistry> & chart_js.ElementChartOptions<keyof chart_js.ChartTypeRegistry> & chart_js.PluginChartOptions<keyof chart_js.ChartTypeRegistry> & chart_js.DatasetChartOptions<keyof chart_js.ChartTypeRegistry> & chart_js.ScaleChartOptions<keyof chart_js.ChartTypeRegistry>>>;
44
+ default: () => void;
45
+ };
46
+ colorPattern: {
47
+ type: PropType<string>;
48
+ default: string;
49
+ };
50
+ colorStart: {
51
+ type: PropType<number>;
52
+ default: number;
53
+ };
54
+ colorRatio: {
55
+ type: PropType<number>;
56
+ default: number;
57
+ };
58
+ legendPosition: {
59
+ type: PropType<string>;
60
+ default: string;
61
+ };
62
+ legendDirection: {
63
+ type: PropType<string>;
64
+ default: string;
65
+ };
66
+ tooltipMarginTop: {
67
+ type: PropType<number>;
68
+ default: number;
69
+ };
70
+ tooltipMarginLeft: {
71
+ type: PropType<number>;
72
+ default: number;
73
+ };
74
+ tooltipOptions: {
75
+ type: ObjectConstructor;
76
+ default: () => {
77
+ offsetTop: number;
78
+ offsetLeft: number;
79
+ };
80
+ };
81
+ isShowLegend: {
82
+ type: PropType<boolean>;
83
+ default: boolean;
84
+ };
85
+ isShowTooltip: {
86
+ type: PropType<boolean>;
87
+ default: boolean;
88
+ };
89
+ isShowDataLabels: {
90
+ type: PropType<boolean>;
91
+ default: boolean;
92
+ };
93
+ isHorizontal: {
94
+ type: PropType<boolean>;
95
+ default: boolean;
96
+ };
97
+ isStacked: {
98
+ type: PropType<boolean>;
99
+ default: boolean;
100
+ };
101
+ isArea: {
102
+ type: PropType<boolean>;
103
+ default: boolean;
104
+ };
105
+ isDebug: {
106
+ type: PropType<boolean>;
107
+ default: boolean;
108
+ };
109
+ isShowBackgroundHover: {
110
+ type: PropType<boolean>;
111
+ default: boolean;
112
+ };
113
+ isShowGaugePointer: {
114
+ type: PropType<boolean>;
115
+ default: boolean;
116
+ };
117
+ isMixedChart: {
118
+ type: PropType<boolean>;
119
+ default: boolean;
120
+ };
121
+ };
122
+ declare const chartEmit: readonly ["show-tooltip", "hide-tooltip", "click-legend"];
123
+ type ChartProps = ExtractPropTypes<typeof chartProps>;
124
+ type ChartEmit = (event: (typeof chartEmit)[number], value?: unknown, value2?: unknown) => void;
125
+
126
+ export { ChartEmit, ChartProps, chartEmit, chartProps };
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/modules/chart.props.ts
21
+ var chart_props_exports = {};
22
+ __export(chart_props_exports, {
23
+ chartEmit: () => chartEmit,
24
+ chartProps: () => chartProps
25
+ });
26
+ module.exports = __toCommonJS(chart_props_exports);
27
+ var chartProps = {
28
+ id: {
29
+ type: String,
30
+ default: ""
31
+ },
32
+ title: {
33
+ type: String,
34
+ default: ""
35
+ },
36
+ type: {
37
+ type: String,
38
+ default: "bar"
39
+ },
40
+ widthChart: {
41
+ type: String,
42
+ default: "100%"
43
+ },
44
+ heightChart: {
45
+ type: String,
46
+ default: "256px"
47
+ },
48
+ widthContainer: {
49
+ type: String,
50
+ default: "100%"
51
+ },
52
+ heightContainer: {
53
+ type: String,
54
+ default: "100%"
55
+ },
56
+ data: {
57
+ type: Object,
58
+ default: () => {
59
+ return {
60
+ labels: "",
61
+ dataSets: []
62
+ };
63
+ }
64
+ },
65
+ options: {
66
+ type: Object,
67
+ default: () => {
68
+ }
69
+ },
70
+ colorPattern: {
71
+ type: String,
72
+ default: "categorical"
73
+ },
74
+ colorStart: {
75
+ type: Number,
76
+ default: 1
77
+ },
78
+ colorRatio: {
79
+ type: Number,
80
+ default: 0.2
81
+ },
82
+ legendPosition: {
83
+ type: String,
84
+ default: "bottom"
85
+ },
86
+ legendDirection: {
87
+ type: String,
88
+ default: "left"
89
+ },
90
+ tooltipMarginTop: {
91
+ type: Number,
92
+ default: 0
93
+ },
94
+ tooltipMarginLeft: {
95
+ type: Number,
96
+ default: 0
97
+ },
98
+ tooltipOptions: {
99
+ type: Object,
100
+ default: () => {
101
+ return {
102
+ offsetTop: 0,
103
+ offsetLeft: 0
104
+ };
105
+ }
106
+ },
107
+ isShowLegend: {
108
+ type: Boolean,
109
+ default: true
110
+ },
111
+ isShowTooltip: {
112
+ type: Boolean,
113
+ default: true
114
+ },
115
+ isShowDataLabels: {
116
+ type: Boolean,
117
+ default: false
118
+ },
119
+ isHorizontal: {
120
+ type: Boolean,
121
+ default: false
122
+ },
123
+ isStacked: {
124
+ type: Boolean,
125
+ default: false
126
+ },
127
+ isArea: {
128
+ type: Boolean,
129
+ default: false
130
+ },
131
+ isDebug: {
132
+ type: Boolean,
133
+ default: false
134
+ },
135
+ isShowBackgroundHover: {
136
+ type: Boolean,
137
+ default: false
138
+ },
139
+ isShowGaugePointer: {
140
+ type: Boolean,
141
+ default: false
142
+ },
143
+ isMixedChart: {
144
+ type: Boolean,
145
+ default: false
146
+ }
147
+ };
148
+ var chartEmit = ["show-tooltip", "hide-tooltip", "click-legend"];
149
+ // Annotate the CommonJS export names for ESM import in node:
150
+ 0 && (module.exports = {
151
+ chartEmit,
152
+ chartProps
153
+ });
@@ -0,0 +1,9 @@
1
+ import {
2
+ chartEmit,
3
+ chartProps
4
+ } from "../chunk-4Y625OEJ.mjs";
5
+ import "../chunk-QZ7VFGWC.mjs";
6
+ export {
7
+ chartEmit,
8
+ chartProps
9
+ };
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@mekari/pixel3-chart",
3
+ "description": "Chart component for mekari pixel 3",
4
+ "version": "0.0.1-dev.0",
5
+ "main": "dist/index.js",
6
+ "license": "MIT",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "dependencies": {
11
+ "chart.js": "^4.4.2",
12
+ "chartjs-plugin-datalabels": "^2.2.0",
13
+ "color": "^4.2.3",
14
+ "lodash-es": "^4.17.21",
15
+ "@mekari/pixel3-styled-system": "0.0.8-dev.0",
16
+ "@mekari/pixel3-text": "0.0.10-dev.0",
17
+ "@mekari/pixel3-utils": "0.0.6-dev.0"
18
+ },
19
+ "peerDependencies": {
20
+ "vue": "^3.4.9"
21
+ },
22
+ "devDependencies": {
23
+ "@types/color": "^3.0.6",
24
+ "@types/lodash-es": "^4.17.12",
25
+ "vue": "^3.4.9"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "module": "dist/index.mjs",
31
+ "types": "dist/index.d.ts",
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/index.d.ts",
35
+ "require": "./dist/index.js",
36
+ "default": "./dist/index.mjs"
37
+ }
38
+ },
39
+ "scripts": {
40
+ "clean": "rimraf dist .turbo",
41
+ "build": "tsup && pnpm build:types",
42
+ "build:fast": "tsup",
43
+ "build:types": "tsup src --dts-only",
44
+ "types:check": "tsc --noEmit",
45
+ "replace-config": "clean-package",
46
+ "restore-config": "clean-package restore"
47
+ }
48
+ }