@fiscozen/tab 0.1.0 → 0.1.1

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiscozen/tab",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Design System Tab component",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
package/src/FzTab.vue CHANGED
@@ -14,7 +14,7 @@ const isActive = computed(() => selectedTab?.value === props.title);
14
14
  onMounted(() => {
15
15
  if (selectedTab === undefined) {
16
16
  console.error(
17
- "[Fiscozen Design System]: FzTab must be used inside a FzTabs component"
17
+ "[Fiscozen Design System]: FzTab must be used inside a FzTabs component",
18
18
  );
19
19
  } else if (props.initialSelected) {
20
20
  selectedTab.value = props.title;
package/src/FzTabs.vue CHANGED
@@ -45,9 +45,13 @@ const tabs = computed(() => {
45
45
  return slots
46
46
  .default()
47
47
  .filter((tab) => {
48
- return tab.type === FzTab;
48
+ return tab.type === FzTab || typeof tab.type === "symbol";
49
49
  })
50
- .map((tab) => tab.props as FzTabProps);
50
+ .map((tab) => {
51
+ const props =
52
+ tab.type === FzTab ? tab.props : (tab.children as any)[0].props;
53
+ return props as FzTabProps;
54
+ });
51
55
  });
52
56
 
53
57
  const isOverflowing = computed(() => {
@@ -77,7 +81,7 @@ function onWheel(e: WheelEvent) {
77
81
  onMounted(() => {
78
82
  if (tabs.value.length === 0) {
79
83
  console.error(
80
- "[Fiscozen Design System]: FzTabs must have at least one FzTab child"
84
+ "[Fiscozen Design System]: FzTabs must have at least one FzTab child",
81
85
  );
82
86
  return;
83
87
  }
@@ -93,5 +93,5 @@ describe("FzTabs", () => {
93
93
  );
94
94
 
95
95
  expect(wrapper.html()).toMatchSnapshot();
96
- })
96
+ });
97
97
  });