@fiscozen/tab 0.1.7-beta → 0.1.8-beta
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/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiscozen/tab",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8-beta",
|
|
4
4
|
"description": "Design System Tab component",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [],
|
|
8
8
|
"author": "Cristian Barraco",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@fiscozen/badge": "^0.1.
|
|
11
|
-
"@fiscozen/composables": "^0.1.
|
|
10
|
+
"@fiscozen/badge": "^0.1.2",
|
|
11
|
+
"@fiscozen/composables": "^0.1.34"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"tailwindcss": "^3.4.1",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"@awesome.me/kit-8137893ad3": "^1.0.65",
|
|
34
34
|
"@fortawesome/fontawesome-svg-core": "^6.5.1",
|
|
35
35
|
"@fortawesome/vue-fontawesome": "^3.0.6",
|
|
36
|
-
"@fiscozen/eslint-config": "^0.1.0",
|
|
37
36
|
"@fiscozen/tsconfig": "^0.1.0",
|
|
38
|
-
"@fiscozen/
|
|
37
|
+
"@fiscozen/eslint-config": "^0.1.0",
|
|
38
|
+
"@fiscozen/icons": "^0.1.15",
|
|
39
39
|
"@fiscozen/prettier-config": "^0.1.0"
|
|
40
40
|
},
|
|
41
41
|
"license": "MIT",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
position="bottom"
|
|
4
4
|
:isOpen
|
|
5
5
|
class="w-full overflow-hidden"
|
|
6
|
-
contentClass="bg-transparent"
|
|
6
|
+
contentClass="bg-transparent z-70"
|
|
7
7
|
>
|
|
8
8
|
<template #opener>
|
|
9
9
|
<button
|
|
@@ -12,9 +12,17 @@
|
|
|
12
12
|
:class="computedClasses"
|
|
13
13
|
ref="opener"
|
|
14
14
|
>
|
|
15
|
+
<FzIcon v-if="selectedTabProps?.icon" :name="selectedTabProps.icon" :size="size" />
|
|
15
16
|
<span class="overflow-hidden text-ellipsis whitespace-nowrap">
|
|
16
17
|
{{ selectedTab }}
|
|
17
18
|
</span>
|
|
19
|
+
<FzBadge
|
|
20
|
+
v-if="selectedTabProps?.badgeContent != null"
|
|
21
|
+
:color="selectedTab === selectedTabProps.title ? 'blue' : 'black'"
|
|
22
|
+
:size="size"
|
|
23
|
+
>
|
|
24
|
+
{{ selectedTabProps.badgeContent }}
|
|
25
|
+
</FzBadge>
|
|
18
26
|
<FzIcon :name="isOpen ? 'chevron-up' : 'chevron-down'" :size="size" />
|
|
19
27
|
</button>
|
|
20
28
|
</template>
|
|
@@ -33,9 +41,10 @@
|
|
|
33
41
|
</template>
|
|
34
42
|
|
|
35
43
|
<script setup lang="ts">
|
|
36
|
-
import { ref, inject, computed } from "vue";
|
|
44
|
+
import { ref, inject, computed, Ref } from "vue";
|
|
37
45
|
import { FzFloating } from "@fiscozen/composables";
|
|
38
46
|
import { FzIcon } from "@fiscozen/icons";
|
|
47
|
+
import { FzBadge } from "@fiscozen/badge";
|
|
39
48
|
import { FzTabProps } from "../types";
|
|
40
49
|
import { mapSizeToClasses } from "../common";
|
|
41
50
|
import FzTabPickerValue from "./FzTabPickerValue.vue";
|
|
@@ -47,7 +56,10 @@ const props = defineProps<{
|
|
|
47
56
|
}>();
|
|
48
57
|
const opener = ref<HTMLElement>();
|
|
49
58
|
|
|
50
|
-
const selectedTab = inject("selectedTab");
|
|
59
|
+
const selectedTab = inject<Ref<string>>("selectedTab");
|
|
60
|
+
const selectedTabProps = computed(() => {
|
|
61
|
+
return props.tabs.find((tab) => tab.title === selectedTab?.value);
|
|
62
|
+
});
|
|
51
63
|
|
|
52
64
|
const computedClasses = computed(() => [
|
|
53
65
|
"flex items-center text-left max-w-[136px] rounded-md h-auto bg-white text-blue-500 font-medium cursor-pointer capitalize ",
|
|
@@ -5,13 +5,23 @@
|
|
|
5
5
|
:class="computedClasses"
|
|
6
6
|
:disabled="tab.disabled"
|
|
7
7
|
>
|
|
8
|
+
<FzIcon v-if="tab.icon" :name="tab.icon" :size="size" />
|
|
8
9
|
{{ tab.title }}
|
|
10
|
+
<FzBadge
|
|
11
|
+
v-if="tab.badgeContent != null"
|
|
12
|
+
:color="selectedTab === tab.title ? 'blue' : 'black'"
|
|
13
|
+
:size="size"
|
|
14
|
+
>
|
|
15
|
+
{{ tab.badgeContent }}
|
|
16
|
+
</FzBadge>
|
|
9
17
|
</button>
|
|
10
18
|
</template>
|
|
11
19
|
|
|
12
20
|
<script setup lang="ts">
|
|
13
21
|
import { Ref, inject, computed } from "vue";
|
|
14
22
|
import { FzTabProps } from "../types";
|
|
23
|
+
import { FzBadge } from "@fiscozen/badge";
|
|
24
|
+
import { FzIcon } from "@fiscozen/icons";
|
|
15
25
|
import { mapSizeToClasses } from "../common";
|
|
16
26
|
|
|
17
27
|
const props = defineProps<{
|