/*
 * 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 RULE_NAME="oj-html-form-layout-maxcols";const DESCRIPTION="Prior to JET 10.0.0, maxColumns in 'row' direction was not responsive, so that the "+"number of columns was exactly equal to maxColumns. In JET 10.0.0 and later, maxColumns "+"<b>is</b> responsive, so that the actual number of columns may now be less, depending on the "+"space available to the form.<br>If the app needs to preserve the old fixed-columns behavior, "+"then the <oj-form-layout> 'max-columns' attribute should be replaced with the new "+"'columns' attribute.";const SHORT_DESCRIPTION="For <oj-form-layout>, the 'max-columns' attribute may have a behavioral change in JET 10.0.0.";const MAX_COLUMNS="max-columns";const COLUMNS="columns";const COLUMN="column";const DIRECTION="direction";const ISSUE="<oj-form-layout> with 'max-columns' may have a behavior change in JET 10.0.0.";class Rule{getName(){return RULE_NAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-form-layout>":this._onTag}}_onTag(ruleCtx){if(_isGT(_getTagAttr(ruleCtx,MAX_COLUMNS),1)){if(!_hasTagAttr(ruleCtx,COLUMNS)||_getTagAttr(ruleCtx,DIRECTION)===COLUMN){let issue=new ruleCtx.Issue(ISSUE);let pos=ruleCtx.utils.DomUtils.getAttribPosition(ruleCtx.data,ruleCtx.node,MAX_COLUMNS);issue.setPosition(pos.row,pos.col,pos.start,pos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}function _hasTagAttr(ruleCtx,attr){var attrs=ruleCtx.tagNode.attribs;return attrs?attrs.hasOwnProperty(attr):false}function _getTagAttr(ruleCtx,attr){var attrs=ruleCtx.tagNode.attribs;return attrs?attrs[attr]:null}function _isGT(val,n){val=parseInt(val);return!isNaN(val)&&val>n}module.exports=Rule;