@tenancy.nz/feature-ui 1.0.0 → 1.0.2
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/_virtual/_rollupPluginBabelHelpers.cjs +134 -0
- package/dist/cjs/components/AgentDetailsCard.cjs +93 -0
- package/dist/cjs/components/AnalyticsBox.cjs +58 -0
- package/dist/cjs/components/AnalyticsSection.cjs +161 -0
- package/dist/cjs/components/BookingChart.cjs +126 -0
- package/dist/cjs/components/BookingChart.styled.cjs +46 -0
- package/dist/cjs/components/BookingTable.cjs +53 -0
- package/dist/cjs/components/BookingTableRow.cjs +107 -0
- package/dist/cjs/components/BookingTableRow.styled.cjs +21 -0
- package/dist/cjs/components/BookingTableRowHeader.cjs +66 -0
- package/dist/cjs/components/BookingTableRowSkeleton.cjs +97 -0
- package/dist/cjs/components/CheckedIcon.cjs +23 -0
- package/dist/cjs/components/EnquiriesDoughnutChart.cjs +144 -0
- package/dist/cjs/components/GridList.cjs +80 -0
- package/dist/cjs/components/Hidden.cjs +18 -0
- package/dist/cjs/components/IconLabel.cjs +44 -0
- package/dist/cjs/components/NotesCard.cjs +67 -0
- package/dist/cjs/components/PropertyCard.cjs +145 -0
- package/dist/cjs/components/PropertyCard.styled.cjs +24 -0
- package/dist/cjs/index.cjs +36 -0
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +120 -0
- package/dist/esm/components/AgentDetailsCard.js +89 -0
- package/dist/esm/components/AnalyticsBox.js +54 -0
- package/dist/esm/components/AnalyticsSection.js +157 -0
- package/dist/esm/components/BookingChart.js +122 -0
- package/dist/esm/components/BookingChart.styled.js +40 -0
- package/dist/esm/components/BookingTable.js +49 -0
- package/dist/esm/components/BookingTableRow.js +103 -0
- package/dist/esm/components/BookingTableRow.styled.js +19 -0
- package/dist/esm/components/BookingTableRowHeader.js +62 -0
- package/dist/esm/components/BookingTableRowSkeleton.js +93 -0
- package/dist/esm/components/CheckedIcon.js +19 -0
- package/dist/esm/components/EnquiriesDoughnutChart.js +140 -0
- package/dist/esm/components/GridList.js +76 -0
- package/dist/esm/components/Hidden.js +14 -0
- package/dist/esm/components/IconLabel.js +40 -0
- package/dist/esm/components/NotesCard.js +63 -0
- package/dist/esm/components/PropertyCard.js +141 -0
- package/dist/esm/components/PropertyCard.styled.js +20 -0
- package/dist/esm/index.js +16 -0
- package/package.json +5 -5
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
import { Box } from '@tenancy.nz/ui';
|
|
5
|
+
import { Chart } from 'primereact/chart';
|
|
6
|
+
import { StyledBookingChartStack, StyledBookingChartLegend, StyledBookingChartButton } from './BookingChart.styled.js';
|
|
7
|
+
|
|
8
|
+
var defaultOptions = {
|
|
9
|
+
scaleFontColor: "black",
|
|
10
|
+
legend: {
|
|
11
|
+
display: false
|
|
12
|
+
},
|
|
13
|
+
plugins: {
|
|
14
|
+
datalabels: {
|
|
15
|
+
align: "centre",
|
|
16
|
+
font: {
|
|
17
|
+
weight: "700",
|
|
18
|
+
size: 12,
|
|
19
|
+
family: "Montserrat, sans-serif"
|
|
20
|
+
},
|
|
21
|
+
display: function display(ctx) {
|
|
22
|
+
return ctx.dataset.data[ctx.dataIndex] > 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
scales: {
|
|
27
|
+
xAxes: [{
|
|
28
|
+
gridLines: {
|
|
29
|
+
labelString: "Date",
|
|
30
|
+
display: false
|
|
31
|
+
},
|
|
32
|
+
ticks: {
|
|
33
|
+
fontSize: 13,
|
|
34
|
+
family: "Montserrat, sans-serif",
|
|
35
|
+
fontWeight: "bold"
|
|
36
|
+
},
|
|
37
|
+
stacked: true
|
|
38
|
+
}],
|
|
39
|
+
yAxes: [{
|
|
40
|
+
scaleLabel: {
|
|
41
|
+
display: true,
|
|
42
|
+
labelString: "Total bookings",
|
|
43
|
+
fontFamily: "Montserrat, sans-serif",
|
|
44
|
+
fontSize: 13,
|
|
45
|
+
fontStyle: "600"
|
|
46
|
+
},
|
|
47
|
+
ticks: {
|
|
48
|
+
min: 0,
|
|
49
|
+
stepSize: 5,
|
|
50
|
+
fontSize: 13,
|
|
51
|
+
fontWeight: 500
|
|
52
|
+
},
|
|
53
|
+
gridLines: {
|
|
54
|
+
display: false
|
|
55
|
+
},
|
|
56
|
+
stacked: true
|
|
57
|
+
}]
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
function BookingChart(_ref) {
|
|
61
|
+
var data = _ref.data,
|
|
62
|
+
labels = _ref.labels,
|
|
63
|
+
_ref$mode = _ref.mode,
|
|
64
|
+
mode = _ref$mode === void 0 ? "day" : _ref$mode,
|
|
65
|
+
_ref$options = _ref.options,
|
|
66
|
+
options = _ref$options === void 0 ? {} : _ref$options,
|
|
67
|
+
_ref$onModeChange = _ref.onModeChange,
|
|
68
|
+
onModeChange = _ref$onModeChange === void 0 ? void 0 : _ref$onModeChange;
|
|
69
|
+
var legends = useMemo(function () {
|
|
70
|
+
return data.map(function (_ref2) {
|
|
71
|
+
var label = _ref2.label,
|
|
72
|
+
backgroundColor = _ref2.backgroundColor;
|
|
73
|
+
return [label, backgroundColor];
|
|
74
|
+
}).filter(function (_ref3, i, items) {
|
|
75
|
+
var _ref4 = _slicedToArray(_ref3, 1),
|
|
76
|
+
label = _ref4[0];
|
|
77
|
+
return items.findIndex(function (_ref5) {
|
|
78
|
+
var _ref6 = _slicedToArray(_ref5, 1),
|
|
79
|
+
l = _ref6[0];
|
|
80
|
+
return l === label;
|
|
81
|
+
}) === i;
|
|
82
|
+
});
|
|
83
|
+
}, [data]);
|
|
84
|
+
return /* @__PURE__ */React.createElement(Box, {
|
|
85
|
+
display: "flex",
|
|
86
|
+
direction: "column",
|
|
87
|
+
gap: "16px",
|
|
88
|
+
width: "100%"
|
|
89
|
+
}, legends.length > 0 && /* @__PURE__ */React.createElement(StyledBookingChartStack, null, legends.map(function (_ref7) {
|
|
90
|
+
var _ref8 = _slicedToArray(_ref7, 2),
|
|
91
|
+
label = _ref8[0],
|
|
92
|
+
backgroundColor = _ref8[1];
|
|
93
|
+
return /* @__PURE__ */React.createElement(StyledBookingChartLegend, {
|
|
94
|
+
key: label,
|
|
95
|
+
color: backgroundColor
|
|
96
|
+
}, label);
|
|
97
|
+
})), /* @__PURE__ */React.createElement(Box, {
|
|
98
|
+
width: "100%",
|
|
99
|
+
overflow: "hidden"
|
|
100
|
+
}, /* @__PURE__ */React.createElement(Chart, {
|
|
101
|
+
type: "bar",
|
|
102
|
+
data: {
|
|
103
|
+
labels: labels,
|
|
104
|
+
datasets: data
|
|
105
|
+
},
|
|
106
|
+
options: _objectSpread2(_objectSpread2({}, defaultOptions), options)
|
|
107
|
+
})), onModeChange && /* @__PURE__ */React.createElement(StyledBookingChartStack, null, /* @__PURE__ */React.createElement(StyledBookingChartButton, {
|
|
108
|
+
onClick: onModeChange,
|
|
109
|
+
active: mode === "day",
|
|
110
|
+
value: "day"
|
|
111
|
+
}, "Day"), /* @__PURE__ */React.createElement(StyledBookingChartButton, {
|
|
112
|
+
onClick: onModeChange,
|
|
113
|
+
active: mode === "week",
|
|
114
|
+
value: "week"
|
|
115
|
+
}, "Week"), /* @__PURE__ */React.createElement(StyledBookingChartButton, {
|
|
116
|
+
onClick: onModeChange,
|
|
117
|
+
active: mode === "month",
|
|
118
|
+
value: "month"
|
|
119
|
+
}, "Month")));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export { BookingChart as default };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { taggedTemplateLiteral as _taggedTemplateLiteral } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import styled from '@emotion/styled';
|
|
5
|
+
|
|
6
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
7
|
+
var StyledBookingChartStack = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n padding: 0;\n margin: 0;\n list-style: none;\n font-size: 12px;\n justify-content: center;\n color: #000;\n width: 100%;\n"])));
|
|
8
|
+
var StyledBookingChartLegend = styled("span", {
|
|
9
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
10
|
+
return !["color"].includes(prop);
|
|
11
|
+
}
|
|
12
|
+
})(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-weight: 500;\n display: flex;\n align-items: center;\n gap: 6px;\n\n &::before {\n content: '';\n display: inline-flex;\n width: 32px;\n height: 18px;\n background-color: ", ";\n border-radius: 4px;\n }\n"])), function (props) {
|
|
13
|
+
return props.color;
|
|
14
|
+
});
|
|
15
|
+
var StyledBookingChartButton = styled("button", {
|
|
16
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
17
|
+
return !["color"].includes(prop);
|
|
18
|
+
}
|
|
19
|
+
})(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-weight: 500;\n display: flex;\n align-items: center;\n padding: 6px 10px;\n font-size: 14px;\n border-radius: 4px;\n font-family: inherit;\n border: 1px solid ", ";\n box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.1);\n background-color: ", ";\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n"])), function (_ref) {
|
|
20
|
+
var theme = _ref.theme;
|
|
21
|
+
return theme.palette.primary.main;
|
|
22
|
+
}, function (_ref2) {
|
|
23
|
+
var active = _ref2.active,
|
|
24
|
+
theme = _ref2.theme;
|
|
25
|
+
return active ? "#CEF3ED" : theme.palette.background.paper;
|
|
26
|
+
}, function (_ref3) {
|
|
27
|
+
var active = _ref3.active,
|
|
28
|
+
theme = _ref3.theme;
|
|
29
|
+
return !active ? theme.palette.grey[100] : null;
|
|
30
|
+
});
|
|
31
|
+
var StyledPropertyDetailsBox = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n align-items: flex-start;\n padding: 16px 24px 16px 20px;\n flex-direction: column;\n\n ", "\n\n @media print {\n flex-direction: row;\n align-items: center;\n }\n"])), function (_ref4) {
|
|
32
|
+
var theme = _ref4.theme;
|
|
33
|
+
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n ", " {\n flex-direction: row;\n align-items: center;\n }\n "])), theme.breakpoints.up("sm"));
|
|
34
|
+
});
|
|
35
|
+
var StyledPropertyAmenitiesBox = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n padding-right: 25px;\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n\n gap: 18px;\n min-width: 170px;\n height: 100%;\n justify-content: space-between;\n\n ", "\n\n @media print {\n align-items: flex-end;\n }\n"])), function (_ref5) {
|
|
36
|
+
var theme = _ref5.theme;
|
|
37
|
+
return "\n @media (min-width: ".concat(theme.breakpoints.values.md, "px) {\n align-items: flex-end;\n }\n ");
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export { StyledBookingChartButton, StyledBookingChartLegend, StyledBookingChartStack, StyledPropertyAmenitiesBox, StyledPropertyDetailsBox };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { uid } from 'react-uid';
|
|
4
|
+
import { Box, Paper, Heading } from '@tenancy.nz/ui';
|
|
5
|
+
import BookingTableRowHeader from './BookingTableRowHeader.js';
|
|
6
|
+
import BookingTableRow from './BookingTableRow.js';
|
|
7
|
+
import BookingTableRowSkeleton from './BookingTableRowSkeleton.js';
|
|
8
|
+
|
|
9
|
+
function BookingTable(_ref) {
|
|
10
|
+
var data = _ref.data,
|
|
11
|
+
_ref$loading = _ref.loading,
|
|
12
|
+
loading = _ref$loading === void 0 ? false : _ref$loading;
|
|
13
|
+
return /* @__PURE__ */React.createElement(Box, {
|
|
14
|
+
sx: {
|
|
15
|
+
overflowX: "auto",
|
|
16
|
+
scrollBehavior: "smooth"
|
|
17
|
+
}
|
|
18
|
+
}, /* @__PURE__ */React.createElement(Box, {
|
|
19
|
+
sx: {
|
|
20
|
+
minWidth: "1024px"
|
|
21
|
+
}
|
|
22
|
+
}, /* @__PURE__ */React.createElement(Paper, {
|
|
23
|
+
outlined: true,
|
|
24
|
+
overflow: false
|
|
25
|
+
}, /* @__PURE__ */React.createElement(Box, {
|
|
26
|
+
bgcolor: "grey.50"
|
|
27
|
+
}, /* @__PURE__ */React.createElement(BookingTableRowHeader, null)), /* @__PURE__ */React.createElement(Box, null, !loading && data.map(function (booking, index) {
|
|
28
|
+
return /* @__PURE__ */React.createElement(BookingTableRow, {
|
|
29
|
+
key: uid(booking, index),
|
|
30
|
+
firstName: booking.firstName,
|
|
31
|
+
lastName: booking.lastName,
|
|
32
|
+
notes: booking.notes,
|
|
33
|
+
tenantNotes: booking.tenantNotes,
|
|
34
|
+
status: booking.status,
|
|
35
|
+
attended: booking.attended,
|
|
36
|
+
suitable: booking.suitable,
|
|
37
|
+
applicationSent: booking.applicationSent,
|
|
38
|
+
applicationReceived: booking.applicationReceived
|
|
39
|
+
});
|
|
40
|
+
}), loading && /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(BookingTableRowSkeleton, null), /* @__PURE__ */React.createElement(BookingTableRowSkeleton, null), /* @__PURE__ */React.createElement(BookingTableRowSkeleton, null), /* @__PURE__ */React.createElement(BookingTableRowSkeleton, null)), !loading && data.length === 0 && /* @__PURE__ */React.createElement(Heading, {
|
|
41
|
+
as: "h4",
|
|
42
|
+
align: "center",
|
|
43
|
+
sx: {
|
|
44
|
+
margin: "16px 0"
|
|
45
|
+
}
|
|
46
|
+
}, "No bookings")))));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { BookingTable as default };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Grid, Text, Tag } from '@tenancy.nz/ui';
|
|
4
|
+
import CheckedIcon from './CheckedIcon.js';
|
|
5
|
+
import { StyledBookingTableRowCell } from './BookingTableRow.styled.js';
|
|
6
|
+
|
|
7
|
+
var tagMap = function tagMap(status) {
|
|
8
|
+
if (status === "confirmed") {
|
|
9
|
+
return /* @__PURE__ */React.createElement(Tag, {
|
|
10
|
+
color: "success",
|
|
11
|
+
label: "Confirmed"
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
if (status === "cancelled") {
|
|
15
|
+
return /* @__PURE__ */React.createElement(Tag, {
|
|
16
|
+
color: "error",
|
|
17
|
+
label: "Cancelled"
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */React.createElement(Tag, {
|
|
21
|
+
color: "info",
|
|
22
|
+
label: "Registered"
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
function BookingTableRow(_ref) {
|
|
26
|
+
var _ref$applicationRecei = _ref.applicationReceived,
|
|
27
|
+
applicationReceived = _ref$applicationRecei === void 0 ? false : _ref$applicationRecei,
|
|
28
|
+
_ref$applicationSent = _ref.applicationSent,
|
|
29
|
+
applicationSent = _ref$applicationSent === void 0 ? false : _ref$applicationSent,
|
|
30
|
+
_ref$attended = _ref.attended,
|
|
31
|
+
attended = _ref$attended === void 0 ? false : _ref$attended,
|
|
32
|
+
firstName = _ref.firstName,
|
|
33
|
+
lastName = _ref.lastName,
|
|
34
|
+
_ref$notes = _ref.notes,
|
|
35
|
+
notes = _ref$notes === void 0 ? void 0 : _ref$notes,
|
|
36
|
+
status = _ref.status,
|
|
37
|
+
_ref$suitable = _ref.suitable,
|
|
38
|
+
suitable = _ref$suitable === void 0 ? false : _ref$suitable,
|
|
39
|
+
_ref$tenantNotes = _ref.tenantNotes,
|
|
40
|
+
tenantNotes = _ref$tenantNotes === void 0 ? void 0 : _ref$tenantNotes;
|
|
41
|
+
return /* @__PURE__ */React.createElement(Grid, {
|
|
42
|
+
container: true,
|
|
43
|
+
spacing: 0
|
|
44
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
45
|
+
item: true,
|
|
46
|
+
container: true,
|
|
47
|
+
xs: 6
|
|
48
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
49
|
+
item: true,
|
|
50
|
+
xs: 3,
|
|
51
|
+
md: 3
|
|
52
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, null, firstName, " ", lastName)), /* @__PURE__ */React.createElement(Grid, {
|
|
53
|
+
item: true,
|
|
54
|
+
xs: 6,
|
|
55
|
+
md: 7
|
|
56
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, null, /* @__PURE__ */React.createElement(Text, {
|
|
57
|
+
as: "div",
|
|
58
|
+
variant: "body2"
|
|
59
|
+
}, notes && /* @__PURE__ */React.createElement(Text, {
|
|
60
|
+
variant: "inherit",
|
|
61
|
+
paragraph: !!tenantNotes
|
|
62
|
+
}, /* @__PURE__ */React.createElement("strong", null, "Property Manager Note"), " ", /* @__PURE__ */React.createElement("br", null), notes), tenantNotes && /* @__PURE__ */React.createElement(Text, {
|
|
63
|
+
variant: "inherit"
|
|
64
|
+
}, /* @__PURE__ */React.createElement("strong", null, "Tenant Feedback"), /* @__PURE__ */React.createElement("br", null), tenantNotes)))), /* @__PURE__ */React.createElement(Grid, {
|
|
65
|
+
item: true,
|
|
66
|
+
xs: 3,
|
|
67
|
+
md: 2
|
|
68
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, null, /* @__PURE__ */React.createElement("span", null, tagMap(status))))), /* @__PURE__ */React.createElement(Grid, {
|
|
69
|
+
item: true,
|
|
70
|
+
container: true,
|
|
71
|
+
xs: 6
|
|
72
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
73
|
+
item: true,
|
|
74
|
+
xs: 3
|
|
75
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, {
|
|
76
|
+
align: "center"
|
|
77
|
+
}, /* @__PURE__ */React.createElement(CheckedIcon, {
|
|
78
|
+
value: attended
|
|
79
|
+
}))), /* @__PURE__ */React.createElement(Grid, {
|
|
80
|
+
item: true,
|
|
81
|
+
xs: 3
|
|
82
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, {
|
|
83
|
+
align: "center"
|
|
84
|
+
}, /* @__PURE__ */React.createElement(CheckedIcon, {
|
|
85
|
+
value: suitable
|
|
86
|
+
}))), /* @__PURE__ */React.createElement(Grid, {
|
|
87
|
+
item: true,
|
|
88
|
+
xs: 3
|
|
89
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, {
|
|
90
|
+
align: "center"
|
|
91
|
+
}, /* @__PURE__ */React.createElement(CheckedIcon, {
|
|
92
|
+
value: applicationSent
|
|
93
|
+
}))), /* @__PURE__ */React.createElement(Grid, {
|
|
94
|
+
item: true,
|
|
95
|
+
xs: 3
|
|
96
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, {
|
|
97
|
+
align: "center"
|
|
98
|
+
}, /* @__PURE__ */React.createElement(CheckedIcon, {
|
|
99
|
+
value: applicationReceived
|
|
100
|
+
})))));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export { BookingTableRow as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { taggedTemplateLiteral as _taggedTemplateLiteral } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import styled from '@emotion/styled';
|
|
5
|
+
|
|
6
|
+
var _templateObject, _templateObject2;
|
|
7
|
+
var StyledBookingTableRowCell = styled("div", {
|
|
8
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
9
|
+
return prop !== "align";
|
|
10
|
+
}
|
|
11
|
+
})(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n"])), function (_ref) {
|
|
12
|
+
var _ref$align = _ref.align,
|
|
13
|
+
align = _ref$align === void 0 ? "left" : _ref$align,
|
|
14
|
+
header = _ref.header,
|
|
15
|
+
theme = _ref.theme;
|
|
16
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: ", ";\n padding: 6px 12px;\n font-size: ", ";\n color: #717680;\n height: 100%;\n\n ", "\n\n ", "\n\n ", "\n\n ", " {\n padding: 12px 24px;\n }\n\n @media print {\n padding: 12px 24px;\n }\n "])), header ? "center" : "flex-start", header ? "12px" : "14px", align === "left" && "\n align-items: flex-start;\n ", align === "center" && "\n align-items: center;\n text-align: center;\n ", align === "right" && "\n align-items: flex-end;\n ", theme.breakpoints.up("md"));
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export { StyledBookingTableRowCell };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Grid } from '@tenancy.nz/ui';
|
|
4
|
+
import { StyledBookingTableRowCell } from './BookingTableRow.styled.js';
|
|
5
|
+
|
|
6
|
+
function BookingTableRowHeader() {
|
|
7
|
+
return /* @__PURE__ */React.createElement(Grid, {
|
|
8
|
+
container: true,
|
|
9
|
+
spacing: 0
|
|
10
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
11
|
+
item: true,
|
|
12
|
+
container: true,
|
|
13
|
+
xs: 6
|
|
14
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
15
|
+
item: true,
|
|
16
|
+
xs: 3
|
|
17
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, {
|
|
18
|
+
header: true
|
|
19
|
+
}, "Name")), /* @__PURE__ */React.createElement(Grid, {
|
|
20
|
+
item: true,
|
|
21
|
+
xs: 6,
|
|
22
|
+
md: 7
|
|
23
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, {
|
|
24
|
+
header: true
|
|
25
|
+
}, "Comments")), /* @__PURE__ */React.createElement(Grid, {
|
|
26
|
+
item: true,
|
|
27
|
+
xs: 3,
|
|
28
|
+
md: 2
|
|
29
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, {
|
|
30
|
+
header: true
|
|
31
|
+
}, "Status"))), /* @__PURE__ */React.createElement(Grid, {
|
|
32
|
+
item: true,
|
|
33
|
+
container: true,
|
|
34
|
+
xs: 6
|
|
35
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
36
|
+
item: true,
|
|
37
|
+
xs: 3
|
|
38
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, {
|
|
39
|
+
align: "center",
|
|
40
|
+
header: true
|
|
41
|
+
}, "Attendend")), /* @__PURE__ */React.createElement(Grid, {
|
|
42
|
+
item: true,
|
|
43
|
+
xs: 3
|
|
44
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, {
|
|
45
|
+
align: "center",
|
|
46
|
+
header: true
|
|
47
|
+
}, "Suitable")), /* @__PURE__ */React.createElement(Grid, {
|
|
48
|
+
item: true,
|
|
49
|
+
xs: 3
|
|
50
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, {
|
|
51
|
+
align: "center",
|
|
52
|
+
header: true
|
|
53
|
+
}, "Application Sent")), /* @__PURE__ */React.createElement(Grid, {
|
|
54
|
+
item: true,
|
|
55
|
+
xs: 3
|
|
56
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, {
|
|
57
|
+
align: "center",
|
|
58
|
+
header: true
|
|
59
|
+
}, "Application Received"))));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { BookingTableRowHeader as default };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Grid, Skeleton } from '@tenancy.nz/ui';
|
|
4
|
+
import { StyledBookingTableRowCell } from './BookingTableRow.styled.js';
|
|
5
|
+
|
|
6
|
+
function BookingTableRowSkeleton() {
|
|
7
|
+
return /* @__PURE__ */React.createElement(Grid, {
|
|
8
|
+
container: true,
|
|
9
|
+
spacing: 0
|
|
10
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
11
|
+
item: true,
|
|
12
|
+
container: true,
|
|
13
|
+
xs: 12,
|
|
14
|
+
sm: 6
|
|
15
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
16
|
+
item: true,
|
|
17
|
+
xs: 12,
|
|
18
|
+
sm: 3
|
|
19
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, null, /* @__PURE__ */React.createElement(Skeleton, {
|
|
20
|
+
width: "85%",
|
|
21
|
+
height: "20px",
|
|
22
|
+
variant: "text"
|
|
23
|
+
}))), /* @__PURE__ */React.createElement(Grid, {
|
|
24
|
+
item: true,
|
|
25
|
+
xs: 12,
|
|
26
|
+
sm: 6,
|
|
27
|
+
md: 7
|
|
28
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, null, /* @__PURE__ */React.createElement(Skeleton, {
|
|
29
|
+
width: "95%",
|
|
30
|
+
height: "20px",
|
|
31
|
+
variant: "text"
|
|
32
|
+
}), /* @__PURE__ */React.createElement(Skeleton, {
|
|
33
|
+
width: "80%",
|
|
34
|
+
height: "20px",
|
|
35
|
+
variant: "text"
|
|
36
|
+
}))), /* @__PURE__ */React.createElement(Grid, {
|
|
37
|
+
item: true,
|
|
38
|
+
xs: 12,
|
|
39
|
+
sm: 3,
|
|
40
|
+
md: 2
|
|
41
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, null, /* @__PURE__ */React.createElement(Skeleton, {
|
|
42
|
+
width: "90px",
|
|
43
|
+
height: "30px",
|
|
44
|
+
variant: "text"
|
|
45
|
+
})))), /* @__PURE__ */React.createElement(Grid, {
|
|
46
|
+
item: true,
|
|
47
|
+
container: true,
|
|
48
|
+
xs: 12,
|
|
49
|
+
sm: 6
|
|
50
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
51
|
+
item: true,
|
|
52
|
+
xs: 12,
|
|
53
|
+
sm: 3
|
|
54
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, {
|
|
55
|
+
align: "center"
|
|
56
|
+
}, /* @__PURE__ */React.createElement(Skeleton, {
|
|
57
|
+
width: "40px",
|
|
58
|
+
height: "20px",
|
|
59
|
+
variant: "text"
|
|
60
|
+
}))), /* @__PURE__ */React.createElement(Grid, {
|
|
61
|
+
item: true,
|
|
62
|
+
xs: 12,
|
|
63
|
+
sm: 3
|
|
64
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, {
|
|
65
|
+
align: "center"
|
|
66
|
+
}, /* @__PURE__ */React.createElement(Skeleton, {
|
|
67
|
+
width: "40px",
|
|
68
|
+
height: "20px",
|
|
69
|
+
variant: "text"
|
|
70
|
+
}))), /* @__PURE__ */React.createElement(Grid, {
|
|
71
|
+
item: true,
|
|
72
|
+
xs: 12,
|
|
73
|
+
sm: 3
|
|
74
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, {
|
|
75
|
+
align: "center"
|
|
76
|
+
}, /* @__PURE__ */React.createElement(Skeleton, {
|
|
77
|
+
width: "40px",
|
|
78
|
+
height: "20px",
|
|
79
|
+
variant: "text"
|
|
80
|
+
}))), /* @__PURE__ */React.createElement(Grid, {
|
|
81
|
+
item: true,
|
|
82
|
+
xs: 12,
|
|
83
|
+
sm: 3
|
|
84
|
+
}, /* @__PURE__ */React.createElement(StyledBookingTableRowCell, {
|
|
85
|
+
align: "center"
|
|
86
|
+
}, /* @__PURE__ */React.createElement(Skeleton, {
|
|
87
|
+
width: "40px",
|
|
88
|
+
height: "20px",
|
|
89
|
+
variant: "text"
|
|
90
|
+
})))));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export { BookingTableRowSkeleton as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CircleCheckIcon, CircleTimesIcon } from '@tenancy.nz/icons';
|
|
4
|
+
|
|
5
|
+
function CheckedIcon(_ref) {
|
|
6
|
+
var value = _ref.value;
|
|
7
|
+
if (value === true) {
|
|
8
|
+
return /* @__PURE__ */React.createElement(CircleCheckIcon, {
|
|
9
|
+
color: "success.main",
|
|
10
|
+
size: "20px"
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return /* @__PURE__ */React.createElement(CircleTimesIcon, {
|
|
14
|
+
color: "error.main",
|
|
15
|
+
size: "20px"
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { CheckedIcon as default };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Box, Text } from '@tenancy.nz/ui';
|
|
4
|
+
import { Chart } from 'primereact/chart';
|
|
5
|
+
|
|
6
|
+
function EnquiriesDoughnutChart(_ref) {
|
|
7
|
+
var _ref$tradeMeEnquiries = _ref.tradeMeEnquiriesCount,
|
|
8
|
+
tradeMeEnquiriesCount = _ref$tradeMeEnquiries === void 0 ? 0 : _ref$tradeMeEnquiries,
|
|
9
|
+
_ref$bookMeEnquiriesC = _ref.bookMeEnquiriesCount,
|
|
10
|
+
bookMeEnquiriesCount = _ref$bookMeEnquiriesC === void 0 ? 0 : _ref$bookMeEnquiriesC,
|
|
11
|
+
_ref$manualEnquiryCou = _ref.manualEnquiryCount,
|
|
12
|
+
manualEnquiryCount = _ref$manualEnquiryCou === void 0 ? 0 : _ref$manualEnquiryCou;
|
|
13
|
+
var colors = {
|
|
14
|
+
tradeMe: "#6FD3C0",
|
|
15
|
+
bookMe: "#00C0F3",
|
|
16
|
+
manual: "#394869"
|
|
17
|
+
};
|
|
18
|
+
var chartColors = [colors.tradeMe, colors.bookMe, colors.manual];
|
|
19
|
+
return /* @__PURE__ */React.createElement(Box, {
|
|
20
|
+
position: "relative",
|
|
21
|
+
display: "flex",
|
|
22
|
+
height: "100%",
|
|
23
|
+
align: "center"
|
|
24
|
+
}, /* @__PURE__ */React.createElement(Text, {
|
|
25
|
+
transform: "uppercase",
|
|
26
|
+
sx: {
|
|
27
|
+
position: "absolute",
|
|
28
|
+
left: 20,
|
|
29
|
+
top: -10
|
|
30
|
+
},
|
|
31
|
+
fontSize: 13,
|
|
32
|
+
color: "textPrimary",
|
|
33
|
+
weight: "700"
|
|
34
|
+
}, "Number of enquiries"), /* @__PURE__ */React.createElement(Box, {
|
|
35
|
+
width: "100%",
|
|
36
|
+
overflow: "hidden"
|
|
37
|
+
}, /* @__PURE__ */React.createElement(Chart, {
|
|
38
|
+
type: "doughnut",
|
|
39
|
+
data: {
|
|
40
|
+
labels: ["TradeMe", "BookMe", "Manual"],
|
|
41
|
+
datasets: [{
|
|
42
|
+
data: [Math.max(tradeMeEnquiriesCount, 1e-3), Math.max(bookMeEnquiriesCount, 1e-3), Math.max(manualEnquiryCount, 1e-3)],
|
|
43
|
+
backgroundColor: chartColors,
|
|
44
|
+
hoverBackgroundColor: chartColors
|
|
45
|
+
}]
|
|
46
|
+
},
|
|
47
|
+
options: {
|
|
48
|
+
legend: {
|
|
49
|
+
display: false
|
|
50
|
+
},
|
|
51
|
+
animation: {
|
|
52
|
+
duration: 0
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
style: {
|
|
56
|
+
width: "100%",
|
|
57
|
+
position: "absolute",
|
|
58
|
+
top: "18%",
|
|
59
|
+
left: "-75px"
|
|
60
|
+
}
|
|
61
|
+
})), /* @__PURE__ */React.createElement(Box, {
|
|
62
|
+
maxWidth: {
|
|
63
|
+
xs: "160px",
|
|
64
|
+
xl: "180px"
|
|
65
|
+
},
|
|
66
|
+
width: "100%",
|
|
67
|
+
padding: "10px 20px",
|
|
68
|
+
mt: -4
|
|
69
|
+
}, /* @__PURE__ */React.createElement(Box, {
|
|
70
|
+
width: "100%"
|
|
71
|
+
}, /* @__PURE__ */React.createElement(Box, {
|
|
72
|
+
height: "10px",
|
|
73
|
+
backgroundColor: colors.tradeMe,
|
|
74
|
+
width: "100%"
|
|
75
|
+
}), /* @__PURE__ */React.createElement(Box, {
|
|
76
|
+
display: "flex",
|
|
77
|
+
justify: "space-between",
|
|
78
|
+
width: "100%",
|
|
79
|
+
align: "flex-start",
|
|
80
|
+
mt: 2
|
|
81
|
+
}, /* @__PURE__ */React.createElement(Text, {
|
|
82
|
+
transform: "uppercase",
|
|
83
|
+
fontSize: 12,
|
|
84
|
+
weight: "600"
|
|
85
|
+
}, "TradeMe"), /* @__PURE__ */React.createElement(Text, {
|
|
86
|
+
transform: "uppercase",
|
|
87
|
+
fontSize: 32,
|
|
88
|
+
weight: "700",
|
|
89
|
+
mt: -3,
|
|
90
|
+
color: "textPrimary"
|
|
91
|
+
}, tradeMeEnquiriesCount))), /* @__PURE__ */React.createElement(Box, {
|
|
92
|
+
width: "100%",
|
|
93
|
+
mt: "30px"
|
|
94
|
+
}, /* @__PURE__ */React.createElement(Box, {
|
|
95
|
+
height: "10px",
|
|
96
|
+
backgroundColor: colors.bookMe,
|
|
97
|
+
width: "100%"
|
|
98
|
+
}), /* @__PURE__ */React.createElement(Box, {
|
|
99
|
+
display: "flex",
|
|
100
|
+
justify: "space-between",
|
|
101
|
+
width: "100%",
|
|
102
|
+
align: "flex-start",
|
|
103
|
+
mt: 2
|
|
104
|
+
}, /* @__PURE__ */React.createElement(Text, {
|
|
105
|
+
transform: "uppercase",
|
|
106
|
+
fontSize: 12,
|
|
107
|
+
weight: "600"
|
|
108
|
+
}, "Bookme"), /* @__PURE__ */React.createElement(Text, {
|
|
109
|
+
transform: "uppercase",
|
|
110
|
+
fontSize: 32,
|
|
111
|
+
weight: "700",
|
|
112
|
+
mt: -3,
|
|
113
|
+
color: "textPrimary"
|
|
114
|
+
}, bookMeEnquiriesCount))), /* @__PURE__ */React.createElement(Box, {
|
|
115
|
+
width: "100%",
|
|
116
|
+
mt: "30px"
|
|
117
|
+
}, /* @__PURE__ */React.createElement(Box, {
|
|
118
|
+
height: "10px",
|
|
119
|
+
backgroundColor: colors.manual,
|
|
120
|
+
width: "100%"
|
|
121
|
+
}), /* @__PURE__ */React.createElement(Box, {
|
|
122
|
+
display: "flex",
|
|
123
|
+
justify: "space-between",
|
|
124
|
+
width: "100%",
|
|
125
|
+
align: "flex-start",
|
|
126
|
+
mt: 2
|
|
127
|
+
}, /* @__PURE__ */React.createElement(Text, {
|
|
128
|
+
transform: "uppercase",
|
|
129
|
+
fontSize: 12,
|
|
130
|
+
weight: "600"
|
|
131
|
+
}, "Manually", /* @__PURE__ */React.createElement("br", null), "Generated"), /* @__PURE__ */React.createElement(Text, {
|
|
132
|
+
transform: "uppercase",
|
|
133
|
+
fontSize: 32,
|
|
134
|
+
weight: "700",
|
|
135
|
+
color: "textPrimary",
|
|
136
|
+
mt: -3
|
|
137
|
+
}, manualEnquiryCount)))));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export { EnquiriesDoughnutChart as default };
|