diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift index dae0e818..e070b8e6 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift @@ -68,6 +68,7 @@ import VDS size = viewModel.size selectedIndex = viewModel.selectedIndex surface = viewModel.style ?? .light + fillContainer = viewModel.fillContainer tabModels = viewModel.tabs.compactMap { TabModel(text: $0.label.text) } } } diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift index 648357b3..24933f45 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift @@ -21,6 +21,7 @@ open class TabsModel: MoleculeModelProtocol { open var orientation: Tabs.Orientation = .horizontal open var indicatorPosition: Tabs.IndicatorPosition = .bottom open var overflow: Tabs.Overflow = .scroll + open var fillContainer: Bool = false open var size: Tabs.Size = .medium public var backgroundColor: Color? @@ -35,6 +36,7 @@ open class TabsModel: MoleculeModelProtocol { case selectedIndex case orientation case indicatorPosition + case fillContainer case overflow case size case style @@ -49,6 +51,11 @@ open class TabsModel: MoleculeModelProtocol { id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString tabs = try typeContainer.decode([TabItemModel].self, forKey: .tabs) style = try typeContainer.decodeIfPresent(Surface.self, forKey: .style) + + if let fillContainer = try typeContainer.decodeIfPresent(Bool.self, forKey: .fillContainer) { + self.fillContainer = fillContainer + } + if let index = try typeContainer.decodeIfPresent(Int.self, forKey: .selectedIndex) { selectedIndex = index } @@ -76,6 +83,7 @@ open class TabsModel: MoleculeModelProtocol { try container.encode(moleculeName, forKey: .moleculeName) try container.encode(tabs, forKey: .tabs) try container.encode(selectedIndex, forKey: .selectedIndex) + try container.encode(fillContainer, forKey: .fillContainer) try container.encodeIfPresent(style, forKey: .style) try container.encode(orientation, forKey: .orientation) try container.encode(overflow, forKey: .overflow)