87 lines
3.6 KiB
Swift
87 lines
3.6 KiB
Swift
//
|
|
// ButtonIconBadgeIndicatorModel.swift
|
|
// VDS
|
|
//
|
|
// Created by Kanamarlapudi, Vasavi on 08/02/24.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension ButtonIcon {
|
|
|
|
//Model that represents the options available for the Badge Indicator
|
|
public struct BadgeIndicatorModel: Equatable {
|
|
/// Enum used to describe the badge indicator direction of icon button determining the expand direction.
|
|
public enum ExpandDirection: String, CaseIterable {
|
|
case right, center, left
|
|
}
|
|
|
|
/// Applies expand direction to Badge Indicator if shows badge indicator.
|
|
public var expandDirection: ExpandDirection = .right
|
|
|
|
/// Kind that will be used for the badge indicator.
|
|
public var kind: BadgeIndicator.Kind
|
|
|
|
/// Fill color that will be used for the badge indicator.
|
|
public var fillColor: BadgeIndicator.FillColor
|
|
|
|
/// Size that will be used for the badge indicator.
|
|
public var size: BadgeIndicator.Size
|
|
|
|
/// Number of digits that will be used for the badge indicator.
|
|
public var maximumDigits: BadgeIndicator.MaximumDigits
|
|
|
|
/// Max width that will be used for the badge indicator.
|
|
public var width: CGFloat?
|
|
|
|
/// Max height that will be used for the badge indicator.
|
|
public var height: CGFloat?
|
|
|
|
/// Number that will be used for the badge indicator.
|
|
public var number: Int?
|
|
|
|
/// Leading Character that will be used for the badge indicator.
|
|
public var leadingCharacter: String?
|
|
|
|
/// Trailing Text height that will be used for the badge indicator.
|
|
public var trailingText: String?
|
|
|
|
/// Accessibliity Text
|
|
public var accessibilityText: String?
|
|
|
|
/// Dot Size that will be used for the badge indicator.
|
|
public var dotSize: CGFloat?
|
|
|
|
/// Vertical Padding that will be used for the badge indicator.
|
|
public var verticalPadding: CGFloat?
|
|
|
|
/// Horizontal Padding that will be used for the badge indicator.
|
|
public var horizontalPadding: CGFloat?
|
|
|
|
/// Hide Dot that will be used for the badge indicator.
|
|
public var hideDot: Bool = false
|
|
|
|
/// Hide Border that will be used for the badge indicator.
|
|
public var hideBorder: Bool = false
|
|
|
|
public init(kind: BadgeIndicator.Kind = .simple, fillColor: BadgeIndicator.FillColor = .red, expandDirection: ExpandDirection = .right, size: BadgeIndicator.Size = .xxlarge, maximumDigits: BadgeIndicator.MaximumDigits = .two, width: CGFloat? = nil, height: CGFloat? = nil, number: Int? = nil, leadingCharacter: String? = "", trailingText: String? = "", accessibilityText: String? = nil, dotSize: CGFloat? = nil, verticalPadding: CGFloat? = nil, horizontalPadding: CGFloat? = nil, hideDot: Bool = false, hideBorder: Bool = false) {
|
|
self.kind = kind
|
|
self.fillColor = fillColor
|
|
self.expandDirection = expandDirection
|
|
self.size = size
|
|
self.maximumDigits = maximumDigits
|
|
self.width = width
|
|
self.height = height
|
|
self.number = number
|
|
self.accessibilityText = accessibilityText
|
|
self.leadingCharacter = leadingCharacter
|
|
self.trailingText = trailingText
|
|
self.dotSize = dotSize
|
|
self.verticalPadding = verticalPadding
|
|
self.horizontalPadding = horizontalPadding
|
|
self.hideDot = hideDot
|
|
self.hideBorder = hideBorder
|
|
}
|
|
}
|
|
}
|