rave-accessibility.js 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090
  1. (function() {
  2. // During the rave-accessibility.js build, this file is added to the top.
  3. // Create an inner self-executing function that will be run with the global scope
  4. // On browsers, this is 'window'. Everywhere else should use 'this' if available.
  5. // Need to run eval('this') "indirectly" by having eval returned by (1,eval). OBVIOUSLY :)
  6. var _window = (1, eval)('this');
  7. (function (global, factory) {
  8. // dynamically determine how 'rave' variable should be loaded depeneding on loader type
  9. var _rave;
  10. if (typeof module === "object" && typeof module.exports === "object" && typeof require == "function") {
  11. // CommonJS/node.js
  12. var rave = require("rave-navigation");
  13. var _accessibility = factory(global,rave);
  14. module.exports = rave;
  15. } else if (typeof define === "function" && define.amd) {
  16. // AMD
  17. define(['rave-navigation'], function(rave) {
  18. return factory(global,rave);
  19. });
  20. } else {
  21. // probably loading via script tag. run as is, setting stuff on rave
  22. factory(global,global['rave']);
  23. }
  24. }(_window, function (_global, _rave) {// $source: com/ibm/rave/accessibility/internal/nativeImpl/ModuleHeader
  25. /************************************************************************
  26. ** IBM Confidential
  27. **
  28. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  29. **
  30. ** (C) Copyright IBM Corp. 2014, 2015
  31. **
  32. ** The source code for this program is not published or otherwise divested of its trade secrets,
  33. ** irrespective of what has been deposited with the U.S. Copyright Office.
  34. ************************************************************************/
  35. // setup
  36. var global = typeof _global !== "undefined" ? _global : (1, eval)('this');
  37. var rave = typeof _rave !== "undefined" ? _rave : global['rave'];
  38. var rave_document = rave["_"]["rave_document"], rave_externs={},
  39. com_ibm_rave_core_Rave = rave,
  40. com_ibm_rave_core_nativeImpl_Declare = rave["_"]["com_ibm_rave_core_nativeImpl_Declare"],
  41. com_ibm_rave_core_selector_Selector = rave["internal"]["Selector"],
  42. com_ibm_rave_core_selector_SelectorDelegate = rave["internal"]["SelectorDelegate"],
  43. com_ibm_rave_navigation_focus_FocusController = rave["navigation"]["internal"]["FocusController"],
  44. com_ibm_rave_core_context_RaveContextManager = rave["internal"]["RaveContextManager"],
  45. com_ibm_rave_navigation_Navigation = rave["navigation"];
  46. // $source: com/ibm/rave/accessibility/AccessibilityConstants
  47. /************************************************************************
  48. ** IBM Confidential
  49. **
  50. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  51. **
  52. ** (C) Copyright IBM Corp. 2017
  53. **
  54. ** The source code for this program is not published or otherwise divested of its trade secrets,
  55. ** irrespective of what has been deposited with the U.S. Copyright Office.
  56. ************************************************************************/
  57. // GENERATED
  58. var com_ibm_rave_accessibility_AccessibilityConstants = rave_externs["AccessibilityConstants"] = {
  59. };
  60. /**
  61. * Key for the accessibility selector. To access accessibility methods on a selector, get the accessibility selector from the core selector this way: <code> AccessibilitySelector a11ySelector = (AccessibilitySelector) Rave.select("id").extension( Accessibility.SELECTOR_ID); </code>
  62. */
  63. /** @expose */
  64. com_ibm_rave_accessibility_AccessibilityConstants.SELECTOR_ID = "raveAccessibility";
  65. /**
  66. * Property key for accessible info. The accessible info must be of type {@link (Object) AccessibleInfo} .
  67. */
  68. /** @expose */
  69. com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY = "__accessibleInfo__";
  70. /**
  71. * Property key for shadow tree builder. The shadow tree builder must be of type {@link (com.ibm.rave.accessibility.ShadowTreeBuilder) ShadowTreeBuilder} .
  72. */
  73. /** @expose */
  74. com_ibm_rave_accessibility_AccessibilityConstants.SHADOW_TREE_BUILDER_KEY = "__shadowTreeBuilder__";
  75. // $source: com/ibm/rave/accessibility/internal/AccessibleNavigationSceneNodeExtension
  76. /************************************************************************
  77. ** IBM Confidential
  78. **
  79. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  80. **
  81. ** (C) Copyright IBM Corp. 2017
  82. **
  83. ** The source code for this program is not published or otherwise divested of its trade secrets,
  84. ** irrespective of what has been deposited with the U.S. Copyright Office.
  85. ************************************************************************/
  86. // GENERATED
  87. //@import com/ibm/rave/core/Rave (static) // Rave
  88. //@import com/ibm/rave/accessibility/internal/AccessibilityUtil (runtime) // recursiveSetShadowTreeBuilder, getShadowTreeBuilder
  89. //@import com/ibm/rave/accessibility/AccessibilityConstants (runtime) // AccessibilityConstants
  90. var com_ibm_rave_accessibility_internal_AccessibleNavigationSceneNodeExtension = {
  91. //constructor : function() {}
  92. };
  93. com_ibm_rave_accessibility_internal_AccessibleNavigationSceneNodeExtension.extend = function(baseNode) {
  94. var oriAppendChild = baseNode.appendChild;
  95. baseNode.appendChild = function(node) {
  96. oriAppendChild.call(this, node);
  97. com_ibm_rave_core_Rave.configuration.extendRecursive(node);
  98. var builder = com_ibm_rave_accessibility_internal_AccessibilityUtil.getShadowTreeBuilder(this);
  99. if (builder) {
  100. com_ibm_rave_accessibility_internal_AccessibilityUtil.recursiveSetShadowTreeBuilder(node, builder);
  101. builder.onAppend(this, node);
  102. }
  103. };
  104. var oriInsertBefore = baseNode.insertBefore;
  105. baseNode.insertBefore = function(node, before) {
  106. oriInsertBefore.call(this, node, before);
  107. com_ibm_rave_core_Rave.configuration.extendRecursive(node);
  108. var builder = com_ibm_rave_accessibility_internal_AccessibilityUtil.getShadowTreeBuilder(this);
  109. if (builder) {
  110. com_ibm_rave_accessibility_internal_AccessibilityUtil.recursiveSetShadowTreeBuilder(node, builder);
  111. builder.onInsert(this, node, before);
  112. }
  113. };
  114. var oriRemoveChild = baseNode.removeChild;
  115. baseNode.removeChild = function(node) {
  116. var i = this.rave_getChildNodes().indexOf(node);
  117. if (i != -1) {
  118. oriRemoveChild.call(this, node);
  119. com_ibm_rave_core_Rave.configuration.extendRecursive(node);
  120. var builder = com_ibm_rave_accessibility_internal_AccessibilityUtil.getShadowTreeBuilder(node);
  121. if (builder) {
  122. builder.onRemove(this, node, i);
  123. com_ibm_rave_accessibility_internal_AccessibilityUtil.recursiveSetShadowTreeBuilder(node, null);
  124. }
  125. return true;
  126. }
  127. return false;
  128. };
  129. var oriSetProperty = baseNode.rave_setProperty;
  130. baseNode.rave_setProperty = function(key, value) {
  131. oriSetProperty.call(this, key, value);
  132. if (com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY == key) {
  133. var builder = com_ibm_rave_accessibility_internal_AccessibilityUtil.getShadowTreeBuilder(this);
  134. if (builder) {
  135. builder.onChange(this);
  136. }
  137. }
  138. };
  139. };
  140. com_ibm_rave_accessibility_internal_AccessibleNavigationSceneNodeExtension.register = function() {
  141. com_ibm_rave_core_Rave.configuration.addSceneNodeExtensionFactory("http://www.w3.org/2000/svg", function(node, context) {
  142. if ((context && context.rave_hasProperty(com_ibm_rave_accessibility_AccessibilityConstants.SHADOW_TREE_BUILDER_KEY)) || node.rave_hasProperty(com_ibm_rave_accessibility_AccessibilityConstants.SHADOW_TREE_BUILDER_KEY)) {
  143. com_ibm_rave_accessibility_internal_AccessibleNavigationSceneNodeExtension.extend(node);
  144. }
  145. }, 0);
  146. };
  147. // $source: com/ibm/rave/accessibility/internal/AccessibilityUtil
  148. /************************************************************************
  149. ** IBM Confidential
  150. **
  151. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  152. **
  153. ** (C) Copyright IBM Corp. 2017
  154. **
  155. ** The source code for this program is not published or otherwise divested of its trade secrets,
  156. ** irrespective of what has been deposited with the U.S. Copyright Office.
  157. ************************************************************************/
  158. // GENERATED
  159. //@import com/ibm/rave/accessibility/AccessibilityConstants (static) // AccessibilityConstants
  160. //@import com/ibm/rave/core/selector/Selector (static) // extension
  161. //@import com/ibm/rave/accessibility/selector/AccessibilitySelector (runtime) // new
  162. var com_ibm_rave_accessibility_internal_AccessibilityUtil = {
  163. //constructor : function() {}
  164. };
  165. com_ibm_rave_accessibility_internal_AccessibilityUtil.getShadowTreeBuilder = function(node) {
  166. return node.rave_getProperty(com_ibm_rave_accessibility_AccessibilityConstants.SHADOW_TREE_BUILDER_KEY);
  167. };
  168. com_ibm_rave_accessibility_internal_AccessibilityUtil.hasAccessibleInfo = function(node) {
  169. return node.rave_getProperty(com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY) != null;
  170. };
  171. com_ibm_rave_accessibility_internal_AccessibilityUtil.recursiveSetShadowTreeBuilder = function(node, builder) {
  172. node.rave_setProperty(com_ibm_rave_accessibility_AccessibilityConstants.SHADOW_TREE_BUILDER_KEY, builder);
  173. if (node.rave_hasChildNodes()) {
  174. for (var __i_enFor0 = 0, __exp_enFor0 = node.rave_getChildNodes(), __len_enFor0 = __exp_enFor0.length;
  175. __i_enFor0 < __len_enFor0; ++__i_enFor0) {
  176. var child = __exp_enFor0[__i_enFor0];
  177. com_ibm_rave_accessibility_internal_AccessibilityUtil.recursiveSetShadowTreeBuilder(child, builder);
  178. }
  179. }
  180. };
  181. com_ibm_rave_accessibility_internal_AccessibilityUtil.registerSelector = function() {
  182. com_ibm_rave_core_selector_Selector.extension(com_ibm_rave_accessibility_AccessibilityConstants.SELECTOR_ID, function() {
  183. return new com_ibm_rave_accessibility_selector_AccessibilitySelector();
  184. });
  185. };
  186. // $source: com/ibm/rave/accessibility/selector/AccessibilitySelector
  187. /************************************************************************
  188. ** IBM Confidential
  189. **
  190. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  191. **
  192. ** (C) Copyright IBM Corp. 2017
  193. **
  194. ** The source code for this program is not published or otherwise divested of its trade secrets,
  195. ** irrespective of what has been deposited with the U.S. Copyright Office.
  196. ************************************************************************/
  197. // GENERATED
  198. //@import com/ibm/rave/core/nativeImpl/Declare (loadtime) // declare
  199. //@import com/ibm/rave/core/selector/SelectorDelegate (loadtime) // superclass
  200. //@import com/ibm/rave/accessibility/internal/nativeImpl/AccessibleContext (runtime) // setDescription, getDescription
  201. //@import com/ibm/rave/accessibility/AccessibilityConstants (runtime) // AccessibilityConstants
  202. /**
  203. * Accessibility extension to {@link (com.ibm.rave.core.selector.SelectorDelegate) SelectorDelegate} . Adds the ability to perform accessibility related functions to a selector.
  204. */
  205. var com_ibm_rave_accessibility_selector_AccessibilitySelector = rave_externs["AccessibilitySelector"] = com_ibm_rave_core_nativeImpl_Declare(com_ibm_rave_core_selector_SelectorDelegate, {
  206. /**
  207. * Constructor
  208. */
  209. /** @expose */
  210. constructor : function() {},
  211. /**
  212. * Create the extension to the selector.
  213. * @param (com.ibm.rave.core.selector.Selector) s The core selector.
  214. * @return (com.ibm.rave.core.selector.Selector) The extended selector.
  215. */
  216. /** @expose */
  217. create : function(s) {
  218. var as = new com_ibm_rave_accessibility_selector_AccessibilitySelector();
  219. return as.setDelegate(s);
  220. },
  221. /**
  222. * Get the accessible description for the first SceneNode in this Selector. In JavaScript, this gets the "aria-label".
  223. * @return (String) the accessible description of the first SceneNode in this Selector
  224. */
  225. description$0 : function() {
  226. var node = this.node();
  227. var owner = node ? node.rave_getOwner() : null;
  228. return !owner ? null : com_ibm_rave_accessibility_internal_nativeImpl_AccessibleContext.getDescription(owner);
  229. },
  230. /**
  231. * Set an accessible description for each owner of SceneNode in this Selector. In JavaScript, this sets the "aria-label".
  232. * @param (String) description the description
  233. * @return (com.ibm.rave.accessibility.selector.AccessibilitySelector) this {@link (com.ibm.rave.accessibility.selector.AccessibilitySelector) AccessibilitySelector}
  234. */
  235. description$1 : function(description) {
  236. this.each$0(function(data, index, groupIndex) {
  237. var owner = this.rave_getOwner();
  238. if (owner) {
  239. com_ibm_rave_accessibility_internal_nativeImpl_AccessibleContext.setDescription(owner, description);
  240. if (description != null) {
  241. var info = owner.rave_getProperty(com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY);
  242. if (!info) {
  243. info = {};
  244. info["label"] = description;
  245. owner.rave_setProperty(com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY, info);
  246. }
  247. }
  248. }
  249. });
  250. return this;
  251. },
  252. /**
  253. * Set an accessible description for each owner of SceneNode in this Selector. In JavaScript, this sets the "aria-label".
  254. * @param (com.ibm.rave.core.selector.ValueFunction) valueFunction a function which returns a description
  255. * @return (com.ibm.rave.core.selector.Selector) this {@link (com.ibm.rave.accessibility.selector.AccessibilitySelector) AccessibilitySelector}
  256. */
  257. description$2 : function(valueFunction) {
  258. this.each$0(function(data, index, groupIndex) {
  259. var owner = this.rave_getOwner();
  260. if (owner) {
  261. var value = valueFunction.call(owner, owner.rave_getData(), index, groupIndex);
  262. var description = value != null ? value + "" : "";
  263. com_ibm_rave_accessibility_internal_nativeImpl_AccessibleContext.setDescription(owner, description);
  264. if (description != null) {
  265. var info = owner.rave_getProperty(com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY);
  266. if (!info) {
  267. info = {};
  268. info["label"] = description;
  269. owner.rave_setProperty(com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY, info);
  270. }
  271. }
  272. }
  273. });
  274. return this;
  275. },
  276. /**
  277. * Get the accessible info for the first SceneNode in this Selector.
  278. * @return (Object) the accessible info of the first SceneNode in this Selector
  279. */
  280. info$0 : function() {
  281. var node = this.node();
  282. return !node ? null : node.rave_getProperty(com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY);
  283. },
  284. /**
  285. * Set an accessible info for each SceneNode in this Selector.
  286. * @param (Object) info the accessible info
  287. * @return (com.ibm.rave.accessibility.selector.AccessibilitySelector) this {@link (com.ibm.rave.accessibility.selector.AccessibilitySelector) AccessibilitySelector}
  288. */
  289. info$1 : function(info) {
  290. this.each$0(function(data, index, groupIndex) {
  291. this.rave_setProperty(com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY, info);
  292. });
  293. return this;
  294. },
  295. /**
  296. * Set an accessible info for each SceneNode in this Selector.
  297. * @param (com.ibm.rave.core.selector.ValueFunction) valueFunction a function which returns a {@link (Object) AccessibleInfo}
  298. * @return (com.ibm.rave.accessibility.selector.AccessibilitySelector) this {@link (com.ibm.rave.accessibility.selector.AccessibilitySelector) AccessibilitySelector}
  299. */
  300. info$2 : function(valueFunction) {
  301. this.each$0(function(data, index, groupIndex) {
  302. this.rave_setProperty(com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY, valueFunction.call(this, data, index, groupIndex));
  303. });
  304. return this;
  305. },
  306. /** @expose */
  307. description : function(a0) {
  308. var args = arguments;
  309. if (args.length == 0) {
  310. return this.description$0();
  311. }
  312. if (args.length == 1 && (a0 == null || typeof a0 === "string")) {
  313. return this.description$1(a0);
  314. }
  315. return this.description$2(a0);
  316. },
  317. /** @expose */
  318. info : function(a0) {
  319. var args = arguments;
  320. if (args.length == 0) {
  321. return this.info$0();
  322. }
  323. if (args.length == 1 && typeof a0 === "function") {
  324. return this.info$2(a0);
  325. }
  326. return this.info$1(a0);
  327. }
  328. });
  329. // $source: com/ibm/rave/accessibility/internal/nativeImpl/ShadowDOMBuilder
  330. /************************************************************************
  331. ** IBM Confidential
  332. **
  333. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  334. **
  335. ** (C) Copyright IBM Corp. 2014, 2015
  336. **
  337. ** The source code for this program is not published or otherwise divested of its trade secrets,
  338. ** irrespective of what has been deposited with the U.S. Copyright Office.
  339. ************************************************************************/
  340. // @import com/ibm/rave/core/nativeImpl/Declare
  341. // @import com/ibm/rave/accessibility/AccessibilityConstants
  342. // @import com/ibm/rave/core/internal/nativeImpl/event/Event
  343. var com_ibm_rave_accessibility_internal_nativeImpl_ShadowDOMBuilder = (function() {
  344. var shadowDomNodeKey = "__shadowDomNode__";
  345. var sceneNodeKey = "__sceneNode__";
  346. function removeShadowDomNode(domNode) {
  347. if (domNode[shadowDomNodeKey]) {
  348. delete domNode[shadowDomNodeKey][sceneNodeKey];
  349. delete domNode[shadowDomNodeKey];
  350. }
  351. var childNodes = domNode.childNodes;
  352. for (var i = 0; i < childNodes.length; i++) {
  353. removeShadowDomNode(childNodes[i]);
  354. }
  355. }
  356. function setAttributes(shadowDomNode, info) {
  357. // set the known properties
  358. info["label"] ? shadowDomNode.setAttribute("aria-label", info["label"]) : shadowDomNode.removeAttribute("aria-label");
  359. info["hint"] ? shadowDomNode.setAttribute("aria-hint", info["hint"]) : shadowDomNode.removeAttribute("aria-hint");
  360. info["role"] ? shadowDomNode.setAttribute("role", info["role"]) : shadowDomNode.removeAttribute("role");
  361. // set all custom properties
  362. for (var key in info) {
  363. if (info.hasOwnProperty(key)) {
  364. switch (key) {
  365. case "label":
  366. case "hint":
  367. case "role":
  368. break;
  369. default:
  370. info[key] ? shadowDomNode.setAttribute(key, info[key]) : shadowDomNode.removeAttribute(key);
  371. }
  372. }
  373. }
  374. }
  375. function setText(shadowDomNode, info) {
  376. if (info && info["label"] && info["label"].length) {
  377. shadowDomNode.textContent = info["label"];
  378. }
  379. }
  380. function appendOrInsert(parent, child, before) {
  381. var info = child.rave_getProperty(com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY);
  382. if (info) {
  383. var shadowDomNode = child.rave_getProperty(shadowDomNodeKey),
  384. ps = rave.select(parent.rave_getProperty(shadowDomNodeKey)),
  385. ul = ps.select("ul");
  386. if (!shadowDomNode) {
  387. if (ul.empty()) {
  388. ul = ps.append("ul");
  389. }
  390. shadowDomNode = rave_document.createElement("li");
  391. shadowDomNode[sceneNodeKey] = child;
  392. child.rave_setProperty(shadowDomNodeKey, shadowDomNode);
  393. setAttributes(shadowDomNode, info);
  394. setText(shadowDomNode, info);
  395. // recursively add its children
  396. if (child.rave_hasChildNodes()) {
  397. var children = child.rave_getChildNodes();
  398. for (var i = 0; i < children.length; i++) {
  399. this.onAppend(child, children[i]);
  400. }
  401. }
  402. }
  403. // get the real ul dom node
  404. ul = ul.node();
  405. if (arguments.length == 3) {
  406. ul.insertBefore(shadowDomNode, before.rave_getProperty(shadowDomNodeKey));
  407. } else {
  408. ul.appendChild(shadowDomNode);
  409. }
  410. }
  411. }
  412. return com_ibm_rave_core_nativeImpl_Declare({
  413. onAppend : appendOrInsert,
  414. onInsert : appendOrInsert,
  415. onRemove : function(parent, child, index) {
  416. var shadowDomNode = child[shadowDomNodeKey], newFocus;
  417. if (shadowDomNode == this._currentFocus) {
  418. newFocus = shadowDomNode.previousElementSibling;
  419. if (!newFocus) {
  420. newFocus = shadowDomNode.nextElementSibling;
  421. if (!newFocus) {
  422. // -> ul -> next parent
  423. newFocus = shadowDomNode.parentNode.parentNode;
  424. }
  425. }
  426. }
  427. this.tearDown(child);
  428. if (newFocus) {
  429. // select the scene node
  430. this._focusEventHandler.fireFocus(newFocus[sceneNodeKey]);
  431. }
  432. },
  433. onChange : function(domNode) {
  434. var info = domNode.rave_getProperty(com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY),
  435. shadowDomNode = domNode.rave_getProperty(shadowDomNodeKey);
  436. if (!info) {
  437. // if no info remove the shadow dom node
  438. if (shadowDomNode) {
  439. this.tearDown(domNode);
  440. }
  441. } else if (!shadowDomNode) {
  442. var parentNode = domNode.parentNode;
  443. if (parentNode) {
  444. appendOrInsert(parentNode, domNode);
  445. }
  446. } else {
  447. // update attributes
  448. setAttributes(shadowDomNode, info);
  449. // cannot use #setText because text may be spread across multiple text nodes
  450. // remove all text nodes
  451. var childNodes = shadowDomNode.childNodes;
  452. for (var i = 0; i < childNodes.length; i++) {
  453. if (childNodes[i].nodeType == 3) {
  454. shadowDomNode.removeChild(childNodes[i]);
  455. }
  456. }
  457. if (info.label && info.label.length) {
  458. // add new text node
  459. shadowDomNode.insertBefore(rave_document.createTextNode(info.label), shadowDomNode.firstChild);
  460. }
  461. }
  462. },
  463. setUp : function(domNode, focusEventHandler) {
  464. this._focusEventHandler = focusEventHandler;
  465. var shadowDomNode = domNode[shadowDomNodeKey],
  466. info = domNode.rave_getProperty(com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY);
  467. if (!info) {
  468. info = {};
  469. domNode.rave_setProperty(com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY, info);
  470. }
  471. if (!shadowDomNode) {
  472. shadowDomNode = rave_document.createElement("div");
  473. shadowDomNode[sceneNodeKey] = domNode;
  474. shadowDomNode.setAttribute("class", "rave-a11y");
  475. rave.select(shadowDomNode).style({
  476. "width": 0,
  477. "height": 0,
  478. "left": -10000,
  479. "top": -10000,
  480. "position": "absolute",
  481. "overflow": "hidden"
  482. }, "important");
  483. domNode.parentNode.insertBefore(shadowDomNode, domNode);
  484. domNode[shadowDomNodeKey] = shadowDomNode;
  485. setAttributes(shadowDomNode, info);
  486. setText(shadowDomNode, info);
  487. if (domNode.rave_hasChildNodes()) {
  488. var children = domNode.rave_getChildNodes();
  489. for (var i = 0; i < children.length; i++) {
  490. this.onAppend(domNode, children[i]);
  491. }
  492. }
  493. // make the visualization focusable
  494. this._tabIndex = +domNode.getAttribute("tabindex");
  495. domNode.removeAttribute("tabindex");
  496. // set the current focus to the root shadow dom node
  497. this._currentFocus = shadowDomNode;
  498. this._currentFocus.setAttribute("tabindex", this._tabIndex);
  499. }
  500. },
  501. tearDown : function(domNode) {
  502. shadowDomNode = domNode[shadowDomNodeKey];
  503. if (shadowDomNode) {
  504. // remove from the DOM
  505. shadowDomNode.parentNode.removeChild(shadowDomNode);
  506. // remove stored data from the scene tree
  507. removeShadowDomNode(domNode);
  508. }
  509. },
  510. focus : function(domNode) {
  511. var shadowDomNode;
  512. if (domNode) {
  513. shadowDomNode = domNode[shadowDomNodeKey];
  514. }
  515. if (this._currentFocus != shadowDomNode) {
  516. var refocus = document.activeElement === this._currentFocus;
  517. if (this._currentFocus) {
  518. this._currentFocus.removeAttribute("tabindex");
  519. this._currentFocus.blur();
  520. }
  521. if (shadowDomNode) {
  522. shadowDomNode.setAttribute("tabindex", this._tabIndex);
  523. if (refocus) {
  524. shadowDomNode.focus();
  525. }
  526. }
  527. this._currentFocus = shadowDomNode;
  528. }
  529. }
  530. });
  531. })();
  532. // $source: com/ibm/rave/accessibility/internal/nativeImpl/AccessibleContext
  533. /************************************************************************
  534. ** IBM Confidential
  535. **
  536. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  537. **
  538. ** (C) Copyright IBM Corp. 2014
  539. **
  540. ** The source code for this program is not published or otherwise divested of its trade secrets,
  541. ** irrespective of what has been deposited with the U.S. Copyright Office.
  542. ************************************************************************/
  543. // Utility to setup accessible context on a scene node
  544. // @import ./ShadowDOMBuilder
  545. var com_ibm_rave_accessibility_internal_nativeImpl_AccessibleContext = {
  546. getDescription : function(node) {
  547. return node.getAttribute("aria-label");
  548. },
  549. setDescription : function(node, description) {
  550. node.setAttribute("aria-label", description);
  551. },
  552. createShadowTreeBuilder : function() {
  553. return new com_ibm_rave_accessibility_internal_nativeImpl_ShadowDOMBuilder();
  554. }
  555. };
  556. // $source: com/ibm/rave/accessibility/navigation/AccessibleNavigation
  557. /************************************************************************
  558. ** IBM Confidential
  559. **
  560. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  561. **
  562. ** (C) Copyright IBM Corp. 2017
  563. **
  564. ** The source code for this program is not published or otherwise divested of its trade secrets,
  565. ** irrespective of what has been deposited with the U.S. Copyright Office.
  566. ************************************************************************/
  567. // GENERATED
  568. //@import com/ibm/rave/core/nativeImpl/Declare (loadtime) // declare
  569. //@import com/ibm/rave/accessibility/navigation/AccessibleKeyboard (runtime) // new
  570. var com_ibm_rave_accessibility_navigation_AccessibleNavigation = com_ibm_rave_core_nativeImpl_Declare({
  571. /**
  572. * Creates a new instance of {@link (com.ibm.rave.accessibility.navigation.AccessibleKeyboard) AccessibleKeyboard} .
  573. * @return (com.ibm.rave.accessibility.navigation.AccessibleKeyboard) new instance of {@link (com.ibm.rave.accessibility.navigation.AccessibleKeyboard) AccessibleKeyboard}
  574. */
  575. /** @expose */
  576. keyboard : function() {
  577. return new com_ibm_rave_accessibility_navigation_AccessibleKeyboard();
  578. }
  579. //constructor : function() {}
  580. });
  581. /** @expose */
  582. com_ibm_rave_accessibility_navigation_AccessibleNavigation.INSTANCE = new com_ibm_rave_accessibility_navigation_AccessibleNavigation();
  583. // $source: com/ibm/rave/accessibility/Accessibility
  584. /************************************************************************
  585. ** IBM Confidential
  586. **
  587. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  588. **
  589. ** (C) Copyright IBM Corp. 2017
  590. **
  591. ** The source code for this program is not published or otherwise divested of its trade secrets,
  592. ** irrespective of what has been deposited with the U.S. Copyright Office.
  593. ************************************************************************/
  594. // GENERATED
  595. //@import com/ibm/rave/core/context/RaveContextManager (static) // RaveContextManager
  596. //@import com/ibm/rave/accessibility/internal/AccessibleNavigationSceneNodeExtension (static) // register
  597. //@import com/ibm/rave/accessibility/internal/AccessibilityUtil (static) // registerSelector
  598. //@import com/ibm/rave/core/nativeImpl/Declare (loadtime) // declare
  599. //@import com/ibm/rave/accessibility/AccessibilityConstants (static) // AccessibilityConstants
  600. //@import com/ibm/rave/accessibility/navigation/AccessibleNavigation (static) // AccessibleNavigation
  601. /**
  602. * The accessibility layer. Provides entry points into functionality provided by the accessibility layer.
  603. */
  604. var com_ibm_rave_accessibility_Accessibility = rave_externs["Accessibility"] = {
  605. //constructor : function() {}
  606. };
  607. com_ibm_rave_accessibility_Accessibility.getRegistrationStatus = function() {
  608. var registrationStatus = com_ibm_rave_core_context_RaveContextManager.INSTANCE.getRaveContext().getData("ACCESSIBILITY_EXTENSION_REGISTRATION_STATUS_KEY");
  609. if (!registrationStatus) {
  610. registrationStatus = new com_ibm_rave_accessibility_Accessibility.RegistrationStatus();
  611. com_ibm_rave_core_context_RaveContextManager.INSTANCE.getRaveContext().putData("ACCESSIBILITY_EXTENSION_REGISTRATION_STATUS_KEY", registrationStatus);
  612. }
  613. return registrationStatus;
  614. };
  615. /**
  616. * Initialize the Accessibility feature. This needs to be called before using any accessibility features.
  617. */
  618. /** @expose */
  619. com_ibm_rave_accessibility_Accessibility.init = function() {
  620. var registrationStatus = com_ibm_rave_accessibility_Accessibility.getRegistrationStatus();
  621. if (!registrationStatus.registered) {
  622. com_ibm_rave_accessibility_internal_AccessibleNavigationSceneNodeExtension.register();
  623. com_ibm_rave_accessibility_internal_AccessibilityUtil.registerSelector();
  624. registrationStatus.registered = true;
  625. }
  626. };
  627. com_ibm_rave_accessibility_Accessibility.RegistrationStatus = com_ibm_rave_core_nativeImpl_Declare({
  628. registered : false
  629. });
  630. //com_ibm_rave_accessibility_Accessibility.EXTENSION_REGISTRATION_STATUS_KEY = "ACCESSIBILITY_EXTENSION_REGISTRATION_STATUS_KEY";
  631. /**
  632. * @see this.AccessibilityConstants#com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY
  633. */
  634. /** @expose */
  635. com_ibm_rave_accessibility_Accessibility.ACCESSIBLE_INFO_KEY = com_ibm_rave_accessibility_AccessibilityConstants.ACCESSIBLE_INFO_KEY;
  636. /**
  637. * @see this.AccessibilityConstants#com_ibm_rave_accessibility_AccessibilityConstants.SHADOW_TREE_BUILDER_KEY
  638. */
  639. /** @expose */
  640. com_ibm_rave_accessibility_Accessibility.SHADOW_TREE_BUILDER_KEY = com_ibm_rave_accessibility_AccessibilityConstants.SHADOW_TREE_BUILDER_KEY;
  641. /**
  642. * @see this.AccessibilityConstants#com_ibm_rave_accessibility_AccessibilityConstants.SELECTOR_ID
  643. */
  644. /** @expose */
  645. com_ibm_rave_accessibility_Accessibility.SELECTOR_ID = com_ibm_rave_accessibility_AccessibilityConstants.SELECTOR_ID;
  646. /**
  647. * @see (com.ibm.rave.accessibility.navigation.AccessibleNavigation) AccessibleNavigation
  648. */
  649. /** @expose */
  650. com_ibm_rave_accessibility_Accessibility.navigation = com_ibm_rave_accessibility_navigation_AccessibleNavigation.INSTANCE;
  651. // $source: com/ibm/rave/accessibility/internal/nativeImpl/Module
  652. /************************************************************************
  653. ** IBM Confidential
  654. **
  655. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  656. **
  657. ** (C) Copyright IBM Corp. 2014
  658. **
  659. ** The source code for this program is not published or otherwise divested of its trade secrets,
  660. ** irrespective of what has been deposited with the U.S. Copyright Office.
  661. ************************************************************************/
  662. // @OnDemandLoad("rave-accessibility")
  663. // Must be the first import
  664. // @import ./ModuleHeader
  665. // Other module dependencies
  666. // @import com/ibm/rave/navigation/internal/nativeImpl/Module
  667. // @import com/ibm/rave/accessibility/Accessibility
  668. com_ibm_rave_accessibility_Accessibility.init();
  669. // expose a11y class to the global variable rave
  670. rave["accessibility"] = com_ibm_rave_accessibility_Accessibility;
  671. // $source: com/ibm/rave/accessibility/navigation/AccessibleKeyboard
  672. /************************************************************************
  673. ** IBM Confidential
  674. **
  675. ** IBM Business Analytics: Rapidly Adaptive Visualization Engine
  676. **
  677. ** (C) Copyright IBM Corp. 2017
  678. **
  679. ** The source code for this program is not published or otherwise divested of its trade secrets,
  680. ** irrespective of what has been deposited with the U.S. Copyright Office.
  681. ************************************************************************/
  682. // GENERATED
  683. //@import com/ibm/rave/core/nativeImpl/Declare (loadtime) // declare
  684. //@import com/ibm/rave/navigation/Navigation (runtime) // keybinding
  685. //@import com/ibm/rave/core/Rave (runtime) // select, Rave
  686. //@import com/ibm/rave/accessibility/internal/nativeImpl/AccessibleContext (runtime) // createShadowTreeBuilder
  687. //@import com/ibm/rave/navigation/focus/FocusController (runtime) // nextFocusableNode, nextFocusableNodeFromStart, previousFocusableNodeFromEnd, nextLevelFocusableNode, previousLevelFocusableNode, previousFocusableNode
  688. //@import com/ibm/rave/accessibility/internal/AccessibilityUtil (runtime) // recursiveSetShadowTreeBuilder, hasAccessibleInfo, getShadowTreeBuilder
  689. var com_ibm_rave_accessibility_navigation_AccessibleKeyboard = rave_externs["AccessibleKeyboard"] = com_ibm_rave_core_nativeImpl_Declare({
  690. //kb : null,
  691. //eventHandler : null,
  692. //treeBuilder : null,
  693. //next : null,
  694. //previous : null,
  695. //nextStep : null,
  696. //previousStep : null,
  697. //first : null,
  698. //last : null,
  699. //nextLevel : null,
  700. //previousLevel : null,
  701. _$functionClassMethod : function() {
  702. var _$self = function(args) {
  703. if (args !== null || arguments.length > 1){
  704. args = Array.prototype.slice.call(arguments, 0);
  705. }
  706. {
  707. _$self.bind(args[0]);
  708. return null;
  709. }
  710. };
  711. return _$self;
  712. },
  713. constructor : function() {
  714. this.kb = com_ibm_rave_navigation_Navigation.keybinding();
  715. this.eventHandler = com_ibm_rave_core_Rave.behavior.focusEventHandler();
  716. this.treeBuilder = function(data, index, groupIndex) {
  717. return com_ibm_rave_accessibility_internal_nativeImpl_AccessibleContext.createShadowTreeBuilder();
  718. };
  719. {
  720. var self = this;
  721. this.next = function(args) {
  722. if (args !== null || arguments.length > 1){
  723. args = Array.prototype.slice.call(arguments, 0);
  724. }
  725. {
  726. var focused = self.eventHandler.focusedNode;
  727. if (focused && !(com_ibm_rave_accessibility_navigation_AccessibleKeyboard.isNavigationRoot(focused))) {
  728. var nextSibling = focused;
  729. while ((nextSibling = com_ibm_rave_navigation_focus_FocusController.nextFocusableNode(nextSibling))) {
  730. if (com_ibm_rave_accessibility_internal_AccessibilityUtil.hasAccessibleInfo(nextSibling)) {
  731. self.eventHandler.fireFocus(nextSibling);
  732. break;
  733. }
  734. }
  735. }
  736. rave.event.preventDefault();
  737. return null;
  738. }
  739. };
  740. this.previous = function(args) {
  741. if (args !== null || arguments.length > 1){
  742. args = Array.prototype.slice.call(arguments, 0);
  743. }
  744. {
  745. var focused = self.eventHandler.focusedNode;
  746. if (focused && !(com_ibm_rave_accessibility_navigation_AccessibleKeyboard.isNavigationRoot(focused))) {
  747. var previousSibling = focused;
  748. while ((previousSibling = com_ibm_rave_navigation_focus_FocusController.previousFocusableNode(previousSibling))) {
  749. if (com_ibm_rave_accessibility_internal_AccessibilityUtil.hasAccessibleInfo(previousSibling)) {
  750. self.eventHandler.fireFocus(previousSibling);
  751. break;
  752. }
  753. }
  754. }
  755. rave.event.preventDefault();
  756. return null;
  757. }
  758. };
  759. this.nextStep = function(args) {
  760. if (args !== null || arguments.length > 1){
  761. args = Array.prototype.slice.call(arguments, 0);
  762. }
  763. {
  764. var focused = self.eventHandler.focusedNode;
  765. if (focused && !(com_ibm_rave_accessibility_navigation_AccessibleKeyboard.isNavigationRoot(focused))) {
  766. var stepCount = 0;
  767. var nextSibling = focused, temp = focused;
  768. while (stepCount < 20 && temp) {
  769. temp = com_ibm_rave_navigation_focus_FocusController.nextFocusableNode(temp);
  770. if (temp) {
  771. if (com_ibm_rave_accessibility_internal_AccessibilityUtil.hasAccessibleInfo(temp)) {
  772. nextSibling = temp;
  773. stepCount++;
  774. }
  775. }
  776. }
  777. if (nextSibling != focused) {
  778. self.eventHandler.fireFocus(nextSibling);
  779. }
  780. }
  781. rave.event.preventDefault();
  782. return null;
  783. }
  784. };
  785. this.previousStep = function(args) {
  786. if (args !== null || arguments.length > 1){
  787. args = Array.prototype.slice.call(arguments, 0);
  788. }
  789. {
  790. var focused = self.eventHandler.focusedNode;
  791. if (focused && !(com_ibm_rave_accessibility_navigation_AccessibleKeyboard.isNavigationRoot(focused))) {
  792. var stepCount = 0;
  793. var previousSibling = focused, temp = focused;
  794. while (stepCount < 20 && temp) {
  795. temp = com_ibm_rave_navigation_focus_FocusController.previousFocusableNode(temp);
  796. if (temp) {
  797. if (com_ibm_rave_accessibility_internal_AccessibilityUtil.hasAccessibleInfo(temp)) {
  798. previousSibling = temp;
  799. stepCount++;
  800. }
  801. }
  802. }
  803. if (previousSibling != focused) {
  804. self.eventHandler.fireFocus(previousSibling);
  805. }
  806. }
  807. rave.event.preventDefault();
  808. return null;
  809. }
  810. };
  811. this.first = function(args) {
  812. if (args !== null || arguments.length > 1){
  813. args = Array.prototype.slice.call(arguments, 0);
  814. }
  815. {
  816. var focused = self.eventHandler.focusedNode;
  817. if (focused && !(com_ibm_rave_accessibility_navigation_AccessibleKeyboard.isNavigationRoot(focused))) {
  818. var firstNode = com_ibm_rave_navigation_focus_FocusController.nextFocusableNodeFromStart(focused);
  819. if (!(com_ibm_rave_accessibility_internal_AccessibilityUtil.hasAccessibleInfo(firstNode))) {
  820. while ((firstNode = com_ibm_rave_navigation_focus_FocusController.nextFocusableNode(firstNode))) {
  821. if (com_ibm_rave_accessibility_internal_AccessibilityUtil.hasAccessibleInfo(firstNode)) {
  822. break;
  823. }
  824. }
  825. }
  826. if (firstNode && focused != firstNode) {
  827. self.eventHandler.fireFocus(firstNode);
  828. }
  829. }
  830. rave.event.preventDefault();
  831. return null;
  832. }
  833. };
  834. this.last = function(args) {
  835. if (args !== null || arguments.length > 1){
  836. args = Array.prototype.slice.call(arguments, 0);
  837. }
  838. {
  839. var focused = self.eventHandler.focusedNode;
  840. if (focused && !(com_ibm_rave_accessibility_navigation_AccessibleKeyboard.isNavigationRoot(focused))) {
  841. var lastNode = com_ibm_rave_navigation_focus_FocusController.previousFocusableNodeFromEnd(focused);
  842. if (!(com_ibm_rave_accessibility_internal_AccessibilityUtil.hasAccessibleInfo(lastNode))) {
  843. while ((lastNode = com_ibm_rave_navigation_focus_FocusController.previousFocusableNode(lastNode))) {
  844. if (com_ibm_rave_accessibility_internal_AccessibilityUtil.hasAccessibleInfo(lastNode)) {
  845. break;
  846. }
  847. }
  848. }
  849. if (lastNode && focused != lastNode) {
  850. self.eventHandler.fireFocus(lastNode);
  851. }
  852. }
  853. rave.event.preventDefault();
  854. return null;
  855. }
  856. };
  857. this.nextLevel = function(args) {
  858. if (args !== null || arguments.length > 1){
  859. args = Array.prototype.slice.call(arguments, 0);
  860. }
  861. {
  862. var focused = self.eventHandler.focusedNode;
  863. if (focused) {
  864. if (focused.rave_hasChildNodes()) {
  865. var child = com_ibm_rave_navigation_focus_FocusController.nextLevelFocusableNode(focused);
  866. if (!(com_ibm_rave_accessibility_internal_AccessibilityUtil.hasAccessibleInfo(child))) {
  867. while ((child = com_ibm_rave_navigation_focus_FocusController.nextFocusableNode(child))) {
  868. if (com_ibm_rave_accessibility_internal_AccessibilityUtil.hasAccessibleInfo(child)) {
  869. break;
  870. }
  871. }
  872. }
  873. if (child) {
  874. self.eventHandler.fireFocus(child);
  875. }
  876. }
  877. }
  878. rave.event.preventDefault();
  879. return null;
  880. }
  881. };
  882. this.previousLevel = function(args) {
  883. if (args !== null || arguments.length > 1){
  884. args = Array.prototype.slice.call(arguments, 0);
  885. }
  886. {
  887. var focused = self.eventHandler.focusedNode;
  888. if (focused && !(com_ibm_rave_accessibility_navigation_AccessibleKeyboard.isNavigationRoot(focused))) {
  889. var parent = com_ibm_rave_navigation_focus_FocusController.previousLevelFocusableNode(focused);
  890. if (parent) {
  891. self.eventHandler.fireFocus(parent);
  892. }
  893. }
  894. rave.event.preventDefault();
  895. return null;
  896. }
  897. };
  898. }
  899. {
  900. this.kb.on(40, this.next).on(38, this.previous).on(34, this.nextStep).on(33, this.previousStep).on(36, this.first).on(35, this.last).on(39, this.nextLevel).on(37, this.previousLevel);
  901. }
  902. },
  903. /** @expose */
  904. bind : function(g) {
  905. var self = this;
  906. g.each(function(data, index, groupIndex) {
  907. var s = com_ibm_rave_core_Rave.select(this);
  908. var stb = self.treeBuilder.call(this, data, index, groupIndex);
  909. com_ibm_rave_accessibility_internal_AccessibilityUtil.recursiveSetShadowTreeBuilder(this, stb);
  910. com_ibm_rave_core_Rave.configuration.extendRecursive(this);
  911. stb.setUp(this, self.eventHandler);
  912. s.on("ravefocus", com_ibm_rave_accessibility_navigation_AccessibleKeyboard.FOCUS_LISTENER);
  913. com_ibm_rave_core_Rave.select(this.rave_getOwner()).call(self.kb);
  914. s.property(com_ibm_rave_accessibility_navigation_AccessibleKeyboard.NATIVATION_ROOT, true);
  915. self.eventHandler.focusedNode = this;
  916. });
  917. },
  918. shadowTreeBuilder$0 : function() {
  919. return this.treeBuilder;
  920. },
  921. shadowTreeBuilder$1 : function(shadowTreeBuilder) {
  922. this.treeBuilder = shadowTreeBuilder;
  923. return this;
  924. },
  925. /** @expose */
  926. keyBinding : function() {
  927. return this.kb;
  928. },
  929. focusEventHandler$0 : function() {
  930. return this.eventHandler;
  931. },
  932. focusEventHandler$1 : function(handler) {
  933. this.eventHandler = handler;
  934. return this;
  935. },
  936. /** @expose */
  937. shadowTreeBuilder : function(a0) {
  938. var args = arguments;
  939. if (args.length == 0) {
  940. return this.shadowTreeBuilder$0();
  941. }
  942. return this.shadowTreeBuilder$1(a0);
  943. },
  944. /** @expose */
  945. focusEventHandler : function(a0) {
  946. var args = arguments;
  947. if (args.length == 0) {
  948. return this.focusEventHandler$0();
  949. }
  950. return this.focusEventHandler$1(a0);
  951. }
  952. });
  953. com_ibm_rave_accessibility_navigation_AccessibleKeyboard.isNavigationRoot = function(item) {
  954. return item.rave_getProperty(com_ibm_rave_accessibility_navigation_AccessibleKeyboard.NATIVATION_ROOT) != null;
  955. };
  956. com_ibm_rave_accessibility_navigation_AccessibleKeyboard.NATIVATION_ROOT = "__rave-kbnav-root__";
  957. com_ibm_rave_accessibility_navigation_AccessibleKeyboard.STEP = 20;
  958. com_ibm_rave_accessibility_navigation_AccessibleKeyboard.FOCUS_LISTENER = function(data, index, groupIndex, event) {
  959. var stb = com_ibm_rave_accessibility_internal_AccessibilityUtil.getShadowTreeBuilder(event.target);
  960. if (event.target) {
  961. stb.focus(event.target);
  962. } else {
  963. stb.focus(null);
  964. }
  965. };
  966. // This is the end of the factory method defined in the header. Added only during a full compiled JS build.
  967. return rave;
  968. }));})();