@woosmap/ui 2.60.0 → 2.64.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@woosmap/ui",
3
- "version": "2.60.0",
3
+ "version": "2.64.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/WebGeoServices/ui.git"
@@ -210,6 +210,7 @@ export default class DistanceDemo extends Component {
210
210
  }
211
211
 
212
212
  if (window.woosmap && window.woosmap.map && this.demoRef.current) {
213
+ window.woosmap.map.config.setApiKey(Constants.woosmapKey);
213
214
  this.map = createWoosmapMap(this.demoRef.current.getMap());
214
215
  this.requestDistance();
215
216
  } else {
@@ -218,6 +219,9 @@ export default class DistanceDemo extends Component {
218
219
  };
219
220
 
220
221
  localitiesOnChangeCallBack = (type) => (item) => {
222
+ if (!item) {
223
+ return;
224
+ }
221
225
  const newState = {};
222
226
  newState[`${type}Location`] = item ? item.location : {};
223
227
  this.setState(newState, this.requestDistance);
@@ -345,7 +349,7 @@ export default class DistanceDemo extends Component {
345
349
  };
346
350
  return (
347
351
  <>
348
- <Script url={`https://sdk.woosmap.com/map/map.js?key=${Constants.woosmapKey}`} />
352
+ <Script url="https://sdk.woosmap.com/map/map.js" />
349
353
  <Demo
350
354
  id="distance-demo"
351
355
  className="demo--distance"
@@ -179,6 +179,7 @@ export default class GeolocationDemo extends Component {
179
179
  }
180
180
 
181
181
  if (window.woosmap && window.woosmap.map && this.demoRef.current) {
182
+ window.woosmap.map.config.setApiKey(Constants.geolocationWoosmapSearchKey);
182
183
  this.map = createWoosmapMap(this.demoRef.current.getMap());
183
184
  this.requestGeolocation();
184
185
  } else {
@@ -210,7 +211,7 @@ export default class GeolocationDemo extends Component {
210
211
  }
211
212
  return (
212
213
  <>
213
- <Script url={`https://sdk.woosmap.com/map/map.js?key=${Constants.geolocationWoosmapSearchKey}`} />
214
+ <Script url="https://sdk.woosmap.com/map/map.js" />
214
215
  <Demo
215
216
  className="demo--geolocation"
216
217
  docLink="https://developers.woosmap.com/products/geolocation-api/location/"
@@ -327,6 +327,7 @@ export default class LocalitiesAddressDemo extends Component {
327
327
  }
328
328
 
329
329
  if (window.woosmap && window.woosmap.map && this.demoRef.current) {
330
+ window.woosmap.map.config.setApiKey(Constants.woosmapKey);
330
331
  this.map = createWoosmapMap(this.demoRef.current.getMap());
331
332
  this.requestAddress();
332
333
  } else {
@@ -343,7 +344,7 @@ export default class LocalitiesAddressDemo extends Component {
343
344
  }
344
345
  return (
345
346
  <>
346
- <Script url={`https://sdk.woosmap.com/map/map.js?key=${Constants.woosmapKey}`} />
347
+ <Script url="https://sdk.woosmap.com/map/map.js" />
347
348
  <Demo
348
349
  noheader={noheader}
349
350
  header={headerLabels}
@@ -195,6 +195,7 @@ export default class LocalitiesDemo extends Component {
195
195
  }
196
196
 
197
197
  if (window.woosmap && window.woosmap.map && this.demoRef.current) {
198
+ window.woosmap.map.config.setApiKey(Constants.woosmapKey);
198
199
  this.map = createWoosmapMap(this.demoRef.current.getMap());
199
200
  this.requestLocalities();
200
201
  } else {
@@ -270,7 +271,7 @@ export default class LocalitiesDemo extends Component {
270
271
  const { noheader, headerLabels, subHeader } = this.props;
271
272
  return (
272
273
  <>
273
- <Script url={`https://sdk.woosmap.com/map/map.js?key=${Constants.woosmapKey}`} />
274
+ <Script url="https://sdk.woosmap.com/map/map.js" />
274
275
  <Demo
275
276
  id="localities-demo"
276
277
  header={headerLabels}
@@ -251,7 +251,7 @@ storesOverlay.setMap(map);
251
251
  };
252
252
  return (
253
253
  <>
254
- <Script url={`https://sdk.woosmap.com/map/map.js?key=${Constants.woosmapKey}`} />
254
+ <Script url="https://sdk.woosmap.com/map/map.js" />
255
255
  <Demo
256
256
  ref={this.demoRef}
257
257
  header={headerLabels}
@@ -73,7 +73,7 @@ export default class SearchDemo extends Component {
73
73
  key: Constants.woosmapKey,
74
74
  lat: location.lat,
75
75
  lng: location.lng,
76
- stores_by_page: maxStore,
76
+ stores_by_page: maxStore || '5',
77
77
  query,
78
78
  };
79
79
  };
@@ -190,6 +190,7 @@ export default class SearchDemo extends Component {
190
190
  if (this.timeoutMap) clearTimeout(this.timeoutMap);
191
191
 
192
192
  if (window.woosmap && window.woosmap.map && this.demoRef.current) {
193
+ window.woosmap.map.config.setApiKey(Constants.woosmapKey);
193
194
  this.map = createWoosmapMap(this.demoRef.current.getMap());
194
195
  this.requestSearch();
195
196
  } else {
@@ -310,7 +311,7 @@ export default class SearchDemo extends Component {
310
311
  };
311
312
  return (
312
313
  <>
313
- <Script url={`https://sdk.woosmap.com/map/map.js?key=${Constants.woosmapKey}`} />
314
+ <Script url="https://sdk.woosmap.com/map/map.js" />
314
315
  <Demo
315
316
  id="search-demo"
316
317
  className="demo--search"
@@ -7,6 +7,7 @@ import { ReactComponent as Battery } from '../../icons/battery.svg';
7
7
  import { ReactComponent as Cars } from '../../icons/cars.svg';
8
8
  import { ReactComponent as Github } from '../../icons/github.svg';
9
9
  import { ReactComponent as Green } from '../../icons/green.svg';
10
+ import { ReactComponent as Integrations } from '../../icons/integrations.svg';
10
11
  import { ReactComponent as Like } from '../../icons/like.svg';
11
12
  import { ReactComponent as MapHd } from '../../icons/map-hd.svg';
12
13
  import { ReactComponent as Markers } from '../../icons/markers.svg';
@@ -89,7 +90,10 @@ import { ReactComponent as Manage } from '../../icons/manage.svg';
89
90
  import { ReactComponent as Marker } from '../../icons/marker.svg';
90
91
  import { ReactComponent as Members } from '../../icons/members.svg';
91
92
  import { ReactComponent as Member } from '../../icons/member.svg';
92
- import { ReactComponent as Menu } from '../../icons/menu.svg';
93
+ import { ReactComponent as MenuVertical } from '../../icons/menu-vertical.svg';
94
+ import { ReactComponent as MenuCircleVertical } from '../../icons/menu-circle-vertical.svg';
95
+ import { ReactComponent as MenuHorizontal } from '../../icons/menu-horizontal.svg';
96
+ import { ReactComponent as MenuCircleHorizontal } from '../../icons/menu-circle-horizontal.svg';
93
97
  import { ReactComponent as Metrics } from '../../icons/metrics.svg';
94
98
  import { ReactComponent as Organization } from '../../icons/organization.svg';
95
99
  import { ReactComponent as Organizations } from '../../icons/organizations.svg';
@@ -138,6 +142,7 @@ const Icons = {
138
142
  cars: Cars,
139
143
  github: Github,
140
144
  green: Green,
145
+ integrations: Integrations,
141
146
  like: Like,
142
147
  'map-hd': MapHd,
143
148
  markers: Markers,
@@ -221,7 +226,10 @@ const Icons = {
221
226
  members: Members,
222
227
  member: Member,
223
228
  metrics: Metrics,
224
- menu: Menu,
229
+ 'menu-vertical': MenuVertical,
230
+ 'menu-circle-vertical': MenuCircleVertical,
231
+ 'menu-horizontal': MenuHorizontal,
232
+ 'menu-circle-horizontal': MenuCircleHorizontal,
225
233
  organization: Organization,
226
234
  organizations: Organizations,
227
235
  phone: Phone,
@@ -58,11 +58,11 @@ function withLayer(MyComponent) {
58
58
  function close() {
59
59
  setOpen(false);
60
60
  }
61
- const { forwardedRef, container, placement, ...rest } = props;
61
+ const { forwardedRef, container, placement, disableClickOutside, ...rest } = props;
62
62
  const { renderLayer, triggerProps, layerProps, arrowProps } = useLayer({
63
63
  isOpen,
64
64
  container,
65
- onOutsideClick: close, // close the menu when the user clicks outside
65
+ onOutsideClick: disableClickOutside ? null : close, // close the menu when the user clicks outside
66
66
  onDisappear: close, // close the menu when the menu gets scrolled out of sight
67
67
  overflowContainer: true, // keep the menu positioned inside the container
68
68
  auto: true, // automatically find the best placement
@@ -87,11 +87,13 @@ function withLayer(MyComponent) {
87
87
  WrappedComponent.defaultProps = {
88
88
  container: null,
89
89
  placement: 'bottom-center',
90
+ disableClickOutside: false,
90
91
  };
91
92
  WrappedComponent.propTypes = {
92
93
  forwardedRef: PropTypes.object.isRequired,
93
94
  container: PropTypes.string,
94
95
  placement: PropTypes.string,
96
+ disableClickOutside: PropTypes.bool,
95
97
  };
96
98
  return React.forwardRef((props, ref) => <WrappedComponent {...props} forwardedRef={ref} />);
97
99
  }
@@ -3,6 +3,12 @@ import Popover from './Popover';
3
3
  import ConfirmationPopover from './ConfirmationPopover';
4
4
  import Button from '../Button/Button';
5
5
 
6
+ const toggle = (ref) => {
7
+ if (ref.current) {
8
+ ref.current.toggle();
9
+ }
10
+ };
11
+
6
12
  const Story = {
7
13
  title: 'base/Popover',
8
14
  component: Popover,
@@ -12,15 +18,10 @@ export default Story;
12
18
 
13
19
  const Template = () => {
14
20
  const popoverRef = React.createRef();
15
- function toggle() {
16
- if (popoverRef.current) {
17
- popoverRef.current.toggle();
18
- }
19
- }
20
21
  return (
21
22
  <div style={{ paddingLeft: '50px' }}>
22
23
  <Popover ref={popoverRef} content="My popover">
23
- <Button label="my button" onClick={toggle} />
24
+ <Button label="my button" onClick={() => toggle(popoverRef)} />
24
25
  </Popover>
25
26
  </div>
26
27
  );
@@ -34,15 +35,10 @@ const TemplateConfirmPopover = (args) => {
34
35
  const confirmCb = () => {
35
36
  // confirm action
36
37
  };
37
- function toggleConfirm() {
38
- if (popoverConfirmRef.current) {
39
- popoverConfirmRef.current.toggle();
40
- }
41
- }
42
38
  return (
43
39
  <div style={{ paddingLeft: '50px' }}>
44
40
  <ConfirmationPopover ref={popoverConfirmRef} text={text} confirmCb={confirmCb}>
45
- <Button label="my button" onClick={toggleConfirm} />
41
+ <Button label="my button" onClick={() => toggle(popoverConfirmRef)} />
46
42
  </ConfirmationPopover>
47
43
  </div>
48
44
  );
@@ -51,3 +47,16 @@ export const ConfirmationPopoverTemplate = TemplateConfirmPopover.bind({});
51
47
  ConfirmationPopoverTemplate.args = {
52
48
  text: 'Do you confirm?',
53
49
  };
50
+
51
+ const TemplatePopoverNoClickOutside = () => {
52
+ const popoverRef = React.createRef();
53
+
54
+ return (
55
+ <div style={{ paddingLeft: '50px' }}>
56
+ <Popover ref={popoverRef} content="My popover, no click outside" disableClickOutside>
57
+ <Button label="my button 2" onClick={() => toggle(popoverRef)} />
58
+ </Popover>
59
+ </div>
60
+ );
61
+ };
62
+ export const TemplatePopoverClickOutsideDisabled = TemplatePopoverNoClickOutside.bind({});
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M79.267 11.367H20.733a9.393 9.393 0 0 0-9.381 9.383v58.5a9.393 9.393 0 0 0 9.381 9.383h58.534a9.393 9.393 0 0 0 9.381-9.383v-58.5a9.393 9.393 0 0 0-9.381-9.383Zm-27.763 3h27.763a6.389 6.389 0 0 1 6.381 6.383v27.738H75.6a1.5 1.5 0 0 0-1.146.531 1.419 1.419 0 0 0-.105.14 1.5 1.5 0 0 0-.252.831 5.523 5.523 0 0 1-11.045 0 1.5 1.5 0 0 0-.252-.831 1.52 1.52 0 0 0-.375-.388 1.5 1.5 0 0 0-.877-.283H51.5V39.83a8.524 8.524 0 0 0 0-16.781Zm-30.771 0H48.5v10.047a1.5 1.5 0 0 0 .072.432 1.48 1.48 0 0 0 .274.511l.018.024.017.016a1.4 1.4 0 0 0 .095.109c.017.016.041.022.058.037a1.474 1.474 0 0 0 .382.243c.031.013.062.02.094.032a1.5 1.5 0 0 0 .482.092h.009a5.523 5.523 0 0 1 0 11.045h-.009a1.5 1.5 0 0 0-.481.092c-.033.012-.065.019-.1.033a1.481 1.481 0 0 0-.379.242c-.019.015-.043.022-.06.038a1.215 1.215 0 0 0-.095.109l-.016.015-.017.022a1.515 1.515 0 0 0-.276.514 1.5 1.5 0 0 0-.072.433v10.035h-8.682a8.524 8.524 0 0 0-16.781 0h-8.681V20.75a6.389 6.389 0 0 1 6.381-6.383ZM48.5 85.633H20.733a6.389 6.389 0 0 1-6.381-6.383V51.512H24.4a1.5 1.5 0 0 0 1.146-.531 1.419 1.419 0 0 0 .105-.14 1.5 1.5 0 0 0 .252-.831 5.523 5.523 0 0 1 11.045 0 1.5 1.5 0 0 0 .252.831 1.52 1.52 0 0 0 .375.388 1.5 1.5 0 0 0 .877.283H48.5v8.658a8.524 8.524 0 0 0 0 16.781Zm30.771 0H51.5V75.586a1.5 1.5 0 0 0-.072-.432 1.48 1.48 0 0 0-.274-.511l-.018-.024-.017-.016a1.4 1.4 0 0 0-.095-.109c-.017-.016-.041-.022-.058-.037a1.474 1.474 0 0 0-.382-.243c-.031-.013-.062-.02-.094-.032a1.5 1.5 0 0 0-.482-.092h-.009a5.523 5.523 0 0 1 0-11.045h.009a1.5 1.5 0 0 0 .481-.092c.033-.012.065-.019.1-.033a1.486 1.486 0 0 0 .38-.242c.018-.016.042-.022.059-.038a1.4 1.4 0 0 0 .095-.109l.016-.015.017-.022a1.515 1.515 0 0 0 .276-.514 1.5 1.5 0 0 0 .072-.433V51.512h8.682a8.524 8.524 0 0 0 16.781 0h8.681V79.25a6.389 6.389 0 0 1-6.381 6.383Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.994 12.081A1.984 1.984 0 0 1 6.762 14.1c-1.2.425-2.718.208-3.156-1.033C3.18 11.86 3.4 10.344 4.638 9.9c1.2-.426 2.718-.208 3.157 1.033a3.467 3.467 0 0 1 .199 1.148Zm-1.6.958c.589-.208.558-1.137.35-1.728a.691.691 0 0 0-.589-.452 2.2 2.2 0 0 0-1.139.1c-.589.209-.559 1.137-.35 1.728s1.136.559 1.728.35Zm7.9-.958a1.986 1.986 0 0 1-1.232 2.019c-1.2.425-2.718.208-3.157-1.033-.426-1.2-.208-2.718 1.033-3.157 1.2-.425 2.718-.208 3.157 1.033a3.467 3.467 0 0 1 .199 1.138Zm-1.605.958c.588-.208.558-1.137.35-1.728s-1.136-.559-1.728-.35-.558 1.135-.35 1.728 1.136.559 1.728.35Zm7.905-.958a1.986 1.986 0 0 1-1.232 2.019c-1.2.426-2.718.208-3.157-1.033-.426-1.2-.208-2.718 1.033-3.157 1.2-.425 2.718-.208 3.157 1.033a3.467 3.467 0 0 1 .199 1.138Zm-3.47-.183a2.467 2.467 0 0 0 .137.791.692.692 0 0 0 .589.452 2.2 2.2 0 0 0 1.139-.1c.589-.208.557-1.137.35-1.728s-1.136-.559-1.728-.35a.9.9 0 0 0-.487.937Z"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.919 7.994A1.984 1.984 0 0 1 9.9 6.762c-.425-1.2-.208-2.718 1.033-3.156 1.2-.426 2.718-.209 3.157 1.032.426 1.2.208 2.718-1.033 3.157a3.467 3.467 0 0 1-1.138.199zm-.958-1.6c.208.589 1.137.558 1.728.35a.691.691 0 0 0 .452-.589 2.2 2.2 0 0 0-.1-1.139c-.209-.589-1.137-.559-1.728-.35s-.559 1.136-.35 1.728zm.958 7.9A1.986 1.986 0 0 1 9.9 13.062c-.425-1.2-.208-2.718 1.033-3.157 1.2-.426 2.718-.208 3.157 1.033.425 1.2.208 2.718-1.033 3.157a3.467 3.467 0 0 1-1.138.199zm-.958-1.605c.208.588 1.137.558 1.728.35s.559-1.136.35-1.728-1.135-.558-1.728-.35-.559 1.136-.35 1.728zm.958 7.905A1.986 1.986 0 0 1 9.9 19.362c-.426-1.2-.208-2.718 1.033-3.157 1.2-.426 2.718-.208 3.157 1.033.425 1.2.208 2.718-1.033 3.157a3.467 3.467 0 0 1-1.138.199zm.183-3.47a2.467 2.467 0 0 0-.791.137.692.692 0 0 0-.452.589 2.2 2.2 0 0 0 .1 1.139c.208.589 1.137.557 1.728.35s.559-1.136.35-1.728a.9.9 0 0 0-.937-.487z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.919 7.994A1.984 1.984 0 0 1 9.9 6.762c-.425-1.2-.208-2.718 1.033-3.156 1.2-.426 2.718-.209 3.157 1.032.426 1.2.208 2.718-1.033 3.157a3.467 3.467 0 0 1-1.138.199Zm-.958-1.6c.208.589 1.137.558 1.728.35a.691.691 0 0 0 .452-.589 2.2 2.2 0 0 0-.1-1.139c-.209-.589-1.137-.559-1.728-.35s-.559 1.136-.35 1.728Zm.958 7.9A1.986 1.986 0 0 1 9.9 13.062c-.425-1.2-.208-2.718 1.033-3.157 1.2-.426 2.718-.208 3.157 1.033.425 1.2.208 2.718-1.033 3.157a3.467 3.467 0 0 1-1.138.199Zm-.958-1.605c.208.588 1.137.558 1.728.35s.559-1.136.35-1.728-1.135-.558-1.728-.35-.559 1.136-.35 1.728Zm.958 7.905A1.986 1.986 0 0 1 9.9 19.362c-.426-1.2-.208-2.718 1.033-3.157 1.2-.426 2.718-.208 3.157 1.033.425 1.2.208 2.718-1.033 3.157a3.467 3.467 0 0 1-1.138.199Zm.183-3.47a2.467 2.467 0 0 0-.791.137.692.692 0 0 0-.452.589 2.2 2.2 0 0 0 .1 1.139c.208.589 1.137.557 1.728.35s.559-1.136.35-1.728a.9.9 0 0 0-.937-.487Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.994 12.081A1.984 1.984 0 0 1 6.762 14.1c-1.2.425-2.718.208-3.156-1.033C3.18 11.86 3.4 10.344 4.638 9.9c1.2-.426 2.718-.208 3.157 1.033a3.467 3.467 0 0 1 .199 1.148Zm6.3 0a1.986 1.986 0 0 1-1.232 2.019c-1.2.425-2.718.208-3.157-1.033-.426-1.2-.208-2.718 1.033-3.157 1.2-.425 2.718-.208 3.157 1.033a3.467 3.467 0 0 1 .199 1.138Zm6.3 0a1.986 1.986 0 0 1-1.232 2.019c-1.2.426-2.718.208-3.157-1.033-.426-1.2-.208-2.718 1.033-3.157 1.2-.425 2.718-.208 3.157 1.033a3.467 3.467 0 0 1 .199 1.138Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.081 16.006a1.984 1.984 0 0 1 2.019 1.232c.425 1.2.208 2.718-1.033 3.156-1.2.426-2.718.209-3.157-1.032-.426-1.2-.208-2.718 1.033-3.157a3.467 3.467 0 0 1 1.138-.199Zm0-6.3a1.986 1.986 0 0 1 2.019 1.232c.425 1.2.208 2.718-1.033 3.157-1.2.426-2.718.208-3.157-1.033-.425-1.2-.208-2.718 1.033-3.157a3.467 3.467 0 0 1 1.138-.199Zm0-6.3A1.986 1.986 0 0 1 14.1 4.638c.426 1.2.208 2.718-1.033 3.157C11.86 8.221 10.344 8 9.9 6.762c-.425-1.2-.208-2.718 1.033-3.157a3.467 3.467 0 0 1 1.148-.199Z"/></svg>
@@ -303,3 +303,40 @@ $merchant10 = rgba(120, 144, 156, .1)
303
303
  $trafficDark = rgba(2165, 46, 111, 1)// #D82E6F
304
304
  $traffic = rgba(255, 124, 129, 1) // #ff7c81
305
305
  $traffic10 = rgba(255, 124, 129, .1)
306
+
307
+
308
+ // Products
309
+
310
+ $stores = #388aff
311
+ $stores10 = rgba($stores, .1)
312
+ $storesDark = #0D63DD
313
+
314
+ $localities = #009DFF
315
+ $localities10 = rgba($localities, .1)
316
+ $localitiesDark = #0085D8
317
+
318
+ $geolocation = #506BDE
319
+ $geolocation10 = rgba($geolocation, .1)
320
+ $geolocationDark = #1F40CC
321
+
322
+ $address = #4AC6F2
323
+ $address10 = rgba($address, .1)
324
+ $addressDark = #0D9ED1
325
+
326
+ $distance = #FF8A65
327
+ $distance10 = rgba($distance, .1)
328
+ $distanceDark = #E06138
329
+
330
+ $traffic = #FF6565
331
+ $traffic10 = rgba($traffic, .1)
332
+ $trafficDark = #E04B4B
333
+
334
+ $map = #A1887F
335
+ $map10 = rgba($map, .1)
336
+ $mapDark = #906455
337
+
338
+ $merchant = #08A278
339
+ $merchant10 = rgba($merchant, .1)
340
+ $merchantDark = #008863
341
+
342
+