/*
 * 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-html-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 that overflow=\"popup\" to avoid pssible truncation.";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-tab-bar truncation=>":this._onTabBar}}_onTabBar(ruleCtx,attrName,attrValue){if(attrValue==="progressive"){if(!this._hasAttribValue(ruleCtx,"overflow","popup")){let issue=new ruleCtx.Issue("<oj-tab-bar> 'overflow' attribute must be set to \"popup\" if truncation=\"progressive\"");ruleCtx.reporter.addIssue(issue,ruleCtx)}}}_hasAttribValue(ruleCtx,attrName,attrValue){var attribs,ret=false;if(attribs=ruleCtx.tagNode.attribs){let val;if((val=attribs[attrName])&&val===attrValue){ret=true}}return ret}}module.exports=Rule;