@refinitiv-ui/elements 7.1.0 → 7.2.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.
- package/CHANGELOG.md +21 -0
- package/lib/chart/elements/chart.js +1 -2
- package/lib/heatmap/helpers/types.d.ts +10 -10
- package/lib/heatmap/index.js +55 -26
- package/lib/interactive-chart/custom-elements.json +5 -0
- package/lib/interactive-chart/custom-elements.md +1 -0
- package/lib/interactive-chart/index.d.ts +5 -1
- package/lib/interactive-chart/index.js +21 -30
- package/lib/notification/helpers/status.d.ts +4 -4
- package/lib/notification/helpers/status.js +2 -2
- package/lib/notification/helpers/types.d.ts +1 -1
- package/lib/number-field/index.d.ts +1 -0
- package/lib/number-field/index.js +2 -0
- package/lib/tooltip/helpers/renderer.d.ts +1 -1
- package/lib/tooltip/helpers/renderer.js +3 -3
- package/lib/version.js +1 -1
- package/package.json +2 -2
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
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
|
+
## [7.2.1](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.2.0...@refinitiv-ui/elements@7.2.1) (2023-08-07)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **chart:** use single color on bar and bubble chart ([#882](https://github.com/Refinitiv/refinitiv-ui/issues/882)) ([3adb28d](https://github.com/Refinitiv/refinitiv-ui/commit/3adb28def9dd2e5a2e9ab8be5c36f9384251dc45))
|
|
11
|
+
- **interactive-chart:** replace priceScale config with left and right priceScale due to api changed ([#875](https://github.com/Refinitiv/refinitiv-ui/issues/875)) ([a3310c1](https://github.com/Refinitiv/refinitiv-ui/commit/a3310c14a2f84f51b655ea3591f24084fca6e849))
|
|
12
|
+
- **interactive-chart:** wrong legend color on candlestick chart ([#874](https://github.com/Refinitiv/refinitiv-ui/issues/874)) ([710f8e9](https://github.com/Refinitiv/refinitiv-ui/commit/710f8e96bc27bc6715c038b20fd25c38f37287ee))
|
|
13
|
+
- **notification:** `info`, `confirm`, `warn`, `error` duration should be optional ([#873](https://github.com/Refinitiv/refinitiv-ui/issues/873)) ([207808c](https://github.com/Refinitiv/refinitiv-ui/commit/207808cd2191bec53cdaa03becf60a1a8e3bfe14))
|
|
14
|
+
|
|
15
|
+
# [7.2.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.1.0...@refinitiv-ui/elements@7.2.0) (2023-07-31)
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
- **heatmap:** `HeatmapCell` properties other than `value` should be optional ([#866](https://github.com/Refinitiv/refinitiv-ui/issues/866)) ([c27d3d6](https://github.com/Refinitiv/refinitiv-ui/commit/c27d3d6a004f897a0d8c037899514c9fe154a21c))
|
|
20
|
+
- **number-field:** add aria-valuetext to prevent VO announce % ([e127ccb](https://github.com/Refinitiv/refinitiv-ui/commit/e127ccb403f2dc1795f25a24f41ac293f701647e))
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
- **interactive-chart:** change chart instance access modifier to public ([88ed541](https://github.com/Refinitiv/refinitiv-ui/commit/88ed541212f494877678213f9d8a68c0c8fa0b2c))
|
|
25
|
+
- **tooltip:** add data-tooltip alias for tooltip attribute ([#859](https://github.com/Refinitiv/refinitiv-ui/issues/859)) ([3d2a333](https://github.com/Refinitiv/refinitiv-ui/commit/3d2a333f28afacbac353d344beae5fa6c52f61db))
|
|
26
|
+
|
|
6
27
|
# [7.1.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.0.2...@refinitiv-ui/elements@7.1.0) (2023-07-25)
|
|
7
28
|
|
|
8
29
|
### Bug Fixes
|
|
@@ -98,10 +98,9 @@ let Chart = class Chart extends BasicElement {
|
|
|
98
98
|
merge(dataset.backgroundColor, backgroundColor);
|
|
99
99
|
}
|
|
100
100
|
break;
|
|
101
|
-
// These types, Colors could be string or array
|
|
102
101
|
case 'bar':
|
|
103
102
|
case 'bubble':
|
|
104
|
-
colors = this.generateColors(
|
|
103
|
+
colors = this.generateColors(false, 1, datasetIndex);
|
|
105
104
|
borderColor = colors.solid;
|
|
106
105
|
backgroundColor = this.config?.type === 'bubble' ? colors.opaque : colors.solid;
|
|
107
106
|
if (!dataset.borderColor) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type HeatmapConfig = {
|
|
2
|
-
data:
|
|
2
|
+
data: HeatmapCell[][];
|
|
3
3
|
yAxis?: HeatmapYAxis;
|
|
4
4
|
xAxis?: HeatmapXAxis;
|
|
5
5
|
};
|
|
@@ -13,18 +13,18 @@ type HeatmapYAxis = {
|
|
|
13
13
|
position: 'left' | 'right';
|
|
14
14
|
};
|
|
15
15
|
type HeatmapCell = {
|
|
16
|
-
rowIndex
|
|
17
|
-
colIndex
|
|
18
|
-
x
|
|
19
|
-
y
|
|
20
|
-
width
|
|
21
|
-
height
|
|
16
|
+
rowIndex?: number;
|
|
17
|
+
colIndex?: number;
|
|
18
|
+
x?: number;
|
|
19
|
+
y?: number;
|
|
20
|
+
width?: number;
|
|
21
|
+
height?: number;
|
|
22
22
|
value: number | null;
|
|
23
23
|
header?: string;
|
|
24
24
|
label?: string;
|
|
25
|
-
foregroundColor
|
|
26
|
-
defaultBackground
|
|
27
|
-
backgroundColor
|
|
25
|
+
foregroundColor?: string;
|
|
26
|
+
defaultBackground?: string;
|
|
27
|
+
backgroundColor?: string;
|
|
28
28
|
animationFrame?: number;
|
|
29
29
|
customLabel?: string;
|
|
30
30
|
customBackgroundColor?: string;
|
package/lib/heatmap/index.js
CHANGED
|
@@ -318,15 +318,13 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
318
318
|
*/
|
|
319
319
|
onResize() {
|
|
320
320
|
this.updateTimer = 0;
|
|
321
|
-
if (!this.isSizeCalculated) {
|
|
322
|
-
if (this.offsetWidth || this.offsetHeight) {
|
|
323
|
-
this.isSizeCalculated = true;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
321
|
if (this.isSizeCalculated) {
|
|
327
322
|
const spacing = parseFloat(this.getComputedVariable('--spacing', '0'));
|
|
328
323
|
this.cellMargin = spacing / 2;
|
|
329
324
|
}
|
|
325
|
+
else {
|
|
326
|
+
this.isSizeCalculated = Boolean(this.offsetWidth || this.offsetHeight);
|
|
327
|
+
}
|
|
330
328
|
// calculate responsive height
|
|
331
329
|
if (this.responsiveHeight || !this.offsetHeight) {
|
|
332
330
|
const width = this.offsetWidth;
|
|
@@ -397,12 +395,17 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
397
395
|
*/
|
|
398
396
|
/* c8 ignore start */
|
|
399
397
|
updateTooltipOverlayPosition(cell) {
|
|
398
|
+
if (cell.x === undefined ||
|
|
399
|
+
cell.y === undefined ||
|
|
400
|
+
cell.width === undefined ||
|
|
401
|
+
cell.height === undefined) {
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
400
404
|
// Compensate x-axis height for overlay when x-axis is at top position
|
|
401
405
|
let marginOverlayTop = 0;
|
|
402
406
|
if (this.config?.xAxis && this.xAxis?.offsetHeight) {
|
|
403
407
|
marginOverlayTop = this.config.xAxis.position === 'bottom' ? 0 : this.xAxis?.offsetHeight;
|
|
404
408
|
}
|
|
405
|
-
// Update overlay position
|
|
406
409
|
this.tooltipOverlay.style.left = `${cell.x}px`;
|
|
407
410
|
this.tooltipOverlay.style.top = `${cell.y + marginOverlayTop}px`;
|
|
408
411
|
this.tooltipOverlay.style.width = `${cell.width}px`;
|
|
@@ -417,7 +420,7 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
417
420
|
*/
|
|
418
421
|
/* c8 ignore start */
|
|
419
422
|
hoverCellChanged(cell, previousCell) {
|
|
420
|
-
if (cell && cell.value !== null) {
|
|
423
|
+
if (cell && cell.value !== null && cell.backgroundColor) {
|
|
421
424
|
if (this.tooltipCallback) {
|
|
422
425
|
this.updateTooltipOverlayPosition(cell);
|
|
423
426
|
}
|
|
@@ -427,7 +430,7 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
427
430
|
this.fade(cell, cell.backgroundColor, fadedColor, 100);
|
|
428
431
|
}
|
|
429
432
|
// returns color of previous cell to default cell color
|
|
430
|
-
if (previousCell && previousCell.value !== null) {
|
|
433
|
+
if (previousCell && previousCell.value !== null && previousCell.backgroundColor) {
|
|
431
434
|
previousCell.foregroundColor = this.foregroundColor;
|
|
432
435
|
this.fade(previousCell, previousCell.backgroundColor, this.getBackgroundColor(previousCell.value), 300);
|
|
433
436
|
}
|
|
@@ -487,6 +490,12 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
487
490
|
*/
|
|
488
491
|
/* c8 ignore start */
|
|
489
492
|
resetCell(cell) {
|
|
493
|
+
if (cell.x === undefined ||
|
|
494
|
+
cell.y === undefined ||
|
|
495
|
+
cell.width === undefined ||
|
|
496
|
+
cell.height === undefined) {
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
490
499
|
this.canvasContext?.clearRect(cell.x, cell.y, cell.width, cell.height);
|
|
491
500
|
}
|
|
492
501
|
/* c8 ignore stop */
|
|
@@ -504,6 +513,9 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
504
513
|
const start = performance.now();
|
|
505
514
|
const end = start + duration;
|
|
506
515
|
const fadingAnimation = (time) => {
|
|
516
|
+
if (cell.colIndex === undefined || cell.rowIndex === undefined) {
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
507
519
|
cell.x = this.colTrack.getContentStart(cell.colIndex);
|
|
508
520
|
cell.y = this.rowTrack.getContentStart(cell.rowIndex);
|
|
509
521
|
cell.width = this.colTrack.getContentSize(cell.colIndex);
|
|
@@ -641,12 +653,18 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
641
653
|
* @returns {void}
|
|
642
654
|
*/
|
|
643
655
|
paintLabel(cell) {
|
|
656
|
+
if (!this.canvasContext ||
|
|
657
|
+
cell.x === undefined ||
|
|
658
|
+
cell.y === undefined ||
|
|
659
|
+
cell.width === undefined ||
|
|
660
|
+
cell.height === undefined ||
|
|
661
|
+
cell.foregroundColor === undefined) {
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
644
664
|
const margin = cell.header ? this.calculateHeaderMargin(cell.height) : 0;
|
|
645
665
|
const label = typeof cell.customLabel === 'string' ? cell.customLabel : cell.label;
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
this.canvasContext.fillText(label || '', cell.x + cell.width / 2, cell.y + 1 + cell.height / 2 + margin);
|
|
649
|
-
}
|
|
666
|
+
this.canvasContext.fillStyle = cell.customForegroundColor || cell.foregroundColor;
|
|
667
|
+
this.canvasContext.fillText(label || '', cell.x + cell.width / 2, cell.y + 1 + cell.height / 2 + margin);
|
|
650
668
|
}
|
|
651
669
|
/**
|
|
652
670
|
* Check if the text (label / header and label) can be paint on the cell
|
|
@@ -796,15 +814,21 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
796
814
|
* @returns {void}
|
|
797
815
|
*/
|
|
798
816
|
paintHeader(cell) {
|
|
799
|
-
if (this.canvasContext
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
this.canvasContext.font = labelFontStyle;
|
|
817
|
+
if (!this.canvasContext ||
|
|
818
|
+
cell.x === undefined ||
|
|
819
|
+
cell.y === undefined ||
|
|
820
|
+
cell.width === undefined ||
|
|
821
|
+
cell.height === undefined ||
|
|
822
|
+
cell.foregroundColor === undefined) {
|
|
823
|
+
return;
|
|
807
824
|
}
|
|
825
|
+
const labelFontStyle = this.canvasContext.font;
|
|
826
|
+
const margin = this.labelHidden ? 0 : this.calculateHeaderMargin(cell.height);
|
|
827
|
+
this.canvasContext.font = 'bold ' + labelFontStyle;
|
|
828
|
+
this.canvasContext.fillStyle = cell.customForegroundColor || cell.foregroundColor;
|
|
829
|
+
this.canvasContext.fillText(cell.header || '', cell.x + cell.width / 2, cell.y + 1 + cell.height / 2 - margin);
|
|
830
|
+
// Reverts font style to paint label correctly
|
|
831
|
+
this.canvasContext.font = labelFontStyle;
|
|
808
832
|
}
|
|
809
833
|
/**
|
|
810
834
|
* Paints header to all cells
|
|
@@ -847,10 +871,16 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
847
871
|
* @returns {void}
|
|
848
872
|
*/
|
|
849
873
|
paintCellBackground(cell) {
|
|
850
|
-
if (this.canvasContext
|
|
851
|
-
|
|
852
|
-
|
|
874
|
+
if (!this.canvasContext ||
|
|
875
|
+
cell.x === undefined ||
|
|
876
|
+
cell.y === undefined ||
|
|
877
|
+
cell.width === undefined ||
|
|
878
|
+
cell.height === undefined ||
|
|
879
|
+
cell.backgroundColor === undefined) {
|
|
880
|
+
return;
|
|
853
881
|
}
|
|
882
|
+
this.canvasContext.fillStyle = cell.customBackgroundColor || cell.backgroundColor;
|
|
883
|
+
this.canvasContext.fillRect(cell.x, cell.y, cell.width, cell.height);
|
|
854
884
|
}
|
|
855
885
|
/**
|
|
856
886
|
* Construct and renders x-axis
|
|
@@ -1011,7 +1041,6 @@ let Heatmap = class Heatmap extends ResponsiveElement {
|
|
|
1011
1041
|
if (this.hoverCell && this.canvasContext && this.tooltipCallback) {
|
|
1012
1042
|
return this.tooltipCallback(this.hoverCell);
|
|
1013
1043
|
}
|
|
1014
|
-
return undefined;
|
|
1015
1044
|
}
|
|
1016
1045
|
/* c8 ignore stop */
|
|
1017
1046
|
/**
|
|
@@ -1084,10 +1113,10 @@ __decorate([
|
|
|
1084
1113
|
property({ type: Number })
|
|
1085
1114
|
], Heatmap.prototype, "saturation", void 0);
|
|
1086
1115
|
__decorate([
|
|
1087
|
-
property({
|
|
1116
|
+
property({ attribute: false })
|
|
1088
1117
|
], Heatmap.prototype, "tooltipCallback", void 0);
|
|
1089
1118
|
__decorate([
|
|
1090
|
-
property({
|
|
1119
|
+
property({ attribute: false })
|
|
1091
1120
|
], Heatmap.prototype, "renderCallback", void 0);
|
|
1092
1121
|
__decorate([
|
|
1093
1122
|
query('[part=canvas]', true)
|
|
@@ -56,6 +56,11 @@
|
|
|
56
56
|
"description": "Set legend style i.e. `horizontal`, `vertical`.",
|
|
57
57
|
"type": "\"vertical\" | \"horizontal\"",
|
|
58
58
|
"default": "\"vertical\""
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "chart",
|
|
62
|
+
"description": "lightweight-charts object",
|
|
63
|
+
"type": "IChartApi | null"
|
|
59
64
|
}
|
|
60
65
|
],
|
|
61
66
|
"events": [
|
|
@@ -7,6 +7,7 @@ By lightweight-charts library.
|
|
|
7
7
|
|
|
8
8
|
| Property | Attribute | Type | Default | Description |
|
|
9
9
|
|----------------------|------------------------|------------------------------|------------|-------------------------------------------------|
|
|
10
|
+
| `chart` | | `IChartApi \| null` | null | lightweight-charts object |
|
|
10
11
|
| `config` | `config` | `InteractiveChartConfig` | null | Chart configurations for init chart |
|
|
11
12
|
| `disabledJumpButton` | `disabled-jump-button` | `boolean` | false | Hide jump to latest data button |
|
|
12
13
|
| `disabledLegend` | `disabled-legend` | `boolean` | false | Hide legend |
|
|
@@ -49,10 +49,14 @@ export declare class InteractiveChart extends ResponsiveElement {
|
|
|
49
49
|
* Array of series instances in chart
|
|
50
50
|
*/
|
|
51
51
|
seriesList: SeriesList[];
|
|
52
|
+
/**
|
|
53
|
+
* lightweight-charts object
|
|
54
|
+
* @type {IChartApi | null}
|
|
55
|
+
*/
|
|
56
|
+
chart: IChartApi | null;
|
|
52
57
|
private jumpButtonInitialized;
|
|
53
58
|
private legendInitialized;
|
|
54
59
|
private isCrosshairVisible;
|
|
55
|
-
protected chart: IChartApi | null;
|
|
56
60
|
protected rowLegend: RowLegend;
|
|
57
61
|
private timeScale;
|
|
58
62
|
private width;
|
|
@@ -39,10 +39,14 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
39
39
|
* Array of series instances in chart
|
|
40
40
|
*/
|
|
41
41
|
this.seriesList = [];
|
|
42
|
+
/**
|
|
43
|
+
* lightweight-charts object
|
|
44
|
+
* @type {IChartApi | null}
|
|
45
|
+
*/
|
|
46
|
+
this.chart = null;
|
|
42
47
|
this.jumpButtonInitialized = false;
|
|
43
48
|
this.legendInitialized = false;
|
|
44
49
|
this.isCrosshairVisible = false;
|
|
45
|
-
this.chart = null;
|
|
46
50
|
this.rowLegend = null;
|
|
47
51
|
this.timeScale = null;
|
|
48
52
|
this.width = 0;
|
|
@@ -514,7 +518,10 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
514
518
|
textColor: this.theme.textColor,
|
|
515
519
|
fontFamily: defaultFontFamily
|
|
516
520
|
},
|
|
517
|
-
|
|
521
|
+
leftPriceScale: {
|
|
522
|
+
borderColor: this.theme.scalePriceBorderColor
|
|
523
|
+
},
|
|
524
|
+
rightPriceScale: {
|
|
518
525
|
borderColor: this.theme.scalePriceBorderColor
|
|
519
526
|
},
|
|
520
527
|
timeScale: {
|
|
@@ -903,9 +910,11 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
903
910
|
return this.getLegendPriceColor(this.seriesList[index].options().color);
|
|
904
911
|
}
|
|
905
912
|
else if (chartType === 'candlestick') {
|
|
906
|
-
const
|
|
913
|
+
const priceValue = seriesData.hasOwnProperty('seriesData')
|
|
914
|
+
? seriesData.seriesData.get(this.seriesList[index])
|
|
915
|
+
: seriesData;
|
|
907
916
|
const barStyle = this.seriesList[index].options();
|
|
908
|
-
const colorBar = close > open ? barStyle.borderUpColor : barStyle.borderDownColor;
|
|
917
|
+
const colorBar = priceValue.close > priceValue.open ? barStyle.borderUpColor : barStyle.borderDownColor;
|
|
909
918
|
return colorBar;
|
|
910
919
|
}
|
|
911
920
|
else if (chartType === 'bar') {
|
|
@@ -915,35 +924,17 @@ let InteractiveChart = InteractiveChart_1 = class InteractiveChart extends Respo
|
|
|
915
924
|
return this.getLegendPriceColor(this.seriesList[index].options().lineColor);
|
|
916
925
|
}
|
|
917
926
|
else if (chartType === 'volume') {
|
|
918
|
-
const
|
|
927
|
+
const dataItem = seriesData.hasOwnProperty('seriesData')
|
|
919
928
|
? seriesData.seriesData.get(this.seriesList[index])
|
|
920
|
-
: seriesData
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
const timeSeriesData = seriesData.time;
|
|
926
|
-
// if via time point data string format 'yyyy-mm-dd' or object '{ year: 2019, month: 6, day: 1 }'
|
|
927
|
-
if (time.hasOwnProperty('day') && time.hasOwnProperty('month') && time.hasOwnProperty('year')) {
|
|
928
|
-
if (time.day === timeSeriesData.day &&
|
|
929
|
-
time.month === timeSeriesData.month &&
|
|
930
|
-
time.year === timeSeriesData.year &&
|
|
931
|
-
data.value === priceValue) {
|
|
932
|
-
dataItem = dataConfig;
|
|
933
|
-
}
|
|
929
|
+
: seriesData;
|
|
930
|
+
// check when each color is added, the item comes from the configuration
|
|
931
|
+
if (dataItem) {
|
|
932
|
+
if (dataItem.hasOwnProperty('color')) {
|
|
933
|
+
return this.getLegendPriceColor(dataItem.color);
|
|
934
934
|
}
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
dataItem = data;
|
|
935
|
+
else {
|
|
936
|
+
return this.getLegendPriceColor(this.seriesList[index].options().color);
|
|
938
937
|
}
|
|
939
|
-
});
|
|
940
|
-
// check when each color is added, the item comes from the configuration
|
|
941
|
-
if (dataItem.hasOwnProperty('color')) {
|
|
942
|
-
const data = dataItem;
|
|
943
|
-
return this.getLegendPriceColor(data.color);
|
|
944
|
-
}
|
|
945
|
-
else {
|
|
946
|
-
return this.getLegendPriceColor(this.seriesList[index].options().color);
|
|
947
938
|
}
|
|
948
939
|
}
|
|
949
940
|
return '';
|
|
@@ -5,26 +5,26 @@ import type { Notification } from '../elements/notification';
|
|
|
5
5
|
* @param duration Duration the notification should be displayed for.
|
|
6
6
|
* @returns instance of the `Notification`.
|
|
7
7
|
*/
|
|
8
|
-
declare const info: (message: string, duration
|
|
8
|
+
declare const info: (message: string, duration?: number) => Notification;
|
|
9
9
|
/**
|
|
10
10
|
* Show a confirmation notification
|
|
11
11
|
* @param message Message to show in the notification.
|
|
12
12
|
* @param duration Duration the notification should be displayed for.
|
|
13
13
|
* @returns instance of the `Notification`.
|
|
14
14
|
*/
|
|
15
|
-
declare const confirm: (message: string, duration
|
|
15
|
+
declare const confirm: (message: string, duration?: number) => Notification;
|
|
16
16
|
/**
|
|
17
17
|
* Show a warning notification
|
|
18
18
|
* @param message Message to show in the notification.
|
|
19
19
|
* @param duration Duration the notification should be displayed for.
|
|
20
20
|
* @returns instance of the `Notification`.
|
|
21
21
|
*/
|
|
22
|
-
declare const warn: (message: string, duration
|
|
22
|
+
declare const warn: (message: string, duration?: number) => Notification;
|
|
23
23
|
/**
|
|
24
24
|
* Show an error notification
|
|
25
25
|
* @param message Message to show in the notification.
|
|
26
26
|
* @param duration Duration the notification should be displayed for.
|
|
27
27
|
* @returns instance of the `Notification`.
|
|
28
28
|
*/
|
|
29
|
-
declare const error: (message: string, duration
|
|
29
|
+
declare const error: (message: string, duration?: number) => Notification;
|
|
30
30
|
export { info, confirm, warn, error };
|
|
@@ -123,8 +123,8 @@ const error = (message, duration) => {
|
|
|
123
123
|
};
|
|
124
124
|
if (DEV_ENV) {
|
|
125
125
|
// Show application errors, in development mode
|
|
126
|
-
window.addEventListener('error', (
|
|
127
|
-
error(
|
|
126
|
+
window.addEventListener('error', (event) => {
|
|
127
|
+
error(event.message, 1000);
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
export { info, confirm, warn, error };
|
|
@@ -315,6 +315,7 @@ export declare class NumberField extends FormFieldElement {
|
|
|
315
315
|
* inputmode="decimal" - show decimals keyboard by default
|
|
316
316
|
* role="spinbutton" - number field is actually a spinner
|
|
317
317
|
* aria-valuenow - current value or 0
|
|
318
|
+
* aria-valuetext - current value or 0, need this to improve user-friendly and human-understandable when screen reader announce value
|
|
318
319
|
* @keydown - Listener for `keydown` event. Runs `this.onInputKeyDown`
|
|
319
320
|
* @beforeinput - Listener for `beforeinput` event. Runs `this.onBeforeInputChange`
|
|
320
321
|
* @returns template map
|
|
@@ -724,6 +724,7 @@ let NumberField = class NumberField extends FormFieldElement {
|
|
|
724
724
|
* inputmode="decimal" - show decimals keyboard by default
|
|
725
725
|
* role="spinbutton" - number field is actually a spinner
|
|
726
726
|
* aria-valuenow - current value or 0
|
|
727
|
+
* aria-valuetext - current value or 0, need this to improve user-friendly and human-understandable when screen reader announce value
|
|
727
728
|
* @keydown - Listener for `keydown` event. Runs `this.onInputKeyDown`
|
|
728
729
|
* @beforeinput - Listener for `beforeinput` event. Runs `this.onBeforeInputChange`
|
|
729
730
|
* @returns template map
|
|
@@ -736,6 +737,7 @@ let NumberField = class NumberField extends FormFieldElement {
|
|
|
736
737
|
inputmode: 'decimal',
|
|
737
738
|
role: 'spinbutton',
|
|
738
739
|
'aria-valuenow': `${this.value || 0}`,
|
|
740
|
+
'aria-valuetext': `${this.value || 0}`,
|
|
739
741
|
'@keydown': this.onInputKeyDown,
|
|
740
742
|
'@beforeinput': this.onBeforeInputChange
|
|
741
743
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A default renderer that renders `tooltip`
|
|
2
|
+
* A default renderer that renders `tooltip` or `data-tooltip` attributes
|
|
3
3
|
* @param target Target to check
|
|
4
4
|
* @returns tooltip or null or undefined
|
|
5
5
|
*/
|
|
6
6
|
const tooltipRenderer = (target) => {
|
|
7
|
-
if (target.hasAttribute('tooltip')) {
|
|
8
|
-
return target.getAttribute('tooltip');
|
|
7
|
+
if (target.hasAttribute('tooltip') || target.hasAttribute('data-tooltip')) {
|
|
8
|
+
return target.getAttribute('tooltip') || target.getAttribute('data-tooltip');
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
11
|
export { tooltipRenderer };
|
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '7.1
|
|
1
|
+
export const VERSION = '7.2.1';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refinitiv-ui/elements",
|
|
3
|
-
"version": "7.1
|
|
3
|
+
"version": "7.2.1",
|
|
4
4
|
"description": "Element Framework Elements",
|
|
5
5
|
"author": "Refinitiv",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -371,5 +371,5 @@
|
|
|
371
371
|
"publishConfig": {
|
|
372
372
|
"access": "public"
|
|
373
373
|
},
|
|
374
|
-
"gitHead": "
|
|
374
|
+
"gitHead": "33b12ffdedd23320fbdb8d2c8537cf1a316abcca"
|
|
375
375
|
}
|