/*
 * Copyright (c) 2018, 2026, 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-tabbar-progressive-popup";const DESCRIPTION="For JET 18.0.0 and later, <oj-tab-bar> truncation=\"progressive\" should always be used with "+"overflow=\"popup\" for handling overflow properly. If truncation=\"progressive\" is used alone, "+"for long labels it is possible that all items may not fit within oj-tab-bar despite being truncated.";const SHORT_DESCRIPTION="For <oj-tab-bar>, truncation=\"progressive\" requires overflow=\"popup\" to avoid pssible truncation.";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._tsxUtils=regCtx.utils.tsxUtils;return{"Tsx<oj-tab-bar truncation=>":this._onTabBar}}_onTabBar(ruleCtx,tsxProp){if(this._tsxUtils.getPropertyStringValue(tsxProp)==="progressive"){if(!this._hasPropWithValue(tsxProp.parent,"overflow","popup")){let issue=new ruleCtx.Issue("<oj-tab-bar> 'overflow' property must be set to \"popup\" if truncation=\"progressive\"");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}_hasPropWithValue(tsxComp,propName,propValue){var tsxProp,val,ret=false;if(tsxProp=this._tsxUtils.getProperty(tsxComp,propName)){if(val=this._tsxUtils.getPropertyStringValue(tsxProp)){ret=val===propValue}}return ret}}module.exports=Rule;