@tenancy.nz/ui 1.0.4 → 1.0.5
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/Alert.cjs +6 -11
- package/dist/cjs/components/Autocomplete.cjs +32 -34
- package/dist/cjs/components/Avatar.cjs +2 -5
- package/dist/cjs/components/AvatarCropDialog.cjs +40 -48
- package/dist/cjs/components/AvatarInput.cjs +86 -110
- package/dist/cjs/components/Badge.cjs +2 -5
- package/dist/cjs/components/BankAccountInput.cjs +74 -81
- package/dist/cjs/components/Bar.cjs +4 -6
- package/dist/cjs/components/BaseModal.cjs +3 -5
- package/dist/cjs/components/BooleanInput.cjs +37 -44
- package/dist/cjs/components/BorderedGrid.cjs +7 -9
- package/dist/cjs/components/Box.cjs +2 -5
- package/dist/cjs/components/Button.cjs +2 -5
- package/dist/cjs/components/Card.cjs +12 -21
- package/dist/cjs/components/CardContent.cjs +2 -5
- package/dist/cjs/components/Checkbox.cjs +14 -19
- package/dist/cjs/components/CircularProgress.cjs +2 -3
- package/dist/cjs/components/CollapsedText.cjs +29 -38
- package/dist/cjs/components/Confirmation.cjs +19 -26
- package/dist/cjs/components/Container.cjs +2 -5
- package/dist/cjs/components/CroppedImageInput.cjs +145 -167
- package/dist/cjs/components/CroppedImageInputActions.cjs +30 -39
- package/dist/cjs/components/DateInput.cjs +71 -79
- package/dist/cjs/components/DateNumberInput.cjs +49 -51
- package/dist/cjs/components/DatePicker.cjs +36 -41
- package/dist/cjs/components/DateSelect.cjs +100 -111
- package/dist/cjs/components/Divider.cjs +2 -3
- package/dist/cjs/components/DropZone.cjs +96 -112
- package/dist/cjs/components/Embed.cjs +11 -15
- package/dist/cjs/components/FileUpload.cjs +105 -126
- package/dist/cjs/components/FileUploadButton.cjs +9 -14
- package/dist/cjs/components/FileUploadButtonLoader.cjs +4 -5
- package/dist/cjs/components/FileViewer.cjs +50 -69
- package/dist/cjs/components/FlashMessage.cjs +7 -11
- package/dist/cjs/components/FormControl.cjs +45 -52
- package/dist/cjs/components/FormFocus.cjs +2 -3
- package/dist/cjs/components/FormLabel.cjs +1 -4
- package/dist/cjs/components/Grid.cjs +8 -14
- package/dist/cjs/components/Heading.cjs +3 -5
- package/dist/cjs/components/IconButton.cjs +2 -5
- package/dist/cjs/components/Icons.cjs +22 -41
- package/dist/cjs/components/LinearProgress.cjs +2 -3
- package/dist/cjs/components/Link.cjs +2 -5
- package/dist/cjs/components/Media.cjs +7 -10
- package/dist/cjs/components/Modal.cjs +23 -30
- package/dist/cjs/components/ModalActions.cjs +3 -5
- package/dist/cjs/components/ModalContent.cjs +3 -5
- package/dist/cjs/components/ModalHeader.cjs +10 -17
- package/dist/cjs/components/Nameplate.cjs +39 -64
- package/dist/cjs/components/Pagination.cjs +12 -17
- package/dist/cjs/components/Paper.cjs +3 -5
- package/dist/cjs/components/Popper.cjs +13 -17
- package/dist/cjs/components/PropertyCard.cjs +62 -90
- package/dist/cjs/components/Radio.cjs +14 -19
- package/dist/cjs/components/Rating.cjs +2 -3
- package/dist/cjs/components/Select.cjs +17 -24
- package/dist/cjs/components/Skeleton.cjs +3 -5
- package/dist/cjs/components/StatusMessage.cjs +3 -5
- package/dist/cjs/components/StepIcon.cjs +13 -20
- package/dist/cjs/components/Stepper.cjs +29 -35
- package/dist/cjs/components/SuccessModal.cjs +7 -16
- package/dist/cjs/components/Switch.cjs +17 -21
- package/dist/cjs/components/Tab.cjs +2 -3
- package/dist/cjs/components/TabPanel.cjs +4 -6
- package/dist/cjs/components/Table.cjs +2 -5
- package/dist/cjs/components/TableBody.cjs +2 -5
- package/dist/cjs/components/TableCell.cjs +2 -5
- package/dist/cjs/components/TableContainer.cjs +2 -5
- package/dist/cjs/components/TableFooter.cjs +2 -5
- package/dist/cjs/components/TableHead.cjs +2 -5
- package/dist/cjs/components/TableRow.cjs +2 -5
- package/dist/cjs/components/Tabs.cjs +4 -6
- package/dist/cjs/components/Tag.cjs +8 -16
- package/dist/cjs/components/Text.cjs +3 -5
- package/dist/cjs/components/TextInput.cjs +39 -47
- package/dist/cjs/components/ThemeProvider.cjs +8 -15
- package/dist/cjs/components/TimeInput.cjs +63 -71
- package/dist/cjs/components/Tooltip.cjs +5 -9
- package/dist/esm/components/Alert.js +6 -11
- package/dist/esm/components/Autocomplete.js +33 -35
- package/dist/esm/components/Avatar.js +2 -5
- package/dist/esm/components/AvatarCropDialog.js +41 -49
- package/dist/esm/components/AvatarInput.js +87 -111
- package/dist/esm/components/Badge.js +2 -5
- package/dist/esm/components/BankAccountInput.js +75 -82
- package/dist/esm/components/Bar.js +4 -6
- package/dist/esm/components/BaseModal.js +3 -5
- package/dist/esm/components/BooleanInput.js +38 -45
- package/dist/esm/components/BorderedGrid.js +7 -9
- package/dist/esm/components/Box.js +3 -6
- package/dist/esm/components/Button.js +2 -5
- package/dist/esm/components/Card.js +12 -21
- package/dist/esm/components/CardContent.js +2 -5
- package/dist/esm/components/Checkbox.js +14 -19
- package/dist/esm/components/CircularProgress.js +2 -3
- package/dist/esm/components/CollapsedText.js +30 -39
- package/dist/esm/components/Confirmation.js +19 -26
- package/dist/esm/components/Container.js +2 -5
- package/dist/esm/components/CroppedImageInput.js +146 -168
- package/dist/esm/components/CroppedImageInputActions.js +30 -39
- package/dist/esm/components/DateInput.js +72 -80
- package/dist/esm/components/DateNumberInput.js +50 -52
- package/dist/esm/components/DatePicker.js +37 -42
- package/dist/esm/components/DateSelect.js +95 -106
- package/dist/esm/components/Divider.js +2 -3
- package/dist/esm/components/DropZone.js +96 -112
- package/dist/esm/components/Embed.js +11 -15
- package/dist/esm/components/FileUpload.js +106 -127
- package/dist/esm/components/FileUploadButton.js +10 -15
- package/dist/esm/components/FileUploadButtonLoader.js +4 -5
- package/dist/esm/components/FileViewer.js +50 -69
- package/dist/esm/components/FlashMessage.js +7 -11
- package/dist/esm/components/FormControl.js +43 -50
- package/dist/esm/components/FormFocus.js +2 -3
- package/dist/esm/components/FormLabel.js +1 -4
- package/dist/esm/components/Grid.js +8 -14
- package/dist/esm/components/Heading.js +3 -5
- package/dist/esm/components/IconButton.js +2 -5
- package/dist/esm/components/Icons.js +22 -41
- package/dist/esm/components/LinearProgress.js +2 -3
- package/dist/esm/components/Link.js +2 -5
- package/dist/esm/components/Media.js +7 -10
- package/dist/esm/components/Modal.js +23 -30
- package/dist/esm/components/ModalActions.js +3 -5
- package/dist/esm/components/ModalContent.js +3 -5
- package/dist/esm/components/ModalHeader.js +10 -17
- package/dist/esm/components/Nameplate.js +39 -64
- package/dist/esm/components/Pagination.js +12 -17
- package/dist/esm/components/Paper.js +3 -5
- package/dist/esm/components/Popper.js +14 -18
- package/dist/esm/components/PropertyCard.js +62 -90
- package/dist/esm/components/Radio.js +14 -19
- package/dist/esm/components/Rating.js +2 -3
- package/dist/esm/components/Select.js +17 -24
- package/dist/esm/components/Skeleton.js +3 -5
- package/dist/esm/components/StatusMessage.js +3 -5
- package/dist/esm/components/StepIcon.js +13 -20
- package/dist/esm/components/Stepper.js +29 -35
- package/dist/esm/components/SuccessModal.js +8 -17
- package/dist/esm/components/Switch.js +17 -21
- package/dist/esm/components/Tab.js +2 -3
- package/dist/esm/components/TabPanel.js +4 -6
- package/dist/esm/components/Table.js +2 -5
- package/dist/esm/components/TableBody.js +2 -5
- package/dist/esm/components/TableCell.js +2 -5
- package/dist/esm/components/TableContainer.js +2 -5
- package/dist/esm/components/TableFooter.js +2 -5
- package/dist/esm/components/TableHead.js +2 -5
- package/dist/esm/components/TableRow.js +2 -5
- package/dist/esm/components/Tabs.js +4 -6
- package/dist/esm/components/Tag.js +8 -16
- package/dist/esm/components/Text.js +3 -5
- package/dist/esm/components/TextInput.js +36 -44
- package/dist/esm/components/ThemeProvider.js +8 -15
- package/dist/esm/components/TimeInput.js +64 -72
- package/dist/esm/components/Tooltip.js +5 -9
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
-
import
|
|
4
|
-
import 'react';
|
|
3
|
+
import React from 'react';
|
|
5
4
|
import PropTypes from 'prop-types';
|
|
6
5
|
import CardContent from './CardContent.js';
|
|
7
6
|
import Media from './Media.js';
|
|
@@ -25,27 +24,19 @@ function Card(_ref) {
|
|
|
25
24
|
var rest = _objectSpread2({
|
|
26
25
|
elevate: elevate
|
|
27
26
|
}, others);
|
|
28
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */React.createElement(Paper, _objectSpread2({
|
|
29
28
|
elevate: false,
|
|
30
29
|
outlined: true
|
|
31
|
-
}, rest),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
children: /* @__PURE__ */jsx(Media, {
|
|
42
|
-
src: imgSrc,
|
|
43
|
-
title: title
|
|
44
|
-
})
|
|
45
|
-
}), /* @__PURE__ */jsx(CardContent, {
|
|
46
|
-
children: children
|
|
47
|
-
})]
|
|
48
|
-
}));
|
|
30
|
+
}, rest), onClick &&
|
|
31
|
+
// <ActionArea onClick={onClick}>
|
|
32
|
+
/* @__PURE__ */
|
|
33
|
+
React.createElement(StyledCardMedia, null, imgContent, !imgContent && /* @__PURE__ */React.createElement(Media, {
|
|
34
|
+
src: imgSrc,
|
|
35
|
+
title: title
|
|
36
|
+
})), !onClick && /* @__PURE__ */React.createElement(StyledCardMedia, null, /* @__PURE__ */React.createElement(Media, {
|
|
37
|
+
src: imgSrc,
|
|
38
|
+
title: title
|
|
39
|
+
})), /* @__PURE__ */React.createElement(CardContent, null, children));
|
|
49
40
|
}
|
|
50
41
|
Card.propTypes = {
|
|
51
42
|
/**
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
import 'react';
|
|
2
|
+
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import { StyledCardContent } from './CardContent.styled.js';
|
|
6
5
|
|
|
7
6
|
function CardContent(_ref) {
|
|
8
7
|
var children = _ref.children;
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
children: children
|
|
11
|
-
});
|
|
8
|
+
return /* @__PURE__ */React.createElement(StyledCardContent, null, children);
|
|
12
9
|
}
|
|
13
10
|
CardContent.propTypes = {
|
|
14
11
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
3
|
import Stack from '@mui/material/Stack';
|
|
5
4
|
import Box from './Box.js';
|
|
6
5
|
import FormLabel from './FormLabel.js';
|
|
@@ -32,26 +31,22 @@ function Checkbox(_ref) {
|
|
|
32
31
|
size: size,
|
|
33
32
|
name: name
|
|
34
33
|
}, rest);
|
|
35
|
-
return /* @__PURE__ */
|
|
34
|
+
return /* @__PURE__ */React.createElement(Stack, {
|
|
36
35
|
direction: "row",
|
|
37
36
|
gap: "10px",
|
|
38
|
-
alignItems: "flex-start"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
children: label
|
|
53
|
-
})]
|
|
54
|
-
});
|
|
37
|
+
alignItems: "flex-start"
|
|
38
|
+
}, /* @__PURE__ */React.createElement(Box, null, /* @__PURE__ */React.createElement(StyledCheckbox, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
39
|
+
disableRipple: true
|
|
40
|
+
}))), /* @__PURE__ */React.createElement(FormLabel, {
|
|
41
|
+
htmlFor: id,
|
|
42
|
+
size: size,
|
|
43
|
+
disabled: disabled,
|
|
44
|
+
margin: "none",
|
|
45
|
+
sx: {
|
|
46
|
+
mt: "2px",
|
|
47
|
+
fontWeight: "500"
|
|
48
|
+
}
|
|
49
|
+
}, label));
|
|
55
50
|
}
|
|
56
51
|
|
|
57
52
|
export { Checkbox as default };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { extends as _extends, objectDestructuringEmpty as _objectDestructuringEmpty, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
-
import
|
|
4
|
-
import 'react';
|
|
3
|
+
import React from 'react';
|
|
5
4
|
import CircularProgress$1 from '@mui/material/CircularProgress';
|
|
6
5
|
|
|
7
6
|
function CircularProgress(_ref) {
|
|
8
7
|
var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
9
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */React.createElement(CircularProgress$1, _objectSpread2({}, rest));
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
export { CircularProgress as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { slicedToArray as _slicedToArray } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
-
import {
|
|
4
|
-
import { useState, useEffect } from 'react';
|
|
3
|
+
import React, { useState, useEffect } from 'react';
|
|
5
4
|
import PropTypes from 'prop-types';
|
|
6
5
|
import Grid from '@mui/material/Grid';
|
|
7
6
|
import { StyledCollapse, StyledButtonWrapper, StyledArrowDownIcon } from './CollapsedText.styled.js';
|
|
@@ -32,43 +31,35 @@ function CollapsedText(_ref) {
|
|
|
32
31
|
setCollapsedSize(collapsedLines * lineHeight);
|
|
33
32
|
}
|
|
34
33
|
}, [collapsedLines, lineHeight]);
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
return open ? "Less" : "More";
|
|
66
|
-
}()
|
|
67
|
-
})
|
|
68
|
-
})
|
|
69
|
-
})
|
|
70
|
-
})]
|
|
71
|
-
});
|
|
34
|
+
return /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(StyledCollapse, {
|
|
35
|
+
backgroundColor: backgroundColor,
|
|
36
|
+
collapsedSize: collapsedSize,
|
|
37
|
+
in: open,
|
|
38
|
+
lineHeight: lineHeight
|
|
39
|
+
}, children), /* @__PURE__ */React.createElement(Grid, {
|
|
40
|
+
container: true,
|
|
41
|
+
justify: buttonJustify
|
|
42
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
43
|
+
item: true
|
|
44
|
+
}, /* @__PURE__ */React.createElement(StyledButtonWrapper, null, /* @__PURE__ */React.createElement(Button, {
|
|
45
|
+
color: "primaryAlt",
|
|
46
|
+
variant: "outlined",
|
|
47
|
+
size: "small",
|
|
48
|
+
onClick: function onClick() {
|
|
49
|
+
return setOpen(!open);
|
|
50
|
+
},
|
|
51
|
+
endIcon: buttonJustify === "flex-end" ? /* @__PURE__ */React.createElement(StyledArrowDownIcon, {
|
|
52
|
+
open: open
|
|
53
|
+
}) : null,
|
|
54
|
+
startIcon: buttonJustify !== "flex-end" ? /* @__PURE__ */React.createElement(StyledArrowDownIcon, {
|
|
55
|
+
open: open
|
|
56
|
+
}) : null
|
|
57
|
+
}, function () {
|
|
58
|
+
if (buttonLabel && buttonLabel.open && buttonLabel.closed) {
|
|
59
|
+
return open ? buttonLabel.open : buttonLabel.closed;
|
|
60
|
+
}
|
|
61
|
+
return open ? "Less" : "More";
|
|
62
|
+
}())))));
|
|
72
63
|
}
|
|
73
64
|
CollapsedText.propTypes = {
|
|
74
65
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import Button from './Button.js';
|
|
5
4
|
import Heading from './Heading.js';
|
|
@@ -25,36 +24,30 @@ function Confirmation(_ref) {
|
|
|
25
24
|
severity = _ref$severity === void 0 ? "default" : _ref$severity,
|
|
26
25
|
_ref$title = _ref.title,
|
|
27
26
|
title = _ref$title === void 0 ? "Are you sure?" : _ref$title;
|
|
28
|
-
var actions = /* @__PURE__ */
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
children: confirmBtnText
|
|
42
|
-
})]
|
|
43
|
-
});
|
|
44
|
-
return /* @__PURE__ */jsx(Modal, {
|
|
27
|
+
var actions = /* @__PURE__ */React.createElement(React.Fragment, null, onCancel && cancelBtnText && /* @__PURE__ */React.createElement(Button, {
|
|
28
|
+
onClick: onCancel,
|
|
29
|
+
color: "primaryAlt",
|
|
30
|
+
variant: "outlined",
|
|
31
|
+
size: "small",
|
|
32
|
+
loading: cancelling
|
|
33
|
+
}, cancelBtnText), onConfirm && confirmBtnText && /* @__PURE__ */React.createElement(Button, {
|
|
34
|
+
onClick: onConfirm,
|
|
35
|
+
color: severity === "default" ? "primary" : severity,
|
|
36
|
+
size: "small",
|
|
37
|
+
loading: confirming
|
|
38
|
+
}, confirmBtnText));
|
|
39
|
+
return /* @__PURE__ */React.createElement(Modal, {
|
|
45
40
|
maxWidth: "xs",
|
|
46
41
|
open: open,
|
|
47
|
-
heading: /* @__PURE__ */
|
|
42
|
+
heading: /* @__PURE__ */React.createElement(Heading, {
|
|
48
43
|
as: "h5",
|
|
49
|
-
gutterBottom: false
|
|
50
|
-
|
|
51
|
-
}),
|
|
44
|
+
gutterBottom: false
|
|
45
|
+
}, title),
|
|
52
46
|
actions: actions,
|
|
53
|
-
content: /* @__PURE__ */
|
|
47
|
+
content: /* @__PURE__ */React.createElement(Text, {
|
|
54
48
|
as: "div",
|
|
55
|
-
variant: "body2"
|
|
56
|
-
|
|
57
|
-
})
|
|
49
|
+
variant: "body2"
|
|
50
|
+
}, message)
|
|
58
51
|
});
|
|
59
52
|
}
|
|
60
53
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
-
import
|
|
4
|
-
import 'react';
|
|
3
|
+
import React from 'react';
|
|
5
4
|
import PropTypes from 'prop-types';
|
|
6
5
|
import MuiContainer from '@mui/material/Container';
|
|
7
6
|
|
|
@@ -9,9 +8,7 @@ var _excluded = ["children"];
|
|
|
9
8
|
function Container(_ref) {
|
|
10
9
|
var children = _ref.children,
|
|
11
10
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
children: children
|
|
14
|
-
}));
|
|
11
|
+
return /* @__PURE__ */React.createElement(MuiContainer, _objectSpread2({}, rest), children);
|
|
15
12
|
}
|
|
16
13
|
Container.propTypes = {
|
|
17
14
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
-
import {
|
|
4
|
-
import { useState, useRef, useEffect, useCallback, createElement } from 'react';
|
|
3
|
+
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
5
4
|
import PropTypes from 'prop-types';
|
|
6
5
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
7
6
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
@@ -278,172 +277,151 @@ function CroppedImageInput(_ref) {
|
|
|
278
277
|
}
|
|
279
278
|
return false;
|
|
280
279
|
};
|
|
281
|
-
return /* @__PURE__ */
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
})
|
|
427
|
-
})))]
|
|
428
|
-
})]
|
|
429
|
-
})
|
|
430
|
-
}, "form-control"), (!openInDialog && src !== null && (!croppedImage || showError) || !openInDialog && showActions) && /* @__PURE__ */jsx(CroppedImageInputActions, {
|
|
431
|
-
handleCancel: handleCancel,
|
|
432
|
-
cancelling: cancelling,
|
|
433
|
-
cancelButtonProps: cancelButtonProps,
|
|
434
|
-
handleImageSave: handleImageSave,
|
|
435
|
-
saving: saving,
|
|
436
|
-
saveButtonProps: saveButtonProps,
|
|
437
|
-
disabled: disabled
|
|
438
|
-
}), /* @__PURE__ */jsx(Confirmation, {
|
|
439
|
-
open: confirmDelete,
|
|
440
|
-
onCancel: function onCancel() {
|
|
441
|
-
return setConfirmDelete(false);
|
|
442
|
-
},
|
|
443
|
-
onConfirm: handleDelete,
|
|
444
|
-
message: "Are you sure you want to remove the attached image?"
|
|
445
|
-
})]
|
|
446
|
-
});
|
|
280
|
+
return /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(FileViewer, _objectSpread2(_objectSpread2({}, fileViewerProps), {}, {
|
|
281
|
+
file: {
|
|
282
|
+
url: documentFile,
|
|
283
|
+
filetype: filetype
|
|
284
|
+
},
|
|
285
|
+
open: viewDocument,
|
|
286
|
+
onClose: function onClose() {
|
|
287
|
+
return setViewDocument(false);
|
|
288
|
+
}
|
|
289
|
+
})), /* @__PURE__ */React.createElement(FormControl, {
|
|
290
|
+
key: "form-control",
|
|
291
|
+
name: name,
|
|
292
|
+
fullWidth: true,
|
|
293
|
+
label: label,
|
|
294
|
+
helperText: helperText,
|
|
295
|
+
helperTextPlacement: helperTextPlacement,
|
|
296
|
+
disabled: disabled,
|
|
297
|
+
required: required,
|
|
298
|
+
showError: showError,
|
|
299
|
+
errorMessage: errorMessage,
|
|
300
|
+
edges: edges
|
|
301
|
+
}, /* @__PURE__ */React.createElement("div", null, /* @__PURE__ */React.createElement("input", _objectSpread2(_objectSpread2({
|
|
302
|
+
type: "hidden",
|
|
303
|
+
ref: input
|
|
304
|
+
}, inputProps), {}, {
|
|
305
|
+
key: "hidden-input"
|
|
306
|
+
})), saving || cancelling && /* @__PURE__ */React.createElement(StyledCircularProgress, {
|
|
307
|
+
key: "loading"
|
|
308
|
+
}), /* @__PURE__ */React.createElement(AnimatePresence, {
|
|
309
|
+
exitBeforeEnter: true
|
|
310
|
+
}, (croppedImage || documentFile) && !showError && /* @__PURE__ */React.createElement(StyledSavedImage, _objectSpread2(_objectSpread2({}, fade), {}, {
|
|
311
|
+
key: "saved-image",
|
|
312
|
+
edges: edges
|
|
313
|
+
}), /* @__PURE__ */React.createElement(Grid, {
|
|
314
|
+
container: true,
|
|
315
|
+
alignItems: "center",
|
|
316
|
+
spacing: 5
|
|
317
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
318
|
+
item: true,
|
|
319
|
+
xs: 12,
|
|
320
|
+
md: 11
|
|
321
|
+
}, croppedImage && /* @__PURE__ */React.createElement("img", {
|
|
322
|
+
src: croppedImage,
|
|
323
|
+
alt: ""
|
|
324
|
+
}), documentFile && /* @__PURE__ */React.createElement(Grid, {
|
|
325
|
+
item: true,
|
|
326
|
+
xs: 12,
|
|
327
|
+
md: 1,
|
|
328
|
+
style: {
|
|
329
|
+
justifyContent: "center",
|
|
330
|
+
alignItems: "center"
|
|
331
|
+
}
|
|
332
|
+
}, /* @__PURE__ */React.createElement(IconButton, {
|
|
333
|
+
onClick: function onClick() {
|
|
334
|
+
return setViewDocument(true);
|
|
335
|
+
}
|
|
336
|
+
}, /* @__PURE__ */React.createElement(StyledFileIcon, null)))), /* @__PURE__ */React.createElement(Grid, {
|
|
337
|
+
item: true,
|
|
338
|
+
xs: 12,
|
|
339
|
+
md: 1
|
|
340
|
+
}, /* @__PURE__ */React.createElement(StyledDeleteIcon, null, /* @__PURE__ */React.createElement(DeleteIcon, null))))), !src && !documentFile && !croppedImage && (openInDialog ? /* @__PURE__ */React.createElement(motion.div, _objectSpread2(_objectSpread2({}, fade), {}, {
|
|
341
|
+
key: "upload-button"
|
|
342
|
+
}), /* @__PURE__ */React.createElement(FileUploadButton, {
|
|
343
|
+
onUpload: onDrop,
|
|
344
|
+
fullWidth: !isNotMobile
|
|
345
|
+
}, dropzoneLabel)) : /* @__PURE__ */React.createElement(motion.div, _objectSpread2(_objectSpread2({}, fade), {}, {
|
|
346
|
+
key: "dropzone"
|
|
347
|
+
}), /* @__PURE__ */React.createElement(DropZone, {
|
|
348
|
+
loading: loading,
|
|
349
|
+
disabled: disabled,
|
|
350
|
+
onDrop: onDrop,
|
|
351
|
+
edges: edges,
|
|
352
|
+
dropzoneLabel: dropzoneLabel,
|
|
353
|
+
dropzoneDescription: dropzoneDescription,
|
|
354
|
+
dropzoneProps: _objectSpread2(_objectSpread2({
|
|
355
|
+
accept: ["image/*"]
|
|
356
|
+
}, dropzoneProps), {}, {
|
|
357
|
+
maxFiles: 1
|
|
358
|
+
})
|
|
359
|
+
}))), src !== null && documentFile === null && (!croppedImage || showError) && (openInDialog ? /* @__PURE__ */React.createElement(Modal, {
|
|
360
|
+
open: true,
|
|
361
|
+
fullWidth: true,
|
|
362
|
+
fullScreen: true
|
|
363
|
+
}, /* @__PURE__ */React.createElement(ModalHeader, {
|
|
364
|
+
onClose: handleCancel
|
|
365
|
+
}, /* @__PURE__ */React.createElement(Heading, {
|
|
366
|
+
as: "h4"
|
|
367
|
+
}, "Crop Image")), /* @__PURE__ */React.createElement(ModalContent, null, /* @__PURE__ */React.createElement(Box, {
|
|
368
|
+
pl: 2.5,
|
|
369
|
+
pr: 2.5,
|
|
370
|
+
pb: 2.5
|
|
371
|
+
}, /* @__PURE__ */React.createElement(StyledEditor, {
|
|
372
|
+
edges: edges,
|
|
373
|
+
showError: showError
|
|
374
|
+
}, /* @__PURE__ */React.createElement(ReactCrop, {
|
|
375
|
+
crop: crop,
|
|
376
|
+
style: {
|
|
377
|
+
width: "100%"
|
|
378
|
+
},
|
|
379
|
+
onChange: handleCropChange,
|
|
380
|
+
onImageLoaded: handleImageLoaded,
|
|
381
|
+
renderSelectionAddon: cropGuide
|
|
382
|
+
}, /* @__PURE__ */React.createElement("img", {
|
|
383
|
+
src: src,
|
|
384
|
+
alt: ""
|
|
385
|
+
}))), /* @__PURE__ */React.createElement(CroppedImageInputActions, {
|
|
386
|
+
handleCancel: handleCancel,
|
|
387
|
+
cancelling: cancelling,
|
|
388
|
+
cancelButtonProps: cancelButtonProps,
|
|
389
|
+
handleImageSave: handleImageSave,
|
|
390
|
+
saving: saving,
|
|
391
|
+
saveButtonProps: saveButtonProps,
|
|
392
|
+
disabled: disabled
|
|
393
|
+
})))) : /* @__PURE__ */React.createElement(motion.div, _objectSpread2(_objectSpread2({}, fade), {}, {
|
|
394
|
+
key: "editor"
|
|
395
|
+
}), /* @__PURE__ */React.createElement(StyledEditor, {
|
|
396
|
+
edges: edges,
|
|
397
|
+
showError: showError
|
|
398
|
+
}, /* @__PURE__ */React.createElement(ReactCrop, {
|
|
399
|
+
crop: crop,
|
|
400
|
+
style: {
|
|
401
|
+
width: "100%"
|
|
402
|
+
},
|
|
403
|
+
onChange: handleCropChange,
|
|
404
|
+
renderSelectionAddon: cropGuide
|
|
405
|
+
}, /* @__PURE__ */React.createElement("img", {
|
|
406
|
+
src: src,
|
|
407
|
+
alt: "",
|
|
408
|
+
onLoad: handleImageLoaded
|
|
409
|
+
})))))))), (!openInDialog && src !== null && (!croppedImage || showError) || !openInDialog && showActions) && /* @__PURE__ */React.createElement(CroppedImageInputActions, {
|
|
410
|
+
handleCancel: handleCancel,
|
|
411
|
+
cancelling: cancelling,
|
|
412
|
+
cancelButtonProps: cancelButtonProps,
|
|
413
|
+
handleImageSave: handleImageSave,
|
|
414
|
+
saving: saving,
|
|
415
|
+
saveButtonProps: saveButtonProps,
|
|
416
|
+
disabled: disabled
|
|
417
|
+
}), /* @__PURE__ */React.createElement(Confirmation, {
|
|
418
|
+
open: confirmDelete,
|
|
419
|
+
onCancel: function onCancel() {
|
|
420
|
+
return setConfirmDelete(false);
|
|
421
|
+
},
|
|
422
|
+
onConfirm: handleDelete,
|
|
423
|
+
message: "Are you sure you want to remove the attached image?"
|
|
424
|
+
}));
|
|
447
425
|
}
|
|
448
426
|
CroppedImageInput.propTypes = {
|
|
449
427
|
/**
|