@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
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
7
|
var CheckCircleOutlineOutlinedIcon = require('@mui/icons-material/CheckCircleOutlineOutlined');
|
|
9
8
|
var ErrorOutlineOutlinedIcon = require('@mui/icons-material/ErrorOutlineOutlined');
|
|
10
9
|
var InfoOutlinedIcon = require('@mui/icons-material/InfoOutlined');
|
|
@@ -16,22 +15,22 @@ var variantMap = {
|
|
|
16
15
|
contained: "filled"
|
|
17
16
|
};
|
|
18
17
|
var icons = {
|
|
19
|
-
info: /* @__PURE__ */
|
|
18
|
+
info: /* @__PURE__ */React.createElement(InfoOutlinedIcon, {
|
|
20
19
|
sx: {
|
|
21
20
|
fontSize: 24
|
|
22
21
|
}
|
|
23
22
|
}),
|
|
24
|
-
success: /* @__PURE__ */
|
|
23
|
+
success: /* @__PURE__ */React.createElement(CheckCircleOutlineOutlinedIcon, {
|
|
25
24
|
sx: {
|
|
26
25
|
fontSize: 24
|
|
27
26
|
}
|
|
28
27
|
}),
|
|
29
|
-
error: /* @__PURE__ */
|
|
28
|
+
error: /* @__PURE__ */React.createElement(ErrorOutlineOutlinedIcon, {
|
|
30
29
|
sx: {
|
|
31
30
|
fontSize: 24
|
|
32
31
|
}
|
|
33
32
|
}),
|
|
34
|
-
warning: /* @__PURE__ */
|
|
33
|
+
warning: /* @__PURE__ */React.createElement(WarningAmberOutlinedIcon, {
|
|
35
34
|
sx: {
|
|
36
35
|
fontSize: 24
|
|
37
36
|
}
|
|
@@ -48,7 +47,7 @@ function Alert(_ref) {
|
|
|
48
47
|
_ref$variant = _ref.variant,
|
|
49
48
|
variant = _ref$variant === void 0 ? "standard" : _ref$variant,
|
|
50
49
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
51
|
-
return /* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */React.createElement(Alert_styled.default, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
|
|
52
51
|
color: color,
|
|
53
52
|
variant: variantMap[variant] || variant,
|
|
54
53
|
severity: color,
|
|
@@ -56,11 +55,7 @@ function Alert(_ref) {
|
|
|
56
55
|
closeText: "undo"
|
|
57
56
|
}, rest), (!icon || !color || !icons[color]) && {
|
|
58
57
|
icon: false
|
|
59
|
-
}),
|
|
60
|
-
children: [title && /* @__PURE__ */jsxRuntime.jsx(Alert_styled.StyledAlertTitle, {
|
|
61
|
-
children: title
|
|
62
|
-
}), children]
|
|
63
|
-
}));
|
|
58
|
+
}), title && /* @__PURE__ */React.createElement(Alert_styled.StyledAlertTitle, null, title), children);
|
|
64
59
|
}
|
|
65
60
|
|
|
66
61
|
exports.default = Alert;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
7
|
var React = require('react');
|
|
9
8
|
var PropTypes = require('prop-types');
|
|
10
9
|
var KeyboardArrowDownIcon = require('@mui/icons-material/KeyboardArrowDown');
|
|
@@ -64,7 +63,7 @@ function Autocomplete(_ref) {
|
|
|
64
63
|
}
|
|
65
64
|
onChange.apply(void 0, [event, val].concat(extras));
|
|
66
65
|
};
|
|
67
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */React.createElement(FormControl.default, {
|
|
68
67
|
name: name,
|
|
69
68
|
fullWidth: fullWidth,
|
|
70
69
|
label: label,
|
|
@@ -75,38 +74,37 @@ function Autocomplete(_ref) {
|
|
|
75
74
|
showError: showError,
|
|
76
75
|
errorMessage: errorMessage,
|
|
77
76
|
hideLabel: hideLabel,
|
|
78
|
-
edges: edges
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
});
|
|
77
|
+
edges: edges
|
|
78
|
+
}, /* @__PURE__ */React.createElement(Autocomplete_styled.StyledAutocomplete, _rollupPluginBabelHelpers.objectSpread2({
|
|
79
|
+
disabled: disabled,
|
|
80
|
+
iconrotation: disableIconRotation ? "no" : "yes",
|
|
81
|
+
popupIcon: popupIcon === void 0 ? /* @__PURE__ */React.createElement(KeyboardArrowDownIcon, null) : popupIcon,
|
|
82
|
+
renderInput: function renderInput(_ref2) {
|
|
83
|
+
var inputProps = _ref2.inputProps,
|
|
84
|
+
InputProps = _ref2.InputProps,
|
|
85
|
+
params = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded2);
|
|
86
|
+
return /* @__PURE__ */React.createElement(TextInput.default, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, params), {}, {
|
|
87
|
+
disabled: disabled,
|
|
88
|
+
name: name,
|
|
89
|
+
variant: variant,
|
|
90
|
+
size: size,
|
|
91
|
+
edges: edges,
|
|
92
|
+
required: required,
|
|
93
|
+
value: selectedValue,
|
|
94
|
+
placeholder: placeholder,
|
|
95
|
+
inputProps: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
|
|
96
|
+
autoComplete: "off"
|
|
97
|
+
}, textInputAttrs), inputProps),
|
|
98
|
+
slotProps: {
|
|
99
|
+
input: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, TextInputProps), InputProps)
|
|
100
|
+
},
|
|
101
|
+
showError: showError,
|
|
102
|
+
message: errorMessage,
|
|
103
|
+
ref: InputProps.ref
|
|
104
|
+
}));
|
|
105
|
+
},
|
|
106
|
+
onChange: handleChange
|
|
107
|
+
}, rest)));
|
|
110
108
|
}
|
|
111
109
|
Autocomplete.propTypes = {
|
|
112
110
|
/**
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
|
|
7
|
-
var
|
|
8
|
-
require('react');
|
|
7
|
+
var React = require('react');
|
|
9
8
|
var PropTypes = require('prop-types');
|
|
10
9
|
var Avatar_styled = require('./Avatar.styled.cjs');
|
|
11
10
|
|
|
@@ -28,9 +27,7 @@ function Avatar(_ref) {
|
|
|
28
27
|
srcSet: srcSet,
|
|
29
28
|
variant: variant
|
|
30
29
|
}, rest);
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
children: children
|
|
33
|
-
}));
|
|
30
|
+
return /* @__PURE__ */React.createElement(Avatar_styled.StyledAvatar, _rollupPluginBabelHelpers.objectSpread2({}, props), children);
|
|
34
31
|
}
|
|
35
32
|
Avatar.propTypes = {
|
|
36
33
|
/**
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
7
|
var React = require('react');
|
|
9
8
|
var PropTypes = require('prop-types');
|
|
10
9
|
var useMediaQuery = require('@mui/material/useMediaQuery');
|
|
@@ -129,53 +128,46 @@ function AvatarCropDialog(_ref) {
|
|
|
129
128
|
}
|
|
130
129
|
return false;
|
|
131
130
|
};
|
|
132
|
-
return /* @__PURE__ */
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
onCancel: function onCancel() {
|
|
173
|
-
return setConfirmDelete(false);
|
|
174
|
-
},
|
|
175
|
-
onConfirm: handleCancel,
|
|
176
|
-
message: "Are you sure you want to remove the attached image?"
|
|
177
|
-
})]
|
|
178
|
-
});
|
|
131
|
+
return /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(FormControl.default, {
|
|
132
|
+
key: "form-control",
|
|
133
|
+
name: "avatar-crop-editor",
|
|
134
|
+
fullWidth: true,
|
|
135
|
+
label: label,
|
|
136
|
+
helperText: helperText,
|
|
137
|
+
showError: showError,
|
|
138
|
+
errorMessage: errorMessage
|
|
139
|
+
}, /* @__PURE__ */React.createElement(AvatarCropDialog_styled.StyledEditor, {
|
|
140
|
+
showError: showError
|
|
141
|
+
}, /* @__PURE__ */React.createElement(ReactCrop, {
|
|
142
|
+
src: droppedFile,
|
|
143
|
+
crop: crop,
|
|
144
|
+
style: {
|
|
145
|
+
width: editorWidth,
|
|
146
|
+
maxHeight: window.innerHeight * 0.7
|
|
147
|
+
},
|
|
148
|
+
circularCrop: true,
|
|
149
|
+
onChange: handleCropChange,
|
|
150
|
+
onImageLoaded: handleImageLoaded,
|
|
151
|
+
keepSelection: true
|
|
152
|
+
}))), /* @__PURE__ */React.createElement(ModalActions.default, null, /* @__PURE__ */React.createElement(Button.default, {
|
|
153
|
+
onClick: handleCancel,
|
|
154
|
+
variant: "outlined",
|
|
155
|
+
loading: cancelling,
|
|
156
|
+
color: "primaryAlt",
|
|
157
|
+
fullWidth: !isNotMobile
|
|
158
|
+
}, "Cancel"), /* @__PURE__ */React.createElement(Button.default, {
|
|
159
|
+
onClick: handleImageSave,
|
|
160
|
+
loading: saving,
|
|
161
|
+
color: "primaryAlt",
|
|
162
|
+
fullWidth: !isNotMobile
|
|
163
|
+
}, "Save")), /* @__PURE__ */React.createElement(Confirmation.default, {
|
|
164
|
+
open: confirmDelete,
|
|
165
|
+
onCancel: function onCancel() {
|
|
166
|
+
return setConfirmDelete(false);
|
|
167
|
+
},
|
|
168
|
+
onConfirm: handleCancel,
|
|
169
|
+
message: "Are you sure you want to remove the attached image?"
|
|
170
|
+
}));
|
|
179
171
|
}
|
|
180
172
|
AvatarCropDialog.propTypes = {
|
|
181
173
|
/**
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
7
|
var React = require('react');
|
|
9
8
|
var PropTypes = require('prop-types');
|
|
10
9
|
var Box = require('@mui/material/Box');
|
|
@@ -113,115 +112,92 @@ function AvatarInput(_ref) {
|
|
|
113
112
|
isDragReject = _useDropzone.isDragReject,
|
|
114
113
|
fileRejections = _useDropzone.fileRejections;
|
|
115
114
|
var hasErrors = fileRejections.length > 0;
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
onClose: function onClose() {
|
|
203
|
-
return setOpen(false);
|
|
204
|
-
},
|
|
205
|
-
children: /* @__PURE__ */jsxRuntime.jsx("span", {
|
|
206
|
-
children: "\xA0"
|
|
207
|
-
})
|
|
208
|
-
}), /* @__PURE__ */jsxRuntime.jsx(ModalContent.default, {
|
|
209
|
-
children: /* @__PURE__ */jsxRuntime.jsx(AvatarCropDialog.default, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
|
|
210
|
-
droppedFile: droppedFile
|
|
211
|
-
}, rest), {}, {
|
|
212
|
-
onSave: handleSave,
|
|
213
|
-
onDelete: handleDelete
|
|
214
|
-
}))
|
|
215
|
-
})]
|
|
216
|
-
}), /* @__PURE__ */jsxRuntime.jsx(Confirmation.default, {
|
|
217
|
-
open: confirmDelete,
|
|
218
|
-
onCancel: function onCancel() {
|
|
219
|
-
return setConfirmDelete(false);
|
|
220
|
-
},
|
|
221
|
-
onConfirm: handleDelete,
|
|
222
|
-
message: "Are you sure you want to remove the attached image?"
|
|
223
|
-
})]
|
|
224
|
-
});
|
|
115
|
+
return /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement("div", {
|
|
116
|
+
style: {
|
|
117
|
+
position: "relative"
|
|
118
|
+
}
|
|
119
|
+
}, /* @__PURE__ */React.createElement(AvatarInput_styled.StyledRoot, _rollupPluginBabelHelpers.objectSpread2({
|
|
120
|
+
disabled: disabled,
|
|
121
|
+
edges: edges,
|
|
122
|
+
errors: hasErrors ? "yes" : ""
|
|
123
|
+
}, getRootProps()), isDragActive && /* @__PURE__ */React.createElement(AvatarInput_styled.StyledLinearProgress, {
|
|
124
|
+
isDragReject: isDragReject
|
|
125
|
+
}), loading && !hasErrors && /* @__PURE__ */React.createElement(AvatarInput_styled.StyledCircularProgress, null), /* @__PURE__ */React.createElement("input", _rollupPluginBabelHelpers.objectSpread2({}, getInputProps())), /* @__PURE__ */React.createElement(Grid, {
|
|
126
|
+
container: true,
|
|
127
|
+
spacing: 5,
|
|
128
|
+
alignItems: "center"
|
|
129
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
130
|
+
item: true,
|
|
131
|
+
xs: 12,
|
|
132
|
+
sm: 3,
|
|
133
|
+
md: 2,
|
|
134
|
+
style: {
|
|
135
|
+
textAlign: "center"
|
|
136
|
+
}
|
|
137
|
+
}, /* @__PURE__ */React.createElement(AvatarInput_styled.StyledAvatarIcon, null, function () {
|
|
138
|
+
if (isDragReject) {
|
|
139
|
+
return /* @__PURE__ */React.createElement(WarningIcon, null);
|
|
140
|
+
}
|
|
141
|
+
if (isDragAccept) {
|
|
142
|
+
return /* @__PURE__ */React.createElement(CheckCircleIcon, null);
|
|
143
|
+
}
|
|
144
|
+
if (savedImage || value || placeholder) {
|
|
145
|
+
return /* @__PURE__ */React.createElement(AvatarInput_styled.StyledAvatar, {
|
|
146
|
+
src: savedImage || value || placeholder
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
if (DropzoneIcon) {
|
|
150
|
+
return /* @__PURE__ */React.createElement(DropzoneIcon, null);
|
|
151
|
+
}
|
|
152
|
+
return /* @__PURE__ */React.createElement(PersonIcon, null);
|
|
153
|
+
}(), !hasSelection && /* @__PURE__ */React.createElement(AvatarInput_styled.StyledAddIcon, null, /* @__PURE__ */React.createElement(AddIcon, {
|
|
154
|
+
style: {
|
|
155
|
+
color: "inherit"
|
|
156
|
+
}
|
|
157
|
+
}))), /* @__PURE__ */React.createElement(Text.default, {
|
|
158
|
+
align: "center",
|
|
159
|
+
weight: "500",
|
|
160
|
+
color: "textPrimary",
|
|
161
|
+
noWrap: true,
|
|
162
|
+
gutterBottom: false
|
|
163
|
+
}, isDragReject ? "Error!" : dropzoneLabel)), /* @__PURE__ */React.createElement(Grid, {
|
|
164
|
+
item: true,
|
|
165
|
+
xs: 12,
|
|
166
|
+
sm: 8,
|
|
167
|
+
md: 9
|
|
168
|
+
}, /* @__PURE__ */React.createElement(Box, {
|
|
169
|
+
pl: isNotMobile ? 5 : 0
|
|
170
|
+
}, /* @__PURE__ */React.createElement(Text.default, {
|
|
171
|
+
align: isNotMobile ? "left" : "center",
|
|
172
|
+
weight: "500",
|
|
173
|
+
color: "textPrimary"
|
|
174
|
+
}, isDragReject ? "The selected file(s) will not be accepted" : dropzoneDescription))))), (savedImage || value) &&
|
|
175
|
+
// <ActionArea onClick={() => setConfirmDelete(true)}>
|
|
176
|
+
/* @__PURE__ */
|
|
177
|
+
React.createElement(AvatarInput_styled.StyledDeleteIcon, null, /* @__PURE__ */React.createElement(DeleteIcon, null))), droppedFile && /* @__PURE__ */React.createElement(Modal.default, {
|
|
178
|
+
open: open,
|
|
179
|
+
onClose: function onClose() {
|
|
180
|
+
return setOpen(false);
|
|
181
|
+
},
|
|
182
|
+
fullWidth: true,
|
|
183
|
+
maxWidth: "lg"
|
|
184
|
+
}, /* @__PURE__ */React.createElement(ModalHeader.default, {
|
|
185
|
+
onClose: function onClose() {
|
|
186
|
+
return setOpen(false);
|
|
187
|
+
}
|
|
188
|
+
}, /* @__PURE__ */React.createElement("span", null, "\xA0")), /* @__PURE__ */React.createElement(ModalContent.default, null, /* @__PURE__ */React.createElement(AvatarCropDialog.default, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
|
|
189
|
+
droppedFile: droppedFile
|
|
190
|
+
}, rest), {}, {
|
|
191
|
+
onSave: handleSave,
|
|
192
|
+
onDelete: handleDelete
|
|
193
|
+
})))), /* @__PURE__ */React.createElement(Confirmation.default, {
|
|
194
|
+
open: confirmDelete,
|
|
195
|
+
onCancel: function onCancel() {
|
|
196
|
+
return setConfirmDelete(false);
|
|
197
|
+
},
|
|
198
|
+
onConfirm: handleDelete,
|
|
199
|
+
message: "Are you sure you want to remove the attached image?"
|
|
200
|
+
}));
|
|
225
201
|
}
|
|
226
202
|
AvatarInput.propTypes = {
|
|
227
203
|
/**
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
|
|
7
|
-
var
|
|
8
|
-
require('react');
|
|
7
|
+
var React = require('react');
|
|
9
8
|
var PropTypes = require('prop-types');
|
|
10
9
|
var Badge_styled = require('./Badge.styled.cjs');
|
|
11
10
|
|
|
@@ -43,9 +42,7 @@ function Badge(_ref) {
|
|
|
43
42
|
showZero: showZero,
|
|
44
43
|
variant: variant
|
|
45
44
|
}, rest);
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
children: children
|
|
48
|
-
}));
|
|
45
|
+
return /* @__PURE__ */React.createElement(Badge_styled.StyledBadge, _rollupPluginBabelHelpers.objectSpread2({}, props), children);
|
|
49
46
|
}
|
|
50
47
|
Badge.propTypes = {
|
|
51
48
|
/**
|