@ltht-react/table 1.0.137 → 1.0.138

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.
@@ -1,11 +1,11 @@
1
- import { QuestionnaireResponse, Questionnaire } from '@ltht-react/types';
2
- import { FC } from 'react';
3
- import { IPaginationProps, ITableDimensionProps, ITableConfig } from '../molecules/table';
4
- import { AdminActionsForQuestionnaire } from './questionnaire-table-methods';
5
- declare const QuestionnaireTable: FC<IProps>;
6
- interface IProps extends ITableConfig, IPaginationProps, ITableDimensionProps {
7
- definition: Questionnaire;
8
- records: QuestionnaireResponse[];
9
- adminActions?: AdminActionsForQuestionnaire[];
10
- }
11
- export default QuestionnaireTable;
1
+ import { QuestionnaireResponse, Questionnaire } from '@ltht-react/types';
2
+ import { FC } from 'react';
3
+ import { IPaginationProps, ITableDimensionProps, ITableConfig } from '../molecules/table';
4
+ import { AdminActionsForQuestionnaire } from './questionnaire-table-methods';
5
+ declare const QuestionnaireTable: FC<IProps>;
6
+ interface IProps extends ITableConfig, IPaginationProps, ITableDimensionProps {
7
+ definition: Questionnaire;
8
+ records: QuestionnaireResponse[];
9
+ adminActions?: AdminActionsForQuestionnaire[];
10
+ }
11
+ export default QuestionnaireTable;
@@ -1,45 +1,45 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
- var __importDefault = (this && this.__importDefault) || function (mod) {
25
- return (mod && mod.__esModule) ? mod : { "default": mod };
26
- };
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- var jsx_runtime_1 = require("react/jsx-runtime");
29
- var react_1 = require("react");
30
- var icon_1 = __importDefault(require("@ltht-react/icon"));
31
- var table_1 = __importDefault(require("../molecules/table"));
32
- var questionnaire_table_methods_1 = __importDefault(require("./questionnaire-table-methods"));
33
- var QuestionnaireTable = function (_a) {
34
- var definition = _a.definition, records = _a.records, _b = _a.headerAxis, headerAxis = _b === void 0 ? 'y' : _b, _c = _a.staticColumns, staticColumns = _c === void 0 ? 0 : _c, adminActions = _a.adminActions, _d = _a.pageSize, pageSize = _d === void 0 ? 10 : _d, _e = _a.currentPage, currentPage = _e === void 0 ? 1 : _e, _f = _a.keepPreviousData, keepPreviousData = _f === void 0 ? true : _f, props = __rest(_a, ["definition", "records", "headerAxis", "staticColumns", "adminActions", "pageSize", "currentPage", "keepPreviousData"]);
35
- var tableData = react_1.useMemo(function () { return questionnaire_table_methods_1.default(definition, records, headerAxis, adminActions); }, [headerAxis, definition, records, adminActions]);
36
- // TODO: Replace this fragment with a properly styled error component.
37
- // Maybe this could be a re-usable atom?
38
- if (!tableData) {
39
- return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [jsx_runtime_1.jsx(icon_1.default, { type: "exclamation", size: "large", color: "red" }, void 0),
40
- jsx_runtime_1.jsx("div", { children: "An error occurred whilst loading this table." }, void 0)] }, void 0));
41
- }
42
- return (jsx_runtime_1.jsx(table_1.default, __assign({ tableData: tableData, staticColumns: staticColumns, headerAxis: headerAxis, pageSize: pageSize, currentPage: currentPage, keepPreviousData: keepPreviousData }, props), void 0));
43
- };
44
- exports.default = QuestionnaireTable;
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ var jsx_runtime_1 = require("react/jsx-runtime");
29
+ var react_1 = require("react");
30
+ var icon_1 = __importDefault(require("@ltht-react/icon"));
31
+ var table_1 = __importDefault(require("../molecules/table"));
32
+ var questionnaire_table_methods_1 = __importDefault(require("./questionnaire-table-methods"));
33
+ var QuestionnaireTable = function (_a) {
34
+ var definition = _a.definition, records = _a.records, _b = _a.headerAxis, headerAxis = _b === void 0 ? 'y' : _b, _c = _a.staticColumns, staticColumns = _c === void 0 ? 0 : _c, adminActions = _a.adminActions, _d = _a.pageSize, pageSize = _d === void 0 ? 10 : _d, _e = _a.currentPage, currentPage = _e === void 0 ? 1 : _e, _f = _a.keepPreviousData, keepPreviousData = _f === void 0 ? true : _f, props = __rest(_a, ["definition", "records", "headerAxis", "staticColumns", "adminActions", "pageSize", "currentPage", "keepPreviousData"]);
35
+ var tableData = react_1.useMemo(function () { return questionnaire_table_methods_1.default(definition, records, headerAxis, adminActions); }, [headerAxis, definition, records, adminActions]);
36
+ // TODO: Replace this fragment with a properly styled error component.
37
+ // Maybe this could be a re-usable atom?
38
+ if (!tableData) {
39
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [jsx_runtime_1.jsx(icon_1.default, { type: "exclamation", size: "large", color: "red" }, void 0),
40
+ jsx_runtime_1.jsx("div", { children: "An error occurred whilst loading this table." }, void 0)] }, void 0));
41
+ }
42
+ return (jsx_runtime_1.jsx(table_1.default, __assign({ tableData: tableData, staticColumns: staticColumns, headerAxis: headerAxis, pageSize: pageSize, currentPage: currentPage, keepPreviousData: keepPreviousData }, props), void 0));
43
+ };
44
+ exports.default = QuestionnaireTable;
45
45
  //# sourceMappingURL=questionnaire-table.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ltht-react/table",
3
- "version": "1.0.137",
3
+ "version": "1.0.138",
4
4
  "description": "ltht-react Table component.",
5
5
  "author": "LTHT",
6
6
  "homepage": "",
@@ -27,17 +27,17 @@
27
27
  "dependencies": {
28
28
  "@emotion/react": "^11.0.0",
29
29
  "@emotion/styled": "^11.0.0",
30
- "@ltht-react/button": "^1.3.262",
31
- "@ltht-react/icon": "^1.3.262",
32
- "@ltht-react/menu": "^1.0.104",
33
- "@ltht-react/styles": "^1.3.254",
34
- "@ltht-react/types": "^1.0.258",
35
- "@ltht-react/utils": "^1.1.260",
30
+ "@ltht-react/button": "^1.3.263",
31
+ "@ltht-react/icon": "^1.3.263",
32
+ "@ltht-react/menu": "^1.0.105",
33
+ "@ltht-react/styles": "^1.3.255",
34
+ "@ltht-react/types": "^1.0.259",
35
+ "@ltht-react/utils": "^1.1.261",
36
36
  "@tanstack/react-table": "^8.5.22",
37
37
  "react": "^17.0.0",
38
38
  "react-uuid": "^2.0.0"
39
39
  },
40
- "gitHead": "8dd6d6fade59184e452db27590434db55ca571a0",
40
+ "gitHead": "b82831796fe091fa1ffef6c1825a119dd03e5bbc",
41
41
  "devDependencies": {
42
42
  "@types/react-table": "^7.7.12"
43
43
  }