@tenancy.nz/feature-ui 1.0.0 → 1.0.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 +55 -0
- package/dist/cjs/components/AnalyticsBox.cjs +58 -0
- package/dist/cjs/components/AnalyticsSection.cjs +209 -0
- package/dist/cjs/components/BookingChart.cjs +124 -0
- package/dist/cjs/components/BookingChart.styled.cjs +100 -0
- package/dist/cjs/components/BookingTable.cjs +44 -0
- package/dist/cjs/components/BookingTableRow.cjs +63 -0
- package/dist/cjs/components/BookingTableRow.styled.cjs +42 -0
- package/dist/cjs/components/BookingTableRowHeader.cjs +27 -0
- package/dist/cjs/components/BookingTableRowSkeleton.cjs +30 -0
- package/dist/cjs/components/CheckedIcon.cjs +17 -0
- package/dist/cjs/components/EnquiriesDoughnutChart.cjs +167 -0
- package/dist/cjs/components/GridList.cjs +87 -0
- package/dist/cjs/components/Hidden.cjs +15 -0
- package/dist/cjs/components/IconLabel.cjs +36 -0
- package/dist/cjs/components/NotesCard.cjs +39 -0
- package/dist/cjs/components/PropertyCard.cjs +137 -0
- package/dist/cjs/components/PropertyCard.styled.cjs +76 -0
- package/dist/cjs/index.cjs +36 -0
- package/dist/esm/components/AgentDetailsCard.js +51 -0
- package/dist/esm/components/AnalyticsBox.js +54 -0
- package/dist/esm/components/AnalyticsSection.js +205 -0
- package/dist/esm/components/BookingChart.js +120 -0
- package/dist/esm/components/BookingChart.styled.js +94 -0
- package/dist/esm/components/BookingTable.js +40 -0
- package/dist/esm/components/BookingTableRow.js +59 -0
- package/dist/esm/components/BookingTableRow.styled.js +40 -0
- package/dist/esm/components/BookingTableRowHeader.js +23 -0
- package/dist/esm/components/BookingTableRowSkeleton.js +26 -0
- package/dist/esm/components/CheckedIcon.js +13 -0
- package/dist/esm/components/EnquiriesDoughnutChart.js +163 -0
- package/dist/esm/components/GridList.js +83 -0
- package/dist/esm/components/Hidden.js +11 -0
- package/dist/esm/components/IconLabel.js +32 -0
- package/dist/esm/components/NotesCard.js +35 -0
- package/dist/esm/components/PropertyCard.js +133 -0
- package/dist/esm/components/PropertyCard.styled.js +72 -0
- package/dist/esm/index.js +16 -0
- package/package.json +5 -5
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var react = require('@emotion/react');
|
|
5
|
+
var styled = require('@emotion/styled');
|
|
6
|
+
|
|
7
|
+
const StyledBookingTableRowCell = styled("div", {
|
|
8
|
+
shouldForwardProp: (prop) => prop !== "align"
|
|
9
|
+
})`
|
|
10
|
+
${({ align = "left", header, theme }) => react.css`
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
justify-content: ${header ? "center" : "flex-start"};
|
|
14
|
+
padding: 6px 12px;
|
|
15
|
+
font-size: ${header ? "12px" : "14px"};
|
|
16
|
+
color: #717680;
|
|
17
|
+
height: 100%;
|
|
18
|
+
|
|
19
|
+
${align === "left" && `
|
|
20
|
+
align-items: flex-start;
|
|
21
|
+
`}
|
|
22
|
+
|
|
23
|
+
${align === "center" && `
|
|
24
|
+
align-items: center;
|
|
25
|
+
text-align: center;
|
|
26
|
+
`}
|
|
27
|
+
|
|
28
|
+
${align === "right" && `
|
|
29
|
+
align-items: flex-end;
|
|
30
|
+
`}
|
|
31
|
+
|
|
32
|
+
${theme.breakpoints.up("md")} {
|
|
33
|
+
padding: 12px 24px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media print {
|
|
37
|
+
padding: 12px 24px;
|
|
38
|
+
}
|
|
39
|
+
`}
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
exports.StyledBookingTableRowCell = StyledBookingTableRowCell;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
require('react');
|
|
8
|
+
var ui = require('@tenancy.nz/ui');
|
|
9
|
+
var BookingTableRow_styled = require('./BookingTableRow.styled.cjs');
|
|
10
|
+
|
|
11
|
+
function BookingTableRowHeader() {
|
|
12
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Grid, { container: true, spacing: 0, children: [
|
|
13
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Grid, { item: true, container: true, xs: 6, children: [
|
|
14
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 3, children: /* @__PURE__ */ jsxRuntime.jsx(BookingTableRow_styled.StyledBookingTableRowCell, { header: true, children: "Name" }) }),
|
|
15
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 6, md: 7, children: /* @__PURE__ */ jsxRuntime.jsx(BookingTableRow_styled.StyledBookingTableRowCell, { header: true, children: "Comments" }) }),
|
|
16
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 3, md: 2, children: /* @__PURE__ */ jsxRuntime.jsx(BookingTableRow_styled.StyledBookingTableRowCell, { header: true, children: "Status" }) })
|
|
17
|
+
] }),
|
|
18
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Grid, { item: true, container: true, xs: 6, children: [
|
|
19
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 3, children: /* @__PURE__ */ jsxRuntime.jsx(BookingTableRow_styled.StyledBookingTableRowCell, { align: "center", header: true, children: "Attendend" }) }),
|
|
20
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 3, children: /* @__PURE__ */ jsxRuntime.jsx(BookingTableRow_styled.StyledBookingTableRowCell, { align: "center", header: true, children: "Suitable" }) }),
|
|
21
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 3, children: /* @__PURE__ */ jsxRuntime.jsx(BookingTableRow_styled.StyledBookingTableRowCell, { align: "center", header: true, children: "Application Sent" }) }),
|
|
22
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 3, children: /* @__PURE__ */ jsxRuntime.jsx(BookingTableRow_styled.StyledBookingTableRowCell, { align: "center", header: true, children: "Application Received" }) })
|
|
23
|
+
] })
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
exports.default = BookingTableRowHeader;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
require('react');
|
|
8
|
+
var ui = require('@tenancy.nz/ui');
|
|
9
|
+
var BookingTableRow_styled = require('./BookingTableRow.styled.cjs');
|
|
10
|
+
|
|
11
|
+
function BookingTableRowSkeleton() {
|
|
12
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Grid, { container: true, spacing: 0, children: [
|
|
13
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Grid, { item: true, container: true, xs: 12, sm: 6, children: [
|
|
14
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 12, sm: 3, children: /* @__PURE__ */ jsxRuntime.jsx(BookingTableRow_styled.StyledBookingTableRowCell, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "85%", height: "20px", variant: "text" }) }) }),
|
|
15
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 12, sm: 6, md: 7, children: /* @__PURE__ */ jsxRuntime.jsxs(BookingTableRow_styled.StyledBookingTableRowCell, { children: [
|
|
16
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "95%", height: "20px", variant: "text" }),
|
|
17
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "80%", height: "20px", variant: "text" })
|
|
18
|
+
] }) }),
|
|
19
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 12, sm: 3, md: 2, children: /* @__PURE__ */ jsxRuntime.jsx(BookingTableRow_styled.StyledBookingTableRowCell, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "90px", height: "30px", variant: "text" }) }) })
|
|
20
|
+
] }),
|
|
21
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Grid, { item: true, container: true, xs: 12, sm: 6, children: [
|
|
22
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 12, sm: 3, children: /* @__PURE__ */ jsxRuntime.jsx(BookingTableRow_styled.StyledBookingTableRowCell, { align: "center", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "40px", height: "20px", variant: "text" }) }) }),
|
|
23
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 12, sm: 3, children: /* @__PURE__ */ jsxRuntime.jsx(BookingTableRow_styled.StyledBookingTableRowCell, { align: "center", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "40px", height: "20px", variant: "text" }) }) }),
|
|
24
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 12, sm: 3, children: /* @__PURE__ */ jsxRuntime.jsx(BookingTableRow_styled.StyledBookingTableRowCell, { align: "center", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "40px", height: "20px", variant: "text" }) }) }),
|
|
25
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { item: true, xs: 12, sm: 3, children: /* @__PURE__ */ jsxRuntime.jsx(BookingTableRow_styled.StyledBookingTableRowCell, { align: "center", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "40px", height: "20px", variant: "text" }) }) })
|
|
26
|
+
] })
|
|
27
|
+
] });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.default = BookingTableRowSkeleton;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
require('react');
|
|
8
|
+
var icons = require('@tenancy.nz/icons');
|
|
9
|
+
|
|
10
|
+
function CheckedIcon({ value }) {
|
|
11
|
+
if (value === true) {
|
|
12
|
+
return /* @__PURE__ */ jsxRuntime.jsx(icons.CircleCheckIcon, { color: "success.main", size: "20px" });
|
|
13
|
+
}
|
|
14
|
+
return /* @__PURE__ */ jsxRuntime.jsx(icons.CircleTimesIcon, { color: "error.main", size: "20px" });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.default = CheckedIcon;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
require('react');
|
|
8
|
+
var ui = require('@tenancy.nz/ui');
|
|
9
|
+
var chart = require('primereact/chart');
|
|
10
|
+
|
|
11
|
+
function EnquiriesDoughnutChart({
|
|
12
|
+
tradeMeEnquiriesCount = 0,
|
|
13
|
+
bookMeEnquiriesCount = 0,
|
|
14
|
+
manualEnquiryCount = 0
|
|
15
|
+
}) {
|
|
16
|
+
const colors = {
|
|
17
|
+
tradeMe: "#6FD3C0",
|
|
18
|
+
bookMe: "#00C0F3",
|
|
19
|
+
manual: "#394869"
|
|
20
|
+
};
|
|
21
|
+
const chartColors = [colors.tradeMe, colors.bookMe, colors.manual];
|
|
22
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { position: "relative", display: "flex", height: "100%", align: "center", children: [
|
|
23
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24
|
+
ui.Text,
|
|
25
|
+
{
|
|
26
|
+
transform: "uppercase",
|
|
27
|
+
sx: { position: "absolute", left: 20, top: -10 },
|
|
28
|
+
fontSize: 13,
|
|
29
|
+
color: "textPrimary",
|
|
30
|
+
weight: "700",
|
|
31
|
+
children: "Number of enquiries"
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Box, { width: "100%", overflow: "hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
35
|
+
chart.Chart,
|
|
36
|
+
{
|
|
37
|
+
type: "doughnut",
|
|
38
|
+
data: {
|
|
39
|
+
labels: ["TradeMe", "BookMe", "Manual"],
|
|
40
|
+
datasets: [
|
|
41
|
+
{
|
|
42
|
+
data: [
|
|
43
|
+
Math.max(tradeMeEnquiriesCount, 1e-3),
|
|
44
|
+
Math.max(bookMeEnquiriesCount, 1e-3),
|
|
45
|
+
Math.max(manualEnquiryCount, 1e-3)
|
|
46
|
+
],
|
|
47
|
+
backgroundColor: chartColors,
|
|
48
|
+
hoverBackgroundColor: chartColors
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
options: {
|
|
53
|
+
legend: {
|
|
54
|
+
display: false
|
|
55
|
+
},
|
|
56
|
+
animation: {
|
|
57
|
+
duration: 0
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
style: {
|
|
61
|
+
width: "100%",
|
|
62
|
+
position: "absolute",
|
|
63
|
+
top: "18%",
|
|
64
|
+
left: "-75px"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
) }),
|
|
68
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
69
|
+
ui.Box,
|
|
70
|
+
{
|
|
71
|
+
maxWidth: { xs: "160px", xl: "180px" },
|
|
72
|
+
width: "100%",
|
|
73
|
+
padding: "10px 20px",
|
|
74
|
+
mt: -4,
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { width: "100%", children: [
|
|
77
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Box, { height: "10px", backgroundColor: colors.tradeMe, width: "100%" }),
|
|
78
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
79
|
+
ui.Box,
|
|
80
|
+
{
|
|
81
|
+
display: "flex",
|
|
82
|
+
justify: "space-between",
|
|
83
|
+
width: "100%",
|
|
84
|
+
align: "flex-start",
|
|
85
|
+
mt: 2,
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { transform: "uppercase", fontSize: 12, weight: "600", children: "TradeMe" }),
|
|
88
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
89
|
+
ui.Text,
|
|
90
|
+
{
|
|
91
|
+
transform: "uppercase",
|
|
92
|
+
fontSize: 32,
|
|
93
|
+
weight: "700",
|
|
94
|
+
mt: -3,
|
|
95
|
+
color: "textPrimary",
|
|
96
|
+
children: tradeMeEnquiriesCount
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
] }),
|
|
103
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { width: "100%", mt: "30px", children: [
|
|
104
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Box, { height: "10px", backgroundColor: colors.bookMe, width: "100%" }),
|
|
105
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
106
|
+
ui.Box,
|
|
107
|
+
{
|
|
108
|
+
display: "flex",
|
|
109
|
+
justify: "space-between",
|
|
110
|
+
width: "100%",
|
|
111
|
+
align: "flex-start",
|
|
112
|
+
mt: 2,
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { transform: "uppercase", fontSize: 12, weight: "600", children: "Bookme" }),
|
|
115
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
116
|
+
ui.Text,
|
|
117
|
+
{
|
|
118
|
+
transform: "uppercase",
|
|
119
|
+
fontSize: 32,
|
|
120
|
+
weight: "700",
|
|
121
|
+
mt: -3,
|
|
122
|
+
color: "textPrimary",
|
|
123
|
+
children: bookMeEnquiriesCount
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
] }),
|
|
130
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { width: "100%", mt: "30px", children: [
|
|
131
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Box, { height: "10px", backgroundColor: colors.manual, width: "100%" }),
|
|
132
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
133
|
+
ui.Box,
|
|
134
|
+
{
|
|
135
|
+
display: "flex",
|
|
136
|
+
justify: "space-between",
|
|
137
|
+
width: "100%",
|
|
138
|
+
align: "flex-start",
|
|
139
|
+
mt: 2,
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Text, { transform: "uppercase", fontSize: 12, weight: "600", children: [
|
|
142
|
+
"Manually",
|
|
143
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
144
|
+
"Generated"
|
|
145
|
+
] }),
|
|
146
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
147
|
+
ui.Text,
|
|
148
|
+
{
|
|
149
|
+
transform: "uppercase",
|
|
150
|
+
fontSize: 32,
|
|
151
|
+
weight: "700",
|
|
152
|
+
color: "textPrimary",
|
|
153
|
+
mt: -3,
|
|
154
|
+
children: manualEnquiryCount
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
] })
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
] });
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
exports.default = EnquiriesDoughnutChart;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var ui = require('@tenancy.nz/ui');
|
|
9
|
+
var Hidden = require('./Hidden.cjs');
|
|
10
|
+
|
|
11
|
+
function GridList({
|
|
12
|
+
items,
|
|
13
|
+
children,
|
|
14
|
+
renderItem,
|
|
15
|
+
headerComponent,
|
|
16
|
+
footerComponent,
|
|
17
|
+
spacing,
|
|
18
|
+
loading,
|
|
19
|
+
loadingComponent,
|
|
20
|
+
emptyComponent,
|
|
21
|
+
currentPage,
|
|
22
|
+
totalPages,
|
|
23
|
+
onChangePage,
|
|
24
|
+
showHeaderComponent,
|
|
25
|
+
resultsPerPage,
|
|
26
|
+
onChangeResultsPerPage,
|
|
27
|
+
perPage,
|
|
28
|
+
scrollTopOnChangePage,
|
|
29
|
+
...rest
|
|
30
|
+
}) {
|
|
31
|
+
const gridContainerRef = React.useRef(null);
|
|
32
|
+
const childLen = React.Children.count(children);
|
|
33
|
+
const isChildren = childLen > 0;
|
|
34
|
+
let listLength = 0;
|
|
35
|
+
if (!isChildren) {
|
|
36
|
+
listLength = Array.isArray(items) ? items.length : 0;
|
|
37
|
+
} else {
|
|
38
|
+
listLength = childLen;
|
|
39
|
+
}
|
|
40
|
+
const isEmpty = listLength === 0;
|
|
41
|
+
React.useEffect(() => {
|
|
42
|
+
if (scrollTopOnChangePage && currentPage > 1 && !loading && gridContainerRef && gridContainerRef.current) {
|
|
43
|
+
gridContainerRef.current.scrollIntoView();
|
|
44
|
+
}
|
|
45
|
+
}, [currentPage, loading, gridContainerRef, scrollTopOnChangePage]);
|
|
46
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
47
|
+
showHeaderComponent && headerComponent,
|
|
48
|
+
loading && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: loadingComponent }),
|
|
49
|
+
!loading && isEmpty && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: emptyComponent }),
|
|
50
|
+
!loading && !isEmpty && /* @__PURE__ */ jsxRuntime.jsx("div", { ref: gridContainerRef, style: { width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { container: true, ...rest, spacing, children: isChildren ? children : items.map(renderItem) }) }),
|
|
51
|
+
typeof onChangePage === "function" && /* @__PURE__ */ jsxRuntime.jsx(Hidden.default, { hide: isEmpty, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
52
|
+
ui.Box,
|
|
53
|
+
{
|
|
54
|
+
display: "flex",
|
|
55
|
+
justify: "center",
|
|
56
|
+
align: "center",
|
|
57
|
+
direction: "column",
|
|
58
|
+
marginTop: 12,
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
61
|
+
ui.Pagination,
|
|
62
|
+
{
|
|
63
|
+
page: currentPage,
|
|
64
|
+
count: totalPages,
|
|
65
|
+
color: "textPrimary",
|
|
66
|
+
shape: "round",
|
|
67
|
+
size: "large",
|
|
68
|
+
onChange: onChangePage
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
typeof onChangeResultsPerPage === "function" && /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { mt: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
+
ui.Select,
|
|
73
|
+
{
|
|
74
|
+
name: "gridListSelect",
|
|
75
|
+
value: perPage,
|
|
76
|
+
options: resultsPerPage,
|
|
77
|
+
onChange: onChangeResultsPerPage
|
|
78
|
+
}
|
|
79
|
+
) })
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
) }),
|
|
83
|
+
footerComponent
|
|
84
|
+
] });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
exports.default = GridList;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
require('react');
|
|
7
|
+
|
|
8
|
+
function Hidden({ hide = false, children }) {
|
|
9
|
+
if (hide) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return children;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.default = Hidden;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
require('react');
|
|
8
|
+
var ui = require('@tenancy.nz/ui');
|
|
9
|
+
|
|
10
|
+
function IconLabel({
|
|
11
|
+
children,
|
|
12
|
+
endIcon = void 0,
|
|
13
|
+
startIcon = void 0,
|
|
14
|
+
onClick = void 0,
|
|
15
|
+
...rest
|
|
16
|
+
}) {
|
|
17
|
+
const iconLabel = /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { align: "center", display: "inline-flex", ...rest, children: [
|
|
18
|
+
startIcon && /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { display: "inline-flex", color: "inherit", fontSize: "inherit", children: startIcon }),
|
|
19
|
+
children && /* @__PURE__ */ jsxRuntime.jsx(
|
|
20
|
+
ui.Box,
|
|
21
|
+
{
|
|
22
|
+
display: "inline-flex",
|
|
23
|
+
color: "inherit",
|
|
24
|
+
fontSize: "inherit",
|
|
25
|
+
marginLeft: startIcon ? 1 : 0,
|
|
26
|
+
marginRight: endIcon ? 1 : 0,
|
|
27
|
+
fontWeight: "inherit",
|
|
28
|
+
children
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
endIcon && /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { display: "inline-flex", color: "text.muted", marginLeft: 1, children: endIcon })
|
|
32
|
+
] });
|
|
33
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: typeof onClick === "function" ? /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { onClick, children: iconLabel }) : iconLabel });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exports.default = IconLabel;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
require('react');
|
|
8
|
+
var ui = require('@tenancy.nz/ui');
|
|
9
|
+
|
|
10
|
+
const tagMap = (name) => {
|
|
11
|
+
if (typeof name !== "string") {
|
|
12
|
+
return name;
|
|
13
|
+
}
|
|
14
|
+
if (name === "feedback") {
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.Tag, { color: "info", label: "Feedback" });
|
|
16
|
+
}
|
|
17
|
+
if (name === "maintenance") {
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.Tag, { color: "orange", label: "Maintenance" });
|
|
19
|
+
}
|
|
20
|
+
return name;
|
|
21
|
+
};
|
|
22
|
+
function NotesCard({
|
|
23
|
+
loading = false,
|
|
24
|
+
tag = void 0,
|
|
25
|
+
text = void 0,
|
|
26
|
+
...rest
|
|
27
|
+
}) {
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Paper, { inset: "medium", sx: { minHeight: "100%" }, ...rest, children: [
|
|
29
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Box, { mb: "8px", mt: loading ? "-5px" : "0px", children: loading ? /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "114px", height: "30px", variant: "text" }) : tagMap(tag) }),
|
|
30
|
+
loading && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
31
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "90%", height: "20px", variant: "text" }),
|
|
32
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "80%", height: "20px", variant: "text" }),
|
|
33
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "70%", height: "20px", variant: "text" })
|
|
34
|
+
] }),
|
|
35
|
+
!loading && /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { variant: "body2", weight: "400", children: text })
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
exports.default = NotesCard;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
require('react');
|
|
8
|
+
var ui = require('@tenancy.nz/ui');
|
|
9
|
+
var icons = require('@tenancy.nz/icons');
|
|
10
|
+
var IconLabel = require('./IconLabel.cjs');
|
|
11
|
+
var PropertyCard_styled = require('./PropertyCard.styled.cjs');
|
|
12
|
+
|
|
13
|
+
function PropertyCard({
|
|
14
|
+
address = void 0,
|
|
15
|
+
compact = false,
|
|
16
|
+
enquiriesCount = void 0,
|
|
17
|
+
imgSrc,
|
|
18
|
+
noOfBedrooms = void 0,
|
|
19
|
+
noOfBathrooms = void 0,
|
|
20
|
+
noOfCarparks = void 0,
|
|
21
|
+
rent = void 0,
|
|
22
|
+
viewingsCount = void 0,
|
|
23
|
+
...rest
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
26
|
+
ui.Paper,
|
|
27
|
+
{
|
|
28
|
+
overflow: false,
|
|
29
|
+
sx: {
|
|
30
|
+
display: "flex",
|
|
31
|
+
alignItems: "center"
|
|
32
|
+
},
|
|
33
|
+
...rest,
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsxRuntime.jsx(PropertyCard_styled.StyledPropertyImage, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Media, { as: "img", title: address, src: imgSrc }) }),
|
|
36
|
+
/* @__PURE__ */ jsxRuntime.jsxs(PropertyCard_styled.StyledPropertyDetailsBox, { children: [
|
|
37
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { as: "h4", weight: "700", children: address }) }),
|
|
38
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
39
|
+
ui.Box,
|
|
40
|
+
{
|
|
41
|
+
sx: {
|
|
42
|
+
display: "flex",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
ml: { sm: "auto" },
|
|
45
|
+
mt: { xs: "10px", sm: 0 },
|
|
46
|
+
"@media print": {
|
|
47
|
+
ml: "auto"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsxRuntime.jsxs(PropertyCard_styled.StyledPropertyAmenitiesBox, { children: [
|
|
52
|
+
rent && /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { as: "h4", weight: "700", children: rent }),
|
|
53
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { fontSize: "16px", children: [
|
|
54
|
+
noOfBedrooms && /* @__PURE__ */ jsxRuntime.jsx(
|
|
55
|
+
IconLabel.default,
|
|
56
|
+
{
|
|
57
|
+
color: "text.primary",
|
|
58
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Icon, { size: 21, color: "inherit", name: "bed" }),
|
|
59
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { as: "span", variant: "inherit", children: noOfBedrooms })
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
noOfBathrooms && /* @__PURE__ */ jsxRuntime.jsx(
|
|
63
|
+
IconLabel.default,
|
|
64
|
+
{
|
|
65
|
+
color: "text.primary",
|
|
66
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Icon, { size: 21, color: "inherit", name: "bath" }),
|
|
67
|
+
marginLeft: 3,
|
|
68
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { as: "span", variant: "inherit", children: noOfBathrooms })
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
noOfCarparks && /* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
+
IconLabel.default,
|
|
73
|
+
{
|
|
74
|
+
color: "text.primary",
|
|
75
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Icon, { size: 21, color: "inherit", name: "car" }),
|
|
76
|
+
marginLeft: 3,
|
|
77
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { as: "span", variant: "inherit", children: noOfCarparks })
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] })
|
|
81
|
+
] }),
|
|
82
|
+
!compact && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
83
|
+
ui.Box,
|
|
84
|
+
{
|
|
85
|
+
paddingLeft: "25px",
|
|
86
|
+
borderLeft: "1px solid #00000040",
|
|
87
|
+
display: "flex",
|
|
88
|
+
direction: "column",
|
|
89
|
+
sx: {
|
|
90
|
+
gap: { xs: "18px", lg: "10px", xl: 0 },
|
|
91
|
+
justifyContent: "space-between"
|
|
92
|
+
},
|
|
93
|
+
children: [
|
|
94
|
+
viewingsCount && /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { display: "flex", align: "center", gap: "12px", children: [
|
|
95
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Box, { minWidth: "87px", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
96
|
+
ui.Text,
|
|
97
|
+
{
|
|
98
|
+
transform: "uppercase",
|
|
99
|
+
color: "textPrimary",
|
|
100
|
+
as: "span",
|
|
101
|
+
weight: "600",
|
|
102
|
+
align: "right",
|
|
103
|
+
lineHeight: "15px",
|
|
104
|
+
children: "Viewings"
|
|
105
|
+
}
|
|
106
|
+
) }),
|
|
107
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { as: "h2", children: viewingsCount })
|
|
108
|
+
] }),
|
|
109
|
+
enquiriesCount && /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { display: "flex", align: "center", gap: "12px", children: [
|
|
110
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Box, { minWidth: "87px", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
111
|
+
ui.Text,
|
|
112
|
+
{
|
|
113
|
+
transform: "uppercase",
|
|
114
|
+
color: "textPrimary",
|
|
115
|
+
as: "span",
|
|
116
|
+
weight: "600",
|
|
117
|
+
minWidth: "87px",
|
|
118
|
+
align: "right",
|
|
119
|
+
lineHeight: "15px",
|
|
120
|
+
children: "Enquiries"
|
|
121
|
+
}
|
|
122
|
+
) }),
|
|
123
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { as: "h2", children: enquiriesCount })
|
|
124
|
+
] })
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
] })
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
exports.default = PropertyCard;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var react = require('@emotion/react');
|
|
5
|
+
var styled = require('@emotion/styled');
|
|
6
|
+
|
|
7
|
+
const StyledPropertyImage = styled.figure`
|
|
8
|
+
padding: 0;
|
|
9
|
+
margin: 0;
|
|
10
|
+
width: 120px;
|
|
11
|
+
height: 95px;
|
|
12
|
+
flex: 0 0 95px;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
|
|
15
|
+
${({ theme }) => react.css`
|
|
16
|
+
${theme.breakpoints.down("sm")} {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
${theme.breakpoints.up("sm")} {
|
|
21
|
+
width: 150px;
|
|
22
|
+
height: 135px;
|
|
23
|
+
flex: 0 0 150px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media print {
|
|
27
|
+
width: 150px;
|
|
28
|
+
height: 135px;
|
|
29
|
+
flex: 0 0 150px;
|
|
30
|
+
display: block;
|
|
31
|
+
}
|
|
32
|
+
`}
|
|
33
|
+
`;
|
|
34
|
+
const StyledPropertyDetailsBox = styled.div`
|
|
35
|
+
display: flex;
|
|
36
|
+
width: 100%;
|
|
37
|
+
align-items: flex-start;
|
|
38
|
+
padding: 16px 24px 16px 20px;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
|
|
41
|
+
${({ theme }) => react.css`
|
|
42
|
+
${theme.breakpoints.up("sm")} {
|
|
43
|
+
flex-direction: row;
|
|
44
|
+
align-items: center;
|
|
45
|
+
}
|
|
46
|
+
`}
|
|
47
|
+
|
|
48
|
+
@media print {
|
|
49
|
+
flex-direction: row;
|
|
50
|
+
align-items: center;
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
const StyledPropertyAmenitiesBox = styled.div`
|
|
54
|
+
padding-right: 25px;
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
margin-top: 5px;
|
|
58
|
+
|
|
59
|
+
gap: 18px;
|
|
60
|
+
min-width: 170px;
|
|
61
|
+
height: 100%;
|
|
62
|
+
justify-content: space-between;
|
|
63
|
+
|
|
64
|
+
${({ theme }) => `
|
|
65
|
+
@media (min-width: ${theme.breakpoints.values.md}px) {
|
|
66
|
+
align-items: flex-end;
|
|
67
|
+
}
|
|
68
|
+
`}
|
|
69
|
+
@media print {
|
|
70
|
+
align-items: flex-end;
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
|
|
74
|
+
exports.StyledPropertyAmenitiesBox = StyledPropertyAmenitiesBox;
|
|
75
|
+
exports.StyledPropertyDetailsBox = StyledPropertyDetailsBox;
|
|
76
|
+
exports.StyledPropertyImage = StyledPropertyImage;
|