@fiscozen/tab 0.1.2 → 0.1.4

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Fiscozen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ {"result":[{"scriptId":"1197","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/tab/src/__test__/FzTabs.test.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":9137,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":9137,"count":1}],"isBlockCoverage":true},{"functionName":"createWrapper","ranges":[{"startOffset":1180,"endOffset":1594,"count":6}],"isBlockCoverage":true},{"functionName":"default","ranges":[{"startOffset":1338,"endOffset":1530,"count":19}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":1637,"endOffset":3495,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":1680,"endOffset":1760,"count":6}],"isBlockCoverage":true},{"functionName":"globalThis.HTMLElement.scrollIntoView","ranges":[{"startOffset":1742,"endOffset":1755,"count":7}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":1816,"endOffset":2062,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":2116,"endOffset":2320,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":2387,"endOffset":2610,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":2669,"endOffset":2887,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":2931,"endOffset":3206,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":3271,"endOffset":3491,"count":1}],"isBlockCoverage":true}]},{"scriptId":"1234","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/tab/src/index.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":1087,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":1087,"count":1}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":387,"endOffset":432,"count":6}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":635,"endOffset":680,"count":38}],"isBlockCoverage":true}]},{"scriptId":"1235","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/tab/src/FzTabs.vue","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":16424,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":16424,"count":1}],"isBlockCoverage":true},{"functionName":"setup","ranges":[{"startOffset":2090,"endOffset":5464,"count":6}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":2487,"endOffset":3099,"count":6},{"startOffset":2529,"endOffset":2539,"count":0}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":2576,"endOffset":2685,"count":12},{"startOffset":2645,"endOffset":2676,"count":0}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":2691,"endOffset":3057,"count":12},{"startOffset":2785,"endOffset":3049,"count":0}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":2954,"endOffset":3009,"count":0}],"isBlockCoverage":false},{"functionName":"","ranges":[{"startOffset":3015,"endOffset":3037,"count":0}],"isBlockCoverage":false},{"functionName":"","ranges":[{"startOffset":3073,"endOffset":3091,"count":12}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":3159,"endOffset":3363,"count":12},{"startOffset":3206,"endOffset":3274,"count":6},{"startOffset":3274,"endOffset":3290,"count":0}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":3423,"endOffset":3483,"count":6},{"startOffset":3452,"endOffset":3464,"count":1},{"startOffset":3465,"endOffset":3477,"count":5}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":3550,"endOffset":3625,"count":6},{"startOffset":3594,"endOffset":3606,"count":5},{"startOffset":3607,"endOffset":3619,"count":1}],"isBlockCoverage":true},{"functionName":"onWheel","ranges":[{"startOffset":3632,"endOffset":3839,"count":0}],"isBlockCoverage":false},{"functionName":"","ranges":[{"startOffset":3876,"endOffset":4623,"count":6},{"startOffset":3919,"endOffset":4058,"count":0},{"startOffset":4157,"endOffset":4214,"count":0},{"startOffset":4441,"endOffset":4617,"count":0}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":4102,"endOffset":4130,"count":12}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":4324,"endOffset":4342,"count":12}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":4351,"endOffset":4404,"count":12}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":4665,"endOffset":4688,"count":13}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":4696,"endOffset":5078,"count":7}],"isBlockCoverage":true},{"functionName":"_sfc_render","ranges":[{"startOffset":5470,"endOffset":7574,"count":13},{"startOffset":6282,"endOffset":6516,"count":0}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":6739,"endOffset":7031,"count":26}],"isBlockCoverage":true}]},{"scriptId":"1236","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/tab/src/components/FzTabPicker.vue","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":9407,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":9407,"count":1}],"isBlockCoverage":true},{"functionName":"setup","ranges":[{"startOffset":1996,"endOffset":3157,"count":0}],"isBlockCoverage":false},{"functionName":"_sfc_render","ranges":[{"startOffset":3273,"endOffset":5280,"count":0}],"isBlockCoverage":false}]},{"scriptId":"1237","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/composables/src/index.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":1445,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":1445,"count":1}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":470,"endOffset":515,"count":0}],"isBlockCoverage":false}]},{"scriptId":"1238","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/composables/src/FzFloating.vue","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":8012,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":8012,"count":1}],"isBlockCoverage":true},{"functionName":"setup","ranges":[{"startOffset":1716,"endOffset":3041,"count":0}],"isBlockCoverage":false},{"functionName":"_sfc_render","ranges":[{"startOffset":3111,"endOffset":4117,"count":0}],"isBlockCoverage":false}]},{"scriptId":"1239","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/composables/src/composables/index.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":806,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":806,"count":1}],"isBlockCoverage":true}]},{"scriptId":"1240","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/composables/src/composables/useFloating.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":26829,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":26829,"count":1}],"isBlockCoverage":true},{"functionName":"useFloating","ranges":[{"startOffset":690,"endOffset":8698,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":8799,"endOffset":8826,"count":0}],"isBlockCoverage":false}]},{"scriptId":"1241","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/composables/src/utils/index.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":7224,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":7224,"count":1}],"isBlockCoverage":true},{"functionName":"getHighestAvailableSpacePos","ranges":[{"startOffset":221,"endOffset":1791,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":1908,"endOffset":1951,"count":0}],"isBlockCoverage":false},{"functionName":"calcRealPos","ranges":[{"startOffset":1975,"endOffset":2125,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":2226,"endOffset":2253,"count":0}],"isBlockCoverage":false}]},{"scriptId":"1242","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/tab/%00plugin-vue:export-helper","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":1367,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":1367,"count":1}],"isBlockCoverage":true},{"functionName":"__vite_ssr_exports__.default","ranges":[{"startOffset":217,"endOffset":355,"count":8},{"startOffset":308,"endOffset":336,"count":17}],"isBlockCoverage":true}]},{"scriptId":"1243","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/composables/src/types.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":401,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":401,"count":1}],"isBlockCoverage":true}]},{"scriptId":"1244","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/icons/src/index.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":2417,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":2417,"count":1}],"isBlockCoverage":true},{"functionName":"install","ranges":[{"startOffset":930,"endOffset":1078,"count":0}],"isBlockCoverage":false},{"functionName":"get","ranges":[{"startOffset":1177,"endOffset":1222,"count":2}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":1324,"endOffset":1350,"count":0}],"isBlockCoverage":false}]},{"scriptId":"1252","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/icons/src/FzIcon.vue","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":6218,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":6218,"count":1}],"isBlockCoverage":true},{"functionName":"setup","ranges":[{"startOffset":1749,"endOffset":2666,"count":1}],"isBlockCoverage":true},{"functionName":"get FontAwesomeIcon","ranges":[{"startOffset":2374,"endOffset":2455,"count":1}],"isBlockCoverage":true},{"functionName":"get byPrefixAndName","ranges":[{"startOffset":2457,"endOffset":2538,"count":1}],"isBlockCoverage":true},{"functionName":"_sfc_render","ranges":[{"startOffset":2672,"endOffset":3397,"count":1},{"startOffset":3244,"endOffset":3257,"count":0},{"startOffset":3308,"endOffset":3316,"count":0}],"isBlockCoverage":true}]},{"scriptId":"1255","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/tab/src/common.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":974,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":974,"count":1}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":419,"endOffset":451,"count":26}],"isBlockCoverage":true}]},{"scriptId":"1256","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/tab/src/components/FzTabPickerValue.vue","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":5606,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":5606,"count":1}],"isBlockCoverage":true},{"functionName":"setup","ranges":[{"startOffset":1428,"endOffset":2454,"count":0}],"isBlockCoverage":false},{"functionName":"_sfc_render","ranges":[{"startOffset":2493,"endOffset":2914,"count":0}],"isBlockCoverage":false}]},{"scriptId":"1257","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/tab/src/components/FzTabName.vue","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":7744,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":7744,"count":1}],"isBlockCoverage":true},{"functionName":"setup","ranges":[{"startOffset":1830,"endOffset":2854,"count":12}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":2032,"endOffset":2401,"count":26},{"startOffset":2203,"endOffset":2229,"count":7},{"startOffset":2230,"endOffset":2327,"count":19},{"startOffset":2354,"endOffset":2376,"count":0}],"isBlockCoverage":true},{"functionName":"onClickTab","ranges":[{"startOffset":2427,"endOffset":2526,"count":1}],"isBlockCoverage":true},{"functionName":"get FzBadge","ranges":[{"startOffset":2596,"endOffset":2661,"count":2}],"isBlockCoverage":true},{"functionName":"get FzIcon","ranges":[{"startOffset":2663,"endOffset":2726,"count":2}],"isBlockCoverage":true},{"functionName":"_sfc_render","ranges":[{"startOffset":2941,"endOffset":4363,"count":26},{"startOffset":3260,"endOffset":3461,"count":2},{"startOffset":3462,"endOffset":3518,"count":24},{"startOffset":3737,"endOffset":4264,"count":2},{"startOffset":3901,"endOffset":3909,"count":1},{"startOffset":3910,"endOffset":3919,"count":1},{"startOffset":4265,"endOffset":4321,"count":24}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":4005,"endOffset":4196,"count":2}],"isBlockCoverage":true}]},{"scriptId":"1258","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/badge/src/index.ts","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":922,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":922,"count":1}],"isBlockCoverage":true},{"functionName":"get","ranges":[{"startOffset":458,"endOffset":503,"count":2}],"isBlockCoverage":true}]},{"scriptId":"1259","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/badge/src/FzBadge.vue","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":4449,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":4449,"count":1}],"isBlockCoverage":true},{"functionName":"setup","ranges":[{"startOffset":1245,"endOffset":2011,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":1695,"endOffset":1820,"count":2}],"isBlockCoverage":true},{"functionName":"_sfc_render","ranges":[{"startOffset":2017,"endOffset":2367,"count":2}],"isBlockCoverage":true}]},{"scriptId":"1260","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/tab/src/FzTab.vue","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":4064,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":4064,"count":1}],"isBlockCoverage":true},{"functionName":"setup","ranges":[{"startOffset":1422,"endOffset":2147,"count":12}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":1625,"endOffset":1665,"count":26}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":1704,"endOffset":1961,"count":12},{"startOffset":1746,"endOffset":1872,"count":0},{"startOffset":1905,"endOffset":1955,"count":0}],"isBlockCoverage":true},{"functionName":"_sfc_render","ranges":[{"startOffset":2153,"endOffset":2378,"count":26},{"startOffset":2248,"endOffset":2318,"count":7},{"startOffset":2319,"endOffset":2375,"count":19}],"isBlockCoverage":true}]},{"scriptId":"1261","url":"file:///Users/fiscozen/Documents/repository/design_system/packages/tab/src/FzTabs.vue","functions":[{"functionName":"","ranges":[{"startOffset":0,"endOffset":554,"count":1}],"isBlockCoverage":true},{"functionName":"","ranges":[{"startOffset":13,"endOffset":554,"count":1}],"isBlockCoverage":true}]}]}
package/package.json CHANGED
@@ -1,30 +1,20 @@
1
1
  {
2
2
  "name": "@fiscozen/tab",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Design System Tab component",
5
- "scripts": {
6
- "coverage": "vitest run --coverage",
7
- "format": "prettier --write src/",
8
- "test:unit": "vitest run",
9
- "build": "vue-tsc && vite build"
10
- },
11
5
  "main": "src/index.ts",
12
6
  "type": "module",
13
7
  "keywords": [],
14
8
  "author": "Cristian Barraco",
15
9
  "dependencies": {
16
- "@fiscozen/badge": "workspace:^",
17
- "@fiscozen/composables": "workspace:^"
10
+ "@fiscozen/composables": "^0.1.5",
11
+ "@fiscozen/badge": "^0.1.0"
18
12
  },
19
13
  "peerDependencies": {
20
14
  "tailwindcss": "^3.4.1",
21
15
  "vue": "^3.4.13"
22
16
  },
23
17
  "devDependencies": {
24
- "@fiscozen/eslint-config": "workspace:^",
25
- "@fiscozen/prettier-config": "workspace:^",
26
- "@fiscozen/tsconfig": "workspace:^",
27
- "@fiscozen/icons": "workspace:^",
28
18
  "@rushstack/eslint-patch": "^1.3.3",
29
19
  "@types/jsdom": "^21.1.6",
30
20
  "@types/node": "^18.19.3",
@@ -42,7 +32,17 @@
42
32
  "vue-tsc": "^1.8.25",
43
33
  "@awesome.me/kit-8137893ad3": "^1.0.65",
44
34
  "@fortawesome/fontawesome-svg-core": "^6.5.1",
45
- "@fortawesome/vue-fontawesome": "^3.0.6"
35
+ "@fortawesome/vue-fontawesome": "^3.0.6",
36
+ "@fiscozen/eslint-config": "^0.1.0",
37
+ "@fiscozen/tsconfig": "^0.1.0",
38
+ "@fiscozen/prettier-config": "^0.1.0",
39
+ "@fiscozen/icons": "^0.1.3"
46
40
  },
47
- "license": "MIT"
48
- }
41
+ "license": "MIT",
42
+ "scripts": {
43
+ "coverage": "vitest run --coverage",
44
+ "format": "prettier --write src/",
45
+ "test:unit": "vitest run",
46
+ "build": "vue-tsc && vite build"
47
+ }
48
+ }
package/src/FzTabs.vue CHANGED
@@ -1,18 +1,25 @@
1
1
  <template>
2
2
  <div :class="computedClassWrapper">
3
- <div :class="computedClass" ref="tabContainer" @wheel="onWheel">
4
- <FzTabPicker
5
- v-if="!horizontalOverflow && isOverflowing"
6
- :tabs="tabs"
7
- :size="size"
8
- />
9
- <FzTabName
10
- v-else
11
- v-for="tab in tabs"
12
- :tab="tab"
13
- :key="tab.title"
14
- :size="size"
15
- />
3
+ <div :class="['flex', computedClass]">
4
+ <div
5
+ :class="[staticTabContainerClass, computedClass]"
6
+ ref="tabContainer"
7
+ @wheel="onWheel"
8
+ >
9
+ <FzTabPicker
10
+ v-if="!horizontalOverflow && isOverflowing"
11
+ :tabs="tabs"
12
+ :size="size"
13
+ />
14
+ <FzTabName
15
+ v-else
16
+ v-for="tab in tabs"
17
+ :tab="tab"
18
+ :key="tab.title"
19
+ :size="size"
20
+ />
21
+ <slot name="tabs-container-end" />
22
+ </div>
16
23
  <slot name="tabs-end" />
17
24
  </div>
18
25
  <slot :selected="selectedTab"></slot>
@@ -20,7 +27,7 @@
20
27
  </template>
21
28
 
22
29
  <script setup lang="ts">
23
- import { computed, ref, onMounted, provide, useSlots, watch } from "vue";
30
+ import { computed, ref, onMounted, provide, useSlots, watch, VNode } from "vue";
24
31
  import { FzTabsProps, FzTabProps } from "./types";
25
32
  import FzTabPicker from "./components/FzTabPicker.vue";
26
33
  import FzTabName from "./components/FzTabName.vue";
@@ -48,15 +55,19 @@ const tabs = computed(() => {
48
55
  return tab.type === FzTab || typeof tab.type === "symbol";
49
56
  })
50
57
  .map((tab) => {
58
+ if (tab.type === FzTab) return tab.props as FzTabProps;
51
59
 
52
- if(tab.type === FzTab) return (tab.props as FzTabProps)
60
+ if (typeof tab.type === "symbol") {
61
+ const children = tab.children as VNode[];
62
+ if (!children) return null;
53
63
 
54
- const children = tab.children as any[];
55
- if (!children) return null;
56
-
57
- return children.map((child) => child.props as FzTabProps);;
64
+ return children
65
+ .filter((child) => child.type === FzTab)
66
+ .map((child) => child.props as FzTabProps);
67
+ }
58
68
  })
59
- .flat();
69
+ .flat()
70
+ .filter((el) => el != null);
60
71
  });
61
72
 
62
73
  const isOverflowing = computed(() => {
@@ -66,8 +77,10 @@ const isOverflowing = computed(() => {
66
77
  return tabContainer.value.scrollWidth > parent.clientWidth;
67
78
  });
68
79
 
80
+ const staticTabContainerClass =
81
+ "tab-container flex rounded-lg gap-8 p-2 bg-grey-100 w-fit max-w-full overflow-x-auto";
82
+
69
83
  const computedClass = computed(() => [
70
- "tab-container flex rounded-lg gap-8 p-2 bg-grey-100 w-fit max-w-full overflow-x-auto",
71
84
  props.vertical ? "flex-col" : "flex-row",
72
85
  ]);
73
86
 
@@ -2,80 +2,92 @@
2
2
 
3
3
  exports[`FzTabs > change tab 1`] = `
4
4
  "<div data-v-97c498eb="" class="flex flex-col">
5
- <div data-v-97c498eb="" class="tab-container flex rounded-lg gap-8 p-2 bg-grey-100 w-fit max-w-full overflow-x-auto flex-row"><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md text-grey-500 bg-grey-100 hover:bg-background-alice-blue active:bg-white active:text-blue-500 cursor-pointer" title="tab1">
6
- <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab1</span>
7
- <!--v-if-->
8
- </button><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md bg-white text-blue-500 cursor-pointer" title="tab2">
9
- <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab2</span>
10
- <!--v-if-->
11
- </button></div>
5
+ <div data-v-97c498eb="" class="flex flex-row">
6
+ <div data-v-97c498eb="" class="tab-container flex rounded-lg gap-8 p-2 bg-grey-100 w-fit max-w-full overflow-x-auto flex-row"><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md text-grey-500 bg-grey-100 hover:bg-background-alice-blue active:bg-white active:text-blue-500 cursor-pointer" title="tab1">
7
+ <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab1</span>
8
+ <!--v-if-->
9
+ </button><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md bg-white text-blue-500 cursor-pointer" title="tab2">
10
+ <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab2</span>
11
+ <!--v-if-->
12
+ </button></div>
13
+ </div>
12
14
  <!--v-if-->Content tab2
13
15
  </div>"
14
16
  `;
15
17
 
16
18
  exports[`FzTabs > renders with badgeContent on tab1 1`] = `
17
19
  "<div data-v-97c498eb="" class="flex flex-col">
18
- <div data-v-97c498eb="" class="tab-container flex rounded-lg gap-8 p-2 bg-grey-100 w-fit max-w-full overflow-x-auto flex-row"><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md bg-white text-blue-500 cursor-pointer" title="tab1" badgecontent="1">
19
- <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab1</span>
20
- <div class="text-xs px-12 rounded-xl w-fit h-20 flex items-center font-medium bg-blue-500 text-core-white" size="sm">1</div>
21
- </button><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md text-grey-500 bg-grey-100 hover:bg-background-alice-blue active:bg-white active:text-blue-500 cursor-pointer" title="tab2">
22
- <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab2</span>
23
- <!--v-if-->
24
- </button></div>Content tab1
20
+ <div data-v-97c498eb="" class="flex flex-row">
21
+ <div data-v-97c498eb="" class="tab-container flex rounded-lg gap-8 p-2 bg-grey-100 w-fit max-w-full overflow-x-auto flex-row"><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md bg-white text-blue-500 cursor-pointer" title="tab1" badgecontent="1">
22
+ <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab1</span>
23
+ <div class="text-xs px-12 rounded-xl w-fit h-20 flex items-center font-medium bg-blue-500 text-core-white" size="sm">1</div>
24
+ </button><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md text-grey-500 bg-grey-100 hover:bg-background-alice-blue active:bg-white active:text-blue-500 cursor-pointer" title="tab2">
25
+ <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab2</span>
26
+ <!--v-if-->
27
+ </button></div>
28
+ </div>Content tab1
25
29
  <!--v-if-->
26
30
  </div>"
27
31
  `;
28
32
 
29
33
  exports[`FzTabs > renders with base case 1`] = `
30
34
  "<div data-v-97c498eb="" class="flex flex-col">
31
- <div data-v-97c498eb="" class="tab-container flex rounded-lg gap-8 p-2 bg-grey-100 w-fit max-w-full overflow-x-auto flex-row"><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md bg-white text-blue-500 cursor-pointer" title="tab1">
32
- <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab1</span>
33
- <!--v-if-->
34
- </button><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md text-grey-500 bg-grey-100 hover:bg-background-alice-blue active:bg-white active:text-blue-500 cursor-pointer" title="tab2">
35
- <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab2</span>
36
- <!--v-if-->
37
- </button></div>Content tab1
35
+ <div data-v-97c498eb="" class="flex flex-row">
36
+ <div data-v-97c498eb="" class="tab-container flex rounded-lg gap-8 p-2 bg-grey-100 w-fit max-w-full overflow-x-auto flex-row"><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md bg-white text-blue-500 cursor-pointer" title="tab1">
37
+ <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab1</span>
38
+ <!--v-if-->
39
+ </button><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md text-grey-500 bg-grey-100 hover:bg-background-alice-blue active:bg-white active:text-blue-500 cursor-pointer" title="tab2">
40
+ <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab2</span>
41
+ <!--v-if-->
42
+ </button></div>
43
+ </div>Content tab1
38
44
  <!--v-if-->
39
45
  </div>"
40
46
  `;
41
47
 
42
48
  exports[`FzTabs > renders with icon on tab1 1`] = `
43
49
  "<div data-v-97c498eb="" class="flex flex-col">
44
- <div data-v-97c498eb="" class="tab-container flex rounded-lg gap-8 p-2 bg-grey-100 w-fit max-w-full overflow-x-auto flex-row"><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md bg-white text-blue-500 cursor-pointer" title="tab1" icon="bell">
45
- <div class="flex items-center justify-center w-[15px] h-[15px]"><svg class="svg-inline--fa fa-bell fa-sm h-[12px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="bell" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
46
- <path class="" fill="currentColor" d="M224 0c-17.7 0-32 14.3-32 32V51.2C119 66 64 130.6 64 208v25.4c0 45.4-15.5 89.5-43.8 124.9L5.3 377c-5.8 7.2-6.9 17.1-2.9 25.4S14.8 416 24 416H424c9.2 0 17.6-5.3 21.6-13.6s2.9-18.2-2.9-25.4l-14.9-18.6C399.5 322.9 384 278.8 384 233.4V208c0-77.4-55-142-128-156.8V32c0-17.7-14.3-32-32-32zm0 96c61.9 0 112 50.1 112 112v25.4c0 47.9 13.9 94.6 39.7 134.6H72.3C98.1 328 112 281.3 112 233.4V208c0-61.9 50.1-112 112-112zm64 352H224 160c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7s18.7-28.3 18.7-45.3z"></path>
47
- </svg></div><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab1</span>
48
- <!--v-if-->
49
- </button><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md text-grey-500 bg-grey-100 hover:bg-background-alice-blue active:bg-white active:text-blue-500 cursor-pointer" title="tab2">
50
- <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab2</span>
51
- <!--v-if-->
52
- </button></div>Content tab1
50
+ <div data-v-97c498eb="" class="flex flex-row">
51
+ <div data-v-97c498eb="" class="tab-container flex rounded-lg gap-8 p-2 bg-grey-100 w-fit max-w-full overflow-x-auto flex-row"><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md bg-white text-blue-500 cursor-pointer" title="tab1" icon="bell">
52
+ <div class="flex items-center justify-center w-[15px] h-[15px]"><svg class="svg-inline--fa fa-bell fa-sm h-[12px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="bell" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
53
+ <path class="" fill="currentColor" d="M224 0c-17.7 0-32 14.3-32 32V51.2C119 66 64 130.6 64 208v25.4c0 45.4-15.5 89.5-43.8 124.9L5.3 377c-5.8 7.2-6.9 17.1-2.9 25.4S14.8 416 24 416H424c9.2 0 17.6-5.3 21.6-13.6s2.9-18.2-2.9-25.4l-14.9-18.6C399.5 322.9 384 278.8 384 233.4V208c0-77.4-55-142-128-156.8V32c0-17.7-14.3-32-32-32zm0 96c61.9 0 112 50.1 112 112v25.4c0 47.9 13.9 94.6 39.7 134.6H72.3C98.1 328 112 281.3 112 233.4V208c0-61.9 50.1-112 112-112zm64 352H224 160c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7s18.7-28.3 18.7-45.3z"></path>
54
+ </svg></div><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab1</span>
55
+ <!--v-if-->
56
+ </button><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md text-grey-500 bg-grey-100 hover:bg-background-alice-blue active:bg-white active:text-blue-500 cursor-pointer" title="tab2">
57
+ <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab2</span>
58
+ <!--v-if-->
59
+ </button></div>
60
+ </div>Content tab1
53
61
  <!--v-if-->
54
62
  </div>"
55
63
  `;
56
64
 
57
65
  exports[`FzTabs > renders with md size 1`] = `
58
66
  "<div data-v-97c498eb="" class="flex flex-col">
59
- <div data-v-97c498eb="" class="tab-container flex rounded-lg gap-8 p-2 bg-grey-100 w-fit max-w-full overflow-x-auto flex-row"><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-md h-40 gap-8 py-12 px-14 rounded-lg bg-white text-blue-500 cursor-pointer" title="tab1">
60
- <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab1</span>
61
- <!--v-if-->
62
- </button><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-md h-40 gap-8 py-12 px-14 rounded-lg text-grey-500 bg-grey-100 hover:bg-background-alice-blue active:bg-white active:text-blue-500 cursor-pointer" title="tab2">
63
- <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab2</span>
64
- <!--v-if-->
65
- </button></div>Content tab1
67
+ <div data-v-97c498eb="" class="flex flex-row">
68
+ <div data-v-97c498eb="" class="tab-container flex rounded-lg gap-8 p-2 bg-grey-100 w-fit max-w-full overflow-x-auto flex-row"><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-md h-40 gap-8 py-12 px-14 rounded-lg bg-white text-blue-500 cursor-pointer" title="tab1">
69
+ <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab1</span>
70
+ <!--v-if-->
71
+ </button><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-md h-40 gap-8 py-12 px-14 rounded-lg text-grey-500 bg-grey-100 hover:bg-background-alice-blue active:bg-white active:text-blue-500 cursor-pointer" title="tab2">
72
+ <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab2</span>
73
+ <!--v-if-->
74
+ </button></div>
75
+ </div>Content tab1
66
76
  <!--v-if-->
67
77
  </div>"
68
78
  `;
69
79
 
70
80
  exports[`FzTabs > renders with vertical direction 1`] = `
71
81
  "<div data-v-97c498eb="" class="flex flex-row">
72
- <div data-v-97c498eb="" class="tab-container flex rounded-lg gap-8 p-2 bg-grey-100 w-fit max-w-full overflow-x-auto flex-col"><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md bg-white text-blue-500 cursor-pointer" title="tab1">
73
- <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab1</span>
74
- <!--v-if-->
75
- </button><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md text-grey-500 bg-grey-100 hover:bg-background-alice-blue active:bg-white active:text-blue-500 cursor-pointer" title="tab2">
76
- <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab2</span>
77
- <!--v-if-->
78
- </button></div>Content tab1
82
+ <div data-v-97c498eb="" class="flex flex-col">
83
+ <div data-v-97c498eb="" class="tab-container flex rounded-lg gap-8 p-2 bg-grey-100 w-fit max-w-full overflow-x-auto flex-col"><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md bg-white text-blue-500 cursor-pointer" title="tab1">
84
+ <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab1</span>
85
+ <!--v-if-->
86
+ </button><button data-v-97c498eb="" class="w-auto flex font-medium items-center max-w-[136px] text-sm h-40 gap-6 py-8 px-12 rounded-md text-grey-500 bg-grey-100 hover:bg-background-alice-blue active:bg-white active:text-blue-500 cursor-pointer" title="tab2">
87
+ <!--v-if--><span class="text-ellipsis whitespace-nowrap overflow-hidden">tab2</span>
88
+ <!--v-if-->
89
+ </button></div>
90
+ </div>Content tab1
79
91
  <!--v-if-->
80
92
  </div>"
81
93
  `;