@refinitiv-ui/elements 6.0.4 → 6.1.0

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [6.1.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.0.4...@refinitiv-ui/elements@6.1.0) (2022-08-16)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **datetime-picker:** parse invalid value to date object ([#422](https://github.com/Refinitiv/refinitiv-ui/issues/422)) ([dd86b73](https://github.com/Refinitiv/refinitiv-ui/commit/dd86b73fecd03518d2dae78174b91b0ef50fc913))
12
+ * **overlay:** Tab does not work with slotted elements ([16f4b60](https://github.com/Refinitiv/refinitiv-ui/commit/16f4b60e9b840d3b7d225f3d61f15e017dc17855))
13
+ * **radio-button:** check-changed is not fired on arrow keys ([77d7407](https://github.com/Refinitiv/refinitiv-ui/commit/77d7407883ba77e7b07bdaa8483fc49d35c76c14))
14
+
15
+
16
+ ### Features
17
+
18
+ * **interactive-chart:** add disabledLegend option to hide data legend ([#421](https://github.com/Refinitiv/refinitiv-ui/issues/421)) ([32a6d7b](https://github.com/Refinitiv/refinitiv-ui/commit/32a6d7b1889597a7ae804edbb08fc95fc5c5a04e))
19
+
20
+
21
+
22
+
23
+
6
24
  ## [6.0.4](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.0.3...@refinitiv-ui/elements@6.0.4) (2022-08-02)
7
25
 
8
26
 
@@ -175,7 +175,7 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
175
175
  cursor: pointer;
176
176
  }
177
177
  :host([popup-disabled]) [part=icon], :host([readonly]) [part=icon] {
178
- pointer-event: none;
178
+ pointer-events: none;
179
179
  }
180
180
  `;
181
181
  }
@@ -841,12 +841,17 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
841
841
  */
842
842
  isValueWithinMinMax() {
843
843
  if (this.min || this.max) {
844
- const minTime = this.min ? parse(this.min).getTime() : -Infinity;
845
- const maxTime = this.max ? parse(this.max).getTime() : Infinity;
846
844
  for (let i = 0; i < this.values.length; i += 1) {
847
- const valueTime = parse(this.values[i]).getTime();
848
- if (minTime > valueTime || maxTime < valueTime) {
849
- return false;
845
+ const value = this.values[i];
846
+ if (value) {
847
+ // Value before min
848
+ if (this.min && value !== this.min && isBefore(value, this.min)) {
849
+ return false;
850
+ }
851
+ // Value after max
852
+ if (this.max && value !== this.max && isAfter(value, this.max)) {
853
+ return false;
854
+ }
850
855
  }
851
856
  }
852
857
  }
@@ -38,6 +38,7 @@ interface InteractiveChartSeries {
38
38
  type: string;
39
39
  symbol?: string;
40
40
  symbolName?: string;
41
+ legendVisible?: boolean;
41
42
  legendPriceFormatter?: (price: string | number) => string | number;
42
43
  data: SeriesData;
43
44
  seriesOptions?: SeriesPartialOptions<SeriesOptions>;
@@ -12,7 +12,6 @@ import { LegendStyle } from './helpers/types.js';
12
12
  import { merge } from './helpers/merge.js';
13
13
  const NOT_AVAILABLE_DATA = 'N/A';
14
14
  const NO_DATA_POINT = '--';
15
- const HIDE_DATA_POINT = '';
16
15
  /**
17
16
  * A charting component that allows you to create several use cases of financial chart.
18
17
  * By lightweight-charts library.
@@ -633,11 +632,12 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
633
632
  const chartType = this.internalConfig.series[idx].type;
634
633
  const dataSet = this.internalConfig.series[idx].data || [];
635
634
  const symbol = (this.internalConfig.series[idx].symbolName || this.internalConfig.series[idx].symbol) || '';
635
+ const isLegendVisible = this.internalConfig.series[idx].legendVisible !== false;
636
636
  // Create row legend element
637
637
  if (!rowLegend) {
638
638
  rowLegendElem = document.createElement('div');
639
639
  rowLegendElem.setAttribute('class', 'row');
640
- this.createTextSymbol(rowLegendElem, symbol);
640
+ isLegendVisible && this.createTextSymbol(rowLegendElem, symbol);
641
641
  if (dataSet.length) {
642
642
  this.hasDataPoint = true;
643
643
  const lastData = dataSet[dataSet.length - 1];
@@ -669,7 +669,7 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
669
669
  }
670
670
  // when there's no data point in the series object.
671
671
  else if (!eventMove?.seriesPrices.get(this.seriesList[idx]) && eventMove?.time) {
672
- value = symbol ? NO_DATA_POINT : HIDE_DATA_POINT;
672
+ value = NO_DATA_POINT;
673
673
  this.isCrosshairVisible = true;
674
674
  this.hasDataPoint = false;
675
675
  }
@@ -698,8 +698,9 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
698
698
  * @returns {void}
699
699
  */
700
700
  renderTextLegend(chartType, rowLegendElem, value, priceColor, index) {
701
+ const isLegendVisible = this.internalConfig.series[index].legendVisible !== false;
701
702
  // No need to render if disable legend
702
- if (this.disabledLegend) {
703
+ if (this.disabledLegend || !isLegendVisible) {
703
704
  return;
704
705
  }
705
706
  if (chartType === 'bar' || chartType === 'candlestick') {
@@ -764,7 +765,7 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
764
765
  /**
765
766
  * Create a new span OHLC after displaying (--) or (N/A)
766
767
  */
767
- if (spanElem.textContent === NOT_AVAILABLE_DATA || spanElem.textContent === NO_DATA_POINT || spanElem.textContent === HIDE_DATA_POINT) {
768
+ if (spanElem.textContent === NOT_AVAILABLE_DATA || spanElem.textContent === NO_DATA_POINT) {
768
769
  rowLegend[index].removeChild(spanElem);
769
770
  this.createSpanOHLC(rowLegend[index], rowData, priceColor);
770
771
  }
@@ -801,7 +802,7 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
801
802
  createTextPrice(rowLegend, price, priceColor, index) {
802
803
  const formatter = this.internalConfig.series[index].legendPriceFormatter;
803
804
  // Formats legend only when formatter and data point are provided
804
- const formattedPrice = !!formatter && price !== NO_DATA_POINT && price !== HIDE_DATA_POINT ? formatter(price) : price;
805
+ const formattedPrice = !!formatter && price !== NO_DATA_POINT ? formatter(price) : price;
805
806
  // Create text price after chart has rendered
806
807
  if (rowLegend instanceof HTMLElement) {
807
808
  rowLegend.setAttribute('data-color', priceColor);
@@ -126,13 +126,13 @@ export class FocusManager {
126
126
  }
127
127
  isFocusBoundaryDescendant(element) {
128
128
  const focusBoundaryElements = this.focusBoundaryElements;
129
- let node = element.parentNode;
129
+ let node = element.assignedSlot || element.parentNode;
130
130
  while (node) {
131
131
  if ((node instanceof HTMLElement || node instanceof ShadowRoot) && focusBoundaryElements.includes(node)) {
132
132
  return true;
133
133
  }
134
134
  // parenNode is not defined if the node is inside document fragment. Use host instead
135
- node = node.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? node.host : node.parentNode;
135
+ node = node.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? node.host : (node.assignedSlot || node.parentNode);
136
136
  }
137
137
  return false;
138
138
  }
@@ -216,9 +216,9 @@ let RadioButton = class RadioButton extends ControlElement {
216
216
  if (!element) {
217
217
  element = direction === 'next' ? group[0] : group[group.length - 1];
218
218
  }
219
- if (!element.readonly) {
220
- this.checked = false;
219
+ if (!element.readonly && element !== this && !element.checked) {
221
220
  element.checked = true;
221
+ element.notifyPropertyChange('checked', element.checked);
222
222
  }
223
223
  element.focus();
224
224
  }
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '6.0.4';
1
+ export const VERSION = '6.1.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refinitiv-ui/elements",
3
- "version": "6.0.4",
3
+ "version": "6.1.0",
4
4
  "description": "Element Framework Elements",
5
5
  "author": "Refinitiv",
6
6
  "license": "Apache-2.0",
@@ -338,24 +338,24 @@
338
338
  "tslib": "^2.3.1"
339
339
  },
340
340
  "devDependencies": {
341
- "@refinitiv-ui/core": "^6.0.3",
342
- "@refinitiv-ui/demo-block": "^6.0.4",
341
+ "@refinitiv-ui/core": "^6.0.4",
342
+ "@refinitiv-ui/demo-block": "^6.0.5",
343
343
  "@refinitiv-ui/i18n": "^6.0.3",
344
344
  "@refinitiv-ui/phrasebook": "^6.1.2",
345
345
  "@refinitiv-ui/test-helpers": "^6.0.3",
346
- "@refinitiv-ui/translate": "^6.0.3",
346
+ "@refinitiv-ui/translate": "^6.0.4",
347
347
  "@refinitiv-ui/utils": "^6.0.3",
348
348
  "@types/d3-interpolate": "^3.0.1"
349
349
  },
350
350
  "peerDependencies": {
351
- "@refinitiv-ui/core": "^6.0.3",
351
+ "@refinitiv-ui/core": "^6.0.4",
352
352
  "@refinitiv-ui/i18n": "^6.0.3",
353
353
  "@refinitiv-ui/phrasebook": "^6.1.2",
354
- "@refinitiv-ui/translate": "^6.0.3",
354
+ "@refinitiv-ui/translate": "^6.0.4",
355
355
  "@refinitiv-ui/utils": "^6.0.3"
356
356
  },
357
357
  "publishConfig": {
358
358
  "access": "public"
359
359
  },
360
- "gitHead": "489b81e6e87d65a6b44b5960a9a5da795518b4ce"
360
+ "gitHead": "155cbde4c14e5d365bd8af2daf3c4eea3e481b19"
361
361
  }