1protected get ButtonClass(): object {
2 const buttonClass = {
3 'cursor-pointer hover:shadow focus:shadow': this.Enabled,
4 'opacity-40 cursor-not-allowed': !this.Enabled,
5 'whitespace-no-wrap': !this.LineBreaks
6 }
7 // The below allows you to define object properties based on a variable.
8 // If you were to assign them in the snippet above, it would cause an error.
9 buttonClass[`hover:${this.Color.FocusColorClass}`] = this.Enabled;
10 buttonClass[`focus:${this.Color.FocusColorClass}`] = this.Enabled;
11 buttonClass[`active:${this.Color.ActiveColorClass}`] = this.Enabled;
12 return buttonClass;
13 }