@tenancy.nz/feature-ui 1.10.6 → 1.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_virtual/_rollupPluginBabelHelpers.cjs +15 -4
- package/dist/cjs/components/BackButton.cjs +18 -0
- package/dist/cjs/components/ConfirmButton.cjs +91 -0
- package/dist/cjs/components/ContactCard.cjs +71 -0
- package/dist/cjs/components/ContactCardHeader.cjs +17 -22
- package/dist/cjs/components/ContactMethod.cjs +111 -0
- package/dist/cjs/components/DeleteIconButton.cjs +17 -0
- package/dist/cjs/components/DownloadIconButton.cjs +17 -0
- package/dist/cjs/components/EditIconButton.cjs +17 -0
- package/dist/cjs/components/LogoutButton.cjs +17 -0
- package/dist/cjs/components/OpenInNewIconButton.cjs +17 -0
- package/dist/cjs/components/ScrollTopButton.cjs +2 -1
- package/dist/cjs/index.cjs +20 -10
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +14 -5
- package/dist/esm/components/BackButton.js +14 -0
- package/dist/esm/components/ConfirmButton.js +87 -0
- package/dist/esm/components/ContactCard.js +68 -0
- package/dist/esm/components/ContactCardHeader.js +18 -23
- package/dist/esm/components/ContactMethod.js +107 -0
- package/dist/esm/components/DeleteIconButton.js +13 -0
- package/dist/esm/components/DownloadIconButton.js +13 -0
- package/dist/esm/components/EditIconButton.js +13 -0
- package/dist/esm/components/LogoutButton.js +13 -0
- package/dist/esm/components/OpenInNewIconButton.js +13 -0
- package/dist/esm/components/ScrollTopButton.js +2 -1
- package/dist/esm/index.js +10 -5
- package/package.json +5 -7
- package/dist/cjs/components/AnalyticsSection.cjs +0 -186
- package/dist/cjs/components/BookingChart.cjs +0 -128
- package/dist/cjs/components/BookingChart.styled.cjs +0 -48
- package/dist/cjs/components/ChartLegend.cjs +0 -63
- package/dist/cjs/components/analytics-doughnut-chart.cjs +0 -116
- package/dist/cjs/components/doughnut-chart.cjs +0 -130
- package/dist/cjs/components/pdf-analytics-section.cjs +0 -173
- package/dist/cjs/utils/helpers/general.cjs +0 -10
- package/dist/esm/components/AnalyticsSection.js +0 -182
- package/dist/esm/components/BookingChart.js +0 -124
- package/dist/esm/components/BookingChart.styled.js +0 -42
- package/dist/esm/components/ChartLegend.js +0 -59
- package/dist/esm/components/analytics-doughnut-chart.js +0 -112
- package/dist/esm/components/doughnut-chart.js +0 -126
- package/dist/esm/components/pdf-analytics-section.js +0 -169
- package/dist/esm/utils/helpers/general.js +0 -8
|
@@ -19,6 +19,15 @@ function _defineProperty(e, r, t) {
|
|
|
19
19
|
writable: true
|
|
20
20
|
}) : e[r] = t, e;
|
|
21
21
|
}
|
|
22
|
+
function _extends() {
|
|
23
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
24
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
25
|
+
var t = arguments[e];
|
|
26
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
27
|
+
}
|
|
28
|
+
return n;
|
|
29
|
+
}, _extends.apply(null, arguments);
|
|
30
|
+
}
|
|
22
31
|
function _iterableToArray(r) {
|
|
23
32
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
24
33
|
}
|
|
@@ -33,10 +42,7 @@ function _iterableToArrayLimit(r, l) {
|
|
|
33
42
|
f = true,
|
|
34
43
|
o = false;
|
|
35
44
|
try {
|
|
36
|
-
if (i = (t = t.call(r)).next, 0 === l)
|
|
37
|
-
if (Object(t) !== t) return;
|
|
38
|
-
f = !1;
|
|
39
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
45
|
+
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
40
46
|
} catch (r) {
|
|
41
47
|
o = true, n = r;
|
|
42
48
|
} finally {
|
|
@@ -55,6 +61,9 @@ function _nonIterableRest() {
|
|
|
55
61
|
function _nonIterableSpread() {
|
|
56
62
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
57
63
|
}
|
|
64
|
+
function _objectDestructuringEmpty(t) {
|
|
65
|
+
if (null == t) throw new TypeError("Cannot destructure " + t);
|
|
66
|
+
}
|
|
58
67
|
function ownKeys(e, r) {
|
|
59
68
|
var t = Object.keys(e);
|
|
60
69
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -135,10 +144,12 @@ exports.arrayLikeToArray = _arrayLikeToArray;
|
|
|
135
144
|
exports.arrayWithHoles = _arrayWithHoles;
|
|
136
145
|
exports.arrayWithoutHoles = _arrayWithoutHoles;
|
|
137
146
|
exports.defineProperty = _defineProperty;
|
|
147
|
+
exports.extends = _extends;
|
|
138
148
|
exports.iterableToArray = _iterableToArray;
|
|
139
149
|
exports.iterableToArrayLimit = _iterableToArrayLimit;
|
|
140
150
|
exports.nonIterableRest = _nonIterableRest;
|
|
141
151
|
exports.nonIterableSpread = _nonIterableSpread;
|
|
152
|
+
exports.objectDestructuringEmpty = _objectDestructuringEmpty;
|
|
142
153
|
exports.objectSpread2 = _objectSpread2;
|
|
143
154
|
exports.objectWithoutProperties = _objectWithoutProperties;
|
|
144
155
|
exports.objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var ArrowLeftOutlinedIcon = require('@tenancy.nz/icons/ArrowLeftOutlined');
|
|
7
|
+
var ui = require('@tenancy.nz/ui');
|
|
8
|
+
|
|
9
|
+
function BackButton(_ref) {
|
|
10
|
+
var onClick = _ref.onClick;
|
|
11
|
+
return /* @__PURE__ */React.createElement(ui.Button, {
|
|
12
|
+
startIcon: /* @__PURE__ */React.createElement(ArrowLeftOutlinedIcon, null),
|
|
13
|
+
variant: "outlined",
|
|
14
|
+
onClick: onClick
|
|
15
|
+
}, "Back");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.default = BackButton;
|
|
@@ -0,0 +1,91 @@
|
|
|
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 ui = require('@tenancy.nz/ui');
|
|
8
|
+
|
|
9
|
+
var _excluded = ["Component", "children", "color", "confirmMessage", "label", "onClick", "title", "confirmProps"];
|
|
10
|
+
var errorConfirmProps = {
|
|
11
|
+
severity: "error",
|
|
12
|
+
cancelBtnText: "Don't delete",
|
|
13
|
+
confirmBtnText: "Delete"
|
|
14
|
+
};
|
|
15
|
+
function ConfirmButton(_ref) {
|
|
16
|
+
var _ref$Component = _ref.Component,
|
|
17
|
+
Component = _ref$Component === void 0 ? null : _ref$Component,
|
|
18
|
+
children = _ref.children,
|
|
19
|
+
_ref$color = _ref.color,
|
|
20
|
+
color = _ref$color === void 0 ? "inherit" : _ref$color,
|
|
21
|
+
_ref$confirmMessage = _ref.confirmMessage,
|
|
22
|
+
confirmMessage = _ref$confirmMessage === void 0 ? void 0 : _ref$confirmMessage,
|
|
23
|
+
_ref$label = _ref.label,
|
|
24
|
+
label = _ref$label === void 0 ? "" : _ref$label,
|
|
25
|
+
onClick = _ref.onClick,
|
|
26
|
+
_ref$title = _ref.title,
|
|
27
|
+
title = _ref$title === void 0 ? "" : _ref$title,
|
|
28
|
+
_ref$confirmProps = _ref.confirmProps,
|
|
29
|
+
confirmProps = _ref$confirmProps === void 0 ? {} : _ref$confirmProps,
|
|
30
|
+
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
var _useState = React.useState(false),
|
|
32
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
|
33
|
+
showConfirm = _useState2[0],
|
|
34
|
+
setShowConfirm = _useState2[1];
|
|
35
|
+
var _useState3 = React.useState(void 0),
|
|
36
|
+
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
|
37
|
+
value = _useState4[0],
|
|
38
|
+
setValue = _useState4[1];
|
|
39
|
+
var handleCancel = function handleCancel(e) {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
setShowConfirm(false);
|
|
42
|
+
setValue(void 0);
|
|
43
|
+
};
|
|
44
|
+
var handleClick = function handleClick(e) {
|
|
45
|
+
e.stopPropagation();
|
|
46
|
+
if (!confirmMessage) {
|
|
47
|
+
onClick(e);
|
|
48
|
+
} else {
|
|
49
|
+
setShowConfirm(true);
|
|
50
|
+
setValue(e);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var handleConfirm = function handleConfirm() {
|
|
54
|
+
if (value) {
|
|
55
|
+
onClick(value);
|
|
56
|
+
}
|
|
57
|
+
setShowConfirm(false);
|
|
58
|
+
setValue(void 0);
|
|
59
|
+
};
|
|
60
|
+
return /* @__PURE__ */React.createElement(React.Fragment, null, Component ? /* @__PURE__ */React.createElement(Component, _rollupPluginBabelHelpers.objectSpread2({
|
|
61
|
+
color: color,
|
|
62
|
+
onClick: handleClick
|
|
63
|
+
}, rest), children) : /* @__PURE__ */React.createElement(ui.Tooltip, {
|
|
64
|
+
title: title,
|
|
65
|
+
placement: "top"
|
|
66
|
+
}, /* @__PURE__ */React.createElement(ui.Box, {
|
|
67
|
+
display: "inline-flex",
|
|
68
|
+
color: color.indexOf(".") === -1 ? "".concat(color, ".main") : color,
|
|
69
|
+
align: "center",
|
|
70
|
+
direction: "column"
|
|
71
|
+
}, /* @__PURE__ */React.createElement(ui.IconButton, _rollupPluginBabelHelpers.objectSpread2({
|
|
72
|
+
color: color === "error" ? "error" : "inherit",
|
|
73
|
+
onClick: handleClick
|
|
74
|
+
}, rest), children), !!label && /* @__PURE__ */React.createElement(ui.Box, {
|
|
75
|
+
color: "#617391",
|
|
76
|
+
display: "inline-flex",
|
|
77
|
+
fontSize: "11px",
|
|
78
|
+
onClick: handleClick,
|
|
79
|
+
sx: {
|
|
80
|
+
cursor: "pointer"
|
|
81
|
+
}
|
|
82
|
+
}, label))), !!confirmMessage && /* @__PURE__ */React.createElement(ui.Confirmation, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
|
|
83
|
+
open: showConfirm,
|
|
84
|
+
message: confirmMessage,
|
|
85
|
+
title: "Please confirm",
|
|
86
|
+
onCancel: handleCancel,
|
|
87
|
+
onConfirm: handleConfirm
|
|
88
|
+
}, color === "error" && errorConfirmProps), confirmProps)));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
exports.default = ConfirmButton;
|
|
@@ -1,2 +1,73 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var Stack = require('@mui/material/Stack');
|
|
8
|
+
var EmailOutlinedIcon = require('@tenancy.nz/icons/EmailOutlined');
|
|
9
|
+
var PhoneOutlinedIcon = require('@tenancy.nz/icons/PhoneOutlined');
|
|
10
|
+
var ui = require('@tenancy.nz/ui');
|
|
11
|
+
var ContactCardHeader = require('./ContactCardHeader.cjs');
|
|
12
|
+
var ContactMethod = require('./ContactMethod.cjs');
|
|
13
|
+
|
|
14
|
+
var _excluded = ["avatarColor", "avatarUrl", "email", "firstName", "lastName", "mobile", "phone", "role", "sx"];
|
|
15
|
+
function ContactCard(_ref) {
|
|
16
|
+
var _ref$avatarColor = _ref.avatarColor,
|
|
17
|
+
avatarColor = _ref$avatarColor === void 0 ? "grey" : _ref$avatarColor,
|
|
18
|
+
_ref$avatarUrl = _ref.avatarUrl,
|
|
19
|
+
avatarUrl = _ref$avatarUrl === void 0 ? void 0 : _ref$avatarUrl,
|
|
20
|
+
_ref$email = _ref.email,
|
|
21
|
+
email = _ref$email === void 0 ? void 0 : _ref$email,
|
|
22
|
+
_ref$firstName = _ref.firstName,
|
|
23
|
+
firstName = _ref$firstName === void 0 ? void 0 : _ref$firstName,
|
|
24
|
+
_ref$lastName = _ref.lastName,
|
|
25
|
+
lastName = _ref$lastName === void 0 ? void 0 : _ref$lastName,
|
|
26
|
+
_ref$mobile = _ref.mobile,
|
|
27
|
+
mobile = _ref$mobile === void 0 ? void 0 : _ref$mobile,
|
|
28
|
+
_ref$phone = _ref.phone,
|
|
29
|
+
phone = _ref$phone === void 0 ? void 0 : _ref$phone,
|
|
30
|
+
_ref$role = _ref.role,
|
|
31
|
+
role = _ref$role === void 0 ? void 0 : _ref$role,
|
|
32
|
+
_ref$sx = _ref.sx,
|
|
33
|
+
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
34
|
+
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
35
|
+
return /* @__PURE__ */React.createElement(ui.Paper, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
|
|
36
|
+
inset: "large"
|
|
37
|
+
}, rest), {}, {
|
|
38
|
+
sx: sx,
|
|
39
|
+
outlined: true
|
|
40
|
+
}), /* @__PURE__ */React.createElement(Stack, {
|
|
41
|
+
gap: 4
|
|
42
|
+
}, /* @__PURE__ */React.createElement(ContactCardHeader.default, {
|
|
43
|
+
avatarColor: avatarColor,
|
|
44
|
+
avatarUrl: avatarUrl,
|
|
45
|
+
firstName: firstName,
|
|
46
|
+
lastName: lastName,
|
|
47
|
+
role: role
|
|
48
|
+
}), /* @__PURE__ */React.createElement(Stack, {
|
|
49
|
+
divider: /* @__PURE__ */React.createElement(ui.Divider, {
|
|
50
|
+
disableGutter: true
|
|
51
|
+
})
|
|
52
|
+
}, email && /* @__PURE__ */React.createElement(ContactMethod.default, {
|
|
53
|
+
label: "Email",
|
|
54
|
+
type: "email",
|
|
55
|
+
value: email,
|
|
56
|
+
Icon: EmailOutlinedIcon,
|
|
57
|
+
tooltip: "Email"
|
|
58
|
+
}), mobile && /* @__PURE__ */React.createElement(ContactMethod.default, {
|
|
59
|
+
label: "Mobile",
|
|
60
|
+
type: "phone",
|
|
61
|
+
value: mobile,
|
|
62
|
+
Icon: PhoneOutlinedIcon,
|
|
63
|
+
tooltip: "Call"
|
|
64
|
+
}), phone && /* @__PURE__ */React.createElement(ContactMethod.default, {
|
|
65
|
+
label: "Office",
|
|
66
|
+
type: "phone",
|
|
67
|
+
value: phone,
|
|
68
|
+
Icon: PhoneOutlinedIcon,
|
|
69
|
+
tooltip: "Call"
|
|
70
|
+
}))));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
exports.default = ContactCard;
|
|
@@ -5,28 +5,28 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var Stack = require('@mui/material/Stack');
|
|
8
|
+
var ProfileOutlinedIcon = require('@tenancy.nz/icons/ProfileOutlined');
|
|
8
9
|
var ui = require('@tenancy.nz/ui');
|
|
9
10
|
|
|
10
|
-
var _excluded = ["avatarColor", "avatarUrl", "
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
var _excluded = ["avatarColor", "avatarUrl", "firstName", "lastName", "role", "sx"];
|
|
12
|
+
var styles = {
|
|
13
|
+
role: {
|
|
14
|
+
display: "flex",
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
gap: 1
|
|
17
|
+
}
|
|
14
18
|
};
|
|
15
19
|
function ContactCardHeader(_ref) {
|
|
16
20
|
var _ref$avatarColor = _ref.avatarColor,
|
|
17
21
|
avatarColor = _ref$avatarColor === void 0 ? "grey" : _ref$avatarColor,
|
|
18
22
|
_ref$avatarUrl = _ref.avatarUrl,
|
|
19
23
|
avatarUrl = _ref$avatarUrl === void 0 ? void 0 : _ref$avatarUrl,
|
|
20
|
-
_ref$disabled = _ref.disabled,
|
|
21
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
22
|
-
_ref$email = _ref.email,
|
|
23
|
-
email = _ref$email === void 0 ? void 0 : _ref$email,
|
|
24
24
|
_ref$firstName = _ref.firstName,
|
|
25
25
|
firstName = _ref$firstName === void 0 ? void 0 : _ref$firstName,
|
|
26
26
|
_ref$lastName = _ref.lastName,
|
|
27
27
|
lastName = _ref$lastName === void 0 ? void 0 : _ref$lastName,
|
|
28
|
-
_ref$
|
|
29
|
-
|
|
28
|
+
_ref$role = _ref.role,
|
|
29
|
+
role = _ref$role === void 0 ? void 0 : _ref$role,
|
|
30
30
|
_ref$sx = _ref.sx,
|
|
31
31
|
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
32
32
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
@@ -47,18 +47,13 @@ function ContactCardHeader(_ref) {
|
|
|
47
47
|
}, name && /* @__PURE__ */React.createElement(ui.Heading, {
|
|
48
48
|
as: "h5",
|
|
49
49
|
color: "inherit"
|
|
50
|
-
}, name),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
weight: "500"
|
|
58
|
-
}, email), mobile && /* @__PURE__ */React.createElement(ui.Text, {
|
|
59
|
-
variant: "inherit",
|
|
60
|
-
weight: "500"
|
|
61
|
-
}, mobile))));
|
|
50
|
+
}, name), role && /* @__PURE__ */React.createElement(ui.Text, {
|
|
51
|
+
variant: "small",
|
|
52
|
+
color: "textPrimary",
|
|
53
|
+
sx: styles.role
|
|
54
|
+
}, /* @__PURE__ */React.createElement(ProfileOutlinedIcon, {
|
|
55
|
+
size: 16
|
|
56
|
+
}), /* @__PURE__ */React.createElement("span", null, role))));
|
|
62
57
|
}
|
|
63
58
|
|
|
64
59
|
exports.default = ContactCardHeader;
|
|
@@ -0,0 +1,111 @@
|
|
|
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 Stack = require('@mui/material/Stack');
|
|
8
|
+
var CopyOutlinedIcon = require('@tenancy.nz/icons/CopyOutlined');
|
|
9
|
+
var ui = require('@tenancy.nz/ui');
|
|
10
|
+
|
|
11
|
+
var _excluded = ["Icon", "label", "sx", "type", "value", "tooltip"];
|
|
12
|
+
var ActionButton = ui.IconButton;
|
|
13
|
+
var wide = "@420/contact-method";
|
|
14
|
+
var styles = {
|
|
15
|
+
container: {
|
|
16
|
+
containerType: "inline-size",
|
|
17
|
+
containerName: "contact-method"
|
|
18
|
+
},
|
|
19
|
+
details: {
|
|
20
|
+
flexDirection: _rollupPluginBabelHelpers.defineProperty({}, wide, "row"),
|
|
21
|
+
alignItems: _rollupPluginBabelHelpers.defineProperty({}, wide, "center"),
|
|
22
|
+
gap: _rollupPluginBabelHelpers.defineProperty({
|
|
23
|
+
xs: 1
|
|
24
|
+
}, wide, 4)
|
|
25
|
+
},
|
|
26
|
+
copyButton: {
|
|
27
|
+
display: _rollupPluginBabelHelpers.defineProperty({
|
|
28
|
+
xs: "none"
|
|
29
|
+
}, wide, "inline-flex")
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var makeHref = function makeHref(type, value) {
|
|
33
|
+
if (!type) {
|
|
34
|
+
return "";
|
|
35
|
+
}
|
|
36
|
+
if (type === "email") {
|
|
37
|
+
return "mailto:".concat(value);
|
|
38
|
+
}
|
|
39
|
+
if (type === "phone") {
|
|
40
|
+
return "tel:".concat(value);
|
|
41
|
+
}
|
|
42
|
+
return "";
|
|
43
|
+
};
|
|
44
|
+
function ContactMethod(_ref) {
|
|
45
|
+
var _ref$Icon = _ref.Icon,
|
|
46
|
+
Icon = _ref$Icon === void 0 ? void 0 : _ref$Icon,
|
|
47
|
+
_ref$label = _ref.label,
|
|
48
|
+
label = _ref$label === void 0 ? void 0 : _ref$label,
|
|
49
|
+
_ref$sx = _ref.sx,
|
|
50
|
+
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
51
|
+
_ref$type = _ref.type,
|
|
52
|
+
type = _ref$type === void 0 ? "" : _ref$type,
|
|
53
|
+
_ref$value = _ref.value,
|
|
54
|
+
value = _ref$value === void 0 ? void 0 : _ref$value,
|
|
55
|
+
_ref$tooltip = _ref.tooltip,
|
|
56
|
+
tooltip = _ref$tooltip === void 0 ? "" : _ref$tooltip,
|
|
57
|
+
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
58
|
+
if (!value) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
var handleCopy = function handleCopy() {
|
|
62
|
+
var _navigator$clipboard;
|
|
63
|
+
(_navigator$clipboard = navigator.clipboard) === null || _navigator$clipboard === void 0 || _navigator$clipboard.writeText(value);
|
|
64
|
+
};
|
|
65
|
+
var href = makeHref(type, value);
|
|
66
|
+
return /* @__PURE__ */React.createElement(Stack, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
|
|
67
|
+
direction: "row",
|
|
68
|
+
alignItems: "center",
|
|
69
|
+
gap: 4,
|
|
70
|
+
py: 3
|
|
71
|
+
}, rest), {}, {
|
|
72
|
+
sx: [styles.container].concat(_rollupPluginBabelHelpers.toConsumableArray(Array.isArray(sx) ? sx : [sx]))
|
|
73
|
+
}), /* @__PURE__ */React.createElement(Stack, {
|
|
74
|
+
sx: styles.details
|
|
75
|
+
}, label && /* @__PURE__ */React.createElement(ui.Text, {
|
|
76
|
+
variant: "body2",
|
|
77
|
+
weight: "600",
|
|
78
|
+
color: "textPrimary",
|
|
79
|
+
sx: {
|
|
80
|
+
width: "64px"
|
|
81
|
+
}
|
|
82
|
+
}, label), /* @__PURE__ */React.createElement(ui.Text, {
|
|
83
|
+
color: "textPrimary"
|
|
84
|
+
}, value)), /* @__PURE__ */React.createElement(Stack, {
|
|
85
|
+
direction: "row",
|
|
86
|
+
ml: "auto",
|
|
87
|
+
flexShrink: 0
|
|
88
|
+
}, /* @__PURE__ */React.createElement(ui.Tooltip, {
|
|
89
|
+
title: "Copy",
|
|
90
|
+
placement: "top"
|
|
91
|
+
}, /* @__PURE__ */React.createElement(ActionButton, {
|
|
92
|
+
"aria-label": "Copy ".concat(label !== null && label !== void 0 ? label : value),
|
|
93
|
+
color: "primary",
|
|
94
|
+
onClick: handleCopy,
|
|
95
|
+
sx: styles.copyButton
|
|
96
|
+
}, /* @__PURE__ */React.createElement(CopyOutlinedIcon, {
|
|
97
|
+
size: 20
|
|
98
|
+
}))), Icon && href && /* @__PURE__ */React.createElement(ui.Tooltip, {
|
|
99
|
+
title: tooltip,
|
|
100
|
+
placement: "top"
|
|
101
|
+
}, /* @__PURE__ */React.createElement(ActionButton, {
|
|
102
|
+
component: "a",
|
|
103
|
+
color: "primary",
|
|
104
|
+
href: href,
|
|
105
|
+
"aria-label": label
|
|
106
|
+
}, /* @__PURE__ */React.createElement(Icon, {
|
|
107
|
+
size: 20
|
|
108
|
+
})))));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
exports.default = ContactMethod;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 DeleteOutlinedIcon = require('@tenancy.nz/icons/DeleteOutlined');
|
|
8
|
+
var ConfirmButton = require('./ConfirmButton.cjs');
|
|
9
|
+
|
|
10
|
+
function DeleteIconButton(_ref) {
|
|
11
|
+
var rest = _rollupPluginBabelHelpers.extends({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_ref), _ref));
|
|
12
|
+
return /* @__PURE__ */React.createElement(ConfirmButton.default, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, rest), {}, {
|
|
13
|
+
color: "error"
|
|
14
|
+
}), /* @__PURE__ */React.createElement(DeleteOutlinedIcon, null));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.default = DeleteIconButton;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 DownloadOutlinedIcon = require('@tenancy.nz/icons/DownloadOutlined');
|
|
8
|
+
var ui = require('@tenancy.nz/ui');
|
|
9
|
+
|
|
10
|
+
function DownloadIconButton(_ref) {
|
|
11
|
+
var rest = _rollupPluginBabelHelpers.extends({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_ref), _ref));
|
|
12
|
+
return /* @__PURE__ */React.createElement(ui.IconButton, _rollupPluginBabelHelpers.objectSpread2({
|
|
13
|
+
color: "primary"
|
|
14
|
+
}, rest), /* @__PURE__ */React.createElement(DownloadOutlinedIcon, null));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.default = DownloadIconButton;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 EditOutlinedIcon = require('@tenancy.nz/icons/EditOutlined');
|
|
8
|
+
var ConfirmButton = require('./ConfirmButton.cjs');
|
|
9
|
+
|
|
10
|
+
function EditIconButton(_ref) {
|
|
11
|
+
var rest = _rollupPluginBabelHelpers.extends({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_ref), _ref));
|
|
12
|
+
return /* @__PURE__ */React.createElement(ConfirmButton.default, _rollupPluginBabelHelpers.objectSpread2({
|
|
13
|
+
color: "primary"
|
|
14
|
+
}, rest), /* @__PURE__ */React.createElement(EditOutlinedIcon, null));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.default = EditIconButton;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 LogoutOutlinedIcon = require('@tenancy.nz/icons/LogoutOutlined');
|
|
8
|
+
var ui = require('@tenancy.nz/ui');
|
|
9
|
+
|
|
10
|
+
function LogoutButton(_ref) {
|
|
11
|
+
var rest = _rollupPluginBabelHelpers.extends({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_ref), _ref));
|
|
12
|
+
return /* @__PURE__ */React.createElement(ui.Button, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, rest), {}, {
|
|
13
|
+
startIcon: /* @__PURE__ */React.createElement(LogoutOutlinedIcon, null)
|
|
14
|
+
}), "Logout");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.default = LogoutButton;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 ExternalLinkOutlinedIcon = require('@tenancy.nz/icons/ExternalLinkOutlined');
|
|
8
|
+
var ui = require('@tenancy.nz/ui');
|
|
9
|
+
|
|
10
|
+
function OpenInNewIconButton(_ref) {
|
|
11
|
+
var rest = _rollupPluginBabelHelpers.extends({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_ref), _ref));
|
|
12
|
+
return /* @__PURE__ */React.createElement(ui.IconButton, _rollupPluginBabelHelpers.objectSpread2({
|
|
13
|
+
color: "primary"
|
|
14
|
+
}, rest), /* @__PURE__ */React.createElement(ExternalLinkOutlinedIcon, null));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.default = OpenInNewIconButton;
|
|
@@ -179,7 +179,8 @@ function ScrollTopButton(_ref2) {
|
|
|
179
179
|
return withPortal(withPlacement(/* @__PURE__ */React.createElement(ui.IconButton, _rollupPluginBabelHelpers.objectSpread2({
|
|
180
180
|
variant: "outlined",
|
|
181
181
|
size: "large",
|
|
182
|
-
onClick: handleClick
|
|
182
|
+
onClick: handleClick,
|
|
183
|
+
color: "primary"
|
|
183
184
|
}, rest), icon)));
|
|
184
185
|
}
|
|
185
186
|
return withPortal(withPlacement(/* @__PURE__ */React.createElement(ui.Button, _rollupPluginBabelHelpers.objectSpread2({
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -2,22 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
var AgentDetailsCard = require('./components/AgentDetailsCard.cjs');
|
|
4
4
|
var AnalyticsBox = require('./components/AnalyticsBox.cjs');
|
|
5
|
-
var
|
|
6
|
-
var BookingChart = require('./components/BookingChart.cjs');
|
|
5
|
+
var BackButton = require('./components/BackButton.cjs');
|
|
7
6
|
var BookingTable = require('./components/BookingTable.cjs');
|
|
8
7
|
var BookingTableRow = require('./components/BookingTableRow.cjs');
|
|
9
8
|
var BookingTableRowHeader = require('./components/BookingTableRowHeader.cjs');
|
|
10
9
|
var BookingTableRowSkeleton = require('./components/BookingTableRowSkeleton.cjs');
|
|
10
|
+
var ConfirmButton = require('./components/ConfirmButton.cjs');
|
|
11
|
+
var ContactCard = require('./components/ContactCard.cjs');
|
|
12
|
+
var ContactCardHeader = require('./components/ContactCardHeader.cjs');
|
|
13
|
+
var ContactMethod = require('./components/ContactMethod.cjs');
|
|
14
|
+
var DeleteIconButton = require('./components/DeleteIconButton.cjs');
|
|
15
|
+
var DownloadIconButton = require('./components/DownloadIconButton.cjs');
|
|
16
|
+
var EditIconButton = require('./components/EditIconButton.cjs');
|
|
11
17
|
var IntegrationTag = require('./components/IntegrationTag.cjs');
|
|
12
18
|
var CheckedIcon = require('./components/CheckedIcon.cjs');
|
|
13
|
-
var doughnutChart = require('./components/doughnut-chart.cjs');
|
|
14
|
-
var analyticsDoughnutChart = require('./components/analytics-doughnut-chart.cjs');
|
|
15
|
-
var pdfAnalyticsSection = require('./components/pdf-analytics-section.cjs');
|
|
16
19
|
var partnerLogo = require('./components/partner-logo.cjs');
|
|
17
20
|
var GridList = require('./components/GridList.cjs');
|
|
18
21
|
var Hidden = require('./components/Hidden.cjs');
|
|
19
22
|
var IconLabel = require('./components/IconLabel.cjs');
|
|
23
|
+
var LogoutButton = require('./components/LogoutButton.cjs');
|
|
20
24
|
var NotesCard = require('./components/NotesCard.cjs');
|
|
25
|
+
var OpenInNewIconButton = require('./components/OpenInNewIconButton.cjs');
|
|
21
26
|
var PersonCard = require('./components/PersonCard.cjs');
|
|
22
27
|
var PersonDetailHeader = require('./components/PersonDetailHeader.cjs');
|
|
23
28
|
var PropertyCard = require('./components/PropertyCard.cjs');
|
|
@@ -29,22 +34,27 @@ var TenantAvatarGroup = require('./components/TenantAvatarGroup.cjs');
|
|
|
29
34
|
|
|
30
35
|
exports.AgentDetailsCard = AgentDetailsCard.default;
|
|
31
36
|
exports.AnalyticsBox = AnalyticsBox.default;
|
|
32
|
-
exports.
|
|
33
|
-
exports.BookingChart = BookingChart.default;
|
|
37
|
+
exports.BackButton = BackButton.default;
|
|
34
38
|
exports.BookingTable = BookingTable.default;
|
|
35
39
|
exports.BookingTableRow = BookingTableRow.default;
|
|
36
40
|
exports.BookingTableRowHeader = BookingTableRowHeader.default;
|
|
37
41
|
exports.BookingTableRowSkeleton = BookingTableRowSkeleton.default;
|
|
42
|
+
exports.ConfirmButton = ConfirmButton.default;
|
|
43
|
+
exports.ContactCard = ContactCard.default;
|
|
44
|
+
exports.ContactCardHeader = ContactCardHeader.default;
|
|
45
|
+
exports.ContactMethod = ContactMethod.default;
|
|
46
|
+
exports.DeleteIconButton = DeleteIconButton.default;
|
|
47
|
+
exports.DownloadIconButton = DownloadIconButton.default;
|
|
48
|
+
exports.EditIconButton = EditIconButton.default;
|
|
38
49
|
exports.IntegrationTag = IntegrationTag.default;
|
|
39
50
|
exports.CheckedIcon = CheckedIcon.default;
|
|
40
|
-
exports.DoughnutChart = doughnutChart.default;
|
|
41
|
-
exports.AnalyticsDoughnutChart = analyticsDoughnutChart.default;
|
|
42
|
-
exports.PDFAnalyticsSection = pdfAnalyticsSection.default;
|
|
43
51
|
exports.PartnerLogo = partnerLogo.default;
|
|
44
52
|
exports.GridList = GridList.default;
|
|
45
53
|
exports.Hidden = Hidden.default;
|
|
46
54
|
exports.IconLabel = IconLabel.default;
|
|
55
|
+
exports.LogoutButton = LogoutButton.default;
|
|
47
56
|
exports.NotesCard = NotesCard.default;
|
|
57
|
+
exports.OpenInNewIconButton = OpenInNewIconButton.default;
|
|
48
58
|
exports.PersonCard = PersonCard.default;
|
|
49
59
|
exports.PersonDetailHeader = PersonDetailHeader.default;
|
|
50
60
|
exports.PropertyCard = PropertyCard.default;
|
|
@@ -17,6 +17,15 @@ function _defineProperty(e, r, t) {
|
|
|
17
17
|
writable: true
|
|
18
18
|
}) : e[r] = t, e;
|
|
19
19
|
}
|
|
20
|
+
function _extends() {
|
|
21
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
22
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
23
|
+
var t = arguments[e];
|
|
24
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
25
|
+
}
|
|
26
|
+
return n;
|
|
27
|
+
}, _extends.apply(null, arguments);
|
|
28
|
+
}
|
|
20
29
|
function _iterableToArray(r) {
|
|
21
30
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
22
31
|
}
|
|
@@ -31,10 +40,7 @@ function _iterableToArrayLimit(r, l) {
|
|
|
31
40
|
f = true,
|
|
32
41
|
o = false;
|
|
33
42
|
try {
|
|
34
|
-
if (i = (t = t.call(r)).next, 0 === l)
|
|
35
|
-
if (Object(t) !== t) return;
|
|
36
|
-
f = !1;
|
|
37
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
43
|
+
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
38
44
|
} catch (r) {
|
|
39
45
|
o = true, n = r;
|
|
40
46
|
} finally {
|
|
@@ -53,6 +59,9 @@ function _nonIterableRest() {
|
|
|
53
59
|
function _nonIterableSpread() {
|
|
54
60
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
55
61
|
}
|
|
62
|
+
function _objectDestructuringEmpty(t) {
|
|
63
|
+
if (null == t) throw new TypeError("Cannot destructure " + t);
|
|
64
|
+
}
|
|
56
65
|
function ownKeys(e, r) {
|
|
57
66
|
var t = Object.keys(e);
|
|
58
67
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -129,4 +138,4 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
129
138
|
}
|
|
130
139
|
}
|
|
131
140
|
|
|
132
|
-
export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _arrayWithoutHoles as arrayWithoutHoles, _defineProperty as defineProperty, _iterableToArray as iterableToArray, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _nonIterableSpread as nonIterableSpread, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _slicedToArray as slicedToArray, _taggedTemplateLiteral as taggedTemplateLiteral, _toConsumableArray as toConsumableArray, _toPrimitive as toPrimitive, _toPropertyKey as toPropertyKey, _unsupportedIterableToArray as unsupportedIterableToArray };
|
|
141
|
+
export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _arrayWithoutHoles as arrayWithoutHoles, _defineProperty as defineProperty, _extends as extends, _iterableToArray as iterableToArray, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _nonIterableSpread as nonIterableSpread, _objectDestructuringEmpty as objectDestructuringEmpty, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _slicedToArray as slicedToArray, _taggedTemplateLiteral as taggedTemplateLiteral, _toConsumableArray as toConsumableArray, _toPrimitive as toPrimitive, _toPropertyKey as toPropertyKey, _unsupportedIterableToArray as unsupportedIterableToArray };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ArrowLeftOutlinedIcon from '@tenancy.nz/icons/ArrowLeftOutlined';
|
|
3
|
+
import { Button } from '@tenancy.nz/ui';
|
|
4
|
+
|
|
5
|
+
function BackButton(_ref) {
|
|
6
|
+
var onClick = _ref.onClick;
|
|
7
|
+
return /* @__PURE__ */React.createElement(Button, {
|
|
8
|
+
startIcon: /* @__PURE__ */React.createElement(ArrowLeftOutlinedIcon, null),
|
|
9
|
+
variant: "outlined",
|
|
10
|
+
onClick: onClick
|
|
11
|
+
}, "Back");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { BackButton as default };
|