@woosmap/ui 4.164.6 → 4.164.8

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.6",
3
+ "version": "4.164.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/WebGeoServices/ui.git"
@@ -61,7 +61,7 @@ class PricingSlider extends Component {
61
61
  const tier = pricing[matchedTierIndex];
62
62
  if (tier) {
63
63
  const previousTier = matchedTierIndex > 0 ? pricing[matchedTierIndex - 1][0] : 0;
64
- const queries = matchedTierIndex * 100000 + (100000 * (value - previousTier)) / tier[0];
64
+ const queries = matchedTierIndex * 100000 + (100000 * (value - previousTier)) / (tier[0]-previousTier);
65
65
  this.onChange(queries);
66
66
  }
67
67
  };
@@ -114,6 +114,7 @@ class PricingSlider extends Component {
114
114
  const computedQueries = this.computeQueries(queries);
115
115
  const formatedQueries = computedQueries === '∞' ? computedQueries : numeral(computedQueries).format('0.[0]a');
116
116
  const amount = this.computeAmount(displayedPricing, computedQueries);
117
+ const aboveLastTier = formatedQueries === '∞' ? `>${numeral(displayedPricing[displayedPricing.length-2][0]).format('0.[0]a')}` : null
117
118
 
118
119
  return {
119
120
  queries,
@@ -124,6 +125,7 @@ class PricingSlider extends Component {
124
125
  name,
125
126
  discountEligible: productPricing.discountEligible,
126
127
  displayedPricing,
128
+ aboveLastTier
127
129
  };
128
130
  };
129
131
 
@@ -137,7 +139,8 @@ class PricingSlider extends Component {
137
139
  render() {
138
140
  const { name, productPricing, currency, values, id } = this.props;
139
141
  const { queries } = values;
140
- const { displayedPricing, amount, formatedQueries, marks, computedQueries } = this.getDisplayedData(queries);
142
+ const { displayedPricing, amount, formatedQueries, marks, computedQueries, aboveLastTier } = this.getDisplayedData(queries);
143
+
141
144
  let displayedAmount = <span className="amount">{`0${currency}`}</span>;
142
145
  if (amount === '∞') {
143
146
  displayedAmount = this.contactSalesButton();
@@ -163,7 +166,7 @@ class PricingSlider extends Component {
163
166
  renderThumb={(props) => (
164
167
  <div {...props}>
165
168
  <span>
166
- <span>{formatedQueries} </span>
169
+ <span>{aboveLastTier ? aboveLastTier : formatedQueries} </span>
167
170
  </span>
168
171
  </div>
169
172
  )}
@@ -178,7 +181,7 @@ class PricingSlider extends Component {
178
181
  />
179
182
  <div className="pricing-slider__queries">
180
183
  <div className="pricing-slider__queries__label">{productPricing.unit}</div>
181
- <Input type="text" onChange={this.reverseComputeQueries} value={computedQueries} />
184
+ <Input type="text" onChange={this.reverseComputeQueries} value={aboveLastTier ? aboveLastTier : computedQueries} />
182
185
  </div>
183
186
  <div className="pricing-slider__price">{displayedAmount}</div>
184
187
  </div>