@tenancy.nz/feature-ui 1.5.7 → 1.5.9
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.
- package/dist/cjs/components/ChartLegend.cjs +25 -6
- package/dist/cjs/components/analytics-doughnut-chart.cjs +43 -12
- package/dist/cjs/components/doughnut-chart.cjs +6 -5
- package/dist/cjs/components/partner-logo.cjs +2 -2
- package/dist/cjs/components/pdf-analytics-section.cjs +169 -0
- package/dist/cjs/index.cjs +2 -0
- package/dist/esm/components/ChartLegend.js +25 -6
- package/dist/esm/components/analytics-doughnut-chart.js +43 -12
- package/dist/esm/components/doughnut-chart.js +6 -5
- package/dist/esm/components/partner-logo.js +2 -2
- package/dist/esm/components/pdf-analytics-section.js +165 -0
- package/dist/esm/index.js +1 -0
- package/package.json +3 -3
|
@@ -21,15 +21,34 @@ function ChartLegend(_ref) {
|
|
|
21
21
|
gap: 1.5,
|
|
22
22
|
sx: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, sx), {}, {
|
|
23
23
|
userSelect: "none",
|
|
24
|
-
fontSize:
|
|
24
|
+
fontSize: {
|
|
25
|
+
xs: "8px",
|
|
26
|
+
md: "12px"
|
|
27
|
+
}
|
|
25
28
|
})
|
|
26
29
|
}, /* @__PURE__ */React.createElement(ui.Box, {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
bgcolor: color || "#D9D9D9",
|
|
31
|
+
sx: {
|
|
32
|
+
width: {
|
|
33
|
+
xs: "20px",
|
|
34
|
+
md: "32px"
|
|
35
|
+
},
|
|
36
|
+
height: {
|
|
37
|
+
xs: "12px",
|
|
38
|
+
md: "18px"
|
|
39
|
+
},
|
|
40
|
+
borderRadius: {
|
|
41
|
+
xs: "2px",
|
|
42
|
+
md: "4px"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
31
45
|
}), /* @__PURE__ */React.createElement(ui.Box, {
|
|
32
|
-
|
|
46
|
+
xs: {
|
|
47
|
+
minWidth: {
|
|
48
|
+
xs: "20px",
|
|
49
|
+
md: "24px"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
33
52
|
}, count !== void 0 && count >= 0 && /* @__PURE__ */React.createElement(ui.Text, {
|
|
34
53
|
align: "center",
|
|
35
54
|
weight: "700",
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
|
|
5
6
|
var React = require('react');
|
|
6
7
|
var doughnutChart = require('./doughnut-chart.cjs');
|
|
7
8
|
var partnerLogo = require('./partner-logo.cjs');
|
|
8
9
|
var general = require('../utils/helpers/general.cjs');
|
|
9
10
|
|
|
11
|
+
var _excluded = ["allhouseCount", "bookMeCount", "oneRoofCount", "realEstateCount", "tradeMeCount", "manualCount", "heading"];
|
|
10
12
|
function AnalyticsDoughnutChart(_ref) {
|
|
11
13
|
var _ref$allhouseCount = _ref.allhouseCount,
|
|
12
14
|
allhouseCount = _ref$allhouseCount === void 0 ? 0 : _ref$allhouseCount,
|
|
@@ -21,7 +23,8 @@ function AnalyticsDoughnutChart(_ref) {
|
|
|
21
23
|
_ref$manualCount = _ref.manualCount,
|
|
22
24
|
manualCount = _ref$manualCount === void 0 ? 0 : _ref$manualCount,
|
|
23
25
|
_ref$heading = _ref.heading,
|
|
24
|
-
heading = _ref$heading === void 0 ? void 0 : _ref$heading
|
|
26
|
+
heading = _ref$heading === void 0 ? void 0 : _ref$heading,
|
|
27
|
+
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
25
28
|
var data = [{
|
|
26
29
|
color: "#0CC1A3",
|
|
27
30
|
count: general.parseChartCount(bookMeCount),
|
|
@@ -34,8 +37,14 @@ function AnalyticsDoughnutChart(_ref) {
|
|
|
34
37
|
title: "Allhouse",
|
|
35
38
|
logo: /* @__PURE__ */React.createElement(partnerLogo.default, {
|
|
36
39
|
name: "allhouse",
|
|
37
|
-
width:
|
|
38
|
-
|
|
40
|
+
width: {
|
|
41
|
+
xs: "48px",
|
|
42
|
+
md: "59px"
|
|
43
|
+
},
|
|
44
|
+
height: {
|
|
45
|
+
xs: "12px",
|
|
46
|
+
md: "14px"
|
|
47
|
+
}
|
|
39
48
|
})
|
|
40
49
|
}, {
|
|
41
50
|
color: "#FF8500",
|
|
@@ -44,8 +53,14 @@ function AnalyticsDoughnutChart(_ref) {
|
|
|
44
53
|
title: "OneRoof",
|
|
45
54
|
logo: /* @__PURE__ */React.createElement(partnerLogo.default, {
|
|
46
55
|
name: "oneroof",
|
|
47
|
-
width:
|
|
48
|
-
|
|
56
|
+
width: {
|
|
57
|
+
xs: "52px",
|
|
58
|
+
md: "66px"
|
|
59
|
+
},
|
|
60
|
+
height: {
|
|
61
|
+
xs: "",
|
|
62
|
+
md: "12px"
|
|
63
|
+
}
|
|
49
64
|
})
|
|
50
65
|
}, {
|
|
51
66
|
color: "#0098FF",
|
|
@@ -54,8 +69,14 @@ function AnalyticsDoughnutChart(_ref) {
|
|
|
54
69
|
title: "realestate.co.nz",
|
|
55
70
|
logo: /* @__PURE__ */React.createElement(partnerLogo.default, {
|
|
56
71
|
name: "realestate",
|
|
57
|
-
width:
|
|
58
|
-
|
|
72
|
+
width: {
|
|
73
|
+
xs: "72px",
|
|
74
|
+
md: "92px"
|
|
75
|
+
},
|
|
76
|
+
height: {
|
|
77
|
+
xs: "12px",
|
|
78
|
+
md: "14px"
|
|
79
|
+
}
|
|
59
80
|
})
|
|
60
81
|
}, {
|
|
61
82
|
color: "#4854D3",
|
|
@@ -64,8 +85,14 @@ function AnalyticsDoughnutChart(_ref) {
|
|
|
64
85
|
title: "Trade Me",
|
|
65
86
|
logo: /* @__PURE__ */React.createElement(partnerLogo.default, {
|
|
66
87
|
name: "trademe",
|
|
67
|
-
width:
|
|
68
|
-
|
|
88
|
+
width: {
|
|
89
|
+
xs: "64px",
|
|
90
|
+
md: "90px"
|
|
91
|
+
},
|
|
92
|
+
height: {
|
|
93
|
+
xs: "12px",
|
|
94
|
+
md: "12px"
|
|
95
|
+
}
|
|
69
96
|
})
|
|
70
97
|
}, {
|
|
71
98
|
color: "#D9D9D9",
|
|
@@ -73,10 +100,14 @@ function AnalyticsDoughnutChart(_ref) {
|
|
|
73
100
|
slug: "manual",
|
|
74
101
|
title: "Manually Generated"
|
|
75
102
|
}];
|
|
76
|
-
return /* @__PURE__ */React.createElement(doughnutChart.default, {
|
|
103
|
+
return /* @__PURE__ */React.createElement(doughnutChart.default, _rollupPluginBabelHelpers.objectSpread2({
|
|
77
104
|
data: data,
|
|
78
|
-
heading: heading
|
|
79
|
-
|
|
105
|
+
heading: heading,
|
|
106
|
+
size: {
|
|
107
|
+
xs: "100px",
|
|
108
|
+
md: "165px"
|
|
109
|
+
}
|
|
110
|
+
}, rest));
|
|
80
111
|
}
|
|
81
112
|
|
|
82
113
|
exports.default = AnalyticsDoughnutChart;
|
|
@@ -40,18 +40,19 @@ function DoughnutChart(_ref) {
|
|
|
40
40
|
as: "h4",
|
|
41
41
|
color: "primary"
|
|
42
42
|
}, heading), /* @__PURE__ */React.createElement(Stack, {
|
|
43
|
-
flexDirection:
|
|
44
|
-
|
|
43
|
+
flexDirection: "row",
|
|
44
|
+
gap: {
|
|
45
|
+
xs: 4,
|
|
46
|
+
md: 12
|
|
45
47
|
},
|
|
46
|
-
gap: 12,
|
|
47
48
|
alignItems: "center"
|
|
48
49
|
}, /* @__PURE__ */React.createElement(ui.Box, {
|
|
49
|
-
width: size,
|
|
50
|
-
height: size,
|
|
51
50
|
overflow: "hidden",
|
|
52
51
|
position: "relative",
|
|
53
52
|
maxWidth: "100%",
|
|
54
53
|
sx: {
|
|
54
|
+
width: size,
|
|
55
|
+
height: size,
|
|
55
56
|
"&& > canvas": {
|
|
56
57
|
width: "100%",
|
|
57
58
|
height: "100%"
|
|
@@ -88,10 +88,10 @@ function PartnerLogo(_ref) {
|
|
|
88
88
|
height = _ref.height,
|
|
89
89
|
width = _ref.width;
|
|
90
90
|
return /* @__PURE__ */React.createElement(ui.Box, {
|
|
91
|
-
width: width,
|
|
92
|
-
height: height,
|
|
93
91
|
display: "inline-flex",
|
|
94
92
|
sx: {
|
|
93
|
+
width: width,
|
|
94
|
+
height: height,
|
|
95
95
|
"> svg": {
|
|
96
96
|
width: "inherit",
|
|
97
97
|
height: "inherit",
|
|
@@ -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: 12
|
|
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: 12,
|
|
116
|
+
spacing: 6
|
|
117
|
+
}, /* @__PURE__ */React.createElement(ui.Grid, {
|
|
118
|
+
item: true,
|
|
119
|
+
xs: 6
|
|
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: 6,
|
|
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;
|
|
@@ -17,15 +17,34 @@ function ChartLegend(_ref) {
|
|
|
17
17
|
gap: 1.5,
|
|
18
18
|
sx: _objectSpread2(_objectSpread2({}, sx), {}, {
|
|
19
19
|
userSelect: "none",
|
|
20
|
-
fontSize:
|
|
20
|
+
fontSize: {
|
|
21
|
+
xs: "8px",
|
|
22
|
+
md: "12px"
|
|
23
|
+
}
|
|
21
24
|
})
|
|
22
25
|
}, /* @__PURE__ */React.createElement(Box, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
bgcolor: color || "#D9D9D9",
|
|
27
|
+
sx: {
|
|
28
|
+
width: {
|
|
29
|
+
xs: "20px",
|
|
30
|
+
md: "32px"
|
|
31
|
+
},
|
|
32
|
+
height: {
|
|
33
|
+
xs: "12px",
|
|
34
|
+
md: "18px"
|
|
35
|
+
},
|
|
36
|
+
borderRadius: {
|
|
37
|
+
xs: "2px",
|
|
38
|
+
md: "4px"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
27
41
|
}), /* @__PURE__ */React.createElement(Box, {
|
|
28
|
-
|
|
42
|
+
xs: {
|
|
43
|
+
minWidth: {
|
|
44
|
+
xs: "20px",
|
|
45
|
+
md: "24px"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
29
48
|
}, count !== void 0 && count >= 0 && /* @__PURE__ */React.createElement(Text, {
|
|
30
49
|
align: "center",
|
|
31
50
|
weight: "700",
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import DoughnutChart from './doughnut-chart.js';
|
|
3
4
|
import PartnerLogo from './partner-logo.js';
|
|
4
5
|
import { parseChartCount } from '../utils/helpers/general.js';
|
|
5
6
|
|
|
7
|
+
var _excluded = ["allhouseCount", "bookMeCount", "oneRoofCount", "realEstateCount", "tradeMeCount", "manualCount", "heading"];
|
|
6
8
|
function AnalyticsDoughnutChart(_ref) {
|
|
7
9
|
var _ref$allhouseCount = _ref.allhouseCount,
|
|
8
10
|
allhouseCount = _ref$allhouseCount === void 0 ? 0 : _ref$allhouseCount,
|
|
@@ -17,7 +19,8 @@ function AnalyticsDoughnutChart(_ref) {
|
|
|
17
19
|
_ref$manualCount = _ref.manualCount,
|
|
18
20
|
manualCount = _ref$manualCount === void 0 ? 0 : _ref$manualCount,
|
|
19
21
|
_ref$heading = _ref.heading,
|
|
20
|
-
heading = _ref$heading === void 0 ? void 0 : _ref$heading
|
|
22
|
+
heading = _ref$heading === void 0 ? void 0 : _ref$heading,
|
|
23
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
21
24
|
var data = [{
|
|
22
25
|
color: "#0CC1A3",
|
|
23
26
|
count: parseChartCount(bookMeCount),
|
|
@@ -30,8 +33,14 @@ function AnalyticsDoughnutChart(_ref) {
|
|
|
30
33
|
title: "Allhouse",
|
|
31
34
|
logo: /* @__PURE__ */React.createElement(PartnerLogo, {
|
|
32
35
|
name: "allhouse",
|
|
33
|
-
width:
|
|
34
|
-
|
|
36
|
+
width: {
|
|
37
|
+
xs: "48px",
|
|
38
|
+
md: "59px"
|
|
39
|
+
},
|
|
40
|
+
height: {
|
|
41
|
+
xs: "12px",
|
|
42
|
+
md: "14px"
|
|
43
|
+
}
|
|
35
44
|
})
|
|
36
45
|
}, {
|
|
37
46
|
color: "#FF8500",
|
|
@@ -40,8 +49,14 @@ function AnalyticsDoughnutChart(_ref) {
|
|
|
40
49
|
title: "OneRoof",
|
|
41
50
|
logo: /* @__PURE__ */React.createElement(PartnerLogo, {
|
|
42
51
|
name: "oneroof",
|
|
43
|
-
width:
|
|
44
|
-
|
|
52
|
+
width: {
|
|
53
|
+
xs: "52px",
|
|
54
|
+
md: "66px"
|
|
55
|
+
},
|
|
56
|
+
height: {
|
|
57
|
+
xs: "",
|
|
58
|
+
md: "12px"
|
|
59
|
+
}
|
|
45
60
|
})
|
|
46
61
|
}, {
|
|
47
62
|
color: "#0098FF",
|
|
@@ -50,8 +65,14 @@ function AnalyticsDoughnutChart(_ref) {
|
|
|
50
65
|
title: "realestate.co.nz",
|
|
51
66
|
logo: /* @__PURE__ */React.createElement(PartnerLogo, {
|
|
52
67
|
name: "realestate",
|
|
53
|
-
width:
|
|
54
|
-
|
|
68
|
+
width: {
|
|
69
|
+
xs: "72px",
|
|
70
|
+
md: "92px"
|
|
71
|
+
},
|
|
72
|
+
height: {
|
|
73
|
+
xs: "12px",
|
|
74
|
+
md: "14px"
|
|
75
|
+
}
|
|
55
76
|
})
|
|
56
77
|
}, {
|
|
57
78
|
color: "#4854D3",
|
|
@@ -60,8 +81,14 @@ function AnalyticsDoughnutChart(_ref) {
|
|
|
60
81
|
title: "Trade Me",
|
|
61
82
|
logo: /* @__PURE__ */React.createElement(PartnerLogo, {
|
|
62
83
|
name: "trademe",
|
|
63
|
-
width:
|
|
64
|
-
|
|
84
|
+
width: {
|
|
85
|
+
xs: "64px",
|
|
86
|
+
md: "90px"
|
|
87
|
+
},
|
|
88
|
+
height: {
|
|
89
|
+
xs: "12px",
|
|
90
|
+
md: "12px"
|
|
91
|
+
}
|
|
65
92
|
})
|
|
66
93
|
}, {
|
|
67
94
|
color: "#D9D9D9",
|
|
@@ -69,10 +96,14 @@ function AnalyticsDoughnutChart(_ref) {
|
|
|
69
96
|
slug: "manual",
|
|
70
97
|
title: "Manually Generated"
|
|
71
98
|
}];
|
|
72
|
-
return /* @__PURE__ */React.createElement(DoughnutChart, {
|
|
99
|
+
return /* @__PURE__ */React.createElement(DoughnutChart, _objectSpread2({
|
|
73
100
|
data: data,
|
|
74
|
-
heading: heading
|
|
75
|
-
|
|
101
|
+
heading: heading,
|
|
102
|
+
size: {
|
|
103
|
+
xs: "100px",
|
|
104
|
+
md: "165px"
|
|
105
|
+
}
|
|
106
|
+
}, rest));
|
|
76
107
|
}
|
|
77
108
|
|
|
78
109
|
export { AnalyticsDoughnutChart as default };
|
|
@@ -36,18 +36,19 @@ function DoughnutChart(_ref) {
|
|
|
36
36
|
as: "h4",
|
|
37
37
|
color: "primary"
|
|
38
38
|
}, heading), /* @__PURE__ */React.createElement(Stack, {
|
|
39
|
-
flexDirection:
|
|
40
|
-
|
|
39
|
+
flexDirection: "row",
|
|
40
|
+
gap: {
|
|
41
|
+
xs: 4,
|
|
42
|
+
md: 12
|
|
41
43
|
},
|
|
42
|
-
gap: 12,
|
|
43
44
|
alignItems: "center"
|
|
44
45
|
}, /* @__PURE__ */React.createElement(Box, {
|
|
45
|
-
width: size,
|
|
46
|
-
height: size,
|
|
47
46
|
overflow: "hidden",
|
|
48
47
|
position: "relative",
|
|
49
48
|
maxWidth: "100%",
|
|
50
49
|
sx: {
|
|
50
|
+
width: size,
|
|
51
|
+
height: size,
|
|
51
52
|
"&& > canvas": {
|
|
52
53
|
width: "100%",
|
|
53
54
|
height: "100%"
|
|
@@ -84,10 +84,10 @@ function PartnerLogo(_ref) {
|
|
|
84
84
|
height = _ref.height,
|
|
85
85
|
width = _ref.width;
|
|
86
86
|
return /* @__PURE__ */React.createElement(Box, {
|
|
87
|
-
width: width,
|
|
88
|
-
height: height,
|
|
89
87
|
display: "inline-flex",
|
|
90
88
|
sx: {
|
|
89
|
+
width: width,
|
|
90
|
+
height: height,
|
|
91
91
|
"> svg": {
|
|
92
92
|
width: "inherit",
|
|
93
93
|
height: "inherit",
|
|
@@ -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: 12
|
|
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: 12,
|
|
112
|
+
spacing: 6
|
|
113
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
114
|
+
item: true,
|
|
115
|
+
xs: 6
|
|
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: 6,
|
|
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.9",
|
|
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.9"
|
|
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.9"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"react-uid": "^2.4.0"
|