/*
 * 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 RULENAME="oj-tsx-picker-attrs";const DESCRIPTION="Property 'pickerAttributes' sub-property 'style' violates the recommended Content Security Policy (CSP) which disallows inline styles, and is therefore ignored in JET 11.0.";const SHORT_DESCRIPTION="Property 'pickerAttributes' sub-property 'style' is a CSP violation (no inline styles), and is ignored.";const MSG="'pickerAttributes' sub-property 'style' is ignored in JET 11.0.0, and is a CSP violation - use sub-property 'class'";const PICKER_ATTRIB="pickerAttributes";const JSX_SPREAD_ATTRIBUTE="JSXSpreadAttribute";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._tsxUtils=regCtx.utils.tsxUtils;return{"Tsx<oj-input-date>":this._onTag,"Tsx<oj-input-date-time>":this._onTag,"Tsx<oj-input-time>":this._onTag,"Tsx<oj-date-picker>":this._onTag,"Tsx<oj-date-time-picker>":this._onTag,"Tsx<oj-select-many>":this._onTag,"Tsx<oj-combobox-many>":this._onTag,"Tsx<oj-combobox-one>":this._onTag}}_onTag(ruleCtx,tsxComp){var tsxProps,tsxProp,i;if(tsxProps=tsxComp.properties){for(i=0;i<tsxProps.length;i++){tsxProp=tsxProps[i];if(tsxProp.node.type===JSX_SPREAD_ATTRIBUTE){continue}if(tsxProp.name.startsWith(PICKER_ATTRIB)){let obj=this._tsxUtils.getExpressionObject(tsxProp);if(obj&&obj.style){let issue=new ruleCtx.Issue(MSG);this._tsxUtils.setIssuePosition(issue,tsxProp);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}}}module.exports=Rule;