@woosmap/ui 2.33.0 → 2.37.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.
@@ -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
+ }
@@ -1,4 +1,4 @@
1
- .marker
1
+ .ui-marker
2
2
  position absolute
3
3
  width 3rem
4
4
  height 4.6rem
@@ -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 Points of Interest.",
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, et la zone de chalandise.",
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.": "Listez vos propres points de vente et centrez votre affichage cartographique autour de sa position.",
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...",
@@ -155,32 +155,32 @@
155
155
  .icon
156
156
  fill $secondary
157
157
  &--inverse
158
- btn()
159
- background-color transparent
160
- border .1rem solid $light
158
+ btn()
159
+ background-color transparent
160
+ border .1rem solid $light
161
+ color $light
162
+ .icon
163
+ fill $light
164
+ &.btn--has-icon
165
+ &:not(.btn--mini):not(.btn--small):not(.btn--large)
166
+ mbi(.4)
167
+ &.btn--icon
168
+ flex-shrink 0
169
+ .icon
170
+ flex-shrink 0
171
+ &:hover
172
+ border-color $success
161
173
  color $light
162
174
  .icon
163
175
  fill $light
164
- &.btn--has-icon
165
- &:not(.btn--mini):not(.btn--small):not(.btn--large)
166
- mbi(.4)
167
- &.btn--icon
168
- flex-shrink 0
169
- .icon
170
- flex-shrink 0
176
+ &:disabled
177
+ opacity .3
171
178
  &:hover
179
+ cursor default
172
180
  border-color $success
173
181
  color $light
174
182
  .icon
175
183
  fill $light
176
- &:disabled
177
- opacity .3
178
- &:hover
179
- cursor default
180
- border-color $success
181
- color $light
182
- .icon
183
- fill $light
184
184
  &--dropdown-item
185
185
  flexBtn()
186
186
  ellipsis()
@@ -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,13 +565,15 @@
543
565
  &--small
544
566
  buttonSmall()
545
567
  &.btn--group
568
+ &.btn--switch
546
569
  buttonSmall()
547
570
  &.btn--icon
548
571
  width auto
549
572
  img
550
573
  max-width 2.2rem
551
- .icon
552
- sq(1.8)
574
+ &:not(.btn--custom-icon-size)
575
+ .icon
576
+ sq(1.8)
553
577
  &:not(.btn--icon)
554
578
  .icon
555
579
  margin-right .4rem
@@ -562,8 +586,9 @@
562
586
  sq(1.8)
563
587
  &--mini
564
588
  buttonMini()
565
- .icon
566
- sq(1.6)
589
+ &:not(.btn--custom-icon-size)
590
+ .icon
591
+ sq(1.6)
567
592
  &:not(.btn--icon)
568
593
  .icon
569
594
  margin-right .4rem
@@ -577,8 +602,9 @@
577
602
 
578
603
  &--large
579
604
  buttonLarge()
580
- .icon
581
- sq(3.2)
605
+ &:not(.btn--custom-icon-size)
606
+ .icon
607
+ sq(3.2)
582
608
  &:not(.btn--icon)
583
609
  .icon
584
610
  margin-right .6rem
@@ -70,6 +70,8 @@ $special2 = #ff3260
70
70
  $special3 = #46cebc
71
71
  $focus = #3633ff
72
72
 
73
+ $favorite = #ffc200
74
+
73
75
  $modalBg = rgba(0, 11, 31, .85)
74
76
 
75
77
  // Labels
@@ -34,7 +34,7 @@ box()
34
34
  // Buttons mixins
35
35
 
36
36
  hover()
37
- &:not(.btn--group)
37
+ &:not(.btn--group):not(.btn--switch)
38
38
  &:hover
39
39
  background-color $buttonHover
40
40
  color $light