@tenancy.nz/ui 1.0.3 → 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 +3 -3
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { slicedToArray as _slicedToArray, toConsumableArray as _toConsumableArray, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
-
import {
|
|
4
|
-
import { useState, useCallback } from 'react';
|
|
3
|
+
import React, { useState, useCallback } from 'react';
|
|
5
4
|
import PropTypes from 'prop-types';
|
|
6
5
|
import Alert from '@mui/material/Alert';
|
|
7
6
|
import { AnimateSharedLayout, AnimatePresence, motion } from 'framer-motion';
|
|
@@ -144,134 +143,114 @@ function FileUpload(_ref) {
|
|
|
144
143
|
opacity: 0
|
|
145
144
|
}
|
|
146
145
|
};
|
|
147
|
-
return /* @__PURE__ */
|
|
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
|
-
scale: 0.3
|
|
181
|
-
},
|
|
182
|
-
animate: {
|
|
183
|
-
opacity: 1,
|
|
184
|
-
y: 0,
|
|
185
|
-
scale: 1
|
|
186
|
-
},
|
|
187
|
-
exit: {
|
|
188
|
-
opacity: 0,
|
|
189
|
-
scale: 0.5,
|
|
190
|
-
transition: {
|
|
191
|
-
duration: 0.2
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
children: /* @__PURE__ */jsxs(Alert, {
|
|
195
|
-
severity: showError || fileErrors(file, index) !== null ? "error" : "success",
|
|
196
|
-
style: {
|
|
197
|
-
marginBottom: 5
|
|
198
|
-
},
|
|
199
|
-
action: /* @__PURE__ */jsxs(Fragment, {
|
|
200
|
-
children: [fileActions(file, index) !== null && fileActions(file, index), /* @__PURE__ */jsx(Button, {
|
|
201
|
-
onClick: function onClick() {
|
|
202
|
-
return setViewedFile(file);
|
|
203
|
-
},
|
|
204
|
-
color: "inherit",
|
|
205
|
-
size: "small",
|
|
206
|
-
variant: "text",
|
|
207
|
-
children: "View"
|
|
208
|
-
}), /* @__PURE__ */jsx(Tooltip, {
|
|
209
|
-
title: "Delete",
|
|
210
|
-
enterDelay: 0,
|
|
211
|
-
children: /* @__PURE__ */jsx("div", {
|
|
212
|
-
children: /* @__PURE__ */jsx(IconButton, {
|
|
213
|
-
disabled: saving,
|
|
214
|
-
size: "small",
|
|
215
|
-
"aria-label": "delete",
|
|
216
|
-
style: {
|
|
217
|
-
padding: 0
|
|
218
|
-
},
|
|
219
|
-
onClick: function onClick() {
|
|
220
|
-
return !showError ? handleDeleteConfirmation(index) : handleDeleteWithoutConfirmation(index);
|
|
221
|
-
},
|
|
222
|
-
children: /* @__PURE__ */jsx(DeleteIcon, {})
|
|
223
|
-
})
|
|
224
|
-
})
|
|
225
|
-
})]
|
|
226
|
-
}),
|
|
227
|
-
children: [/* @__PURE__ */jsx(StyledAlertTitle, {
|
|
228
|
-
children: getFileName(file)
|
|
229
|
-
}), fileErrors(file, index)]
|
|
230
|
-
})
|
|
231
|
-
})
|
|
232
|
-
}, getFileName(file));
|
|
233
|
-
})
|
|
234
|
-
})
|
|
235
|
-
})
|
|
236
|
-
})]
|
|
237
|
-
})), (!files || files.length === 0 || !dropzoneProps || dropzoneProps.maxFiles === void 0 || dropzoneProps.maxFiles > 1) && /* @__PURE__ */jsx(motion.div, _objectSpread2(_objectSpread2({}, fade), {}, {
|
|
238
|
-
style: files && files.length > 0 ? {
|
|
239
|
-
marginTop: 8
|
|
240
|
-
} : null,
|
|
241
|
-
children: /* @__PURE__ */jsx(DropZone, {
|
|
242
|
-
loading: loading,
|
|
243
|
-
disabled: disabled,
|
|
244
|
-
onDrop: onDrop,
|
|
245
|
-
edges: edges,
|
|
246
|
-
dropzoneLabel: dropzoneLabel,
|
|
247
|
-
dropzoneDescription: dropzoneDescription,
|
|
248
|
-
dropzoneProps: dropzoneProps,
|
|
249
|
-
compact: files && files.length > 0
|
|
250
|
-
})
|
|
251
|
-
}))]
|
|
252
|
-
}), /* @__PURE__ */jsx(Confirmation, {
|
|
253
|
-
open: confirmDeleteAll,
|
|
254
|
-
onCancel: function onCancel() {
|
|
255
|
-
return setConfirmDeleteAll(false);
|
|
146
|
+
return /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(FormControl, {
|
|
147
|
+
name: name,
|
|
148
|
+
fullWidth: true,
|
|
149
|
+
label: label,
|
|
150
|
+
helperText: helperText,
|
|
151
|
+
helperTextPlacement: helperTextPlacement,
|
|
152
|
+
disabled: disabled,
|
|
153
|
+
required: required,
|
|
154
|
+
showError: showError,
|
|
155
|
+
errorMessage: errorMessage,
|
|
156
|
+
edges: edges
|
|
157
|
+
}, /* @__PURE__ */React.createElement(FormFocus, {
|
|
158
|
+
name: name
|
|
159
|
+
}), files && files.length > 0 && /* @__PURE__ */React.createElement(StyledSavedWrapper, _objectSpread2(_objectSpread2({}, fade), {}, {
|
|
160
|
+
edges: edges
|
|
161
|
+
}), (saving || loading) && /* @__PURE__ */React.createElement(StyledLoader, {
|
|
162
|
+
disableShrink: true
|
|
163
|
+
}), /* @__PURE__ */React.createElement(Grid, {
|
|
164
|
+
container: true,
|
|
165
|
+
alignItems: "center",
|
|
166
|
+
spacing: 5
|
|
167
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
168
|
+
item: true,
|
|
169
|
+
xs: 12
|
|
170
|
+
}, /* @__PURE__ */React.createElement(AnimateSharedLayout, null, files.map(function (file, index) {
|
|
171
|
+
return /* @__PURE__ */React.createElement(AnimatePresence, {
|
|
172
|
+
key: getFileName(file)
|
|
173
|
+
}, /* @__PURE__ */React.createElement(motion.div, {
|
|
174
|
+
positionTransition: true,
|
|
175
|
+
initial: {
|
|
176
|
+
opacity: 0,
|
|
177
|
+
y: 50,
|
|
178
|
+
scale: 0.3
|
|
256
179
|
},
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
onCancel: function onCancel() {
|
|
262
|
-
setConfirmDelete(null);
|
|
263
|
-
setLoading(false);
|
|
180
|
+
animate: {
|
|
181
|
+
opacity: 1,
|
|
182
|
+
y: 0,
|
|
183
|
+
scale: 1
|
|
264
184
|
},
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
return setViewedFile(null);
|
|
185
|
+
exit: {
|
|
186
|
+
opacity: 0,
|
|
187
|
+
scale: 0.5,
|
|
188
|
+
transition: {
|
|
189
|
+
duration: 0.2
|
|
190
|
+
}
|
|
272
191
|
}
|
|
273
|
-
}
|
|
274
|
-
|
|
192
|
+
}, /* @__PURE__ */React.createElement(Alert, {
|
|
193
|
+
severity: showError || fileErrors(file, index) !== null ? "error" : "success",
|
|
194
|
+
style: {
|
|
195
|
+
marginBottom: 5
|
|
196
|
+
},
|
|
197
|
+
action: /* @__PURE__ */React.createElement(React.Fragment, null, fileActions(file, index) !== null && fileActions(file, index), /* @__PURE__ */React.createElement(Button, {
|
|
198
|
+
onClick: function onClick() {
|
|
199
|
+
return setViewedFile(file);
|
|
200
|
+
},
|
|
201
|
+
color: "inherit",
|
|
202
|
+
size: "small",
|
|
203
|
+
variant: "text"
|
|
204
|
+
}, "View"), /* @__PURE__ */React.createElement(Tooltip, {
|
|
205
|
+
title: "Delete",
|
|
206
|
+
enterDelay: 0
|
|
207
|
+
}, /* @__PURE__ */React.createElement("div", null, /* @__PURE__ */React.createElement(IconButton, {
|
|
208
|
+
disabled: saving,
|
|
209
|
+
size: "small",
|
|
210
|
+
"aria-label": "delete",
|
|
211
|
+
style: {
|
|
212
|
+
padding: 0
|
|
213
|
+
},
|
|
214
|
+
onClick: function onClick() {
|
|
215
|
+
return !showError ? handleDeleteConfirmation(index) : handleDeleteWithoutConfirmation(index);
|
|
216
|
+
}
|
|
217
|
+
}, /* @__PURE__ */React.createElement(DeleteIcon, null)))))
|
|
218
|
+
}, /* @__PURE__ */React.createElement(StyledAlertTitle, null, getFileName(file)), fileErrors(file, index))));
|
|
219
|
+
}))))), (!files || files.length === 0 || !dropzoneProps || dropzoneProps.maxFiles === void 0 || dropzoneProps.maxFiles > 1) && /* @__PURE__ */React.createElement(motion.div, _objectSpread2(_objectSpread2({}, fade), {}, {
|
|
220
|
+
style: files && files.length > 0 ? {
|
|
221
|
+
marginTop: 8
|
|
222
|
+
} : null
|
|
223
|
+
}), /* @__PURE__ */React.createElement(DropZone, {
|
|
224
|
+
loading: loading,
|
|
225
|
+
disabled: disabled,
|
|
226
|
+
onDrop: onDrop,
|
|
227
|
+
edges: edges,
|
|
228
|
+
dropzoneLabel: dropzoneLabel,
|
|
229
|
+
dropzoneDescription: dropzoneDescription,
|
|
230
|
+
dropzoneProps: dropzoneProps,
|
|
231
|
+
compact: files && files.length > 0
|
|
232
|
+
}))), /* @__PURE__ */React.createElement(Confirmation, {
|
|
233
|
+
open: confirmDeleteAll,
|
|
234
|
+
onCancel: function onCancel() {
|
|
235
|
+
return setConfirmDeleteAll(false);
|
|
236
|
+
},
|
|
237
|
+
onConfirm: handleDeleteAll,
|
|
238
|
+
message: "Are you sure you want to remove the attached file(s)?"
|
|
239
|
+
}), /* @__PURE__ */React.createElement(Confirmation, {
|
|
240
|
+
open: confirmDelete !== null,
|
|
241
|
+
onCancel: function onCancel() {
|
|
242
|
+
setConfirmDelete(null);
|
|
243
|
+
setLoading(false);
|
|
244
|
+
},
|
|
245
|
+
onConfirm: handleDelete,
|
|
246
|
+
message: "Are you sure you want to remove the attached file?"
|
|
247
|
+
}), /* @__PURE__ */React.createElement(FileViewer, {
|
|
248
|
+
file: viewedFile,
|
|
249
|
+
open: viewedFile !== null,
|
|
250
|
+
onClose: function onClose() {
|
|
251
|
+
return setViewedFile(null);
|
|
252
|
+
}
|
|
253
|
+
}));
|
|
275
254
|
}
|
|
276
255
|
FileUpload.propTypes = {
|
|
277
256
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, toConsumableArray as _toConsumableArray, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
-
import {
|
|
4
|
-
import { useState, useCallback } from 'react';
|
|
3
|
+
import React, { useState, useCallback } from 'react';
|
|
5
4
|
import PropTypes from 'prop-types';
|
|
6
5
|
import { useDropzone } from 'react-dropzone';
|
|
7
6
|
import Button from './Button.js';
|
|
@@ -87,19 +86,15 @@ function FileUploadButton(_ref) {
|
|
|
87
86
|
}),
|
|
88
87
|
getRootProps = _useDropzone.getRootProps,
|
|
89
88
|
getInputProps = _useDropzone.getInputProps;
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}, rest), {}, {
|
|
100
|
-
children: [/* @__PURE__ */jsx("input", _objectSpread2({}, getInputProps())), children]
|
|
101
|
-
}))
|
|
102
|
-
}));
|
|
89
|
+
return /* @__PURE__ */React.createElement("span", _objectSpread2({}, getRootProps()), /* @__PURE__ */React.createElement(Button, _objectSpread2({
|
|
90
|
+
loading: true,
|
|
91
|
+
disabled: disabled,
|
|
92
|
+
pending: pending,
|
|
93
|
+
pendingIndicator: /* @__PURE__ */React.createElement(FileUploadButtonLoader, {
|
|
94
|
+
accepted: accepted,
|
|
95
|
+
rejected: rejected
|
|
96
|
+
})
|
|
97
|
+
}, rest), /* @__PURE__ */React.createElement("input", _objectSpread2({}, getInputProps())), children));
|
|
103
98
|
}
|
|
104
99
|
FileUploadButton.propTypes = {
|
|
105
100
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
import 'react';
|
|
2
|
+
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import CheckIcon from '@mui/icons-material/Check';
|
|
6
5
|
import WarningIcon from '@mui/icons-material/Warning';
|
|
@@ -12,18 +11,18 @@ function FileUploadButtonLoader(_ref) {
|
|
|
12
11
|
_ref$rejected = _ref.rejected,
|
|
13
12
|
rejected = _ref$rejected === void 0 ? false : _ref$rejected;
|
|
14
13
|
if (accepted) {
|
|
15
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */React.createElement(CheckIcon, {
|
|
16
15
|
color: "inherit",
|
|
17
16
|
size: 16
|
|
18
17
|
});
|
|
19
18
|
}
|
|
20
19
|
if (rejected) {
|
|
21
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */React.createElement(WarningIcon, {
|
|
22
21
|
color: "inherit",
|
|
23
22
|
size: 16
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */React.createElement(CircularProgress, {
|
|
27
26
|
color: "inherit",
|
|
28
27
|
size: 16
|
|
29
28
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
import 'react';
|
|
2
|
+
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import mime from 'mime/lite';
|
|
6
5
|
import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
|
|
@@ -56,75 +55,57 @@ function FileViewer(_ref) {
|
|
|
56
55
|
_ref$open = _ref.open,
|
|
57
56
|
open = _ref$open === void 0 ? false : _ref$open,
|
|
58
57
|
onClose = _ref.onClose;
|
|
59
|
-
return /* @__PURE__ */
|
|
58
|
+
return /* @__PURE__ */React.createElement(Modal, {
|
|
60
59
|
open: open && file !== null,
|
|
61
60
|
onClose: onClose,
|
|
62
|
-
fullWidth: true
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
110
|
-
as: "a",
|
|
111
|
-
download: true,
|
|
112
|
-
color: "primary",
|
|
113
|
-
size: "large",
|
|
114
|
-
children: "Download"
|
|
115
|
-
})
|
|
116
|
-
})]
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
return /* @__PURE__ */jsx(Embed, {
|
|
120
|
-
src: file.url.startsWith("data") || file.url.includes(".pdf") ? file.url : "https://docs.google.com/gview?url=".concat(file.url, "&embedded=true"),
|
|
121
|
-
height: "85%"
|
|
122
|
-
});
|
|
123
|
-
}()
|
|
124
|
-
})
|
|
125
|
-
})]
|
|
126
|
-
})
|
|
127
|
-
});
|
|
61
|
+
fullWidth: true
|
|
62
|
+
}, file !== null && open && /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(ModalHeader, {
|
|
63
|
+
onClose: onClose
|
|
64
|
+
}, /* @__PURE__ */React.createElement(Heading, {
|
|
65
|
+
as: "h5"
|
|
66
|
+
}, heading || getFileName(file))), /* @__PURE__ */React.createElement(ModalContent, null, /* @__PURE__ */React.createElement(StyledFilePreviewAreaOuter, null, function () {
|
|
67
|
+
if (isImage(file)) {
|
|
68
|
+
return /* @__PURE__ */React.createElement(Box, {
|
|
69
|
+
display: "flex",
|
|
70
|
+
justifyContent: "center",
|
|
71
|
+
width: "100%"
|
|
72
|
+
}, /* @__PURE__ */React.createElement("img", {
|
|
73
|
+
src: file.url,
|
|
74
|
+
alt: getFileName(file),
|
|
75
|
+
style: {
|
|
76
|
+
maxWidth: "100%"
|
|
77
|
+
}
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
if (file && isString(file.url) && file.url.startsWith("data") && getFileExtension(file) !== "pdf" || getFileExtension(file) === "unsupported") {
|
|
81
|
+
return /* @__PURE__ */React.createElement(Grid, {
|
|
82
|
+
container: true,
|
|
83
|
+
spacing: 5,
|
|
84
|
+
direction: "column",
|
|
85
|
+
alignItems: "center",
|
|
86
|
+
justify: "center"
|
|
87
|
+
}, /* @__PURE__ */React.createElement(Grid, {
|
|
88
|
+
item: true
|
|
89
|
+
}, /* @__PURE__ */React.createElement(StyledBrokenFileIcon, null, /* @__PURE__ */React.createElement(ErrorOutlineIcon, null))), /* @__PURE__ */React.createElement(Grid, {
|
|
90
|
+
item: true
|
|
91
|
+
}, /* @__PURE__ */React.createElement(Heading, {
|
|
92
|
+
as: "h5",
|
|
93
|
+
transform: "uppercase"
|
|
94
|
+
}, "Preview unavailable")), /* @__PURE__ */React.createElement(Grid, {
|
|
95
|
+
item: true
|
|
96
|
+
}, /* @__PURE__ */React.createElement(Button, {
|
|
97
|
+
href: file.url,
|
|
98
|
+
as: "a",
|
|
99
|
+
download: true,
|
|
100
|
+
color: "primary",
|
|
101
|
+
size: "large"
|
|
102
|
+
}, "Download")));
|
|
103
|
+
}
|
|
104
|
+
return /* @__PURE__ */React.createElement(Embed, {
|
|
105
|
+
src: file.url.startsWith("data") || file.url.includes(".pdf") ? file.url : "https://docs.google.com/gview?url=".concat(file.url, "&embedded=true"),
|
|
106
|
+
height: "85%"
|
|
107
|
+
});
|
|
108
|
+
}()))));
|
|
128
109
|
}
|
|
129
110
|
FileViewer.propTypes = {
|
|
130
111
|
file: PropTypes.shape({
|
|
@@ -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 Snackbar from '@mui/material/Snackbar';
|
|
7
6
|
import Alert from './Alert.js';
|
|
@@ -24,7 +23,7 @@ function FlashMessage(_ref) {
|
|
|
24
23
|
var handleClose = function handleClose() {
|
|
25
24
|
onClose();
|
|
26
25
|
};
|
|
27
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */React.createElement(Snackbar, _objectSpread2({
|
|
28
27
|
anchorOrigin: {
|
|
29
28
|
vertical: vertical,
|
|
30
29
|
horizontal: horizontal
|
|
@@ -33,14 +32,11 @@ function FlashMessage(_ref) {
|
|
|
33
32
|
open: open,
|
|
34
33
|
onClose: handleClose,
|
|
35
34
|
message: "This is a text snack message"
|
|
36
|
-
}, rest),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
children: children
|
|
42
|
-
})
|
|
43
|
-
}));
|
|
35
|
+
}, rest), /* @__PURE__ */React.createElement(Alert, {
|
|
36
|
+
color: color,
|
|
37
|
+
onClose: handleClose,
|
|
38
|
+
elevation: 7
|
|
39
|
+
}, children));
|
|
44
40
|
}
|
|
45
41
|
FlashMessage.propTypes = {
|
|
46
42
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
5
4
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
6
5
|
import FormHelperText from '@mui/material/FormHelperText';
|
|
@@ -41,56 +40,50 @@ var FormControl = /*#__PURE__*/forwardRef(function FormControl2(_ref, ref) {
|
|
|
41
40
|
$required: required
|
|
42
41
|
};
|
|
43
42
|
var statusMessage = errorMessage || message;
|
|
44
|
-
return /** @ts-ignore */ /* @__PURE__ */
|
|
45
|
-
ref: ref
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
height: "auto"
|
|
62
|
-
},
|
|
63
|
-
collapsed: {
|
|
64
|
-
opacity: 0,
|
|
65
|
-
height: 0
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
transition: {
|
|
69
|
-
delay: 0.15,
|
|
70
|
-
duration: 0.3,
|
|
71
|
-
ease: [0.04, 0.62, 0.23, 0.98]
|
|
72
|
-
},
|
|
73
|
-
children: !!statusMessage && /* @__PURE__ */jsx(StatusMessage, {
|
|
74
|
-
color: props.color === "default" ? "info" : props.color,
|
|
75
|
-
children: statusMessage
|
|
76
|
-
})
|
|
77
|
-
}, "".concat(id, "_message"))
|
|
78
|
-
}), !!helperText && /* @__PURE__ */jsx(FormHelperText, {
|
|
79
|
-
sx: {
|
|
80
|
-
color: "text.primary",
|
|
81
|
-
fontSize: function fontSize(theme) {
|
|
82
|
-
if (size === "medium") {
|
|
83
|
-
return "".concat(theme.typography.fontSize, "px");
|
|
84
|
-
}
|
|
85
|
-
return null;
|
|
86
|
-
},
|
|
87
|
-
padding: 0,
|
|
88
|
-
margin: 0,
|
|
89
|
-
mt: statusMessage ? 0 : "8px"
|
|
43
|
+
return /** @ts-ignore */ /* @__PURE__ */React.createElement(StyledFormControl, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
44
|
+
ref: ref
|
|
45
|
+
}), !!label && isString(label) ? /* @__PURE__ */React.createElement(FormLabel, {
|
|
46
|
+
disabled: disabled,
|
|
47
|
+
htmlFor: id,
|
|
48
|
+
required: required,
|
|
49
|
+
size: size
|
|
50
|
+
}, label) : label, children, /* @__PURE__ */React.createElement(AnimatePresence, null, /* @__PURE__ */React.createElement(motion.div, {
|
|
51
|
+
layout: true,
|
|
52
|
+
key: "".concat(id, "_message"),
|
|
53
|
+
initial: "collapsed",
|
|
54
|
+
animate: "open",
|
|
55
|
+
exit: "collapsed",
|
|
56
|
+
variants: {
|
|
57
|
+
open: {
|
|
58
|
+
opacity: 1,
|
|
59
|
+
height: "auto"
|
|
90
60
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
61
|
+
collapsed: {
|
|
62
|
+
opacity: 0,
|
|
63
|
+
height: 0
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
transition: {
|
|
67
|
+
delay: 0.15,
|
|
68
|
+
duration: 0.3,
|
|
69
|
+
ease: [0.04, 0.62, 0.23, 0.98]
|
|
70
|
+
}
|
|
71
|
+
}, !!statusMessage && /* @__PURE__ */React.createElement(StatusMessage, {
|
|
72
|
+
color: props.color === "default" ? "info" : props.color
|
|
73
|
+
}, statusMessage))), !!helperText && /* @__PURE__ */React.createElement(FormHelperText, {
|
|
74
|
+
sx: {
|
|
75
|
+
color: "text.primary",
|
|
76
|
+
fontSize: function fontSize(theme) {
|
|
77
|
+
if (size === "medium") {
|
|
78
|
+
return "".concat(theme.typography.fontSize, "px");
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
},
|
|
82
|
+
padding: 0,
|
|
83
|
+
margin: 0,
|
|
84
|
+
mt: statusMessage ? 0 : "8px"
|
|
85
|
+
}
|
|
86
|
+
}, helperText));
|
|
94
87
|
});
|
|
95
88
|
|
|
96
89
|
export { FormControl as default };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
import 'react';
|
|
2
|
+
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
|
|
6
5
|
function FormFocus(_ref) {
|
|
7
6
|
var name = _ref.name;
|
|
8
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */React.createElement("input", {
|
|
9
8
|
name: name,
|
|
10
9
|
style: {
|
|
11
10
|
appearance: "none",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
3
|
import StyledFormLabel from './FormLabel.styled.js';
|
|
5
4
|
|
|
6
5
|
var _excluded = ["children", "disabled", "margin", "required"];
|
|
@@ -18,9 +17,7 @@ function FormLabel(_ref) {
|
|
|
18
17
|
margin: margin,
|
|
19
18
|
required: required
|
|
20
19
|
};
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
children: children
|
|
23
|
-
}));
|
|
20
|
+
return /* @__PURE__ */React.createElement(StyledFormLabel, _objectSpread2(_objectSpread2({}, rest), props), children);
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
export { FormLabel as default };
|