@tenancy.nz/reports 1.1.2 → 1.1.4

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.
@@ -22,7 +22,13 @@ function OwnerBookingReport(_ref) {
22
22
  notes = _ref$eventData.notes,
23
23
  _ref$eventData$proper = _ref$eventData.property,
24
24
  property = _ref$eventData$proper === void 0 ? {} : _ref$eventData$proper,
25
- stats = _ref$eventData.stats;
25
+ stats = _ref$eventData.stats,
26
+ _ref$eventData$includ = _ref$eventData.includes,
27
+ includes = _ref$eventData$includ === void 0 ? {} : _ref$eventData$includ;
28
+ var _includes$sections = includes.sections,
29
+ sections = _includes$sections === void 0 ? [] : _includes$sections,
30
+ _includes$bookingTabl = includes.bookingTableColumns,
31
+ bookingTableColumns = _includes$bookingTabl === void 0 ? "all" : _includes$bookingTabl;
26
32
  return /* @__PURE__ */React.createElement(ui.ThemeProvider, null, /* @__PURE__ */React.createElement(ui.Box, {
27
33
  width: "100%"
28
34
  }, /* @__PURE__ */React.createElement(ui.Grid, {
@@ -111,14 +117,12 @@ function OwnerBookingReport(_ref) {
111
117
  xs: 12
112
118
  }, /* @__PURE__ */React.createElement(ui.Paper, {
113
119
  inset: "medium",
114
- sx: {
115
- height: "100%"
116
- },
117
120
  outlined: true
118
121
  }, /* @__PURE__ */React.createElement(featureUi.BookingChart, {
119
122
  data: chart.data || [],
120
- labels: chart.labels || []
121
- }))), /* @__PURE__ */React.createElement(ui.Grid, {
123
+ labels: chart.labels || [],
124
+ mode: "day"
125
+ }))), sections.includes("bookings") && /* @__PURE__ */React.createElement(ui.Grid, {
122
126
  item: true,
123
127
  xs: 12
124
128
  }, /* @__PURE__ */React.createElement(ui.Heading, {
@@ -128,15 +132,16 @@ function OwnerBookingReport(_ref) {
128
132
  mb: "20px"
129
133
  }
130
134
  }, "Bookings"), /* @__PURE__ */React.createElement(featureUi.BookingTable, {
135
+ columns: bookingTableColumns,
131
136
  data: bookings,
132
137
  loading: loading
133
- })), /* @__PURE__ */React.createElement(ui.Grid, {
138
+ })), sections.includes("notes") && /* @__PURE__ */React.createElement(ui.Grid, {
134
139
  item: true,
135
140
  xs: 12
136
141
  }, /* @__PURE__ */React.createElement(ui.Heading, {
137
142
  as: "h4",
138
143
  weight: "700"
139
- }, "Viewing notes")), loading && /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(ui.Grid, {
144
+ }, "Viewing notes")), sections.includes("notes") && loading && /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(ui.Grid, {
140
145
  item: true,
141
146
  xs: 6
142
147
  }, /* @__PURE__ */React.createElement(featureUi.NotesCard, {
@@ -148,7 +153,7 @@ function OwnerBookingReport(_ref) {
148
153
  }, /* @__PURE__ */React.createElement(featureUi.NotesCard, {
149
154
  loading: true,
150
155
  text: ""
151
- })))), !loading && notes && notes.length && notes.map(function (_ref2, i) {
156
+ })))), !loading && sections.includes("notes") && notes && notes.length && notes.map(function (_ref2, i) {
152
157
  var label = _ref2.label,
153
158
  data = _ref2.data;
154
159
  return /* @__PURE__ */React.createElement(ui.Box, {
@@ -186,7 +191,14 @@ function OwnerBookingReport(_ref) {
186
191
  outlined: true
187
192
  }));
188
193
  })));
189
- })));
194
+ }), sections.includes("moreViewingsRequired") && /* @__PURE__ */React.createElement(ui.Heading, {
195
+ as: "h6",
196
+ weight: "700",
197
+ sx: {
198
+ mt: 5,
199
+ mb: 2
200
+ }
201
+ }, "* More viewings are required to be conducted on this property")));
190
202
  }
191
203
  OwnerBookingReport.Header = ReportHeader.default;
192
204
  OwnerBookingReport.Footer = ReportFooter.default;
@@ -3,19 +3,31 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var ui = require('@tenancy.nz/ui');
7
6
 
7
+ var styles = {
8
+ container: {
9
+ marginTop: "24px",
10
+ color: "#595959",
11
+ width: "100%"
12
+ },
13
+ text: {
14
+ fontStyle: "italic",
15
+ color: "inherit",
16
+ fontWeight: "300",
17
+ fontSize: "14px",
18
+ lineHeight: "1.43",
19
+ fontFamily: "inherit",
20
+ margin: "0",
21
+ padding: "0"
22
+ }
23
+ };
8
24
  function ReportFooter(_ref) {
9
25
  var eventData = _ref.eventData;
10
26
  var text = eventData.text;
11
- return /* @__PURE__ */React.createElement(ui.Box, {
12
- mt: "24px",
13
- color: "#595959"
14
- }, /* @__PURE__ */React.createElement(ui.Text, {
15
- as: "div",
16
- variant: "body2",
17
- weight: "300",
18
- italic: true
27
+ return /* @__PURE__ */React.createElement("div", {
28
+ style: styles.container
29
+ }, /* @__PURE__ */React.createElement("div", {
30
+ style: styles.text
19
31
  }, text || "This PDF is for - purposes."));
20
32
  }
21
33
 
@@ -3,52 +3,66 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var ui = require('@tenancy.nz/ui');
7
6
 
7
+ var styles = {
8
+ container: {
9
+ marginBottom: "24px",
10
+ borderBottom: "1px solid #E0E0E0",
11
+ paddingBottom: "8px",
12
+ display: "flex",
13
+ alignItems: "flex-start",
14
+ color: "#0e0044",
15
+ width: "100%"
16
+ },
17
+ heading: {
18
+ fontSize: "32px",
19
+ fontWeight: "700",
20
+ padding: "0",
21
+ margin: "0 0 8px 0",
22
+ lineHeight: "1.3",
23
+ color: "inherit",
24
+ fontFamily: "inherit"
25
+ },
26
+ subheading: {
27
+ fontSize: "17px",
28
+ fontWeight: "500",
29
+ padding: "0",
30
+ margin: "0",
31
+ lineHeight: "1.3",
32
+ color: "inherit",
33
+ fontFamily: "inherit"
34
+ },
35
+ imgContainer: {
36
+ width: "150px",
37
+ height: "35px"
38
+ },
39
+ img: {
40
+ maxWidth: "100%",
41
+ maxHeight: "100%"
42
+ }
43
+ };
8
44
  function ReportHeader(_ref) {
9
45
  var eventData = _ref.eventData;
10
46
  var heading = eventData.heading,
11
47
  subheading = eventData.subheading,
12
48
  logo = eventData.logo;
13
- return /* @__PURE__ */React.createElement(ui.Box, {
14
- mb: "24px",
15
- borderBottom: "1px solid #E0E0E0",
16
- paddingBottom: "8px"
17
- }, /* @__PURE__ */React.createElement(ui.Grid, {
18
- container: true,
19
- spacing: 6
20
- }, /* @__PURE__ */React.createElement(ui.Grid, {
21
- item: true,
22
- xs: 8
23
- }, /* @__PURE__ */React.createElement(ui.Heading, {
24
- as: "h1",
25
- weight: "700",
26
- sx: {
27
- mb: "8px"
28
- }
29
- }, heading), subheading && /* @__PURE__ */React.createElement(ui.Heading, {
30
- as: "h5",
31
- weight: "500"
32
- }, subheading)), /* @__PURE__ */React.createElement(ui.Grid, {
33
- item: true,
34
- xs: 4,
35
- sx: {
36
- display: "flex",
37
- justifyContent: "flex-end"
38
- }
39
- }, logo && /* @__PURE__ */React.createElement(ui.Box, {
40
- sx: {
41
- width: "150px",
42
- height: "35px",
43
- "> img": {
44
- maxWidth: "100%",
45
- maxHeight: "100%"
46
- }
49
+ return /* @__PURE__ */React.createElement("div", {
50
+ style: styles.container
51
+ }, /* @__PURE__ */React.createElement("div", {
52
+ style: {
53
+ width: "100%"
47
54
  }
55
+ }, /* @__PURE__ */React.createElement("h1", {
56
+ style: styles.heading
57
+ }, heading), /* @__PURE__ */React.createElement("h5", {
58
+ style: styles.subheading
59
+ }, subheading)), /* @__PURE__ */React.createElement("div", {
60
+ style: styles.imgContainer
48
61
  }, /* @__PURE__ */React.createElement("img", {
49
62
  src: logo,
50
- alt: "Tenancy"
51
- })))));
63
+ alt: "Tenancy",
64
+ style: styles.img
65
+ })));
52
66
  }
53
67
 
54
68
  exports.default = ReportHeader;
@@ -18,7 +18,13 @@ function OwnerBookingReport(_ref) {
18
18
  notes = _ref$eventData.notes,
19
19
  _ref$eventData$proper = _ref$eventData.property,
20
20
  property = _ref$eventData$proper === void 0 ? {} : _ref$eventData$proper,
21
- stats = _ref$eventData.stats;
21
+ stats = _ref$eventData.stats,
22
+ _ref$eventData$includ = _ref$eventData.includes,
23
+ includes = _ref$eventData$includ === void 0 ? {} : _ref$eventData$includ;
24
+ var _includes$sections = includes.sections,
25
+ sections = _includes$sections === void 0 ? [] : _includes$sections,
26
+ _includes$bookingTabl = includes.bookingTableColumns,
27
+ bookingTableColumns = _includes$bookingTabl === void 0 ? "all" : _includes$bookingTabl;
22
28
  return /* @__PURE__ */React.createElement(ThemeProvider, null, /* @__PURE__ */React.createElement(Box, {
23
29
  width: "100%"
24
30
  }, /* @__PURE__ */React.createElement(Grid, {
@@ -107,14 +113,12 @@ function OwnerBookingReport(_ref) {
107
113
  xs: 12
108
114
  }, /* @__PURE__ */React.createElement(Paper, {
109
115
  inset: "medium",
110
- sx: {
111
- height: "100%"
112
- },
113
116
  outlined: true
114
117
  }, /* @__PURE__ */React.createElement(BookingChart, {
115
118
  data: chart.data || [],
116
- labels: chart.labels || []
117
- }))), /* @__PURE__ */React.createElement(Grid, {
119
+ labels: chart.labels || [],
120
+ mode: "day"
121
+ }))), sections.includes("bookings") && /* @__PURE__ */React.createElement(Grid, {
118
122
  item: true,
119
123
  xs: 12
120
124
  }, /* @__PURE__ */React.createElement(Heading, {
@@ -124,15 +128,16 @@ function OwnerBookingReport(_ref) {
124
128
  mb: "20px"
125
129
  }
126
130
  }, "Bookings"), /* @__PURE__ */React.createElement(BookingTable, {
131
+ columns: bookingTableColumns,
127
132
  data: bookings,
128
133
  loading: loading
129
- })), /* @__PURE__ */React.createElement(Grid, {
134
+ })), sections.includes("notes") && /* @__PURE__ */React.createElement(Grid, {
130
135
  item: true,
131
136
  xs: 12
132
137
  }, /* @__PURE__ */React.createElement(Heading, {
133
138
  as: "h4",
134
139
  weight: "700"
135
- }, "Viewing notes")), loading && /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(Grid, {
140
+ }, "Viewing notes")), sections.includes("notes") && loading && /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(Grid, {
136
141
  item: true,
137
142
  xs: 6
138
143
  }, /* @__PURE__ */React.createElement(NotesCard, {
@@ -144,7 +149,7 @@ function OwnerBookingReport(_ref) {
144
149
  }, /* @__PURE__ */React.createElement(NotesCard, {
145
150
  loading: true,
146
151
  text: ""
147
- })))), !loading && notes && notes.length && notes.map(function (_ref2, i) {
152
+ })))), !loading && sections.includes("notes") && notes && notes.length && notes.map(function (_ref2, i) {
148
153
  var label = _ref2.label,
149
154
  data = _ref2.data;
150
155
  return /* @__PURE__ */React.createElement(Box, {
@@ -182,7 +187,14 @@ function OwnerBookingReport(_ref) {
182
187
  outlined: true
183
188
  }));
184
189
  })));
185
- })));
190
+ }), sections.includes("moreViewingsRequired") && /* @__PURE__ */React.createElement(Heading, {
191
+ as: "h6",
192
+ weight: "700",
193
+ sx: {
194
+ mt: 5,
195
+ mb: 2
196
+ }
197
+ }, "* More viewings are required to be conducted on this property")));
186
198
  }
187
199
  OwnerBookingReport.Header = ReportHeader;
188
200
  OwnerBookingReport.Footer = ReportFooter;
@@ -1,17 +1,29 @@
1
1
  import React from 'react';
2
- import { Box, Text } from '@tenancy.nz/ui';
3
2
 
3
+ var styles = {
4
+ container: {
5
+ marginTop: "24px",
6
+ color: "#595959",
7
+ width: "100%"
8
+ },
9
+ text: {
10
+ fontStyle: "italic",
11
+ color: "inherit",
12
+ fontWeight: "300",
13
+ fontSize: "14px",
14
+ lineHeight: "1.43",
15
+ fontFamily: "inherit",
16
+ margin: "0",
17
+ padding: "0"
18
+ }
19
+ };
4
20
  function ReportFooter(_ref) {
5
21
  var eventData = _ref.eventData;
6
22
  var text = eventData.text;
7
- return /* @__PURE__ */React.createElement(Box, {
8
- mt: "24px",
9
- color: "#595959"
10
- }, /* @__PURE__ */React.createElement(Text, {
11
- as: "div",
12
- variant: "body2",
13
- weight: "300",
14
- italic: true
23
+ return /* @__PURE__ */React.createElement("div", {
24
+ style: styles.container
25
+ }, /* @__PURE__ */React.createElement("div", {
26
+ style: styles.text
15
27
  }, text || "This PDF is for - purposes."));
16
28
  }
17
29
 
@@ -1,50 +1,64 @@
1
1
  import React from 'react';
2
- import { Box, Grid, Heading } from '@tenancy.nz/ui';
3
2
 
3
+ var styles = {
4
+ container: {
5
+ marginBottom: "24px",
6
+ borderBottom: "1px solid #E0E0E0",
7
+ paddingBottom: "8px",
8
+ display: "flex",
9
+ alignItems: "flex-start",
10
+ color: "#0e0044",
11
+ width: "100%"
12
+ },
13
+ heading: {
14
+ fontSize: "32px",
15
+ fontWeight: "700",
16
+ padding: "0",
17
+ margin: "0 0 8px 0",
18
+ lineHeight: "1.3",
19
+ color: "inherit",
20
+ fontFamily: "inherit"
21
+ },
22
+ subheading: {
23
+ fontSize: "17px",
24
+ fontWeight: "500",
25
+ padding: "0",
26
+ margin: "0",
27
+ lineHeight: "1.3",
28
+ color: "inherit",
29
+ fontFamily: "inherit"
30
+ },
31
+ imgContainer: {
32
+ width: "150px",
33
+ height: "35px"
34
+ },
35
+ img: {
36
+ maxWidth: "100%",
37
+ maxHeight: "100%"
38
+ }
39
+ };
4
40
  function ReportHeader(_ref) {
5
41
  var eventData = _ref.eventData;
6
42
  var heading = eventData.heading,
7
43
  subheading = eventData.subheading,
8
44
  logo = eventData.logo;
9
- return /* @__PURE__ */React.createElement(Box, {
10
- mb: "24px",
11
- borderBottom: "1px solid #E0E0E0",
12
- paddingBottom: "8px"
13
- }, /* @__PURE__ */React.createElement(Grid, {
14
- container: true,
15
- spacing: 6
16
- }, /* @__PURE__ */React.createElement(Grid, {
17
- item: true,
18
- xs: 8
19
- }, /* @__PURE__ */React.createElement(Heading, {
20
- as: "h1",
21
- weight: "700",
22
- sx: {
23
- mb: "8px"
24
- }
25
- }, heading), subheading && /* @__PURE__ */React.createElement(Heading, {
26
- as: "h5",
27
- weight: "500"
28
- }, subheading)), /* @__PURE__ */React.createElement(Grid, {
29
- item: true,
30
- xs: 4,
31
- sx: {
32
- display: "flex",
33
- justifyContent: "flex-end"
34
- }
35
- }, logo && /* @__PURE__ */React.createElement(Box, {
36
- sx: {
37
- width: "150px",
38
- height: "35px",
39
- "> img": {
40
- maxWidth: "100%",
41
- maxHeight: "100%"
42
- }
45
+ return /* @__PURE__ */React.createElement("div", {
46
+ style: styles.container
47
+ }, /* @__PURE__ */React.createElement("div", {
48
+ style: {
49
+ width: "100%"
43
50
  }
51
+ }, /* @__PURE__ */React.createElement("h1", {
52
+ style: styles.heading
53
+ }, heading), /* @__PURE__ */React.createElement("h5", {
54
+ style: styles.subheading
55
+ }, subheading)), /* @__PURE__ */React.createElement("div", {
56
+ style: styles.imgContainer
44
57
  }, /* @__PURE__ */React.createElement("img", {
45
58
  src: logo,
46
- alt: "Tenancy"
47
- })))));
59
+ alt: "Tenancy",
60
+ style: styles.img
61
+ })));
48
62
  }
49
63
 
50
64
  export { ReportHeader as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tenancy.nz/reports",
3
3
  "description": "React UI reporting components.",
4
- "version": "1.1.2",
4
+ "version": "1.1.4",
5
5
  "author": "TPS <https://www.tenancy.co.nz>",
6
6
  "license": "ISC",
7
7
  "type": "module",
@@ -14,12 +14,12 @@
14
14
  "peerDependencies": {
15
15
  "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
16
16
  "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
17
- "@tenancy.nz/feature-ui": "1.1.2",
18
- "@tenancy.nz/ui": "1.1.2"
17
+ "@tenancy.nz/feature-ui": "1.1.4",
18
+ "@tenancy.nz/ui": "1.1.4"
19
19
  },
20
20
  "devDependencies": {
21
- "@tenancy.nz/feature-ui": "1.1.2",
22
- "@tenancy.nz/ui": "1.1.2"
21
+ "@tenancy.nz/feature-ui": "1.1.4",
22
+ "@tenancy.nz/ui": "1.1.4"
23
23
  },
24
24
  "dependencies": {
25
25
  "react-uid": "^2.4.0"