@nathapp/na-cli 1.0.8 → 1.0.10
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/dist/templates/db-schema/.gitlab-ci.yml +139 -0
- package/dist/templates/db-schema/Makefile +885 -0
- package/dist/templates/k8s-deployment/.gitlab-ci.yml +158 -0
- package/dist/templates/k8s-deployment/Makefile +233 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/script/Makefile +12 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/script/Makefile +8 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/script/Makefile +56 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/Makefile +9 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/script/Makefile +14 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/_t-0100-readiness-liveness.ts +84 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/hub.ts +372 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contact.ts +158 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contract.ts +328 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-kyc.ts +304 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-app.ts +823 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-web.ts +493 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-profile.ts +277 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-whitelist.ts +133 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/t-0200-start.ts +172 -0
- package/dist/templates/nestjs-api/.dockerignore +9 -0
- package/dist/templates/nestjs-api/.env +35 -0
- package/dist/templates/nestjs-api/.env.local +5 -29
- package/dist/templates/nestjs-api/.gitlab-ci.yml +180 -0
- package/dist/templates/nestjs-api/.nvmrc +1 -0
- package/dist/templates/nestjs-api/.prettierrc +4 -0
- package/dist/templates/nestjs-api/Makefile +95 -0
- package/dist/templates/nestjs-api/README.md +15 -0
- package/dist/templates/nestjs-api/nest-cli.json +10 -0
- package/dist/templates/nestjs-api/ormconfig.ts +16 -0
- package/dist/templates/nestjs-api/package.json +9 -9
- package/dist/templates/nestjs-api/src/app.controller.spec.ts +24 -0
- package/dist/templates/nestjs-api/src/app.controller.ts +27 -0
- package/dist/templates/nestjs-api/src/app.module.ts +33 -0
- package/dist/templates/nestjs-api/src/app.service.ts +27 -0
- package/dist/templates/nestjs-api/src/main.ts +31 -0
- package/dist/templates/nestjs-api/test/app.e2e-spec.ts +47 -0
- package/dist/templates/nestjs-api/tsconfig.build.json +5 -0
- package/dist/templates/nestjs-api/tsconfig.json +28 -0
- package/dist/templates/nestjs-api/tsconfig.spec.json +9 -0
- package/dist/templates/nestjs-library/.gitlab-ci.yml +134 -0
- package/dist/templates/nestjs-library/.nvmrc +1 -0
- package/dist/templates/nestjs-library/.prettierrc +6 -0
- package/dist/templates/nestjs-library/Makefile +60 -0
- package/dist/templates/nestjs-library/lib/index.ts +2 -0
- package/dist/templates/nestjs-library/test/app/controller/hello.controller.spec.ts +20 -0
- package/dist/templates/nestjs-library/test/app/controller/hello.controller.ts +7 -0
- package/dist/templates/nestjs-library/tsconfig.build.json +8 -0
- package/dist/templates/nestjs-library/tsconfig.json +21 -0
- package/dist/templates/nestjs-library/tsconfig.spec.json +9 -0
- package/dist/templates/ts-library/.dockerignore +2 -0
- package/dist/templates/ts-library/.eslintrc.js +24 -0
- package/dist/templates/ts-library/.gitlab-ci.yml +136 -0
- package/dist/templates/ts-library/.prettierrc +6 -0
- package/dist/templates/ts-library/Makefile +58 -0
- package/dist/templates/ts-library/index.ts +1 -0
- package/dist/templates/ts-library/lib/index.ts +1 -0
- package/dist/templates/ts-library/lib/samples/index.ts +5 -0
- package/dist/templates/ts-library/lib/samples/samples-function.ts +3 -0
- package/dist/templates/ts-library/test/sample.e2e-spec.ts +10 -0
- package/dist/templates/ts-library/tsconfig.build.json +4 -0
- package/dist/templates/ts-library/tsconfig.json +18 -0
- package/dist/templates/turbo-nestjs-vuexy/.dockerignore +2 -0
- package/dist/templates/turbo-nestjs-vuexy/.gitignore-rename +40 -0
- package/dist/templates/turbo-nestjs-vuexy/.npmrc-rename +0 -0
- package/dist/templates/turbo-nestjs-vuexy/Makefile +48 -0
- package/dist/templates/vuexy-portal/.dockerignore +2 -0
- package/dist/templates/vuexy-portal/.env +1 -0
- package/dist/templates/vuexy-portal/.gitlab-ci.yml +233 -0
- package/dist/templates/vuexy-portal/.npmrc-rename +2 -0
- package/dist/templates/vuexy-portal/.nvmrc +1 -0
- package/dist/templates/vuexy-portal/Makefile +55 -0
- package/dist/templates/vuexy-portal/src/@core/composable/createUrl.ts +20 -0
- package/dist/templates/vuexy-portal/src/@core/composable/useCookie.ts +43 -0
- package/dist/templates/vuexy-portal/src/@core/composable/useGenerateImageVariant.ts +25 -0
- package/dist/templates/vuexy-portal/src/@core/composable/useResponsiveSidebar.ts +29 -0
- package/dist/templates/vuexy-portal/src/@core/composable/useSkins.ts +42 -0
- package/dist/templates/vuexy-portal/src/@core/enums.ts +21 -0
- package/dist/templates/vuexy-portal/src/@core/index.ts +43 -0
- package/dist/templates/vuexy-portal/src/@core/initCore.ts +93 -0
- package/dist/templates/vuexy-portal/src/@core/libs/apex-chart/apexCharConfig.ts +701 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/chartjsConfig.ts +372 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/BarChart.ts +58 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/BubbleChart.ts +58 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/DoughnutChart.ts +58 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/LineChart.ts +58 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/PolarAreaChart.ts +58 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/RadarChart.ts +58 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/ScatterChart.ts +58 -0
- package/dist/templates/vuexy-portal/src/@core/stores/config.ts +80 -0
- package/dist/templates/vuexy-portal/src/@core/types.ts +49 -0
- package/dist/templates/vuexy-portal/src/@core/utils/formatters.ts +48 -0
- package/dist/templates/vuexy-portal/src/@core/utils/helpers.ts +32 -0
- package/dist/templates/vuexy-portal/src/@core/utils/plugins.ts +53 -0
- package/dist/templates/vuexy-portal/src/@core/utils/validators.ts +105 -0
- package/dist/templates/vuexy-portal/src/@core/utils/vuetify.ts +13 -0
- package/dist/templates/vuexy-portal/src/@custom/composables/toasts.ts +45 -0
- package/dist/templates/vuexy-portal/src/@custom/composables/validator.ts +160 -0
- package/dist/templates/vuexy-portal/src/@custom/enums/index.ts +0 -0
- package/dist/templates/vuexy-portal/src/@custom/types/common.ts +17 -0
- package/dist/templates/vuexy-portal/src/@custom/types/index.ts +0 -0
- package/dist/templates/vuexy-portal/src/@custom/types/pagination.ts +19 -0
- package/dist/templates/vuexy-portal/src/@custom/types/user.ts +5 -0
- package/dist/templates/vuexy-portal/src/@custom/utils/formatters.ts +83 -0
- package/dist/templates/vuexy-portal/src/@custom/utils/index.ts +0 -0
- package/dist/templates/vuexy-portal/src/@custom/utils/validators.ts +51 -0
- package/dist/templates/vuexy-portal/src/@layouts/components.ts +11 -0
- package/dist/templates/vuexy-portal/src/@layouts/config.ts +43 -0
- package/dist/templates/vuexy-portal/src/@layouts/enums.ts +27 -0
- package/dist/templates/vuexy-portal/src/@layouts/index.ts +49 -0
- package/dist/templates/vuexy-portal/src/@layouts/plugins/casl.ts +48 -0
- package/dist/templates/vuexy-portal/src/@layouts/stores/config.ts +115 -0
- package/dist/templates/vuexy-portal/src/@layouts/symbols.ts +1 -0
- package/dist/templates/vuexy-portal/src/@layouts/types.ts +126 -0
- package/dist/templates/vuexy-portal/src/@layouts/utils.ts +180 -0
- package/dist/templates/vuexy-portal/src/api/api.ts +1 -0
- package/dist/templates/vuexy-portal/src/api/commonApi.ts +25 -0
- package/dist/templates/vuexy-portal/src/api/index.ts +58 -0
- package/dist/templates/vuexy-portal/src/api/requestInterceptor.ts +21 -0
- package/dist/templates/vuexy-portal/src/api/responseInterceptor.ts +52 -0
- package/dist/templates/vuexy-portal/src/api/types.ts +14 -0
- package/dist/templates/vuexy-portal/src/api/useApi.ts +68 -0
- package/dist/templates/vuexy-portal/src/api/useFetchApi.ts +41 -0
- package/dist/templates/vuexy-portal/src/api/userApi.ts +11 -0
- package/dist/templates/vuexy-portal/src/composables/useApiFetch.ts +48 -0
- package/dist/templates/vuexy-portal/src/composables/useJwt.ts +108 -0
- package/dist/templates/vuexy-portal/src/main.ts +17 -0
- package/dist/templates/vuexy-portal/src/navigation/horizontal/index.ts +5 -0
- package/dist/templates/vuexy-portal/src/navigation/index.ts +7 -0
- package/dist/templates/vuexy-portal/src/navigation/vertical/index.ts +5 -0
- package/dist/templates/vuexy-portal/src/plugins/1.router/additional-routes.ts +23 -0
- package/dist/templates/vuexy-portal/src/plugins/1.router/guards.ts +50 -0
- package/dist/templates/vuexy-portal/src/plugins/1.router/index.ts +45 -0
- package/dist/templates/vuexy-portal/src/plugins/2.pinia.ts +8 -0
- package/dist/templates/vuexy-portal/src/plugins/casl/ability.ts +10 -0
- package/dist/templates/vuexy-portal/src/plugins/casl/composables/useAbility.ts +4 -0
- package/dist/templates/vuexy-portal/src/plugins/casl/index.ts +14 -0
- package/dist/templates/vuexy-portal/src/plugins/i18n/index.ts +29 -0
- package/dist/templates/vuexy-portal/src/plugins/iconify/build-icons.ts +299 -0
- package/dist/templates/vuexy-portal/src/plugins/iconify/index.ts +5 -0
- package/dist/templates/vuexy-portal/src/plugins/layouts.ts +13 -0
- package/dist/templates/vuexy-portal/src/plugins/toast/index.ts +9 -0
- package/dist/templates/vuexy-portal/src/plugins/vuetify/defaults.ts +192 -0
- package/dist/templates/vuexy-portal/src/plugins/vuetify/icons.ts +84 -0
- package/dist/templates/vuexy-portal/src/plugins/vuetify/index.ts +47 -0
- package/dist/templates/vuexy-portal/src/plugins/vuetify/theme.ts +155 -0
- package/dist/templates/vuexy-portal/src/plugins/webfontloader.ts +19 -0
- package/dist/templates/vuexy-portal/src/stores/auth.ts +22 -0
- package/dist/templates/vuexy-portal/src/stores/common.ts +41 -0
- package/dist/templates/vuexy-portal/src/stores/index.ts +0 -0
- package/dist/templates/vuexy-portal/src/utils/constants.ts +3 -0
- package/dist/templates/vuexy-portal/src/utils/paginationMeta.ts +10 -0
- package/dist/templates/vuexy-portal/themeConfig.ts +66 -0
- package/dist/templates/vuexy-portal/tsconfig.json +86 -0
- package/dist/templates/vuexy-portal/vite.config.ts +111 -0
- package/dist/utils/jwt-keys.js +26 -0
- package/dist/utils/jwt-keys.js.map +1 -0
- package/dist/utils/template.js +4 -1
- package/dist/utils/template.js.map +1 -1
- package/package.json +4 -1
- package/alias-script.sh +0 -30
- package/bunfig.toml +0 -3
- package/nax/config.json +0 -23
- package/nax/features/enhancements/prd.json +0 -61
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import type { ThemeInstance } from 'vuetify'
|
|
2
|
+
import { hexToRgb } from '@layouts/utils'
|
|
3
|
+
|
|
4
|
+
// 👉 Colors variables
|
|
5
|
+
const colorVariables = (themeColors: ThemeInstance['themes']['value']['colors']) => {
|
|
6
|
+
const themeSecondaryTextColor = `rgba(${hexToRgb(themeColors.colors['on-surface'])},${themeColors.variables['medium-emphasis-opacity']})`
|
|
7
|
+
const themeDisabledTextColor = `rgba(${hexToRgb(themeColors.colors['on-surface'])},${themeColors.variables['disabled-opacity']})`
|
|
8
|
+
const themeBorderColor = `rgba(${hexToRgb(String(themeColors.variables['border-color']))},${themeColors.variables['border-opacity']})`
|
|
9
|
+
|
|
10
|
+
return { labelColor: themeDisabledTextColor, borderColor: themeBorderColor, legendColor: themeSecondaryTextColor }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// SECTION config
|
|
14
|
+
|
|
15
|
+
// 👉 Latest Bar Chart Config
|
|
16
|
+
export const getLatestBarChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
|
|
17
|
+
const { borderColor, labelColor } = colorVariables(themeColors)
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
responsive: true,
|
|
21
|
+
maintainAspectRatio: false,
|
|
22
|
+
animation: { duration: 500 },
|
|
23
|
+
scales: {
|
|
24
|
+
x: {
|
|
25
|
+
grid: {
|
|
26
|
+
borderColor,
|
|
27
|
+
drawBorder: false,
|
|
28
|
+
color: borderColor,
|
|
29
|
+
},
|
|
30
|
+
ticks: { color: labelColor },
|
|
31
|
+
},
|
|
32
|
+
y: {
|
|
33
|
+
min: 0,
|
|
34
|
+
max: 400,
|
|
35
|
+
grid: {
|
|
36
|
+
borderColor,
|
|
37
|
+
drawBorder: false,
|
|
38
|
+
color: borderColor,
|
|
39
|
+
},
|
|
40
|
+
ticks: {
|
|
41
|
+
stepSize: 100,
|
|
42
|
+
color: labelColor,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
plugins: {
|
|
47
|
+
legend: { display: false },
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// 👉 Horizontal Bar Chart Config
|
|
53
|
+
export const getHorizontalBarChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
|
|
54
|
+
const { borderColor, labelColor, legendColor } = colorVariables(themeColors)
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
indexAxis: 'y',
|
|
58
|
+
responsive: true,
|
|
59
|
+
maintainAspectRatio: false,
|
|
60
|
+
animation: { duration: 500 },
|
|
61
|
+
elements: {
|
|
62
|
+
bar: {
|
|
63
|
+
borderRadius: {
|
|
64
|
+
topRight: 15,
|
|
65
|
+
bottomRight: 15,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
layout: {
|
|
70
|
+
padding: { top: -4 },
|
|
71
|
+
},
|
|
72
|
+
scales: {
|
|
73
|
+
x: {
|
|
74
|
+
min: 0,
|
|
75
|
+
grid: {
|
|
76
|
+
drawTicks: false,
|
|
77
|
+
drawBorder: false,
|
|
78
|
+
color: borderColor,
|
|
79
|
+
},
|
|
80
|
+
ticks: { color: labelColor },
|
|
81
|
+
},
|
|
82
|
+
y: {
|
|
83
|
+
grid: {
|
|
84
|
+
borderColor,
|
|
85
|
+
display: false,
|
|
86
|
+
drawBorder: false,
|
|
87
|
+
},
|
|
88
|
+
ticks: { color: labelColor },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
plugins: {
|
|
92
|
+
legend: {
|
|
93
|
+
align: 'end',
|
|
94
|
+
position: 'top',
|
|
95
|
+
labels: { color: legendColor },
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// 👉 Line Chart Config
|
|
102
|
+
export const getLineChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
|
|
103
|
+
const { borderColor, labelColor, legendColor } = colorVariables(themeColors)
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
responsive: true,
|
|
107
|
+
maintainAspectRatio: false,
|
|
108
|
+
scales: {
|
|
109
|
+
x: {
|
|
110
|
+
ticks: { color: labelColor },
|
|
111
|
+
grid: {
|
|
112
|
+
borderColor,
|
|
113
|
+
drawBorder: false,
|
|
114
|
+
color: borderColor,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
y: {
|
|
118
|
+
min: 0,
|
|
119
|
+
max: 400,
|
|
120
|
+
ticks: {
|
|
121
|
+
stepSize: 100,
|
|
122
|
+
color: labelColor,
|
|
123
|
+
},
|
|
124
|
+
grid: {
|
|
125
|
+
borderColor,
|
|
126
|
+
drawBorder: false,
|
|
127
|
+
color: borderColor,
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
plugins: {
|
|
132
|
+
legend: {
|
|
133
|
+
align: 'end',
|
|
134
|
+
position: 'top',
|
|
135
|
+
labels: {
|
|
136
|
+
padding: 25,
|
|
137
|
+
boxWidth: 10,
|
|
138
|
+
color: legendColor,
|
|
139
|
+
usePointStyle: true,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// 👉 Radar Chart Config
|
|
147
|
+
export const getRadarChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
|
|
148
|
+
const { borderColor, labelColor, legendColor } = colorVariables(themeColors)
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
responsive: true,
|
|
152
|
+
maintainAspectRatio: false,
|
|
153
|
+
animation: { duration: 500 },
|
|
154
|
+
layout: {
|
|
155
|
+
padding: { top: -20 },
|
|
156
|
+
},
|
|
157
|
+
scales: {
|
|
158
|
+
r: {
|
|
159
|
+
ticks: {
|
|
160
|
+
display: false,
|
|
161
|
+
maxTicksLimit: 1,
|
|
162
|
+
color: labelColor,
|
|
163
|
+
},
|
|
164
|
+
grid: { color: borderColor },
|
|
165
|
+
pointLabels: { color: labelColor },
|
|
166
|
+
angleLines: { color: borderColor },
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
plugins: {
|
|
170
|
+
legend: {
|
|
171
|
+
position: 'top',
|
|
172
|
+
labels: {
|
|
173
|
+
padding: 25,
|
|
174
|
+
color: legendColor,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// 👉 Polar Chart Config
|
|
182
|
+
export const getPolarChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
|
|
183
|
+
const { legendColor } = colorVariables(themeColors)
|
|
184
|
+
|
|
185
|
+
return {
|
|
186
|
+
responsive: true,
|
|
187
|
+
maintainAspectRatio: false,
|
|
188
|
+
animation: { duration: 500 },
|
|
189
|
+
layout: {
|
|
190
|
+
padding: {
|
|
191
|
+
top: -5,
|
|
192
|
+
bottom: -45,
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
scales: {
|
|
196
|
+
r: {
|
|
197
|
+
grid: { display: false },
|
|
198
|
+
ticks: { display: false },
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
plugins: {
|
|
202
|
+
legend: {
|
|
203
|
+
position: 'right',
|
|
204
|
+
labels: {
|
|
205
|
+
padding: 25,
|
|
206
|
+
boxWidth: 9,
|
|
207
|
+
color: legendColor,
|
|
208
|
+
usePointStyle: true,
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// 👉 Bubble Chart Config
|
|
216
|
+
export const getBubbleChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
|
|
217
|
+
const { borderColor, labelColor } = colorVariables(themeColors)
|
|
218
|
+
|
|
219
|
+
return {
|
|
220
|
+
responsive: true,
|
|
221
|
+
maintainAspectRatio: false,
|
|
222
|
+
scales: {
|
|
223
|
+
x: {
|
|
224
|
+
min: 0,
|
|
225
|
+
max: 140,
|
|
226
|
+
grid: {
|
|
227
|
+
borderColor,
|
|
228
|
+
drawBorder: false,
|
|
229
|
+
color: borderColor,
|
|
230
|
+
},
|
|
231
|
+
ticks: {
|
|
232
|
+
stepSize: 10,
|
|
233
|
+
color: labelColor,
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
y: {
|
|
237
|
+
min: 0,
|
|
238
|
+
max: 400,
|
|
239
|
+
grid: {
|
|
240
|
+
borderColor,
|
|
241
|
+
drawBorder: false,
|
|
242
|
+
color: borderColor,
|
|
243
|
+
},
|
|
244
|
+
ticks: {
|
|
245
|
+
stepSize: 100,
|
|
246
|
+
color: labelColor,
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
plugins: {
|
|
251
|
+
legend: { display: false },
|
|
252
|
+
},
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// 👉 Doughnut Chart Config
|
|
257
|
+
export const getDoughnutChartConfig = () => {
|
|
258
|
+
return {
|
|
259
|
+
responsive: true,
|
|
260
|
+
maintainAspectRatio: false,
|
|
261
|
+
animation: { duration: 500 },
|
|
262
|
+
cutout: 80,
|
|
263
|
+
plugins: {
|
|
264
|
+
legend: {
|
|
265
|
+
display: false,
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// 👉 Scatter Chart Config
|
|
272
|
+
export const getScatterChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
|
|
273
|
+
const { borderColor, labelColor, legendColor } = colorVariables(themeColors)
|
|
274
|
+
|
|
275
|
+
return {
|
|
276
|
+
responsive: true,
|
|
277
|
+
maintainAspectRatio: false,
|
|
278
|
+
animation: { duration: 800 },
|
|
279
|
+
layout: {
|
|
280
|
+
padding: { top: -20 },
|
|
281
|
+
},
|
|
282
|
+
scales: {
|
|
283
|
+
x: {
|
|
284
|
+
min: 0,
|
|
285
|
+
max: 140,
|
|
286
|
+
grid: {
|
|
287
|
+
borderColor,
|
|
288
|
+
drawTicks: false,
|
|
289
|
+
drawBorder: false,
|
|
290
|
+
color: borderColor,
|
|
291
|
+
},
|
|
292
|
+
ticks: {
|
|
293
|
+
stepSize: 10,
|
|
294
|
+
color: labelColor,
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
y: {
|
|
298
|
+
min: 0,
|
|
299
|
+
max: 400,
|
|
300
|
+
grid: {
|
|
301
|
+
borderColor,
|
|
302
|
+
drawTicks: false,
|
|
303
|
+
drawBorder: false,
|
|
304
|
+
color: borderColor,
|
|
305
|
+
},
|
|
306
|
+
ticks: {
|
|
307
|
+
stepSize: 100,
|
|
308
|
+
color: labelColor,
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
plugins: {
|
|
313
|
+
legend: {
|
|
314
|
+
align: 'start',
|
|
315
|
+
position: 'top',
|
|
316
|
+
labels: {
|
|
317
|
+
padding: 25,
|
|
318
|
+
boxWidth: 9,
|
|
319
|
+
color: legendColor,
|
|
320
|
+
usePointStyle: true,
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// 👉 Line Area Chart Config
|
|
328
|
+
export const getLineAreaChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
|
|
329
|
+
const { borderColor, labelColor, legendColor } = colorVariables(themeColors)
|
|
330
|
+
|
|
331
|
+
return {
|
|
332
|
+
responsive: true,
|
|
333
|
+
maintainAspectRatio: false,
|
|
334
|
+
layout: {
|
|
335
|
+
padding: { top: -20 },
|
|
336
|
+
},
|
|
337
|
+
scales: {
|
|
338
|
+
x: {
|
|
339
|
+
grid: {
|
|
340
|
+
borderColor,
|
|
341
|
+
color: 'transparent',
|
|
342
|
+
},
|
|
343
|
+
ticks: { color: labelColor },
|
|
344
|
+
},
|
|
345
|
+
y: {
|
|
346
|
+
min: 0,
|
|
347
|
+
max: 400,
|
|
348
|
+
grid: {
|
|
349
|
+
borderColor,
|
|
350
|
+
color: 'transparent',
|
|
351
|
+
},
|
|
352
|
+
ticks: {
|
|
353
|
+
stepSize: 100,
|
|
354
|
+
color: labelColor,
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
plugins: {
|
|
359
|
+
legend: {
|
|
360
|
+
align: 'start',
|
|
361
|
+
position: 'top',
|
|
362
|
+
labels: {
|
|
363
|
+
padding: 25,
|
|
364
|
+
boxWidth: 9,
|
|
365
|
+
color: legendColor,
|
|
366
|
+
usePointStyle: true,
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
// !SECTION
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { PluginOptionsByType } from 'chart.js'
|
|
2
|
+
import { BarElement, CategoryScale, Chart as ChartJS, Legend, LinearScale, Title, Tooltip } from 'chart.js'
|
|
3
|
+
import type { PropType } from 'vue'
|
|
4
|
+
import { defineComponent } from 'vue'
|
|
5
|
+
import { Bar } from 'vue-chartjs'
|
|
6
|
+
|
|
7
|
+
ChartJS.register(Title, Tooltip, Legend, BarElement, CategoryScale, LinearScale)
|
|
8
|
+
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
name: 'BarChart',
|
|
11
|
+
props: {
|
|
12
|
+
chartId: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: 'bar-chart',
|
|
15
|
+
},
|
|
16
|
+
width: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 400,
|
|
19
|
+
},
|
|
20
|
+
height: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 400,
|
|
23
|
+
},
|
|
24
|
+
cssClasses: {
|
|
25
|
+
default: '',
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
styles: {
|
|
29
|
+
type: Object as PropType<Partial<CSSStyleDeclaration>>,
|
|
30
|
+
default: () => ({}),
|
|
31
|
+
},
|
|
32
|
+
plugins: {
|
|
33
|
+
type: Array as PropType<PluginOptionsByType<'bar'>[]>,
|
|
34
|
+
default: () => ([]),
|
|
35
|
+
},
|
|
36
|
+
chartData: {
|
|
37
|
+
type: Object,
|
|
38
|
+
default: () => ({}),
|
|
39
|
+
},
|
|
40
|
+
chartOptions: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: () => ({}),
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
setup(props) {
|
|
46
|
+
return () =>
|
|
47
|
+
h(h(Bar), {
|
|
48
|
+
data: props.chartData,
|
|
49
|
+
options: props.chartOptions,
|
|
50
|
+
chartId: props.chartId,
|
|
51
|
+
width: props.width,
|
|
52
|
+
height: props.height,
|
|
53
|
+
cssClasses: props.cssClasses,
|
|
54
|
+
styles: props.styles,
|
|
55
|
+
plugins: props.plugins,
|
|
56
|
+
})
|
|
57
|
+
},
|
|
58
|
+
})
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { PluginOptionsByType } from 'chart.js'
|
|
2
|
+
import { Chart as ChartJS, Legend, LinearScale, PointElement, Title, Tooltip } from 'chart.js'
|
|
3
|
+
import type { PropType } from 'vue'
|
|
4
|
+
import { defineComponent } from 'vue'
|
|
5
|
+
import { Bubble } from 'vue-chartjs'
|
|
6
|
+
|
|
7
|
+
ChartJS.register(Title, Tooltip, Legend, PointElement, LinearScale)
|
|
8
|
+
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
name: 'BubbleChart',
|
|
11
|
+
props: {
|
|
12
|
+
chartId: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: 'bubble-chart',
|
|
15
|
+
},
|
|
16
|
+
width: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 400,
|
|
19
|
+
},
|
|
20
|
+
height: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 400,
|
|
23
|
+
},
|
|
24
|
+
cssClasses: {
|
|
25
|
+
default: '',
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
styles: {
|
|
29
|
+
type: Object as PropType<Partial<CSSStyleDeclaration>>,
|
|
30
|
+
default: () => ({}),
|
|
31
|
+
},
|
|
32
|
+
plugins: {
|
|
33
|
+
type: Array as PropType<PluginOptionsByType<'bubble'>[]>,
|
|
34
|
+
default: () => [],
|
|
35
|
+
},
|
|
36
|
+
chartData: {
|
|
37
|
+
type: Object,
|
|
38
|
+
default: () => ({}),
|
|
39
|
+
},
|
|
40
|
+
chartOptions: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: () => ({}),
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
setup(props) {
|
|
46
|
+
return () =>
|
|
47
|
+
h(h(Bubble), {
|
|
48
|
+
data: props.chartData,
|
|
49
|
+
options: props.chartOptions,
|
|
50
|
+
chartId: props.chartId,
|
|
51
|
+
width: props.width,
|
|
52
|
+
height: props.height,
|
|
53
|
+
cssClasses: props.cssClasses,
|
|
54
|
+
styles: props.styles,
|
|
55
|
+
plugins: props.plugins,
|
|
56
|
+
})
|
|
57
|
+
},
|
|
58
|
+
})
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { PluginOptionsByType } from 'chart.js'
|
|
2
|
+
import { ArcElement, CategoryScale, Chart as ChartJS, Legend, Title, Tooltip } from 'chart.js'
|
|
3
|
+
import type { PropType } from 'vue'
|
|
4
|
+
import { defineComponent } from 'vue'
|
|
5
|
+
import { Doughnut } from 'vue-chartjs'
|
|
6
|
+
|
|
7
|
+
ChartJS.register(Title, Tooltip, Legend, ArcElement, CategoryScale)
|
|
8
|
+
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
name: 'DoughnutChart',
|
|
11
|
+
props: {
|
|
12
|
+
chartId: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: 'doughnut-chart',
|
|
15
|
+
},
|
|
16
|
+
width: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 400,
|
|
19
|
+
},
|
|
20
|
+
height: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 400,
|
|
23
|
+
},
|
|
24
|
+
cssClasses: {
|
|
25
|
+
default: '',
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
styles: {
|
|
29
|
+
type: Object as PropType<Partial<CSSStyleDeclaration>>,
|
|
30
|
+
default: () => ({}),
|
|
31
|
+
},
|
|
32
|
+
plugins: {
|
|
33
|
+
type: Array as PropType<PluginOptionsByType<'doughnut'>[]>,
|
|
34
|
+
default: () => [],
|
|
35
|
+
},
|
|
36
|
+
chartData: {
|
|
37
|
+
type: Object,
|
|
38
|
+
default: () => ({}),
|
|
39
|
+
},
|
|
40
|
+
chartOptions: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: () => ({}),
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
setup(props) {
|
|
46
|
+
return () =>
|
|
47
|
+
h(h(Doughnut), {
|
|
48
|
+
data: props.chartData,
|
|
49
|
+
options: props.chartOptions,
|
|
50
|
+
chartId: props.chartId,
|
|
51
|
+
width: props.width,
|
|
52
|
+
height: props.height,
|
|
53
|
+
cssClasses: props.cssClasses,
|
|
54
|
+
styles: props.styles,
|
|
55
|
+
plugins: props.plugins,
|
|
56
|
+
})
|
|
57
|
+
},
|
|
58
|
+
})
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { PluginOptionsByType } from 'chart.js'
|
|
2
|
+
import { CategoryScale, Chart as ChartJS, Legend, LineElement, LinearScale, PointElement, Title, Tooltip } from 'chart.js'
|
|
3
|
+
import type { PropType } from 'vue'
|
|
4
|
+
import { defineComponent } from 'vue'
|
|
5
|
+
import { Line } from 'vue-chartjs'
|
|
6
|
+
|
|
7
|
+
ChartJS.register(Title, Tooltip, Legend, LineElement, LinearScale, PointElement, CategoryScale)
|
|
8
|
+
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
name: 'LineChart',
|
|
11
|
+
props: {
|
|
12
|
+
chartId: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: 'line-chart',
|
|
15
|
+
},
|
|
16
|
+
width: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 400,
|
|
19
|
+
},
|
|
20
|
+
height: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 400,
|
|
23
|
+
},
|
|
24
|
+
cssClasses: {
|
|
25
|
+
default: '',
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
styles: {
|
|
29
|
+
type: Object as PropType<Partial<CSSStyleDeclaration>>,
|
|
30
|
+
default: () => ({}),
|
|
31
|
+
},
|
|
32
|
+
plugins: {
|
|
33
|
+
type: Array as PropType<PluginOptionsByType<'line'>[]>,
|
|
34
|
+
default: () => [],
|
|
35
|
+
},
|
|
36
|
+
chartData: {
|
|
37
|
+
type: Object,
|
|
38
|
+
default: () => ({}),
|
|
39
|
+
},
|
|
40
|
+
chartOptions: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: () => ({}),
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
setup(props) {
|
|
46
|
+
return () =>
|
|
47
|
+
h(h(Line), {
|
|
48
|
+
chartId: props.chartId,
|
|
49
|
+
width: props.width,
|
|
50
|
+
height: props.height,
|
|
51
|
+
cssClasses: props.cssClasses,
|
|
52
|
+
styles: props.styles,
|
|
53
|
+
plugins: props.plugins,
|
|
54
|
+
options: props.chartOptions,
|
|
55
|
+
data: props.chartData,
|
|
56
|
+
})
|
|
57
|
+
},
|
|
58
|
+
})
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { PluginOptionsByType } from 'chart.js'
|
|
2
|
+
import { ArcElement, Chart as ChartJS, Legend, RadialLinearScale, Title, Tooltip } from 'chart.js'
|
|
3
|
+
import type { PropType } from 'vue'
|
|
4
|
+
import { defineComponent } from 'vue'
|
|
5
|
+
import { PolarArea } from 'vue-chartjs'
|
|
6
|
+
|
|
7
|
+
ChartJS.register(Title, Tooltip, Legend, ArcElement, RadialLinearScale)
|
|
8
|
+
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
name: 'PolarAreaChart',
|
|
11
|
+
props: {
|
|
12
|
+
chartId: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: 'line-chart',
|
|
15
|
+
},
|
|
16
|
+
width: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 400,
|
|
19
|
+
},
|
|
20
|
+
height: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 400,
|
|
23
|
+
},
|
|
24
|
+
cssClasses: {
|
|
25
|
+
default: '',
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
styles: {
|
|
29
|
+
type: Object as PropType<Partial<CSSStyleDeclaration>>,
|
|
30
|
+
default: () => ({}),
|
|
31
|
+
},
|
|
32
|
+
plugins: {
|
|
33
|
+
type: Array as PropType<PluginOptionsByType<'polarArea'>[]>,
|
|
34
|
+
default: () => [],
|
|
35
|
+
},
|
|
36
|
+
chartData: {
|
|
37
|
+
type: Object,
|
|
38
|
+
default: () => ({}),
|
|
39
|
+
},
|
|
40
|
+
chartOptions: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: () => ({}),
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
setup(props) {
|
|
46
|
+
return () =>
|
|
47
|
+
h(h(PolarArea), {
|
|
48
|
+
data: props.chartData,
|
|
49
|
+
options: props.chartOptions,
|
|
50
|
+
chartId: props.chartId,
|
|
51
|
+
width: props.width,
|
|
52
|
+
height: props.height,
|
|
53
|
+
cssClasses: props.cssClasses,
|
|
54
|
+
styles: props.styles,
|
|
55
|
+
plugins: props.plugins,
|
|
56
|
+
})
|
|
57
|
+
},
|
|
58
|
+
})
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { PluginOptionsByType } from 'chart.js'
|
|
2
|
+
import { Chart as ChartJS, Filler, Legend, LineElement, PointElement, RadialLinearScale, Title, Tooltip } from 'chart.js'
|
|
3
|
+
import type { PropType } from 'vue'
|
|
4
|
+
import { defineComponent } from 'vue'
|
|
5
|
+
import { Radar } from 'vue-chartjs'
|
|
6
|
+
|
|
7
|
+
ChartJS.register(Title, Tooltip, Legend, PointElement, RadialLinearScale, LineElement, Filler)
|
|
8
|
+
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
name: 'RadarChart',
|
|
11
|
+
props: {
|
|
12
|
+
chartId: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: 'radar-chart',
|
|
15
|
+
},
|
|
16
|
+
width: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 400,
|
|
19
|
+
},
|
|
20
|
+
height: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 400,
|
|
23
|
+
},
|
|
24
|
+
cssClasses: {
|
|
25
|
+
default: '',
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
styles: {
|
|
29
|
+
type: Object as PropType<Partial<CSSStyleDeclaration>>,
|
|
30
|
+
default: () => ({}),
|
|
31
|
+
},
|
|
32
|
+
plugins: {
|
|
33
|
+
type: Array as PropType<PluginOptionsByType<'radar'>[]>,
|
|
34
|
+
default: () => [],
|
|
35
|
+
},
|
|
36
|
+
chartData: {
|
|
37
|
+
type: Object,
|
|
38
|
+
default: () => ({}),
|
|
39
|
+
},
|
|
40
|
+
chartOptions: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: () => ({}),
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
setup(props) {
|
|
46
|
+
return () =>
|
|
47
|
+
h(h(Radar), {
|
|
48
|
+
data: props.chartData,
|
|
49
|
+
options: props.chartOptions,
|
|
50
|
+
chartId: props.chartId,
|
|
51
|
+
width: props.width,
|
|
52
|
+
height: props.height,
|
|
53
|
+
cssClasses: props.cssClasses,
|
|
54
|
+
styles: props.styles,
|
|
55
|
+
plugins: props.plugins,
|
|
56
|
+
})
|
|
57
|
+
},
|
|
58
|
+
})
|