@oracle/oraclejet-audit 18.0.7 → 18.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"metaList":{"8.3.0":{"version":"8.3.0","date":"Monday May 04, 2020","time":"4:34pm edt"},"13.0.0":{"version":"13.0.4","date":"Thursday Sep 22, 2022","time":"3:14am utc"},"13.1.0":{"version":"13.1.0","date":"Sunday Oct 02, 2022","time":"3:37am utc"},"14.0.0":{"version":"14.0.0","date":"Tuesday Jan 03, 2023","time":"8:54pm utc"},"14.1.0":{"version":"14.1.0","date":"Thursday Apr 06, 2023","time":"7:55pm utc"},"15.0.0":{"version":"15.0.0","date":"Saturday Jul 01, 2023","time":"2:08pm utc"},"15.1.0":{"version":"15.1.0","date":"Thursday Jul 06, 2023","time":"8:04pm utc"},"16.0.0":{"version":"16.0.0","date":"Saturday Feb 10, 2024","time":"4:36pm utc"},"16.1.0":{"version":"16.1.0","date":"Monday Feb 12, 2024","time":"8:58pm utc"},"17.0.0":{"version":"17.0.0","date":"Thursday Jul 25, 2024","time":"1:57am utc"},"17.1.0":{"version":"17.1.0","date":"Friday Nov 01, 2024","time":"11:30pm utc"},"18.0.0":{"version":"18.0.7","date":"Thursday May 22, 2025","time":"8:54pm utc"}}}
1
+ {"metaList":{"8.3.0":{"version":"8.3.0","date":"Monday May 04, 2020","time":"4:34pm edt"},"13.0.0":{"version":"13.0.4","date":"Thursday Sep 22, 2022","time":"3:14am utc"},"13.1.0":{"version":"13.1.0","date":"Sunday Oct 02, 2022","time":"3:37am utc"},"14.0.0":{"version":"14.0.0","date":"Tuesday Jan 03, 2023","time":"8:54pm utc"},"14.1.0":{"version":"14.1.0","date":"Thursday Apr 06, 2023","time":"7:55pm utc"},"15.0.0":{"version":"15.0.0","date":"Saturday Jul 01, 2023","time":"2:08pm utc"},"15.1.0":{"version":"15.1.0","date":"Thursday Jul 06, 2023","time":"8:04pm utc"},"16.0.0":{"version":"16.0.0","date":"Saturday Feb 10, 2024","time":"4:36pm utc"},"16.1.0":{"version":"16.1.0","date":"Monday Feb 12, 2024","time":"8:58pm utc"},"17.0.0":{"version":"17.0.0","date":"Thursday Jul 25, 2024","time":"1:57am utc"},"17.1.0":{"version":"17.1.0","date":"Friday Nov 01, 2024","time":"11:30pm utc"},"18.0.0":{"version":"18.0.9","date":"Thursday Jul 03, 2025","time":"12:11am utc"}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oracle/oraclejet-audit",
3
- "version": "18.0.7",
3
+ "version": "18.0.9",
4
4
  "description": "JET AUDIT FRAMEWORK",
5
5
  "main": "jaf.js",
6
6
  "files": [
@@ -44,7 +44,7 @@
44
44
  "lint"
45
45
  ],
46
46
  "Jaf": {
47
- "version": "11.12.6"
47
+ "version": "11.12.8"
48
48
  },
49
49
  "license": "UPL-1.0",
50
50
  "dependencies": {
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULE_NAME="oj-acc-aria-labelledby";const ARIA_LABELLEDBY="aria-labelledby";const DATABIND="data-bind";const DESCRIPTION="The <i>'aria-labelledby'</i> attribute contains the element id of another element to provide a relationship between an object and its label. The label ID can be provided by an 'id' or a JET 'label-id' attribute. e.g. <p><oj-label id=\"groupReadonly\" label-id=\"groupReadonly\" class=\"oj-label\">Read Only switches</oj-label><br><oj-switch id=\"switch-1\" readonly aria-labelledby=\"groupReadonly\"></oj-switch><br>";function getName(){return RULE_NAME};function getShortDescription(){return"JET 'aria-labelledby' attribute must refer to an element 'id' or 'label-id' attribute"};function getDescription(){return DESCRIPTION};function register(){return{"webcomp":_onComp}};function _onComp(ruleCtx){var attrs,attr,val;if(!(attrs=ruleCtx.tagNode.attribs)){return}for(attr in attrs){val=attrs[attr];_onAttr(ruleCtx,attr,val)}}function _onAttr(ruleCtx,attrName,attrValue){var attr,node,attrOrig=attrName;var ids,i;if(attrName===DATABIND){attr=ruleCtx.utils.DomUtils.extractAttribsFromDataBind(attrValue);if(attr&&attr[ARIA_LABELLEDBY]){attrName=ARIA_LABELLEDBY;attrValue=attr[ARIA_LABELLEDBY]}}if(attrName!==ARIA_LABELLEDBY||_isExpression(attrValue)){return}ids=attrValue.split(" ");for(i=0;i<ids.length;i++){ids[i]=ids[i].trim();if(ids.length){if(_isExpression(ids[i])){continue}node=ruleCtx.utils.DomUtils.getElemById(ids[i],true);if(!node){let issue=new ruleCtx.Issue(`<${ruleCtx.tagNode.name}> 'aria-labelledby' attribute '${ids[i]}' has no matching element with same id`);_addIssue(ruleCtx,issue,attrOrig)}}}};function _addIssue(ruleCtx,issue,attrName){let attrPos=ruleCtx.utils.DomUtils.getAttribPosition(ruleCtx.data,ruleCtx.node,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)};function _isExpression(s){return /[(}{}+*\/]/.test(s)};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-acc-aria-labelledby";const DESCRIPTION="The <i>'aria-labelledby'</i> attribute contains the element id of another element to provide "+"a relationship between an object and its label. The label ID can be provided by an 'id' or a "+"JET 'label-id' attribute. e.g."+" <p><br>"+"<oj-label id=\"groupReadonly\" label-id=\"groupReadonly\" class=\"oj-label\">Read Only switches</oj-label><br>"+"<oj-switch id=\"switch-1\" readonly aria-labelledby=\"groupReadonly\"></oj-switch><br>";const ARIA_LABELLEDBY="aria-labelledby";const ARIA_COLON_LABELLEDBY=":aria-labelledby";const DATABIND="data-bind";function getName(){return RULE_NAME};function getShortDescription(){return"JET 'aria-labelledby' attribute must refer to an element 'id' or 'label-id' attribute"};function getDescription(){return DESCRIPTION};function register(){return{"webcomp":_onComp}};function _onComp(ruleCtx){var attrs,attr,val;if(!(attrs=ruleCtx.tagNode.attribs)){return}for(attr in attrs){val=attrs[attr];_onAttr(ruleCtx,attr,val)}}function _onAttr(ruleCtx,attrName,attrValue){var attr,node,attrOrig=attrName;var isAriaLabelledBy,ids,i;if(attrName===DATABIND){if(attr=ruleCtx.utils.DomUtils.extractAttribsFromDataBind(attrValue)){let name;if(name=_isAttribAriaLabelledBy(attr)){attrName=name;attrValue=attr[name];isAriaLabelledBy=true}}}else{isAriaLabelledBy=!!_isAttribAriaLabelledBy(attrName)}attrValue=attrValue.trim();if(!isAriaLabelledBy||_isExpression(attrValue)){return}ids=attrValue.split(" ");for(i=0;i<ids.length;i++){ids[i]=ids[i].trim();if(ids.length){if(_isExpression(ids[i])){continue}node=ruleCtx.utils.DomUtils.getElemById(ids[i],true);if(!node){let issue=new ruleCtx.Issue(`<${ruleCtx.tagNode.name}> 'aria-labelledby' attribute '${ids[i]}' has no matching element with same id`);_addIssue(ruleCtx,issue,attrOrig)}}}};function _addIssue(ruleCtx,issue,attrName){let attrPos=ruleCtx.utils.DomUtils.getAttribPosition(ruleCtx.data,ruleCtx.node,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)};function _isExpression(s){return s.startsWith("[[")||s.startsWith("{{")};function _isAttribAriaLabelledBy(attr){var name;if(typeof attr==="string"){if(attr===ARIA_LABELLEDBY){name=ARIA_LABELLEDBY}else if(attr===ARIA_COLON_LABELLEDBY){name=ARIA_COLON_LABELLEDBY}}else{if(attr[ARIA_LABELLEDBY]){name=ARIA_LABELLEDBY}else if(attr[ARIA_COLON_LABELLEDBY]){name=ARIA_COLON_LABELLEDBY}}return name};module.exports={getName,getDescription,getShortDescription,register};
@@ -3,4 +3,4 @@
3
3
  * Licensed under The Universal Permissive License (UPL), Version 1.0
4
4
  * as shown at https://oss.oracle.com/licenses/upl/
5
5
  */
6
- const RULENAME="oj-tsx-ojoption-text";const DESCRIPTION="<oj-option> components cannot contain other custom elements that might render "+"something other than the expected text node that is used to define the label of the option ";const SHORT_DESCRIPTION="<oj-options> components cannot contain elements that render something other than a text node.";const DIV="div";const SPAN="span";const OJ_IF="oj-if";const OJ_BIND_IF="oj-bind-if";const OJ_BIND_TEXT="oj-bind-text";const OJ_CHECKBOXSET="oj-checkboxset";const OJ_MENU="oj-menu";const OJ_OPTION="oj-option";const TEMPLATE="template";const OJ_BIND_DASH="oj-bind-";const JSXTEXT="JSXText";const JSXELEMENT="JSXElement";const TSXCOMPONENT="TsxComponent";const JSXATTRIBUTE="JSXAttribute";const JSXIDENTIFIER="JSXIdentifier";const CHILD_TAGS=[DIV,SPAN,OJ_BIND_IF,OJ_IF];const FORMATS=["b","strong","i","em","mark","small","del","ins","sub","sup"];class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._tsxUtils=regCtx.utils.tsxUtils;return{"Tsx<oj-option>":this._onOption}}_onOption(ruleCtx,tsxComp){if(this._pos&&tsxComp.loc.start.line===this._pos){return}this._haveText=this._done=false;this._pos=0;this._tsxComp=tsxComp;this._evalNodes(ruleCtx,tsxComp.node.children)}_evalNodes(ruleCtx,childs){if(this._haveText||this._done){return}if(!childs||childs.length===0){let rc;if(rc=this._checkNoDataExceptions(ruleCtx,childs)){this._emitIssue(ruleCtx,rc)}return}for(const child of childs){if(this._haveText){return}if(child.type===JSXTEXT){this._haveText=true;break}if(child.type===JSXELEMENT){let name=child.openingElement.name.name;if(CHILD_TAGS.includes(name)||FORMATS.includes(name)){this._evalNodes(ruleCtx,child.children)}else if(name===OJ_BIND_TEXT){this._evalOjBindText(ruleCtx,child)}else{this._emitIssue(ruleCtx,1);this._done=true;if(name===OJ_OPTION){this._pos=child.loc.start.line}break}}}}_checkNoDataExceptions(ruleCtx,childs){var node,parent,childs,name;node=this._tsxComp;if(name=this._getParent(node)){if(name===OJ_MENU){return 0}if(name===OJ_CHECKBOXSET){let n=0;childs=node.parent.children;childs.forEach(child=>{if(child.type===TSXCOMPONENT&&child.name===OJ_OPTION){n++}});return n===1?0:2}}if(this._tsxUtils.getProperty(node,"data-oj-command")){return 0}return 1}_evalOjBindText(ruleCtx,child){var attribs,attrib;if(attribs=child?.openingElement.attributes){for(let i=0;i<attribs.length;i++){attrib=attribs[i];if(attrib.type===JSXATTRIBUTE&&attrib.name.type===JSXIDENTIFIER){break}}}if(!attribs||!attrib||attrib.name.name!=="value"){this._emitIssue(ruleCtx,1)}}_emitIssue(ruleCtx,msgType){var msg;if(msgType===1||msgType===2){msg="The default slot of <oj-option> must evaluate to a text label.";ruleCtx.reporter.addIssue(new ruleCtx.Issue(msg),ruleCtx)}}_getParent(node){var parent,name;if(parent=node.parent){name=parent.name;if(name==TEMPLATE||name.startsWith(OJ_BIND_DASH)){return this._getParent(parent)}}else{name=null}return name}}module.exports=Rule;
6
+ const RULENAME="oj-tsx-ojoption-text";const DESCRIPTION="<oj-option> components cannot contain other custom elements that might render "+"something other than the expected text node that is used to define the label of the option ";const SHORT_DESCRIPTION="<oj-options> components cannot contain elements that render something other than a text node.";const DIV="div";const SPAN="span";const OJ_IF="oj-if";const OJ_BIND_IF="oj-bind-if";const OJ_BIND_TEXT="oj-bind-text";const OJ_CHECKBOXSET="oj-checkboxset";const OJ_MENU="oj-menu";const OJ_OPTION="oj-option";const TEMPLATE="template";const OJ_BIND_DASH="oj-bind-";const JSXTEXT="JSXText";const JSXELEMENT="JSXElement";const TSXCOMPONENT="TsxComponent";const JSXATTRIBUTE="JSXAttribute";const JSXIDENTIFIER="JSXIdentifier";const CHILD_TAGS=[DIV,SPAN,OJ_BIND_IF,OJ_IF];const FORMATS=["b","strong","i","em","mark","small","del","ins","sub","sup"];class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._tsxUtils=regCtx.utils.tsxUtils;return{"Tsx<oj-option>":this._onOption}}_onOption(ruleCtx,tsxComp){if(this._pos&&tsxComp.loc.start.line===this._pos){return}this._haveText=this._done=false;this._pos=0;this._tsxComp=tsxComp;this._evalNodes(ruleCtx,tsxComp.node.children)}_evalNodes(ruleCtx,childs){if(this._haveText||this._done){return}if(!childs||childs.length===0){let rc;if(rc=this._checkNoDataExceptions(ruleCtx,childs)){this._emitIssue(ruleCtx,rc)}return}for(const child of childs){if(this._haveText){return}if(child.type===JSXTEXT){this._haveText=true;break}if(child.type===JSXELEMENT){let name=child.openingElement.name.name;if(CHILD_TAGS.includes(name)||FORMATS.includes(name)){this._evalNodes(ruleCtx,child.children)}else if(name===OJ_BIND_TEXT){this._evalOjBindText(ruleCtx,child)}else{this._emitIssue(ruleCtx,1);this._done=true;if(name===OJ_OPTION){this._pos=child.loc.start.line}break}}}}_checkNoDataExceptions(ruleCtx,childs){var node,parent,childs,name;node=this._tsxComp;if(name=this._getParent(node)){if(name===OJ_MENU){return 0}if(name===OJ_CHECKBOXSET){let n=0;childs=node.parent.children;childs.forEach(child=>{if(child.type===TSXCOMPONENT&&child.name===OJ_OPTION){n++}});return n===1?0:2}}else{return 0}if(this._tsxUtils.getProperty(node,"data-oj-command")){return 0}return 1}_evalOjBindText(ruleCtx,child){var attribs,attrib;if(attribs=child?.openingElement.attributes){for(let i=0;i<attribs.length;i++){attrib=attribs[i];if(attrib.type===JSXATTRIBUTE&&attrib.name.type===JSXIDENTIFIER){break}}}if(!attribs||!attrib||attrib.name.name!=="value"){this._emitIssue(ruleCtx,1)}}_emitIssue(ruleCtx,msgType){var msg;if(msgType===1||msgType===2){msg="The default slot of <oj-option> must evaluate to a text label.";ruleCtx.reporter.addIssue(new ruleCtx.Issue(msg),ruleCtx)}}_getParent(node){var parent,name;if(parent=node.parent){name=parent.name;if(name==TEMPLATE||name.startsWith(OJ_BIND_DASH)){return this._getParent(parent)}}else{name=null}return name}}module.exports=Rule;