tycho-components 0.15.9 → 0.15.11
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/AppDropzone/AppDropzone.d.ts +2 -1
- package/dist/AppDropzone/AppDropzone.js +2 -2
- package/dist/AppDropzone/AppDropzoneBody.d.ts +2 -0
- package/dist/AppDropzone/AppDropzoneBody.js +2 -2
- package/dist/AppDropzone/style.scss +0 -1
- package/dist/configs/Localization.d.ts +192 -174
- package/dist/configs/localization/CommonTexts.d.ts +193 -175
- package/dist/configs/localization/CommonTexts.js +193 -175
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ type Props = {
|
|
|
12
12
|
title: string;
|
|
13
13
|
action: () => void;
|
|
14
14
|
};
|
|
15
|
+
disableConfirm?: boolean;
|
|
15
16
|
};
|
|
16
|
-
export default function AppDropzone({ folder, onClose, onSuccess, onError, accept, onDrop, keepName, title, alternativeButton, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default function AppDropzone({ folder, onClose, onSuccess, onError, accept, onDrop, keepName, title, alternativeButton, disableConfirm, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -3,11 +3,11 @@ import { useRef } from 'react';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import AppModal from '../AppModal';
|
|
5
5
|
import AppDropzoneBody from './AppDropzoneBody';
|
|
6
|
-
export default function AppDropzone({ folder, onClose, onSuccess, onError, accept, onDrop, keepName, title, alternativeButton, }) {
|
|
6
|
+
export default function AppDropzone({ folder, onClose, onSuccess, onError, accept, onDrop, keepName, title, alternativeButton, disableConfirm = false, }) {
|
|
7
7
|
const { t } = useTranslation('upload');
|
|
8
8
|
const bodyRef = useRef(null);
|
|
9
9
|
const handleConfirm = () => {
|
|
10
10
|
bodyRef.current?.upload();
|
|
11
11
|
};
|
|
12
|
-
return (_jsx(AppModal, { title: title || t('modal.title'), className: "modal-upload", close: onClose, confirm: handleConfirm, alternativeButton: alternativeButton, children: _jsx(AppDropzoneBody, { ref: bodyRef, folder: folder, onSuccess: onSuccess, onError: onError, accept: accept, onDrop: onDrop, keepName: keepName, showConfirmButton: false }) }));
|
|
12
|
+
return (_jsx(AppModal, { title: title || t('modal.title'), className: "modal-upload", close: onClose, confirm: handleConfirm, disableConfirm: disableConfirm, alternativeButton: alternativeButton, children: _jsx(AppDropzoneBody, { ref: bodyRef, folder: folder, onSuccess: onSuccess, onError: onError, accept: accept, onDrop: onDrop, keepName: keepName, showConfirmButton: false }) }));
|
|
13
13
|
}
|
|
@@ -11,6 +11,8 @@ export type AppDropzoneBodyProps = {
|
|
|
11
11
|
showConfirmButton?: boolean;
|
|
12
12
|
/** When true, image preview is not rendered and filename message is shown instead */
|
|
13
13
|
disablePreview?: boolean;
|
|
14
|
+
/** When true, confirm button is visible but disabled */
|
|
15
|
+
disableConfirm?: boolean;
|
|
14
16
|
};
|
|
15
17
|
export type AppDropzoneBodyRef = {
|
|
16
18
|
upload: () => Promise<void>;
|
|
@@ -8,7 +8,7 @@ import { toastLoading } from '../configs/store/actions';
|
|
|
8
8
|
import { useMessageUtils } from '../configs/useMessageUtils';
|
|
9
9
|
import UploadService from './UploadService';
|
|
10
10
|
import './style.scss';
|
|
11
|
-
function AppDropzoneBodyInner({ folder, onSuccess, onError, accept, onDrop, keepName, showConfirmButton = true, disablePreview = false, }, ref) {
|
|
11
|
+
function AppDropzoneBodyInner({ folder, onSuccess, onError, accept, onDrop, keepName, showConfirmButton = true, disablePreview = false, disableConfirm = false, }, ref) {
|
|
12
12
|
const { t } = useTranslation('upload');
|
|
13
13
|
const { state, dispatch } = useContext(CommonContext);
|
|
14
14
|
const { dispatchError } = useMessageUtils();
|
|
@@ -64,7 +64,7 @@ function AppDropzoneBodyInner({ folder, onSuccess, onError, accept, onDrop, keep
|
|
|
64
64
|
const handleCancel = () => {
|
|
65
65
|
setFile(undefined);
|
|
66
66
|
};
|
|
67
|
-
return (_jsxs("div", { className: "dropzone-container", children: [!file && (_jsx(Dropzone, { onDrop: (acceptedFiles) => handleDrop(acceptedFiles), accept: accept, maxFiles: 1, children: ({ getRootProps, getInputProps }) => (_jsxs("div", { ...getRootProps(), className: "dropzone", children: [_jsx("input", { ...getInputProps() }), _jsx("span", { children: t('label.dropzone') })] })) })), file && (_jsxs("div", { className: "uploaded-file", children: [preview && _jsx("img", { className: "preview", src: preview, alt: "" }), !preview && (_jsxs(_Fragment, { children: [_jsx("b", { children: t('label.uploaded.file') }), _jsx("span", { children: file.name })] })), showConfirmButton && (_jsxs("div", { className: "buttons", children: [_jsx(Button, { onClick: handleCancel, text: t('common:button.cancel'), size: "small", mode: "outlined", color: "danger" }), _jsx(Button, { onClick: upload, text: t('label.confirm'), size: "small", mode: "outlined" })] }))] }))] }));
|
|
67
|
+
return (_jsxs("div", { className: "dropzone-container", children: [!file && (_jsx(Dropzone, { onDrop: (acceptedFiles) => handleDrop(acceptedFiles), accept: accept, maxFiles: 1, children: ({ getRootProps, getInputProps }) => (_jsxs("div", { ...getRootProps(), className: "dropzone", children: [_jsx("input", { ...getInputProps() }), _jsx("span", { children: t('label.dropzone') })] })) })), file && (_jsxs("div", { className: "uploaded-file", children: [preview && _jsx("img", { className: "preview", src: preview, alt: "" }), !preview && (_jsxs(_Fragment, { children: [_jsx("b", { children: t('label.uploaded.file') }), _jsx("span", { children: file.name })] })), showConfirmButton && (_jsxs("div", { className: "buttons", children: [_jsx(Button, { onClick: handleCancel, text: t('common:button.cancel'), size: "small", mode: "outlined", color: "danger" }), _jsx(Button, { onClick: upload, text: t('label.confirm'), size: "small", mode: "outlined", disabled: disableConfirm })] }))] }))] }));
|
|
68
68
|
}
|
|
69
69
|
const AppDropzoneBody = forwardRef(AppDropzoneBodyInner);
|
|
70
70
|
export default AppDropzoneBody;
|
|
@@ -46,64 +46,70 @@ export declare const commonResources: {
|
|
|
46
46
|
'label.edited': string;
|
|
47
47
|
};
|
|
48
48
|
common: {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
49
|
+
"button.confirm": string;
|
|
50
|
+
"button.continue": string;
|
|
51
|
+
"button.cancel": string;
|
|
52
|
+
"button.remove": string;
|
|
53
|
+
"button.save": string;
|
|
54
|
+
"button.clone": string;
|
|
55
|
+
"button.apply": string;
|
|
56
|
+
"button.search": string;
|
|
57
|
+
"button.edit": string;
|
|
58
|
+
"button.open": string;
|
|
59
|
+
"button.close": string;
|
|
60
|
+
"button.add": string;
|
|
61
|
+
"button.filter": string;
|
|
62
|
+
"button.clear": string;
|
|
63
|
+
"button.play": string;
|
|
64
|
+
"button.pause": string;
|
|
65
|
+
"label.public": string;
|
|
66
|
+
"label.private": string;
|
|
67
|
+
"label.notavailable": string;
|
|
68
|
+
"generic.boolean.true": string;
|
|
69
|
+
"generic.boolean.false": string;
|
|
70
|
+
"select.empty": string;
|
|
71
|
+
"pagination.label.showing": string;
|
|
72
|
+
"pagination.label.results": string;
|
|
73
|
+
"pagination.label.total": string;
|
|
74
|
+
"generic.loading": string;
|
|
75
|
+
"generic.placeholder": string;
|
|
76
|
+
"generic.placeholder.comma.separated": string;
|
|
77
|
+
"generic.placeholder.select": string;
|
|
78
|
+
"validation.required": string;
|
|
79
|
+
"placeholder.check": string;
|
|
80
|
+
"placeholder.input": string;
|
|
81
|
+
"user.status.active": string;
|
|
82
|
+
"user.status.inactive": string;
|
|
83
|
+
"user.status.super": string;
|
|
84
|
+
"user.status.visitor": string;
|
|
85
|
+
"update.success": string;
|
|
86
|
+
"internal.server.error": string;
|
|
87
|
+
"table.label.rows-page": string;
|
|
88
|
+
"table.label.pages": string;
|
|
89
|
+
"table.label.items": string;
|
|
90
|
+
"tooltip.copy": string;
|
|
91
|
+
"tooltip.copied": string;
|
|
92
|
+
"document.status.deleted": string;
|
|
93
|
+
"document.status.editing": string;
|
|
94
|
+
"document.status.edited": string;
|
|
95
|
+
"document.status.revision": string;
|
|
96
|
+
"document.status.completed": string;
|
|
97
|
+
"document.status.syntactic": string;
|
|
98
|
+
"document.status.copying": string;
|
|
99
|
+
"document.status.error": string;
|
|
100
|
+
"sentence.status.todo": string;
|
|
101
|
+
"sentence.status.done": string;
|
|
102
|
+
"sentence.status.ignore": string;
|
|
103
|
+
"sentence.status.tagged": string;
|
|
104
|
+
"sentence.status.review": string;
|
|
105
|
+
"sentence.status.error": string;
|
|
106
|
+
"sentence.status.auto": string;
|
|
107
|
+
"corpus.status.active": string;
|
|
108
|
+
"corpus.status.inactive": string;
|
|
109
|
+
"corpus.status.archived": string;
|
|
110
|
+
"corpus.status.demo": string;
|
|
111
|
+
"corpus.status.pending": string;
|
|
112
|
+
"corpus.status.rejected": string;
|
|
107
113
|
};
|
|
108
114
|
header: {
|
|
109
115
|
"label.platform": string;
|
|
@@ -357,64 +363,70 @@ export declare const commonResources: {
|
|
|
357
363
|
'label.edited': string;
|
|
358
364
|
};
|
|
359
365
|
common: {
|
|
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
|
-
|
|
366
|
+
"button.confirm": string;
|
|
367
|
+
"button.continue": string;
|
|
368
|
+
"button.cancel": string;
|
|
369
|
+
"button.remove": string;
|
|
370
|
+
"button.save": string;
|
|
371
|
+
"button.clone": string;
|
|
372
|
+
"button.apply": string;
|
|
373
|
+
"button.search": string;
|
|
374
|
+
"button.edit": string;
|
|
375
|
+
"button.open": string;
|
|
376
|
+
"button.add": string;
|
|
377
|
+
"button.close": string;
|
|
378
|
+
"button.filter": string;
|
|
379
|
+
"button.clear": string;
|
|
380
|
+
"button.play": string;
|
|
381
|
+
"button.pause": string;
|
|
382
|
+
"label.public": string;
|
|
383
|
+
"label.private": string;
|
|
384
|
+
"label.notavailable": string;
|
|
385
|
+
"generic.boolean.true": string;
|
|
386
|
+
"generic.boolean.false": string;
|
|
387
|
+
"select.empty": string;
|
|
388
|
+
"pagination.label.showing": string;
|
|
389
|
+
"pagination.label.results": string;
|
|
390
|
+
"pagination.label.total": string;
|
|
391
|
+
"generic.loading": string;
|
|
392
|
+
"generic.placeholder": string;
|
|
393
|
+
"generic.placeholder.select": string;
|
|
394
|
+
"generic.placeholder.comma.separated": string;
|
|
395
|
+
"validation.required": string;
|
|
396
|
+
"placeholder.check": string;
|
|
397
|
+
"placeholder.input": string;
|
|
398
|
+
"user.status.active": string;
|
|
399
|
+
"user.status.inactive": string;
|
|
400
|
+
"user.status.super": string;
|
|
401
|
+
"user.status.visitor": string;
|
|
402
|
+
"update.success": string;
|
|
403
|
+
"internal.server.error": string;
|
|
404
|
+
"table.label.rows-page": string;
|
|
405
|
+
"table.label.pages": string;
|
|
406
|
+
"table.label.items": string;
|
|
407
|
+
"tooltip.copy": string;
|
|
408
|
+
"tooltip.copied": string;
|
|
409
|
+
"document.status.deleted": string;
|
|
410
|
+
"document.status.editing": string;
|
|
411
|
+
"document.status.edited": string;
|
|
412
|
+
"document.status.revision": string;
|
|
413
|
+
"document.status.completed": string;
|
|
414
|
+
"document.status.syntactic": string;
|
|
415
|
+
"document.status.copying": string;
|
|
416
|
+
"document.status.error": string;
|
|
417
|
+
"sentence.status.todo": string;
|
|
418
|
+
"sentence.status.done": string;
|
|
419
|
+
"sentence.status.ignore": string;
|
|
420
|
+
"sentence.status.tagged": string;
|
|
421
|
+
"sentence.status.review": string;
|
|
422
|
+
"sentence.status.error": string;
|
|
423
|
+
"sentence.status.auto": string;
|
|
424
|
+
"corpus.status.active": string;
|
|
425
|
+
"corpus.status.inactive": string;
|
|
426
|
+
"corpus.status.archived": string;
|
|
427
|
+
"corpus.status.demo": string;
|
|
428
|
+
"corpus.status.pending": string;
|
|
429
|
+
"corpus.status.rejected": string;
|
|
418
430
|
};
|
|
419
431
|
header: {
|
|
420
432
|
"label.platform": string;
|
|
@@ -665,64 +677,70 @@ export declare const commonResources: {
|
|
|
665
677
|
'label.edited': string;
|
|
666
678
|
};
|
|
667
679
|
common: {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
680
|
+
"button.confirm": string;
|
|
681
|
+
"button.continue": string;
|
|
682
|
+
"button.cancel": string;
|
|
683
|
+
"button.remove": string;
|
|
684
|
+
"button.save": string;
|
|
685
|
+
"button.clone": string;
|
|
686
|
+
"button.search": string;
|
|
687
|
+
"button.edit": string;
|
|
688
|
+
"button.open": string;
|
|
689
|
+
"button.apply": string;
|
|
690
|
+
"button.add": string;
|
|
691
|
+
"button.close": string;
|
|
692
|
+
"button.filter": string;
|
|
693
|
+
"button.clear": string;
|
|
694
|
+
"button.play": string;
|
|
695
|
+
"button.pause": string;
|
|
696
|
+
"label.public": string;
|
|
697
|
+
"label.private": string;
|
|
698
|
+
"label.notavailable": string;
|
|
699
|
+
"generic.boolean.true": string;
|
|
700
|
+
"generic.boolean.false": string;
|
|
701
|
+
"select.empty": string;
|
|
702
|
+
"pagination.label.showing": string;
|
|
703
|
+
"pagination.label.results": string;
|
|
704
|
+
"pagination.label.total": string;
|
|
705
|
+
"generic.loading": string;
|
|
706
|
+
"generic.placeholder": string;
|
|
707
|
+
"generic.placeholder.select": string;
|
|
708
|
+
"generic.placeholder.comma.separated": string;
|
|
709
|
+
"validation.required": string;
|
|
710
|
+
"placeholder.check": string;
|
|
711
|
+
"placeholder.input": string;
|
|
712
|
+
"user.status.active": string;
|
|
713
|
+
"user.status.inactive": string;
|
|
714
|
+
"user.status.super": string;
|
|
715
|
+
"user.status.visitor": string;
|
|
716
|
+
"update.success": string;
|
|
717
|
+
"internal.server.error": string;
|
|
718
|
+
"table.label.rows-page": string;
|
|
719
|
+
"table.label.pages": string;
|
|
720
|
+
"table.label.items": string;
|
|
721
|
+
"tooltip.copy": string;
|
|
722
|
+
"tooltip.copied": string;
|
|
723
|
+
"document.status.deleted": string;
|
|
724
|
+
"document.status.editing": string;
|
|
725
|
+
"document.status.edited": string;
|
|
726
|
+
"document.status.revision": string;
|
|
727
|
+
"document.status.completed": string;
|
|
728
|
+
"document.status.syntactic": string;
|
|
729
|
+
"document.status.copying": string;
|
|
730
|
+
"document.status.error": string;
|
|
731
|
+
"sentence.status.todo": string;
|
|
732
|
+
"sentence.status.done": string;
|
|
733
|
+
"sentence.status.ignore": string;
|
|
734
|
+
"sentence.status.tagged": string;
|
|
735
|
+
"sentence.status.review": string;
|
|
736
|
+
"sentence.status.error": string;
|
|
737
|
+
"sentence.status.auto": string;
|
|
738
|
+
"corpus.status.active": string;
|
|
739
|
+
"corpus.status.inactive": string;
|
|
740
|
+
"corpus.status.archived": string;
|
|
741
|
+
"corpus.status.demo": string;
|
|
742
|
+
"corpus.status.pending": string;
|
|
743
|
+
"corpus.status.rejected": string;
|
|
726
744
|
};
|
|
727
745
|
header: {
|
|
728
746
|
"label.platform": string;
|