src/components/sq-button/sq-button.component.ts
Represents the SqButtonComponent, a customizable button component.
Look the link about the component in original framework and the appearance
See https://css.squidit.com.br/components/button
selector | sq-button |
styleUrls | ./sq-button.component.scss |
templateUrl | ./sq-button.component.html |
Properties |
|
Methods |
Inputs |
Outputs |
constructor(element: ElementRef, colorsHelper: ColorsHelper)
|
||||||||||||
Constructor for the SqButtonComponent class.
Parameters :
|
block | |
Type : boolean
|
|
Indicates whether the button should occupy the full width of its container. |
borderColor | |
Type : string
|
|
Default value : ''
|
|
The border color of the button. |
borderRadius | |
Type : string
|
|
Default value : ''
|
|
The border radius of the button. |
borderStyle | |
Type : string
|
|
Default value : ''
|
|
The border style of the button. |
borderWidth | |
Type : string
|
|
Default value : ''
|
|
The width of the button border. |
boxShadow | |
Type : string
|
|
The box shadow of the button. |
buttonAsLink | |
Type : boolean
|
|
Indicates whether the button should be styled as a link. |
color | |
Type : string
|
|
Default value : 'primary'
|
|
The background color of the button. |
disabled | |
Type : boolean
|
|
Indicates whether the button is disabled. |
fontSize | |
Type : string
|
|
The font size of the button. |
hideOnLoading | |
Type : boolean
|
|
Indicates whether the button should be hidden during the loading state. |
id | |
Type : string
|
|
The ID attribute of the button. |
invertedHover | |
Type : boolean
|
|
Default value : false
|
|
Indicates whether the button should have inverted hover colors. |
loading | |
Type : boolean
|
|
Indicates whether the button is in a loading state. |
noPadding | |
Type : boolean
|
|
Indicates whether to remove padding from the button. |
noUnderline | |
Type : boolean
|
|
Indicates whether the button text should have no underline. |
size | |
Type : "sm" | "md" | "lg" | "xl"
|
|
Default value : 'md'
|
|
The size of the button ('sm', 'md', 'lg', 'xl'). |
textColor | |
Type : string
|
|
Default value : ''
|
|
The text color of the button. |
textTransform | |
Type : string
|
|
Default value : ''
|
|
The text transformation of the button text (e.g., 'uppercase', 'lowercase'). |
type | |
Type : "submit" | "reset" | "button"
|
|
Default value : 'button'
|
|
The type of the button (e.g., 'button', 'submit', 'reset'). |
width | |
Type : string
|
|
The width of the button. |
emitClick | |
Type : EventEmitter<MouseEvent>
|
|
Event emitter for when the button is clicked. |
doHoverOnBackground |
doHoverOnBackground()
|
Determines the background color when hovering.
Returns :
any
The background color when hovering. |
doHoverOnBorder |
doHoverOnBorder()
|
Determines the border color when hovering.
Returns :
any
The border color when hovering. |
doHoverOnText |
doHoverOnText()
|
Determines the text color when hovering.
Returns :
any
The text color when hovering. |
executeFunction | ||||||||
executeFunction(event: MouseEvent)
|
||||||||
Executes a function when the button is clicked.
Parameters :
Returns :
void
|
setHover | ||||||||
setHover(color: string)
|
||||||||
Sets the hover color.
Parameters :
Returns :
any
The color with the hover effect applied. |
setHoverBg |
setHoverBg()
|
Sets the hover background color.
Returns :
any
The background color with the hover effect applied. |
setHoverText |
setHoverText()
|
Sets the hover text color.
Returns :
any
The text color with the hover effect applied. |
validatePresetColors |
validatePresetColors()
|
Validates if the preset colors are set correctly.
Returns :
boolean
True if the color is set correctly; otherwise, false. |
Public colorsHelper |
Type : ColorsHelper
|
- The ColorsHelper service for color manipulation.
|
Public element |
Type : ElementRef
|
- The ElementRef representing the button element.
|
hover |
Default value : false
|
Indicates whether the mouse is hovering over the button. |
nativeElement |
Type : ElementRef
|
The native element of the button. |
./sq-button.component.scss