@woosmap/ui 4.159.2 → 4.160.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/package.json
CHANGED
|
@@ -30,8 +30,9 @@ const Pricing = {
|
|
|
30
30
|
[20000000, 0.01],
|
|
31
31
|
[50000000, 0.01],
|
|
32
32
|
],
|
|
33
|
+
discountEligible: true,
|
|
33
34
|
},
|
|
34
|
-
'
|
|
35
|
+
'Mapping': {
|
|
35
36
|
defaultQueries: 1500,
|
|
36
37
|
publicTierCount: 2,
|
|
37
38
|
unit: "Monthly Requests",
|
|
@@ -46,6 +47,7 @@ const Pricing = {
|
|
|
46
47
|
[20000000, 0.14],
|
|
47
48
|
[50000000, 0.06],
|
|
48
49
|
],
|
|
50
|
+
discountEligible: true,
|
|
49
51
|
},
|
|
50
52
|
'Data Management': {
|
|
51
53
|
defaultQueries: 1500,
|
|
@@ -62,6 +64,7 @@ const Pricing = {
|
|
|
62
64
|
[20000000, 0.28],
|
|
63
65
|
[50000000, 0.12],
|
|
64
66
|
],
|
|
67
|
+
discountEligible: true,
|
|
65
68
|
},
|
|
66
69
|
'Mobile Search': {
|
|
67
70
|
defaultQueries: 1500,
|
|
@@ -78,6 +81,7 @@ const Pricing = {
|
|
|
78
81
|
[20000000, 0.14],
|
|
79
82
|
[50000000, 0.06],
|
|
80
83
|
],
|
|
84
|
+
discountEligible: true,
|
|
81
85
|
},
|
|
82
86
|
},
|
|
83
87
|
},
|
|
@@ -94,6 +98,7 @@ const Pricing = {
|
|
|
94
98
|
pricing: [
|
|
95
99
|
[50000000, 0],
|
|
96
100
|
],
|
|
101
|
+
discountEligible: true,
|
|
97
102
|
},
|
|
98
103
|
'Details': {
|
|
99
104
|
defaultQueries: 1500,
|
|
@@ -110,6 +115,7 @@ const Pricing = {
|
|
|
110
115
|
[20000000, 0.46],
|
|
111
116
|
[50000000, 0.46],
|
|
112
117
|
],
|
|
118
|
+
discountEligible: true,
|
|
113
119
|
},
|
|
114
120
|
'Details UK Addresses': {
|
|
115
121
|
defaultQueries: 1500,
|
|
@@ -127,6 +133,7 @@ const Pricing = {
|
|
|
127
133
|
[20000000, 0.94],
|
|
128
134
|
[50000000, 0.94],
|
|
129
135
|
],
|
|
136
|
+
discountEligible: false,
|
|
130
137
|
},
|
|
131
138
|
'Geocode/Reverse Geocode': {
|
|
132
139
|
defaultQueries: 1500,
|
|
@@ -143,6 +150,7 @@ const Pricing = {
|
|
|
143
150
|
[20000000, 0.05],
|
|
144
151
|
[50000000, 0.02],
|
|
145
152
|
],
|
|
153
|
+
discountEligible: true,
|
|
146
154
|
},
|
|
147
155
|
'Geocode/Reverse Geocode UK addresses': {
|
|
148
156
|
defaultQueries: 1500,
|
|
@@ -160,6 +168,7 @@ const Pricing = {
|
|
|
160
168
|
[20000000, 0.1],
|
|
161
169
|
[50000000, 0.04],
|
|
162
170
|
],
|
|
171
|
+
discountEligible: false,
|
|
163
172
|
},
|
|
164
173
|
'Nearby': {
|
|
165
174
|
defaultQueries: 1500,
|
|
@@ -176,6 +185,7 @@ const Pricing = {
|
|
|
176
185
|
[20000000, 0.46],
|
|
177
186
|
[50000000, 0.46],
|
|
178
187
|
],
|
|
188
|
+
discountEligible: true,
|
|
179
189
|
},
|
|
180
190
|
'what3words': {
|
|
181
191
|
defaultQueries: 0,
|
|
@@ -186,6 +196,7 @@ const Pricing = {
|
|
|
186
196
|
pricing: [
|
|
187
197
|
[50000000, 0],
|
|
188
198
|
],
|
|
199
|
+
discountEligible: true,
|
|
189
200
|
},
|
|
190
201
|
},
|
|
191
202
|
},
|
|
@@ -208,6 +219,7 @@ const Pricing = {
|
|
|
208
219
|
[20000000, 0.07],
|
|
209
220
|
[50000000, 0.03],
|
|
210
221
|
],
|
|
222
|
+
discountEligible: true,
|
|
211
223
|
},
|
|
212
224
|
},
|
|
213
225
|
},
|
|
@@ -230,6 +242,7 @@ const Pricing = {
|
|
|
230
242
|
[20000000, 0.05],
|
|
231
243
|
[50000000, 0.02],
|
|
232
244
|
],
|
|
245
|
+
discountEligible: true,
|
|
233
246
|
},
|
|
234
247
|
'Route with Traffic (/q)': {
|
|
235
248
|
defaultQueries: 1500,
|
|
@@ -246,6 +259,7 @@ const Pricing = {
|
|
|
246
259
|
[20000000, 0.11],
|
|
247
260
|
[50000000, 0.04],
|
|
248
261
|
],
|
|
262
|
+
discountEligible: false,
|
|
249
263
|
},
|
|
250
264
|
'Distance Matrix (/elt)': {
|
|
251
265
|
defaultQueries: 1500,
|
|
@@ -262,6 +276,7 @@ const Pricing = {
|
|
|
262
276
|
[20000000, 0.05],
|
|
263
277
|
[50000000, 0.02],
|
|
264
278
|
],
|
|
279
|
+
discountEligible: true,
|
|
265
280
|
},
|
|
266
281
|
'Distance Matrix with Traffic (/elt)': {
|
|
267
282
|
defaultQueries: 1500,
|
|
@@ -278,6 +293,7 @@ const Pricing = {
|
|
|
278
293
|
[20000000, 0.11],
|
|
279
294
|
[50000000, 0.04],
|
|
280
295
|
],
|
|
296
|
+
discountEligible: false,
|
|
281
297
|
},
|
|
282
298
|
'Isochrone (/q)': {
|
|
283
299
|
defaultQueries: 1500,
|
|
@@ -294,6 +310,7 @@ const Pricing = {
|
|
|
294
310
|
[20000000, 0.05],
|
|
295
311
|
[50000000, 0.02],
|
|
296
312
|
],
|
|
313
|
+
discountEligible: true,
|
|
297
314
|
},
|
|
298
315
|
'Distance Matrix on Mobile (/elt)': {
|
|
299
316
|
defaultQueries: 1500,
|
|
@@ -310,6 +327,7 @@ const Pricing = {
|
|
|
310
327
|
[20000000, 0.28],
|
|
311
328
|
[50000000, 0.12],
|
|
312
329
|
],
|
|
330
|
+
discountEligible: true,
|
|
313
331
|
},
|
|
314
332
|
'Distance Matrix with Traffic on Mobile (/elt)': {
|
|
315
333
|
defaultQueries: 1500,
|
|
@@ -326,6 +344,7 @@ const Pricing = {
|
|
|
326
344
|
[20000000, 0.56],
|
|
327
345
|
[50000000, 0.24],
|
|
328
346
|
],
|
|
347
|
+
discountEligible: false,
|
|
329
348
|
},
|
|
330
349
|
},
|
|
331
350
|
},
|
|
@@ -348,6 +367,7 @@ const Pricing = {
|
|
|
348
367
|
[20000000, 0.06],
|
|
349
368
|
[50000000, 0.02],
|
|
350
369
|
],
|
|
370
|
+
discountEligible: false,
|
|
351
371
|
},
|
|
352
372
|
'Stores': {
|
|
353
373
|
defaultQueries: 1500,
|
|
@@ -364,6 +384,7 @@ const Pricing = {
|
|
|
364
384
|
[20000000, 0.07],
|
|
365
385
|
[50000000, 0.05],
|
|
366
386
|
],
|
|
387
|
+
discountEligible: true,
|
|
367
388
|
},
|
|
368
389
|
'Timezone': {
|
|
369
390
|
defaultQueries: 1500,
|
|
@@ -380,6 +401,7 @@ const Pricing = {
|
|
|
380
401
|
[20000000, 0.07],
|
|
381
402
|
[50000000, 0.05],
|
|
382
403
|
],
|
|
404
|
+
discountEligible: true,
|
|
383
405
|
},
|
|
384
406
|
},
|
|
385
407
|
},
|
|
@@ -402,6 +424,7 @@ const Pricing = {
|
|
|
402
424
|
[20000000, 0.07],
|
|
403
425
|
[50000000, 0.03],
|
|
404
426
|
],
|
|
427
|
+
discountEligible: false,
|
|
405
428
|
},
|
|
406
429
|
},
|
|
407
430
|
},
|
|
@@ -424,6 +447,7 @@ const Pricing = {
|
|
|
424
447
|
[20000000, 0.06],
|
|
425
448
|
[50000000, 0.02],
|
|
426
449
|
],
|
|
450
|
+
discountEligible: true,
|
|
427
451
|
},
|
|
428
452
|
'Distance': {
|
|
429
453
|
defaultQueries: 1500,
|
|
@@ -440,6 +464,7 @@ const Pricing = {
|
|
|
440
464
|
[20000000, 0.56],
|
|
441
465
|
[50000000, 0.24],
|
|
442
466
|
],
|
|
467
|
+
discountEligible: true,
|
|
443
468
|
},
|
|
444
469
|
'Data Management': {
|
|
445
470
|
defaultQueries: 1500,
|
|
@@ -456,6 +481,7 @@ const Pricing = {
|
|
|
456
481
|
[20000000, 0.56],
|
|
457
482
|
[50000000, 0.24],
|
|
458
483
|
],
|
|
484
|
+
discountEligible: true,
|
|
459
485
|
},
|
|
460
486
|
'Mapping': {
|
|
461
487
|
defaultQueries: 1500,
|
|
@@ -472,6 +498,7 @@ const Pricing = {
|
|
|
472
498
|
[20000000, 0.56],
|
|
473
499
|
[50000000, 0.24],
|
|
474
500
|
],
|
|
501
|
+
discountEligible: true,
|
|
475
502
|
},
|
|
476
503
|
},
|
|
477
504
|
},
|
|
@@ -4,23 +4,31 @@ import PricingSlider from './PricingSlider';
|
|
|
4
4
|
import PricingData from './PricingData';
|
|
5
5
|
|
|
6
6
|
class PricingSimulator extends Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
this.state = { total: 0 };
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
onChange = (pricingKey) => (data) => {
|
|
8
13
|
console.log(pricingKey, data);
|
|
9
14
|
};
|
|
10
15
|
|
|
11
16
|
render() {
|
|
17
|
+
const { total } = this.state;
|
|
12
18
|
const { publicMode, currency } = this.props;
|
|
13
19
|
return (
|
|
14
20
|
<>
|
|
15
|
-
<
|
|
16
|
-
|
|
21
|
+
<div className="pricing-nav">
|
|
22
|
+
<ul className="pricing-menu">
|
|
23
|
+
{Object.keys(PricingData).map((category) => (
|
|
24
|
+
<li className="pricing-menu__item">
|
|
25
|
+
<a href={`#${category}`}>{category}</a>
|
|
26
|
+
</li>
|
|
27
|
+
))}
|
|
17
28
|
<li className="pricing-menu__item">
|
|
18
|
-
<
|
|
29
|
+
<div className="pricing-total">{total + currency}</div>
|
|
19
30
|
</li>
|
|
20
|
-
|
|
21
|
-
</ul>
|
|
22
|
-
<div className="pricing-total">
|
|
23
|
-
<div className="pricing-total__label">120€</div>
|
|
31
|
+
</ul>
|
|
24
32
|
</div>
|
|
25
33
|
<div className="pricing-simulator__wrapper">
|
|
26
34
|
{Object.keys(PricingData).map((category) => (
|
|
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import ReactSlider from 'react-slider';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import numeral from 'numeral';
|
|
5
|
-
import {
|
|
5
|
+
import { Input } from '@woosmap/ui';
|
|
6
6
|
|
|
7
7
|
class PricingSlider extends Component {
|
|
8
8
|
constructor(props) {
|
|
@@ -94,7 +94,7 @@ class PricingSlider extends Component {
|
|
|
94
94
|
|
|
95
95
|
let value;
|
|
96
96
|
if (props.key === 0) {
|
|
97
|
-
value =
|
|
97
|
+
value = 0;
|
|
98
98
|
} else {
|
|
99
99
|
const index = props.key / 1000 - 1;
|
|
100
100
|
if (index === displayedPricing.length - 1 && publicMode) {
|
|
@@ -120,6 +120,27 @@ class PricingSlider extends Component {
|
|
|
120
120
|
return publicMode ? pricing.slice(0, publicTierCount + 1) : pricing;
|
|
121
121
|
};
|
|
122
122
|
|
|
123
|
+
getDisplayedData = () => {
|
|
124
|
+
const { queries } = this.state;
|
|
125
|
+
const { name, productPricing } = this.props;
|
|
126
|
+
const displayedPricing = this.getDisplayedPricing();
|
|
127
|
+
const marks = this.getMarks(displayedPricing);
|
|
128
|
+
const computedQueries = this.computeQueries(queries);
|
|
129
|
+
const formatedQueries = computedQueries === '∞' ? computedQueries : numeral(computedQueries).format('0.[0]a');
|
|
130
|
+
const amount = this.computeAmount(displayedPricing, computedQueries);
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
queries,
|
|
134
|
+
amount,
|
|
135
|
+
formatedQueries,
|
|
136
|
+
marks,
|
|
137
|
+
computedQueries,
|
|
138
|
+
name,
|
|
139
|
+
discountEligible: productPricing.discountEligible,
|
|
140
|
+
displayedPricing,
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
|
|
123
144
|
onChange = () => {
|
|
124
145
|
const { onChange } = this.props;
|
|
125
146
|
if (onChange) {
|
|
@@ -128,13 +149,9 @@ class PricingSlider extends Component {
|
|
|
128
149
|
};
|
|
129
150
|
|
|
130
151
|
render() {
|
|
131
|
-
const { queries } = this.state;
|
|
132
152
|
const { name, productPricing } = this.props;
|
|
133
|
-
const displayedPricing = this.
|
|
134
|
-
|
|
135
|
-
const computedQueries = this.computeQueries(queries);
|
|
136
|
-
const formatedQueries = computedQueries === '∞' ? computedQueries : numeral(computedQueries).format('0.[0]a');
|
|
137
|
-
const amount = this.computeAmount(displayedPricing, computedQueries);
|
|
153
|
+
const { queries, displayedPricing, amount, formatedQueries, marks, computedQueries } = this.getDisplayedData();
|
|
154
|
+
|
|
138
155
|
return (
|
|
139
156
|
<div className="pricing-slider__wrapper" id={name}>
|
|
140
157
|
<div className="pricing-slider__info">
|
|
@@ -158,7 +175,7 @@ class PricingSlider extends Component {
|
|
|
158
175
|
)}
|
|
159
176
|
renderMark={this.renderMarks}
|
|
160
177
|
pearling
|
|
161
|
-
min={
|
|
178
|
+
min={0}
|
|
162
179
|
onChange={(a) => {
|
|
163
180
|
this.setState({ queries: a }, this.onChange);
|
|
164
181
|
}}
|