refactored naming
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
e08de8fb3e
commit
2854aea8c2
@ -21,7 +21,7 @@
|
||||
1855EC662BAABF2A002ACAC2 /* BreadcrumbItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1855EC652BAABF2A002ACAC2 /* BreadcrumbItemModel.swift */; };
|
||||
186D13CB2BBA8B1500986B53 /* DropdownSelect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 186D13CA2BBA8B1500986B53 /* DropdownSelect.swift */; };
|
||||
18792A902B7431F2008C0D29 /* ButtonIconBadgeIndicatorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18792A8F2B7431F2008C0D29 /* ButtonIconBadgeIndicatorModel.swift */; };
|
||||
18926F5B2C7616A500C55BF6 /* Footnote.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18926F5A2C7616A500C55BF6 /* Footnote.swift */; };
|
||||
18926F5B2C7616A500C55BF6 /* FootnoteItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18926F5A2C7616A500C55BF6 /* FootnoteItem.swift */; };
|
||||
18926F5D2C7616C600C55BF6 /* FootnoteChangeLog.txt in Resources */ = {isa = PBXBuildFile; fileRef = 18926F5C2C7616C600C55BF6 /* FootnoteChangeLog.txt */; };
|
||||
18A3F12A2BD9298900498E4A /* Calendar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A3F1292BD9298900498E4A /* Calendar.swift */; };
|
||||
18A65A022B96E848006602CC /* Breadcrumbs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A65A012B96E848006602CC /* Breadcrumbs.swift */; };
|
||||
@ -233,7 +233,7 @@
|
||||
186D13CA2BBA8B1500986B53 /* DropdownSelect.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DropdownSelect.swift; sourceTree = "<group>"; };
|
||||
186D13CE2BBC36EE00986B53 /* DropdownSelectChangeLog.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = DropdownSelectChangeLog.txt; sourceTree = "<group>"; };
|
||||
18792A8F2B7431F2008C0D29 /* ButtonIconBadgeIndicatorModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonIconBadgeIndicatorModel.swift; sourceTree = "<group>"; };
|
||||
18926F5A2C7616A500C55BF6 /* Footnote.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Footnote.swift; sourceTree = "<group>"; };
|
||||
18926F5A2C7616A500C55BF6 /* FootnoteItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FootnoteItem.swift; sourceTree = "<group>"; };
|
||||
18926F5C2C7616C600C55BF6 /* FootnoteChangeLog.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = FootnoteChangeLog.txt; sourceTree = "<group>"; };
|
||||
18A3F1292BD9298900498E4A /* Calendar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Calendar.swift; sourceTree = "<group>"; };
|
||||
18A65A012B96E848006602CC /* Breadcrumbs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Breadcrumbs.swift; sourceTree = "<group>"; };
|
||||
@ -505,7 +505,7 @@
|
||||
18926F592C76168300C55BF6 /* Footnote */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
18926F5A2C7616A500C55BF6 /* Footnote.swift */,
|
||||
18926F5A2C7616A500C55BF6 /* FootnoteItem.swift */,
|
||||
183B16F62C80B32200BA6A10 /* FootnoteGroup.swift */,
|
||||
18926F5C2C7616C600C55BF6 /* FootnoteChangeLog.txt */,
|
||||
);
|
||||
@ -1328,7 +1328,7 @@
|
||||
18B463A42BBD3C46005C4528 /* DropdownOptionModel.swift in Sources */,
|
||||
EAF2F4762C231EAA007BFEDC /* AccessibilityActionElement.swift in Sources */,
|
||||
EAC58BFD2BE935C300BA39FA /* TitleLockupTextColor.swift in Sources */,
|
||||
18926F5B2C7616A500C55BF6 /* Footnote.swift in Sources */,
|
||||
18926F5B2C7616A500C55BF6 /* FootnoteItem.swift in Sources */,
|
||||
EAACB89A2B927108006A3869 /* Valuing.swift in Sources */,
|
||||
EAE785312BA0A438009428EA /* UIImage+Helper.swift in Sources */,
|
||||
EAF193422C134F3400C68D18 /* Table.swift in Sources */,
|
||||
|
||||
@ -42,7 +42,7 @@ open class FootnoteGroup: View {
|
||||
// MARK: - Public Properties
|
||||
//--------------------------------------------------
|
||||
/// Array of ``Footnote`` for the Footnote items.
|
||||
open var footnoteItems: [Footnote] = [] { didSet { setNeedsUpdate() } }
|
||||
open var footnoteItems: [FootnoteItem] = [] { didSet { setNeedsUpdate() } }
|
||||
|
||||
/// Any percentage or pixel value and cannot exceed container size.
|
||||
/// If there is a width that is larger than container size, the footnote will resize to container's width.
|
||||
@ -132,7 +132,7 @@ open class FootnoteGroup: View {
|
||||
var symbolMaxWidth = 0.0
|
||||
if footnoteItems.count > 0 {
|
||||
for index in 0...footnoteItems.count - 1 {
|
||||
let footnote: Footnote = footnoteItems[index]
|
||||
let footnote: FootnoteItem = footnoteItems[index]
|
||||
let separatorWidth = Label().with { $0.text = footnote.symbolType; $0.sizeToFit() }.intrinsicContentSize.width
|
||||
symbolMaxWidth = separatorWidth > symbolMaxWidth ? separatorWidth : symbolMaxWidth
|
||||
}
|
||||
@ -142,8 +142,8 @@ open class FootnoteGroup: View {
|
||||
// add symbol label, text label to stack.
|
||||
if footnoteItems.count > 0 {
|
||||
for index in 0...footnoteItems.count - 1 {
|
||||
let footnote: Footnote = footnoteItems[index]
|
||||
footnote.symbolWiderWidth = symbolMaxWidth
|
||||
let footnote: FootnoteItem = footnoteItems[index]
|
||||
footnote.symbolWidth = symbolMaxWidth
|
||||
footnote.surface = surface
|
||||
stackView.addArrangedSubview(footnote)
|
||||
}
|
||||
|
||||
@ -12,8 +12,8 @@ import VDSCoreTokens
|
||||
/// A footnote is text that provides supporting details, legal copy and links to related content.
|
||||
/// It exists at the bottom or "foot" of a page or section.
|
||||
@objcMembers
|
||||
@objc(VDSFootnote)
|
||||
open class Footnote: View {
|
||||
@objc(VDSFootnoteItem)
|
||||
open class FootnoteItem: View {
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
@ -122,7 +122,7 @@ open class Footnote: View {
|
||||
}
|
||||
|
||||
/// To set the widest symbol width from the symbol container in the group.
|
||||
open var symbolWiderWidth: CGFloat = 0 { didSet { setNeedsUpdate() } }
|
||||
internal var symbolWidth: CGFloat? { didSet { setNeedsUpdate() } }
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Private Properties
|
||||
@ -210,7 +210,6 @@ open class Footnote: View {
|
||||
super.updateView()
|
||||
|
||||
// Update symbolLabel
|
||||
symbolWidthConstraint?.isActive = false
|
||||
symbolLabel.text = symbolType
|
||||
symbolLabel.isHidden = hideSymbol
|
||||
symbolLabel.textColor = kind.colorConfiguration.getColor(self)
|
||||
@ -218,13 +217,12 @@ open class Footnote: View {
|
||||
symbolLabel.surface = surface
|
||||
|
||||
//Set width to the symbol label
|
||||
if symbolWiderWidth > 0 {
|
||||
if let symbolWidth, symbolWidth > 0 {
|
||||
// Set the widest symbol width from the symbol container in the group.
|
||||
symbolWidthConstraint = symbolLabel.widthAnchor.constraint(equalToConstant: symbolWiderWidth)
|
||||
symbolWidthConstraint?.constant = symbolWidth
|
||||
} else {
|
||||
symbolWidthConstraint = symbolLabel.widthAnchor.constraint(equalToConstant: symbolLabel.intrinsicContentSize.width)
|
||||
symbolWidthConstraint?.constant = symbolLabel.intrinsicContentSize.width
|
||||
}
|
||||
symbolWidthConstraint?.isActive = true
|
||||
|
||||
// Update textLabel
|
||||
textLabel.text = text
|
||||
Loading…
Reference in New Issue
Block a user