homeflowjs 0.10.21 → 0.10.23

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.
@@ -14,6 +14,7 @@ const BranchesSearchInput = ({
14
14
  setIsSelected,
15
15
  label,
16
16
  isRequired,
17
+ submitOnSelect,
17
18
  }) => {
18
19
  const { branchesSearch } = useSelector((state) => state?.branches);
19
20
  const dispatch = useDispatch();
@@ -107,6 +108,10 @@ const BranchesSearchInput = ({
107
108
  * Check is setIsSelect exists as its is only passed as a prop on
108
109
  * countrywide themes, other themes will not use this.
109
110
  */
111
+ if (submitOnSelect) {
112
+ const form = document.querySelector('form[action="/branches"]');
113
+ form.submit();
114
+ }
110
115
  if (setIsSelected) setIsSelected(false);
111
116
  if (label) setInputFocused(true);
112
117
  return (
@@ -144,6 +149,7 @@ BranchesSearchInput.propTypes = {
144
149
  PropTypes.func,
145
150
  PropTypes.string,
146
151
  ]),
152
+ submitOnSelect: PropTypes.bool,
147
153
  };
148
154
 
149
155
  BranchesSearchInput.defaultProps = {
@@ -152,6 +158,7 @@ BranchesSearchInput.defaultProps = {
152
158
  isSelected: '',
153
159
  setIsSelected: '',
154
160
  isRequired: false,
161
+ submitOnSelect: false,
155
162
  };
156
163
 
157
164
  export default BranchesSearchInput;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "0.10.21",
3
+ "version": "0.10.23",
4
4
  "description": "JavaScript toolkit for Homeflow themes",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -58,7 +58,7 @@ export default class DraggableMap {
58
58
  this.setMarkersFor(properties);
59
59
  }
60
60
  if (this.noLocationfound) { this.setToMarkeredBounds(); }
61
- if (Homeflow.get('custom_map_zoom')) {
61
+ if (Homeflow.get('custom_map_zoom') !== null) {
62
62
  this.map.setZoom(Homeflow.get('custom_map_zoom'));
63
63
  }
64
64
  }
@@ -191,13 +191,14 @@ export default class DraggableMap {
191
191
  }
192
192
 
193
193
  generateMap(map_options) {
194
- const zoomMax = Homeflow.get('custom_max_zoom') ? Homeflow.get('custom_max_zoom') : 16;
194
+ const zoomMax = Homeflow.get('custom_max_zoom') !== null? Homeflow.get('custom_max_zoom') : 16;
195
+ const zoomMin = Homeflow.get('custom_min_zoom') !== null ? Homeflow.get('custom_min_zoom') : 6;
195
196
  const zoomPosition = Homeflow.get('custom_map_zoom_location') ? Homeflow.get('custom_map_zoom_location') : '';
196
197
 
197
198
  if (map_options == null) {
198
199
  map_options = {
199
200
  ...(zoomPosition !== '') && {zoomControl: false},
200
- minZoom: 6,
201
+ minZoom: zoomMin,
201
202
  maxZoom: zoomMax,
202
203
  scrollWheelZoom: Homeflow.get('enable_scroll_wheel_zoom'),
203
204
  dragging: !Homeflow.get('disable_draggable_map')
@@ -48,10 +48,11 @@ export default class DrawableMap extends DraggableMap {
48
48
 
49
49
  generateMap(map_options) {
50
50
  const zoomMax = Homeflow.get('custom_max_zoom') ? Homeflow.get('custom_max_zoom') : 16;
51
+ const zoomMin = Homeflow.get('custom_min_zoom') !== null ? Homeflow.get('custom_min_zoom') : 6;
51
52
  const drawLocation = Homeflow.get('custom_map_draw_location') ? Homeflow.get('custom_map_draw_location') : 'bottomleft';
52
53
 
53
54
  map_options = {
54
- minZoom: 6,
55
+ minZoom: zoomMin,
55
56
  maxZoom: zoomMax,
56
57
  scrollWheelZoom: Homeflow.get('enable_scroll_wheel_zoom'),
57
58
  'zoomControl': false,