@woosmap/ui 2.35.0 → 2.39.0
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 +2 -1
- package/src/Constants.js +1 -0
- package/src/components/Button/Button.stories.js +1 -1
- package/src/components/Button/ButtonSwitch.js +1 -1
- package/src/components/Card/Card.stories.js +1 -1
- package/src/components/Card/SimpleCard.js +9 -1
- package/src/components/Card/SimpleCard.styl +9 -2
- package/src/components/Demo/DistanceDemo.js +87 -62
- package/src/components/Demo/GeolocationDemo.js +124 -48
- package/src/components/Demo/LocalitiesAddressDemo.js +63 -54
- package/src/components/Demo/LocalitiesDemo.js +61 -46
- package/src/components/Demo/SearchDemo.js +85 -93
- package/src/components/Label/Label.styl +9 -1
- package/src/components/Map/Marker.js +2 -2
- package/src/components/Map/Marker.test.js +2 -2
- package/src/components/Map/drawOnMap.js +67 -0
- package/src/components/Map/marker.styl +1 -1
- package/src/locales/en/translation.json +2 -1
- package/src/locales/fr/translation.json +3 -2
- package/src/styles/console/button.styl +24 -1
- package/src/styles/console/colors.styl +2 -0
- package/src/styles/console/mixins.styl +1 -1
|
@@ -76,3 +76,70 @@ export const extendedBounds = function extendedBounds(boundsArray) {
|
|
|
76
76
|
|
|
77
77
|
return bounds;
|
|
78
78
|
};
|
|
79
|
+
|
|
80
|
+
export const woosmapBoundsFromViewport = function woosmapBoundsFromViewport(viewportObj) {
|
|
81
|
+
return new window.woosmap.map.LatLngBounds(
|
|
82
|
+
new window.woosmap.map.LatLng(viewportObj.southwest),
|
|
83
|
+
new window.woosmap.map.LatLng(viewportObj.northeast)
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export class WoosmapMapBoundingBox {
|
|
88
|
+
constructor(bounds, padding) {
|
|
89
|
+
this.overlayView = new window.woosmap.map.OverlayView();
|
|
90
|
+
|
|
91
|
+
this.bounds = !(bounds instanceof window.woosmap.map.LatLngBounds)
|
|
92
|
+
? new window.woosmap.map.LatLngBounds(
|
|
93
|
+
{ lng: bounds.east, lat: bounds.north },
|
|
94
|
+
{ lng: bounds.west, lat: bounds.south }
|
|
95
|
+
)
|
|
96
|
+
: bounds;
|
|
97
|
+
|
|
98
|
+
this.padding = {
|
|
99
|
+
right: padding?.right || 0,
|
|
100
|
+
left: padding?.left || 0,
|
|
101
|
+
top: padding?.top || 0,
|
|
102
|
+
bottom: padding?.bottom || 0,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const self = this;
|
|
106
|
+
|
|
107
|
+
this.overlayView.onAdd = () => {
|
|
108
|
+
const panes = this.overlayView.getPanes();
|
|
109
|
+
|
|
110
|
+
this.div = document.createElement('div');
|
|
111
|
+
this.div.style.borderStyle = 'solid';
|
|
112
|
+
this.div.style.borderWidth = '1px';
|
|
113
|
+
this.div.style.borderColor = 'rgba(0, 0, 255, 0.8)';
|
|
114
|
+
this.div.style.position = 'absolute';
|
|
115
|
+
this.div.style.backgroundColor = 'rgba(0, 0, 255, 0.2)';
|
|
116
|
+
|
|
117
|
+
panes.overlayLayer.appendChild(this.div);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
this.overlayView.draw = () => {
|
|
121
|
+
const overlayProjection = this.overlayView.getProjection();
|
|
122
|
+
|
|
123
|
+
const sw = overlayProjection.fromLatLngToDivPixel(self.bounds.getSouthWest());
|
|
124
|
+
const ne = overlayProjection.fromLatLngToDivPixel(self.bounds.getNorthEast());
|
|
125
|
+
|
|
126
|
+
if (this.div) {
|
|
127
|
+
this.div.style.left = `${sw.x - self.padding.left}px`;
|
|
128
|
+
this.div.style.top = `${ne.y - self.padding.top}px`;
|
|
129
|
+
this.div.style.width = `${ne.x - sw.x + (self.padding.left + self.padding.right)}px`;
|
|
130
|
+
this.div.style.height = `${sw.y - ne.y + (self.padding.top + self.padding.bottom)}px`;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
this.overlayView.onRemove = () => {
|
|
135
|
+
if (this.div) {
|
|
136
|
+
this.div.parentNode.removeChild(this.div);
|
|
137
|
+
delete this.div;
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
setMap(map) {
|
|
143
|
+
this.overlayView.setMap(map);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"Default": "Default",
|
|
30
30
|
"Destination": "Destination",
|
|
31
31
|
"Display Map POIs": "Display Map POIs",
|
|
32
|
+
"Display Geolocation POIs": "Display points of interest",
|
|
32
33
|
"Display Woosmap Stores overlay": "Display Woosmap Stores overlay",
|
|
33
34
|
"Display your regional promotions and catchment area.": "Display your regional promotions and catchment area.",
|
|
34
35
|
"Distance API": "Distance API",
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
"Grey": "Grey",
|
|
45
46
|
"Identify the country to redirect users to the suitable website, or adapt your services according to the timezone.": "Identify the country to redirect users to the suitable website, or adapt your services according to the timezone.",
|
|
46
47
|
"In Store Wifi": "In Store Wifi",
|
|
47
|
-
"Initialise your map display around the end user and retrieve your own Points of Interest.": "Initialise your map display around the end user and retrieve your own
|
|
48
|
+
"Initialise your map display around the end user and retrieve your own Points of Interest.": "Initialise your map display around the end user and retrieve your own points of interest.",
|
|
48
49
|
"Language": "Language",
|
|
49
50
|
"Light Grey": "Light Grey",
|
|
50
51
|
"Loading...": "Loading...",
|
|
@@ -29,8 +29,9 @@
|
|
|
29
29
|
"Default": "Défaut",
|
|
30
30
|
"Destination": "Destination",
|
|
31
31
|
"Display Map POIs": "Afficher les POIs de la carte",
|
|
32
|
+
"Display Geolocation POIs": "Afficher les points de vente",
|
|
32
33
|
"Display Woosmap Stores overlay": "Afficher la couche de magasins Woosmap",
|
|
33
|
-
"Display your regional promotions and catchment area.": "Affichez les offres promotionnelles de la région
|
|
34
|
+
"Display your regional promotions and catchment area.": "Affichez les offres promotionnelles de la région et la zone de chalandise.",
|
|
34
35
|
"Distance API": "Distance API",
|
|
35
36
|
"Features": "Caractéristiques",
|
|
36
37
|
"Filter by": "Filtrer par",
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
"Grey": "Gris",
|
|
45
46
|
"Identify the country to redirect users to the suitable website, or adapt your services according to the timezone.": "Identifiez le pays pour rediriger vers le bon site et adaptez vos offres de services en fonction du fuseau horaire de vos visiteurs.",
|
|
46
47
|
"In Store Wifi": "Wifi",
|
|
47
|
-
"Initialise your map display around the end user and retrieve your own Points of Interest.": "
|
|
48
|
+
"Initialise your map display around the end user and retrieve your own Points of Interest.": "Centrez la carte autour de la position de votre visiteur et affichez vos propres points de vente.",
|
|
48
49
|
"Language": "Language",
|
|
49
50
|
"Light Grey": "Gris clair",
|
|
50
51
|
"Loading...": "Chargement...",
|
|
@@ -332,7 +332,6 @@
|
|
|
332
332
|
.btn__label
|
|
333
333
|
trans()
|
|
334
334
|
|
|
335
|
-
|
|
336
335
|
&--has-icon
|
|
337
336
|
&:not(.btn--icon):not(.btn--link):not(.btn--link-primary):not(.btn--link-info):not(.btn--link-flex):not(.btn--link-flex-info):not(.btn--loading):not(.btn--mini):not(.btn--small):not(.btn--large):not(.btn--dropdown-item):not(.btn--tab):not(.btn--sidebar-link)
|
|
338
337
|
padding 0 $padding 0 $padding - .6
|
|
@@ -344,6 +343,29 @@
|
|
|
344
343
|
background-color $error
|
|
345
344
|
.icon
|
|
346
345
|
sq(2.2)
|
|
346
|
+
&--switch
|
|
347
|
+
btn()
|
|
348
|
+
color $secondary-medium
|
|
349
|
+
background-color $light
|
|
350
|
+
border .1rem solid $inputBorderColor
|
|
351
|
+
&.btn--has-icon
|
|
352
|
+
&:not(.btn--mini):not(.btn--small):not(.btn--large)
|
|
353
|
+
mbi(.4)
|
|
354
|
+
&.btn--icon
|
|
355
|
+
flex-shrink 0
|
|
356
|
+
.icon
|
|
357
|
+
flex-shrink 0
|
|
358
|
+
&:hover
|
|
359
|
+
color $secondary
|
|
360
|
+
background-color $primary10
|
|
361
|
+
&.active
|
|
362
|
+
color $light
|
|
363
|
+
border-color $secondary
|
|
364
|
+
background-color $secondary
|
|
365
|
+
.icon
|
|
366
|
+
fill $light
|
|
367
|
+
&:hover
|
|
368
|
+
background-color $secondary
|
|
347
369
|
&--group
|
|
348
370
|
btn()
|
|
349
371
|
color $secondary-medium
|
|
@@ -543,6 +565,7 @@
|
|
|
543
565
|
&--small
|
|
544
566
|
buttonSmall()
|
|
545
567
|
&.btn--group
|
|
568
|
+
&.btn--switch
|
|
546
569
|
buttonSmall()
|
|
547
570
|
&.btn--icon
|
|
548
571
|
width auto
|