/*
 * Copyright (c) 2018, 2025, Oracle and/or its affiliates.
 * Licensed under The Universal Permissive License (UPL), Version 1.0
 * as shown at https://oss.oracle.com/licenses/upl/
 */
const RULE="oj-tsx-acc-button-onclick";const LONG="The ojAction event should be used in place of onClick for button-like components, because it is triggered by both mouse and keyboard.";const SHORT="The ojAction event should be used in place of onClick for button-like components.";const ON_CLICK="onClick";class Rule{getName(){return RULE}getDescription(){return LONG}getShortDescription(){return SHORT}register(regCtx){this._tsxUtils=regCtx.utils.tsxUtils;return{"Tsx<oj-action-card>":this._onBtn,"Tsx<oj-button>":this._onBtn,"Tsx<oj-menu-button>":this._onBtn,"Tsx<oj-c-button>":this._onBtn}}_onBtn(ruleCtx,tsxComp){var tsxProp;if(tsxProp=this._tsxUtils.getProperty(tsxComp,ON_CLICK)){let issue=new ruleCtx.Issue(`<${tsxComp.name}> 'onClick' event attribute - replace with 'onOjAction'`);this._tsxUtils.setIssuePosition(issue,tsxProp);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;