@longline/aqua-ui 1.0.128 → 1.0.129

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.
@@ -41,7 +41,8 @@ var TableBase = function (_a) {
41
41
  var auxRef = React.useRef(null);
42
42
  var activeColumns = props.columns.filter(function (c) { return c.active; });
43
43
  var _b = React.useState(null), activeRef = _b[0], setActiveRef = _b[1];
44
- var _c = usePopper(activeRef, auxRef.current, {
44
+ var _c = React.useState(0), time = _c[0], setTime = _c[1];
45
+ var _d = usePopper(activeRef, auxRef.current, {
45
46
  placement: 'right-start',
46
47
  modifiers: [
47
48
  {
@@ -51,7 +52,7 @@ var TableBase = function (_a) {
51
52
  },
52
53
  }, {
53
54
  name: 'flip',
54
- enabled: false
55
+ enabled: true
55
56
  }, {
56
57
  name: 'preventOverflow',
57
58
  options: {
@@ -61,11 +62,24 @@ var TableBase = function (_a) {
61
62
  }
62
63
  }
63
64
  ]
64
- }), styles = _c.styles, attributes = _c.attributes, update = _c.update;
65
+ }), styles = _d.styles, attributes = _d.attributes, update = _d.update, forceUpdate = _d.forceUpdate;
65
66
  React.useEffect(function () {
66
67
  if (update)
67
68
  update();
68
- }, [props.active]);
69
+ }, [activeRef, time]);
70
+ // We use a ResizeObserver to detect changes in the size of aux.
71
+ // This is because the content of an InfoBox may change, and the Infobox
72
+ // may then grow or shrink. If its position isn't updated, then the Infobox
73
+ // may suddenly run off the screen.
74
+ // When a resize is detected, we reposition the aux.
75
+ React.useEffect(function () {
76
+ var resizeObserver = new ResizeObserver(function () {
77
+ // Update component state so that we can update popper.
78
+ setTime(Math.random());
79
+ });
80
+ resizeObserver.observe(auxRef.current);
81
+ return function () { return resizeObserver.disconnect(); };
82
+ }, [auxRef]);
69
83
  return (React.createElement(Wrapper, { "$dark": props.dark },
70
84
  props.columnsMode &&
71
85
  React.createElement(Anchor, { right: "32px", top: "64px" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longline/aqua-ui",
3
- "version": "1.0.128",
3
+ "version": "1.0.129",
4
4
  "description": "AquaUI",
5
5
  "author": "Alexander van Oostenrijk / Longline Environment",
6
6
  "license": "Commercial",