@tenancy.nz/feature-ui 1.5.6 → 1.5.8
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.
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var reactUid = require('react-uid');
|
|
7
|
+
var Stack = require('@mui/material/Stack');
|
|
8
|
+
var useMediaQuery = require('@mui/material/useMediaQuery');
|
|
9
|
+
var ui = require('@tenancy.nz/ui');
|
|
10
|
+
var AnalyticsBox = require('./AnalyticsBox.cjs');
|
|
11
|
+
var analyticsDoughnutChart = require('./analytics-doughnut-chart.cjs');
|
|
12
|
+
|
|
13
|
+
var styles = {
|
|
14
|
+
chartPaper: {
|
|
15
|
+
height: "100%",
|
|
16
|
+
width: "100%",
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
justifyContent: "center",
|
|
19
|
+
display: "flex"
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
function PDFAnalyticsSection(_ref) {
|
|
23
|
+
var viewingsCount = _ref.viewingsCount,
|
|
24
|
+
bookingsCount = _ref.bookingsCount,
|
|
25
|
+
attendeesCount = _ref.attendeesCount,
|
|
26
|
+
cancellationsCount = _ref.cancellationsCount,
|
|
27
|
+
applicationsCount = _ref.applicationsCount,
|
|
28
|
+
averageRent = _ref.averageRent,
|
|
29
|
+
textUsage = _ref.textUsage,
|
|
30
|
+
agreementsCount = _ref.agreementsCount,
|
|
31
|
+
agreementsFinalisedCount = _ref.agreementsFinalisedCount,
|
|
32
|
+
filterDaysCount = _ref.filterDaysCount,
|
|
33
|
+
allHouseEnquiriesCount = _ref.allHouseEnquiriesCount,
|
|
34
|
+
bookMeEnquiriesCount = _ref.bookMeEnquiriesCount,
|
|
35
|
+
oneRoofEnquiriesCount = _ref.oneRoofEnquiriesCount,
|
|
36
|
+
realestateEnquiriesCount = _ref.realestateEnquiriesCount,
|
|
37
|
+
tradeMeEnquiriesCount = _ref.tradeMeEnquiriesCount,
|
|
38
|
+
manualEnquiryCount = _ref.manualEnquiryCount,
|
|
39
|
+
allHouseBookingsCount = _ref.allHouseBookingsCount,
|
|
40
|
+
bookMeBookingsCount = _ref.bookMeBookingsCount,
|
|
41
|
+
oneRoofBookingsCount = _ref.oneRoofBookingsCount,
|
|
42
|
+
realestateBookingsCount = _ref.realestateBookingsCount,
|
|
43
|
+
tradeMeBookingsCount = _ref.tradeMeBookingsCount,
|
|
44
|
+
manualBookingsCount = _ref.manualBookingsCount;
|
|
45
|
+
var isXlUp = useMediaQuery(function (theme) {
|
|
46
|
+
return theme.breakpoints.up("xl");
|
|
47
|
+
});
|
|
48
|
+
var stats = [{
|
|
49
|
+
label: "Viewings",
|
|
50
|
+
value: viewingsCount
|
|
51
|
+
}, {
|
|
52
|
+
label: "Bookings",
|
|
53
|
+
value: bookingsCount
|
|
54
|
+
}, {
|
|
55
|
+
label: "Attendees",
|
|
56
|
+
value: attendeesCount
|
|
57
|
+
}, {
|
|
58
|
+
label: "Cancellations",
|
|
59
|
+
value: cancellationsCount
|
|
60
|
+
}, {
|
|
61
|
+
label: "Applications",
|
|
62
|
+
value: applicationsCount
|
|
63
|
+
}, {
|
|
64
|
+
label: "Average Rent",
|
|
65
|
+
value: "$".concat(averageRent)
|
|
66
|
+
}, {
|
|
67
|
+
label: "Text Usage Total",
|
|
68
|
+
value: textUsage
|
|
69
|
+
}];
|
|
70
|
+
return /* @__PURE__ */React.createElement(Stack, {
|
|
71
|
+
gap: 6
|
|
72
|
+
}, /* @__PURE__ */React.createElement(ui.Grid, {
|
|
73
|
+
container: true,
|
|
74
|
+
spacing: 6
|
|
75
|
+
}, /* @__PURE__ */React.createElement(ui.Grid, {
|
|
76
|
+
container: true,
|
|
77
|
+
item: true,
|
|
78
|
+
spacing: 6,
|
|
79
|
+
xs: 9
|
|
80
|
+
}, /* @__PURE__ */React.createElement(ui.Grid, {
|
|
81
|
+
item: true,
|
|
82
|
+
xs: 6
|
|
83
|
+
}, /* @__PURE__ */React.createElement(ui.Paper, {
|
|
84
|
+
outlined: true,
|
|
85
|
+
inset: "medium",
|
|
86
|
+
overflow: false,
|
|
87
|
+
sx: styles.chartPaper
|
|
88
|
+
}, /* @__PURE__ */React.createElement(analyticsDoughnutChart.default, {
|
|
89
|
+
tradeMeCount: tradeMeEnquiriesCount,
|
|
90
|
+
bookMeCount: bookMeEnquiriesCount,
|
|
91
|
+
manualCount: manualEnquiryCount,
|
|
92
|
+
allhouseCount: allHouseEnquiriesCount,
|
|
93
|
+
oneRoofCount: oneRoofEnquiriesCount,
|
|
94
|
+
realEstateCount: realestateEnquiriesCount,
|
|
95
|
+
heading: "Number of enquiries"
|
|
96
|
+
}))), /* @__PURE__ */React.createElement(ui.Grid, {
|
|
97
|
+
item: true,
|
|
98
|
+
xs: 6
|
|
99
|
+
}, /* @__PURE__ */React.createElement(ui.Paper, {
|
|
100
|
+
outlined: true,
|
|
101
|
+
inset: "medium",
|
|
102
|
+
overflow: false,
|
|
103
|
+
sx: styles.chartPaper
|
|
104
|
+
}, /* @__PURE__ */React.createElement(analyticsDoughnutChart.default, {
|
|
105
|
+
tradeMeCount: tradeMeBookingsCount,
|
|
106
|
+
bookMeCount: bookMeBookingsCount,
|
|
107
|
+
manualCount: manualBookingsCount,
|
|
108
|
+
allhouseCount: allHouseBookingsCount,
|
|
109
|
+
oneRoofCount: oneRoofBookingsCount,
|
|
110
|
+
realEstateCount: realestateBookingsCount,
|
|
111
|
+
heading: "Number of bookings"
|
|
112
|
+
})))), /* @__PURE__ */React.createElement(ui.Grid, {
|
|
113
|
+
item: true,
|
|
114
|
+
container: true,
|
|
115
|
+
xs: 3,
|
|
116
|
+
spacing: 6
|
|
117
|
+
}, /* @__PURE__ */React.createElement(ui.Grid, {
|
|
118
|
+
item: true,
|
|
119
|
+
xs: 12
|
|
120
|
+
}, /* @__PURE__ */React.createElement(AnalyticsBox.default, {
|
|
121
|
+
outlined: true,
|
|
122
|
+
label: /* @__PURE__ */React.createElement("strong", null, "Converted Properties"),
|
|
123
|
+
amount: agreementsCount,
|
|
124
|
+
width: "100%",
|
|
125
|
+
height: isXlUp ? "157px" : "auto",
|
|
126
|
+
text: /* @__PURE__ */React.createElement(ui.Text, {
|
|
127
|
+
as: "span",
|
|
128
|
+
variant: "inherit"
|
|
129
|
+
}, "Properties that have had a viewing in the last", " ", /* @__PURE__ */React.createElement("strong", null, filterDaysCount), " days where an agreement has been ", /* @__PURE__ */React.createElement("strong", null, "created"))
|
|
130
|
+
})), /* @__PURE__ */React.createElement(ui.Grid, {
|
|
131
|
+
item: true,
|
|
132
|
+
xs: 12,
|
|
133
|
+
sx: {
|
|
134
|
+
display: "flex",
|
|
135
|
+
alignItems: "flex-end"
|
|
136
|
+
}
|
|
137
|
+
}, /* @__PURE__ */React.createElement(AnalyticsBox.default, {
|
|
138
|
+
outlined: true,
|
|
139
|
+
label: /* @__PURE__ */React.createElement("strong", null, "Converted Properties"),
|
|
140
|
+
amount: agreementsFinalisedCount,
|
|
141
|
+
width: "100%",
|
|
142
|
+
height: isXlUp ? "157px" : "auto",
|
|
143
|
+
text: /* @__PURE__ */React.createElement(ui.Text, {
|
|
144
|
+
as: "span",
|
|
145
|
+
variant: "inherit"
|
|
146
|
+
}, "Properties that have had a viewing in the last", " ", /* @__PURE__ */React.createElement("strong", null, " ", filterDaysCount), " days where an agreement has been ", /* @__PURE__ */React.createElement("strong", null, "finalised"))
|
|
147
|
+
})))), /* @__PURE__ */React.createElement(ui.Grid, {
|
|
148
|
+
container: true,
|
|
149
|
+
spacing: {
|
|
150
|
+
xs: 3,
|
|
151
|
+
md: 6
|
|
152
|
+
}
|
|
153
|
+
}, stats.map(function (stat, i) {
|
|
154
|
+
return /* @__PURE__ */React.createElement(ui.Grid, {
|
|
155
|
+
item: true,
|
|
156
|
+
key: reactUid.uid(stat, i),
|
|
157
|
+
xs: 3,
|
|
158
|
+
md: 2
|
|
159
|
+
}, /* @__PURE__ */React.createElement(AnalyticsBox.default, {
|
|
160
|
+
outlined: true,
|
|
161
|
+
label: stat.label,
|
|
162
|
+
amount: stat.value,
|
|
163
|
+
width: "100%",
|
|
164
|
+
height: isXlUp ? "157px" : "124px"
|
|
165
|
+
}));
|
|
166
|
+
})));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
exports.default = PDFAnalyticsSection;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -11,6 +11,7 @@ var BookingTableRowSkeleton = require('./components/BookingTableRowSkeleton.cjs'
|
|
|
11
11
|
var CheckedIcon = require('./components/CheckedIcon.cjs');
|
|
12
12
|
var doughnutChart = require('./components/doughnut-chart.cjs');
|
|
13
13
|
var analyticsDoughnutChart = require('./components/analytics-doughnut-chart.cjs');
|
|
14
|
+
var pdfAnalyticsSection = require('./components/pdf-analytics-section.cjs');
|
|
14
15
|
var partnerLogo = require('./components/partner-logo.cjs');
|
|
15
16
|
var GridList = require('./components/GridList.cjs');
|
|
16
17
|
var Hidden = require('./components/Hidden.cjs');
|
|
@@ -31,6 +32,7 @@ exports.BookingTableRowSkeleton = BookingTableRowSkeleton.default;
|
|
|
31
32
|
exports.CheckedIcon = CheckedIcon.default;
|
|
32
33
|
exports.DoughnutChart = doughnutChart.default;
|
|
33
34
|
exports.AnalyticsDoughnutChart = analyticsDoughnutChart.default;
|
|
35
|
+
exports.PDFAnalyticsSection = pdfAnalyticsSection.default;
|
|
34
36
|
exports.PartnerLogo = partnerLogo.default;
|
|
35
37
|
exports.GridList = GridList.default;
|
|
36
38
|
exports.Hidden = Hidden.default;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { uid } from 'react-uid';
|
|
3
|
+
import Stack from '@mui/material/Stack';
|
|
4
|
+
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
5
|
+
import { Grid, Paper, Text } from '@tenancy.nz/ui';
|
|
6
|
+
import AnalyticsBox from './AnalyticsBox.js';
|
|
7
|
+
import AnalyticsDoughnutChart from './analytics-doughnut-chart.js';
|
|
8
|
+
|
|
9
|
+
var styles = {
|
|
10
|
+
chartPaper: {
|
|
11
|
+
height: "100%",
|
|
12
|
+
width: "100%",
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
justifyContent: "center",
|
|
15
|
+
display: "flex"
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function PDFAnalyticsSection(_ref) {
|
|
19
|
+
var viewingsCount = _ref.viewingsCount,
|
|
20
|
+
bookingsCount = _ref.bookingsCount,
|
|
21
|
+
attendeesCount = _ref.attendeesCount,
|
|
22
|
+
cancellationsCount = _ref.cancellationsCount,
|
|
23
|
+
applicationsCount = _ref.applicationsCount,
|
|
24
|
+
averageRent = _ref.averageRent,
|
|
25
|
+
textUsage = _ref.textUsage,
|
|
26
|
+
agreementsCount = _ref.agreementsCount,
|
|
27
|
+
agreementsFinalisedCount = _ref.agreementsFinalisedCount,
|
|
28
|
+
filterDaysCount = _ref.filterDaysCount,
|
|
29
|
+
allHouseEnquiriesCount = _ref.allHouseEnquiriesCount,
|
|
30
|
+
bookMeEnquiriesCount = _ref.bookMeEnquiriesCount,
|
|
31
|
+
oneRoofEnquiriesCount = _ref.oneRoofEnquiriesCount,
|
|
32
|
+
realestateEnquiriesCount = _ref.realestateEnquiriesCount,
|
|
33
|
+
tradeMeEnquiriesCount = _ref.tradeMeEnquiriesCount,
|
|
34
|
+
manualEnquiryCount = _ref.manualEnquiryCount,
|
|
35
|
+
allHouseBookingsCount = _ref.allHouseBookingsCount,
|
|
36
|
+
bookMeBookingsCount = _ref.bookMeBookingsCount,
|
|
37
|
+
oneRoofBookingsCount = _ref.oneRoofBookingsCount,
|
|
38
|
+
realestateBookingsCount = _ref.realestateBookingsCount,
|
|
39
|
+
tradeMeBookingsCount = _ref.tradeMeBookingsCount,
|
|
40
|
+
manualBookingsCount = _ref.manualBookingsCount;
|
|
41
|
+
var isXlUp = useMediaQuery(function (theme) {
|
|
42
|
+
return theme.breakpoints.up("xl");
|
|
43
|
+
});
|
|
44
|
+
var stats = [{
|
|
45
|
+
label: "Viewings",
|
|
46
|
+
value: viewingsCount
|
|
47
|
+
}, {
|
|
48
|
+
label: "Bookings",
|
|
49
|
+
value: bookingsCount
|
|
50
|
+
}, {
|
|
51
|
+
label: "Attendees",
|
|
52
|
+
value: attendeesCount
|
|
53
|
+
}, {
|
|
54
|
+
label: "Cancellations",
|
|
55
|
+
value: cancellationsCount
|
|
56
|
+
}, {
|
|
57
|
+
label: "Applications",
|
|
58
|
+
value: applicationsCount
|
|
59
|
+
}, {
|
|
60
|
+
label: "Average Rent",
|
|
61
|
+
value: "$".concat(averageRent)
|
|
62
|
+
}, {
|
|
63
|
+
label: "Text Usage Total",
|
|
64
|
+
value: textUsage
|
|
65
|
+
}];
|
|
66
|
+
return /* @__PURE__ */React.createElement(Stack, {
|
|
67
|
+
gap: 6
|
|
68
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
69
|
+
container: true,
|
|
70
|
+
spacing: 6
|
|
71
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
72
|
+
container: true,
|
|
73
|
+
item: true,
|
|
74
|
+
spacing: 6,
|
|
75
|
+
xs: 9
|
|
76
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
77
|
+
item: true,
|
|
78
|
+
xs: 6
|
|
79
|
+
}, /* @__PURE__ */React.createElement(Paper, {
|
|
80
|
+
outlined: true,
|
|
81
|
+
inset: "medium",
|
|
82
|
+
overflow: false,
|
|
83
|
+
sx: styles.chartPaper
|
|
84
|
+
}, /* @__PURE__ */React.createElement(AnalyticsDoughnutChart, {
|
|
85
|
+
tradeMeCount: tradeMeEnquiriesCount,
|
|
86
|
+
bookMeCount: bookMeEnquiriesCount,
|
|
87
|
+
manualCount: manualEnquiryCount,
|
|
88
|
+
allhouseCount: allHouseEnquiriesCount,
|
|
89
|
+
oneRoofCount: oneRoofEnquiriesCount,
|
|
90
|
+
realEstateCount: realestateEnquiriesCount,
|
|
91
|
+
heading: "Number of enquiries"
|
|
92
|
+
}))), /* @__PURE__ */React.createElement(Grid, {
|
|
93
|
+
item: true,
|
|
94
|
+
xs: 6
|
|
95
|
+
}, /* @__PURE__ */React.createElement(Paper, {
|
|
96
|
+
outlined: true,
|
|
97
|
+
inset: "medium",
|
|
98
|
+
overflow: false,
|
|
99
|
+
sx: styles.chartPaper
|
|
100
|
+
}, /* @__PURE__ */React.createElement(AnalyticsDoughnutChart, {
|
|
101
|
+
tradeMeCount: tradeMeBookingsCount,
|
|
102
|
+
bookMeCount: bookMeBookingsCount,
|
|
103
|
+
manualCount: manualBookingsCount,
|
|
104
|
+
allhouseCount: allHouseBookingsCount,
|
|
105
|
+
oneRoofCount: oneRoofBookingsCount,
|
|
106
|
+
realEstateCount: realestateBookingsCount,
|
|
107
|
+
heading: "Number of bookings"
|
|
108
|
+
})))), /* @__PURE__ */React.createElement(Grid, {
|
|
109
|
+
item: true,
|
|
110
|
+
container: true,
|
|
111
|
+
xs: 3,
|
|
112
|
+
spacing: 6
|
|
113
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
114
|
+
item: true,
|
|
115
|
+
xs: 12
|
|
116
|
+
}, /* @__PURE__ */React.createElement(AnalyticsBox, {
|
|
117
|
+
outlined: true,
|
|
118
|
+
label: /* @__PURE__ */React.createElement("strong", null, "Converted Properties"),
|
|
119
|
+
amount: agreementsCount,
|
|
120
|
+
width: "100%",
|
|
121
|
+
height: isXlUp ? "157px" : "auto",
|
|
122
|
+
text: /* @__PURE__ */React.createElement(Text, {
|
|
123
|
+
as: "span",
|
|
124
|
+
variant: "inherit"
|
|
125
|
+
}, "Properties that have had a viewing in the last", " ", /* @__PURE__ */React.createElement("strong", null, filterDaysCount), " days where an agreement has been ", /* @__PURE__ */React.createElement("strong", null, "created"))
|
|
126
|
+
})), /* @__PURE__ */React.createElement(Grid, {
|
|
127
|
+
item: true,
|
|
128
|
+
xs: 12,
|
|
129
|
+
sx: {
|
|
130
|
+
display: "flex",
|
|
131
|
+
alignItems: "flex-end"
|
|
132
|
+
}
|
|
133
|
+
}, /* @__PURE__ */React.createElement(AnalyticsBox, {
|
|
134
|
+
outlined: true,
|
|
135
|
+
label: /* @__PURE__ */React.createElement("strong", null, "Converted Properties"),
|
|
136
|
+
amount: agreementsFinalisedCount,
|
|
137
|
+
width: "100%",
|
|
138
|
+
height: isXlUp ? "157px" : "auto",
|
|
139
|
+
text: /* @__PURE__ */React.createElement(Text, {
|
|
140
|
+
as: "span",
|
|
141
|
+
variant: "inherit"
|
|
142
|
+
}, "Properties that have had a viewing in the last", " ", /* @__PURE__ */React.createElement("strong", null, " ", filterDaysCount), " days where an agreement has been ", /* @__PURE__ */React.createElement("strong", null, "finalised"))
|
|
143
|
+
})))), /* @__PURE__ */React.createElement(Grid, {
|
|
144
|
+
container: true,
|
|
145
|
+
spacing: {
|
|
146
|
+
xs: 3,
|
|
147
|
+
md: 6
|
|
148
|
+
}
|
|
149
|
+
}, stats.map(function (stat, i) {
|
|
150
|
+
return /* @__PURE__ */React.createElement(Grid, {
|
|
151
|
+
item: true,
|
|
152
|
+
key: uid(stat, i),
|
|
153
|
+
xs: 3,
|
|
154
|
+
md: 2
|
|
155
|
+
}, /* @__PURE__ */React.createElement(AnalyticsBox, {
|
|
156
|
+
outlined: true,
|
|
157
|
+
label: stat.label,
|
|
158
|
+
amount: stat.value,
|
|
159
|
+
width: "100%",
|
|
160
|
+
height: isXlUp ? "157px" : "124px"
|
|
161
|
+
}));
|
|
162
|
+
})));
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export { PDFAnalyticsSection as default };
|
package/dist/esm/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export { default as BookingTableRowSkeleton } from './components/BookingTableRow
|
|
|
9
9
|
export { default as CheckedIcon } from './components/CheckedIcon.js';
|
|
10
10
|
export { default as DoughnutChart } from './components/doughnut-chart.js';
|
|
11
11
|
export { default as AnalyticsDoughnutChart } from './components/analytics-doughnut-chart.js';
|
|
12
|
+
export { default as PDFAnalyticsSection } from './components/pdf-analytics-section.js';
|
|
12
13
|
export { default as PartnerLogo } from './components/partner-logo.js';
|
|
13
14
|
export { default as GridList } from './components/GridList.js';
|
|
14
15
|
export { default as Hidden } from './components/Hidden.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenancy.nz/feature-ui",
|
|
3
3
|
"description": "React UI feature components.",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.8",
|
|
5
5
|
"author": "TPS <https://www.tenancy.co.nz>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/cjs/index.cjs",
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
"primereact": "3.1.3",
|
|
21
21
|
"react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
22
22
|
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
23
|
-
"@tenancy.nz/ui": "1.5.
|
|
23
|
+
"@tenancy.nz/ui": "1.5.8"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@emotion/react": "^11.14.0",
|
|
27
27
|
"@emotion/styled": "^11.14.1",
|
|
28
28
|
"@mui/icons-material": "^7.2.0",
|
|
29
29
|
"@mui/material": "^7.3.1",
|
|
30
|
-
"@tenancy.nz/ui": "1.5.
|
|
30
|
+
"@tenancy.nz/ui": "1.5.8"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"react-uid": "^2.4.0"
|