@onehat/ui 0.4.34 → 0.4.37
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/package.json +1 -1
- package/src/Components/Editor/Editor.js +3 -1
- package/src/Components/Form/Field/Combo/Combo.js +5 -1
- package/src/Components/Form/Field/Tag/Tag.js +1 -0
- package/src/Components/Form/Form.js +37 -32
- package/src/Components/Grid/Grid.js +3 -2
- package/src/Components/Grid/GridRow.js +1 -1
- package/src/Components/Hoc/Secondary/withSecondaryEditor.js +51 -19
- package/src/Components/Hoc/Secondary/withSecondarySelection.js +29 -23
- package/src/Components/Hoc/withEditor.js +6 -1
- package/src/Components/Hoc/withModal.js +5 -5
- package/src/Components/Hoc/withPdfButtons.js +0 -1
- package/src/Components/Hoc/withSelection.js +4 -3
- package/src/Components/Report/Report.js +2 -3
- package/src/Components/Viewer/Viewer.js +6 -1
- package/src/Functions/Cypress/dom_functions.js +20 -2
- package/src/Functions/Cypress/form_functions.js +178 -172
- package/src/Functions/Cypress/grid_functions.js +18 -9
- package/src/Functions/buildAdditionalButtons.js +0 -1
- package/src/PlatformImports/Web/Attachments.js +22 -15
|
@@ -45,17 +45,16 @@ function FileCardCustom(props) {
|
|
|
45
45
|
uploadStatus,
|
|
46
46
|
} = props,
|
|
47
47
|
isDownloading = uploadStatus && inArray(uploadStatus, ['preparing', 'uploading', 'success']);
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
);
|
|
48
|
+
return <Pressable
|
|
49
|
+
onPress={() => {
|
|
50
|
+
downloadInBackground(downloadUrl);
|
|
51
|
+
}}
|
|
52
|
+
className="px-3 py-1 items-center flex-row rounded-[5px] border border-primary.700"
|
|
53
|
+
>
|
|
54
|
+
{isDownloading && <Spinner className="mr-2" />}
|
|
55
|
+
<Text>{filename}</Text>
|
|
56
|
+
{onDelete && <IconButton ml={1} icon={Xmark} onPress={() => onDelete(id)} />}
|
|
57
|
+
</Pressable>;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
|
|
@@ -183,8 +182,9 @@ function AttachmentsElement(props) {
|
|
|
183
182
|
}
|
|
184
183
|
},
|
|
185
184
|
onFileDelete = (id) => {
|
|
185
|
+
const file = _.find(files, { id });
|
|
186
186
|
if (confirmBeforeDelete) {
|
|
187
|
-
confirm('Are you sure you want to delete the file?', () => doDelete(id));
|
|
187
|
+
confirm('Are you sure you want to delete the file "' + file.name + '"?', () => doDelete(id));
|
|
188
188
|
} else {
|
|
189
189
|
doDelete(id);
|
|
190
190
|
}
|
|
@@ -282,12 +282,19 @@ function AttachmentsElement(props) {
|
|
|
282
282
|
if (canCrud) {
|
|
283
283
|
_fileMosaic.onDelete = onFileDelete;
|
|
284
284
|
}
|
|
285
|
-
let className =
|
|
285
|
+
let className = `
|
|
286
|
+
AttachmentsElement
|
|
287
|
+
w-full
|
|
288
|
+
h-full
|
|
289
|
+
p-1
|
|
290
|
+
rounded-[5px]
|
|
291
|
+
`;
|
|
286
292
|
if (props.className) {
|
|
287
293
|
className += ' ' + props.className;
|
|
288
294
|
}
|
|
289
295
|
let content = <VStack className={className}>
|
|
290
|
-
<HStack className="flex-wrap">
|
|
296
|
+
<HStack className="AttachmentsElement-HStack flex-wrap">
|
|
297
|
+
{files.length === 0 && <Text className="text-grey-600 italic">No files</Text>}
|
|
291
298
|
{files.map((file) => {
|
|
292
299
|
return <Box
|
|
293
300
|
key={file.id}
|
|
@@ -312,7 +319,7 @@ function AttachmentsElement(props) {
|
|
|
312
319
|
{Repository.total <= collapsedMax ? null :
|
|
313
320
|
<Button
|
|
314
321
|
onPress={toggleShowAll}
|
|
315
|
-
className="mt-2"
|
|
322
|
+
className="AttachmentsElement-toggleShowAll mt-2"
|
|
316
323
|
text={'Show ' + (showAll ? ' Less' : ' All ' + Repository.total)}
|
|
317
324
|
_text={{
|
|
318
325
|
className: `
|