@longline/aqua-ui 1.0.208 → 1.0.209

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.
@@ -60,7 +60,7 @@ interface IListViewProps {
60
60
  }>;
61
61
  /**
62
62
  * Component to show when there is no data (`data` is `null` or `data` is `[]`).
63
- * The component is placed under the header, and the component is responsable
63
+ * The component is placed under the header, and the component is responsible
64
64
  * for any styling.
65
65
  * If not set, a default component is shown.
66
66
  * If set to `false`, no component is shown at all.
@@ -43,7 +43,8 @@ var TableBase = function (_a) {
43
43
  var activeColumns = props.columns.filter(function (c) { return c.active; });
44
44
  var _b = React.useState(null), activeRef = _b[0], setActiveRef = _b[1];
45
45
  var _c = React.useState(0), time = _c[0], setTime = _c[1];
46
- var _d = usePopper(activeRef, auxRef.current, {
46
+ var _d = React.useState(false), showingNoData = _d[0], setShowingNoData = _d[1];
47
+ var _e = usePopper(activeRef, auxRef.current, {
47
48
  placement: 'right-start',
48
49
  modifiers: [
49
50
  {
@@ -63,7 +64,7 @@ var TableBase = function (_a) {
63
64
  }
64
65
  }
65
66
  ]
66
- }), styles = _d.styles, attributes = _d.attributes, update = _d.update;
67
+ }), styles = _e.styles, attributes = _e.attributes, update = _e.update;
67
68
  React.useEffect(function () {
68
69
  if (update)
69
70
  update();
@@ -93,12 +94,22 @@ var TableBase = function (_a) {
93
94
  }
94
95
  }
95
96
  }, [activeRef]);
97
+ React.useEffect(function () {
98
+ var _a;
99
+ if ((!Array.isArray(props.data) || ((_a = props.data) === null || _a === void 0 ? void 0 : _a.length) === 0) && !props.ghost) {
100
+ var id_1 = requestAnimationFrame(function () { return setShowingNoData(true); });
101
+ return function () { return cancelAnimationFrame(id_1); };
102
+ }
103
+ else {
104
+ setShowingNoData(false);
105
+ }
106
+ return function () { };
107
+ }, [props.data, props.ghost]);
96
108
  return (React.createElement(Wrapper, { "$dark": props.dark },
97
109
  props.columnsMode &&
98
110
  React.createElement(Anchor, { right: "32px", top: "64px" },
99
111
  React.createElement(ColumnsManager, { columns: props.columns, onChange: props.onChangeColumns, onClose: props.onCloseColumns, onReset: props.onResetColumns })),
100
- (!Array.isArray(props.data) || props.data.length == 0) &&
101
- React.createElement(NoData, { dark: props.dark, component: props.noData }),
112
+ showingNoData && React.createElement(NoData, { dark: props.dark, component: props.noData }),
102
113
  React.createElement(AuxHolder, __assign({ ref: auxRef, style: __assign({ visibility: (props.active && props.aux && Array.isArray(props.data) && props.data.includes(props.active)) ? 'visible' : 'hidden' }, styles.popper) }, attributes.popper), (props.active && props.aux && Array.isArray(props.data) && props.data.includes(props.active)) && React.cloneElement(props.aux, { value: props.active })),
103
114
  React.createElement(OverlayScrollbarsComponent, { ref: innerRef, defer: true, options: { scrollbars: { theme: 'os-theme-light', autoHide: 'leave' } }, style: {
104
115
  position: "absolute",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longline/aqua-ui",
3
- "version": "1.0.208",
3
+ "version": "1.0.209",
4
4
  "description": "AquaUI",
5
5
  "author": "Alexander van Oostenrijk / Longline Environment",
6
6
  "license": "Commercial",