(opt: Dictionary<any>, optType: string, useExtend?: boolean)
| 70 | } |
| 71 | |
| 72 | function convertNormalEmphasis(opt: Dictionary<any>, optType: string, useExtend?: boolean) { |
| 73 | if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) { |
| 74 | const normalOpt = opt[optType].normal; |
| 75 | const emphasisOpt = opt[optType].emphasis; |
| 76 | |
| 77 | if (normalOpt) { |
| 78 | if (__DEV__) { |
| 79 | // eslint-disable-next-line max-len |
| 80 | deprecateLog(`'normal' hierarchy in ${optType} has been removed since 4.0. All style properties are configured in ${optType} directly now.`); |
| 81 | } |
| 82 | // Timeline controlStyle has other properties besides normal and emphasis |
| 83 | if (useExtend) { |
| 84 | opt[optType].normal = opt[optType].emphasis = null; |
| 85 | zrUtil.defaults(opt[optType], normalOpt); |
| 86 | } |
| 87 | else { |
| 88 | opt[optType] = normalOpt; |
| 89 | } |
| 90 | } |
| 91 | if (emphasisOpt) { |
| 92 | if (__DEV__) { |
| 93 | deprecateLog(`${optType}.emphasis has been changed to emphasis.${optType} since 4.0`); |
| 94 | } |
| 95 | opt.emphasis = opt.emphasis || {}; |
| 96 | opt.emphasis[optType] = emphasisOpt; |
| 97 | |
| 98 | // Also compat the case user mix the style and focus together in ec3 style |
| 99 | // for example: { itemStyle: { normal: {}, emphasis: {focus, shadowBlur} } } |
| 100 | if (emphasisOpt.focus) { |
| 101 | opt.emphasis.focus = emphasisOpt.focus; |
| 102 | } |
| 103 | if (emphasisOpt.blurScope) { |
| 104 | opt.emphasis.blurScope = emphasisOpt.blurScope; |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | function removeEC3NormalStatus(opt: Dictionary<any>) { |
| 111 | convertNormalEmphasis(opt, 'itemStyle'); |
no test coverage detected
searching dependent graphs…