@tekkare/auriga 0.1.10 → 0.1.11
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 +1 -1
- package/dist/runtime/components/argActions.vue +11 -6
- package/dist/runtime/components/argActions.vue.d.ts +12 -3
- package/dist/runtime/components/argChart.vue +109 -167
- package/dist/runtime/components/argChart.vue.d.ts +1 -1
- package/dist/runtime/components/argDate.vue +77 -0
- package/dist/runtime/components/argDate.vue.d.ts +34 -0
- package/dist/runtime/components/argErrors.vue +167 -0
- package/dist/runtime/components/argErrors.vue.d.ts +54 -0
- package/dist/runtime/components/argFilterCard.vue +1 -0
- package/dist/runtime/components/argHybridChart.vue +277 -0
- package/dist/runtime/components/argHybridChart.vue.d.ts +48 -0
- package/dist/runtime/components/argMainLayout.vue +1 -0
- package/dist/runtime/components/argMenuLink.vue +43 -15
- package/dist/runtime/components/argMenuLink.vue.d.ts +15 -4
- package/dist/runtime/components/argNumberInput.vue +223 -0
- package/dist/runtime/components/argNumberInput.vue.d.ts +57 -0
- package/dist/runtime/components/argSimpleChart.vue +123 -0
- package/dist/runtime/components/argSimpleChart.vue.d.ts +32 -0
- package/dist/runtime/components/argSimpleInput.vue +94 -0
- package/dist/runtime/components/argSimpleInput.vue.d.ts +40 -0
- package/dist/runtime/components/argSmallAreaChart.vue +138 -0
- package/dist/runtime/components/argSmallAreaChart.vue.d.ts +122 -0
- package/dist/runtime/components/argStyle.vue +8 -0
- package/dist/runtime/components/argTags.vue +6 -4
- package/dist/runtime/components/argTrendIndicator.vue +82 -0
- package/dist/runtime/components/argTrendIndicator.vue.d.ts +23 -0
- package/dist/runtime/components/argTutoModal.vue +185 -0
- package/dist/runtime/components/argTutoModal.vue.d.ts +41 -0
- package/package.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span>{{ formatDate(rawDate) }}</span>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import {
|
|
7
|
+
defineComponent
|
|
8
|
+
} from "vue";
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
name: "argDate",
|
|
11
|
+
props: {
|
|
12
|
+
rawDate: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
lang: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "en"
|
|
19
|
+
},
|
|
20
|
+
short: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
setup(props) {
|
|
26
|
+
function monthToString(month) {
|
|
27
|
+
if (month === 0) {
|
|
28
|
+
return props.lang === "fr" ? props.short ? "Jan." : "Janvier" : props.short ? "Jan" : "January";
|
|
29
|
+
}
|
|
30
|
+
if (month === 1) {
|
|
31
|
+
return props.lang === "fr" ? props.short ? "F\xE9v." : "F\xE9vrier" : props.short ? "Feb." : "February";
|
|
32
|
+
}
|
|
33
|
+
if (month === 2) {
|
|
34
|
+
return props.lang === "fr" ? props.short ? "Mar." : "Mars" : props.short ? "Mar." : "March";
|
|
35
|
+
}
|
|
36
|
+
if (month === 3) {
|
|
37
|
+
return props.lang === "fr" ? props.short ? "Avr." : "Avril" : props.short ? "Apr." : "April";
|
|
38
|
+
}
|
|
39
|
+
if (month === 4) {
|
|
40
|
+
return props.lang === "fr" ? "Mai" : "May";
|
|
41
|
+
}
|
|
42
|
+
if (month === 5) {
|
|
43
|
+
return props.lang === "fr" ? "Juin" : props.short ? "Jun." : "June";
|
|
44
|
+
}
|
|
45
|
+
if (month === 6) {
|
|
46
|
+
return props.lang === "fr" ? props.short ? "Juil." : "Juillet" : props.short ? "Jul." : "July";
|
|
47
|
+
}
|
|
48
|
+
if (month === 7) {
|
|
49
|
+
return props.lang === "fr" ? props.short ? "Ao\xFB." : "Ao\xFBt" : props.short ? "Aug." : "August";
|
|
50
|
+
}
|
|
51
|
+
if (month === 8) {
|
|
52
|
+
return props.lang === "fr" ? props.short ? "Sep." : "Septembre" : props.short ? "Sep." : "September";
|
|
53
|
+
}
|
|
54
|
+
if (month === 9) {
|
|
55
|
+
return props.lang === "fr" ? props.short ? "Oct." : "Octobre" : props.short ? "Oct." : "October";
|
|
56
|
+
}
|
|
57
|
+
if (month === 10) {
|
|
58
|
+
return props.lang === "fr" ? props.short ? "Nov." : "Novembre" : props.short ? "Nov." : "November";
|
|
59
|
+
}
|
|
60
|
+
if (month === 11) {
|
|
61
|
+
return props.lang === "fr" ? props.short ? "D\xE9c." : "D\xE9cembre" : props.short ? "Dec." : "December";
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function formatDate(str) {
|
|
65
|
+
const date = new Date(str);
|
|
66
|
+
const fullDate = `${date.getDate()} ${monthToString(
|
|
67
|
+
date.getMonth()
|
|
68
|
+
)}, ${date.getFullYear()}`;
|
|
69
|
+
return fullDate;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
formatDate,
|
|
73
|
+
monthToString
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
</script>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
rawDate: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
lang: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
short: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
}, {
|
|
15
|
+
formatDate: (str: string) => string;
|
|
16
|
+
monthToString: (month: number) => "Jan." | "Janvier" | "Jan" | "January" | "Fév." | "Février" | "Feb." | "February" | "Mar." | "Mars" | "March" | "Avr." | "Avril" | "Apr." | "April" | "Mai" | "May" | "Juin" | "Jun." | "June" | "Juil." | "Juillet" | "Jul." | "July" | "Aoû." | "Août" | "Aug." | "August" | "Sep." | "Septembre" | "September" | "Oct." | "Octobre" | "October" | "Nov." | "Novembre" | "November" | "Déc." | "Décembre" | "Dec." | "December" | undefined;
|
|
17
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
+
rawDate: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
lang: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
short: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: boolean;
|
|
29
|
+
};
|
|
30
|
+
}>>, {
|
|
31
|
+
lang: string;
|
|
32
|
+
short: boolean;
|
|
33
|
+
}, {}>;
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="oip_error">
|
|
3
|
+
<div class="icon_circle">
|
|
4
|
+
<arg-icon :name="getIconName" size="44" color="var(--cool-grey)" />
|
|
5
|
+
</div>
|
|
6
|
+
<div class="error_text">
|
|
7
|
+
<p class="error_title">{{ getErrorName }}</p>
|
|
8
|
+
<p class="error_descr">{{ getErrorText }}</p>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import {
|
|
15
|
+
computed,
|
|
16
|
+
defineComponent
|
|
17
|
+
} from "vue";
|
|
18
|
+
import argIcon from "./argIcon.vue";
|
|
19
|
+
export default defineComponent({
|
|
20
|
+
name: "argErrors",
|
|
21
|
+
components: {
|
|
22
|
+
argIcon
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
errorType: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "result"
|
|
28
|
+
},
|
|
29
|
+
errorTitle: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: null
|
|
32
|
+
},
|
|
33
|
+
errorText: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: null
|
|
36
|
+
},
|
|
37
|
+
errorIcon: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: null
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
setup(props) {
|
|
43
|
+
const values = [
|
|
44
|
+
{
|
|
45
|
+
type: "selection",
|
|
46
|
+
title: "No selection yet",
|
|
47
|
+
text: "You need to select your scope to view any results or data. Please choose one of the options below to proceed."
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type: "result",
|
|
51
|
+
title: "No results found",
|
|
52
|
+
text: "Your search criteria did not match any results. Please change your criteria or contact us for assistance."
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type: "access",
|
|
56
|
+
title: "Unauthorised access",
|
|
57
|
+
text: "It seems that you do not have access to this page. Reach out to your manager or contact us for assistance."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type: "network",
|
|
61
|
+
title: "Network issue",
|
|
62
|
+
text: "It seems that we are experiencing some network issues. Please try again in a few minutes or contact us for assistance."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: "not-found",
|
|
66
|
+
title: "Page not found",
|
|
67
|
+
text: "Oops it seems like this page doesn\u2019t exist anymore. Go back to OIP or contact us for assistance."
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
const icons = [
|
|
71
|
+
{ type: "selection", value: "CrosshairSimple" },
|
|
72
|
+
{ type: "result", value: "MagnifyingGlass" },
|
|
73
|
+
{ type: "access", value: "Prohibit" },
|
|
74
|
+
{ type: "network", value: "Plugs" },
|
|
75
|
+
{ type: "not-found", value: "LinkBreak" }
|
|
76
|
+
];
|
|
77
|
+
const getIconName = computed(() => {
|
|
78
|
+
if (props.errorIcon === null) {
|
|
79
|
+
let icon = "";
|
|
80
|
+
for (let i = 0; i < icons.length; i++) {
|
|
81
|
+
if (icons[i].type === props.errorType) {
|
|
82
|
+
icon = icons[i].value;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return icon;
|
|
86
|
+
} else
|
|
87
|
+
return props.errorIcon;
|
|
88
|
+
});
|
|
89
|
+
const getErrorText = computed(() => {
|
|
90
|
+
if (props.errorText === null) {
|
|
91
|
+
let title = "";
|
|
92
|
+
for (let i = 0; i < values.length; i++) {
|
|
93
|
+
if (values[i].type === props.errorType) {
|
|
94
|
+
title = values[i].text;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return title;
|
|
98
|
+
} else
|
|
99
|
+
return props.errorText;
|
|
100
|
+
});
|
|
101
|
+
const getErrorName = computed(() => {
|
|
102
|
+
if (props.errorTitle === null) {
|
|
103
|
+
let title = "";
|
|
104
|
+
for (let i = 0; i < values.length; i++) {
|
|
105
|
+
if (values[i].type === props.errorType) {
|
|
106
|
+
title = values[i].title;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return title;
|
|
110
|
+
} else
|
|
111
|
+
return props.errorTitle;
|
|
112
|
+
});
|
|
113
|
+
return {
|
|
114
|
+
values,
|
|
115
|
+
icons,
|
|
116
|
+
getErrorName,
|
|
117
|
+
getErrorText,
|
|
118
|
+
getIconName
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
</script>
|
|
123
|
+
|
|
124
|
+
<style scoped>
|
|
125
|
+
.oip_error {
|
|
126
|
+
display: flex;
|
|
127
|
+
max-width: 409px;
|
|
128
|
+
flex-direction: column;
|
|
129
|
+
align-items: center;
|
|
130
|
+
gap: 24px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.icon_circle {
|
|
134
|
+
display: flex;
|
|
135
|
+
border-radius: 50px;
|
|
136
|
+
background: var(--base-dividers, #ececf2);
|
|
137
|
+
flex-direction: column;
|
|
138
|
+
justify-content: center;
|
|
139
|
+
align-items: center;
|
|
140
|
+
padding: 10px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.error_text {
|
|
144
|
+
display: flex;
|
|
145
|
+
flex-direction: column;
|
|
146
|
+
align-items: center;
|
|
147
|
+
gap: 8px;
|
|
148
|
+
align-self: stretch;
|
|
149
|
+
text-align: center;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.error_title {
|
|
153
|
+
font-size: 16px;
|
|
154
|
+
font-style: normal;
|
|
155
|
+
font-weight: 700;
|
|
156
|
+
line-height: normal;
|
|
157
|
+
text-align: center;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.error_descr {
|
|
161
|
+
font-size: 14px;
|
|
162
|
+
font-style: normal;
|
|
163
|
+
font-weight: 400;
|
|
164
|
+
line-height: 160%;
|
|
165
|
+
color: var(--cool-grey);
|
|
166
|
+
}
|
|
167
|
+
</style>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
errorType: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
errorTitle: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: null;
|
|
9
|
+
};
|
|
10
|
+
errorText: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: null;
|
|
13
|
+
};
|
|
14
|
+
errorIcon: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: null;
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
values: {
|
|
20
|
+
type: string;
|
|
21
|
+
title: string;
|
|
22
|
+
text: string;
|
|
23
|
+
}[];
|
|
24
|
+
icons: {
|
|
25
|
+
type: string;
|
|
26
|
+
value: string;
|
|
27
|
+
}[];
|
|
28
|
+
getErrorName: import("vue").ComputedRef<string>;
|
|
29
|
+
getErrorText: import("vue").ComputedRef<string>;
|
|
30
|
+
getIconName: import("vue").ComputedRef<string>;
|
|
31
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
32
|
+
errorType: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
errorTitle: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
default: null;
|
|
39
|
+
};
|
|
40
|
+
errorText: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
default: null;
|
|
43
|
+
};
|
|
44
|
+
errorIcon: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: null;
|
|
47
|
+
};
|
|
48
|
+
}>>, {
|
|
49
|
+
errorType: string;
|
|
50
|
+
errorTitle: string;
|
|
51
|
+
errorText: string;
|
|
52
|
+
errorIcon: string;
|
|
53
|
+
}, {}>;
|
|
54
|
+
export default _default;
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<client-only>
|
|
4
|
+
<table class="oip_hybrid_chart">
|
|
5
|
+
<thead class="oip_hybrid_chart__header">
|
|
6
|
+
<tr>
|
|
7
|
+
<th
|
|
8
|
+
class="oip_hybrid_chart__header_elem"
|
|
9
|
+
v-for="(header, index) in heads"
|
|
10
|
+
:key="index"
|
|
11
|
+
>
|
|
12
|
+
{{ header }}
|
|
13
|
+
</th>
|
|
14
|
+
</tr>
|
|
15
|
+
</thead>
|
|
16
|
+
<tbody class="oip_hybrid_chart__body">
|
|
17
|
+
<tr v-for="(row, tableIndex) in tableBody" :key="tableIndex">
|
|
18
|
+
<td
|
|
19
|
+
v-for="(val, index) in row.values"
|
|
20
|
+
:key="index"
|
|
21
|
+
class="oip_hybrid_chart__td"
|
|
22
|
+
>
|
|
23
|
+
<div class="oip_hybrid_chart__bar_group" v-if="index === 0">
|
|
24
|
+
<div
|
|
25
|
+
class="oip_hybrid_chart__bar"
|
|
26
|
+
:style="{
|
|
27
|
+
background: barColor + '1a',
|
|
28
|
+
width: `${getPercentage(row.values[1].percentage)}%`,
|
|
29
|
+
}"
|
|
30
|
+
></div>
|
|
31
|
+
<arg-tooltip
|
|
32
|
+
:id="`tooltip-${val}`"
|
|
33
|
+
:disable="isEllipsisActive(val)"
|
|
34
|
+
:tooltipText="val"
|
|
35
|
+
:dir="tableIndex === tableBody.length - 1 ? 'bottom' : 'top'"
|
|
36
|
+
class="oip_hybrid_chart__bar_content"
|
|
37
|
+
>
|
|
38
|
+
<div :id="`text-value-${val}`" class="truncated">
|
|
39
|
+
{{ val }}
|
|
40
|
+
</div>
|
|
41
|
+
</arg-tooltip>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="oip_hybrid_chart__td_content" v-if="index === 1">
|
|
44
|
+
<p>
|
|
45
|
+
{{
|
|
46
|
+
new Intl.NumberFormat("fr-FR")
|
|
47
|
+
.format(val.value)
|
|
48
|
+
.replace(",", ".")
|
|
49
|
+
}}
|
|
50
|
+
<span class="oip_hybrid_chart__bar_percentage"
|
|
51
|
+
>({{ val.percentage }} %)</span
|
|
52
|
+
>
|
|
53
|
+
</p>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="oip_hybrid_chart__td_content" v-if="index > 1">
|
|
56
|
+
{{ val }}
|
|
57
|
+
</div>
|
|
58
|
+
</td>
|
|
59
|
+
</tr>
|
|
60
|
+
</tbody>
|
|
61
|
+
</table>
|
|
62
|
+
</client-only>
|
|
63
|
+
<div class="oip_hybrid_chart__footer" v-if="limiter">
|
|
64
|
+
<arg-btn
|
|
65
|
+
btnStyle="skeleton"
|
|
66
|
+
prefixIcon="CornersOut"
|
|
67
|
+
@onClick="changeShowState(true)"
|
|
68
|
+
v-if="!showAll"
|
|
69
|
+
>Show all</arg-btn
|
|
70
|
+
>
|
|
71
|
+
<arg-btn
|
|
72
|
+
btnStyle="skeleton"
|
|
73
|
+
prefixIcon="CornersIn"
|
|
74
|
+
@onClick="changeShowState(false)"
|
|
75
|
+
v-if="showAll"
|
|
76
|
+
>Show less</arg-btn
|
|
77
|
+
>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</template>
|
|
81
|
+
<script>
|
|
82
|
+
import argBtn from "./argBtn";
|
|
83
|
+
import argTooltip from "./argTooltip";
|
|
84
|
+
import {
|
|
85
|
+
onMounted,
|
|
86
|
+
ref,
|
|
87
|
+
computed,
|
|
88
|
+
watch,
|
|
89
|
+
defineComponent
|
|
90
|
+
} from "vue";
|
|
91
|
+
export default defineComponent({
|
|
92
|
+
name: "argHybridChart",
|
|
93
|
+
components: { argBtn, argTooltip },
|
|
94
|
+
props: {
|
|
95
|
+
heads: {
|
|
96
|
+
type: Array,
|
|
97
|
+
required: true
|
|
98
|
+
},
|
|
99
|
+
contents: {
|
|
100
|
+
type: Array,
|
|
101
|
+
required: true
|
|
102
|
+
},
|
|
103
|
+
barColor: {
|
|
104
|
+
type: String,
|
|
105
|
+
default: "#4475FB"
|
|
106
|
+
},
|
|
107
|
+
limiter: {
|
|
108
|
+
type: Number,
|
|
109
|
+
required: false
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
emits: ["showState"],
|
|
113
|
+
setup(props, { emit }) {
|
|
114
|
+
const showAll = ref(false);
|
|
115
|
+
const maxValue = ref(0);
|
|
116
|
+
const tableBody = computed(() => {
|
|
117
|
+
let contentValues = [];
|
|
118
|
+
if (props.limiter) {
|
|
119
|
+
if (!showAll.value) {
|
|
120
|
+
contentValues = props.contents.slice(0, props.limiter);
|
|
121
|
+
} else {
|
|
122
|
+
contentValues = props.contents;
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
contentValues = props.contents;
|
|
126
|
+
}
|
|
127
|
+
return contentValues;
|
|
128
|
+
});
|
|
129
|
+
onMounted(() => {
|
|
130
|
+
getMaxValue();
|
|
131
|
+
});
|
|
132
|
+
watch(
|
|
133
|
+
() => props.contents,
|
|
134
|
+
(new_contents) => {
|
|
135
|
+
maxValue.value = 0;
|
|
136
|
+
getMaxValue();
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
function isEllipsisActive(value) {
|
|
140
|
+
let textValue = document?.getElementById(`text-value-${value}`);
|
|
141
|
+
let tooltip = document?.getElementById(`tooltip-${value}`);
|
|
142
|
+
if (textValue !== void 0 && textValue !== null && tooltip !== null) {
|
|
143
|
+
tooltip.style.maxWidth = "12000px";
|
|
144
|
+
textValue.style.overflow = "initial";
|
|
145
|
+
const noEllipsisWidth = textValue.offsetWidth;
|
|
146
|
+
tooltip.style.maxWidth = "100%";
|
|
147
|
+
textValue.style.overflow = "hidden";
|
|
148
|
+
const ellipsisWidth = textValue.offsetWidth;
|
|
149
|
+
if (ellipsisWidth < noEllipsisWidth) {
|
|
150
|
+
return false;
|
|
151
|
+
} else {
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function getMaxValue() {
|
|
157
|
+
for (let i = 0; i < props.contents.length; i++) {
|
|
158
|
+
if (parseFloat(props.contents[i].values[1].percentage) > maxValue.value) {
|
|
159
|
+
parseFloat(maxValue.value = props.contents[i].values[1].percentage);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function changeShowState(val) {
|
|
164
|
+
showAll.value = val;
|
|
165
|
+
emit("showState", val);
|
|
166
|
+
}
|
|
167
|
+
function getPercentage(value) {
|
|
168
|
+
if (maxValue.value === 100) {
|
|
169
|
+
return value;
|
|
170
|
+
} else {
|
|
171
|
+
if (value === maxValue.value) {
|
|
172
|
+
return 100;
|
|
173
|
+
} else {
|
|
174
|
+
return value * 100 / maxValue.value;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
maxValue,
|
|
180
|
+
showAll,
|
|
181
|
+
getMaxValue,
|
|
182
|
+
changeShowState,
|
|
183
|
+
getPercentage,
|
|
184
|
+
tableBody,
|
|
185
|
+
isEllipsisActive
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
</script>
|
|
190
|
+
<style scoped>
|
|
191
|
+
.oip_hybrid_chart {
|
|
192
|
+
border-collapse: collapse;
|
|
193
|
+
border-spacing: 0;
|
|
194
|
+
width: 100%;
|
|
195
|
+
table-layout: auto;
|
|
196
|
+
}
|
|
197
|
+
.oip_hybrid_chart__header th {
|
|
198
|
+
font-style: normal;
|
|
199
|
+
font-weight: 400;
|
|
200
|
+
font-size: 12px;
|
|
201
|
+
line-height: 14px;
|
|
202
|
+
color: var(--cool-grey);
|
|
203
|
+
}
|
|
204
|
+
.oip_hybrid_chart__header_elem:first-child {
|
|
205
|
+
text-align: left;
|
|
206
|
+
padding-left: 0;
|
|
207
|
+
}
|
|
208
|
+
.oip_hybrid_chart__header_elem:last-child {
|
|
209
|
+
padding-right: 0;
|
|
210
|
+
}
|
|
211
|
+
.oip_hybrid_chart__header_elem {
|
|
212
|
+
padding: 5px 10px;
|
|
213
|
+
white-space: nowrap;
|
|
214
|
+
text-align: right;
|
|
215
|
+
}
|
|
216
|
+
.oip_hybrid_chart__body tr {
|
|
217
|
+
padding: 4px 0;
|
|
218
|
+
height: 40px;
|
|
219
|
+
}
|
|
220
|
+
.oip_hybrid_chart__td:first-child {
|
|
221
|
+
width: 100%;
|
|
222
|
+
padding-left: 0;
|
|
223
|
+
}
|
|
224
|
+
.oip_hybrid_chart__td:last-child .oip_hybrid_chart__td_content {
|
|
225
|
+
padding-right: 0;
|
|
226
|
+
}
|
|
227
|
+
.oip_hybrid_chart__td {
|
|
228
|
+
vertical-align: top !important;
|
|
229
|
+
}
|
|
230
|
+
.oip_hybrid_chart__td_content {
|
|
231
|
+
padding: 5px 10px;
|
|
232
|
+
font-style: normal;
|
|
233
|
+
font-weight: 500;
|
|
234
|
+
font-size: 14px;
|
|
235
|
+
line-height: 160%;
|
|
236
|
+
color: var(--independence);
|
|
237
|
+
white-space: nowrap;
|
|
238
|
+
text-align: right;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.oip_hybrid_chart__bar_group {
|
|
242
|
+
position: relative;
|
|
243
|
+
width: 100%;
|
|
244
|
+
}
|
|
245
|
+
.oip_hybrid_chart__bar {
|
|
246
|
+
position: absolute;
|
|
247
|
+
z-index: 0;
|
|
248
|
+
height: 32px;
|
|
249
|
+
}
|
|
250
|
+
.oip_hybrid_chart__bar_content {
|
|
251
|
+
position: absolute;
|
|
252
|
+
z-index: 1;
|
|
253
|
+
padding: 8px 10px;
|
|
254
|
+
white-space: nowrap;
|
|
255
|
+
font-style: normal;
|
|
256
|
+
font-weight: 400;
|
|
257
|
+
font-size: 14px;
|
|
258
|
+
max-width: 100%;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.oip_hybrid_chart__bar_percentage {
|
|
262
|
+
margin-left: 4px;
|
|
263
|
+
font-weight: 400;
|
|
264
|
+
}
|
|
265
|
+
.oip_hybrid_chart__footer {
|
|
266
|
+
display: flex;
|
|
267
|
+
justify-content: center;
|
|
268
|
+
margin-top: 32px;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.truncated {
|
|
272
|
+
display: block;
|
|
273
|
+
white-space: nowrap; /* forces text to single line */
|
|
274
|
+
overflow: hidden;
|
|
275
|
+
text-overflow: ellipsis;
|
|
276
|
+
}
|
|
277
|
+
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
heads: {
|
|
3
|
+
type: ArrayConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
contents: {
|
|
7
|
+
type: ArrayConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
barColor: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
limiter: {
|
|
15
|
+
type: NumberConstructor;
|
|
16
|
+
required: false;
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
maxValue: import("vue").Ref<number>;
|
|
20
|
+
showAll: import("vue").Ref<boolean>;
|
|
21
|
+
getMaxValue: () => void;
|
|
22
|
+
changeShowState: (val: boolean) => void;
|
|
23
|
+
getPercentage: (value: number) => number;
|
|
24
|
+
tableBody: import("vue").ComputedRef<never[]>;
|
|
25
|
+
isEllipsisActive: (value: string) => boolean | undefined;
|
|
26
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "showState"[], "showState", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
|
+
heads: {
|
|
28
|
+
type: ArrayConstructor;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
contents: {
|
|
32
|
+
type: ArrayConstructor;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
barColor: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
limiter: {
|
|
40
|
+
type: NumberConstructor;
|
|
41
|
+
required: false;
|
|
42
|
+
};
|
|
43
|
+
}>> & {
|
|
44
|
+
onShowState?: ((...args: any[]) => any) | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
barColor: string;
|
|
47
|
+
}, {}>;
|
|
48
|
+
export default _default;
|