@refinitiv-ui/elements 6.10.0 → 6.10.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 +7 -0
- package/lib/slider/index.js +19 -29
- package/lib/version.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
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.10.1](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.10.0...@refinitiv-ui/elements@6.10.1) (2023-08-28)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **slider:** display and initial to value incorrectly ([#914](https://github.com/Refinitiv/refinitiv-ui/issues/914)) ([f1964db](https://github.com/Refinitiv/refinitiv-ui/commit/f1964dbb42721ca84efe4c79014b43573a289a11))
|
|
11
|
+
- **slider:** page freeze when from/to overflow max value ([#920](https://github.com/Refinitiv/refinitiv-ui/issues/920)) ([efa8314](https://github.com/Refinitiv/refinitiv-ui/commit/efa8314cda00e3a1c4d31bb24e50e46b835ba95d))
|
|
12
|
+
|
|
6
13
|
# [6.10.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.9.2...@refinitiv-ui/elements@6.10.0) (2023-08-21)
|
|
7
14
|
|
|
8
15
|
### Bug Fixes
|
package/lib/slider/index.js
CHANGED
|
@@ -445,8 +445,8 @@ let Slider = class Slider extends ControlElement {
|
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
else {
|
|
448
|
-
this.from = clamp(this.fromNumber
|
|
449
|
-
this.to = clamp(this.toNumber
|
|
448
|
+
this.from = clamp(this.fromNumber, this.minNumber, this.toNumber);
|
|
449
|
+
this.to = clamp(this.toNumber, this.fromNumber, this.maxNumber);
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
else {
|
|
@@ -966,10 +966,8 @@ let Slider = class Slider extends ControlElement {
|
|
|
966
966
|
}
|
|
967
967
|
else {
|
|
968
968
|
// if value is outside boundary, set to boundary
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
}
|
|
972
|
-
else if (this.fromNumber > this.toNumber) {
|
|
969
|
+
this.from = clamp(this.fromNumber, this.minNumber, this.maxNumber);
|
|
970
|
+
if (this.fromNumber > this.toNumber) {
|
|
973
971
|
this.from = this.to;
|
|
974
972
|
}
|
|
975
973
|
if (this.minRangeNumber) {
|
|
@@ -991,24 +989,19 @@ let Slider = class Slider extends ControlElement {
|
|
|
991
989
|
* @returns true if value and step inside a boundary
|
|
992
990
|
*/
|
|
993
991
|
isValueInBoundary(value, valueFor) {
|
|
994
|
-
if (this.minNumber
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
return false;
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
else if (value < this.minNumber || value > this.maxNumber) {
|
|
992
|
+
if (this.minNumber > this.maxNumber) {
|
|
993
|
+
return false;
|
|
994
|
+
}
|
|
995
|
+
// Check if value is in range
|
|
996
|
+
if (value < this.minNumber || value > this.maxNumber) {
|
|
997
|
+
return false;
|
|
998
|
+
}
|
|
999
|
+
if (this.range) {
|
|
1000
|
+
if (valueFor === SliderDataName.to && value < this.fromNumber + this.minRangeNumber) {
|
|
1007
1001
|
return false;
|
|
1008
1002
|
}
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
return true;
|
|
1003
|
+
else if (value > this.toNumber - this.minRangeNumber) {
|
|
1004
|
+
return false;
|
|
1012
1005
|
}
|
|
1013
1006
|
}
|
|
1014
1007
|
return true;
|
|
@@ -1023,12 +1016,10 @@ let Slider = class Slider extends ControlElement {
|
|
|
1023
1016
|
}
|
|
1024
1017
|
else {
|
|
1025
1018
|
// if value is outside boundary, set to boundary
|
|
1019
|
+
this.to = clamp(this.toNumber, this.minNumber, this.maxNumber);
|
|
1026
1020
|
if (this.toNumber < this.fromNumber) {
|
|
1027
1021
|
this.to = this.from;
|
|
1028
1022
|
}
|
|
1029
|
-
else if (this.toNumber > this.maxNumber) {
|
|
1030
|
-
this.to = this.max;
|
|
1031
|
-
}
|
|
1032
1023
|
if (this.minRangeNumber) {
|
|
1033
1024
|
const distanceFromTo = Math.abs(this.toNumber - this.fromNumber);
|
|
1034
1025
|
const distanceMax = this.fromNumber + this.minRangeNumber;
|
|
@@ -1055,9 +1046,8 @@ let Slider = class Slider extends ControlElement {
|
|
|
1055
1046
|
onMinRangeChange() {
|
|
1056
1047
|
const valueMinRange = Math.abs(this.minRangeNumber);
|
|
1057
1048
|
const maximumRangeMinMax = Math.abs(this.maxNumber - this.minNumber);
|
|
1058
|
-
const maximumRangeFromTo = Math.abs(this.toNumber - this.fromNumber);
|
|
1059
1049
|
if (valueMinRange && valueMinRange >= this.stepNumber) {
|
|
1060
|
-
if (valueMinRange <= maximumRangeMinMax
|
|
1050
|
+
if (valueMinRange <= maximumRangeMinMax) {
|
|
1061
1051
|
this.minRange = valueMinRange.toString();
|
|
1062
1052
|
}
|
|
1063
1053
|
else {
|
|
@@ -1201,8 +1191,8 @@ let Slider = class Slider extends ControlElement {
|
|
|
1201
1191
|
*/
|
|
1202
1192
|
renderThumb(from, to) {
|
|
1203
1193
|
return html `
|
|
1204
|
-
${this.thumbTemplate(from, this.calculatePosition(from), to ? SliderDataName.from : SliderDataName.value)}
|
|
1205
|
-
${to
|
|
1194
|
+
${this.thumbTemplate(from, this.calculatePosition(from), to !== undefined ? SliderDataName.from : SliderDataName.value)}
|
|
1195
|
+
${to !== undefined ? this.thumbTemplate(to, this.calculatePosition(to), SliderDataName.to) : nothing}
|
|
1206
1196
|
`;
|
|
1207
1197
|
}
|
|
1208
1198
|
/**
|
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '6.10.
|
|
1
|
+
export const VERSION = '6.10.1';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refinitiv-ui/elements",
|
|
3
|
-
"version": "6.10.
|
|
3
|
+
"version": "6.10.1",
|
|
4
4
|
"description": "Element Framework Elements",
|
|
5
5
|
"author": "Refinitiv",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -369,5 +369,5 @@
|
|
|
369
369
|
"publishConfig": {
|
|
370
370
|
"access": "public"
|
|
371
371
|
},
|
|
372
|
-
"gitHead": "
|
|
372
|
+
"gitHead": "14f4b70dbd8dc19e883d3b646981bf5f43724e20"
|
|
373
373
|
}
|