(option: Option<Value>, active: boolean)
| 117 | const value = this.value ?? []; |
| 118 | |
| 119 | const styleOption = (option: Option<Value>, active: boolean) => { |
| 120 | if (option.disabled) { |
| 121 | return opt(option, 'disabled'); |
| 122 | } |
| 123 | const selected = value.includes(option.value); |
| 124 | if (active && selected) { |
| 125 | return opt(option, 'active-selected'); |
| 126 | } |
| 127 | if (selected) { |
| 128 | return opt(option, 'selected'); |
| 129 | } |
| 130 | return opt(option, active ? 'active' : 'inactive'); |
| 131 | }; |
| 132 | |
| 133 | switch (this.state) { |
| 134 | case 'submit': { |