@tekkare/auriga 0.1.166 → 0.1.168
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
|
@@ -705,5 +705,5 @@ export default defineComponent({
|
|
|
705
705
|
});
|
|
706
706
|
</script>
|
|
707
707
|
<style>
|
|
708
|
-
.prmt_chart{font-family:Figtree,sans-serif!important;position:relative}.prmt_chart_title{color:var(--darkest);font-size:18px;font-style:normal;font-weight:700;line-height:21px;margin-bottom:8px;margin-right:150px}.prmt_chart_title.prmt_chart_title_without_subtitle{margin-bottom:22px}.prmt_chart_source{align-items:center;color:#2176ff;cursor:pointer;display:flex;font-size:12px;font-style:normal;font-weight:400;gap:8px;height:14px;line-height:14px;overflow:hidden;padding:4px 0;text-overflow:ellipsis;white-space:nowrap}.prmt_chart_source a{color:#2176ff}.prmt_chart_source:empty{visibility:hidden}.prmt_chart .apexcharts-toolbar{top:0!important}.prmt_chart .apexcharts-canvas .apexcharts-svg{overflow:visible}.prmt_chart .apexcharts-pie-area{stroke-width:0}.prmt_chart .apexcharts-canvas{position:static}.prmt_chart.bar-column_arg_chart>.vue-apexcharts>.apexcharts-canvas>svg>.apexcharts-inner>.apexcharts-bar-series.apexcharts-plot-series .apexcharts-series path,.prmt_chart.bar_arg_chart>.vue-apexcharts>.apexcharts-canvas>svg>.apexcharts-inner>.apexcharts-bar-series.apexcharts-plot-series .apexcharts-series path{-webkit-clip-path:inset(0 0 -11% 0 round 6px)!important;clip-path:inset(0 0 -11% 0 round 6px)!important}.prmt_chart.bar-horizontal-group_arg_chart>.vue-apexcharts>.apexcharts-canvas>svg>.apexcharts-inner>.apexcharts-bar-series.apexcharts-plot-series .apexcharts-series path,.prmt_chart.bar-horizontal_arg_chart>.vue-apexcharts>.apexcharts-canvas>svg>.apexcharts-inner>.apexcharts-bar-series.apexcharts-plot-series .apexcharts-series path{-webkit-clip-path:inset(0 0 0 -11% round 6px)!important;clip-path:inset(0 0 0 -11% round 6px)!important}
|
|
708
|
+
.prmt_chart{font-family:Figtree,sans-serif!important;position:relative}.prmt_chart_title{color:var(--darkest);font-size:18px;font-style:normal;font-weight:700;line-height:21px;margin-bottom:8px;margin-right:150px}.prmt_chart_title.prmt_chart_title_without_subtitle{margin-bottom:22px}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center{max-height:100px!important}.prmt_chart_source{align-items:center;color:#2176ff;cursor:pointer;display:flex;font-size:12px;font-style:normal;font-weight:400;gap:8px;height:14px;line-height:14px;overflow:hidden;padding:4px 0;text-overflow:ellipsis;white-space:nowrap}.prmt_chart_source a{color:#2176ff}.prmt_chart_source:empty{visibility:hidden}.prmt_chart .apexcharts-toolbar{top:0!important}.prmt_chart .apexcharts-canvas .apexcharts-svg{overflow:visible}.prmt_chart .apexcharts-pie-area{stroke-width:0}.prmt_chart .apexcharts-canvas{position:static}.prmt_chart.bar-column_arg_chart>.vue-apexcharts>.apexcharts-canvas>svg>.apexcharts-inner>.apexcharts-bar-series.apexcharts-plot-series .apexcharts-series path,.prmt_chart.bar_arg_chart>.vue-apexcharts>.apexcharts-canvas>svg>.apexcharts-inner>.apexcharts-bar-series.apexcharts-plot-series .apexcharts-series path{-webkit-clip-path:inset(0 0 -11% 0 round 6px)!important;clip-path:inset(0 0 -11% 0 round 6px)!important}.prmt_chart.bar-horizontal-group_arg_chart>.vue-apexcharts>.apexcharts-canvas>svg>.apexcharts-inner>.apexcharts-bar-series.apexcharts-plot-series .apexcharts-series path,.prmt_chart.bar-horizontal_arg_chart>.vue-apexcharts>.apexcharts-canvas>svg>.apexcharts-inner>.apexcharts-bar-series.apexcharts-plot-series .apexcharts-series path{-webkit-clip-path:inset(0 0 0 -11% round 6px)!important;clip-path:inset(0 0 0 -11% round 6px)!important}
|
|
709
709
|
</style>
|
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
<div
|
|
3
|
+
ref="tagsContainer"
|
|
4
|
+
class="arg_page_full border"
|
|
5
|
+
>
|
|
6
|
+
<div class="oip_row v-center gap-8 arg_page_full">
|
|
7
|
+
<div class="tags_container">
|
|
8
|
+
<ArgTags
|
|
9
|
+
v-for="(tag, index) in newTags"
|
|
10
|
+
:key="index"
|
|
11
|
+
>
|
|
12
|
+
{{ tag }}
|
|
13
|
+
</ArgTags>
|
|
14
|
+
</div>
|
|
15
|
+
<p
|
|
16
|
+
v-if="haveHiddenTags"
|
|
17
|
+
ref="hiddenTagCounter"
|
|
18
|
+
class="hidden_tags_counter"
|
|
16
19
|
>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
<ArgTooltip
|
|
21
|
+
:tooltip-text="`${hiddenTags.join('\n')}`"
|
|
22
|
+
dir="bottom"
|
|
23
|
+
:override-height="true"
|
|
24
|
+
>
|
|
25
|
+
+{{ hiddenTagsCount }}
|
|
26
|
+
</ArgTooltip>
|
|
27
|
+
</p>
|
|
28
|
+
</div>
|
|
20
29
|
</div>
|
|
21
30
|
</template>
|
|
22
31
|
|
|
@@ -24,86 +33,85 @@
|
|
|
24
33
|
import {
|
|
25
34
|
computed,
|
|
26
35
|
onMounted,
|
|
27
|
-
onBeforeUnmount,
|
|
28
36
|
ref,
|
|
29
37
|
nextTick,
|
|
30
38
|
defineComponent,
|
|
31
39
|
watch
|
|
32
40
|
} from "vue";
|
|
33
41
|
import ArgTooltip from "./argTooltip.vue";
|
|
42
|
+
import ArgTags from "./argTags.vue";
|
|
34
43
|
export default defineComponent({
|
|
35
44
|
name: "argTagsRow",
|
|
36
|
-
components: { ArgTooltip },
|
|
45
|
+
components: { ArgTooltip, ArgTags },
|
|
37
46
|
props: {
|
|
38
47
|
tags: { type: Array, default: () => [] }
|
|
39
48
|
},
|
|
40
49
|
setup(props) {
|
|
41
|
-
const container = ref(null);
|
|
42
50
|
const tagsContainer = ref(null);
|
|
43
51
|
const hiddenTagCounter = ref(null);
|
|
44
|
-
const haveHiddenTags =
|
|
45
|
-
|
|
46
|
-
const leftTag = ref(0);
|
|
47
|
-
const componentKey = ref(0);
|
|
48
|
-
const newTags = computed(() => {
|
|
49
|
-
return haveHiddenTags.value ? props.tags.slice(0, -hiddenTagsCount.value) : props.tags;
|
|
52
|
+
const haveHiddenTags = computed(() => {
|
|
53
|
+
return props.tags.length > newTags.value.length;
|
|
50
54
|
});
|
|
55
|
+
const hiddenTagsCount = ref(0);
|
|
56
|
+
const hiddenTags = ref([]);
|
|
57
|
+
const newTags = ref([props.tags[0]]);
|
|
51
58
|
const adjustTagsRow = () => {
|
|
52
|
-
if (!
|
|
59
|
+
if (!tagsContainer.value)
|
|
53
60
|
return;
|
|
54
|
-
const containerWidth =
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
const containerWidth = tagsContainer.value.clientWidth - 28;
|
|
62
|
+
const gap = 8;
|
|
63
|
+
const base = [props.tags[0]];
|
|
64
|
+
const currentHiddenTags = [];
|
|
65
|
+
let totalTagsWidth = getTextWidth(props.tags[0]) + gap;
|
|
57
66
|
for (let i = 0; i < props.tags.length; i++) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
if (i !== 0) {
|
|
68
|
+
const tag = props.tags[i];
|
|
69
|
+
const tagWidth = getTextWidth(tag) + gap;
|
|
70
|
+
if (totalTagsWidth + tagWidth > containerWidth) {
|
|
71
|
+
currentHiddenTags.push(tag);
|
|
72
|
+
} else {
|
|
73
|
+
totalTagsWidth += tagWidth + 1;
|
|
74
|
+
base.push(tag);
|
|
75
|
+
}
|
|
67
76
|
}
|
|
68
|
-
leftTag.value = totalTagsWidth;
|
|
69
|
-
}
|
|
70
|
-
if (hiddenIndex >= 0) {
|
|
71
|
-
haveHiddenTags.value = true;
|
|
72
|
-
hiddenTagsCount.value = props.tags.length - hiddenIndex;
|
|
73
|
-
} else {
|
|
74
|
-
haveHiddenTags.value = false;
|
|
75
|
-
hiddenTagsCount.value = 0;
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
for (let i = 0; i < currentHiddenTags.length; i++) {
|
|
79
|
+
const tagWidth = getTextWidth(currentHiddenTags[i]) + gap;
|
|
80
|
+
if (totalTagsWidth + tagWidth <= containerWidth) {
|
|
81
|
+
totalTagsWidth += tagWidth;
|
|
82
|
+
base.push(currentHiddenTags[i]);
|
|
83
|
+
hiddenTagsCount.value--;
|
|
84
|
+
}
|
|
80
85
|
}
|
|
81
|
-
|
|
86
|
+
hiddenTags.value = currentHiddenTags;
|
|
87
|
+
hiddenTagsCount.value = currentHiddenTags.length;
|
|
88
|
+
newTags.value = base;
|
|
82
89
|
};
|
|
83
|
-
const
|
|
84
|
-
|
|
90
|
+
const getTextWidth = (text) => {
|
|
91
|
+
const canvas = document.createElement("canvas");
|
|
92
|
+
const context = canvas.getContext("2d");
|
|
93
|
+
if (!context || !tagsContainer.value)
|
|
94
|
+
return 0;
|
|
95
|
+
context.font = "12px Figtree";
|
|
96
|
+
return context.measureText(text).width + 16;
|
|
85
97
|
};
|
|
86
98
|
onMounted(() => {
|
|
87
99
|
nextTick(adjustTagsRow);
|
|
88
|
-
window.addEventListener("resize",
|
|
89
|
-
});
|
|
90
|
-
onBeforeUnmount(() => {
|
|
91
|
-
window.removeEventListener("resize", handleResize);
|
|
100
|
+
window.addEventListener("resize", adjustTagsRow);
|
|
92
101
|
});
|
|
93
102
|
watch(() => props.tags, adjustTagsRow);
|
|
94
103
|
return {
|
|
95
|
-
|
|
96
|
-
tagsContainer,
|
|
104
|
+
newTags,
|
|
97
105
|
hiddenTagCounter,
|
|
98
106
|
haveHiddenTags,
|
|
99
107
|
hiddenTagsCount,
|
|
100
|
-
|
|
101
|
-
|
|
108
|
+
hiddenTags,
|
|
109
|
+
tagsContainer
|
|
102
110
|
};
|
|
103
111
|
}
|
|
104
112
|
});
|
|
105
113
|
</script>
|
|
106
114
|
|
|
107
115
|
<style scoped>
|
|
108
|
-
.
|
|
116
|
+
.tags_container{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px;overflow:hidden}.hidden_tags_counter{border-radius:8px;font-size:12px;padding:2px 4px;width:-moz-fit-content;width:fit-content}
|
|
109
117
|
</style>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
import type { Ref } from "vue";
|
|
1
2
|
declare const _default: import("vue").DefineComponent<{
|
|
2
3
|
tags: {
|
|
3
4
|
type: ArrayConstructor;
|
|
4
5
|
default: () => never[];
|
|
5
6
|
};
|
|
6
7
|
}, {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
leftTag: import("vue").Ref<number>;
|
|
8
|
+
newTags: Ref<unknown[]>;
|
|
9
|
+
hiddenTagCounter: Ref<null>;
|
|
10
|
+
haveHiddenTags: import("vue").ComputedRef<boolean>;
|
|
11
|
+
hiddenTagsCount: Ref<number>;
|
|
12
|
+
hiddenTags: Ref<any[]>;
|
|
13
|
+
tagsContainer: Ref<HTMLElement | null>;
|
|
14
14
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
15
|
tags: {
|
|
16
16
|
type: ArrayConstructor;
|