glib-web 4.27.3 → 4.28.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.
@@ -1,3 +1,4 @@
1
+ import { strandom } from "../../components/helper";
1
2
  import { vueApp } from "../../store";
2
3
  import http from "../../utils/http";
3
4
 
@@ -12,7 +13,7 @@ export default class {
12
13
  component,
13
14
  (response) => {
14
15
  vueApp.sheet = {
15
- spec: response.body,
16
+ spec: Object.assign({}, response.body, { key: strandom() }),
16
17
  show: true,
17
18
  placement
18
19
  };
package/app.vue CHANGED
@@ -32,7 +32,7 @@
32
32
  <Transition name="slide-fade">
33
33
  <v-sheet v-if="vueApp.sheet.show" position="fixed" :class="`views-sheet ${vueApp.sheet.placement}`">
34
34
  <glib-component v-for="(rbSpec, index) in vueApp.sheet.spec.childViews" :spec="rbSpec"
35
- :key="index"></glib-component>
35
+ :key="`${vueApp.sheet.spec.key}-${index}`"></glib-component>
36
36
  </v-sheet>
37
37
  </Transition>
38
38
  <div class="glib-bottomBanner">
@@ -1,7 +1,7 @@
1
1
  import { Chart, Colors } from "chart.js";
2
2
  import chartDataLabels from 'chartjs-plugin-datalabels';
3
3
  import doughnutLabel from 'chartjs-plugin-doughnutlabel-v3';
4
- import { Vue, vueApp } from "../..";
4
+ import { settings, Vue, vueApp } from "../..";
5
5
  import { computePosition, flip, offset } from '@floating-ui/dom';
6
6
 
7
7
  import 'chartkick/chart.js';
@@ -12,6 +12,8 @@ Chart.register(chartDataLabels);
12
12
  Chart.register(doughnutLabel);
13
13
  Chart.register(Colors);
14
14
 
15
+ if (settings.chartPlugin.htmlLegendPlugin) Chart.register(settings.chartPlugin.htmlLegendPlugin);
16
+
15
17
  import VueChartkick from 'vue-chartkick';
16
18
  import { computed } from "vue";
17
19
  Vue.use(VueChartkick);
@@ -186,6 +188,14 @@ function useChart({ dataSeries, spec, multiple = true }) {
186
188
  };
187
189
  }
188
190
 
191
+ if (legend.override) {
192
+ options.plugins.htmlLegend = {
193
+ display: true
194
+ };
195
+ options.plugins.legend = {
196
+ display: false
197
+ };
198
+ }
189
199
  return { series, colors, options };
190
200
  }
191
201
 
@@ -1,17 +1,44 @@
1
1
  <template>
2
- <v-progress-circular :class="$classes()" :rotate="spec.rotate || 0" :size="spec.size || 100" :width="spec.width || 20"
3
- :color="spec.color" :model-value="spec.value" :indeterminate="spec.indeterminate">
4
- <div>
2
+ <div ref="container" :class="containerClass" :style="containerStyle">
3
+ <v-progress-circular ref="progress" :class="$classes()" :rotate="rotate" :size="spec.size || 100"
4
+ :width="spec.width || 20" :color="spec.color" :model-value="model" :indeterminate="spec.indeterminate">
5
+ <div :style="middleTextStyle">
5
6
  <div class="value-style text-center">{{ spec.value }}%</div>
6
7
  <span v-if="spec.text" class="text-style">{{ spec.text }}</span>
7
8
  </div>
8
- </v-progress-circular>
9
+ </v-progress-circular>
10
+ </div>
9
11
  </template>
10
12
 
11
13
  <script>
14
+ import { onMounted, ref } from "vue";
15
+
12
16
  export default {
13
17
  props: {
14
18
  spec: { type: Object, required: true }
19
+ },
20
+ setup(props) {
21
+ const container = ref(null);
22
+ const progress = ref(null);
23
+ const model = ref(props.spec.half ? props.spec.value / 2 : props.spec.value);
24
+ const rotate = ref(props.spec.half ? 270 : 0);
25
+ const containerStyle = ref({ width: '100%', height: '100%' });
26
+ const middleTextStyle = ref({});
27
+ const containerClass = ref([]);
28
+
29
+ function getHeight() {
30
+ return parseInt(progress.value.$el.style.height.replace('px', ''));
31
+ }
32
+
33
+ onMounted(() => {
34
+ if (props.spec.half) {
35
+ middleTextStyle.value = { marginBottom: `${getHeight() / 3}px` };
36
+ containerStyle.value = { width: '100%', height: `${getHeight() / 2}px` };
37
+ containerClass.value = ['half-circle'];
38
+ }
39
+ });
40
+
41
+ return { container, containerClass, containerStyle, middleTextStyle, model, rotate, progress };
15
42
  }
16
43
  };
17
44
  </script>
@@ -28,4 +55,9 @@ export default {
28
55
  line-height: 150%;
29
56
  font-weight: 400;
30
57
  }
58
+
59
+ .half-circle {
60
+ overflow-y: hidden;
61
+ position: relative;
62
+ }
31
63
  </style>
@@ -1,4 +1,5 @@
1
1
  <template>
2
+
2
3
  <v-progress-linear :class="$classes()" :height="spec.height" :color="spec.color"
3
4
  :background-color="spec.backgroundColor" :disabled="true" :model-value="value_in_percentage"
4
5
  :striped="$classes().includes('striped')" :reverse="spec.reversed || false" :rounded="spec.rounded">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glib-web",
3
- "version": "4.27.3",
3
+ "version": "4.28.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/utils/settings.js CHANGED
@@ -9,6 +9,7 @@ class MutableSettings {
9
9
  retries: 3,
10
10
  interval: 50
11
11
  };
12
+ this.chartPlugin = {};
12
13
  this.errorHandler = (err, message) => {
13
14
  console.error(message || err.message, err);
14
15
  };