@tenancy.nz/feature-ui 1.4.11 → 1.5.1
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/AgentDetailsCard.cjs +9 -7
- package/dist/cjs/components/AnalyticsBox.cjs +23 -14
- package/dist/cjs/components/AnalyticsSection.cjs +146 -136
- package/dist/cjs/components/ChartLegend.cjs +43 -0
- package/dist/cjs/components/CheckedIcon.cjs +12 -7
- package/dist/cjs/components/PropertyCard.cjs +62 -41
- package/dist/cjs/components/PropertyCard.styled.cjs +3 -3
- package/dist/cjs/components/analytics-doughnut-chart.cjs +61 -0
- package/dist/cjs/components/doughnut-chart.cjs +124 -0
- package/dist/cjs/index.cjs +4 -2
- package/dist/cjs/utils/helpers/general.cjs +13 -0
- package/dist/esm/components/AgentDetailsCard.js +9 -7
- package/dist/esm/components/AnalyticsBox.js +24 -15
- package/dist/esm/components/AnalyticsSection.js +146 -136
- package/dist/esm/components/ChartLegend.js +39 -0
- package/dist/esm/components/CheckedIcon.js +12 -7
- package/dist/esm/components/PropertyCard.js +62 -41
- package/dist/esm/components/PropertyCard.styled.js +3 -3
- package/dist/esm/components/analytics-doughnut-chart.js +57 -0
- package/dist/esm/components/doughnut-chart.js +120 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/utils/helpers/general.js +11 -0
- package/package.json +9 -5
- package/dist/cjs/components/EnquiriesDoughnutChart.cjs +0 -143
- package/dist/esm/components/EnquiriesDoughnutChart.js +0 -139
|
@@ -5,7 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var ui = require('@tenancy.nz/ui');
|
|
8
|
-
var
|
|
8
|
+
var Stack = require('@mui/material/Stack');
|
|
9
|
+
var BedRoundedIcon = require('@mui/icons-material/BedRounded');
|
|
10
|
+
var BathtubRoundedIcon = require('@mui/icons-material/BathtubRounded');
|
|
11
|
+
var DirectionsCarRoundedIcon = require('@mui/icons-material/DirectionsCarRounded');
|
|
9
12
|
var IconLabel = require('./IconLabel.cjs');
|
|
10
13
|
var PropertyCard_styled = require('./PropertyCard.styled.cjs');
|
|
11
14
|
|
|
@@ -36,7 +39,6 @@ function PropertyCard(_ref) {
|
|
|
36
39
|
alignItems: "center"
|
|
37
40
|
}
|
|
38
41
|
}, rest), /* @__PURE__ */React.createElement(PropertyCard_styled.StyledPropertyImage, null, /* @__PURE__ */React.createElement(ui.Media, {
|
|
39
|
-
as: "img",
|
|
40
42
|
title: address,
|
|
41
43
|
src: imgSrc
|
|
42
44
|
})), /* @__PURE__ */React.createElement(PropertyCard_styled.StyledPropertyDetailsBox, null, /* @__PURE__ */React.createElement(ui.Box, null, /* @__PURE__ */React.createElement(ui.Heading, {
|
|
@@ -53,6 +55,10 @@ function PropertyCard(_ref) {
|
|
|
53
55
|
xs: "10px",
|
|
54
56
|
sm: 0
|
|
55
57
|
},
|
|
58
|
+
width: {
|
|
59
|
+
xs: "100%",
|
|
60
|
+
sm: "auto"
|
|
61
|
+
},
|
|
56
62
|
"@media print": {
|
|
57
63
|
ml: "auto"
|
|
58
64
|
}
|
|
@@ -60,84 +66,99 @@ function PropertyCard(_ref) {
|
|
|
60
66
|
}, /* @__PURE__ */React.createElement(PropertyCard_styled.StyledPropertyAmenitiesBox, null, rent && /* @__PURE__ */React.createElement(ui.Heading, {
|
|
61
67
|
as: "h4",
|
|
62
68
|
weight: "700"
|
|
63
|
-
}, rent), /* @__PURE__ */React.createElement(
|
|
64
|
-
|
|
69
|
+
}, rent), /* @__PURE__ */React.createElement(Stack, {
|
|
70
|
+
sx: {
|
|
71
|
+
fontSize: "16px",
|
|
72
|
+
fontWeight: "600"
|
|
73
|
+
},
|
|
74
|
+
flexDirection: "row",
|
|
75
|
+
gap: 3,
|
|
76
|
+
alignItems: "center"
|
|
65
77
|
}, (noOfBedrooms || String(noOfBedrooms) === "0") && /* @__PURE__ */React.createElement(IconLabel.default, {
|
|
66
78
|
color: "text.primary",
|
|
67
|
-
startIcon: /* @__PURE__ */React.createElement(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
79
|
+
startIcon: /* @__PURE__ */React.createElement(BedRoundedIcon, {
|
|
80
|
+
sx: {
|
|
81
|
+
color: "tertiary.main"
|
|
82
|
+
},
|
|
83
|
+
fontSize: "small"
|
|
71
84
|
})
|
|
72
85
|
}, /* @__PURE__ */React.createElement(ui.Text, {
|
|
73
86
|
as: "span",
|
|
74
87
|
variant: "inherit"
|
|
75
88
|
}, noOfBedrooms)), (noOfBathrooms || String(noOfBathrooms) === "0") && /* @__PURE__ */React.createElement(IconLabel.default, {
|
|
76
89
|
color: "text.primary",
|
|
77
|
-
startIcon: /* @__PURE__ */React.createElement(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
90
|
+
startIcon: /* @__PURE__ */React.createElement(BathtubRoundedIcon, {
|
|
91
|
+
sx: {
|
|
92
|
+
color: "tertiary.main"
|
|
93
|
+
},
|
|
94
|
+
fontSize: "small"
|
|
95
|
+
})
|
|
83
96
|
}, /* @__PURE__ */React.createElement(ui.Text, {
|
|
84
97
|
as: "span",
|
|
85
98
|
variant: "inherit"
|
|
86
99
|
}, noOfBathrooms)), (noOfCarparks || String(noOfCarparks) === "0") && /* @__PURE__ */React.createElement(IconLabel.default, {
|
|
87
100
|
color: "text.primary",
|
|
88
|
-
startIcon: /* @__PURE__ */React.createElement(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
101
|
+
startIcon: /* @__PURE__ */React.createElement(DirectionsCarRoundedIcon, {
|
|
102
|
+
sx: {
|
|
103
|
+
color: "tertiary.main"
|
|
104
|
+
},
|
|
105
|
+
fontSize: "small"
|
|
106
|
+
})
|
|
94
107
|
}, /* @__PURE__ */React.createElement(ui.Text, {
|
|
95
108
|
as: "span",
|
|
96
109
|
variant: "inherit"
|
|
97
110
|
}, noOfCarparks)))), !compact && /* @__PURE__ */React.createElement(ui.Box, {
|
|
98
|
-
paddingLeft: "
|
|
99
|
-
borderLeft: "1px solid #00000040",
|
|
111
|
+
paddingLeft: "24px",
|
|
100
112
|
display: "flex",
|
|
101
113
|
direction: "column",
|
|
102
114
|
sx: {
|
|
103
115
|
gap: {
|
|
104
|
-
xs:
|
|
105
|
-
lg:
|
|
116
|
+
xs: 4,
|
|
117
|
+
lg: 2,
|
|
106
118
|
xl: 0
|
|
107
119
|
},
|
|
108
|
-
justifyContent: "space-between"
|
|
120
|
+
justifyContent: "space-between",
|
|
121
|
+
borderLeft: {
|
|
122
|
+
xs: "none",
|
|
123
|
+
sm: "1px solid"
|
|
124
|
+
},
|
|
125
|
+
borderLeftColor: {
|
|
126
|
+
xs: "transparent",
|
|
127
|
+
sm: "grey.300"
|
|
128
|
+
},
|
|
129
|
+
ml: {
|
|
130
|
+
xs: "auto",
|
|
131
|
+
sm: "0"
|
|
132
|
+
}
|
|
109
133
|
}
|
|
110
|
-
}, viewingsCount && /* @__PURE__ */React.createElement(ui.Box, {
|
|
134
|
+
}, viewingsCount !== void 0 && /* @__PURE__ */React.createElement(ui.Box, {
|
|
111
135
|
display: "flex",
|
|
112
136
|
align: "center",
|
|
113
|
-
gap:
|
|
137
|
+
gap: 2
|
|
114
138
|
}, /* @__PURE__ */React.createElement(ui.Box, {
|
|
115
|
-
minWidth: "
|
|
139
|
+
minWidth: "67px"
|
|
116
140
|
}, /* @__PURE__ */React.createElement(ui.Text, {
|
|
117
|
-
transform: "uppercase",
|
|
118
141
|
color: "textPrimary",
|
|
119
142
|
as: "span",
|
|
120
|
-
weight: "
|
|
143
|
+
weight: "500",
|
|
121
144
|
align: "right",
|
|
122
|
-
|
|
145
|
+
variant: "body2"
|
|
123
146
|
}, "Viewings")), /* @__PURE__ */React.createElement(ui.Heading, {
|
|
124
|
-
as: "
|
|
125
|
-
}, viewingsCount)), enquiriesCount && /* @__PURE__ */React.createElement(ui.Box, {
|
|
147
|
+
as: "h4"
|
|
148
|
+
}, viewingsCount)), enquiriesCount !== void 0 && /* @__PURE__ */React.createElement(ui.Box, {
|
|
126
149
|
display: "flex",
|
|
127
150
|
align: "center",
|
|
128
|
-
gap:
|
|
151
|
+
gap: 2
|
|
129
152
|
}, /* @__PURE__ */React.createElement(ui.Box, {
|
|
130
|
-
minWidth: "
|
|
153
|
+
minWidth: "67px"
|
|
131
154
|
}, /* @__PURE__ */React.createElement(ui.Text, {
|
|
132
|
-
|
|
155
|
+
variant: "body2",
|
|
133
156
|
color: "textPrimary",
|
|
134
157
|
as: "span",
|
|
135
|
-
weight: "
|
|
136
|
-
|
|
137
|
-
align: "right",
|
|
138
|
-
lineHeight: "15px"
|
|
158
|
+
weight: "500",
|
|
159
|
+
align: "right"
|
|
139
160
|
}, "Enquiries")), /* @__PURE__ */React.createElement(ui.Heading, {
|
|
140
|
-
as: "
|
|
161
|
+
as: "h4"
|
|
141
162
|
}, enquiriesCount))))));
|
|
142
163
|
}
|
|
143
164
|
|
|
@@ -5,7 +5,7 @@ var react = require('@emotion/react');
|
|
|
5
5
|
var styled = require('@emotion/styled');
|
|
6
6
|
|
|
7
7
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
8
|
-
var StyledPropertyImage = styled.
|
|
8
|
+
var StyledPropertyImage = styled.div(_templateObject || (_templateObject = _rollupPluginBabelHelpers.taggedTemplateLiteral(["\n padding: 0;\n margin: 0;\n width: 120px;\n height: 95px;\n flex: 0 0 95px;\n overflow: hidden;\n\n ", "\n"])), function (_ref) {
|
|
9
9
|
var theme = _ref.theme;
|
|
10
10
|
return react.css(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers.taggedTemplateLiteral(["\n ", " {\n display: none;\n }\n\n ", " {\n width: 150px;\n height: 135px;\n flex: 0 0 150px;\n }\n\n @media print {\n width: 150px;\n height: 135px;\n flex: 0 0 150px;\n display: block;\n }\n "])), theme.breakpoints.down("sm"), theme.breakpoints.up("sm"));
|
|
11
11
|
});
|
|
@@ -13,9 +13,9 @@ var StyledPropertyDetailsBox = styled.div(_templateObject3 || (_templateObject3
|
|
|
13
13
|
var theme = _ref2.theme;
|
|
14
14
|
return react.css(_templateObject4 || (_templateObject4 = _rollupPluginBabelHelpers.taggedTemplateLiteral(["\n ", " {\n flex-direction: row;\n align-items: center;\n }\n "])), theme.breakpoints.up("sm"));
|
|
15
15
|
});
|
|
16
|
-
var StyledPropertyAmenitiesBox = styled.div(_templateObject5 || (_templateObject5 = _rollupPluginBabelHelpers.taggedTemplateLiteral(["\n padding-right: 25px;\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n
|
|
16
|
+
var StyledPropertyAmenitiesBox = styled.div(_templateObject5 || (_templateObject5 = _rollupPluginBabelHelpers.taggedTemplateLiteral(["\n padding-right: 25px;\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n gap: 8px;\n min-width: 170px;\n height: 100%;\n justify-content: space-between;\n\n ", "\n @media print {\n align-items: flex-end;\n }\n"])), function (_ref3) {
|
|
17
17
|
var theme = _ref3.theme;
|
|
18
|
-
return "\n @media (min-width: ".concat(theme.breakpoints.values.
|
|
18
|
+
return "\n @media (min-width: ".concat(theme.breakpoints.values.sm, "px) {\n align-items: flex-end;\n }\n ");
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
exports.StyledPropertyAmenitiesBox = StyledPropertyAmenitiesBox;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var doughnutChart = require('./doughnut-chart.cjs');
|
|
7
|
+
var general = require('../utils/helpers/general.cjs');
|
|
8
|
+
|
|
9
|
+
function AnalyticsDoughnutChart(_ref) {
|
|
10
|
+
var _ref$allhouseCount = _ref.allhouseCount,
|
|
11
|
+
allhouseCount = _ref$allhouseCount === void 0 ? 0 : _ref$allhouseCount,
|
|
12
|
+
_ref$bookMeCount = _ref.bookMeCount,
|
|
13
|
+
bookMeCount = _ref$bookMeCount === void 0 ? 0 : _ref$bookMeCount,
|
|
14
|
+
_ref$oneRoofCount = _ref.oneRoofCount,
|
|
15
|
+
oneRoofCount = _ref$oneRoofCount === void 0 ? 0 : _ref$oneRoofCount,
|
|
16
|
+
_ref$realEstateCount = _ref.realEstateCount,
|
|
17
|
+
realEstateCount = _ref$realEstateCount === void 0 ? 0 : _ref$realEstateCount,
|
|
18
|
+
_ref$tradeMeCount = _ref.tradeMeCount,
|
|
19
|
+
tradeMeCount = _ref$tradeMeCount === void 0 ? 0 : _ref$tradeMeCount,
|
|
20
|
+
_ref$manualCount = _ref.manualCount,
|
|
21
|
+
manualCount = _ref$manualCount === void 0 ? 0 : _ref$manualCount,
|
|
22
|
+
_ref$heading = _ref.heading,
|
|
23
|
+
heading = _ref$heading === void 0 ? void 0 : _ref$heading;
|
|
24
|
+
var data = [{
|
|
25
|
+
color: "#0CC1A3",
|
|
26
|
+
count: general.parseChartCount(bookMeCount),
|
|
27
|
+
slug: "bookme",
|
|
28
|
+
title: "Tenant Portal"
|
|
29
|
+
}, {
|
|
30
|
+
color: "#000000",
|
|
31
|
+
count: general.parseChartCount(allhouseCount),
|
|
32
|
+
slug: "allhouse",
|
|
33
|
+
title: "Allhouse"
|
|
34
|
+
}, {
|
|
35
|
+
color: "#FF8500",
|
|
36
|
+
count: general.parseChartCount(oneRoofCount),
|
|
37
|
+
slug: "oneroof",
|
|
38
|
+
title: "OneRoof"
|
|
39
|
+
}, {
|
|
40
|
+
color: "#0098FF",
|
|
41
|
+
count: general.parseChartCount(realEstateCount),
|
|
42
|
+
slug: "realestate",
|
|
43
|
+
title: "realestate.co.nz"
|
|
44
|
+
}, {
|
|
45
|
+
color: "#4854D3",
|
|
46
|
+
count: general.parseChartCount(tradeMeCount),
|
|
47
|
+
slug: "trademe",
|
|
48
|
+
title: "Trade Me"
|
|
49
|
+
}, {
|
|
50
|
+
color: "#D9D9D9",
|
|
51
|
+
count: general.parseChartCount(manualCount),
|
|
52
|
+
slug: "manual",
|
|
53
|
+
title: "Manually Generated"
|
|
54
|
+
}];
|
|
55
|
+
return /* @__PURE__ */React.createElement(doughnutChart.default, {
|
|
56
|
+
data: data,
|
|
57
|
+
heading: heading
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
exports.default = AnalyticsDoughnutChart;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var reactUid = require('react-uid');
|
|
8
|
+
var Stack = require('@mui/material/Stack');
|
|
9
|
+
var ui = require('@tenancy.nz/ui');
|
|
10
|
+
var chart_js = require('primereact/chart.js');
|
|
11
|
+
var ChartLegend = require('./ChartLegend.cjs');
|
|
12
|
+
|
|
13
|
+
function DoughnutChart(_ref) {
|
|
14
|
+
var data = _ref.data,
|
|
15
|
+
_ref$heading = _ref.heading,
|
|
16
|
+
heading = _ref$heading === void 0 ? void 0 : _ref$heading,
|
|
17
|
+
_ref$chartProps = _ref.chartProps,
|
|
18
|
+
chartProps = _ref$chartProps === void 0 ? {} : _ref$chartProps,
|
|
19
|
+
_ref$size = _ref.size,
|
|
20
|
+
size = _ref$size === void 0 ? "164px" : _ref$size;
|
|
21
|
+
if (!Array.isArray(data) || data.length === 0) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
var chartLabels = data.map(function (d) {
|
|
25
|
+
return d.title;
|
|
26
|
+
});
|
|
27
|
+
var chartValues = data.map(function (d) {
|
|
28
|
+
return d.count;
|
|
29
|
+
});
|
|
30
|
+
var chartColors = data.map(function (d) {
|
|
31
|
+
return d.color;
|
|
32
|
+
});
|
|
33
|
+
return /* @__PURE__ */React.createElement(Stack, {
|
|
34
|
+
sx: {
|
|
35
|
+
position: "relative"
|
|
36
|
+
},
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
gap: 4
|
|
39
|
+
}, heading && /* @__PURE__ */React.createElement(ui.Heading, {
|
|
40
|
+
as: "h4",
|
|
41
|
+
color: "primary"
|
|
42
|
+
}, heading), /* @__PURE__ */React.createElement(Stack, {
|
|
43
|
+
flexDirection: {
|
|
44
|
+
sm: "row"
|
|
45
|
+
},
|
|
46
|
+
gap: 12,
|
|
47
|
+
alignItems: "center"
|
|
48
|
+
}, /* @__PURE__ */React.createElement(ui.Box, {
|
|
49
|
+
width: size,
|
|
50
|
+
height: size,
|
|
51
|
+
overflow: "hidden",
|
|
52
|
+
position: "relative",
|
|
53
|
+
maxWidth: "100%",
|
|
54
|
+
sx: {
|
|
55
|
+
"&& > canvas": {
|
|
56
|
+
width: "100%",
|
|
57
|
+
height: "100%"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}, /* @__PURE__ */React.createElement(chart_js.Chart, _rollupPluginBabelHelpers.objectSpread2({
|
|
61
|
+
type: "doughnut",
|
|
62
|
+
data: {
|
|
63
|
+
labels: chartLabels,
|
|
64
|
+
datasets: [{
|
|
65
|
+
data: chartValues,
|
|
66
|
+
backgroundColor: chartColors,
|
|
67
|
+
hoverBackgroundColor: chartColors,
|
|
68
|
+
borderWidth: 0
|
|
69
|
+
}]
|
|
70
|
+
},
|
|
71
|
+
options: {
|
|
72
|
+
responsive: true,
|
|
73
|
+
maintainAspectRatio: false,
|
|
74
|
+
cutoutPercentage: 64,
|
|
75
|
+
legend: {
|
|
76
|
+
display: false
|
|
77
|
+
},
|
|
78
|
+
animation: {
|
|
79
|
+
duration: 0
|
|
80
|
+
},
|
|
81
|
+
tooltips: {
|
|
82
|
+
backgroundColor: "#0E0044",
|
|
83
|
+
titleFontColor: "#fff",
|
|
84
|
+
bodyFontColor: "#fff",
|
|
85
|
+
xPadding: 8,
|
|
86
|
+
yPadding: 8,
|
|
87
|
+
bodyFontFamily: "Montserrat, sans-serif",
|
|
88
|
+
bodyFontStyle: "semibold",
|
|
89
|
+
bodyFontSize: 14,
|
|
90
|
+
borderColor: "transparent",
|
|
91
|
+
callbacks: {
|
|
92
|
+
labelColor: function labelColor(tooltipItem, chart) {
|
|
93
|
+
var dataset = chart.config.data.datasets[tooltipItem.datasetIndex];
|
|
94
|
+
var color = dataset.backgroundColor[tooltipItem.index];
|
|
95
|
+
return {
|
|
96
|
+
borderColor: color,
|
|
97
|
+
backgroundColor: color,
|
|
98
|
+
borderWidth: 0,
|
|
99
|
+
borderRadius: 5
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
style: {
|
|
106
|
+
width: "100%",
|
|
107
|
+
height: "100%"
|
|
108
|
+
}
|
|
109
|
+
}, chartProps))), /* @__PURE__ */React.createElement(Stack, {
|
|
110
|
+
gap: 2
|
|
111
|
+
}, data.map(function (item) {
|
|
112
|
+
var color = item.color,
|
|
113
|
+
count = item.count,
|
|
114
|
+
title = item.title;
|
|
115
|
+
return /* @__PURE__ */React.createElement(ChartLegend.default, {
|
|
116
|
+
key: reactUid.uid(item),
|
|
117
|
+
color: color,
|
|
118
|
+
count: count,
|
|
119
|
+
label: title
|
|
120
|
+
});
|
|
121
|
+
}))));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
exports.default = DoughnutChart;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -9,7 +9,8 @@ var BookingTableRow = require('./components/BookingTableRow.cjs');
|
|
|
9
9
|
var BookingTableRowHeader = require('./components/BookingTableRowHeader.cjs');
|
|
10
10
|
var BookingTableRowSkeleton = require('./components/BookingTableRowSkeleton.cjs');
|
|
11
11
|
var CheckedIcon = require('./components/CheckedIcon.cjs');
|
|
12
|
-
var
|
|
12
|
+
var doughnutChart = require('./components/doughnut-chart.cjs');
|
|
13
|
+
var analyticsDoughnutChart = require('./components/analytics-doughnut-chart.cjs');
|
|
13
14
|
var GridList = require('./components/GridList.cjs');
|
|
14
15
|
var Hidden = require('./components/Hidden.cjs');
|
|
15
16
|
var IconLabel = require('./components/IconLabel.cjs');
|
|
@@ -27,7 +28,8 @@ exports.BookingTableRow = BookingTableRow.default;
|
|
|
27
28
|
exports.BookingTableRowHeader = BookingTableRowHeader.default;
|
|
28
29
|
exports.BookingTableRowSkeleton = BookingTableRowSkeleton.default;
|
|
29
30
|
exports.CheckedIcon = CheckedIcon.default;
|
|
30
|
-
exports.
|
|
31
|
+
exports.DoughnutChart = doughnutChart.default;
|
|
32
|
+
exports.AnalyticsDoughnutChart = analyticsDoughnutChart.default;
|
|
31
33
|
exports.GridList = GridList.default;
|
|
32
34
|
exports.Hidden = Hidden.default;
|
|
33
35
|
exports.IconLabel = IconLabel.default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var parseChartCount = function parseChartCount(value) {
|
|
4
|
+
if (Number.isNaN(Number.parseInt(String(value), 10))) {
|
|
5
|
+
return 0;
|
|
6
|
+
}
|
|
7
|
+
if (value === 0) {
|
|
8
|
+
return 0;
|
|
9
|
+
}
|
|
10
|
+
return Math.max(Number(value), 1e-3);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.parseChartCount = parseChartCount;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Box, Skeleton, Heading, Text } from '@tenancy.nz/ui';
|
|
3
|
-
import
|
|
3
|
+
import EmailRoundedIcon from '@mui/icons-material/EmailRounded';
|
|
4
|
+
import PhoneRoundedIcon from '@mui/icons-material/PhoneRounded';
|
|
5
|
+
import PersonRoundedIcon from '@mui/icons-material/PersonRounded';
|
|
4
6
|
import IconLabel from './IconLabel.js';
|
|
5
7
|
|
|
6
8
|
function AgentDetailsCard(_ref) {
|
|
@@ -29,8 +31,8 @@ function AgentDetailsCard(_ref) {
|
|
|
29
31
|
variant: "text"
|
|
30
32
|
}) : /* @__PURE__ */React.createElement(IconLabel, {
|
|
31
33
|
color: "tertiary.main",
|
|
32
|
-
startIcon: /* @__PURE__ */React.createElement(
|
|
33
|
-
|
|
34
|
+
startIcon: /* @__PURE__ */React.createElement(PersonRoundedIcon, {
|
|
35
|
+
fontSize: "small"
|
|
34
36
|
})
|
|
35
37
|
}, /* @__PURE__ */React.createElement(Heading, {
|
|
36
38
|
as: "h5",
|
|
@@ -41,8 +43,8 @@ function AgentDetailsCard(_ref) {
|
|
|
41
43
|
variant: "text"
|
|
42
44
|
}) : /* @__PURE__ */React.createElement(IconLabel, {
|
|
43
45
|
color: "tertiary.main",
|
|
44
|
-
startIcon: /* @__PURE__ */React.createElement(
|
|
45
|
-
|
|
46
|
+
startIcon: /* @__PURE__ */React.createElement(PhoneRoundedIcon, {
|
|
47
|
+
fontSize: "small"
|
|
46
48
|
})
|
|
47
49
|
}, /* @__PURE__ */React.createElement(Text, {
|
|
48
50
|
as: "span",
|
|
@@ -55,8 +57,8 @@ function AgentDetailsCard(_ref) {
|
|
|
55
57
|
variant: "text"
|
|
56
58
|
}) : /* @__PURE__ */React.createElement(IconLabel, {
|
|
57
59
|
color: "tertiary.main",
|
|
58
|
-
startIcon: /* @__PURE__ */React.createElement(
|
|
59
|
-
|
|
60
|
+
startIcon: /* @__PURE__ */React.createElement(EmailRoundedIcon, {
|
|
61
|
+
fontSize: "small"
|
|
60
62
|
})
|
|
61
63
|
}, /* @__PURE__ */React.createElement(Text, {
|
|
62
64
|
as: "span",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import
|
|
3
|
+
import Stack from '@mui/material/Stack';
|
|
4
|
+
import { Paper, Heading, Text } from '@tenancy.nz/ui';
|
|
4
5
|
|
|
5
|
-
var _excluded = ["width", "minWidth", "maxWidth", "height", "border", "label", "amount", "text"];
|
|
6
|
+
var _excluded = ["width", "minWidth", "maxWidth", "height", "border", "label", "amount", "text", "sx"];
|
|
6
7
|
function AnalyticsBox(_ref) {
|
|
7
8
|
var width = _ref.width,
|
|
8
9
|
minWidth = _ref.minWidth,
|
|
@@ -12,40 +13,48 @@ function AnalyticsBox(_ref) {
|
|
|
12
13
|
label = _ref.label,
|
|
13
14
|
amount = _ref.amount,
|
|
14
15
|
text = _ref.text,
|
|
16
|
+
_ref$sx = _ref.sx,
|
|
17
|
+
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
15
18
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
16
19
|
return /* @__PURE__ */React.createElement(Paper, _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
17
|
-
|
|
20
|
+
inset: "medium",
|
|
21
|
+
sx: _objectSpread2(_objectSpread2({
|
|
18
22
|
maxWidth: maxWidth,
|
|
19
23
|
width: width,
|
|
20
24
|
minWidth: minWidth,
|
|
21
|
-
border: border,
|
|
22
|
-
height: height
|
|
25
|
+
border: border || "1px solid",
|
|
26
|
+
height: height,
|
|
23
27
|
display: "flex",
|
|
24
28
|
alignItems: "center",
|
|
25
|
-
justifyContent: "center"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
justifyContent: "center"
|
|
30
|
+
}, border ? {} : {
|
|
31
|
+
borderColor: "grey.300"
|
|
32
|
+
}), sx)
|
|
33
|
+
}), /* @__PURE__ */React.createElement(Stack, {
|
|
34
|
+
color: "text.primary"
|
|
35
|
+
}, /* @__PURE__ */React.createElement(Heading, {
|
|
29
36
|
align: "center",
|
|
30
37
|
weight: "700",
|
|
31
38
|
as: "h3",
|
|
39
|
+
color: "primary",
|
|
32
40
|
gutterBottom: true
|
|
33
41
|
}, amount), /* @__PURE__ */React.createElement(Text, {
|
|
34
42
|
align: "center",
|
|
35
|
-
weight: "
|
|
36
|
-
variant: "body2"
|
|
43
|
+
weight: "500",
|
|
44
|
+
variant: "body2",
|
|
45
|
+
color: "primary"
|
|
37
46
|
}, label), text && /* @__PURE__ */React.createElement(Text, {
|
|
38
47
|
align: "center",
|
|
39
48
|
weight: "400",
|
|
49
|
+
color: "primary",
|
|
40
50
|
sx: {
|
|
41
51
|
fontSize: {
|
|
42
52
|
xs: 8,
|
|
43
|
-
sm: 10
|
|
44
|
-
xl: 14
|
|
53
|
+
sm: 10
|
|
45
54
|
},
|
|
46
|
-
lineHeight: "
|
|
55
|
+
lineHeight: "13px",
|
|
47
56
|
maxWidth: "366px",
|
|
48
|
-
mt:
|
|
57
|
+
mt: 1
|
|
49
58
|
}
|
|
50
59
|
}, text)));
|
|
51
60
|
}
|