@woosmap/ui 4.164.5 → 4.164.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@woosmap/ui",
3
- "version": "4.164.5",
3
+ "version": "4.164.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/WebGeoServices/ui.git"
@@ -14,22 +14,21 @@ class PricingSlider extends Component {
14
14
  return queries;
15
15
  }
16
16
  return pricing.reduce((amount, tier, index) => {
17
- previousPricingTier = index > 0 ? pricing[index - 1] : null;
18
-
19
- if (previousPricingTier !== null) {
20
- const valueToRemove = Math.min(tier[0] - previousPricingTier[0], q);
21
- if (valueToRemove > 0) {
22
- q -= valueToRemove;
23
- return amount + (valueToRemove / 1000) * tier[1] * coef;
24
- }
25
- } else {
26
- const valueToRemove = Math.min(tier[0], q);
17
+ previousPricingTier = index > 0 ? pricing[index - 1] : null;
18
+
19
+ if (previousPricingTier !== null) {
20
+ const valueToRemove = Math.min(tier[0] - previousPricingTier[0], q);
21
+ if (valueToRemove > 0) {
27
22
  q -= valueToRemove;
28
23
  return amount + (valueToRemove / 1000) * tier[1] * coef;
29
24
  }
30
- return amount;
31
- }, 0)
32
-
25
+ } else {
26
+ const valueToRemove = Math.min(tier[0], q);
27
+ q -= valueToRemove;
28
+ return amount + (valueToRemove / 1000) * tier[1] * coef;
29
+ }
30
+ return Math.floor(amount);
31
+ }, 0);
33
32
  };
34
33
 
35
34
  computeQueries = (valueNow) => {
@@ -62,7 +61,7 @@ class PricingSlider extends Component {
62
61
  const tier = pricing[matchedTierIndex];
63
62
  if (tier) {
64
63
  const previousTier = matchedTierIndex > 0 ? pricing[matchedTierIndex - 1][0] : 0;
65
- const queries = matchedTierIndex * 100000 + (100000 * (value - previousTier)) / tier[0];
64
+ const queries = matchedTierIndex * 100000 + (100000 * (value - previousTier)) / (tier[0]-previousTier);
66
65
  this.onChange(queries);
67
66
  }
68
67
  };
@@ -139,6 +138,7 @@ class PricingSlider extends Component {
139
138
  const { name, productPricing, currency, values, id } = this.props;
140
139
  const { queries } = values;
141
140
  const { displayedPricing, amount, formatedQueries, marks, computedQueries } = this.getDisplayedData(queries);
141
+
142
142
  let displayedAmount = <span className="amount">{`0${currency}`}</span>;
143
143
  if (amount === '∞') {
144
144
  displayedAmount = this.contactSalesButton();
@@ -171,6 +171,7 @@ class PricingSlider extends Component {
171
171
  renderMark={this.renderMarks}
172
172
  pearling
173
173
  min={0}
174
+ step={1000}
174
175
  onChange={(_queries) => {
175
176
  this.onChange(_queries);
176
177
  }}