@tekkare/auriga 0.2.68 → 0.2.69

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/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.2.68"
7
+ "version": "0.2.69"
8
8
  }
@@ -5,8 +5,8 @@
5
5
  <thead class="oip_hybrid_chart__header">
6
6
  <tr>
7
7
  <th
8
- class="oip_hybrid_chart__header_elem"
9
8
  v-for="(header, index) in heads"
9
+ class="oip_hybrid_chart__header_elem"
10
10
  :key="index"
11
11
  >
12
12
  {{ header }}
@@ -20,18 +20,18 @@
20
20
  :key="index"
21
21
  class="oip_hybrid_chart__td"
22
22
  >
23
- <div class="oip_hybrid_chart__bar_group" v-if="index === 0">
23
+ <div v-if="index === 0" class="oip_hybrid_chart__bar_group">
24
24
  <div
25
25
  class="oip_hybrid_chart__bar"
26
26
  :style="{
27
27
  background: barColor + '1a',
28
28
  width: `${getPercentage(row.values[1])}%`,
29
29
  }"
30
- ></div>
30
+ />
31
31
  <arg-tooltip
32
32
  :id="`tooltip-${val}`"
33
33
  :disable="isEllipsisActive(val)"
34
- :tooltipText="val"
34
+ :tooltip-text="val"
35
35
  :dir="tableIndex === tableBody.length - 1 ? 'bottom' : 'top'"
36
36
  class="oip_hybrid_chart__bar_content"
37
37
  >
@@ -40,7 +40,7 @@
40
40
  </div>
41
41
  </arg-tooltip>
42
42
  </div>
43
- <div class="oip_hybrid_chart__td_content" v-if="index === 1">
43
+ <div v-if="index === 1" class="oip_hybrid_chart__td_content">
44
44
  <p>
45
45
  {{
46
46
  new Intl.NumberFormat("fr-FR")
@@ -48,13 +48,14 @@
48
48
  .replace(",", ".")
49
49
  }}
50
50
  <span
51
- class="oip_hybrid_chart__bar_percentage"
52
51
  v-if="val.percentage"
53
- >({{ val.percentage }} %)</span
52
+ class="oip_hybrid_chart__bar_percentage"
54
53
  >
54
+ ({{ val.percentage }} %)
55
+ </span>
55
56
  </p>
56
57
  </div>
57
- <div class="oip_hybrid_chart__td_content" v-if="index > 1">
58
+ <div v-if="index > 1" class="oip_hybrid_chart__td_content">
58
59
  {{ val }}
59
60
  </div>
60
61
  </td>
@@ -62,34 +63,33 @@
62
63
  </tbody>
63
64
  </table>
64
65
  </client-only>
65
- <div class="oip_hybrid_chart__footer" v-if="limiter">
66
+ <div
67
+ v-if="limiter && tableBody.length > limiter"
68
+ class="oip_hybrid_chart__footer"
69
+ >
66
70
  <arg-btn
67
- btnStyle="secondary-stroke"
68
- prefixIcon="CornersOut"
69
- @onClick="changeShowState(true)"
70
71
  v-if="!showAll"
71
- >Show all</arg-btn
72
+ btn-style="secondary-stroke"
73
+ prefix-icon="CornersOut"
74
+ @on-click="changeShowState(true)"
72
75
  >
76
+ {{ lang === "fr" ? "Voir plus" : "Show more" }}
77
+ </arg-btn>
73
78
  <arg-btn
74
- btnStyle="secondary-stroke"
75
- prefixIcon="CornersIn"
76
- @onClick="changeShowState(false)"
77
79
  v-if="showAll"
78
- >Show less</arg-btn
80
+ btn-style="secondary-stroke"
81
+ prefix-icon="CornersIn"
82
+ @on-click="changeShowState(false)"
79
83
  >
84
+ {{ lang === "fr" ? "Voir moins" : "Show less" }}
85
+ </arg-btn>
80
86
  </div>
81
87
  </div>
82
88
  </template>
83
89
  <script>
84
90
  import argBtn from "./argBtn.vue";
85
91
  import argTooltip from "./argTooltip.vue";
86
- import {
87
- onMounted,
88
- ref,
89
- computed,
90
- watch,
91
- defineComponent
92
- } from "vue";
92
+ import { onMounted, ref, computed, watch, defineComponent } from "vue";
93
93
  export default defineComponent({
94
94
  name: "argHybridChart",
95
95
  components: { argBtn, argTooltip },
@@ -109,6 +109,13 @@ export default defineComponent({
109
109
  limiter: {
110
110
  type: Number,
111
111
  required: false
112
+ },
113
+ lang: {
114
+ type: String,
115
+ default: "en",
116
+ validator: (value) => {
117
+ return ["en", "fr"].includes(value);
118
+ }
112
119
  }
113
120
  },
114
121
  emits: ["showState"],
@@ -133,14 +140,14 @@ export default defineComponent({
133
140
  });
134
141
  watch(
135
142
  () => props.contents,
136
- (new_contents) => {
143
+ () => {
137
144
  maxValue.value = 0;
138
145
  getMaxValue();
139
146
  }
140
147
  );
141
148
  function isEllipsisActive(value) {
142
- let textValue = document?.getElementById(`text-value-${value}`);
143
- let tooltip = document?.getElementById(`tooltip-${value}`);
149
+ const textValue = document?.getElementById(`text-value-${value}`);
150
+ const tooltip = document?.getElementById(`tooltip-${value}`);
144
151
  if (textValue !== void 0 && textValue !== null && tooltip !== null) {
145
152
  tooltip.style.maxWidth = "12000px";
146
153
  textValue.style.overflow = "initial";
@@ -15,13 +15,18 @@ declare const _default: import("vue").DefineComponent<{
15
15
  type: NumberConstructor;
16
16
  required: false;
17
17
  };
18
+ lang: {
19
+ type: StringConstructor;
20
+ default: string;
21
+ validator: (value: string) => boolean;
22
+ };
18
23
  }, {
19
24
  maxValue: import("vue").Ref<number>;
20
25
  showAll: import("vue").Ref<boolean>;
21
26
  getMaxValue: () => void;
22
27
  changeShowState: (val: boolean) => void;
23
28
  getPercentage: (value: any) => any;
24
- tableBody: import("vue").ComputedRef<never[]>;
29
+ tableBody: any;
25
30
  isEllipsisActive: (value: string) => boolean | undefined;
26
31
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "showState"[], "showState", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
27
32
  heads: {
@@ -40,9 +45,15 @@ declare const _default: import("vue").DefineComponent<{
40
45
  type: NumberConstructor;
41
46
  required: false;
42
47
  };
48
+ lang: {
49
+ type: StringConstructor;
50
+ default: string;
51
+ validator: (value: string) => boolean;
52
+ };
43
53
  }>> & {
44
54
  onShowState?: ((...args: any[]) => any) | undefined;
45
55
  }, {
56
+ lang: string;
46
57
  barColor: string;
47
58
  }, {}>;
48
59
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/auriga",
3
- "version": "0.2.68",
3
+ "version": "0.2.69",
4
4
  "description": "Aurgia is a UI kit developped by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",