@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
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.1.166"
7
+ "version": "0.1.168"
8
8
  }
@@ -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>
@@ -7,9 +7,9 @@
7
7
  class="card_content"
8
8
  :class="
9
9
  position === 'top'
10
- ? 'footer'
10
+ ? 'card_footer'
11
11
  : position === 'bottom'
12
- ? 'header'
12
+ ? 'card_header'
13
13
  : 'none'
14
14
  "
15
15
  >
@@ -1,22 +1,31 @@
1
1
  <template>
2
- <div ref="container" class="oip_row v-center gap-8 global_tags-container">
3
- <div class="tags_container" ref="tagsContainer">
4
- <ArgTags v-for="(tag, index) in newTags" :key="index">{{ tag }}</ArgTags>
5
- </div>
6
- <p
7
- v-if="haveHiddenTags"
8
- ref="hiddenTagCounter"
9
- class="hidden_tags_counter"
10
- :style="{ left: leftTag + 'px' }"
11
- >
12
- <ArgTooltip
13
- :tooltip-text="`${tags.slice(-hiddenTagsCount).join('\n')}`"
14
- dir="bottom"
15
- :override-height="true"
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
- +{{ hiddenTagsCount }}
18
- </ArgTooltip>
19
- </p>
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 = ref(false);
45
- const hiddenTagsCount = ref(0);
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 (!container.value || !tagsContainer.value)
59
+ if (!tagsContainer.value)
53
60
  return;
54
- const containerWidth = container.value.offsetWidth - 20;
55
- let totalTagsWidth = 0;
56
- let hiddenIndex = -1;
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
- const tagElement = tagsContainer.value.children[i];
59
- if (!tagElement) {
60
- hiddenIndex = i;
61
- break;
62
- }
63
- totalTagsWidth += tagElement.offsetWidth + 8;
64
- if (totalTagsWidth > containerWidth) {
65
- hiddenIndex = i;
66
- break;
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
- if (containerWidth > totalTagsWidth) {
78
- haveHiddenTags.value = false;
79
- hiddenTagsCount.value = 0;
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
- componentKey.value++;
86
+ hiddenTags.value = currentHiddenTags;
87
+ hiddenTagsCount.value = currentHiddenTags.length;
88
+ newTags.value = base;
82
89
  };
83
- const handleResize = () => {
84
- nextTick(adjustTagsRow);
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", handleResize);
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
- container,
96
- tagsContainer,
104
+ newTags,
97
105
  hiddenTagCounter,
98
106
  haveHiddenTags,
99
107
  hiddenTagsCount,
100
- newTags,
101
- leftTag
108
+ hiddenTags,
109
+ tagsContainer
102
110
  };
103
111
  }
104
112
  });
105
113
  </script>
106
114
 
107
115
  <style scoped>
108
- .global_tags-container{position:relative}.tags_container{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px;margin-right:20px;max-height:22px;overflow:hidden}.hidden_tags_counter{border:1px solid var(--light);border-radius:8px;font-size:12px;padding:4px;position:absolute;right:0;top:3;width:-moz-fit-content;width:fit-content}
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
- container: import("vue").Ref<null>;
8
- tagsContainer: import("vue").Ref<null>;
9
- hiddenTagCounter: import("vue").Ref<null>;
10
- haveHiddenTags: import("vue").Ref<boolean>;
11
- hiddenTagsCount: import("vue").Ref<number>;
12
- newTags: import("vue").ComputedRef<unknown[]>;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/auriga",
3
- "version": "0.1.166",
3
+ "version": "0.1.168",
4
4
  "description": "Aurgia is a UI kit developped by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",