@woosmap/ui 3.20.0 → 3.24.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": "3.20.0",
3
+ "version": "3.24.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/WebGeoServices/ui.git"
@@ -160,13 +160,13 @@ export default class SkeletonDemo extends Component {
160
160
  };
161
161
 
162
162
  render() {
163
- const { result, request, response, renderCode, withMap, mainContent } = this.props;
163
+ const { result, request, response, renderCode, withMap, mainContent, className } = this.props;
164
164
  const { copied } = this.state;
165
165
  const filters = this.renderHeaderFilters();
166
166
  const filters2 = this.renderFooterFilters();
167
167
  const tagLine = this.renderHeaderTagline();
168
168
  return (
169
- <article className="demo">
169
+ <article className={cl('demo', className)}>
170
170
  <div className="demo__content">
171
171
  <div className="demo__showcase">
172
172
  {(tagLine || filters || filters2) && (
@@ -176,10 +176,12 @@ export default class SkeletonDemo extends Component {
176
176
  {filters2}
177
177
  </div>
178
178
  )}
179
- <div className="demo__map">
180
- {withMap && <div className="map" ref={this.mapDivRef} />}
181
- {mainContent}
182
- </div>
179
+ {withMap && (
180
+ <div className="demo__map">
181
+ <div className="map" ref={this.mapDivRef} />
182
+ </div>
183
+ )}
184
+ {mainContent && <div className="demo__content">{mainContent}</div>}
183
185
  </div>
184
186
  <div className="demo__data">
185
187
  {result && (
@@ -249,6 +251,7 @@ SkeletonDemo.defaultProps = {
249
251
  body: '',
250
252
  method: '',
251
253
  withMap: false,
254
+ className: '',
252
255
  };
253
256
  SkeletonDemo.propTypes = {
254
257
  renderCode: PropTypes.func,
@@ -264,4 +267,5 @@ SkeletonDemo.propTypes = {
264
267
  body: PropTypes.string,
265
268
  method: PropTypes.string,
266
269
  response: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
270
+ className: PropTypes.string,
267
271
  };
@@ -10,13 +10,17 @@ function mapChildrenWithProps(children, childrenRefs, closeCb) {
10
10
  if (children) {
11
11
  return React.Children.map(children, (child, index) => {
12
12
  if (React.isValidElement(child)) {
13
+ // only add ref to non functional components
13
14
  return React.cloneElement(child, {
14
15
  ...child.props,
15
16
  closeCb,
16
- ref: (elem) => {
17
- // eslint-disable-next-line no-param-reassign
18
- childrenRefs[index] = elem;
19
- },
17
+ ref:
18
+ !child.type.prototype || (child.type.prototype && child.type.prototype.render)
19
+ ? (elem) => {
20
+ // eslint-disable-next-line no-param-reassign
21
+ childrenRefs[index] = elem;
22
+ }
23
+ : undefined,
20
24
  });
21
25
  }
22
26
  return child;
@@ -351,7 +355,7 @@ class Dropdown extends Component {
351
355
 
352
356
  return (
353
357
  <div
354
- ref={this.clickOutsideRef}
358
+ ref={openOnMouseEnter ? null : this.clickOutsideRef}
355
359
  className={cl('dropdown', { open }, `dropdown--${size}`, className)}
356
360
  {...rest}
357
361
  onMouseEnter={this.onMouseEnter}
@@ -3,6 +3,8 @@
3
3
  trans()
4
4
  display flex
5
5
  justify-content center
6
+ align-items center
7
+ height 100%
6
8
  width 100%
7
9
  zoom .9
8
10
  padding 2rem
@@ -10,7 +12,6 @@
10
12
  &__mobilewrapper
11
13
  trans()
12
14
  position relative
13
- height 100%
14
15
  margin 3rem
15
16
  &__mobilecontainer
16
17
  position relative
@@ -251,4 +251,6 @@
251
251
  border-bottom .1rem solid rgba($secondary, .1)
252
252
  border-right 0
253
253
  &__map
254
- height 32rem
254
+ height 32rem
255
+ .demo--merchant &
256
+ height auto