InfoRegionsComponent.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. /* *
  2. *
  3. * (c) 2009-2020 Øystein Moseng
  4. *
  5. * Accessibility component for chart info region and table.
  6. *
  7. * License: www.highcharts.com/license
  8. *
  9. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  10. *
  11. * */
  12. 'use strict';
  13. import H from '../../Core/Globals.js';
  14. var doc = H.doc;
  15. import U from '../../Core/Utilities.js';
  16. var extend = U.extend, format = U.format, pick = U.pick;
  17. import AccessibilityComponent from '../AccessibilityComponent.js';
  18. import Announcer from '../Utils/Announcer.js';
  19. import AnnotationsA11y from './AnnotationsA11y.js';
  20. var getAnnotationsInfoHTML = AnnotationsA11y.getAnnotationsInfoHTML;
  21. import ChartUtilities from '../Utils/ChartUtilities.js';
  22. var unhideChartElementFromAT = ChartUtilities.unhideChartElementFromAT, getChartTitle = ChartUtilities.getChartTitle, getAxisDescription = ChartUtilities.getAxisDescription;
  23. import HTMLUtilities from '../Utils/HTMLUtilities.js';
  24. var addClass = HTMLUtilities.addClass, setElAttrs = HTMLUtilities.setElAttrs, escapeStringForHTML = HTMLUtilities.escapeStringForHTML, stripHTMLTagsFromString = HTMLUtilities.stripHTMLTagsFromString, getElement = HTMLUtilities.getElement, visuallyHideElement = HTMLUtilities.visuallyHideElement;
  25. /* eslint-disable no-invalid-this, valid-jsdoc */
  26. /**
  27. * @private
  28. */
  29. function getTypeDescForMapChart(chart, formatContext) {
  30. return formatContext.mapTitle ?
  31. chart.langFormat('accessibility.chartTypes.mapTypeDescription', formatContext) :
  32. chart.langFormat('accessibility.chartTypes.unknownMap', formatContext);
  33. }
  34. /**
  35. * @private
  36. */
  37. function getTypeDescForCombinationChart(chart, formatContext) {
  38. return chart.langFormat('accessibility.chartTypes.combinationChart', formatContext);
  39. }
  40. /**
  41. * @private
  42. */
  43. function getTypeDescForEmptyChart(chart, formatContext) {
  44. return chart.langFormat('accessibility.chartTypes.emptyChart', formatContext);
  45. }
  46. /**
  47. * @private
  48. */
  49. function buildTypeDescriptionFromSeries(chart, types, context) {
  50. var firstType = types[0], typeExplaination = chart.langFormat('accessibility.seriesTypeDescriptions.' + firstType, context), multi = chart.series && chart.series.length < 2 ? 'Single' : 'Multiple';
  51. return (chart.langFormat('accessibility.chartTypes.' + firstType + multi, context) ||
  52. chart.langFormat('accessibility.chartTypes.default' + multi, context)) + (typeExplaination ? ' ' + typeExplaination : '');
  53. }
  54. /**
  55. * @private
  56. */
  57. function getTableSummary(chart) {
  58. return chart.langFormat('accessibility.table.tableSummary', { chart: chart });
  59. }
  60. /**
  61. * @private
  62. */
  63. function stripEmptyHTMLTags(str) {
  64. return str.replace(/<(\w+)[^>]*?>\s*<\/\1>/g, '');
  65. }
  66. /**
  67. * @private
  68. */
  69. function enableSimpleHTML(str) {
  70. return str
  71. .replace(/&lt;(h[1-7]|p|div|ul|ol|li)&gt;/g, '<$1>')
  72. .replace(/&lt;&#x2F;(h[1-7]|p|div|ul|ol|li|a|button)&gt;/g, '</$1>')
  73. .replace(/&lt;(div|a|button) id=&quot;([a-zA-Z\-0-9#]*?)&quot;&gt;/g, '<$1 id="$2">');
  74. }
  75. /**
  76. * @private
  77. */
  78. function stringToSimpleHTML(str) {
  79. return stripEmptyHTMLTags(enableSimpleHTML(escapeStringForHTML(str)));
  80. }
  81. /**
  82. * Return simplified explaination of chart type. Some types will not be familiar
  83. * to most users, but in those cases we try to add an explaination of the type.
  84. *
  85. * @private
  86. * @function Highcharts.Chart#getTypeDescription
  87. * @param {Array<string>} types The series types in this chart.
  88. * @return {string} The text description of the chart type.
  89. */
  90. H.Chart.prototype.getTypeDescription = function (types) {
  91. var firstType = types[0], firstSeries = this.series && this.series[0] || {}, formatContext = {
  92. numSeries: this.series.length,
  93. numPoints: firstSeries.points && firstSeries.points.length,
  94. chart: this,
  95. mapTitle: firstSeries.mapTitle
  96. };
  97. if (!firstType) {
  98. return getTypeDescForEmptyChart(this, formatContext);
  99. }
  100. if (firstType === 'map') {
  101. return getTypeDescForMapChart(this, formatContext);
  102. }
  103. if (this.types.length > 1) {
  104. return getTypeDescForCombinationChart(this, formatContext);
  105. }
  106. return buildTypeDescriptionFromSeries(this, types, formatContext);
  107. };
  108. /**
  109. * The InfoRegionsComponent class
  110. *
  111. * @private
  112. * @class
  113. * @name Highcharts.InfoRegionsComponent
  114. */
  115. var InfoRegionsComponent = function () { };
  116. InfoRegionsComponent.prototype = new AccessibilityComponent();
  117. extend(InfoRegionsComponent.prototype, /** @lends Highcharts.InfoRegionsComponent */ {
  118. /**
  119. * Init the component
  120. * @private
  121. */
  122. init: function () {
  123. var chart = this.chart;
  124. var component = this;
  125. this.initRegionsDefinitions();
  126. this.addEvent(chart, 'afterGetTable', function (e) {
  127. component.onDataTableCreated(e);
  128. });
  129. this.addEvent(chart, 'afterViewData', function (tableDiv) {
  130. component.dataTableDiv = tableDiv;
  131. // Use small delay to give browsers & AT time to register new table
  132. setTimeout(function () {
  133. component.focusDataTable();
  134. }, 300);
  135. });
  136. this.announcer = new Announcer(chart, 'assertive');
  137. },
  138. /**
  139. * @private
  140. */
  141. initRegionsDefinitions: function () {
  142. var component = this;
  143. this.screenReaderSections = {
  144. before: {
  145. element: null,
  146. buildContent: function (chart) {
  147. var formatter = chart.options.accessibility
  148. .screenReaderSection.beforeChartFormatter;
  149. return formatter ? formatter(chart) :
  150. component.defaultBeforeChartFormatter(chart);
  151. },
  152. insertIntoDOM: function (el, chart) {
  153. chart.renderTo.insertBefore(el, chart.renderTo.firstChild);
  154. },
  155. afterInserted: function () {
  156. if (typeof component.sonifyButtonId !== 'undefined') {
  157. component.initSonifyButton(component.sonifyButtonId);
  158. }
  159. if (typeof component.dataTableButtonId !== 'undefined') {
  160. component.initDataTableButton(component.dataTableButtonId);
  161. }
  162. }
  163. },
  164. after: {
  165. element: null,
  166. buildContent: function (chart) {
  167. var formatter = chart.options.accessibility.screenReaderSection
  168. .afterChartFormatter;
  169. return formatter ? formatter(chart) :
  170. component.defaultAfterChartFormatter();
  171. },
  172. insertIntoDOM: function (el, chart) {
  173. chart.renderTo.insertBefore(el, chart.container.nextSibling);
  174. }
  175. }
  176. };
  177. },
  178. /**
  179. * Called on chart render. Have to update the sections on render, in order
  180. * to get a11y info from series.
  181. */
  182. onChartRender: function () {
  183. var component = this;
  184. this.linkedDescriptionElement = this.getLinkedDescriptionElement();
  185. this.setLinkedDescriptionAttrs();
  186. Object.keys(this.screenReaderSections).forEach(function (regionKey) {
  187. component.updateScreenReaderSection(regionKey);
  188. });
  189. },
  190. /**
  191. * @private
  192. */
  193. getLinkedDescriptionElement: function () {
  194. var chartOptions = this.chart.options, linkedDescOption = chartOptions.accessibility.linkedDescription;
  195. if (!linkedDescOption) {
  196. return;
  197. }
  198. if (typeof linkedDescOption !== 'string') {
  199. return linkedDescOption;
  200. }
  201. var query = format(linkedDescOption, this.chart), queryMatch = doc.querySelectorAll(query);
  202. if (queryMatch.length === 1) {
  203. return queryMatch[0];
  204. }
  205. },
  206. /**
  207. * @private
  208. */
  209. setLinkedDescriptionAttrs: function () {
  210. var el = this.linkedDescriptionElement;
  211. if (el) {
  212. el.setAttribute('aria-hidden', 'true');
  213. addClass(el, 'highcharts-linked-description');
  214. }
  215. },
  216. /**
  217. * @private
  218. * @param {string} regionKey The name/key of the region to update
  219. */
  220. updateScreenReaderSection: function (regionKey) {
  221. var chart = this.chart, region = this.screenReaderSections[regionKey], content = region.buildContent(chart), sectionDiv = region.element = (region.element || this.createElement('div')), hiddenDiv = (sectionDiv.firstChild || this.createElement('div'));
  222. this.setScreenReaderSectionAttribs(sectionDiv, regionKey);
  223. hiddenDiv.innerHTML = content;
  224. sectionDiv.appendChild(hiddenDiv);
  225. region.insertIntoDOM(sectionDiv, chart);
  226. visuallyHideElement(hiddenDiv);
  227. unhideChartElementFromAT(chart, hiddenDiv);
  228. if (region.afterInserted) {
  229. region.afterInserted();
  230. }
  231. },
  232. /**
  233. * @private
  234. * @param {Highcharts.HTMLDOMElement} sectionDiv The section element
  235. * @param {string} regionKey Name/key of the region we are setting attrs for
  236. */
  237. setScreenReaderSectionAttribs: function (sectionDiv, regionKey) {
  238. var labelLangKey = ('accessibility.screenReaderSection.' + regionKey + 'RegionLabel'), chart = this.chart, labelText = chart.langFormat(labelLangKey, { chart: chart }), sectionId = 'highcharts-screen-reader-region-' + regionKey + '-' +
  239. chart.index;
  240. setElAttrs(sectionDiv, {
  241. id: sectionId,
  242. 'aria-label': labelText
  243. });
  244. // Sections are wrapped to be positioned relatively to chart in case
  245. // elements inside are tabbed to.
  246. sectionDiv.style.position = 'relative';
  247. if (chart.options.accessibility.landmarkVerbosity === 'all' &&
  248. labelText) {
  249. sectionDiv.setAttribute('role', 'region');
  250. }
  251. },
  252. /**
  253. * @private
  254. * @return {string}
  255. */
  256. defaultBeforeChartFormatter: function () {
  257. var _a;
  258. var chart = this.chart, format = chart.options.accessibility
  259. .screenReaderSection.beforeChartFormat, axesDesc = this.getAxesDescription(), shouldHaveSonifyBtn = chart.sonify && ((_a = chart.options.sonification) === null || _a === void 0 ? void 0 : _a.enabled), sonifyButtonId = 'highcharts-a11y-sonify-data-btn-' +
  260. chart.index, dataTableButtonId = 'hc-linkto-highcharts-data-table-' +
  261. chart.index, annotationsList = getAnnotationsInfoHTML(chart), annotationsTitleStr = chart.langFormat('accessibility.screenReaderSection.annotations.heading', { chart: chart }), context = {
  262. chartTitle: getChartTitle(chart),
  263. typeDescription: this.getTypeDescriptionText(),
  264. chartSubtitle: this.getSubtitleText(),
  265. chartLongdesc: this.getLongdescText(),
  266. xAxisDescription: axesDesc.xAxis,
  267. yAxisDescription: axesDesc.yAxis,
  268. playAsSoundButton: shouldHaveSonifyBtn ?
  269. this.getSonifyButtonText(sonifyButtonId) : '',
  270. viewTableButton: chart.getCSV ?
  271. this.getDataTableButtonText(dataTableButtonId) : '',
  272. annotationsTitle: annotationsList ? annotationsTitleStr : '',
  273. annotationsList: annotationsList
  274. }, formattedString = H.i18nFormat(format, context, chart);
  275. this.dataTableButtonId = dataTableButtonId;
  276. this.sonifyButtonId = sonifyButtonId;
  277. return stringToSimpleHTML(formattedString);
  278. },
  279. /**
  280. * @private
  281. * @return {string}
  282. */
  283. defaultAfterChartFormatter: function () {
  284. var chart = this.chart, format = chart.options.accessibility
  285. .screenReaderSection.afterChartFormat, context = {
  286. endOfChartMarker: this.getEndOfChartMarkerText()
  287. }, formattedString = H.i18nFormat(format, context, chart);
  288. return stringToSimpleHTML(formattedString);
  289. },
  290. /**
  291. * @private
  292. * @return {string}
  293. */
  294. getLinkedDescription: function () {
  295. var el = this.linkedDescriptionElement, content = el && el.innerHTML || '';
  296. return stripHTMLTagsFromString(content);
  297. },
  298. /**
  299. * @private
  300. * @return {string}
  301. */
  302. getLongdescText: function () {
  303. var chartOptions = this.chart.options, captionOptions = chartOptions.caption, captionText = captionOptions && captionOptions.text, linkedDescription = this.getLinkedDescription();
  304. return (chartOptions.accessibility.description ||
  305. linkedDescription ||
  306. captionText ||
  307. '');
  308. },
  309. /**
  310. * @private
  311. * @return {string}
  312. */
  313. getTypeDescriptionText: function () {
  314. var chart = this.chart;
  315. return chart.types ?
  316. chart.options.accessibility.typeDescription ||
  317. chart.getTypeDescription(chart.types) : '';
  318. },
  319. /**
  320. * @private
  321. * @param {string} buttonId
  322. * @return {string}
  323. */
  324. getDataTableButtonText: function (buttonId) {
  325. var chart = this.chart, buttonText = chart.langFormat('accessibility.table.viewAsDataTableButtonText', { chart: chart, chartTitle: getChartTitle(chart) });
  326. return '<button id="' + buttonId + '">' + buttonText + '</button>';
  327. },
  328. /**
  329. * @private
  330. * @param {string} buttonId
  331. * @return {string}
  332. */
  333. getSonifyButtonText: function (buttonId) {
  334. var _a;
  335. var chart = this.chart;
  336. if (((_a = chart.options.sonification) === null || _a === void 0 ? void 0 : _a.enabled) === false) {
  337. return '';
  338. }
  339. var buttonText = chart.langFormat('accessibility.sonification.playAsSoundButtonText', { chart: chart, chartTitle: getChartTitle(chart) });
  340. return '<button id="' + buttonId + '">' + buttonText + '</button>';
  341. },
  342. /**
  343. * @private
  344. * @return {string}
  345. */
  346. getSubtitleText: function () {
  347. var subtitle = (this.chart.options.subtitle);
  348. return stripHTMLTagsFromString(subtitle && subtitle.text || '');
  349. },
  350. /**
  351. * @private
  352. * @return {string}
  353. */
  354. getEndOfChartMarkerText: function () {
  355. var chart = this.chart, markerText = chart.langFormat('accessibility.screenReaderSection.endOfChartMarker', { chart: chart }), id = 'highcharts-end-of-chart-marker-' + chart.index;
  356. return '<div id="' + id + '">' + markerText + '</div>';
  357. },
  358. /**
  359. * @private
  360. * @param {Highcharts.Dictionary<string>} e
  361. */
  362. onDataTableCreated: function (e) {
  363. var chart = this.chart;
  364. if (chart.options.accessibility.enabled) {
  365. if (this.viewDataTableButton) {
  366. this.viewDataTableButton.setAttribute('aria-expanded', 'true');
  367. }
  368. e.html = e.html.replace('<table ', '<table tabindex="-1" summary="' + getTableSummary(chart) + '"');
  369. }
  370. },
  371. /**
  372. * @private
  373. */
  374. focusDataTable: function () {
  375. var tableDiv = this.dataTableDiv, table = tableDiv && tableDiv.getElementsByTagName('table')[0];
  376. if (table && table.focus) {
  377. table.focus();
  378. }
  379. },
  380. /**
  381. * @private
  382. * @param {string} sonifyButtonId
  383. */
  384. initSonifyButton: function (sonifyButtonId) {
  385. var _this = this;
  386. var el = this.sonifyButton = getElement(sonifyButtonId);
  387. var chart = this.chart;
  388. var defaultHandler = function (e) {
  389. el === null || el === void 0 ? void 0 : el.setAttribute('aria-hidden', 'true');
  390. el === null || el === void 0 ? void 0 : el.setAttribute('aria-label', '');
  391. e.preventDefault();
  392. e.stopPropagation();
  393. var announceMsg = chart.langFormat('accessibility.sonification.playAsSoundClickAnnouncement', { chart: chart });
  394. _this.announcer.announce(announceMsg);
  395. setTimeout(function () {
  396. el === null || el === void 0 ? void 0 : el.removeAttribute('aria-hidden');
  397. el === null || el === void 0 ? void 0 : el.removeAttribute('aria-label');
  398. if (chart.sonify) {
  399. chart.sonify();
  400. }
  401. }, 1000); // Delay to let screen reader speak the button press
  402. };
  403. if (el && chart) {
  404. setElAttrs(el, {
  405. tabindex: '-1'
  406. });
  407. el.onclick = function (e) {
  408. var _a;
  409. var onPlayAsSoundClick = (_a = chart.options.accessibility) === null || _a === void 0 ? void 0 : _a.screenReaderSection.onPlayAsSoundClick;
  410. (onPlayAsSoundClick || defaultHandler).call(this, e, chart);
  411. };
  412. }
  413. },
  414. /**
  415. * Set attribs and handlers for default viewAsDataTable button if exists.
  416. * @private
  417. * @param {string} tableButtonId
  418. */
  419. initDataTableButton: function (tableButtonId) {
  420. var el = this.viewDataTableButton = getElement(tableButtonId), chart = this.chart, tableId = tableButtonId.replace('hc-linkto-', '');
  421. if (el) {
  422. setElAttrs(el, {
  423. tabindex: '-1',
  424. 'aria-expanded': !!getElement(tableId)
  425. });
  426. el.onclick = chart.options.accessibility
  427. .screenReaderSection.onViewDataTableClick ||
  428. function () {
  429. chart.viewData();
  430. };
  431. }
  432. },
  433. /**
  434. * Return object with text description of each of the chart's axes.
  435. * @private
  436. * @return {Highcharts.Dictionary<string>}
  437. */
  438. getAxesDescription: function () {
  439. var chart = this.chart, shouldDescribeColl = function (collectionKey, defaultCondition) {
  440. var axes = chart[collectionKey];
  441. return axes.length > 1 || axes[0] &&
  442. pick(axes[0].options.accessibility &&
  443. axes[0].options.accessibility.enabled, defaultCondition);
  444. }, hasNoMap = !!chart.types && chart.types.indexOf('map') < 0, hasCartesian = !!chart.hasCartesianSeries, showXAxes = shouldDescribeColl('xAxis', !chart.angular && hasCartesian && hasNoMap), showYAxes = shouldDescribeColl('yAxis', hasCartesian && hasNoMap), desc = {};
  445. if (showXAxes) {
  446. desc.xAxis = this.getAxisDescriptionText('xAxis');
  447. }
  448. if (showYAxes) {
  449. desc.yAxis = this.getAxisDescriptionText('yAxis');
  450. }
  451. return desc;
  452. },
  453. /**
  454. * @private
  455. * @param {string} collectionKey
  456. * @return {string}
  457. */
  458. getAxisDescriptionText: function (collectionKey) {
  459. var component = this, chart = this.chart, axes = chart[collectionKey];
  460. return chart.langFormat('accessibility.axis.' + collectionKey + 'Description' + (axes.length > 1 ? 'Plural' : 'Singular'), {
  461. chart: chart,
  462. names: axes.map(function (axis) {
  463. return getAxisDescription(axis);
  464. }),
  465. ranges: axes.map(function (axis) {
  466. return component.getAxisRangeDescription(axis);
  467. }),
  468. numAxes: axes.length
  469. });
  470. },
  471. /**
  472. * Return string with text description of the axis range.
  473. * @private
  474. * @param {Highcharts.Axis} axis The axis to get range desc of.
  475. * @return {string} A string with the range description for the axis.
  476. */
  477. getAxisRangeDescription: function (axis) {
  478. var axisOptions = axis.options || {};
  479. // Handle overridden range description
  480. if (axisOptions.accessibility &&
  481. typeof axisOptions.accessibility.rangeDescription !== 'undefined') {
  482. return axisOptions.accessibility.rangeDescription;
  483. }
  484. // Handle category axes
  485. if (axis.categories) {
  486. return this.getCategoryAxisRangeDesc(axis);
  487. }
  488. // Use time range, not from-to?
  489. if (axis.dateTime && (axis.min === 0 || axis.dataMin === 0)) {
  490. return this.getAxisTimeLengthDesc(axis);
  491. }
  492. // Just use from and to.
  493. // We have the range and the unit to use, find the desc format
  494. return this.getAxisFromToDescription(axis);
  495. },
  496. /**
  497. * @private
  498. * @param {Highcharts.Axis} axis
  499. * @return {string}
  500. */
  501. getCategoryAxisRangeDesc: function (axis) {
  502. var chart = this.chart;
  503. if (axis.dataMax && axis.dataMin) {
  504. return chart.langFormat('accessibility.axis.rangeCategories', {
  505. chart: chart,
  506. axis: axis,
  507. numCategories: axis.dataMax - axis.dataMin + 1
  508. });
  509. }
  510. return '';
  511. },
  512. /**
  513. * @private
  514. * @param {Highcharts.Axis} axis
  515. * @return {string}
  516. */
  517. getAxisTimeLengthDesc: function (axis) {
  518. var chart = this.chart, range = {}, rangeUnit = 'Seconds';
  519. range.Seconds = ((axis.max || 0) - (axis.min || 0)) / 1000;
  520. range.Minutes = range.Seconds / 60;
  521. range.Hours = range.Minutes / 60;
  522. range.Days = range.Hours / 24;
  523. ['Minutes', 'Hours', 'Days'].forEach(function (unit) {
  524. if (range[unit] > 2) {
  525. rangeUnit = unit;
  526. }
  527. });
  528. var rangeValue = range[rangeUnit].toFixed(rangeUnit !== 'Seconds' &&
  529. rangeUnit !== 'Minutes' ? 1 : 0 // Use decimals for days/hours
  530. );
  531. // We have the range and the unit to use, find the desc format
  532. return chart.langFormat('accessibility.axis.timeRange' + rangeUnit, {
  533. chart: chart,
  534. axis: axis,
  535. range: rangeValue.replace('.0', '')
  536. });
  537. },
  538. /**
  539. * @private
  540. * @param {Highcharts.Axis} axis
  541. * @return {string}
  542. */
  543. getAxisFromToDescription: function (axis) {
  544. var chart = this.chart, dateRangeFormat = chart.options.accessibility
  545. .screenReaderSection.axisRangeDateFormat, format = function (axisKey) {
  546. return axis.dateTime ? chart.time.dateFormat(dateRangeFormat, axis[axisKey]) : axis[axisKey];
  547. };
  548. return chart.langFormat('accessibility.axis.rangeFromTo', {
  549. chart: chart,
  550. axis: axis,
  551. rangeFrom: format('min'),
  552. rangeTo: format('max')
  553. });
  554. },
  555. /**
  556. * Remove component traces
  557. */
  558. destroy: function () {
  559. var _a;
  560. (_a = this.announcer) === null || _a === void 0 ? void 0 : _a.destroy();
  561. }
  562. });
  563. export default InfoRegionsComponent;