@oracle/oraclejet-audit 16.1.6 → 17.0.1

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.
Files changed (145) hide show
  1. package/corePackMigrator/cli.js +1 -1
  2. package/corePackMigrator/corePackMigrator.js +2 -2
  3. package/corePackMigrator/metadata/actionCardMetadata.json +10 -0
  4. package/corePackMigrator/metadata/avatarMetadata.json +11 -1
  5. package/corePackMigrator/metadata/bindIfMetadata.json +4 -0
  6. package/corePackMigrator/metadata/buttonMetadata.json +65 -49
  7. package/corePackMigrator/metadata/chartMetadata.json +53 -0
  8. package/corePackMigrator/metadata/collapsibleMetadata.json +27 -12
  9. package/corePackMigrator/metadata/conveyorBeltMetadata.json +34 -0
  10. package/corePackMigrator/metadata/datePickerMetadata.json +43 -0
  11. package/corePackMigrator/metadata/drawerLayoutMetadata.json +18 -0
  12. package/corePackMigrator/metadata/drawerPopupMetadata.json +27 -14
  13. package/corePackMigrator/metadata/filePickerMetadata.json +20 -7
  14. package/corePackMigrator/metadata/formLayoutMetadata.json +11 -1
  15. package/corePackMigrator/metadata/highlightTextMetadata.json +10 -0
  16. package/corePackMigrator/metadata/inputDateMetadata.json +110 -0
  17. package/corePackMigrator/metadata/inputNumberMetadata.json +107 -75
  18. package/corePackMigrator/metadata/inputPasswordMetadata.json +111 -75
  19. package/corePackMigrator/metadata/inputTextMetadata.json +118 -81
  20. package/corePackMigrator/metadata/labelValueMetadata.json +245 -0
  21. package/corePackMigrator/metadata/legendItemMetadata.json +11 -1
  22. package/corePackMigrator/metadata/legendMetadata.json +59 -49
  23. package/corePackMigrator/metadata/listItemLayoutMetadata.json +11 -1
  24. package/corePackMigrator/metadata/listviewMetadata.json +104 -63
  25. package/corePackMigrator/metadata/messageBannerMetadata.json +10 -0
  26. package/corePackMigrator/metadata/messagesMetadata.json +11 -1
  27. package/corePackMigrator/metadata/progressBarMetadata.json +11 -1
  28. package/corePackMigrator/metadata/progressCircleMetadata.json +10 -0
  29. package/corePackMigrator/metadata/radiosetMetadata.json +11 -1
  30. package/corePackMigrator/metadata/ratingGaugeMetadata.json +113 -87
  31. package/corePackMigrator/metadata/selectManyMetadata.json +72 -42
  32. package/corePackMigrator/metadata/selectSingleMetadata.json +61 -46
  33. package/corePackMigrator/metadata/selectorMetadata.json +1 -1
  34. package/corePackMigrator/metadata/statusMeterGaugeMetadata.json +1 -1
  35. package/corePackMigrator/metadata/tagCloudMetadata.json +10 -0
  36. package/corePackMigrator/metadata/textAreaMetadata.json +88 -46
  37. package/corePackMigrator/resource/astUtils.js +1 -1
  38. package/corePackMigrator/resource/componentMigrator.js +1 -1
  39. package/corePackMigrator/resource/fileScanner.js +1 -1
  40. package/corePackMigrator/resource/htmlUtils.js +1 -1
  41. package/corePackMigrator/resource/manifest.json +137 -36
  42. package/corePackMigrator/resource/testUtils.js +6 -0
  43. package/corePackMigrator/templates/componentMetaData.json +118 -14
  44. package/corePackMigrator/templates/migrationConfig.json +4 -0
  45. package/corePackMigrator/utilities/deltaWebElementAPIs.js +6 -0
  46. package/corePackMigrator/utilities/logging.js +1 -1
  47. package/jaf-amd.js +1 -1
  48. package/lib/AstJson.js +1 -1
  49. package/lib/Components.js +1 -1
  50. package/lib/Config.js +1 -1
  51. package/lib/ConfigEx.js +6 -0
  52. package/lib/ConfigLib.js +1 -1
  53. package/lib/MetaLib.js +1 -1
  54. package/lib/OjCPack.js +1 -1
  55. package/lib/RegTypes.js +1 -1
  56. package/lib/RulePack.js +1 -1
  57. package/lib/RuleSet.js +1 -1
  58. package/lib/Rules.js +1 -1
  59. package/lib/TsxUtils.js +1 -1
  60. package/lib/checkage.js +1 -1
  61. package/lib/defaults.js +1 -1
  62. package/lib/extends.js +1 -1
  63. package/lib/migrator.js +1 -1
  64. package/lib/ns.js +1 -1
  65. package/libext/expparser.js +1 -1
  66. package/meta/16.1.0/jetauditmeta.js +1 -1
  67. package/meta/17.0.0/jetauditmeta.js +9 -0
  68. package/meta/metaverlist.json +1 -1
  69. package/package.json +3 -3
  70. package/profiles/best-practice.json +97 -78
  71. package/profiles/redwood-strict.json +22 -14
  72. package/rulepacks/csp/csp-json-unsafe-expr.js +1 -1
  73. package/rulepacks/jetwc/jetwc-bootstrap.js +1 -1
  74. package/rulepacks/jetwc/jetwc-css-scoping.js +1 -1
  75. package/rulepacks/jetwc/jetwc-displayname.js +1 -1
  76. package/rulepacks/jetwc/jetwc-jet-version.js +1 -1
  77. package/rulepacks/jetwc/jetwc-markdown-link.js +1 -1
  78. package/rulepacks/jetwc/jetwc-namespace.js +1 -1
  79. package/rulepacks/jetwc/jetwc-nls-languages.js +1 -1
  80. package/rulepacks/jetwc/jetwc-property-nesting.js +1 -1
  81. package/rulepacks/jetwc/jetwc-property-translatable.js +1 -1
  82. package/rulepacks/jetwc/jetwc-require-paths.js +1 -1
  83. package/rulepacks/jetwc/jetwc-reserved-property.js +1 -1
  84. package/rulepacks/jetwc/jetwc-schema.js +1 -1
  85. package/rulepacks/jetwc/jetwc-standard-files.js +1 -1
  86. package/rulepacks/jetwc/jetwc-vb-category.js +1 -1
  87. package/rulepacks/jetwc/rules.json +1 -1
  88. package/rulepacks/jetwc-lib/jetwcutils-auditComponentCacheManager.js +1 -1
  89. package/rulepacks/jetwc-lib/jetwcutils-commonListenerImpls.js +1 -1
  90. package/rulepacks/jetwc-lib/jetwcutils-componentAuditUtils.js +1 -1
  91. package/rulepacks/jetwc-lib/jetwcutils-componentFinder.js +1 -1
  92. package/rulepacks/jetwc-lib/jetwcutils-tsxUtils.js +1 -1
  93. package/rulepacks/jetwco/jetwco-bootstrap.js +1 -1
  94. package/rulepacks/jetwco/jetwco-component-api-baseline-changes.js +1 -1
  95. package/rulepacks/jetwco/jetwco-component-api-changes.js +1 -1
  96. package/rulepacks/jetwco/jetwco-component-api-controlled-changes.js +1 -1
  97. package/rulepacks/jetwco/jetwco-license-info.js +1 -1
  98. package/rulepacks/jetwco/jetwco-prerelease-cdn.js +1 -1
  99. package/rulepacks/jetwco/jetwco-validate-applied-audits.js +1 -1
  100. package/rulepacks/jetwco/rules.json +1 -1
  101. package/rules/jet/helpers/cssHelper.js +1 -1
  102. package/rules/jet/helpers/has-attrib-value.js +6 -0
  103. package/rules/jet/helpers/tsx/has-prop-value.js +6 -0
  104. package/rules/jet/msgid.json +1 -1
  105. package/rules/jet/oj-acc-button-label.js +6 -0
  106. package/rules/jet/oj-css-style-bp-display.js +1 -1
  107. package/rules/jet/oj-html-attr-expr-writeback.js +1 -1
  108. package/rules/jet/oj-html-bindif-test.js +1 -1
  109. package/rules/jet/oj-html-binding-as-slot-child.js +1 -1
  110. package/rules/jet/oj-html-bp-button-xs-chroming.js +6 -0
  111. package/rules/jet/oj-html-bp-title-to-tooltip.js +6 -0
  112. package/rules/jet/oj-html-button-size-chroming.js +6 -0
  113. package/rules/jet/oj-html-dlg-title.js +1 -1
  114. package/rules/jet/oj-html-form-bindif.js +1 -1
  115. package/rules/jet/oj-html-ko-comment.js +1 -1
  116. package/rules/jet/oj-html-ko-databind.js +1 -1
  117. package/rules/jet/oj-html-ojattr-value.js +1 -1
  118. package/rules/jet/oj-html-ojtag-ns.js +1 -1
  119. package/rules/jet/oj-html-redwood-clear-icon.js +6 -0
  120. package/rules/jet/oj-html-slot-default.js +1 -1
  121. package/rules/jet/oj-html-slot-pref-content.js +1 -1
  122. package/rules/jet/oj-html-style-abs-units.js +1 -1
  123. package/rules/jet/oj-html-style-bp-color.js +1 -1
  124. package/rules/jet/oj-html-style-bp-display.js +1 -1
  125. package/rules/jet/oj-html-style-bp-font-family.js +1 -1
  126. package/rules/jet/oj-html-style-bp-font.js +1 -1
  127. package/rules/jet/oj-html-style-bp-margin-padding.js +6 -0
  128. package/rules/jet/oj-html-wctag-maintenance.js +1 -1
  129. package/rules/jet/oj-tsx-acc-button-label.js +6 -0
  130. package/rules/jet/oj-tsx-bp-button-xs-chroming.js +6 -0
  131. package/rules/jet/oj-tsx-bp-title-to-tooltip.js +6 -0
  132. package/rules/jet/oj-tsx-button-size-chroming.js +6 -0
  133. package/rules/jet/oj-tsx-dlg-title.js +1 -1
  134. package/rules/jet/oj-tsx-form-bindif.js +1 -1
  135. package/rules/jet/oj-tsx-ojtag-ns.js +1 -1
  136. package/rules/jet/oj-tsx-redwood-clear-icon.js +6 -0
  137. package/rules/jet/oj-tsx-slot-default.js +6 -0
  138. package/rules/jet/oj-tsx-slot-pref-content.js +1 -1
  139. package/rules/jet/oj-tsx-style-abs-units.js +6 -0
  140. package/rules/jet/oj-tsx-style-bp-margin-padding.js +6 -0
  141. package/rules/jet/oj-tsx-wctag-maintenance.js +1 -1
  142. package/rules/jet/rules.json +1 -1
  143. package/schema/component-schema.json +1 -1
  144. package/src/JafCore.js +1 -1
  145. package/types/index.d.ts +3 -0
@@ -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 Utils=require("../jetwc-lib/jetwcutils-componentAuditUtils");const AuditComponentCacheManager=require("../jetwc-lib/jetwcutils-auditComponentCacheManager");const NetUtils=require("../../lib/NetUtils");const CommonImpl=require("../jetwc-lib/jetwcutils-commonListenerImpls");const TsxUtils=require("../jetwc-lib/jetwcutils-tsxUtils");const VC=require("./jetwco-cacc-auditConstraints");const CaccHelpers=require("./jetwco-cacc-helpers");const{applyCustomMappings}=require("./jetwco-cacc-typeMappingOverrides");const jetVer=require("./jetwco-cacc-jetVer");const packContent=require("./jetwco-cacc-packContent");const packBundle=require("./jetwco-cacc-packBundle");const packBundleContent=require("./jetwco-cacc-packBundleContent");const dependencies=require("./jetwco-cacc-dependencies");const properties=require("./jetwco-cacc-properties");const propertyDefault=require("./jetwco-cacc-propertyDefault");const propertyRequired=require("./jetwco-cacc-propertyRequired");const propertyReadOnly=require("./jetwco-cacc-propertyReadOnly");const propertyWriteback=require("./jetwco-cacc-propertyWriteback");const propertyType=require("./jetwco-cacc-propertyType");const propertyEnumeration=require("./jetwco-cacc-propertyEnumeration");const methods=require("./jetwco-cacc-methods");const methodParams=require("./jetwco-cacc-methodParams");const methodParamTypes=require("./jetwco-cacc-methodParamTypes");const methodReturnType=require("./jetwco-cacc-methodReturnType");const events=require("./jetwco-cacc-events");const eventPayload=require("./jetwco-cacc-eventPayload");const eventBubbles=require("./jetwco-cacc-eventBubbles");const eventCancelable=require("./jetwco-cacc-eventCancelable");const slots=require("./jetwco-cacc-slots");const slotDataVariable=require("./jetwco-cacc-slotDataVariable");const slotDataVariableType=require("./jetwco-cacc-slotDataVariableType");const dynamicSlots=require("./jetwco-cacc-dynamicSlots");const styleVariables=require("./jetwco-cacc-styleVariables");const styleClasses=require("./jetwco-cacc-styleClasses");const publicModules=require("./jetwco-cacc-publicModules");const componentType=require("./jetwco-cacc-componentType");const CONTROL_PROFILE={jetVer:{callback:jetVer,add:VC.MAJOR,remove:VC.MAJOR,mutate:VC.MAJOR,description:"Validate the JET Version compatibility range"},packContent:{callback:packContent,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.SEMVER,description:"Validate the member components of a JET Pack"},packBundle:{callback:packBundle,add:VC.MINOR,remove:VC.MAJOR,mutate:VC.NEVER,description:"Validate the list of bundles defined by a JET Pack"},packBundleContent:{callback:packBundleContent,add:VC.MAJOR,remove:VC.MAJOR,mutate:VC.NEVER,description:"Validate the entries of each bundle defined by a JET Pack"},dependencies:{callback:dependencies,add:VC.MAJOR,remove:VC.MINOR,mutate:VC.SEMVER,description:"Validate the dependencies of a component"},properties:{callback:properties,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the properties of a component"},propertyDefault:{callback:propertyDefault,add:VC.PATCH,remove:VC.MAJOR_DEPRECATED,mutate:VC.MAJOR_DEPRECATED,description:"Validate the defaults assigned to properties of a component"},propertyRequired:{callback:propertyRequired,add:VC.MAJOR,remove:VC.PATCH,mutate:VC.NEVER,description:"Validate the required states of a components properties"},propertyReadOnly:{callback:propertyReadOnly,add:VC.MAJOR,remove:VC.PATCH,mutate:VC.NEVER,description:"Validate the read-only states of a components properties"},propertyWriteback:{callback:propertyWriteback,add:VC.PATCH,remove:VC.NEVER,mutate:VC.NEVER,description:"Validate the writeback states of a components properties"},propertyType:{callback:propertyType,add:VC.PATCH,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the assigned types of a components properties"},propertyEnumeration:{callback:propertyEnumeration,add:VC.PATCH,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.MAJOR,description:"Validate the enumValues of a components properties"},methods:{callback:methods,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of methods exposed by the component"},methodParams:{callback:methodParams,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of parameters passed to methods exposed by the component"},methodParamTypes:{callback:methodParamTypes,add:VC.PATCH,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of parameters passed to methods exposed by the component"},methodReturnType:{callback:methodReturnType,add:VC.PATCH,remove:VC.MAJOR,mutate:VC.NEVER,description:"Validate the return type of the methods exposed by the component"},events:{callback:events,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of events exposed by the component"},eventPayload:{callback:eventPayload,add:VC.MINOR,remove:VC.MAJOR,mutate:VC.NEVER,description:"Validate the event detail of events exposed by the component"},eventBubbles:{callback:eventBubbles,add:VC.MINOR,remove:VC.NEVER,mutate:VC.NEVER,description:"Validate the event bubbles flag"},eventCancelable:{callback:eventCancelable,add:VC.MINOR,remove:VC.NEVER,mutate:VC.NEVER,description:"Validate the event cancelable flag"},slots:{callback:slots,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of slots exposed by the component"},slotDataVariable:{callback:slotDataVariable,add:VC.PATCH,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of attributes in a slot data attribute exposed by the component"},slotDataVariableType:{callback:slotDataVariableType,add:VC.NEVER,remove:VC.NEVER,mutate:VC.NEVER,description:"Validate the type assigned to each attributes in a slot data attribute exposed by the component"},dynamicSlots:{callback:dynamicSlots,add:VC.MINOR,remove:VC.MAJOR,mutate:VC.NEVER,description:"Validate the presence of the dynamicSlots marker on the component"},styleVariables:{callback:styleVariables,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of styleVariables supported by the component"},styleClasses:{callback:styleClasses,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of styleClasses supported by the component"},publicModules:{callback:publicModules,add:VC.MINOR,remove:VC.MAJOR,mutate:VC.NEVER,description:"Validate the list of publicModules exposed by a resource component"},componentType:{callback:componentType,add:VC.NEVER,remove:VC.NEVER,mutate:VC.NEVER,description:"Validate the component type has not been changed"}};const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwco-component-api-controlled-changes"};ruleDef.prototype.getShortDescription=function(){return"Check components for API changes based on a configurable rule-set"};ruleDef.prototype.getDescription=function(){return"This audit compares the APIs exposed by components with older versions in the Exchange Catalog according to a set of rules which determine when given changes, such as the removal of deprecated properties can be made"};ruleDef.prototype.register=function(context){return{startaudit:this._auditPrep,closedownRP:this._dealWithCache,compjson:this._doAudit,Program:this._doVComponentAudit}};ruleDef.prototype._auditPrep=function(context){this.exchangeURL=CommonImpl.checkForExchangeConfiguration(context);if(this.exchangeURL){this.acCache=new AuditComponentCacheManager(context,this.getName(),this.exchangeURL);this.componentExceptions=context.rulePack.getRuleOption("exceptions");const ipr=context.rulePack.getRuleOption("includePreReleases");if(ipr&&ipr===true){this.productionOnly=false}else{this.productionOnly=true}const ruleOverrides=context.rulePack.getRuleOption("controls");this.controlRules={};if(Object.keys(ruleOverrides).length>0){for(const[controlRule,controlRuleDef]of Object.entries(CONTROL_PROFILE)){this.controlRules[controlRule]={...controlRuleDef};if(ruleOverrides.hasOwnProperty(controlRule)){for(const[verb,override]of Object.entries(ruleOverrides[controlRule])){this.controlRules[controlRule][verb]=override}}}}else{this.controlRules={...CONTROL_PROFILE}}const activeControls=context.rulePack.getRuleOption("applyConditions");if(activeControls&&Array.isArray(activeControls)){Object.keys(this.controlRules).forEach(controlRule=>{if(!activeControls.includes(controlRule)){delete this.controlRules[controlRule]}})}this.requiredCheckVersions=CaccHelpers.calcRequiredVersionMatrix(this.controlRules)}else{const issue=new context.Issue(`Invalid or Missing exchangeURL value specified for the rule ${context.ruleName}, rule execution is disabled`);issue.setMsgKey(`${context.ruleName}_2`);issue.setSeverity("critical");context.reporter.addIssue(issue,context)}};ruleDef.prototype._dealWithCache=function(context){const shouldClearCache=context.rulePack.getRuleOption("clearCache",this.getName());if(shouldClearCache&&this.acCache){this.acCache.removeLocalCache()}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);this._conductChecks(context,fullName,componentType,meta)}};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);if(componentInfo){const meta={...componentInfo};if(componentInfo.dependencies){meta.dependencies=componentInfo.dependencies.reduce((asMap,entry)=>{asMap[entry.name]=entry.range;return asMap},{})}this._conductChecks(context,componentInfo.fullName,componentInfo.type,meta)}};ruleDef.prototype._conductChecks=function(context,fullName,componentType,componentMeta){const{msgLib,semVerUtils}=context.utils;const privateComponent=componentMeta.subcomponentType&&componentMeta.subcomponentType==="packPrivate";const skipPrivate=context.rulePack.getRuleOption("ignorePackPrivate",context.ruleName);const overrideTypeMappings=applyCustomMappings(context.rulePack.getRuleOption("typeMappings",context.ruleName));if(skipPrivate&&privateComponent){msgLib.info(`packPrivate component ${fullName} skipped due to ignorePackPrivate flag in ${context.ruleName} configuration`)}else{const baselines=this._grabRequiredVersions(context,fullName,componentMeta.version,this.requiredCheckVersions,this.productionOnly);if(baselines&&baselines.latest.version){const compareMetadata=CaccHelpers.deriveConstraintMetadata(baselines);const componentVersionDiff=CaccHelpers.semanticDiff(semVerUtils,componentMeta.version,compareMetadata.version);try{for(const[controlRuleName,controlRuleDef]of Object.entries(this.controlRules)){if(!this._isExemptFromCheck(fullName,controlRuleName)){msgLib.info(`${context.ruleName}(${controlRuleName}): ${controlRuleDef.description}`);const errorMsgContext=CaccHelpers.getStdErrorContext(fullName,controlRuleName);this._executeCheck(controlRuleName,controlRuleDef,semVerUtils,this.acCache,componentMeta,compareMetadata,componentVersionDiff,baselines,componentType,fullName,errorMsgContext,overrideTypeMappings)}}}catch(auditDetail){const issue=new context.Issue(`API change for ${fullName}@${componentMeta.version}: ${auditDetail}`);issue.setMsgKey(`${context.ruleName}_1`);context.reporter.addIssue(issue,context)}}}};ruleDef.prototype._grabRequiredVersions=function(context,fullName,versionUnderTest,requiredVersions,productionVersionsOnly){const{msgLib,semVerUtils}=context.utils;const checkVersions={"never":{isNeeded:true,version:null,metadata:null},"latest":{isNeeded:true,version:null,metadata:null},"patch":{isNeeded:requiredVersions.patch,version:null,metadata:null},"minor":{isNeeded:requiredVersions.minor,version:null,metadata:null},"major":{isNeeded:requiredVersions.major,version:null,metadata:null},"major+":{isNeeded:requiredVersions.major,version:null,metadata:null},"major2+":{isNeeded:requiredVersions.major2,version:null,metadata:null},"major3+":{isNeeded:requiredVersions.major3,version:null,metadata:null}};try{const versionsToCache=new Set;const netUtils=new NetUtils;const existingVersionsResp=netUtils.loadUrl(`${this.exchangeURL}components/${fullName}/versions`);if(existingVersionsResp.statusCode===200&&existingVersionsResp.body){const existingVersions=JSON.parse(existingVersionsResp.body);if(existingVersions.items&&existingVersions.items.length>0){const{major:vutMajor,minor:vutMinor,patch:vutPatch,prerelease:vutPreRel,version:vutVersion}=semVerUtils.parse(versionUnderTest);let historicalVersions;if(productionVersionsOnly){historicalVersions=existingVersions.items.reverse().filter(versionString=>{const{prerelease}=semVerUtils.parse(versionString);return prerelease.length===0})}else{historicalVersions=existingVersions.items.reverse()}const majorSequence=this._getOffsetMajorVersions(semVerUtils,historicalVersions,vutMajor);for(let i=0;i<historicalVersions.length;i++){const{major:hvMajor,minor:hvMinor,patch:hvPatch,prerelease:hvPreRel,version:hvVersion}=semVerUtils.parse(historicalVersions[i]);if(semVerUtils.lt(hvVersion,vutVersion)){if(!checkVersions.latest.version){checkVersions.latest.version=hvVersion;versionsToCache.add(hvVersion)}if(checkVersions.patch.isNeeded&&!checkVersions.patch.version){checkVersions.patch.version=hvVersion;versionsToCache.add(hvVersion)}if(checkVersions.minor.isNeeded&&!checkVersions.minor.version){if(hvMinor<vutMinor||hvMajor<vutMajor){checkVersions.minor.version=hvVersion;versionsToCache.add(hvVersion)}}if(checkVersions.major.isNeeded&&!checkVersions.major.version){if(majorSequence[1]&&hvMajor===majorSequence[1]){checkVersions.major.version=hvVersion;checkVersions["major+"].version=hvVersion;versionsToCache.add(hvVersion)}}if(checkVersions["major2+"].isNeeded&&!checkVersions["major2+"].version){if(majorSequence[2]&&hvMajor===majorSequence[2]){checkVersions["major2+"].version=hvVersion;versionsToCache.add(hvVersion)}}if(checkVersions["major3+"].isNeeded&&!checkVersions["major3+"].version){if(majorSequence[3]&&hvMajor===majorSequence[3]){checkVersions["major3+"].version=hvVersion;versionsToCache.add(hvVersion);break}}}}versionsToCache.forEach(requiredVersion=>{const cachedDef=this.acCache.getComponentMetadata(fullName,requiredVersion);if(cachedDef){for(const[controlValue,settings]of Object.entries(checkVersions)){if(settings.isNeeded&&settings.version===requiredVersion){checkVersions[controlValue].metadata=cachedDef}}}})}}else if(existingVersionsResp.statusCode===404||existingVersionsResp.eCode==="ENOTFOUND"){msgLib.info(`The component ${fullName} does not exist in the Exchange and so cannot be API verified against older versions. It will be skipped`);if(!this.componentExceptions){this.componentExceptions={}}this.componentExceptions[fullName]=["*"];return}}catch(e){msgLib.error(`Unexpected error processing rule ${context.ruleName} for component ${fullName}:\n${JSON.stringify(e)}`)};return checkVersions};ruleDef.prototype._getOffsetMajorVersions=function(semVerUtils,versions,baseMajorVersion){const majors=[baseMajorVersion];let lastMajor=baseMajorVersion;versions.forEach(stringVersion=>{const{major:parsedMajor}=semVerUtils.parse(stringVersion);if(parsedMajor<lastMajor){lastMajor=parsedMajor;majors.push(parsedMajor)}});return majors};ruleDef.prototype._executeCheck=function(controlRuleName,controlRuleDef,semver,cacheManager,metadata,compareMetadata,componentVersionDiff,baselines,componentType,componentName,errorMsgContext,overrideTypeMappings){const result=controlRuleDef.callback.call(this,controlRuleName,controlRuleDef,semver,cacheManager,metadata,compareMetadata,componentVersionDiff,baselines,componentType,componentName,errorMsgContext,overrideTypeMappings);if(result){throw result}};ruleDef.prototype._isExemptFromCheck=function(fullName,controlRuleName){let exempt=false;let nameMatch;if(this.componentExceptions){if(this.componentExceptions.hasOwnProperty(fullName)){nameMatch=fullName}else{const wildcardNames=Object.keys(this.componentExceptions).reduce((wildcardList,wc)=>{if(wc.endsWith("*")){wildcardList.push(wc.substring(0,wc.length-1))}return wildcardList},[]);if(wildcardNames.length>0){wildcardNames.forEach(wildcard=>{if(fullName.startsWith(wildcard)){nameMatch=wildcard+"*"}})}}if(nameMatch){if(this.componentExceptions[nameMatch].includes("*")||this.componentExceptions[nameMatch].includes(controlRuleName)){exempt=true}}}return exempt};module.exports=ruleDef;
6
+ const Utils=require("../jetwc-lib/jetwcutils-componentAuditUtils");const AuditComponentCacheManager=require("../jetwc-lib/jetwcutils-auditComponentCacheManager");const NetUtils=require("../../lib/NetUtils");const CommonImpl=require("../jetwc-lib/jetwcutils-commonListenerImpls");const TsxUtils=require("../jetwc-lib/jetwcutils-tsxUtils");const VC=require("./jetwco-cacc-auditConstraints");const CaccHelpers=require("./jetwco-cacc-helpers");const{applyCustomMappings}=require("./jetwco-cacc-typeMappingOverrides");const jetVer=require("./jetwco-cacc-jetVer");const packContent=require("./jetwco-cacc-packContent");const packBundle=require("./jetwco-cacc-packBundle");const packBundleContent=require("./jetwco-cacc-packBundleContent");const dependencies=require("./jetwco-cacc-dependencies");const properties=require("./jetwco-cacc-properties");const propertyDefault=require("./jetwco-cacc-propertyDefault");const propertyRequired=require("./jetwco-cacc-propertyRequired");const propertyReadOnly=require("./jetwco-cacc-propertyReadOnly");const propertyWriteback=require("./jetwco-cacc-propertyWriteback");const propertyType=require("./jetwco-cacc-propertyType");const propertyEnumeration=require("./jetwco-cacc-propertyEnumeration");const methods=require("./jetwco-cacc-methods");const methodParams=require("./jetwco-cacc-methodParams");const methodParamTypes=require("./jetwco-cacc-methodParamTypes");const methodReturnType=require("./jetwco-cacc-methodReturnType");const events=require("./jetwco-cacc-events");const eventPayload=require("./jetwco-cacc-eventPayload");const eventBubbles=require("./jetwco-cacc-eventBubbles");const eventCancelable=require("./jetwco-cacc-eventCancelable");const slots=require("./jetwco-cacc-slots");const slotDataVariable=require("./jetwco-cacc-slotDataVariable");const slotDataVariableType=require("./jetwco-cacc-slotDataVariableType");const dynamicSlots=require("./jetwco-cacc-dynamicSlots");const styleVariables=require("./jetwco-cacc-styleVariables");const styleClasses=require("./jetwco-cacc-styleClasses");const publicModules=require("./jetwco-cacc-publicModules");const componentType=require("./jetwco-cacc-componentType");const CONTROL_PROFILE={jetVer:{callback:jetVer,add:VC.MAJOR,remove:VC.MAJOR,mutate:VC.MAJOR,description:"Validate the JET Version compatibility range"},packContent:{callback:packContent,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.SEMVER,description:"Validate the member components of a JET Pack"},packBundle:{callback:packBundle,add:VC.MINOR,remove:VC.MAJOR,mutate:VC.NEVER,description:"Validate the list of bundles defined by a JET Pack"},packBundleContent:{callback:packBundleContent,add:VC.MAJOR,remove:VC.MAJOR,mutate:VC.NEVER,description:"Validate the entries of each bundle defined by a JET Pack"},dependencies:{callback:dependencies,add:VC.MAJOR,remove:VC.MINOR,mutate:VC.SEMVER,description:"Validate the dependencies of a component"},properties:{callback:properties,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the properties of a component"},propertyDefault:{callback:propertyDefault,add:VC.PATCH,remove:VC.MAJOR_DEPRECATED,mutate:VC.MAJOR_DEPRECATED,description:"Validate the defaults assigned to properties of a component"},propertyRequired:{callback:propertyRequired,add:VC.MAJOR,remove:VC.PATCH,mutate:VC.NEVER,description:"Validate the required states of a components properties"},propertyReadOnly:{callback:propertyReadOnly,add:VC.MAJOR,remove:VC.PATCH,mutate:VC.NEVER,description:"Validate the read-only states of a components properties"},propertyWriteback:{callback:propertyWriteback,add:VC.PATCH,remove:VC.NEVER,mutate:VC.NEVER,description:"Validate the writeback states of a components properties"},propertyType:{callback:propertyType,add:VC.PATCH,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the assigned types of a components properties"},propertyEnumeration:{callback:propertyEnumeration,add:VC.PATCH,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.MAJOR,description:"Validate the enumValues of a components properties"},methods:{callback:methods,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of methods exposed by the component"},methodParams:{callback:methodParams,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of parameters passed to methods exposed by the component"},methodParamTypes:{callback:methodParamTypes,add:VC.PATCH,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of parameters passed to methods exposed by the component"},methodReturnType:{callback:methodReturnType,add:VC.PATCH,remove:VC.MAJOR,mutate:VC.NEVER,description:"Validate the return type of the methods exposed by the component"},events:{callback:events,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of events exposed by the component"},eventPayload:{callback:eventPayload,add:VC.MINOR,remove:VC.MAJOR,mutate:VC.NEVER,description:"Validate the event detail of events exposed by the component"},eventBubbles:{callback:eventBubbles,add:VC.MINOR,remove:VC.NEVER,mutate:VC.NEVER,description:"Validate the event bubbles flag"},eventCancelable:{callback:eventCancelable,add:VC.MINOR,remove:VC.NEVER,mutate:VC.NEVER,description:"Validate the event cancelable flag"},slots:{callback:slots,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of slots exposed by the component"},slotDataVariable:{callback:slotDataVariable,add:VC.PATCH,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of attributes in a slot data attribute exposed by the component"},slotDataVariableType:{callback:slotDataVariableType,add:VC.NEVER,remove:VC.NEVER,mutate:VC.NEVER,description:"Validate the type assigned to each attributes in a slot data attribute exposed by the component"},dynamicSlots:{callback:dynamicSlots,add:VC.MINOR,remove:VC.MAJOR,mutate:VC.NEVER,description:"Validate the presence of the dynamicSlots marker on the component"},styleVariables:{callback:styleVariables,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of styleVariables supported by the component"},styleClasses:{callback:styleClasses,add:VC.MINOR,remove:VC.MAJOR_2_DEPRECATED,mutate:VC.NEVER,description:"Validate the list of styleClasses supported by the component"},publicModules:{callback:publicModules,add:VC.MINOR,remove:VC.MAJOR,mutate:VC.NEVER,description:"Validate the list of publicModules exposed by a resource component"},componentType:{callback:componentType,add:VC.NEVER,remove:VC.NEVER,mutate:VC.NEVER,description:"Validate the component type has not been changed"}};const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwco-component-api-controlled-changes"};ruleDef.prototype.getShortDescription=function(){return"Check components for API changes based on a configurable rule-set"};ruleDef.prototype.getDescription=function(){return"This audit compares the APIs exposed by components with older versions in the Exchange Catalog according to a set of rules which determine when given changes, such as the removal of deprecated properties can be made"};ruleDef.prototype.register=function(context){return{startaudit:this._auditPrep,closedownRP:this._dealWithCache,compjson:this._doAudit,Program:this._doVComponentAudit}};ruleDef.prototype._auditPrep=function(context){this.exchangeURL=CommonImpl.checkForExchangeConfiguration(context);if(this.exchangeURL){this.acCache=new AuditComponentCacheManager(context,this.getName(),this.exchangeURL);this.componentExceptions=context.rulePack.getRuleCustomOption("exceptions");const ipr=context.rulePack.getRuleCustomOption("includePreReleases");if(ipr&&ipr===true){this.productionOnly=false}else{this.productionOnly=true}const ruleOverrides=context.rulePack.getRuleCustomOption("controls");this.controlRules={};if(Object.keys(ruleOverrides).length>0){for(const[controlRule,controlRuleDef]of Object.entries(CONTROL_PROFILE)){this.controlRules[controlRule]={...controlRuleDef};if(ruleOverrides.hasOwnProperty(controlRule)){for(const[verb,override]of Object.entries(ruleOverrides[controlRule])){this.controlRules[controlRule][verb]=override}}}}else{this.controlRules={...CONTROL_PROFILE}}const activeControls=context.rulePack.getRuleCustomOption("applyConditions");if(activeControls&&Array.isArray(activeControls)){Object.keys(this.controlRules).forEach(controlRule=>{if(!activeControls.includes(controlRule)){delete this.controlRules[controlRule]}})}this.requiredCheckVersions=CaccHelpers.calcRequiredVersionMatrix(this.controlRules)}else{const issue=new context.Issue(`Invalid or Missing exchangeURL value specified for the rule ${context.ruleName}, rule execution is disabled`);issue.setMsgKey(`${context.ruleName}_2`);issue.setSeverity("critical");context.reporter.addIssue(issue,context)}};ruleDef.prototype._dealWithCache=function(context){const shouldClearCache=context.rulePack.getRuleCustomOption("clearCache",this.getName());if(shouldClearCache&&this.acCache){this.acCache.removeLocalCache()}};ruleDef.prototype._doAudit=function(context){if(context.suppData.obj){const meta=context.suppData.obj;const fullName=Utils.getComponentFullName(meta);const componentType=Utils.getComponentType(meta);this._conductChecks(context,fullName,componentType,meta)}};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);if(componentInfo){const meta={...componentInfo};if(componentInfo.dependencies){meta.dependencies=componentInfo.dependencies.reduce((asMap,entry)=>{asMap[entry.name]=entry.range;return asMap},{})}this._conductChecks(context,componentInfo.fullName,componentInfo.type,meta)}};ruleDef.prototype._conductChecks=function(context,fullName,componentType,componentMeta){const{msgLib,semVerUtils}=context.utils;const privateComponent=componentMeta.subcomponentType&&componentMeta.subcomponentType==="packPrivate";const skipPrivate=context.rulePack.getRuleCustomOption("ignorePackPrivate",context.ruleName);const overrideTypeMappings=applyCustomMappings(context.rulePack.getRuleCustomOption("typeMappings",context.ruleName));if(skipPrivate&&privateComponent){msgLib.info(`packPrivate component ${fullName} skipped due to ignorePackPrivate flag in ${context.ruleName} configuration`)}else{const baselines=this._grabRequiredVersions(context,fullName,componentMeta.version,this.requiredCheckVersions,this.productionOnly);if(baselines&&baselines.latest.version){const compareMetadata=CaccHelpers.deriveConstraintMetadata(baselines);const componentVersionDiff=CaccHelpers.semanticDiff(semVerUtils,componentMeta.version,compareMetadata.version);try{for(const[controlRuleName,controlRuleDef]of Object.entries(this.controlRules)){if(!this._isExemptFromCheck(fullName,controlRuleName)){msgLib.info(`${context.ruleName}(${controlRuleName}): ${controlRuleDef.description}`);const errorMsgContext=CaccHelpers.getStdErrorContext(fullName,controlRuleName);this._executeCheck(controlRuleName,controlRuleDef,semVerUtils,this.acCache,componentMeta,compareMetadata,componentVersionDiff,baselines,componentType,fullName,errorMsgContext,overrideTypeMappings)}}}catch(auditDetail){const issue=new context.Issue(`API change for ${fullName}@${componentMeta.version}: ${auditDetail}`);issue.setMsgKey(`${context.ruleName}_1`);context.reporter.addIssue(issue,context)}}}};ruleDef.prototype._grabRequiredVersions=function(context,fullName,versionUnderTest,requiredVersions,productionVersionsOnly){const{msgLib,semVerUtils}=context.utils;const checkVersions={"never":{isNeeded:true,version:null,metadata:null},"latest":{isNeeded:true,version:null,metadata:null},"patch":{isNeeded:requiredVersions.patch,version:null,metadata:null},"minor":{isNeeded:requiredVersions.minor,version:null,metadata:null},"major":{isNeeded:requiredVersions.major,version:null,metadata:null},"major+":{isNeeded:requiredVersions.major,version:null,metadata:null},"major2+":{isNeeded:requiredVersions.major2,version:null,metadata:null},"major3+":{isNeeded:requiredVersions.major3,version:null,metadata:null}};try{const versionsToCache=new Set;const netUtils=new NetUtils;const existingVersionsResp=netUtils.loadUrl(`${this.exchangeURL}components/${fullName}/versions`);if(existingVersionsResp.statusCode===200&&existingVersionsResp.body){const existingVersions=JSON.parse(existingVersionsResp.body);if(existingVersions.items&&existingVersions.items.length>0){const{major:vutMajor,minor:vutMinor,patch:vutPatch,prerelease:vutPreRel,version:vutVersion}=semVerUtils.parse(versionUnderTest);let historicalVersions;if(productionVersionsOnly){historicalVersions=existingVersions.items.reverse().filter(versionString=>{const{prerelease}=semVerUtils.parse(versionString);return prerelease.length===0})}else{historicalVersions=existingVersions.items.reverse()}const majorSequence=this._getOffsetMajorVersions(semVerUtils,historicalVersions,vutMajor);for(let i=0;i<historicalVersions.length;i++){const{major:hvMajor,minor:hvMinor,patch:hvPatch,prerelease:hvPreRel,version:hvVersion}=semVerUtils.parse(historicalVersions[i]);if(semVerUtils.lt(hvVersion,vutVersion)){if(!checkVersions.latest.version){checkVersions.latest.version=hvVersion;versionsToCache.add(hvVersion)}if(checkVersions.patch.isNeeded&&!checkVersions.patch.version){checkVersions.patch.version=hvVersion;versionsToCache.add(hvVersion)}if(checkVersions.minor.isNeeded&&!checkVersions.minor.version){if(hvMinor<vutMinor||hvMajor<vutMajor){checkVersions.minor.version=hvVersion;versionsToCache.add(hvVersion)}}if(checkVersions.major.isNeeded&&!checkVersions.major.version){if(majorSequence[1]&&hvMajor===majorSequence[1]){checkVersions.major.version=hvVersion;checkVersions["major+"].version=hvVersion;versionsToCache.add(hvVersion)}}if(checkVersions["major2+"].isNeeded&&!checkVersions["major2+"].version){if(majorSequence[2]&&hvMajor===majorSequence[2]){checkVersions["major2+"].version=hvVersion;versionsToCache.add(hvVersion)}}if(checkVersions["major3+"].isNeeded&&!checkVersions["major3+"].version){if(majorSequence[3]&&hvMajor===majorSequence[3]){checkVersions["major3+"].version=hvVersion;versionsToCache.add(hvVersion);break}}}}versionsToCache.forEach(requiredVersion=>{const cachedDef=this.acCache.getComponentMetadata(fullName,requiredVersion);if(cachedDef){for(const[controlValue,settings]of Object.entries(checkVersions)){if(settings.isNeeded&&settings.version===requiredVersion){checkVersions[controlValue].metadata=cachedDef}}}})}}else if(existingVersionsResp.statusCode===404||existingVersionsResp.eCode==="ENOTFOUND"){msgLib.info(`The component ${fullName} does not exist in the Exchange and so cannot be API verified against older versions. It will be skipped`);if(!this.componentExceptions){this.componentExceptions={}}this.componentExceptions[fullName]=["*"];return}}catch(e){msgLib.error(`Unexpected error processing rule ${context.ruleName} for component ${fullName}:\n${JSON.stringify(e)}`)};return checkVersions};ruleDef.prototype._getOffsetMajorVersions=function(semVerUtils,versions,baseMajorVersion){const majors=[baseMajorVersion];let lastMajor=baseMajorVersion;versions.forEach(stringVersion=>{const{major:parsedMajor}=semVerUtils.parse(stringVersion);if(parsedMajor<lastMajor){lastMajor=parsedMajor;majors.push(parsedMajor)}});return majors};ruleDef.prototype._executeCheck=function(controlRuleName,controlRuleDef,semver,cacheManager,metadata,compareMetadata,componentVersionDiff,baselines,componentType,componentName,errorMsgContext,overrideTypeMappings){const result=controlRuleDef.callback.call(this,controlRuleName,controlRuleDef,semver,cacheManager,metadata,compareMetadata,componentVersionDiff,baselines,componentType,componentName,errorMsgContext,overrideTypeMappings);if(result){throw result}};ruleDef.prototype._isExemptFromCheck=function(fullName,controlRuleName){let exempt=false;let nameMatch;if(this.componentExceptions){if(this.componentExceptions.hasOwnProperty(fullName)){nameMatch=fullName}else{const wildcardNames=Object.keys(this.componentExceptions).reduce((wildcardList,wc)=>{if(wc.endsWith("*")){wildcardList.push(wc.substring(0,wc.length-1))}return wildcardList},[]);if(wildcardNames.length>0){wildcardNames.forEach(wildcard=>{if(fullName.startsWith(wildcard)){nameMatch=wildcard+"*"}})}}if(nameMatch){if(this.componentExceptions[nameMatch].includes("*")||this.componentExceptions[nameMatch].includes(controlRuleName)){exempt=true}}}return exempt};module.exports=ruleDef;
@@ -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 path=require("path");const Utils=require("../jetwc-lib/jetwcutils-componentAuditUtils");const TsxUtils=require("../jetwc-lib/jetwcutils-tsxUtils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwco-license-info"};ruleDef.prototype.getShortDescription=function(){return"Validate License Information"};ruleDef.prototype.getDescription=function(){return"This rule is checks that a license file (LICENSE.txt) or URL is supplied, and third party license (THIRD_PARTY_LICENSE.txt) file is present if required"};ruleDef.prototype.register=function(context){return{compjson:this._doAudit,Program:this._doVComponentAudit}};ruleDef.prototype._doAudit=function(context){const componentMetadata=context.suppData.obj;this._checkLicense(context,componentMetadata)};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);this._checkLicense(context,componentInfo)};ruleDef.prototype._checkLicense=function(context,componentMetadata){const msg=context.utils.msgLib;const rulePackState=context.rulePack.getExtension();if(componentMetadata){let issue;let licenseFileFound=false;let isInMonoPack=Utils.isMonoPackMember(context,componentMetadata);;let licenseURL;let licenseCandidate="LICENSE.txt";const compRootFiles=context.utils.fsUtils.readDir(path.dirname(context.filepath));for(let i=0;i<compRootFiles.length;i++){const rootEntry=compRootFiles[i];if(rootEntry.isFile&&rootEntry.name===licenseCandidate){licenseFileFound=true;break}}if(componentMetadata.hasOwnProperty("license")&&typeof componentMetadata.license==="string"){licenseURL=componentMetadata.license}if(!isInMonoPack&&!licenseFileFound&&!licenseURL){issue=new context.Issue(`Component is missing license information. There should either be a 'LICENSE.txt' file (case sensitive) in the root, or a license attribute in the component metadata.`);issue.setMsgKey(context.ruleName+"_1");context.reporter.addIssue(issue,context)}if(licenseURL){const customOpts=context.rulePack.getRuleOptions().customOpts;const allowedLicenses=customOpts.allowedLicenseURLs;if(Array.isArray(allowedLicenses)&&allowedLicenses.length>0){if(!allowedLicenses.includes(licenseURL)){issue=new context.Issue(`Component license metadata value does not specified one of the allowed values: ${allowedLicenses.join(", ")}`);issue.setMsgKey(context.ruleName+"_3");context.reporter.addIssue(issue,context)}}}let thirdPartyScan=false;if(componentMetadata.type&&componentMetadata.type==="reference"){thirdPartyScan=true}else{if(componentMetadata.dependencies){if(rulePackState.allReferenceComponents){Object.keys(componentMetadata.dependencies).forEach(dependency=>{if(rulePackState.allReferenceComponents.has(dependency)){thirdPartyScan=true}})}else{msg.error("JETWC: Unable to scan for reference component dependencies - JETWC-BOOTSTRAP was not run")}}}if(thirdPartyScan){licenseFileFound=false;licenseCandidate="THIRD_PARTY_LICENSE.txt";for(let i=0;i<compRootFiles.length;i++){const rootEntry=compRootFiles[i];if(rootEntry.isFile&&rootEntry.name===licenseCandidate){licenseFileFound=true;break}}if(!licenseFileFound){issue=new context.Issue(`Component with third party dependencies is missing 3rd party license information file in root, 'THIRD_PARTY_LICENSE.txt' is expected (case sensitive)`);issue.setMsgKey(context.ruleName+"_2");context.reporter.addIssue(issue,context)}}}};module.exports=ruleDef;
6
+ const path=require("path");const Utils=require("../jetwc-lib/jetwcutils-componentAuditUtils");const TsxUtils=require("../jetwc-lib/jetwcutils-tsxUtils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwco-license-info"};ruleDef.prototype.getShortDescription=function(){return"Validate License Information"};ruleDef.prototype.getDescription=function(){return"This rule is checks that a license file (LICENSE.txt) or URL is supplied, and third party license (THIRD_PARTY_LICENSE.txt) file is present if required"};ruleDef.prototype.register=function(context){return{compjson:this._doAudit,Program:this._doVComponentAudit}};ruleDef.prototype._doAudit=function(context){const componentMetadata=context.suppData.obj;this._checkLicense(context,componentMetadata)};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);this._checkLicense(context,componentInfo)};ruleDef.prototype._checkLicense=function(context,componentMetadata){const msg=context.utils.msgLib;const rulePackState=context.rulePack.getExtension();if(componentMetadata){let issue;let licenseFileFound=false;let isInMonoPack=Utils.isMonoPackMember(context,componentMetadata);;let licenseURL;let licenseCandidate="LICENSE.txt";const compRootFiles=context.utils.fsUtils.readDir(path.dirname(context.filepath));for(let i=0;i<compRootFiles.length;i++){const rootEntry=compRootFiles[i];if(rootEntry.isFile&&rootEntry.name===licenseCandidate){licenseFileFound=true;break}}if(componentMetadata.hasOwnProperty("license")&&typeof componentMetadata.license==="string"){licenseURL=componentMetadata.license}if(!isInMonoPack&&!licenseFileFound&&!licenseURL){issue=new context.Issue(`Component is missing license information. There should either be a 'LICENSE.txt' file (case sensitive) in the root, or a license attribute in the component metadata.`);issue.setMsgKey(context.ruleName+"_1");context.reporter.addIssue(issue,context)}if(licenseURL){const customOpts=context.rulePack.getRuleCustomOptions();const allowedLicenses=customOpts.allowedLicenseURLs;if(Array.isArray(allowedLicenses)&&allowedLicenses.length>0){if(!allowedLicenses.includes(licenseURL)){issue=new context.Issue(`Component license metadata value does not specified one of the allowed values: ${allowedLicenses.join(", ")}`);issue.setMsgKey(context.ruleName+"_3");context.reporter.addIssue(issue,context)}}}let thirdPartyScan=false;if(componentMetadata.type&&componentMetadata.type==="reference"){thirdPartyScan=true}else{if(componentMetadata.dependencies){if(rulePackState.allReferenceComponents){Object.keys(componentMetadata.dependencies).forEach(dependency=>{if(rulePackState.allReferenceComponents.has(dependency)){thirdPartyScan=true}})}else{msg.error("JETWC: Unable to scan for reference component dependencies - JETWC-BOOTSTRAP was not run")}}}if(thirdPartyScan){licenseFileFound=false;licenseCandidate="THIRD_PARTY_LICENSE.txt";for(let i=0;i<compRootFiles.length;i++){const rootEntry=compRootFiles[i];if(rootEntry.isFile&&rootEntry.name===licenseCandidate){licenseFileFound=true;break}}if(!licenseFileFound){issue=new context.Issue(`Component with third party dependencies is missing 3rd party license information file in root, 'THIRD_PARTY_LICENSE.txt' is expected (case sensitive)`);issue.setMsgKey(context.ruleName+"_2");context.reporter.addIssue(issue,context)}}}};module.exports=ruleDef;
@@ -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 Utils=require("../jetwc-lib/jetwcutils-componentAuditUtils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwco-prerelease-cdn"};ruleDef.prototype.getShortDescription=function(){return"Validates use of the production CDN"};ruleDef.prototype.getDescription=function(){return"This rule checks any CDN definitions to ensure that they point to assets on the production Oracle CDN, not the staging site or other sites"};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){const productionCDN=context.rulePack.getRuleOptions().cdnRoot.toLowerCase();if(context.suppData.obj){let issue;const meta=context.suppData.obj;const componentType=Utils.getComponentType(meta);const componentName=meta.name;if(meta.paths&&meta.paths.cdn){if(meta.paths.cdn.min&&!meta.paths.cdn.min.toLowerCase().startsWith(productionCDN)||meta.paths.cdn.debug&&!meta.paths.cdn.debug.toLowerCase().startsWith(productionCDN)){issue=new context.Issue(`${componentType} component '${componentName}' does not use the correct CDN (${productionCDN})`);context.reporter.addIssue(issue,context)}}}};module.exports=ruleDef;
6
+ const Utils=require("../jetwc-lib/jetwcutils-componentAuditUtils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwco-prerelease-cdn"};ruleDef.prototype.getShortDescription=function(){return"Validates use of the production CDN"};ruleDef.prototype.getDescription=function(){return"This rule checks any CDN definitions to ensure that they point to assets on the production Oracle CDN, not the staging site or other sites"};ruleDef.prototype.register=function(context){return{compjson:this._doAudit}};ruleDef.prototype._doAudit=function(context){const productionCDN=context.rulePack.getRuleCustomOption("cdnRoot")?.toLowerCase();if(context.suppData.obj){let issue;const meta=context.suppData.obj;const componentType=Utils.getComponentType(meta);const componentName=meta.name;if(meta.paths&&meta.paths.cdn){if(meta.paths.cdn.min&&!meta.paths.cdn.min.toLowerCase().startsWith(productionCDN)||meta.paths.cdn.debug&&!meta.paths.cdn.debug.toLowerCase().startsWith(productionCDN)){issue=new context.Issue(`${componentType} component '${componentName}' does not use the correct CDN (${productionCDN})`);context.reporter.addIssue(issue,context)}}}};module.exports=ruleDef;
@@ -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 TsxUtils=require("../jetwc-lib/jetwcutils-tsxUtils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwco-validate-applied-audits"};ruleDef.prototype.getShortDescription=function(){return"Validate Applied Audits"};ruleDef.prototype.getDescription=function(){return"This rule checks that any applied-audits defined by a component are actually valid in the context of the available rule-packs"};ruleDef.prototype.register=function(context){return{startup:this._setupRuleBasis,compjson:this._doAudit,Program:this._doVComponentAudit}};ruleDef.prototype._setupRuleBasis=function(context){this.validRuleNames=this._extractValidRuleNames(context);if(this.validRuleNames.size===0){context.utils.msgLib.error("Configuration for jetwco-validate-applied-audits is in error, the supplied value for \"auditRuleBundles\" does not yield any rules");return false}else{context.utils.msgLib.info(`jetwco-validate-applied-audits is using the following audit names for validation:\n${[...this.validRuleNames.keys()].join(", ")}`);return true}};ruleDef.prototype._doAudit=function(context){const componentMetadata=context.suppData.obj;this._checkAppliedAudits(context,componentMetadata)};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);this._checkAppliedAudits(context,componentInfo)};ruleDef.prototype._checkAppliedAudits=function(context,componentMetadata){if(componentMetadata?.extension?.catalog?.appliedAudits){componentMetadata.extension.catalog.appliedAudits.forEach(namedRule=>{if(!this.validRuleNames.has(namedRule?.auditName)){issue=new context.Issue(`The named applied audit "${namedRule.auditName}" does not exist in the specified audit rule pack(s)`);issue.setMsgKey(context.ruleName+"_1");context.reporter.addIssue(issue,context)}})}};ruleDef.prototype._extractValidRuleNames=function(context){const ruleBundles=context.rulePack.getRuleOption("auditRuleBundles");const flattenedRuleNames=new Set;if(Array.isArray(ruleBundles)&&ruleBundles.length>0){ruleBundles.forEach(bundle=>{if(context.utils.fsUtils.fileExistsSync(bundle)){const ruleBundleDef=context.utils.fsUtils.readJsonSync(bundle,true);if(ruleBundleDef.rules){Object.keys(ruleBundleDef.rules).forEach(ruleName=>{flattenedRuleNames.add(ruleName)})}}})}return flattenedRuleNames};module.exports=ruleDef;
6
+ const TsxUtils=require("../jetwc-lib/jetwcutils-tsxUtils");const ruleDef=function(){};ruleDef.prototype.getName=function(){return"jetwco-validate-applied-audits"};ruleDef.prototype.getShortDescription=function(){return"Validate Applied Audits"};ruleDef.prototype.getDescription=function(){return"This rule checks that any applied-audits defined by a component are actually valid in the context of the available rule-packs"};ruleDef.prototype.register=function(context){return{startup:this._setupRuleBasis,compjson:this._doAudit,Program:this._doVComponentAudit}};ruleDef.prototype._setupRuleBasis=function(context){this.validRuleNames=this._extractValidRuleNames(context);if(this.validRuleNames.size===0){context.utils.msgLib.error("Configuration for jetwco-validate-applied-audits is in error, the supplied value for \"auditRuleBundles\" does not yield any rules");return false}else{context.utils.msgLib.info(`jetwco-validate-applied-audits is using the following audit names for validation:\n${[...this.validRuleNames.keys()].join(", ")}`);return true}};ruleDef.prototype._doAudit=function(context){const componentMetadata=context.suppData.obj;this._checkAppliedAudits(context,componentMetadata)};ruleDef.prototype._doVComponentAudit=function(context){const componentInfo=TsxUtils.matchToVComponentImpl(context,context.filepath);this._checkAppliedAudits(context,componentInfo)};ruleDef.prototype._checkAppliedAudits=function(context,componentMetadata){if(componentMetadata?.extension?.catalog?.appliedAudits){componentMetadata.extension.catalog.appliedAudits.forEach(namedRule=>{if(!this.validRuleNames.has(namedRule?.auditName)){issue=new context.Issue(`The named applied audit "${namedRule.auditName}" does not exist in the specified audit rule pack(s)`);issue.setMsgKey(context.ruleName+"_1");context.reporter.addIssue(issue,context)}})}};ruleDef.prototype._extractValidRuleNames=function(context){const ruleBundles=context.rulePack.getRuleCustomOption("auditRuleBundles");const flattenedRuleNames=new Set;if(Array.isArray(ruleBundles)&&ruleBundles.length>0){ruleBundles.forEach(bundle=>{if(context.utils.fsUtils.fileExistsSync(bundle)){const ruleBundleDef=context.utils.fsUtils.readJsonSync(bundle,true);if(ruleBundleDef.rules){Object.keys(ruleBundleDef.rules).forEach(ruleName=>{flattenedRuleNames.add(ruleName)})}}})}return flattenedRuleNames};module.exports=ruleDef;
@@ -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
- {"title":"Oracle Internal Audit Rules for JET Custom Component Authors","prefix":"JETWCO","version":"1.17.1","rules":{"jetwco-bootstrap":{"group":"jetwco-do-not-disable","enabled":true,"severity":"info","debug":false,"diagnosticFile":"jetwco-diagnostics","auditBuildOutput":false,"testMode":false,"filetype":["tsx","css","html","js","json","md","ts"],"$required":true,"amd":false},"jetwco-component-cdn":{"group":"jetwco-pre-release","severity":"major","filetype":["json"],"amd":false},"jetwco-prerelease-cdn":{"group":"jetwco-pre-release","enabled":true,"cdnRoot":"https://static.oracle.com/cdn/","severity":"blocker","filetype":["json"],"amd":false},"jetwco-thirdparty-ba":{"group":"jetwco-pre-release","enabled":true,"severity":"major","filetype":["json","tsx"],"amd":false},"jetwco-license-info":{"group":"jetwco-pre-release","enabled":true,"severity":"blocker","filetype":["json","tsx"],"amd":false,"allowedLicenseURLs":[]},"jetwco-exchange-version-check":{"group":"jetwco-api","enabled":false,"severity":"info","filetype":["json","tsx"],"amd":false},"jetwco-component-api-changes":{"group":"jetwco-api","enabled":false,"severity":"blocker","filetype":["json","tsx"],"clearCache":false,"amd":false,"status":"deprecated"},"jetwco-compjson-ns-reg":{"group":"jetwco-api","enabled":true,"severity":"major","filetype":["json","tsx"],"amd":false},"jetwco-component-api-baseline-changes":{"group":"jetwco-api","enabled":false,"severity":"blocker","filetype":["json","tsx"],"baseline":{},"clearCache":false,"amd":false,"status":"deprecated"},"jetwco-displayname-standards":{"group":"jetwco-doc","enabled":true,"severity":"minor","filetype":["json","tsx"],"amd":false},"jetwco-description-standards":{"group":"jetwco-doc","enabled":true,"severity":"minor","filetype":["json","tsx"],"amd":false},"jetwco-component-api-controlled-changes":{"group":"jetwco-api","enabled":false,"severity":"blocker","filetype":["json","tsx"],"clearCache":false,"controls":{},"ignorePackPrivate":false,"tolerantAPICompare":false,"amd":false},"jetwco-validate-applied-audits":{"group":"jetwco-pre-release","enabled":false,"severity":"blocker","filetype":["json","tsx"],"amd":false,"auditRuleBundles":[]}}}
6
+ {"title":"Oracle Internal Audit Rules for JET Custom Component Authors","prefix":"JETWCO","version":"1.18.0","rules":{"jetwco-bootstrap":{"group":"jetwco-do-not-disable","enabled":true,"severity":"info","filetype":["tsx","css","html","js","json","md","ts"],"$required":true,"amd":false,"customOpts":{"debug":false,"diagnosticFile":"jetwco-diagnostics","auditBuildOutput":false,"testMode":false}},"jetwco-component-cdn":{"group":"jetwco-pre-release","severity":"major","filetype":["json"],"amd":false},"jetwco-prerelease-cdn":{"group":"jetwco-pre-release","enabled":true,"severity":"blocker","filetype":["json"],"amd":false,"customOpts":{"cdnRoot":"https://static.oracle.com/cdn/"}},"jetwco-thirdparty-ba":{"group":"jetwco-pre-release","enabled":true,"severity":"major","filetype":["json","tsx"],"amd":false},"jetwco-license-info":{"group":"jetwco-pre-release","enabled":true,"severity":"blocker","filetype":["json","tsx"],"amd":false,"customOpts":{"allowedLicenseURLs":[]}},"jetwco-exchange-version-check":{"group":"jetwco-api","enabled":false,"severity":"info","filetype":["json","tsx"],"amd":false},"jetwco-component-api-changes":{"group":"jetwco-api","enabled":false,"severity":"blocker","filetype":["json","tsx"],"amd":false,"status":"deprecated","customOpts":{"clearCache":false}},"jetwco-compjson-ns-reg":{"group":"jetwco-api","enabled":true,"severity":"major","filetype":["json","tsx"],"amd":false},"jetwco-component-api-baseline-changes":{"group":"jetwco-api","enabled":false,"severity":"blocker","filetype":["json","tsx"],"amd":false,"status":"deprecated","customOpts":{"baseline":{},"clearCache":false}},"jetwco-displayname-standards":{"group":"jetwco-doc","enabled":true,"severity":"minor","filetype":["json","tsx"],"amd":false},"jetwco-description-standards":{"group":"jetwco-doc","enabled":true,"severity":"minor","filetype":["json","tsx"],"amd":false},"jetwco-component-api-controlled-changes":{"group":"jetwco-api","enabled":false,"severity":"blocker","filetype":["json","tsx"],"amd":false,"customOpts":{"clearCache":false,"controls":{},"ignorePackPrivate":false,"tolerantAPICompare":false}},"jetwco-validate-applied-audits":{"group":"jetwco-pre-release","enabled":false,"severity":"blocker","filetype":["json","tsx"],"amd":false,"customOpts":{"auditRuleBundles":[]}}}}
@@ -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 COLOR_PROPS=["color","background-color","border-color","border-bottom-color","border-left-color","border-right-color","border-bottom-color","caret-color","column-rule-color","outline-color","text-decoration-color"];const COLOR_PROPS_MULTI=["background","background-image","border","border-bottom","outline","text-shadow"];const LENGTH_PROP_SET=new Set(["background-size","border","border-bottom","border-bottom-left-radius","border-bottom-right-radius","border-bottom-width","border-left","border-left-width","border-image","border-image-width","border-image-outset","border-radius","border-right","border-right-width","border-spacing","border-top","border-top-left-radius","border-top-right-radius","border-top-width","border-width","bottom","box-shadow","clip","column-gap","column-rule","column-rule-width","column-width","columns","filter","flex","flex-basis","font","font-size","grid","grid-auto-columns","grid-auto-rows","grid-column-gap","grid-gap","grid-row-gap","grid-template","grid-temlate-columns","grid-template-rows","height","min-height","width","min-width","max-width","line-height","left","letter-spacing","margin","margin-top","margin-bottom","margin-left","margin-right","max-height","object-position","outline","outline-offset","padding","padding-left","padding-right","padding-top","padding-bottom","perspective","outline-width","right","tab-size","text-indent","text-shadow","top","vertical-align","width","word-spacing"]);module.exports={COLOR_PROPS,COLOR_PROPS_MULTI,LENGTH_PROP_SET};
6
+ const COLOR_PROPS=["color","background-color","border-bottom-color","border-left-color","border-right-color","border-bottom-color","caret-color","column-rule-color","outline-color","text-decoration-color"];const COLOR_MEMBERS=["color","backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderBottomColor","caretColor","columnRuleColor","outlineColor","textDecorationColor"];const COLOR_PROPS_MULTI=["background","background-image","border","border-bottom","border-color","outline","text-shadow"];const COLOR_MEMBERS_MULTI=["background","backgroundImage","border","borderBottom","borderColor","outline","textShadow"];const LENGTH_PROP_SET=new Set(["background-size","border","border-bottom","border-bottom-left-radius","border-bottom-right-radius","border-bottom-width","border-left","border-left-width","border-image","border-image-width","border-image-outset","border-radius","border-right","border-right-width","border-spacing","border-top","border-top-left-radius","border-top-right-radius","border-top-width","border-width","bottom","box-shadow","clip","column-gap","column-rule","column-rule-width","column-width","columns","filter","flex","flex-basis","font","font-size","grid","grid-auto-columns","grid-auto-rows","grid-column-gap","grid-gap","grid-row-gap","grid-template","grid-temlate-columns","grid-template-rows","height","min-height","width","min-width","max-width","line-height","left","letter-spacing","margin","margin-top","margin-bottom","margin-left","margin-right","margin-block","max-height","object-position","outline","outline-offset","padding","padding-left","padding-right","padding-top","padding-bottom","perspective","outline-width","right","tab-size","text-indent","text-shadow","top","vertical-align","width","word-spacing"]);const LENGTH_MEMBER_PROP_SET=new Set(["backgroundSize","border","borderBottom","borderBottomLeftRadius","borderBottomRightRadius","borderBottomWidth","borderLeft","borderLeftWidth","borderImage","borderImageWidth","borderImageOutset","borderRadius","borderRight","borderRightWidth","borderSpacing","borderTop","borderTopLeftRadius","borderTopRightRadius","borderTopWidth","borderWidth","bottom","boxShadow","clip","columnGap","columnRule","columnRuleWidth","columnWidth","columns","filter","flex","flexBasis","font","fontSize","grid","gridAutoColumns","gridAutoRows","gridColumnGap","gridGap","gridRowGap","gridTemplate","gridTemlateColumns","gridTemplateRows","height","minHeight","width","minWidth","maxWidth","left","letter-spacing","lineHeight","margin","marginTop","marginBottom","marginLeft","marginRight","marginBlock","maxHeight","objectPosition","outline","outlineOffset","padding","paddingLeft","paddingRight","paddingTop","paddingBottom","perspective","outlineWidth","right","tabSize","textIndent","textShadow","top","verticalAlign","width","wordSpacing"]);module.exports={COLOR_PROPS,COLOR_MEMBERS,COLOR_PROPS_MULTI,COLOR_MEMBERS_MULTI,LENGTH_PROP_SET,LENGTH_MEMBER_PROP_SET};
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const CLASS="class";module.exports=function(ruleCtx,attr,attrVal){var attribs,attrib,ret=false;if(attr&&(attribs=ruleCtx.tagNode.attribs)){if(attrib=attribs[attr]){if(arguments.length===2){return true}if(attr===CLASS){let clsName,i;let a=attrib.split(" ");for(i=0;i<a.length;i++){if(clsName=a[i]){if(clsName===attrVal){ret=true;break}}}}else if(attrib===attrVal){ret=true}}}return ret};
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const CLASS="class";const LITERAL="Literal";module.exports=function(tsxComp,attr,value){var props,prop;if(props=tsxComp.properties){let propVal,a,i;for(i=0;i<props.length;i++){prop=props[i];if(prop.name===attr){if(attr===CLASS){if(arguments.length===2){return true}let j;if((propVal=prop.node.value)&&propVal.type===LITERAL){a=propVal.value.split(" ");for(j=0;j<a.length;j++){if(a[j]===value){return true}}break}}else{if((propVal=prop.node.value)&&propVal.type===LITERAL){if(arguments.length===2){return true}if(propVal.value===value){return true}}}}}}return false};
@@ -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
- {"oj-html-ojtag-deprecated":"0010","oj-html-ojtag-deprecated_user":"0011","oj-html-wctag-maintenance":"0014","oj-html-wctag-supersedes":"0015","oj-html-attr-json_1":"0020","oj-html-attr-json_2":"0021","oj-html-ojattr":"0040","oj-html-ojattr_1":"0041","oj-html-ojattr-520":"0040","oj-html-ojattr-value":"0060","oj-html-attr-2def":"0070","oj-html-attr-prefix-ro":"0073","oj-html-attr-prefix-expr":"0075","oj-html-attr-req":"0077","oj-html-ojattr-deprecated":"0080","oj-html-ojattr-deprecated_1":"0081","oj-html-ojattr-deprecated_2":"0082","oj-html-ojattr-deprecated_3":"0083","oj-html-ojattr-enum-deprecated":"0085","oj-html-ojattr-enum-deprecated_user":"0086","oj-html-ojevent":"0090","oj-html-jq-databind_1":"0100","oj-html-jq-databind_2":"0110","oj-html-jq-databind_3":"0120","oj-html-databind-all":"0130","oj-html-ojslot":"0140","oj-html-slot-deprecated":"0145","oj-html-slot-deprecated_user":"0146","oj-html-slot-name":"0150","oj-html-slot-pref-content":"0153","oj-html-slot-item-minmax":"0156","oj-html-slot-item-minmax_1":"0157","oj-html-binding-attr":"0160","oj-html-bindif-test":"0163","oj-html-bindforeach-data":"0165","oj-html-dlg-title":"0168","oj-html-attr-$unique_1":"0170","oj-html-attr-$unique_2":"0180","oj-html-tag-attr-noprefix":"0190","oj-html-label-for-prefix":"0195","oj-html-ojtag-globattr-noprefix":"0200","oj-html-ojtag-nonglobattr-prefix":"0210","oj-html-invalid-doctype":"0220","oj-html-invalid-doctype_1":"0221","oj-html-missing-doctype":"0230","oj-html-oj-lib":"0240","oj-html-ko-comment":"0250","oj-html-ko-databind":"0260","oj-html-cca-count":"0270","oj-html-cca-count_1":"0271","oj-html-cdn":"0280","oj-html-ojattr-evt-syntax":"0290","oj-html-ojtag-datacmd":"0310","oj-html-ojtag-datacmd_1":"0311","oj-html-ojtag-datacmd_2":"0312","oj-html-ojtag-datacmd_3":"0313","oj-html-ojtag-datactx":"0320","oj-html-wctag-id":"0330","oj-html-wctag-id_1":"0331","oj-html-wctag-id_2":"0332","oj-html-wctag-for":"0340","oj-html-wctag-arialabelledby":"0350","oj-html-wctag-$props":"0360","oj-html-wctag-$props_1":"0361","oj-html-wctag-$props_2":"0362","oj-html-wctag-$props_3":"0363","oj-html-form-bindif":"0370","oj-html-ojtag-ns":"0385","oj-html-ojtag-ns_1":"0386","oj-html-unsup-theme":"0390","oj-html-unsup-theme_1":"0391","oj-html-form-noflex":"0395","oj-html-5-tag-obs":"0400","oj-html-5-attr-obs_1":"0410","oj-html-5-attr-obs_2":"0411","oj-html-redwood-cssvars":"0420","oj-html-redwood-cssnovars":"0421","oj-html-redwood-bp-endslot":"0422","oj-html-template-index":"0425","oj-form-maxcols":"0430","oj-form-maxcols_1":"0431","oj-form-maxcols_2":"0432","oj-html-form-layout-maxcols":"0435","oj-html-file-pick-accept":"0450","oj-html-file-pick-accept_1":"0451","oj-html-file-pick-accept_2":"0452","oj-html-wctag-packprivate":"0465","oj-html-picker-attrs":"0470","oj-html-wctag-nested":"0480","oj-html-notag-style":"0490","oj-html-notag-style_1":"0491","oj-html-msgs-cat-text":"0495","oj-html-msgs-cat-text_1":"0496","oj-html-msgs-cat-text_2":"0497","oj-html-msgs-cat-text_3":"0498","oj-html-no-style":"0505","oj-html-no-style-tag":"0505","oj-html-alta-deprecated":"0510","oj-html-rating-gauge-size":"0520","oj-html-rating-gauge-track-resize":"0525","oj-html-slot-default":"0530","oj-acc-input-aria-label_1":"2000","oj-acc-input-aria-label_2":"2010","oj-acc-input-aria-label_3":"2020","oj-acc-input-aria-label_4":"2030","oj-acc-input-aria-label_5":"2031","oj-acc-input-aria-label_6":"2032","oj-acc-select-aria-label_1":"2040","oj-acc-select-aria-label_2":"2050","oj-acc-select-aria-label_3":"2060","oj-acc-select-aria-label_4":"2070","oj-acc-select-aria-label_5":"2071","oj-acc-select-aria-label_6":"2072","oj-acc-combobox-aria-label_1":"2080","oj-acc-combobox-aria-label_2":"2090","oj-acc-combobox-aria-label_3":"2100","oj-acc-combobox-aria-label_4":"2120","oj-acc-combobox-aria-label_5":"2121","oj-acc-combobox-aria-label_6":"2122","oj-acc-aria-labelledby":"2130","oj-acc-avatar-aria-role":"2140","oj-acc-film-strip-aria-label":"2150","oj-acc-aria-prop":"2160","oj-acc-aria-ojselector-labelledby":"2170","oj-acc-button-onclick":"2180","oj-html-cca-tagname":"2200","oj-html-cca-tagname_1":"2201","oj-html-attr-expr-delims":"2211","oj-html-tabbar-edge":"2215","oj-html-tabbar-edge_1":"2216","oj-html-wctag-anti-pattern":"2220","oj-html-prop-anti-pattern":"2225","oj-html-prop-anti-pattern_1":"2226","oj-html-attr-expr-writeback":"2235","oj-html-event-focus-blur":"2240","oj-js-ojcomp-deprecated":"3000","oj-js-comp-meth-deprecated":"3020","oj-js-comp-meth-deprecated_1":"3022","oj-js-comp-meth-deprecated_2":"3023","oj-js-comp-attr-deprecated":"3025","oj-js-comp-attr-deprecated_1":"3026","oj-js-comp-attr-deprecated_2":"3027","oj-js-ojcomp-new":"3060","oj-js-ojcomp-exist":"3070","oj-js-ojcomp-exist_1":"3071","oj-js-var-undef":"3080","oj-js-var-undef_1":"3082","oj-js-poly-promise":"3090","oj-js-noconsole":"3100","oj-js-no-ext-final":"3200","oj-ts-ojcomp-deprecated":"3400","oj-ts-comp-meth-deprecated":"3420","oj-ts-comp-meth-deprecated_1":"3422","oj-ts-comp-meth-deprecated_2":"3423","oj-ts-comp-attr-deprecated":"3425","oj-ts-comp-attr-deprecated_1":"3426","oj-ts-comp-attr-deprecated_2":"3427","oj-ts-ojcomp-new":"3440","oj-ts-ojcomp-exist":"3445","oj-ts-ojcomp-exist_1":"3450","oj-ts-poly-promise":"3455","oj-ts-noconsole":"3460","oj-ts-no-ext-final":"3465","oj-ts-numconv-pattern":"3470","oj-json-syntax":"4000","oj-html-style":"5000","oj-html-style_1":"5001","oj-html-style-deprecated":"5010","oj-html-ojstyle":"5015","oj-html-style-bp-color":"5020","oj-html-style-bp-font":"5025","oj-html-style-bp-display":"5030","oj-html-self-close":"5035","oj-html-style-bp-font-family":"5040","oj-html-style-abs-units":"5045","oj-html-style-abs-units_1":"5046","oj-html-style-abs-units_2":"5047","oj-html-stylesel":"5080","oj-html-stylesel_1":"5081","oj-html-stylesel_2":"5082","oj-html-stylesel_3":"5083","oj-html-stylesel_4":"5084","oj-html-stylesel_5":"5085","oj-html-stylesel_6":"5086","oj-html-stylesel_7":"5087","oj-html-input-isodate":"5095","oj-html-input-isodate_1":"5096","oj-html-input-isodate_2":"5097","oj-html-input-isodate_3":"5098","oj-html-input-isodate_4":"5099","oj-html-input-isodate_5":"5100","oj-html-input-isodate_6":"5101","oj-html-input-isodate_7":"5102","oj-html-input-isodate_8":"5103","oj-html-input-isodate_9":"5104","oj-html-pageopts-type":"5110","oj-html-pageopts-type_2":"5111","oj-html-slot-deprecated_aged":"5800","oj-html-ojtag-deprecated_aged":"5805","oj-html-ojattr-deprecated_aged":"5810","oj-html-ojattr-deprecated_1_aged":"5811","oj-html-ojattr-deprecated_2_aged":"5812","oj-html-ojattr-deprecated_3_aged":"5813","oj-html-ojattr-deprecated_user":"5814","oj-html-ojattr-deprecated_1_user":"5815","oj-html-ojattr-deprecated_2_user":"5816","oj-html-ojattr-deprecated_3_user":"5817","oj-html-ojattr-enum-deprecated_aged":"5820","oj-html-alta-deprecated_aged":"5825","oj-js-numconv-pattern":"5830","oj-html-treeview-actionable-content":"5835","oj-html-binding-as-slot-child":"5840","oj-html-binding-as-slot-child_1":"5841","oj-tsx-ojtag-deprecated_aged":"5845","oj-tsx-slot-deprecated_aged":"5850","oj-tsx-ojattr-enum-deprecated_aged":"5855","oj-tsx-ojattr-deprecated_aged":"5860","oj-tsx-ojattr-deprecated_1_aged":"5861","oj-tsx-ojattr-deprecated_2_aged":"5862","oj-tsx-ojattr-deprecated_3_aged":"5863","oj-tsx-ojattr-deprecated_user":"5870","oj-tsx-ojattr-deprecated_1_user":"5871","oj-tsx-ojattr-deprecated_2_user":"5872","oj-tsx-ojattr-deprecated_3_user":"5873","oj-css-style-override_1":"6010","oj-css-style-override_2":"6011","oj-css-style-bp-color":"6015","oj-css-style-deprecated":"6020","oj-css-style-bp-font":"6025","oj-css-style-bp-display":"6030","oj-css-style-bp-font-family":"6035","oj-css-style-abs-units":"6040","oj-css-style-abs-units_1":"6041","oj-css-bp-float":"6045","oj-css-bp-float_1":"6046","oj-css-bp-textalign":"6050","oj-css-bp-textalign_1":"6051","oj-css-bp-border-color":"6060","oj-css-bp-border-color_1":"6061","oj-css-var-override":"6065","oj-css-var-override_1":"6066","oj-css-bp-dir-flow":"6070","oj-tsx-wctag-packprivate":"7000","oj-tsx-ojtag-deprecated":"7010","oj-tsx-ojtag-deprecated_user":"7011","oj-tsx-cca-tagname":"7015","oj-tsx-cca-tagname_1":"7016","oj-tsx-ojattr":"7020","oj-tsx-ojattr_1":"7021","oj-tsx-ojattr_2":"7022","oj-tsx-ojattr-value":"7025","oj-tsx-attr-req":"7030","oj-tsx-5-tag-obs":"7035","oj-tsx-prop-inline-definition":"7040","oj-tsx-aria-ojselector-labelledby":"7050","oj-tsx-aria-prop":"7055","oj-tsx-rating-gauge-size":"7060","oj-tsx-input-isodate":"7065","oj-tsx-input-isodate_1":"7066","oj-tsx-input-isodate_2":"7067","oj-tsx-input-isodate_3":"7068","oj-tsx-input-isodate_4":"7069","oj-tsx-input-isodate_5":"7070","oj-tsx-input-isodate_6":"7071","oj-tsx-input-isodate_7":"7072","oj-tsx-input-isodate_8":"7073","oj-tsx-input-isodate_9":"7074","oj-tsx-unsup-theme":"7080","oj-tsx-unsup-theme_1":"7081","oj-tsx-pageopts-type":"7085","oj-tsx-pageopts-type_1":"7086","oj-tsx-pageopts-type_2":"7087","oj-tsx-pageopts-type_3":"7088","oj-tsx-picker-attrs":"7090","oj-tsx-wctag-nested":"7095","oj-tsx-dlg-title":"7100","oj-tsx-acc-button-onclick":"7105","oj-tsx-acc-avatar-aria-role":"7110","oj-tsx-databind-all":"7115","oj-tsx-wctag-maintenance":"7120","oj-tsx-slot-deprecated":"7125","oj-tsx-slot-deprecated_user":"7126","oj-tsx-ojattr-deprecated":"7130","oj-tsx-ojattr-deprecated_1":"7131","oj-tsx-ojattr-deprecated_2":"7132","oj-tsx-ojattr-deprecated_3":"7133","oj-tsx-jsx-prop":"7135","oj-tsx-jsx-prop_1":"7136","oj-tsx-form-bindif":"7140","oj-tsx-form-noflex":"7145","oj-tsx-rating-gauge-track-resize":"7150","oj-tsx-slot-pref-content":"7155","oj-tsx-slot-pref-content_1":"7156","oj-tsx-ojtag-ns":"7160","oj-tsx-ojtag-ns_1":"7161","oj-tsx-ojattr-enum-deprecated":"7165","oj-tsx-ojattr-enum-deprecated_user":"7166","oj-tsx-tabbar-edge":"7170","oj-tsx-tabbar-edge_1":"7171","oj-tsx-wctag-anti-pattern":"7175","oj-tsx-prop-anti-pattern":"7180","oj-tsx-prop-anti-pattern_1":"7181","oj-tsx-treeview-actionable-content":"7185","oj-tsx-popup-sibling":"7190","oj-tsx-event":"7195","oj-cca-comp-json-file":"9000","oj-cca-comp-json-schema":"9005","oj-cca-comp-json-compdeps":"9010","oj-cca-comp-zip":"9015","oj-cca-comp-zip-type":"9020","oj-cca-comp-zip-content":"9025","oj-cca-comp-zip-content-case":"9030","oj-cca-compjson-bp-obj":"9040","oj-cca-compjson-bp-ar":"9043","oj-cca-compjson-ns-reg":"9046","oj-cca-compjson-ns-reg_1":"9047","oj-cca-compjson-bp-jetver":"9049","oj-cca-compjson-bp-dsplyname":"9052"}
6
+ {"oj-html-ojtag-deprecated":"0010","oj-html-ojtag-deprecated_user":"0011","oj-html-wctag-maintenance":"0014","oj-html-wctag-supersedes":"0015","oj-html-attr-json_1":"0020","oj-html-attr-json_2":"0021","oj-html-ojattr":"0040","oj-html-ojattr_1":"0041","oj-html-ojattr-520":"0040","oj-html-ojattr-value":"0060","oj-html-attr-2def":"0070","oj-html-attr-prefix-ro":"0073","oj-html-attr-prefix-expr":"0075","oj-html-attr-req":"0077","oj-html-ojattr-deprecated":"0080","oj-html-ojattr-deprecated_1":"0081","oj-html-ojattr-deprecated_2":"0082","oj-html-ojattr-deprecated_3":"0083","oj-html-ojattr-enum-deprecated":"0085","oj-html-ojattr-enum-deprecated_user":"0086","oj-html-ojevent":"0090","oj-html-jq-databind_1":"0100","oj-html-jq-databind_2":"0110","oj-html-jq-databind_3":"0120","oj-html-databind-all":"0130","oj-html-ojslot":"0140","oj-html-slot-deprecated":"0145","oj-html-slot-deprecated_user":"0146","oj-html-slot-name":"0150","oj-html-slot-pref-content":"0153","oj-html-slot-item-minmax":"0156","oj-html-slot-item-minmax_1":"0157","oj-html-binding-attr":"0160","oj-html-bindif-test":"0163","oj-html-bindforeach-data":"0165","oj-html-dlg-title":"0168","oj-html-attr-$unique_1":"0170","oj-html-attr-$unique_2":"0180","oj-html-tag-attr-noprefix":"0190","oj-html-label-for-prefix":"0195","oj-html-ojtag-globattr-noprefix":"0200","oj-html-ojtag-nonglobattr-prefix":"0210","oj-html-invalid-doctype":"0220","oj-html-invalid-doctype_1":"0221","oj-html-missing-doctype":"0230","oj-html-oj-lib":"0240","oj-html-ko-comment":"0250","oj-html-ko-comment_1":"0251","oj-html-ko-databind":"0260","oj-html-cca-count":"0270","oj-html-cca-count_1":"0271","oj-html-cdn":"0280","oj-html-ojattr-evt-syntax":"0290","oj-html-ojtag-datacmd":"0310","oj-html-ojtag-datacmd_1":"0311","oj-html-ojtag-datacmd_2":"0312","oj-html-ojtag-datacmd_3":"0313","oj-html-ojtag-datactx":"0320","oj-html-wctag-id":"0330","oj-html-wctag-id_1":"0331","oj-html-wctag-id_2":"0332","oj-html-wctag-for":"0340","oj-html-wctag-arialabelledby":"0350","oj-html-wctag-$props":"0360","oj-html-wctag-$props_1":"0361","oj-html-wctag-$props_2":"0362","oj-html-wctag-$props_3":"0363","oj-html-form-bindif":"0370","oj-html-ojtag-ns":"0385","oj-html-ojtag-ns_1":"0386","oj-html-unsup-theme":"0390","oj-html-unsup-theme_1":"0391","oj-html-form-noflex":"0395","oj-html-5-tag-obs":"0400","oj-html-5-attr-obs_1":"0410","oj-html-5-attr-obs_2":"0411","oj-html-redwood-cssvars":"0420","oj-html-redwood-cssnovars":"0421","oj-html-redwood-bp-endslot":"0422","oj-html-template-index":"0425","oj-form-maxcols":"0430","oj-form-maxcols_1":"0431","oj-form-maxcols_2":"0432","oj-html-form-layout-maxcols":"0435","oj-html-file-pick-accept":"0450","oj-html-file-pick-accept_1":"0451","oj-html-file-pick-accept_2":"0452","oj-html-wctag-packprivate":"0465","oj-html-picker-attrs":"0470","oj-html-wctag-nested":"0480","oj-html-notag-style":"0490","oj-html-notag-style_1":"0491","oj-html-msgs-cat-text":"0495","oj-html-msgs-cat-text_1":"0496","oj-html-msgs-cat-text_2":"0497","oj-html-msgs-cat-text_3":"0498","oj-html-no-style":"0505","oj-html-no-style-tag":"0505","oj-html-alta-deprecated":"0510","oj-html-rating-gauge-size":"0520","oj-html-rating-gauge-track-resize":"0525","oj-html-slot-default":"0530","oj-html-redwood-clear-icon":"0535","oj-acc-input-aria-label_1":"2000","oj-acc-input-aria-label_2":"2010","oj-acc-input-aria-label_3":"2020","oj-acc-input-aria-label_4":"2030","oj-acc-input-aria-label_5":"2031","oj-acc-input-aria-label_6":"2032","oj-acc-select-aria-label_1":"2040","oj-acc-select-aria-label_2":"2050","oj-acc-select-aria-label_3":"2060","oj-acc-select-aria-label_4":"2070","oj-acc-select-aria-label_5":"2071","oj-acc-select-aria-label_6":"2072","oj-acc-combobox-aria-label_1":"2080","oj-acc-combobox-aria-label_2":"2090","oj-acc-combobox-aria-label_3":"2100","oj-acc-combobox-aria-label_4":"2120","oj-acc-combobox-aria-label_5":"2121","oj-acc-combobox-aria-label_6":"2122","oj-acc-aria-labelledby":"2130","oj-acc-avatar-aria-role":"2140","oj-acc-film-strip-aria-label":"2150","oj-acc-aria-prop":"2160","oj-acc-aria-ojselector-labelledby":"2170","oj-acc-button-onclick":"2180","oj-acc-button-label":"2185","oj-html-cca-tagname":"2200","oj-html-cca-tagname_1":"2201","oj-html-attr-expr-delims":"2211","oj-html-tabbar-edge":"2215","oj-html-tabbar-edge_1":"2216","oj-html-wctag-anti-pattern":"2220","oj-html-prop-anti-pattern":"2225","oj-html-prop-anti-pattern_1":"2226","oj-html-attr-expr-writeback":"2235","oj-html-event-focus-blur":"2240","oj-js-ojcomp-deprecated":"3000","oj-js-comp-meth-deprecated":"3020","oj-js-comp-meth-deprecated_1":"3022","oj-js-comp-meth-deprecated_2":"3023","oj-js-comp-attr-deprecated":"3025","oj-js-comp-attr-deprecated_1":"3026","oj-js-comp-attr-deprecated_2":"3027","oj-js-ojcomp-new":"3060","oj-js-ojcomp-exist":"3070","oj-js-ojcomp-exist_1":"3071","oj-js-var-undef":"3080","oj-js-var-undef_1":"3082","oj-js-poly-promise":"3090","oj-js-noconsole":"3100","oj-js-no-ext-final":"3200","oj-ts-ojcomp-deprecated":"3400","oj-ts-comp-meth-deprecated":"3420","oj-ts-comp-meth-deprecated_1":"3422","oj-ts-comp-meth-deprecated_2":"3423","oj-ts-comp-attr-deprecated":"3425","oj-ts-comp-attr-deprecated_1":"3426","oj-ts-comp-attr-deprecated_2":"3427","oj-ts-ojcomp-new":"3440","oj-ts-ojcomp-exist":"3445","oj-ts-ojcomp-exist_1":"3450","oj-ts-poly-promise":"3455","oj-ts-noconsole":"3460","oj-ts-no-ext-final":"3465","oj-ts-numconv-pattern":"3470","oj-json-syntax":"4000","oj-html-style":"5000","oj-html-style_1":"5001","oj-html-style-deprecated":"5010","oj-html-ojstyle":"5015","oj-html-style-bp-color":"5020","oj-html-style-bp-font":"5025","oj-html-style-bp-display":"5030","oj-html-self-close":"5035","oj-html-style-bp-font-family":"5040","oj-html-style-abs-units":"5045","oj-html-style-abs-units_1":"5046","oj-html-style-abs-units_2":"5047","oj-html-stylesel":"5080","oj-html-stylesel_1":"5081","oj-html-stylesel_2":"5082","oj-html-stylesel_3":"5083","oj-html-stylesel_4":"5084","oj-html-stylesel_5":"5085","oj-html-stylesel_6":"5086","oj-html-stylesel_7":"5087","oj-html-input-isodate":"5095","oj-html-input-isodate_1":"5096","oj-html-input-isodate_2":"5097","oj-html-input-isodate_3":"5098","oj-html-input-isodate_4":"5099","oj-html-input-isodate_5":"5100","oj-html-input-isodate_6":"5101","oj-html-input-isodate_7":"5102","oj-html-input-isodate_8":"5103","oj-html-input-isodate_9":"5104","oj-html-pageopts-type":"5110","oj-html-pageopts-type_2":"5111","oj-html-style-bp-margin-padding":"5120","oj-html-style-bp-margin-padding_1":"5121","oj-html-style-bp-margin-padding_2":"5122","oj-html-button-size-chroming":"5130","oj-html-button-size-chroming_1":"5131","oj-html-bp-button-xs-chroming":"5135","oj-html-bp-title-to-tooltip":"5140","oj-html-slot-deprecated_aged":"5800","oj-html-ojtag-deprecated_aged":"5805","oj-html-ojattr-deprecated_aged":"5810","oj-html-ojattr-deprecated_1_aged":"5811","oj-html-ojattr-deprecated_2_aged":"5812","oj-html-ojattr-deprecated_3_aged":"5813","oj-html-ojattr-deprecated_user":"5814","oj-html-ojattr-deprecated_1_user":"5815","oj-html-ojattr-deprecated_2_user":"5816","oj-html-ojattr-deprecated_3_user":"5817","oj-html-ojattr-enum-deprecated_aged":"5820","oj-html-alta-deprecated_aged":"5825","oj-js-numconv-pattern":"5830","oj-html-treeview-actionable-content":"5835","oj-html-binding-as-slot-child":"5840","oj-html-binding-as-slot-child_1":"5841","oj-tsx-ojtag-deprecated_aged":"5845","oj-tsx-slot-deprecated_aged":"5850","oj-tsx-ojattr-enum-deprecated_aged":"5855","oj-tsx-ojattr-deprecated_aged":"5860","oj-tsx-ojattr-deprecated_1_aged":"5861","oj-tsx-ojattr-deprecated_2_aged":"5862","oj-tsx-ojattr-deprecated_3_aged":"5863","oj-tsx-ojattr-deprecated_user":"5870","oj-tsx-ojattr-deprecated_1_user":"5871","oj-tsx-ojattr-deprecated_2_user":"5872","oj-tsx-ojattr-deprecated_3_user":"5873","oj-css-style-override_1":"6010","oj-css-style-override_2":"6011","oj-css-style-bp-color":"6015","oj-css-style-deprecated":"6020","oj-css-style-bp-font":"6025","oj-css-style-bp-display":"6030","oj-css-style-bp-font-family":"6035","oj-css-style-abs-units":"6040","oj-css-style-abs-units_1":"6041","oj-css-bp-float":"6045","oj-css-bp-float_1":"6046","oj-css-bp-textalign":"6050","oj-css-bp-textalign_1":"6051","oj-css-bp-border-color":"6060","oj-css-bp-border-color_1":"6061","oj-css-var-override":"6065","oj-css-var-override_1":"6066","oj-css-bp-dir-flow":"6070","oj-tsx-wctag-packprivate":"7000","oj-tsx-ojtag-deprecated":"7010","oj-tsx-ojtag-deprecated_user":"7011","oj-tsx-cca-tagname":"7015","oj-tsx-cca-tagname_1":"7016","oj-tsx-ojattr":"7020","oj-tsx-ojattr_1":"7021","oj-tsx-ojattr_2":"7022","oj-tsx-ojattr-value":"7025","oj-tsx-attr-req":"7030","oj-tsx-5-tag-obs":"7035","oj-tsx-prop-inline-definition":"7040","oj-tsx-aria-ojselector-labelledby":"7050","oj-tsx-aria-prop":"7055","oj-tsx-rating-gauge-size":"7060","oj-tsx-input-isodate":"7065","oj-tsx-input-isodate_1":"7066","oj-tsx-input-isodate_2":"7067","oj-tsx-input-isodate_3":"7068","oj-tsx-input-isodate_4":"7069","oj-tsx-input-isodate_5":"7070","oj-tsx-input-isodate_6":"7071","oj-tsx-input-isodate_7":"7072","oj-tsx-input-isodate_8":"7073","oj-tsx-input-isodate_9":"7074","oj-tsx-unsup-theme":"7080","oj-tsx-unsup-theme_1":"7081","oj-tsx-pageopts-type":"7085","oj-tsx-pageopts-type_1":"7086","oj-tsx-pageopts-type_2":"7087","oj-tsx-pageopts-type_3":"7088","oj-tsx-picker-attrs":"7090","oj-tsx-wctag-nested":"7095","oj-tsx-dlg-title":"7100","oj-tsx-acc-button-onclick":"7105","oj-tsx-acc-avatar-aria-role":"7110","oj-tsx-databind-all":"7115","oj-tsx-wctag-maintenance":"7120","oj-tsx-slot-deprecated":"7125","oj-tsx-slot-deprecated_user":"7126","oj-tsx-ojattr-deprecated":"7130","oj-tsx-ojattr-deprecated_1":"7131","oj-tsx-ojattr-deprecated_2":"7132","oj-tsx-ojattr-deprecated_3":"7133","oj-tsx-jsx-prop":"7135","oj-tsx-jsx-prop_1":"7136","oj-tsx-form-bindif":"7140","oj-tsx-form-noflex":"7145","oj-tsx-rating-gauge-track-resize":"7150","oj-tsx-slot-pref-content":"7155","oj-tsx-slot-pref-content_1":"7156","oj-tsx-ojtag-ns":"7160","oj-tsx-ojtag-ns_1":"7161","oj-tsx-ojattr-enum-deprecated":"7165","oj-tsx-ojattr-enum-deprecated_user":"7166","oj-tsx-tabbar-edge":"7170","oj-tsx-tabbar-edge_1":"7171","oj-tsx-wctag-anti-pattern":"7175","oj-tsx-prop-anti-pattern":"7180","oj-tsx-prop-anti-pattern_1":"7181","oj-tsx-treeview-actionable-content":"7185","oj-tsx-popup-sibling":"7190","oj-tsx-event":"7195","oj-tsx-style-bp-margin-padding":"7200","oj-tsx-style-bp-margin-padding_1":"7201","oj-tsx-style-bp-margin-padding_2":"7202","oj-tsx-style-abs-units":"7210","oj-tsx-style-abs-units_1":"7211","oj-tsx-style-abs-units_2":"7212","oj-tsx-button-size-chroming":"7215","oj-tsx-button-size-chroming_1":"7216","oj-tsx-bp-button-xs-chroming":"7220","oj-tsx-acc-button-label":"7225","oj-tsx-bp-title-to-tooltip":"7230","oj-tsx-slot-default":"7235","oj-tsx-redwood-clear-icon":"8000","oj-cca-comp-json-file":"9000","oj-cca-comp-json-schema":"9005","oj-cca-comp-json-compdeps":"9010","oj-cca-comp-zip":"9015","oj-cca-comp-zip-type":"9020","oj-cca-comp-zip-content":"9025","oj-cca-comp-zip-content-case":"9030","oj-cca-compjson-bp-obj":"9040","oj-cca-compjson-bp-ar":"9043","oj-cca-compjson-ns-reg":"9046","oj-cca-compjson-ns-reg_1":"9047","oj-cca-compjson-bp-jetver":"9049","oj-cca-compjson-bp-dsplyname":"9052"}
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const hasAttrib=require("./helpers/has-attrib-value");const RULENAME="oj-acc-button-label";const DESCRIPTION="For button accessibility, the 'label' attribute should be applied to the following button components: "+"<oj-c-button>, <oj-c-menu-button> and <oj-c-split-menu-button>.";const SHORT_DESCRIPTION="Buttons should use the 'label' attribute to make them accessible.";const LABEL="label";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._metaLib=regCtx.utils.metaLib;return{"<oj-c-button>":this._onBtn,"<oj-c-menu-button>":this._onBtn,"<oj-c-split-menu-button>":this._onBtn,"<oj-c-toggle-button>":this._onBtn,"startaudit":this._onPreAudit}}_onBtn(ruleCtx,tag){if(!hasAttrib(ruleCtx,LABEL)){if(this._canEmit(ruleCtx,tag)){let issue=new ruleCtx.Issue(`<${tag}> should use the 'label' attribute to be accessible.`);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}_canEmit(ruleCtx,tag){var req,ret=true,i;if((req=this._metaLib.getRequiredAttrs(tag))&&req.length){for(i=0;i<req.length;i++){if(req[i]===LABEL){ret=!this._isAttrReqRule;break}}}return ret}_onPreAudit(ctx){this._isAttrReqRule=ctx.rulePack.isRuleEnabled("oj-html-attr-req")}}module.exports=Rule;
@@ -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-css-style-bp-display";const DESCRIPT="For best practices, CSS property 'display:none' should not be used. Use of JET <oj-bind-if> is recommended.";const DECLARATION="Declaration";function getName(){return RULE_NAME};function getShortDescription(){return DESCRIPT};function getDescription(){return DESCRIPT};function register(regCtx){return{"css-rule":_onRule}};function _onRule(ruleCtx,rule){var block,decl,i;if(!(rule.prelude&&rule.prelude.children&&rule.prelude.children.length)){return}block=rule.block.children;for(i=0;i<block.length;i++){decl=block[i];if(decl.type===DECLARATION){if(decl.property==="display"&&_propValue(decl)==="none"){if(!_isCssVar(decl)){_emitIssue(ruleCtx,decl)}}}}};function _emitIssue(ruleCtx,o){var issue;issue=new ruleCtx.Issue("CSS 'display:none' - for best practices, use <oj-bind-if>");issue.setPosition(ruleCtx.utils.CssUtils.getPosition(ruleCtx,o.loc));ruleCtx.reporter.addIssue(issue,ruleCtx)};function _propValue(decl){var val,ret;if(decl.value&&decl.value.type==="Value"){val=decl.value;if(val.children&&val.children.length){val=val.children[0];if(val.type==="Identifier"){ret=val.name}}}return ret};function _isCssVar(decl){var c,v;c=decl.value.children;v=c[0];return v.name==="var"};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-css-style-bp-display";const DESCRIPT="For best practices, CSS property 'display:none' should not be used. Use of JET <oj-if> is recommended.";const DECLARATION="Declaration";function getName(){return RULE_NAME};function getShortDescription(){return DESCRIPT};function getDescription(){return DESCRIPT};function register(){return{"css-rule":_onRule}};function _onRule(ruleCtx,rule){var block,decl,i;if(!(rule.prelude&&rule.prelude.children&&rule.prelude.children.length)){return}block=rule.block.children;for(i=0;i<block.length;i++){decl=block[i];if(decl.type===DECLARATION){if(decl.property==="display"&&_propValue(decl)==="none"){if(!_isCssVar(decl)){_emitIssue(ruleCtx,decl)}}}}};function _emitIssue(ruleCtx,o){var issue;issue=new ruleCtx.Issue("CSS 'display:none' - for best practices, use <oj-if>");issue.setPosition(ruleCtx.utils.CssUtils.getPosition(ruleCtx,o.loc));ruleCtx.reporter.addIssue(issue,ruleCtx)};function _propValue(decl){var val,ret;if(decl.value&&decl.value.type==="Value"){val=decl.value;if(val.children&&val.children.length){val=val.children[0];if(val.type==="Identifier"){ret=val.name}}}return ret};function _isCssVar(decl){var c,v;c=decl.value.children;v=c[0];return v.name==="var"};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-html-attr-expr-writeback";const SHORT="An attribute expression uses write-back syntax (\"{{...}}\" but the attribute metadata does not support write-back.";const LONG=SHORT+"\n"+"Note that although technically incorrect, functionally there is no harm incurred by using the wrong style of binding notation for a read-only property "+"except for a theoretical performance penalty (minimal).";class Rule{getName(){return RULENAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(regCtx){this._metaLib=regCtx.utils.metaLib;return{attrexpr:this._onExpr}}_onExpr(ruleCtx,attrib,attrValue){var tag=ruleCtx.tagNode.name;if(this._metaLib.isTagAttr(tag,attrib)){if(attrValue.startsWith("{")){if(!ruleCtx.utils.metaLib.isTagAttrWriteback(tag,attrib)){let issue=new ruleCtx.Issue(`<${tag}> attribute '${attrib}' uses a writeback expression, but attribute writeback is not enabled. Replace wih "[[ . . .]]"`);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}}module.exports=Rule;
6
+ const RULENAME="oj-html-attr-expr-writeback";const SHORT="An attribute expression uses write-back syntax (\"{{...}}\" but the attribute metadata does not support write-back.";const LONG=SHORT+"\n"+"Note that although technically incorrect, functionally there is no harm incurred by using the wrong style of binding notation for a read-only property "+"except for a theoretical performance penalty (minimal).";class Rule{getName(){return RULENAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(regCtx){this._metaLib=regCtx.utils.metaLib;return{attrexpr:this._onExpr}}_onExpr(ruleCtx,attrib,attrValue){var tag=ruleCtx.tagNode.name;if(this._metaLib.isTagAttr(tag,attrib)){if(attrValue.startsWith("{")){if(!ruleCtx.utils.metaLib.isTagAttrWriteback(tag,attrib)){let issue=new ruleCtx.Issue(`<${tag}> attribute '${attrib}' uses a writeback expression, but attribute writeback is not enabled. Replace with "[[ . . .]]"`);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}}}module.exports=Rule;
@@ -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-html-bindif-test";const SHORT_DESCRIPT="'test' attribute of an <oj-bind-if> must be a '[[...]]' expression";const LONG_DESCRIPT="The 'test' attribute of an <oj-bind-if> tag must be a '[[...]]' expression and not a literal.";const ATTRNAME="test";const PREFIX_ATTRNAME=":test";const PREFERRED="preferred";const EXPECTED="expected";const MSG="<oj-bind-if> 'test' attribute : read-only '[[...]]' expression ";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{"<oj-bind-if>":_onBindIf}};function _onBindIf(ruleCtx){var attribs,val,valType,attrName,attrPos,issue,what;if(ruleCtx.tagNode.attribs){attribs=ruleCtx.tagNode.attribs;val=attribs[ATTRNAME];valType=typeof val;if(valType!=="undefined"){attrName=ATTRNAME}else{val=attribs[PREFIX_ATTRNAME];valType=typeof val;if(valType!=="undefined"){attrName=PREFIX_ATTRNAME}}if(valType==="undefined"){issue=new ruleCtx.Issue("<oj-bind-if> 'test' attribute missing");ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(valType==="string"){if(val.startsWith("[[")||val==="true"||val==="false"){return}what=val.startsWith("{{")?PREFERRED:EXPECTED}issue=new ruleCtx.Issue(MSG+what);attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);if(what===PREFERRED){issue.setSeverity("minor")}ruleCtx.reporter.addIssue(issue,ruleCtx)}};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-bindif-test";const SHORT_DESCRIPT="'test' attribute of an <oj-bind-if> or <oj-if> must be a '[[...]]' expression";const LONG_DESCRIPT="The 'test' attribute of an <oj-bind-if> or <oj-if> component must be a '[[...]]' (read-only) expression and not a literal.";const TEST="test";const COLON_TEST=":test";const PREFERRED="preferred";const EXPECTED="expected";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCRIPT};function getDescription(){return LONG_DESCRIPT};function register(){return{"<oj-bind-if>":_onTag,"<oj-if>":_onTag}};function _onTag(ruleCtx,tagName){var attribs,val,valType,attrName,attrPos,issue,what;if(ruleCtx.tagNode.attribs){attribs=ruleCtx.tagNode.attribs;attrName=TEST;val=attribs[TEST];if((valType=typeof val)==="undefined"){attrName=COLON_TEST;val=attribs[attrName];valType=typeof val}if(valType==="undefined"){issue=new ruleCtx.Issue(`<${tagName} 'test' attribute missing`);ruleCtx.reporter.addIssue(issue,ruleCtx);return}if(valType==="string"){if(val.startsWith("[[")||val==="true"||val==="false"){return}what=val.startsWith("{{")?PREFERRED:EXPECTED;issue=new ruleCtx.Issue(`<${tagName}> 'test' attribute : read-only '[[...]]' expression ${what}.`);attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);if(what===PREFERRED){issue.setSeverity("minor")}ruleCtx.reporter.addIssue(issue,ruleCtx)}}};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-html-binding-as-slot-child";const DESCRIPTION="JET binding components such as <oj-bind-if> are not present in the final browser "+"DOM at runtime, and as such will not function correctly when directly assigned to "+"a slot. They should always be wrapped in another element such as a <div> or <span> "+"which has the slot attribute applied.<br>";const SHORT_DESCRIPTION="The slot attribute should not be applied directly to JET binding components";const SLOT="slot";const TEMPLATE="template";const OJ_BIND="oj-bind";const OJ_OPTION="oj-option";const BODY="body";const EXCEPTION_TAGS=["oj-accordion","oj-buttonset-many","oj-buttonset-one","oj-checkboxset","oj-combobox-many","oj-combobox-one","oj-film-strip","oj-form-layout","oj-list-item-layout","oj-masonry-layout","oj-menu","oj-menu-select-many","oj-optgroup","oj-radioset","oj-select-many","oj-select-single","oj-toolbar","oj-validation-group","template"];class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._metaLib=regCtx.utils.metaLib;return{bindingtag:this._onBind}}_onBind(ruleCtx){var attribs,attrib,node,parent,name;node=ruleCtx.tagNode;if(attribs=node.attribs){for(attrib in attribs){if(attrib===SLOT){this._emitIssue(1,ruleCtx,node.name);break}}}if(parent=this._getParentElem(node,ruleCtx)){name=parent.name;if(name===OJ_OPTION){if(parent?.parent?.name===TEMPLATE){return}}if(EXCEPTION_TAGS.includes(name)){return}if(this._metaLib.isWCTag(name)&&this._metaLib.hasTagDefaultSlot(name)){this._emitIssue(2,ruleCtx,node.name,name)}}}_getParentElem(node,ruleCtx){var parent,name;if(node&&(parent=node.parent)){if(name=parent.name){if(name.startsWith(OJ_BIND)||name===TEMPLATE||ruleCtx.utils.DomUtils.isSelfClosingTag(name)){return this._getParentElem(parent,ruleCtx)}if(name===BODY){return null}}return parent}return null}_emitIssue(msgType,ruleCtx,tagName,parentName){var issue;if(msgType===1){issue=new ruleCtx.Issue(`The slot attribute must not be applied directly on a <${tagName}> : wrap it in a <div> or <span> and apply the slot attribute to that.`)}else if(msgType===2){issue=new ruleCtx.Issue(`If <${tagName}> is used as the direct child of <${parentName}>, then <${parentName}> may not reflect updates to the bound value unless the <${tagName}> is enclosed in a DOM element such as <div> or <span>.`);issue.setMsgKey(RULENAME+"_1");issue.setSeverity("info")}ruleCtx.reporter.addIssue(issue,ruleCtx)}}module.exports=Rule;
6
+ const RULENAME="oj-html-binding-as-slot-child";const DESCRIPTION="JET binding components such as <oj-bind-if> are not present in the final browser "+"DOM at runtime, and as such will not function correctly when directly assigned to "+"a slot. They should either be relaced with <oj-if> which can be assigned to a slot, "+"or they should be wrapped in another element such as a <div> or <span> which has "+"the slot attribute applied.<br>";const SHORT_DESCRIPTION="The slot attribute should not be applied directly to JET binding components";const SLOT="slot";const TEMPLATE="template";const OJ_BIND="oj-bind";const OJ_BIND_IF="oj-bind-if";const OJ_IF="oj-if";const OJ_OPTION="oj-option";const BODY="body";const EXCEPTION_TAGS=["oj-accordion","oj-buttonset-many","oj-buttonset-one","oj-checkboxset","oj-combobox-many","oj-combobox-one","oj-film-strip","oj-form-layout","oj-list-item-layout","oj-masonry-layout","oj-menu","oj-menu-select-many","oj-optgroup","oj-radioset","oj-select-many","oj-select-single","oj-toolbar","oj-validation-group","template"];class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._metaLib=regCtx.utils.metaLib;return{bindingtag:this._onBind}}_onBind(ruleCtx,tag){var attribs,attrib,node,parent,name;node=ruleCtx.tagNode;if(attribs=node.attribs){for(attrib in attribs){if(attrib===SLOT){this._emitIssue(1,ruleCtx,tag);break}}}if(parent=this._getParentElem(node,ruleCtx)){name=parent.name;if(name===OJ_IF){return}if(name===OJ_OPTION){if(parent?.parent?.name===TEMPLATE){return}}if(EXCEPTION_TAGS.includes(name)){return}if(this._metaLib.isWCTag(name)&&this._metaLib.hasTagDefaultSlot(name)){this._emitIssue(2,ruleCtx,node.name,name)}}}_getParentElem(node,ruleCtx){var parent,name;if(node&&(parent=node.parent)){if(name=parent.name){if(name.startsWith(OJ_BIND)||name===TEMPLATE||ruleCtx.utils.DomUtils.isSelfClosingTag(name)){return this._getParentElem(parent,ruleCtx)}if(name===BODY){return null}}return parent}return null}_emitIssue(msgType,ruleCtx,tagName,parentName){var issue;if(msgType===1){let msg=`The slot attribute must not be applied directly on a <${tagName}> : `;msg+=tagName===OJ_BIND_IF?`either relace with <oj-if> which can be assigned to a slot, or wrap in a <div> or <span> and apply the slot attribute to that.`:`wrap it in a <div> or <span> and apply the slot attribute to that.`;issue=new ruleCtx.Issue(msg)}else if(msgType===2){issue=new ruleCtx.Issue(`If <${tagName}> is used as the direct child of <${parentName}>, then <${parentName}> may not reflect updates to the bound value unless the <${tagName}> is enclosed in a DOM element such as <div> or <span>.`);issue.setMsgKey(RULENAME+"_1");issue.setSeverity("info")}ruleCtx.reporter.addIssue(issue,ruleCtx)}}module.exports=Rule;
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULENAME="oj-html-bp-button-xs-chroming";const DESCRIPTION="For <oj-button> and <oj-c-button> property size=\"xs\" is only supported using "+"ghost chroming and icon display mode. For size=\"xs\":<br>"+"&nbsp; 1) chroming=\"ghost\" is required, and:<br>"+"&nbsp; 2) display=\"icons\" is required.<br>";const SHORT_DESCRIPTION="For <oj-button> and <oj-c-button> property size=\"xs\" is only supported using "+"ghost chroming and icon display mode.<br>";const CLASS="class";const XS="xs";const DISPLAY="display";const CHROMING="chroming";const GHOST="ghost";const ICONS="icons";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-c-button size=>":this._onBtn,"<oj-c-menu-button size=>":this._onBtn}}_onBtn(ruleCtx,attr,attrVal){if(attrVal===XS){let msgType=0;if(this._hasAttr(ruleCtx,CHROMING,GHOST)){if(this._hasAttr(ruleCtx,DISPLAY,ICONS)){return}msgType=2}else{msgType=1}if(msgType){this._emitIssue(ruleCtx,msgType)}}}_emitIssue(ruleCtx,msgType){var msg,tag;tag=ruleCtx.tagNode.name;if(msgType===1){msg=`<${tag} size="xs"> requires chroming="ghost".`}else if(msgType===2){msg=`<${tag} size="xs" chroming="ghost"> requires 'display="icons".`}if(msg){let issue=new ruleCtx.Issue(msg);let attrPos=ruleCtx.position;issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}_hasAttr(ruleCtx,attr,attrVal){var attribs,attrib,ret=false;if(attr&&(attribs=ruleCtx.tagNode.attribs)){if(attrib=attribs[attr]){if(arguments.length===2){return true}if(attr===CLASS){let clsName,i;let a=attrib.split(" ");for(i=0;i<a.length;i++){if(clsName=a[i]){if(clsName===attrVal){ret=true;break}}}}else if(attrib===attrVal){ret=true}}}return ret}}module.exports=Rule;
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULE_NAME="oj-html-bp-title-to-tooltip";const LONG_DESCR="The 'tooltip' attribute matches the Redwood specification, but 'title' does not. "+"Additionally, there are accessibility issues with 'title' that are solved using 'tooltip'.<br>"+"Action: replace attribute 'title' with 'tooltip'.";const SHORT_DESCR="Attribute 'title' does not match the Redwood specifications and should be replaced with 'tooltip'.";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCR};function getDescription(){return LONG_DESCR};function register(){return{"<oj-c-button title=>":_onTitle,"<oj-c-menu-button title=>":_onTitle,"<oj-c-split-menu-button title=>":_onTitle}};function _onTitle(ruleCtx){let msg=`For <${ruleCtx.tagNode.name}> the 'title' attribute should be replaced with 'tooltip'.`;let issue=new ruleCtx.Issue(msg);ruleCtx.reporter.addIssue(issue,ruleCtx)};module.exports={getName,getDescription,getShortDescription,register};
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const getParentNodeForSlot=require("./helpers/has-slot-name");const RULENAME="oj-html-button-size-chroming";const DESCRIPTION="The Redwood input designs require the use of small buttons. Please update the "+"button attributes in the 'start' or 'end' slot:<br>"+"&nbsp;1) For <oj-button>, use class=\"oj-button-sm\"<br>"+"&nbsp;2) For <oj-c-button>, set size=\"sm\" and chroming=\"ghost\"";const SHORT_DESCRIPTION="Redwood input design spec -small buttons required.";const OJ_INPUT_TEXT="oj-input-text";const OJ_C_INPUT_TEXT="oj-c-input-text";const OJ_BUTTON="oj-button";const OJ_C_BUTTON="oj-c-button";const CLASS="class";const START="start";const END="end";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-button slot=>":this._onBtn,"<oj-c-button slot=>":this._onBtn}}_onBtn(ruleCtx,attrName,slotName){if(slotName!==START&&slotName!==END){return}let tagName,parentName,node;if(!(node=getParentNodeForSlot(ruleCtx,slotName))){return}tagName=ruleCtx.tag;parentName=node.name;if(tagName!==OJ_BUTTON&&tagName!==OJ_C_BUTTON||parentName!==OJ_INPUT_TEXT&&parentName!==OJ_C_INPUT_TEXT){return}if(tagName===OJ_BUTTON){if(!this._hasAttr(ruleCtx,"class","oj-button-sm")){this._emitIssue(ruleCtx,true)}}else{if(!this._hasAttr(ruleCtx,"chroming","ghost")||!this._hasAttr(ruleCtx,"size","sm")){this._emitIssue(ruleCtx,false)}}}_emitIssue(ruleCtx,legacy){var msg=legacy?"<oj-button> in the 'start' or 'end' slot should use class=\"oj-button-sm\"":"<oj-c-button> in the 'start' or 'end' slot should use chroming=\"ghost\" and size=\"sm\"";var issue=new ruleCtx.Issue("Redwood input specs: "+msg);if(!legacy){issue.setMsgKey(RULENAME+"_1")}ruleCtx.reporter.addIssue(issue,ruleCtx)}_hasAttr(ruleCtx,attr,value){var attribs,attrib,ret=false;if(attribs=ruleCtx.tagNode.attribs){if(attrib=attribs[attr]){if(attr===CLASS){let clsName,i;let a=attrib.split(" ");for(i=0;i<a.length;i++){if(clsName=a[i]){if(clsName===value){ret=true;break}}}}else if(attrib===value){ret=true}}}return ret}}module.exports=Rule;
@@ -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-html-dlg-title";const SHORT_DESCR="Check that <oj-dialog> attribute is not specified";const LONG_DESCR="<oj-dialog> : 'title' attribute should not be used - use 'dialog-title' instead.";const MSG="<oj-dialog> attribute 'title' should be replaced with 'dialog-title'";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCR};function getDescription(){return LONG_DESCR};function register(){return{"<oj-dialog>":_onDlg}};function _onDlg(ruleCtx){let attribs,attrName;if(attribs=ruleCtx.tagNode.attribs){for(attrName in attribs){if(attrName==="title"||attrName===":title"){let issue=new ruleCtx.Issue(MSG);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-dlg-title";const SHORT_DESCR="<oj-dialog> 'title' attribute should be replaced with 'dialog-title'.";const LONG_DESCR="<oj-dialog> : 'title' attribute should be replaced with 'dialog-title'.";const MSG="<oj-dialog> attribute 'title' should be replaced with 'dialog-title'";function getName(){return RULE_NAME};function getShortDescription(){return SHORT_DESCR};function getDescription(){return LONG_DESCR};function register(){return{"<oj-dialog title=>":_onDlgTitle}};function _onDlgTitle(ruleCtx,attrName){let issue=new ruleCtx.Issue(MSG);let attrPos=ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attrName);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)};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-html-form-bindif";const DESCRIPTION="<oj-form-layout> is meant to have static content only. The use of <oj-bind-for-each> or <oj-bind-if> is not supported.<p>"+"The problem with using oj-bind-if (and oj-for-each) inside a form layout, is that the layout will not be refreshed if "+"its child DOM changes after instantiation (unless the refresh() method on the layout is called). This can result in the "+"layout not managing multiple columns correctly and is therefore not supported.<p>"+"If the <oj-bind-if> evaluation is fully resolved and will not change before the form is rendered, there will be no problem. "+"Similarly, if the form has only one column of fields, there is unlikely to be any visible issue. "+"If there is the possibility that the expression used to control the bind-if is going to change, then the solution is to put "+"the <oj-form-layout> inside the <oj-bind-if> (i.e. split the form layout into multiple layouts and control each as a unit).";const SHORT_DESCRIPTION="The use of <oj-bind-for-each> or <oj-bind-if> inside <oj-form-layout> is not supported";const OJ_BIND_IF="oj-bind-if";const OJ_BIND_FOR_EACH="oj-bind-for-each";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-form-layout>":this._onForm}}_onForm(ruleCtx){let node=ruleCtx.tagNode;let attribs=node.attribs;if(this._attrVal(attribs,"direction")!=="column"){let maxcol=this._attrVal(attribs,"max-columns");if(isNaN(maxcol)||maxcol>1){this._walkDomChildren(ruleCtx,node)}}}_emit(ruleCtx,node){let issue=new ruleCtx.Issue(`<oj-form-layout> is meant to have static content only. The use of <${node.name}> is not supported`);issue.setPosition(null,null,node.startIndex+1,node.startIndex+node.name.length);ruleCtx.reporter.addIssue(issue,ruleCtx)}_walkDomChildren(ruleCtx,node){var ch,n,i,ok=true;;ch=node.children;if(ch){for(i=0;i<ch.length;i++){n=ch[i];if(n.type==="tag"){if(n.name===OJ_BIND_FOR_EACH){ok=false;this._emit(ruleCtx,n)}else if(n.name===OJ_BIND_IF){if(n.children&&n.children.length>1){ok=false;this._emit(ruleCtx,n)}}}}}return ok}_attrVal(attribs,attr){var v=attribs[attr];switch(attr){case"max-columns":v=parseInt(v);break}return v}}module.exports=Rule;
6
+ const RULENAME="oj-html-form-bindif";const DESCRIPTION="<oj-form-layout> is meant to have static content only. The use of a 'bind' tag - <oj-bind-for-each>, <oj-bind-if>,"+"or <oj-if> - is not supported.<p>"+"The problem with using a 'bind' tag inside a form layout, is that the layout will not be refreshed if "+"its child DOM changes after instantiation (unless the refresh() method on the layout is called). This can result in the "+"layout not managing multiple columns correctly and is therefore not supported.<p>"+"If the 'bind' tag evaluation is fully resolved and will not change before the form is rendered, there will be no problem. "+"Similarly, if the form has only one column of fields, there is unlikely to be any visible issue. "+"If there is the possibility that the expression used to control the bind-if is going to change, then the solution is to put "+"the <oj-form-layout> inside the 'bind' tag' (i.e. split the form layout into multiple layouts and control each as a unit).";const SHORT_DESCRIPTION="The use of <oj-bind-for-each>, <oj-bind-if>, or <oj-if> inside <oj-form-layout> is not supported";const OJ_IF="oj-if";const OJ_BIND_IF="oj-bind-if";const OJ_BIND_FOR_EACH="oj-bind-for-each";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-form-layout>":this._onForm}}_onForm(ruleCtx){let node=ruleCtx.tagNode;let attribs=node.attribs;if(this._attrVal(attribs,"direction")!=="column"){let maxcol=this._attrVal(attribs,"max-columns");if(isNaN(maxcol)||maxcol>1){this._walkDomChildren(ruleCtx,node)}}}_emit(ruleCtx,node){let issue=new ruleCtx.Issue(`<oj-form-layout> is meant to have static content only. The use of <${node.name}> is not supported`);issue.setPosition(null,null,node.startIndex+1,node.startIndex+node.name.length);ruleCtx.reporter.addIssue(issue,ruleCtx)}_walkDomChildren(ruleCtx,node){var ch,n,i,ok=true;;ch=node.children;if(ch){for(i=0;i<ch.length;i++){n=ch[i];if(n.type==="tag"){let name=n.name;if(name===OJ_BIND_FOR_EACH){ok=false;this._emit(ruleCtx,n)}else if(name===OJ_BIND_IF||name===OJ_IF){if(n.children&&n.children.length>1){ok=false;this._emit(ruleCtx,n)}}}}}return ok}_attrVal(attribs,attr){var v=attribs[attr];return attr==="max-columns"?parseInt(v):v}}module.exports=Rule;
@@ -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-html-ko-comment";function getName(){return RULE_NAME};function getShortDescription(){return"Jet binding elements should be used in place of Knockout comment bindings"};function getDescription(){return"JET binding elements should be used in place of Knockout comment bindings wherever possible"};function register(){return{"comment":_handleComment}};function _handleComment(ruleCtx,comment){var issue,binding,i,suggest;if(comment.length===0){return}if(comment.toLowerCase().startsWith("ko ")){i=_eatWhite(comment,3);if(i>=0){comment=comment.substring(i);i=comment.indexOf(":");binding=i>0?comment.substring(0,i).trim():"";suggest=_getSuggested(binding);issue=new ruleCtx.Issue("Knockout comment binding \""+binding+":\" found"+(suggest?". Use of JET "+suggest+" recommended.":""));ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _getSuggested(binding){var suggest;binding=binding.toLowerCase();if(binding==="foreach"){suggest="<oj-bind-for-each>"}else if(binding==="if"||binding==="ifnot"){suggest="<oj-bind-if>"}else if(binding==="text"){suggest="<oj-bind-text>"}return suggest};function _eatWhite(str,startIndex){var i,len,ret=-1;startIndex=startIndex?startIndex:0;len=str?str.length:0;for(i=startIndex;i<len;i++){if(!_isWhite(str.charAt(i))){ret=i;break}}return ret};function _isWhite(c){return" \t\n\r\x0B".indexOf(c)>=0};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-ko-comment";const SHORT="JET elements should be used in place of Knockout comment bindings wherever possible.";const DESCRIPT="Use of user-developed custom Knockout bindings increases the direct dependency on Knockout "+"itself and raises the exposure to any future Knockout migration issues or bugs.";const BINDINGS=["foreach","if","ifnot","text","with","component"];const SUGGESTED=["oj-bind-for-each","oj-if","oj-if","oj-bind-text",null,null];var _overrides;function getName(){return RULE_NAME};function getShortDescription(){return SHORT};function getDescription(){return DESCRIPT};function register(regCtx){let opt=regCtx.rulePack.getRuleCustomOption("ignore");if(opt){if(!Array.isArray(opt)){regCtx.utils.msgLib.error(`Rule ${RULE_NAME} : rule override option 'ignore' is not an array`);return false}_overrides=[];opt.forEach(val=>{_overrides.push(val.toLowerCase())})}return{"comment":_onComment}};function _onComment(ruleCtx,comment){if(comment.length===0||!comment.toLowerCase().startsWith("ko ")){return}let i=_eatWhite(comment,3);if(i<0){return}let issue,binding,suggest;comment=comment.substring(i);i=comment.indexOf(":");if(!(binding=i>0?comment.substring(0,i).trim():""))return;if(_overrides&&_overrides.indexOf(binding.toLowerCase())>=0){return}let suggestKey;if((suggestKey=_isKnownBinding(binding))>=0){suggest=_getSuggestedJetBinding(suggestKey);issue=new ruleCtx.Issue(`Knockout comment binding "${binding}:" found`+(suggest?`. Use of JET ${suggest} recommended.`:""))}else{issue=new ruleCtx.Issue(`Custom Knockout binding '${binding}' adds a direct dependency on KO itself and raises exposure to future KO migration issues/bugs.`);issue.setMsgKey(RULE_NAME+"_1");issue.setSeverity("minor")}if(issue){ruleCtx.reporter.addIssue(issue,ruleCtx)}};function _isKnownBinding(binding){return BINDINGS.indexOf(binding.toLowerCase())};function _getSuggestedJetBinding(index){var s;if(index>=0&&(s=SUGGESTED[index])){s=`<${s}>`}return s};function _eatWhite(str,startIndex){var i,len,ret=-1;startIndex=startIndex?startIndex:0;len=str?str.length:0;for(i=startIndex;i<len;i++){if(!_isWhite(str.charAt(i))){ret=i;break}}return ret};function _isWhite(c){return" \t\n\r\x0B".indexOf(c)>=0};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 RULE_NAME="oj-html-ko-databind";function getName(){return RULE_NAME};function getShortDescription(){return"Jet binding elements should be used in place of Knockout 'data-bind' bindings"};function getDescription(){return"JET binding elements should be used in place of Knockout 'data-bind' bindings wherever possible."};function register(){return{"<data-bind=>":_onDataBind}};function _onDataBind(ruleCtx,attrName,attrValue){var aBindings,binding,i,x,suggest;attrValue=attrValue.trim();if(attrValue.length===0){return}attrValue=attrValue.toLowerCase();aBindings=attrValue.split(",");for(i=0;i<aBindings.length;i++){binding=aBindings[i].trim();x=binding.indexOf(":");if(x<0){continue}binding=binding.substring(0,x).trim();suggest=_getSuggested(binding);if(suggest){let issue=new ruleCtx.Issue("Knockout data-bind \""+binding+":\" binding found. Use of JET "+suggest+" recommended.");ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _getSuggested(binding){var suggest;if(binding==="foreach"){suggest="<oj-bind-for-each>"}else if(binding==="if"||binding==="ifnot"){suggest="<oj-bind-if>"}else if(binding==="text"){suggest="<oj-bind-text>"}else if(binding==="css"){suggest=":class binding"}return suggest};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-ko-databind";const SHORT="Jet elements should be used in place of Knockout 'data-bind' bindings";const DESCRIPTION="JET elements should be used in place of Knockout 'data-bind' bindings wherever possible.";function getName(){return RULE_NAME};function getShortDescription(){return SHORT};function getDescription(){return DESCRIPTION};function register(){return{"<data-bind=>":_onDataBind}};function _onDataBind(ruleCtx,attrName,attrValue){var aBindings,binding,i,x,suggest;attrValue=attrValue.trim();if(attrValue.length===0){return}attrValue=attrValue.toLowerCase();aBindings=attrValue.split(",");for(i=0;i<aBindings.length;i++){binding=aBindings[i].trim();x=binding.indexOf(":");if(x<0){continue}binding=binding.substring(0,x).trim();suggest=_getSuggested(binding);if(suggest){let issue=new ruleCtx.Issue("Knockout data-bind \""+binding+":\" binding found. Use of JET "+suggest+" recommended.");ruleCtx.reporter.addIssue(issue,ruleCtx)}}};function _getSuggested(binding){var suggest;if(binding==="foreach"){suggest="<oj-bind-for-each>"}else if(binding==="if"||binding==="ifnot"){suggest="<oj-if>"}else if(binding==="text"){suggest="<oj-bind-text>"}else if(binding==="css"){suggest=":class binding"}return suggest};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 RULE_NAME="oj-html-ojattr-value";const DATABIND="data-bind";function getName(){return RULE_NAME};function getShortDescription(){return"Custom component attribute value must be a defined value"};function getDescription(){return"Custom component attribute value must be a defined value for the component"};function register(){return{"webcomp":_onWComp}};function _onWComp(ruleCtx,tag,attr){var attrs,attr,val;if(ruleCtx.tagNode.attribs){attrs=ruleCtx.tagNode.attribs;for(attr in attrs){val=attrs[attr];if(val.startsWith("{{")||val.startsWith("[[")){continue}_checkAttr(ruleCtx,tag,attr,val)}}};function _checkAttr(ruleCtx,tag,attr,val){var issue,metaLib,DomUtils,aVals,aVal,jsonChar,i;metaLib=ruleCtx.utils.metaLib;DomUtils=ruleCtx.utils.DomUtils;if(DomUtils.isCommonAttr(attr)||DomUtils.isCommonEventAttr(attr)||attr===DATABIND){return}if(!metaLib.isTagAttr(tag,attr)){return}jsonChar=val.charAt(0);try{if(jsonChar==="{"){return}else if(val.charAt(0)==="["){aVals=JSON.parse(val)}else{aVals=[val]}}catch(e){}if(!aVals){return true}if(!metaLib.hasTagAttrValues(tag,attr)){return}for(i=0;i<aVals.length;i++){aVal=aVals[i];if(!metaLib.isTagAttrValue(tag,attr,aVal)){if(!_checkSpecialCases(ruleCtx,tag,attr,aVal)){let attrPos;issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' refers to undefined value '${aVal}'`);attrPos=DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _checkSpecialCases(ruleCtx,tag,attr,attrValue){if(tag==="oj-led-gauge"&&attr==="type"){return ruleCtx.utils.DomUtils.isSvgPath(attrValue)}return false};module.exports={getName,getDescription,getShortDescription,register};
6
+ const RULE_NAME="oj-html-ojattr-value";const DATABIND="data-bind";function getName(){return RULE_NAME};function getShortDescription(){return"Custom component attribute value must be a defined value"};function getDescription(){return"Custom component attribute value must be a defined value for the component"};function register(){return{"webcomp":_onWComp}};function _onWComp(ruleCtx,tag){var attrs,attr,val;if(ruleCtx.tagNode.attribs){attrs=ruleCtx.tagNode.attribs;for(attr in attrs){val=attrs[attr];if(val.startsWith("{{")||val.startsWith("[[")){continue}_checkAttr(ruleCtx,tag,attr,val)}}};function _checkAttr(ruleCtx,tag,attr,val){var issue,metaLib,DomUtils,aVals,aVal,jsonChar,i;metaLib=ruleCtx.utils.metaLib;DomUtils=ruleCtx.utils.DomUtils;if(DomUtils.isCommonAttr(attr)||DomUtils.isCommonEventAttr(attr)||attr===DATABIND){return}if(!metaLib.isTagAttr(tag,attr)){return}jsonChar=val.charAt(0);try{if(jsonChar==="{"){return}else if(val.charAt(0)==="["){aVals=JSON.parse(val)}else{aVals=[val]}}catch(e){}if(!aVals){return true}if(!metaLib.hasTagAttrValues(tag,attr)){return}for(i=0;i<aVals.length;i++){aVal=aVals[i];if(!metaLib.isTagAttrValue(tag,attr,aVal)){if(!_checkSpecialCases(ruleCtx,tag,attr,aVal)){let attrPos;issue=new ruleCtx.Issue(`<${tag}> attribute '${attr}' refers to undefined value '${aVal}'`);attrPos=DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,attr);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}};function _checkSpecialCases(ruleCtx,tag,attr,attrValue){if(tag==="oj-led-gauge"&&attr==="type"){return ruleCtx.utils.DomUtils.isSvgPath(attrValue)}return false};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-html-ojtag-ns";const LONG="Web component namespaces starting with prefixes 'oj-' or 'ns-' must be registered. A component must not use an un-registered namespace.";const SHORT="Web component namespaces starting with prefixes 'oj-' or 'ns-' must be registered.";class Rule{getName(){return RULENAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(){return{notglob:this._onNotGlob}}_onNotGlob(ruleCtx,tagName){var tagName,a,prefix,msg,i;if(!tagName.includes("-")||tagName.startsWith("demo-")||tagName.startsWith("my-")||tagName==="oj-slot"||ruleCtx.ojNS){return}if(tagName.startsWith("oj-")||tagName.startsWith("ns-")){if(!ruleCtx.utils.metaLib.isNamespaceTag(tagName)){if(!ruleCtx.utils.metaLib.isJetTag(tagName)){msg=`<${tagName}> : unregistered use of '${tagName.substring(0,2)}' namespace`;this._emitIssue(ruleCtx,msg)}}}else{if(this._nameSpaces){a=tagName.split("-");prefix=a[0]+"-"+a[1];for(i=0;i<this._nameSpaces.length;i++){if(this._nameSpaces[i].startsWith(prefix)){return}}}msg=`'${tagName}' : use of unknown web component namespace`;this._emitIssue(ruleCtx,msg,1)}}_emitIssue(ruleCtx,msg,id){var issue;issue=new ruleCtx.Issue(msg);if(id){issue.setMsgKey(RULENAME+"_"+id)}ruleCtx.reporter.addIssue(issue,ruleCtx)}}module.exports=Rule;
6
+ const RULENAME="oj-html-ojtag-ns";const LONG="Web component namespaces prefixed by 'oj-' or 'ns-' must be registered via the Namespace Manager - "+"un-registered namespaces should not be used.\n"+"If a user/external component is flagged, the component is not known to JAF. Review the confguration properties 'components' and 'nameSpaces'.";const SHORT="Web component namespaces starting with prefixes 'oj-' or 'ns-' must be registered.";class Rule{getName(){return RULENAME}getDescription(){return LONG}getShortDescription(){return SHORT}register(regCtx){if(this._nameSpaces=regCtx.config.nameSpaces){if(!this._nameSpaces.length){this._nameSpaces=null}}return{notglob:this._onNotGlob}}_onNotGlob(ruleCtx,tagName){if(!tagName.includes("-")||tagName.startsWith("demo-")||tagName.startsWith("my-")||tagName==="oj-slot"||ruleCtx.ojNS){return}ruleCtx.utils.metaLib.isNamespaceTag(tagName);if(tagName.startsWith("oj-")||tagName.startsWith("ns-")){if(!ruleCtx.utils.metaLib.isNamespaceTag(tagName)){if(!ruleCtx.utils.metaLib.isJetTag(tagName)){this._emitIssue(ruleCtx,`<${tagName}> : unregistered use of '${tagName.substring(0,2)}' web component namespace`)}}return}if(this._nameSpaces){let i;for(i=0;i<this._nameSpaces.length;i++){if(tagName.startsWith(this._nameSpaces[i])){return}}}if(!ruleCtx.utils.metaLib.isComponentTag(tagName)){this._emitIssue(ruleCtx,`'${tagName}' : unknown web component namespace`,1)}}_emitIssue(ruleCtx,msg,id){var issue=new ruleCtx.Issue(msg);if(id){issue.setMsgKey(RULENAME+"_"+id)}ruleCtx.reporter.addIssue(issue,ruleCtx)}}module.exports=Rule;
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) 2018, 2024, Oracle and/or its affiliates.
3
+ * Licensed under The Universal Permissive License (UPL), Version 1.0
4
+ * as shown at https://oss.oracle.com/licenses/upl/
5
+ */
6
+ const RULENAME="oj-html-redwood-clear-icon";const DESCRIPTION="For JET components <oj-input-text>, <oj-c-input-text>, <oj-c-input-password>, "+"and <oj-c-input-sensitive>, the 'clear-icon' attribute value 'always' is not permitted using the "+"'redwood-strict' profile'. "+"According to The UX Figma spec \"Only Typing, Focus, and Selection states can show the Clear button. Other "+"states don't show the Clear button since there is no active value to clear/delete.\" The value 'always' would "+"keep the icon showing at all times, while 'conditional' behaves in the manner above.";const SHORT_DESCRIPTION=DESCRIPTION;const ALWAYS="always";const REDWOOD_STRICT="redwood-strict";class Rule{constructor(){this._first=true}getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-input-text clear-icon=>":this._onAttr,"<oj-c-input-text> clear-icon=>":this._onAttr,"<oj-c-input-password clear-icon=>":this._onAttr,"<oj-c-input-sensitive clear-icon=>":this._onAttr}}_onAttr(ruleCtx,attrName,attrValue){if(this._first){this._first=false;if(ruleCtx.utils.configLib.getExtendsProfileName()!==REDWOOD_STRICT){ruleCtx.utils.msgLib.info(`Rule ${RULENAME} has disabled itself - not redwood-strict profile.`);ruleCtx.rulePack.disableRule(RULENAME);return}}if(attrValue===ALWAYS){let issue=new ruleCtx.Issue(`<${ruleCtx.tag}> : profile 'redwood-strict' does not allow 'clear-icon' to be set to 'always'.`);ruleCtx.reporter.addIssue(issue,ruleCtx)}}}module.exports=Rule;
@@ -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-html-slot-default";const DESCRIPT="A child component is defined in a component parent's default slot, but the parent does not support default slots.";const SHORT=DESCRIPT;const SLOT="slot";const COLON_SLOT=":slot";const DEFAULT_SLOT="";function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(regCtx){this._metaLib=regCtx.utils.metaLib;this._utils=regCtx.utils.utils;return{"webcomp":this._onWebComp}};Rule.prototype._onWebComp=function(ruleCtx,tagName){if(tagName==="template"||tagName==="oj-defer"||tagName.startsWith("oj-bind-")||tagName==="oj-refresher"){return}if(!ruleCtx.utils.metaLib.hasTagDefaultSlot(tagName)){this._checkChildren(ruleCtx)}};Rule.prototype._checkChildren=function(ruleCtx){var childs,child,node;if((childs=ruleCtx.tagNode.children)&&childs.length){for(child of childs){node=null;if(child.type==="tag"){if(!this._hasChildSlotAttrib(child)){if(child.name.startsWith("oj-bind-")||child.name==="template"||child.name==="oj-defer"){node=this._getFirstActiveChild(child)}else{node=child};if(node){if(this._metaLib.isWCTag(node.name)){this._emitIssue(ruleCtx,node)}}}}}}};Rule.prototype._emitIssue=function(ruleCtx,child){let issue=new ruleCtx.Issue(`<${ruleCtx.tag}> does not define a default slot but it contains a child <${child.name}>`);issue.setPosition(null,null,child.startIndex,child.endIndex);ruleCtx.reporter.addIssue(issue,ruleCtx)};Rule.prototype._getFirstActiveChild=function(node){if(node.children&&node.children.length){let child;for(child of node.children){if(child.type==="tag"){if(this._hasChildSlotAttrib(child)){break}if(child.name.startsWith("oj-bind-")||child.name==="template"||child.name==="oj-defer"){return this._getFirstActiveChild(child)}return child}}}return null};Rule.prototype._hasChildSlotAttrib=function(child){var ret=false;var attribs=child.attribs;if(this._utils.hasAnyProps(attribs)){let slotx=attribs[SLOT]||attribs[COLON_SLOT];if(slotx&&slotx!==DEFAULT_SLOT){ret=true}}return ret};module.exports=Rule;
6
+ const RULE_NAME="oj-html-slot-default";const DESCRIPT="A child component is defined in a component parent's default slot, but the parent does not support default slots.";const SHORT=DESCRIPT;const SLOT="slot";const COLON_SLOT=":slot";const DEFAULT_SLOT="";const TEMPLATE="template";const OJ_DEFER="oj-defer";const OJ_BIND_DASH="oj-bind-";const OJ_IF="oj-if";const OJ_REFRESHER="oj-refresher";const OJ_SWITCHER="oj-switcher";const _isExempt=tag=>{return tag===TEMPLATE||tag===OJ_DEFER||tag.startsWith(OJ_BIND_DASH)||tag===OJ_REFRESHER||tag===OJ_IF||tag===OJ_SWITCHER};function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(regCtx){this._metaLib=regCtx.utils.metaLib;this._utils=regCtx.utils.utils;return{"webcomp":this._onWebComp}};Rule.prototype._onWebComp=function(ruleCtx,tagName){if(_isExempt(tagName)){return}if(!ruleCtx.utils.metaLib.hasTagDefaultSlot(tagName)){this._checkChildren(ruleCtx)}};Rule.prototype._checkChildren=function(ruleCtx){var childs,child,node;if((childs=ruleCtx.tagNode.children)&&childs.length){for(child of childs){node=null;if(child.type!=="tag"){continue}if(!this._hasChildSlotAttrib(child)){if(child.name.startsWith(OJ_BIND_DASH)||child.name===TEMPLATE||child.name===OJ_DEFER){node=this._getFirstActiveChild(child)}else{node=child};if(node){if(this._metaLib.isWCTag(node.name)){this._emitIssue(ruleCtx,node)}}}}}};Rule.prototype._emitIssue=function(ruleCtx,child){let issue=new ruleCtx.Issue(`<${ruleCtx.tag}> does not define a default slot but it contains a child <${child.name}>`);issue.setPosition(null,null,child.startIndex,child.endIndex);ruleCtx.reporter.addIssue(issue,ruleCtx)};Rule.prototype._getFirstActiveChild=function(node){if(node.children&&node.children.length){let child;for(child of node.children){if(child.type==="tag"){if(this._hasChildSlotAttrib(child)){break}if(child.name.startsWith(OJ_BIND_DASH)||child.name===TEMPLATE||child.name===OJ_DEFER){return this._getFirstActiveChild(child)}return child}}}return null};Rule.prototype._hasChildSlotAttrib=function(child){var ret=false;var attribs=child.attribs;if(this._utils.hasAnyProps(attribs)){let slotx=attribs[SLOT]||attribs[COLON_SLOT];if(slotx&&slotx!==DEFAULT_SLOT){ret=true}}return ret};module.exports=Rule;
@@ -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 getParentNodeForSlot=require("./helpers/has-slot-name");const RULE_NAME="oj-html-slot-pref-content";const DESCRIPT="When component metadata defines 'preferredContent' for a slot, child elements placed into that slot should "+"implement one or more of the requested interfaces and document that through their 'implements' metadata. "+"This rule applies to components that are directly allocated to a slot, or which are direct children "+"of a template allocated to that slot.";const SHORT=DESCRIPT;const IGNORE_TAG=["oj-defer","html","head","body","script"];const TEMPLATE="template";const OJ_SWITCHER="oj-switcher";const OJ_DEFER="oj-defer";const OJ_BIND="oj-bind";const OJ_TOOLBAR="oj-toolbar";const OJ_LABEL="oj-label";const OJ_BIND_SLOT="oj-bind-slot";const DIV="div";const SPAN="span";const TAG="tag";const SLOT="slot";const _isBindTag=tagName=>{return tagName.startsWith("oj-bind")};const _ignoreTag=tagName=>{return IGNORE_TAG.includes(tagName)||tagName.startsWith("oj-bind")};function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(regCtx){this._metaLib=regCtx.utils.metaLib;this._hasJetWCInterfaces=this._metaLib.hasJetWCInterfaces();this._utils=regCtx.utils.utils;this._domUtils=regCtx.utils.DomUtils;return{"webcomp":this._onWebComp,"elem":this._onElem}};Rule.prototype._onElem=function(ruleCtx,elemName){if(ruleCtx.utils.DomUtils.isCommonElem(elemName)||elemName===TEMPLATE){if(!_ignoreTag(elemName)){return this._onWebComp(ruleCtx,elemName)}}};Rule.prototype._onWebComp=function(ruleCtx,tagName){var attribs=ruleCtx.tagNode.attribs;var slotx,slotName="";this._slotDefined=false;if(this._utils.hasAnyProps(attribs)){slotx=attribs[SLOT];if(slotx||slotx===""){slotName=slotx;this._slotDefined=true}}this._onSlot(ruleCtx,SLOT,slotName)};Rule.prototype._onSlot=function(ruleCtx,slotAttr,slotName){var pnode,slotTag,psc;if(slotName&&ruleCtx.tagNode.name===OJ_BIND_SLOT){return}if(!(pnode=getParentNodeForSlot(ruleCtx,slotName))){return}if(pnode.name===OJ_SWITCHER||!this._metaLib.isWCTag(pnode.name)){return}if(this._metaLib.isJetTag(pnode.name)&&!this._hasJetWCInterfaces){return}psc=this._metaLib.getPreferredSlotContentEx(pnode.name,slotName);if(!(psc&&psc.interfaces)){return}slotTag=ruleCtx.tag;if(slotTag==="oj-vb-fragment"||slotTag==="oj-module"){return}if(slotTag.startsWith(OJ_BIND)||slotTag===OJ_DEFER||slotTag===TEMPLATE||slotTag===DIV){let child;if(!(child=_getFirstChildTag(ruleCtx.tagNode.children))||!this._isSlotInterfaceSupported(child,psc)){if(child?.name!==SPAN){if(child&&this._hasChildNamedSlotAttrib(child)){return}this._emitIssue(ruleCtx,ruleCtx.tagNode,slotName,pnode.name,psc,2)}}return}if(ruleCtx.utils.DomUtils.isCommonElem(slotTag)){if(pnode.name!==OJ_TOOLBAR&&ruleCtx.tagNode.name!==SPAN){this._emitIssue(ruleCtx,ruleCtx.tagNode,slotName,pnode.name,psc,3)}return}if(this._metaLib.isWCTag(slotTag)){if(!_isBindTag(slotTag)&&slotTag!==OJ_DEFER&&slotTag!==TEMPLATE){if(!this._isSlotInterfaceSupported(ruleCtx.tagNode,psc)){this._emitIssue(ruleCtx,ruleCtx.tagNode,slotName,pnode.name,psc,1)}}}};Rule.prototype._isSlotInterfaceSupported=function(node,psc){var ret,aIfc;if(aIfc=this._metaLib.getInterfaces(node.name)){for(let ifc of aIfc){if(psc.interfaces.includes(ifc)){ret=true;break}}}return ret};Rule.prototype._emitIssue=function(ruleCtx,elemNode,slotName,slotOwner,psci,issueType){var ifc=_list(psci.interfaces,"or");var comp=psci.components?` (e.g. ${_list(psci.components,"or",true)})`:"";var multi=psci.interfaces.length>1;var actualSlot=slotName;var slotName=slotName?`slot '${slotName}'`:"default slot";var isDefSlot=!slotName;var issue,msg;if(issueType===1){msg=`<${elemNode.name}> is in${isDefSlot?" the":""} ${slotName} of <${slotOwner}> but does not implement interface${multi?"s":""} ${ifc}${comp}`}else if(issueType===2){msg=`<${elemNode.name}> is in${isDefSlot?" the":""} ${slotName} of <${slotOwner}> but its first child does not implement interface${multi?"s":""} ${ifc}${comp}`}else if(issueType===3){msg=`${slotName} on <${elemNode.name}> for <${slotOwner}> cannot provide ${multi?"interfaces":"an interface"} of type ${ifc}${comp}`}else{return}issue=new ruleCtx.Issue(msg);if(this._slotDefined){let attrPos=ruleCtx.utils.DomUtils.getAttrValuePosition(ruleCtx.data,ruleCtx.tagNode,SLOT);ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,SLOT);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end)}issue.setMsgEx({slotName:actualSlot,slotElem:elemNode.name,slotOwner:slotOwner});ruleCtx.reporter.addIssue(issue,ruleCtx)};Rule.prototype._hasChildNamedSlotAttrib=function(node){var attribs,attrib,ret=false;if(node&&(attribs=node.attribs)){for(attrib in attribs){if(attrib==="slot"){ret=true;break}}}return ret};function _getFirstChildTag(childs){var ret,childs,child;if(childs){for(let i=0;i<childs.length;i++){child=childs[i];if(child.type!==TAG){continue}if(child.name.startsWith("oj-bind-")||child.name===OJ_DEFER||child.name===TEMPLATE){return _getFirstChildTag(child.children)}ret=child;break}}return ret};function _list(a,orand,isComp){var s="";for(let i=0;i<a.length;i++){if(i){if(i===a.length-1){s+=(isComp?">":"'")+" "+orand+" "}else{s+=(isComp?">":"'")+", "}}s+=(isComp?"<":"'")+a[i]}return s?s+=isComp?">":"'":s};module.exports=Rule;
6
+ const getParentNodeForSlot=require("./helpers/has-slot-name");const RULE_NAME="oj-html-slot-pref-content";const DESCRIPT="When component metadata defines 'preferredContent' for a slot, child elements placed into that slot should "+"implement one or more of the requested interfaces and document that through their 'implements' metadata. "+"This rule applies to components that are directly allocated to a slot, or which are direct children "+"of a template allocated to that slot.";const SHORT=DESCRIPT;const IGNORE_TAG=["oj-defer","html","head","body","script"];const FLATTENABLE_TAGS=["div","oj-bind-if","oj-bind-for-each","oj-defer","template","oj-refresher","oj-validation-group","span","p"];const TEMPLATE="template";const OJ_SWITCHER="oj-switcher";const OJ_IF="oj-if";const OJ_DEFER="oj-defer";const OJ_BIND="oj-bind";const OJ_TOOLBAR="oj-toolbar";const OJ_BIND_SLOT="oj-bind-slot";const OJ_MODULE="oj-module";const OJ_VB_FRAGMENT="oj-vb-fragment";const DIV="div";const SPAN="span";const TAG="tag";const SLOT="slot";const _isBindTag=tagName=>{return tagName.startsWith("oj-bind")};const _ignoreTag=tagName=>{return IGNORE_TAG.includes(tagName)||tagName.startsWith("oj-bind")};const _isExempt=tagName=>{return tagName===OJ_VB_FRAGMENT||tagName===OJ_MODULE};function Rule(){};Rule.prototype.getName=function(){return RULE_NAME};Rule.prototype.getShortDescription=function(){return SHORT};Rule.prototype.getDescription=function(){return DESCRIPT};Rule.prototype.register=function(regCtx){this._metaLib=regCtx.utils.metaLib;this._hasJetWCInterfaces=this._metaLib.hasJetWCInterfaces();this._utils=regCtx.utils.utils;this._domUtils=regCtx.utils.DomUtils;return{"webcomp":this._onTag,"elem":this._onElem}};Rule.prototype._onElem=function(ruleCtx,elemName){if(ruleCtx.utils.DomUtils.isCommonElem(elemName)||elemName===TEMPLATE){if(!_ignoreTag(elemName)){return this._onTag(ruleCtx,elemName)}}};Rule.prototype._onTag=function(ruleCtx,tagName){var attribs=ruleCtx.tagNode.attribs;var slotx,slotName="";this._slotDefined=false;if(slotx=this._hasSlot(ruleCtx.tagNode)){slotName=slotx;this._slotDefined=true}this._onSlot(ruleCtx,slotName)};Rule.prototype._onSlot=function(ruleCtx,slotName){var pnode,slotTag,psc;if(slotName&&ruleCtx.tagNode.name===OJ_BIND_SLOT){return}if(!(pnode=getParentNodeForSlot(ruleCtx,slotName))){return}if(!this._metaLib.isWCTag(pnode.name)){return}if(this._metaLib.isJetTag(pnode.name)&&!this._hasJetWCInterfaces){return}psc=this._metaLib.getPreferredSlotContentEx(pnode.name,slotName);if(!(psc&&psc.interfaces)){return}slotTag=ruleCtx.tag;if(_isExempt(slotTag)){return}if(slotTag===DIV||slotTag===OJ_IF||slotTag===OJ_SWITCHER||slotTag.startsWith(OJ_BIND)||slotTag===OJ_DEFER||slotTag===TEMPLATE){let childs;if(childs=this._flattenDivChildren(psc,pnode,ruleCtx.tagNode,slotName)){let child;for(let i=0;i<childs.length;i++){child=childs[i];if(!_isExempt(child.name)){if(this._hasSlot(child)){continue}if(!this._isSlotInterfaceSupported(child,psc)){this._emitIssue(ruleCtx,child,slotName,pnode.name,psc,4)}}};return}else{this._emitIssue(ruleCtx,ruleCtx.tagNode,slotName,pnode.name,psc,2)}if(slotTag===OJ_SWITCHER||slotTag===OJ_IF){return}}if(ruleCtx.utils.DomUtils.isCommonElem(slotTag)){if(pnode.name!==OJ_TOOLBAR&&ruleCtx.tagNode.name!==SPAN){this._emitIssue(ruleCtx,ruleCtx.tagNode,slotName,pnode.name,psc,3)}return}if(this._metaLib.isWCTag(slotTag)){if(!_isBindTag(slotTag)&&slotTag!==OJ_DEFER&&slotTag!==TEMPLATE){if(!this._isSlotInterfaceSupported(ruleCtx.tagNode,psc)){this._emitIssue(ruleCtx,ruleCtx.tagNode,slotName,pnode.name,psc,1)}}}};Rule.prototype._flattenDivChildren=function(psc,pnode,tagNode,slotName,children){var nodes=tagNode.children;var node,tagName,i;for(i=0;i<nodes.length;i++){node=nodes[i];if(node.type!=="tag"){continue}tagName=node.name;if(FLATTENABLE_TAGS.includes(tagName)){if(!node.attributes?.slot){children=this._flattenDivChildren(psc,pnode,node,slotName,children)}continue}if(!children){children=[]}children.push(node)}return children};Rule.prototype._isSlotInterfaceSupported=function(node,psc){var ret=false,aIfc;if(node){if(aIfc=this._metaLib.getInterfaces(node.name)){for(let ifc of aIfc){if(psc.interfaces.includes(ifc)){ret=true;break}}}}return ret};Rule.prototype._emitIssue=function(ruleCtx,elemNode,slotName,slotOwner,psci,issueType){var ifc=_list(psci.interfaces,"or");var comp=psci.components?` (e.g. ${_list(psci.components,"or",true)})`:"";var multi=psci.interfaces.length>1;var actualSlot=slotName;var slotName=slotName?`slot '${slotName}'`:"default slot";var isDefSlot=!slotName;var issue,msg;if(issueType===1||issueType===4){msg=`<${elemNode.name}> is in${isDefSlot?" the":""} ${slotName} of <${slotOwner}> but does not implement interface${multi?"s":""} ${ifc}${comp}`}else if(issueType===2){msg=`<${elemNode.name}> is in${isDefSlot?" the":""} ${slotName} of <${slotOwner}> but its first child does not implement interface${multi?"s":""} ${ifc}${comp}`}else if(issueType===3){msg=`${slotName} on <${elemNode.name}> for <${slotOwner}> cannot provide ${multi?"interfaces":"an interface"} of type ${ifc}${comp}`}else{return}issue=new ruleCtx.Issue(msg);if(issueType===4){let pos=ruleCtx.utils.DomUtils.getLineCol(ruleCtx.data,elemNode.startIndex);issue.setPosition(pos.row,pos.col,elemNode.startIndex,elemNode.endIndex)}else if(this._slotDefined){let attrPos=ruleCtx.utils.DomUtils.getAttrValuePosition(ruleCtx.data,ruleCtx.tagNode,SLOT);ruleCtx.utils.DomUtils.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,SLOT);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end)}issue.setMsgEx({slotName:actualSlot,slotElem:elemNode.name,slotOwner:slotOwner});ruleCtx.reporter.addIssue(issue,ruleCtx)};Rule.prototype._hasSlot=function(tagNode){var slotName,attribs,slotx;if(attribs=tagNode.attribs){if(this._utils.hasAnyProps(attribs)){slotx=attribs[SLOT];if(slotx||slotx===""){slotName=slotx}}}return slotName};function _getFirstChildTag(childs){var ret,childs,child;if(childs){for(let i=0;i<childs.length;i++){child=childs[i];if(child.type!==TAG){continue}if(child.name.startsWith("oj-bind-")||child.name===OJ_DEFER||child.name===TEMPLATE){return _getFirstChildTag(child.children)}ret=child;break}}return ret};function _list(a,orand,isComp){var s="";for(let i=0;i<a.length;i++){if(i){if(i===a.length-1){s+=(isComp?">":"'")+" "+orand+" "}else{s+=(isComp?">":"'")+", "}}s+=(isComp?"<":"'")+a[i]}return s?s+=isComp?">":"'":s};module.exports=Rule;