@longline/aqua-ui 1.0.20 → 1.0.22

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.
@@ -4,6 +4,10 @@ interface IColumnProps {
4
4
  * Column name, e.g. "Number of Users"
5
5
  */
6
6
  name: string;
7
+ /**
8
+ * Optional label. `name` will be used if not specified.
9
+ */
10
+ label?: React.ReactNode;
7
11
  /**
8
12
  * Column width. If a number, e.g. `1`, then it is the column's weight,
9
13
  * relative to other columns. If it is a string, e.g. `50px`, then it is
@@ -19,9 +19,9 @@ var GhostBase = function (props) {
19
19
  return (React.createElement("div", { className: props.className },
20
20
  React.createElement("div", { className: "mask1" }),
21
21
  React.createElement("div", { className: "mask2" }),
22
- props.onCheck && React.createElement(Cell, { "$dark": props.dark, "$shadow": props.shadow, "$content": false }),
23
- props.columns.filter(function (c) { return c.active; }).map(function (c, idx) { return React.createElement(Cell, { "$dark": props.dark, "$shadow": props.shadow, "$content": true, key: idx }); }),
24
- props.columnsEditable && React.createElement(Cell, { "$dark": props.dark, "$shadow": props.shadow, "$content": false })));
22
+ !props.noheader && props.onCheck && React.createElement(Cell, { "$dark": props.dark, "$shadow": props.shadow, "$content": false }),
23
+ !props.noheader && props.columns.filter(function (c) { return c.active; }).map(function (c, idx) { return React.createElement(Cell, { "$dark": props.dark, "$shadow": props.shadow, "$content": true, key: idx }); }),
24
+ !props.noheader && props.columnsEditable && React.createElement(Cell, { "$dark": props.dark, "$shadow": props.shadow, "$content": false })));
25
25
  };
26
26
  var Pulse = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 0% {\n background-position-x: 0px;\n }\n 100% {\n background-position-x: 250px;\n }\n"], ["\n 0% {\n background-position-x: 0px;\n }\n 100% {\n background-position-x: 250px;\n }\n"])));
27
27
  var Pulse2 = keyframes(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n 0% {\n background-position-x: 125px;\n }\n 50% {\n background-position-x: 250px; \n }\n 50.1% {\n background-position-x: 0px; \n } \n 100% {\n background-position-x: 125px;\n }\n"], ["\n 0% {\n background-position-x: 125px;\n }\n 50% {\n background-position-x: 250px; \n }\n 50.1% {\n background-position-x: 0px; \n } \n 100% {\n background-position-x: 125px;\n }\n"])));
@@ -17,6 +17,7 @@ import * as React from 'react';
17
17
  import styled from 'styled-components';
18
18
  import { SortButton } from './SortButton';
19
19
  var HeaderCellBase = function (props) {
20
+ var _a;
20
21
  var sorted = props.sort == props.column.sort;
21
22
  return (React.createElement("th", {
22
23
  // Sorted column gets .sorted class:
@@ -24,8 +25,8 @@ var HeaderCellBase = function (props) {
24
25
  // Sortable column has pointer cursor:
25
26
  cursor: props.column.sort ? 'pointer' : 'auto'
26
27
  }, onClick: (props.column.sort && props.onSortClick) ? function () { return props.onSortClick(props.column); } : null },
27
- React.createElement("span", null, props.column.name),
28
- React.createElement(SortButton, { dark: props.dark, active: sorted,
28
+ React.createElement("div", { style: { width: '100%' } }, (_a = props.column.label) !== null && _a !== void 0 ? _a : props.column.name),
29
+ props.column.sort && React.createElement(SortButton, { dark: props.dark, active: sorted,
29
30
  // If currently sorted, show sort direction.
30
31
  // If not currently sorted, show default sort direction.
31
32
  reverse: sorted ? props.reverse : props.column.reverse })));
@@ -3,6 +3,11 @@ interface IListViewProps {
3
3
  * Array of data to show in the table
4
4
  */
5
5
  data: any[];
6
+ /**
7
+ * If set, show no header.
8
+ * @default false
9
+ */
10
+ noheader?: boolean;
6
11
  /**
7
12
  * Does this `ListView` use the `dark` style?
8
13
  * @default false
@@ -11,7 +11,7 @@ interface IProps extends IListViewProps {
11
11
  children?: React.ReactElement<IColumnProps> | React.ReactElement<IColumnProps>[];
12
12
  }
13
13
  declare const ListView: {
14
- ({ dark, hover, striped, grid, total, singular, plural, narrow, shadow, ghost, columnsEditable, ...props }: IProps): React.JSX.Element;
14
+ ({ dark, noheader, hover, striped, grid, total, singular, plural, narrow, shadow, ghost, columnsEditable, ...props }: IProps): React.JSX.Element;
15
15
  Column: {
16
16
  (_: IColumnProps): null;
17
17
  displayName: string;
@@ -90,8 +90,8 @@ var ListViewBase = function (props) {
90
90
  };
91
91
  // Wrapper for default values:
92
92
  var ListView = function (_a) {
93
- var _b = _a.dark, dark = _b === void 0 ? false : _b, _c = _a.hover, hover = _c === void 0 ? false : _c, _d = _a.striped, striped = _d === void 0 ? false : _d, _e = _a.grid, grid = _e === void 0 ? false : _e, _f = _a.total, total = _f === void 0 ? false : _f, _g = _a.singular, singular = _g === void 0 ? "record" : _g, _h = _a.plural, plural = _h === void 0 ? "records" : _h, _j = _a.narrow, narrow = _j === void 0 ? false : _j, _k = _a.shadow, shadow = _k === void 0 ? false : _k, _l = _a.ghost, ghost = _l === void 0 ? false : _l, _m = _a.columnsEditable, columnsEditable = _m === void 0 ? false : _m, props = __rest(_a, ["dark", "hover", "striped", "grid", "total", "singular", "plural", "narrow", "shadow", "ghost", "columnsEditable"]);
94
- return React.createElement(ListViewBase, __assign({ dark: dark, hover: hover, striped: striped, grid: grid, total: total, singular: singular, plural: plural, narrow: narrow, shadow: shadow, ghost: ghost, columnsEditable: columnsEditable }, props));
93
+ var _b = _a.dark, dark = _b === void 0 ? false : _b, _c = _a.noheader, noheader = _c === void 0 ? false : _c, _d = _a.hover, hover = _d === void 0 ? false : _d, _e = _a.striped, striped = _e === void 0 ? false : _e, _f = _a.grid, grid = _f === void 0 ? false : _f, _g = _a.total, total = _g === void 0 ? false : _g, _h = _a.singular, singular = _h === void 0 ? "record" : _h, _j = _a.plural, plural = _j === void 0 ? "records" : _j, _k = _a.narrow, narrow = _k === void 0 ? false : _k, _l = _a.shadow, shadow = _l === void 0 ? false : _l, _m = _a.ghost, ghost = _m === void 0 ? false : _m, _o = _a.columnsEditable, columnsEditable = _o === void 0 ? false : _o, props = __rest(_a, ["dark", "noheader", "hover", "striped", "grid", "total", "singular", "plural", "narrow", "shadow", "ghost", "columnsEditable"]);
94
+ return React.createElement(ListViewBase, __assign({ dark: dark, noheader: noheader, hover: hover, striped: striped, grid: grid, total: total, singular: singular, plural: plural, narrow: narrow, shadow: shadow, ghost: ghost, columnsEditable: columnsEditable }, props));
95
95
  };
96
96
  ListView.Column = Column;
97
97
  export { ListView };
@@ -71,7 +71,7 @@ var TableBase = function (_a) {
71
71
  React.createElement(AuxHolder, { ref: auxRef, style: { visibility: (props.active && props.aux && props.data.includes(props.active)) ? 'visible' : 'hidden' } }, (props.active && props.aux && props.data.includes(props.active)) && React.cloneElement(props.aux, { value: props.active })),
72
72
  React.createElement(Inner, { onScroll: handleScroll, ref: innerRef },
73
73
  React.createElement("table", { className: className },
74
- React.createElement(Header, __assign({}, props, { columns: activeColumns, onOpenColumns: props.onOpenColumns })),
74
+ props.noheader != true && React.createElement(Header, __assign({}, props, { columns: activeColumns, onOpenColumns: props.onOpenColumns })),
75
75
  React.createElement(Body, __assign({}, props, { columns: activeColumns })))),
76
76
  props.total && React.createElement(Total, { value: props.data.length, singular: props.singular, plural: props.plural })));
77
77
  };
@@ -0,0 +1 @@
1
+ export { ListView } from './ListView';
@@ -0,0 +1 @@
1
+ export { ListView } from './ListView';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longline/aqua-ui",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "AquaUI",
5
5
  "author": "Alexander van Oostenrijk / Longline Environment",
6
6
  "license": "Commercial",