/*
 * 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-form-layout-colspan-wrap";const DESCRIPTION="When an <oj-form-layout> has <oj-label-value> children that specify a 'colspan' "+"property, oj-form-layout's 'colspanWrap' property specifies the column spanning "+"behavior.  The 'nowrap' behavior has been deprecated as it is not specified by "+"the Redwood Design System.  In these cases, colspanWrap=\"wrap\" needs to be specified "+"on the <oj-form-layout> so that it will produce the correct layout as specified "+"by the Redwood Design System.";const SHORT_DESCRIPTION=DESCRIPTION;const ISSUE="<oj-form-layout> has column spanning elements, and the 'colspanWrap' property's default value "+"'nowrap' has been deprecated.  Please add colspanWrap=\"wrap\" to avoid using this deprecated "+"value and producing a layout that is no longer supported.";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._tsxUtils=regCtx.utils.tsxUtils;return{"Tsx<oj-form-layout>":this._onFormLayout}}_onFormLayout(ruleCtx,tsxComp){var props,prop,ojLabelValues,val,node,i;props=tsxComp.properties;if(props&&props.length){if(prop=this._tsxUtils.getProperty(tsxComp,"colspanWrap")){val=this._tsxUtils.getPropertyStringValue(prop);if(val==="wrap"){return}}}if(!(ojLabelValues=this._getOjLabelValueDirectChilds(tsxComp))){return}for(i=0;i<ojLabelValues.length;i++){node=ojLabelValues[i];if(this._tsxUtils.getProperty(node,"colspan")){if(val=this._tsxUtils.getPropertyStringValue(node,"colspan")){if(val==="1"){continue}}this._emitIssue(ruleCtx)}}}_getOjLabelValueDirectChilds(tsxComp){var childs,child,i,ret=null;if(childs=tsxComp.children){for(i=0;i<childs.length;i++){child=childs[i];if(child.type==="TsxComponent"&&child.name==="oj-label-value"){if(!ret){ret=[]}ret.push(child)}}}return ret}_emitIssue(ruleCtx){ruleCtx.reporter.addIssue(new ruleCtx.Issue(ISSUE),ruleCtx)}}module.exports=Rule;