import Action from './Action';
import Rule from './Rule';

export default class ValueRule extends Rule {
    constructor(prefix, suffix, event, css, xpath, code, key, contextURL, contextCSS, contextXPath) {
        super(prefix, suffix, event, css, xpath, code, key, contextURL, contextCSS, contextXPath);
    }

    makeAction(event): Action {
        return new Action(this.prefix, event.target.value);
    }

    actionToElements(action: Action): Element[] {
        if (action.prefix !== this.prefix) {
            return [];
        }
        let elements = this.findMatchedElements();
        return elements;
    }
}
