eztech-core-components 1.0.7 → 1.0.9

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.
@@ -21,7 +21,8 @@ export default {
21
21
  scales: {
22
22
  yAxes: [{
23
23
  ticks: {
24
- fontColor: 'rgb(75, 85, 99)'
24
+ fontColor: 'rgb(75, 85, 99)',
25
+ beginAtZero: true
25
26
  }
26
27
  }],
27
28
  xAxes: [{
@@ -1,33 +1,22 @@
1
1
  <script>
2
2
  import { Line } from 'vue-chartjs'
3
+ import ChartDataLabels from 'chartjs-plugin-datalabels'
3
4
  export default {
4
5
  name: 'LineChart',
5
6
  extends: Line,
6
7
  props: {
7
- data: {
8
+ chartData: { type: Object, required: true },
9
+ chartOptions: {
8
10
  type: Object,
9
- required: false,
10
- default: () => { return null }
11
- },
12
- options: {
13
- type: Object,
14
- required: false,
15
11
  default: () => ({
16
12
  responsive: true,
17
13
  maintainAspectRatio: false,
18
- legend: {
19
- display: true
20
- },
21
- interaction: {
22
- mode: 'index',
23
- intersect: false
24
- },
25
14
  scales: {
26
15
  yAxes: [{
27
16
  ticks: {
28
- fontColor: 'rgb(75, 85, 99)',
29
- suggestedMin: 30,
30
- suggestedMax: 50
17
+ beginAtZero: true,
18
+ min: 0,
19
+ fontColor: 'rgb(75, 85, 99)'
31
20
  }
32
21
  }],
33
22
  xAxes: [{
@@ -35,21 +24,19 @@ export default {
35
24
  fontColor: 'rgb(75, 85, 99)'
36
25
  }
37
26
  }]
38
- },
39
- title: {
40
- display: false,
41
- text: ''
42
27
  }
43
28
  })
44
- }
45
- },
46
- watch: {
47
- data () {
48
- this.renderChart(this.data, this.options)
29
+ },
30
+ showLabels: {
31
+ type: Boolean,
32
+ default: true
49
33
  }
50
34
  },
51
35
  mounted () {
52
- this.renderChart(this.data, this.options)
36
+ if (this.showLabels) {
37
+ this.addPlugin(ChartDataLabels)
38
+ }
39
+ this.renderChart(this.chartData, this.chartOptions)
53
40
  }
54
41
  }
55
42
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eztech-core-components",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,12 +35,18 @@
35
35
  "dependencies": {
36
36
  "axios": "^0.30.0",
37
37
  "chart.js": "^2.9.4",
38
+ "chartjs-plugin-datalabels": "^0.7.0",
38
39
  "vue": "^2.7.10",
39
40
  "vue-chartjs": "^3.5.1",
40
41
  "vue-cropperjs": "^4.2.0"
41
42
  },
42
43
  "devDependencies": {
43
44
  "@babel/eslint-parser": "^7.19.1",
45
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
46
+ "@babel/plugin-proposal-private-methods": "^7.18.6",
47
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
48
+ "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
49
+ "@babel/plugin-proposal-optional-chaining": "^7.21.0",
44
50
  "@nuxtjs/eslint-config": "^11.0.0",
45
51
  "@nuxtjs/eslint-module": "^3.1.0",
46
52
  "@nuxtjs/moment": "^1.6.1",
package/plugins/chart.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- import Chart from 'chart.js'
3
- import ChartDataLabels from 'chartjs-plugin-datalabels'
4
- Chart.plugins.register(ChartDataLabels)
2
+ // import Chart from 'chart.js'
3
+ // import ChartDataLabels from 'chartjs-plugin-datalabels'
4
+ // Chart.plugins.register(ChartDataLabels)
5
5
  /* eslint-enable */
@@ -103,7 +103,7 @@ export const getDefaultConfig = (options) => {
103
103
  }
104
104
  }
105
105
  if (!options?.ignoreElementUi) {
106
- build.transpile = [/^element-ui/, 'eztech-core-components', 'chart.js']
106
+ build.transpile = [/^element-ui/, 'eztech-core-components']
107
107
  }
108
108
  // ,
109
109
  // vue: {