intelicoreact 1.2.37 → 1.2.38

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.
@@ -53,6 +53,12 @@ var _Object$freeze2 = Object.freeze({
53
53
  ASSIGN_TO_LEFT = _Object$freeze2.ASSIGN_TO_LEFT,
54
54
  ASSIGN_TO_RIGHT = _Object$freeze2.ASSIGN_TO_RIGHT;
55
55
 
56
+ var POINT_VALUE_TYPES = Object.freeze({
57
+ FROM: 'from',
58
+ TO: 'to',
59
+ BOTH: 'both'
60
+ });
61
+
56
62
  function RangeSlider2(_ref) {
57
63
  var _ref$min = _ref.min,
58
64
  min = _ref$min === void 0 ? 300 : _ref$min,
@@ -60,6 +66,10 @@ function RangeSlider2(_ref) {
60
66
  max = _ref$max === void 0 ? 850 : _ref$max,
61
67
  _ref$minRange = _ref.minRange,
62
68
  minRange = _ref$minRange === void 0 ? 50 : _ref$minRange,
69
+ _ref$dividersRange = _ref.dividersRange,
70
+ dividersRange = _ref$dividersRange === void 0 ? 50 : _ref$dividersRange,
71
+ _ref$pointValueType = _ref.pointValueType,
72
+ pointValueType = _ref$pointValueType === void 0 ? POINT_VALUE_TYPES.FROM : _ref$pointValueType,
63
73
  _ref$precision = _ref.precision,
64
74
  precision = _ref$precision === void 0 ? 0 : _ref$precision,
65
75
  _ref$step = _ref.step,
@@ -539,6 +549,20 @@ function RangeSlider2(_ref) {
539
549
  to = _ref16.to;
540
550
  return from <= score && score <= to;
541
551
  });
552
+ };
553
+
554
+ var getPointValue = function getPointValue(score) {
555
+ switch (pointValueType) {
556
+ case POINT_VALUE_TYPES.FROM:
557
+ return "".concat(score + 1);
558
+
559
+ case POINT_VALUE_TYPES.TO:
560
+ return "".concat(score);
561
+
562
+ case POINT_VALUE_TYPES.BOTH:
563
+ default:
564
+ return "".concat(score, " | ").concat(score + 1);
565
+ }
542
566
  }; // EVENTS //
543
567
 
544
568
 
@@ -781,7 +805,7 @@ function RangeSlider2(_ref) {
781
805
  }, /*#__PURE__*/_react.default.createElement("div", {
782
806
  ref: addTriggerRef,
783
807
  className: (0, _classnames.default)("".concat(COMPONENT_CLASS, "__track__range-triggers--add-trigger__point"), (0, _defineProperty2.default)({}, "".concat(COMPONENT_CLASS, "__track__range-triggers--add-trigger__point--shake"), isCollisionVisible)),
784
- "data-point-value": "".concat(score, " | ").concat(score + 1)
808
+ "data-point-value": getPointValue(score)
785
809
  }, /*#__PURE__*/_react.default.createElement(_reactFeather.Plus, null)), isAddTriggerFixed && renderAddTrackTriggerSettings(), renderCollision({
786
810
  isCollisionVisible: isCollisionVisible,
787
811
  isLeftCollision: isLeftCollision,
@@ -812,7 +836,7 @@ function RangeSlider2(_ref) {
812
836
  onMouseLeave: setMouseLeaveTrigger
813
837
  }, /*#__PURE__*/_react.default.createElement("div", {
814
838
  className: (0, _classnames.default)("".concat(COMPONENT_CLASS, "__track__range-triggers--trigger__point"), (0, _defineProperty2.default)({}, "".concat(COMPONENT_CLASS, "__track__range-triggers--trigger__point--shake"), isCollisionVisible)),
815
- "data-point-value": "".concat(triggerScore, " | ").concat(triggerScore + 1),
839
+ "data-point-value": getPointValue(triggerScore),
816
840
  onMouseDown: function onMouseDown(e) {
817
841
  return onTriggerMouseDown(e, triggerIndex);
818
842
  },
@@ -874,7 +898,7 @@ function RangeSlider2(_ref) {
874
898
  });
875
899
  };
876
900
 
877
- var dividersCount = parseInt((max - min) / minRange);
901
+ var dividersCount = parseInt((max - min) / dividersRange);
878
902
  var dividers = [];
879
903
 
880
904
  for (var i = 0; i < dividersCount; ++i) {
@@ -183,7 +183,6 @@ $lineHeight: 4px;
183
183
  content: attr(data-point-value);
184
184
  position: absolute;
185
185
  top: calc(-100% - 13px);
186
- left: -100%;
187
186
  white-space: nowrap;
188
187
  font-family: 'Roboto';
189
188
  font-style: normal;
@@ -312,10 +311,12 @@ $lineHeight: 4px;
312
311
 
313
312
  &:before {
314
313
  content: attr(data-point-value);
315
- position: relative;
316
- top: calc(-100% - 14px);
317
- left: -100%;
314
+ position: absolute;
315
+ top: calc(-100% - 13px);
316
+ left: 9px;
317
+ transform: translateX(-50%);
318
318
  white-space: nowrap;
319
+ width: fit-content;
319
320
  font-family: 'Roboto';
320
321
  font-style: normal;
321
322
  font-weight: 400;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.2.37",
3
+ "version": "1.2.38",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [