Total Complexity | 10 |
Complexity/F | 1.25 |
Lines of Code | 32 |
Function Count | 8 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | /** |
||
5 | import {DIALOG_TYPES, CONFIRM_TYPES} from '../constants' |
||
6 | |||
7 | export default { |
||
8 | computed: { |
||
9 | cancelBtnDisabled(){ |
||
10 | return (this.options.window === DIALOG_TYPES.ALERT) |
||
11 | }, |
||
12 | okBtnDisabled(){ |
||
13 | return (this.options.window === DIALOG_TYPES.CONFIRM) |
||
14 | && (this.options.type === CONFIRM_TYPES.HARD) |
||
15 | && (this.input !== this.options.verification) |
||
16 | }, |
||
17 | leftBtnEnabled(){ |
||
18 | return (this.cancelBtnDisabled === false) || (this.options.reverse === true) |
||
19 | }, |
||
20 | rightBtnEnabled(){ |
||
21 | return (this.cancelBtnDisabled === false) || (this.options.reverse === false) |
||
22 | }, |
||
23 | leftBtnFocus(){ |
||
24 | return !this.isHardConfirm && (this.options.reverse === true) |
||
25 | }, |
||
26 | rightBtnFocus(){ |
||
27 | return !this.isHardConfirm && (this.options.reverse === false) |
||
28 | }, |
||
29 | leftBtnText(){ |
||
30 | return this.options.reverse ? this.options.okText : this.options.cancelText |
||
31 | }, |
||
32 | rightBtnText(){ |
||
33 | return this.options.reverse ? this.options.cancelText : this.options.okText |
||
34 | } |
||
35 | } |
||
36 | } |