@synerise/ds-file-uploader 1.3.9 → 1.3.10
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/CHANGELOG.md +4 -0
- package/dist/AvatarUploader/AvatarUploader.d.ts +7 -8
- package/dist/AvatarUploader/AvatarUploader.js +78 -124
- package/dist/AvatarUploader/AvatarUploader.styles.d.ts +26 -27
- package/dist/AvatarUploader/AvatarUploader.styles.js +54 -70
- package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.const.d.ts +1 -2
- package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.const.js +14 -10
- package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.d.ts +2 -3
- package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.js +49 -90
- package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.styles.d.ts +16 -17
- package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.styles.js +69 -91
- package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.types.d.ts +2 -3
- package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.types.js +1 -1
- package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.util.d.ts +1 -2
- package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.util.js +6 -3
- package/dist/FileUploader.d.ts +6 -7
- package/dist/FileUploader.js +91 -146
- package/dist/FileUploader.styles.d.ts +26 -27
- package/dist/FileUploader.styles.js +58 -78
- package/dist/FileUploader.types.d.ts +2 -3
- package/dist/FileUploader.types.js +1 -1
- package/dist/FileView/FileView.const.d.ts +1 -2
- package/dist/FileView/FileView.const.js +24 -19
- package/dist/FileView/FileView.d.ts +2 -3
- package/dist/FileView/FileView.js +72 -138
- package/dist/FileView/FileView.styles.d.ts +17 -18
- package/dist/FileView/FileView.styles.js +65 -83
- package/dist/FileView/FileView.types.d.ts +2 -3
- package/dist/FileView/FileView.types.js +1 -1
- package/dist/ItemUploader/ItemUploader.d.ts +3 -4
- package/dist/ItemUploader/ItemUploader.js +73 -104
- package/dist/ItemUploader/ItemUploader.styles.d.ts +26 -27
- package/dist/ItemUploader/ItemUploader.styles.js +53 -71
- package/dist/ItemUploader/ItemUploader.types.d.ts +0 -1
- package/dist/ItemUploader/ItemUploader.types.js +1 -1
- package/dist/ItemUploader/UploaderButton/FileViewItem.const.d.ts +0 -1
- package/dist/ItemUploader/UploaderButton/FileViewItem.const.js +16 -11
- package/dist/ItemUploader/UploaderButton/FileViewItem.d.ts +2 -3
- package/dist/ItemUploader/UploaderButton/FileViewItem.js +38 -67
- package/dist/ItemUploader/UploaderButton/FileViewItem.styles.d.ts +12 -13
- package/dist/ItemUploader/UploaderButton/FileViewItem.styles.js +55 -74
- package/dist/index.d.ts +0 -1
- package/dist/index.js +19 -13
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +12 -12
- package/dist/AvatarUploader/AvatarUploader.d.ts.map +0 -1
- package/dist/AvatarUploader/AvatarUploader.styles.d.ts.map +0 -1
- package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.const.d.ts.map +0 -1
- package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.d.ts.map +0 -1
- package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.styles.d.ts.map +0 -1
- package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.types.d.ts.map +0 -1
- package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.util.d.ts.map +0 -1
- package/dist/FileUploader.d.ts.map +0 -1
- package/dist/FileUploader.styles.d.ts.map +0 -1
- package/dist/FileUploader.types.d.ts.map +0 -1
- package/dist/FileView/FileView.const.d.ts.map +0 -1
- package/dist/FileView/FileView.d.ts.map +0 -1
- package/dist/FileView/FileView.styles.d.ts.map +0 -1
- package/dist/FileView/FileView.types.d.ts.map +0 -1
- package/dist/ItemUploader/ItemUploader.d.ts.map +0 -1
- package/dist/ItemUploader/ItemUploader.styles.d.ts.map +0 -1
- package/dist/ItemUploader/ItemUploader.types.d.ts.map +0 -1
- package/dist/ItemUploader/UploaderButton/FileViewItem.const.d.ts.map +0 -1
- package/dist/ItemUploader/UploaderButton/FileViewItem.d.ts.map +0 -1
- package/dist/ItemUploader/UploaderButton/FileViewItem.styles.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
|
@@ -1,146 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
import filesize from
|
|
3
|
-
import
|
|
4
|
-
import { FormattedMessage } from
|
|
5
|
-
import Button from
|
|
6
|
-
import { useTheme } from
|
|
7
|
-
import Icon, {
|
|
8
|
-
import ProgressBar from
|
|
9
|
-
import Tooltip from
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import filesize from "filesize.js";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { FormattedMessage } from "react-intl";
|
|
5
|
+
import Button from "@synerise/ds-button";
|
|
6
|
+
import { useTheme } from "@synerise/ds-core";
|
|
7
|
+
import Icon, { FileM, Close3M, RepeatM, Check3M, WarningFillM } from "@synerise/ds-icon";
|
|
8
|
+
import ProgressBar from "@synerise/ds-progress-bar";
|
|
9
|
+
import Tooltip from "@synerise/ds-tooltip";
|
|
10
|
+
import { isPreviewableMimeType, ICON_MAP } from "./FileView.const.js";
|
|
11
|
+
import { FileViewContainer, PreviewImage, PlaceholderImage, Info, Name, FileName, FileWeight, FlexRow, RemoveWrapper, SizeOrError, CheckButtonWrapper, PopconfirmOnRemove, RemoveButtonWrapper } from "./FileView.styles.js";
|
|
12
|
+
const FileView = ({
|
|
13
|
+
data,
|
|
14
|
+
texts,
|
|
15
|
+
onRemove,
|
|
16
|
+
removable,
|
|
17
|
+
retry,
|
|
18
|
+
retryButtonProps
|
|
19
|
+
}) => {
|
|
20
|
+
const getFriendlySize = (size) => filesize(size || 0);
|
|
21
|
+
const theme = useTheme();
|
|
22
|
+
const {
|
|
23
|
+
disabled,
|
|
24
|
+
error,
|
|
25
|
+
file,
|
|
26
|
+
progress,
|
|
27
|
+
success
|
|
28
|
+
} = data;
|
|
29
|
+
const finalTexts = {
|
|
30
|
+
size: /* @__PURE__ */ jsx(FormattedMessage, { id: "DS.FILE-UPLOADER.SIZE", defaultMessage: "Size" }),
|
|
31
|
+
removeTooltip: /* @__PURE__ */ jsx(FormattedMessage, { id: "DS.FILE-UPLOADER.REMOVE-TOOLTIP", defaultMessage: "Remove" }),
|
|
32
|
+
cancelText: /* @__PURE__ */ jsx(FormattedMessage, { id: "DS.FILE-UPLOADER.FILE-VIEW.CANCEL", defaultMessage: "Cancel" }),
|
|
33
|
+
okText: /* @__PURE__ */ jsx(FormattedMessage, { id: "DS.FILE-UPLOADER.FILE-VIEW.OK", defaultMessage: "OK" }),
|
|
34
|
+
removeConfirmTitle: /* @__PURE__ */ jsx(FormattedMessage, { id: "DS.FILE-UPLOADER.FILE-VIEW.REMOVE-CONFIRM-TITLE", defaultMessage: "Remove" }),
|
|
35
|
+
retryLabel: /* @__PURE__ */ jsx(FormattedMessage, { id: "DS.FILE-UPLOADER.FILE-VIEW.RETRY-BUTTON-LABEL", defaultMessage: "Retry" }),
|
|
36
|
+
...texts
|
|
21
37
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
progress = data.progress,
|
|
27
|
-
success = data.success;
|
|
28
|
-
var finalTexts = _extends({
|
|
29
|
-
size: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
30
|
-
id: "DS.FILE-UPLOADER.SIZE",
|
|
31
|
-
defaultMessage: "Size"
|
|
32
|
-
}),
|
|
33
|
-
removeTooltip: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
34
|
-
id: "DS.FILE-UPLOADER.REMOVE-TOOLTIP",
|
|
35
|
-
defaultMessage: "Remove"
|
|
36
|
-
}),
|
|
37
|
-
cancelText: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
38
|
-
id: "DS.FILE-UPLOADER.FILE-VIEW.CANCEL",
|
|
39
|
-
defaultMessage: "Cancel"
|
|
40
|
-
}),
|
|
41
|
-
okText: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
42
|
-
id: "DS.FILE-UPLOADER.FILE-VIEW.OK",
|
|
43
|
-
defaultMessage: "OK"
|
|
44
|
-
}),
|
|
45
|
-
removeConfirmTitle: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
46
|
-
id: "DS.FILE-UPLOADER.FILE-VIEW.REMOVE-CONFIRM-TITLE",
|
|
47
|
-
defaultMessage: "Remove"
|
|
48
|
-
}),
|
|
49
|
-
fileWeight: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
50
|
-
id: "DS.FILE-UPLOADER.FILE-VIEW.FILE-WEIGHT",
|
|
51
|
-
defaultMessage: "File weight"
|
|
52
|
-
}),
|
|
53
|
-
buttonLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
54
|
-
id: "DS.FILE-UPLOADER.FILE-VIEW.BUTTON-LABEL",
|
|
55
|
-
defaultMessage: "Upload a file"
|
|
56
|
-
}),
|
|
57
|
-
buttonDescription: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
58
|
-
id: "DS.FILE-UPLOADER.FILE-VIEW.BUTTON-DESCRIPTION",
|
|
59
|
-
defaultMessage: "or drop one here"
|
|
60
|
-
}),
|
|
61
|
-
retryLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
62
|
-
id: "DS.FILE-UPLOADER.FILE-VIEW.RETRY-BUTTON-LABEL",
|
|
63
|
-
defaultMessage: "Retry"
|
|
64
|
-
})
|
|
65
|
-
}, texts);
|
|
66
|
-
var hasError = !!error;
|
|
67
|
-
var hasProgress = typeof progress === 'number';
|
|
68
|
-
var _useState = useState(false),
|
|
69
|
-
pressed = _useState[0],
|
|
70
|
-
setPressed = _useState[1];
|
|
71
|
-
var handleRemove = function handleRemove() {
|
|
38
|
+
const hasError = !!error;
|
|
39
|
+
const hasProgress = typeof progress === "number";
|
|
40
|
+
const [pressed, setPressed] = useState(false);
|
|
41
|
+
const handleRemove = () => {
|
|
72
42
|
onRemove && onRemove();
|
|
73
43
|
setPressed(false);
|
|
74
44
|
};
|
|
75
|
-
return
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
onClick:
|
|
96
|
-
"data-testid": "fileview-remove"
|
|
97
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
98
|
-
title: finalTexts.removeTooltip
|
|
99
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
100
|
-
component: /*#__PURE__*/React.createElement(Close3M, null),
|
|
101
|
-
size: 20
|
|
102
|
-
}))))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.Name, null, /*#__PURE__*/React.createElement(S.FileName, null, file.name)), /*#__PURE__*/React.createElement(S.SizeOrError, null, error || /*#__PURE__*/React.createElement(React.Fragment, null, finalTexts.size, " ", getFriendlySize(file.size))))), error && retry && !hasProgress && /*#__PURE__*/React.createElement(Button, {
|
|
103
|
-
onClick: function onClick(event) {
|
|
45
|
+
return /* @__PURE__ */ jsxs(FileViewContainer, { success, pressed, progress: hasProgress, disabled, error: hasError, removable, type: "button", children: [
|
|
46
|
+
isPreviewableMimeType(file.type) ? /* @__PURE__ */ jsx(PreviewImage, { children: /* @__PURE__ */ jsx(Icon, { component: ICON_MAP[file.type], size: 40 }) }) : /* @__PURE__ */ jsx(PlaceholderImage, { children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(FileM, {}), size: 24 }) }),
|
|
47
|
+
/* @__PURE__ */ jsx(Info, { progress: hasProgress, children: hasProgress ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
48
|
+
/* @__PURE__ */ jsxs(Name, { children: [
|
|
49
|
+
/* @__PURE__ */ jsx(FileName, { children: file.name }),
|
|
50
|
+
" ",
|
|
51
|
+
/* @__PURE__ */ jsx(FileWeight, { children: filesize(progress / 100 * file.size) })
|
|
52
|
+
] }),
|
|
53
|
+
/* @__PURE__ */ jsxs(FlexRow, { children: [
|
|
54
|
+
/* @__PURE__ */ jsx(ProgressBar, { width: "300px", percent: finalTexts.percent }),
|
|
55
|
+
removable && /* @__PURE__ */ jsx(RemoveWrapper, { onClick: onRemove, "data-testid": "fileview-remove", children: /* @__PURE__ */ jsx(Tooltip, { title: finalTexts.removeTooltip, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(Close3M, {}), size: 20 }) }) })
|
|
56
|
+
] })
|
|
57
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
58
|
+
/* @__PURE__ */ jsx(Name, { children: /* @__PURE__ */ jsx(FileName, { children: file.name }) }),
|
|
59
|
+
/* @__PURE__ */ jsx(SizeOrError, { children: error || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
60
|
+
finalTexts.size,
|
|
61
|
+
" ",
|
|
62
|
+
getFriendlySize(file.size)
|
|
63
|
+
] }) })
|
|
64
|
+
] }) }),
|
|
65
|
+
error && retry && !hasProgress && /* @__PURE__ */ jsxs(Button, { onClick: (event) => {
|
|
104
66
|
onRemove && onRemove();
|
|
105
|
-
if (retryButtonProps
|
|
67
|
+
if (retryButtonProps?.onClick) {
|
|
106
68
|
retryButtonProps.onClick(event);
|
|
107
69
|
}
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
component:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
})), removable && !disabled && !error && !hasProgress && /*#__PURE__*/React.createElement(S.PopconfirmOnRemove, {
|
|
119
|
-
onConfirm: handleRemove,
|
|
120
|
-
onCancel: function onCancel() {
|
|
121
|
-
return setPressed(false);
|
|
122
|
-
},
|
|
123
|
-
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
124
|
-
component: /*#__PURE__*/React.createElement(WarningFillM, null),
|
|
125
|
-
color: theme.palette['yellow-600']
|
|
126
|
-
}),
|
|
127
|
-
cancelText: finalTexts.cancelText,
|
|
128
|
-
okText: finalTexts.okText,
|
|
129
|
-
okType: "primary",
|
|
130
|
-
title: finalTexts.removeConfirmTitle,
|
|
131
|
-
placement: "top",
|
|
132
|
-
trigger: "click"
|
|
133
|
-
}, /*#__PURE__*/React.createElement(S.RemoveButtonWrapper, {
|
|
134
|
-
onMouseDown: function onMouseDown() {
|
|
135
|
-
return setPressed(true);
|
|
136
|
-
},
|
|
137
|
-
pressed: pressed,
|
|
138
|
-
"data-testid": "fileview-remove"
|
|
139
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
140
|
-
title: finalTexts.removeTooltip
|
|
141
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
142
|
-
component: /*#__PURE__*/React.createElement(Close3M, null),
|
|
143
|
-
size: 20
|
|
144
|
-
})))));
|
|
70
|
+
}, mode: "icon-label", type: "ghost-primary", children: [
|
|
71
|
+
/* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(RepeatM, {}) }),
|
|
72
|
+
finalTexts.retryLabel
|
|
73
|
+
] }),
|
|
74
|
+
!error && !disabled && !hasProgress && /* @__PURE__ */ jsx(CheckButtonWrapper, { "data-testid": "fileview-check", children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(Check3M, {}), size: 20 }) }),
|
|
75
|
+
removable && !disabled && !error && !hasProgress && /* @__PURE__ */ jsx(PopconfirmOnRemove, { onConfirm: handleRemove, onCancel: () => setPressed(false), icon: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(WarningFillM, {}), color: theme.palette["yellow-600"] }), cancelText: finalTexts.cancelText, okText: finalTexts.okText, okType: "primary", title: finalTexts.removeConfirmTitle, placement: "top", trigger: "click", children: /* @__PURE__ */ jsx(RemoveButtonWrapper, { onMouseDown: () => setPressed(true), pressed, "data-testid": "fileview-remove", children: /* @__PURE__ */ jsx(Tooltip, { title: finalTexts.removeTooltip, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(Close3M, {}), size: 20 }) }) }) })
|
|
76
|
+
] });
|
|
77
|
+
};
|
|
78
|
+
export {
|
|
79
|
+
FileView as default
|
|
145
80
|
};
|
|
146
|
-
export default FileView;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export declare const PreviewImage: import(
|
|
2
|
-
export declare const PlaceholderImage: import(
|
|
3
|
-
export declare const Info: import(
|
|
1
|
+
export declare const PreviewImage: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const PlaceholderImage: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const Info: import('styled-components').StyledComponent<"div", any, {
|
|
4
4
|
progress: boolean;
|
|
5
5
|
}, never>;
|
|
6
|
-
export declare const PopconfirmOnRemove: import(
|
|
7
|
-
export declare const FileWeight: import(
|
|
8
|
-
export declare const FileName: import(
|
|
9
|
-
export declare const Name: import(
|
|
10
|
-
export declare const FlexRow: import(
|
|
11
|
-
export declare const SizeOrError: import(
|
|
12
|
-
size?: import(
|
|
13
|
-
ellipsis?: import(
|
|
14
|
-
children?: import(
|
|
6
|
+
export declare const PopconfirmOnRemove: import('styled-components').StyledComponent<import('@synerise/ds-popconfirm/dist/Popconfirm.types').PopconfirmType, any, {}, never>;
|
|
7
|
+
export declare const FileWeight: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
8
|
+
export declare const FileName: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
9
|
+
export declare const Name: import('styled-components').StyledComponent<"label", any, {}, never>;
|
|
10
|
+
export declare const FlexRow: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
11
|
+
export declare const SizeOrError: import('styled-components').StyledComponent<({ size, className, children, ellipsis, style, }: {
|
|
12
|
+
size?: import('@synerise/ds-typography').TextSize;
|
|
13
|
+
ellipsis?: import('@synerise/ds-typography/dist/Ellipsis').EllipsisProps;
|
|
14
|
+
children?: import('react').ReactNode;
|
|
15
15
|
className?: string;
|
|
16
|
-
style?: import(
|
|
16
|
+
style?: import('react').CSSProperties;
|
|
17
17
|
}) => React.JSX.Element, any, {}, never>;
|
|
18
|
-
export declare const RemoveWrapper: import(
|
|
19
|
-
export declare const CheckButtonWrapper: import(
|
|
20
|
-
export declare const RemoveButtonWrapper: import(
|
|
18
|
+
export declare const RemoveWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
19
|
+
export declare const CheckButtonWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
20
|
+
export declare const RemoveButtonWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
21
21
|
pressed?: boolean;
|
|
22
22
|
}, never>;
|
|
23
|
-
export declare const FileViewContainer: import(
|
|
23
|
+
export declare const FileViewContainer: import('styled-components').StyledComponent<"button", any, {
|
|
24
24
|
disabled?: boolean;
|
|
25
25
|
error?: boolean;
|
|
26
26
|
removable?: boolean;
|
|
@@ -28,4 +28,3 @@ export declare const FileViewContainer: import("styled-components").StyledCompon
|
|
|
28
28
|
progress?: boolean;
|
|
29
29
|
pressed?: boolean;
|
|
30
30
|
}, never>;
|
|
31
|
-
//# sourceMappingURL=FileView.styles.d.ts.map
|
|
@@ -1,112 +1,94 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import { IconContainer } from
|
|
3
|
-
import Popconfirm from
|
|
4
|
-
import { Label, Text } from
|
|
5
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { IconContainer } from "@synerise/ds-icon";
|
|
3
|
+
import Popconfirm from "@synerise/ds-popconfirm";
|
|
4
|
+
import { Label, Text } from "@synerise/ds-typography";
|
|
5
|
+
const PreviewImage = /* @__PURE__ */ styled.div.withConfig({
|
|
6
6
|
displayName: "FileViewstyles__PreviewImage",
|
|
7
7
|
componentId: "sc-wpdc66-0"
|
|
8
|
-
})(["", "{color:", ";}margin:-4px -8px -4px -4px;"], IconContainer,
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
-
export var PlaceholderImage = styled.div.withConfig({
|
|
8
|
+
})(["", "{color:", ";}margin:-4px -8px -4px -4px;"], IconContainer, (props) => props.theme.palette["grey-700"]);
|
|
9
|
+
const PlaceholderImage = /* @__PURE__ */ styled.div.withConfig({
|
|
12
10
|
displayName: "FileViewstyles__PlaceholderImage",
|
|
13
11
|
componentId: "sc-wpdc66-1"
|
|
14
|
-
})(["background-color:", ";width:32px;height:32px;border-radius:3px;padding:4px;", "{color:", ";}"],
|
|
15
|
-
|
|
16
|
-
}, IconContainer, function (props) {
|
|
17
|
-
return props.theme.palette['grey-500'];
|
|
18
|
-
});
|
|
19
|
-
export var Info = styled.div.withConfig({
|
|
12
|
+
})(["background-color:", ";width:32px;height:32px;border-radius:3px;padding:4px;", "{color:", ";}"], (props) => props.theme.palette["grey-200"], IconContainer, (props) => props.theme.palette["grey-500"]);
|
|
13
|
+
const Info = /* @__PURE__ */ styled.div.withConfig({
|
|
20
14
|
displayName: "FileViewstyles__Info",
|
|
21
15
|
componentId: "sc-wpdc66-2"
|
|
22
|
-
})(["overflow:hidden;margin:0 0 0 10px;width:", ";"],
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
export var PopconfirmOnRemove = styled(Popconfirm).withConfig({
|
|
16
|
+
})(["overflow:hidden;margin:0 0 0 10px;width:", ";"], (props) => props.progress ? "100%" : "80%");
|
|
17
|
+
const PopconfirmOnRemove = /* @__PURE__ */ styled(Popconfirm).withConfig({
|
|
26
18
|
displayName: "FileViewstyles__PopconfirmOnRemove",
|
|
27
19
|
componentId: "sc-wpdc66-3"
|
|
28
20
|
})([".ant-popover-buttons{.ant-btn-sm{&:first-of-type{padding-left:6px;}}}"]);
|
|
29
|
-
|
|
21
|
+
const FileWeight = /* @__PURE__ */ styled.div.withConfig({
|
|
30
22
|
displayName: "FileViewstyles__FileWeight",
|
|
31
23
|
componentId: "sc-wpdc66-4"
|
|
32
|
-
})(["color:", ";padding-right:30px;font-weight:normal;font-size:13px;"],
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
export var FileName = styled.div.withConfig({
|
|
24
|
+
})(["color:", ";padding-right:30px;font-weight:normal;font-size:13px;"], (props) => props.theme.palette["grey-500"]);
|
|
25
|
+
const FileName = /* @__PURE__ */ styled.div.withConfig({
|
|
36
26
|
displayName: "FileViewstyles__FileName",
|
|
37
27
|
componentId: "sc-wpdc66-5"
|
|
38
28
|
})(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;"]);
|
|
39
|
-
|
|
29
|
+
const Name = /* @__PURE__ */ styled(Label).withConfig({
|
|
40
30
|
displayName: "FileViewstyles__Name",
|
|
41
31
|
componentId: "sc-wpdc66-6"
|
|
42
|
-
})(["&&{color:", ";max-width:100%;cursor:initial;white-space:nowrap;display:flex;justify-content:space-between;}"],
|
|
43
|
-
|
|
44
|
-
});
|
|
45
|
-
export var FlexRow = styled.div.withConfig({
|
|
32
|
+
})(["&&{color:", ";max-width:100%;cursor:initial;white-space:nowrap;display:flex;justify-content:space-between;}"], (props) => props.theme.palette["grey-600"]);
|
|
33
|
+
const FlexRow = /* @__PURE__ */ styled.div.withConfig({
|
|
46
34
|
displayName: "FileViewstyles__FlexRow",
|
|
47
35
|
componentId: "sc-wpdc66-7"
|
|
48
36
|
})(["display:flex;"]);
|
|
49
|
-
|
|
37
|
+
const SizeOrError = /* @__PURE__ */ styled(Text).withConfig({
|
|
50
38
|
displayName: "FileViewstyles__SizeOrError",
|
|
51
39
|
componentId: "sc-wpdc66-8"
|
|
52
|
-
})(["&&{color:", ";}"],
|
|
53
|
-
|
|
54
|
-
});
|
|
55
|
-
export var RemoveWrapper = styled.div.withConfig({
|
|
40
|
+
})(["&&{color:", ";}"], (props) => props.theme.palette["grey-600"]);
|
|
41
|
+
const RemoveWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
56
42
|
displayName: "FileViewstyles__RemoveWrapper",
|
|
57
43
|
componentId: "sc-wpdc66-9"
|
|
58
|
-
})(["display:flex;background-color:transparent;z-index:10;border:0;padding:0;margin:0;height:16px;width:16px;position:absolute;top:14px;right:10px;cursor:pointer;", "{position:absolute;right:-2px;top:-2px;transition:color 0.3s;color:", ";&:hover{color:", ";}}"], IconContainer,
|
|
59
|
-
|
|
60
|
-
}, function (props) {
|
|
61
|
-
return props.theme.palette['red-500'];
|
|
62
|
-
});
|
|
63
|
-
export var CheckButtonWrapper = styled.div.withConfig({
|
|
44
|
+
})(["display:flex;background-color:transparent;z-index:10;border:0;padding:0;margin:0;height:16px;width:16px;position:absolute;top:14px;right:10px;cursor:pointer;", "{position:absolute;right:-2px;top:-2px;transition:color 0.3s;color:", ";&:hover{color:", ";}}"], IconContainer, (props) => props.theme.palette["grey-300"], (props) => props.theme.palette["red-500"]);
|
|
45
|
+
const CheckButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
64
46
|
displayName: "FileViewstyles__CheckButtonWrapper",
|
|
65
47
|
componentId: "sc-wpdc66-10"
|
|
66
|
-
})(["display:flex;background-color:transparent;z-index:10;margin:0;height:16px;width:16px;position:absolute;top:14px;right:10px;cursor:pointer;", "{position:absolute;right:-2px;top:-2px;transition:color 0.3s;color:", ";&:hover{color:", ";}}"], IconContainer,
|
|
67
|
-
|
|
68
|
-
}, function (props) {
|
|
69
|
-
return props.theme.palette['green-500'];
|
|
70
|
-
});
|
|
71
|
-
export var RemoveButtonWrapper = styled.div.withConfig({
|
|
48
|
+
})(["display:flex;background-color:transparent;z-index:10;margin:0;height:16px;width:16px;position:absolute;top:14px;right:10px;cursor:pointer;", "{position:absolute;right:-2px;top:-2px;transition:color 0.3s;color:", ";&:hover{color:", ";}}"], IconContainer, (props) => props.theme.palette["green-600"], (props) => props.theme.palette["green-500"]);
|
|
49
|
+
const RemoveButtonWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
72
50
|
displayName: "FileViewstyles__RemoveButtonWrapper",
|
|
73
51
|
componentId: "sc-wpdc66-11"
|
|
74
|
-
})(["display:", ";background-color:transparent;z-index:10;border:0;padding:0;margin:0;height:16px;width:16px;position:absolute;top:14px;right:10px;cursor:pointer;overflow:", ";", "{position:absolute;right:-2px;top:-2px;transition:color 0.3s;color:", ";&:hover{color:", ";}}"],
|
|
75
|
-
|
|
76
|
-
}, function (props) {
|
|
77
|
-
return props.pressed ? 'visible' : 'hidden';
|
|
78
|
-
}, IconContainer, function (props) {
|
|
79
|
-
return props.theme.palette['red-600'];
|
|
80
|
-
}, function (props) {
|
|
81
|
-
return props.theme.palette['red-500'];
|
|
82
|
-
});
|
|
83
|
-
export var FileViewContainer = styled.button.withConfig({
|
|
52
|
+
})(["display:", ";background-color:transparent;z-index:10;border:0;padding:0;margin:0;height:16px;width:16px;position:absolute;top:14px;right:10px;cursor:pointer;overflow:", ";", "{position:absolute;right:-2px;top:-2px;transition:color 0.3s;color:", ";&:hover{color:", ";}}"], (props) => props.pressed ? "flex" : "none", (props) => props.pressed ? "visible" : "hidden", IconContainer, (props) => props.theme.palette["red-600"], (props) => props.theme.palette["red-500"]);
|
|
53
|
+
const FileViewContainer = /* @__PURE__ */ styled.button.withConfig({
|
|
84
54
|
displayName: "FileViewstyles__FileViewContainer",
|
|
85
55
|
componentId: "sc-wpdc66-12"
|
|
86
|
-
})(["background-color:", ";border-radius:3px;border:1px solid ", ";display:flex;align-items:center;padding:12px 6px;height:48px;width:100%;text-align:left;line-height:initial;position:relative;margin:0 0 12px;&:last-of-type{margin:0;}&:hover{border-color:", ";", "}&:hover{", "}&:focus{border-color:", ";background-color:", ";", "}&:hover{background-color:", ";}&:active{border-color:", ";background-color:", ";}", ";", ";.ant-progress-line{margin:8px 0 0 !important;width:93%;}"],
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
56
|
+
})(["background-color:", ";border-radius:3px;border:1px solid ", ";display:flex;align-items:center;padding:12px 6px;height:48px;width:100%;text-align:left;line-height:initial;position:relative;margin:0 0 12px;&:last-of-type{margin:0;}&:hover{border-color:", ";", "}&:hover{", "}&:focus{border-color:", ";background-color:", ";", "}&:hover{background-color:", ";}&:active{border-color:", ";background-color:", ";}", ";", ";.ant-progress-line{margin:8px 0 0 !important;width:93%;}"], (props) => props.theme.palette.white, (props) => props.theme.palette["grey-200"], (props) => props.theme.palette["grey-300"], (props) => props.removable && !props.disabled && `
|
|
57
|
+
${RemoveButtonWrapper} {
|
|
58
|
+
display: block;
|
|
59
|
+
}
|
|
60
|
+
`, (props) => !props.disabled && `
|
|
61
|
+
${CheckButtonWrapper} {
|
|
62
|
+
display: none;
|
|
63
|
+
}
|
|
64
|
+
`, (props) => props.theme.palette["blue-500"], (props) => props.theme.palette["grey-050"], (props) => props.pressed && `
|
|
65
|
+
${CheckButtonWrapper} {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
`, (props) => props.theme.palette["grey-050"], (props) => props.theme.palette["grey-300"], (props) => props.theme.palette["grey-100"], (props) => props.disabled && `
|
|
69
|
+
background-color: ${props.theme.palette["grey-050"]};
|
|
70
|
+
opacity: 0.4;
|
|
71
|
+
`, (props) => props.error && !props.progress && `
|
|
72
|
+
&& {
|
|
73
|
+
border: 1px solid ${props.theme.palette["red-600"]};
|
|
74
|
+
|
|
75
|
+
${SizeOrError} {
|
|
76
|
+
color: ${props.theme.palette["red-600"]};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`);
|
|
80
|
+
export {
|
|
81
|
+
CheckButtonWrapper,
|
|
82
|
+
FileName,
|
|
83
|
+
FileViewContainer,
|
|
84
|
+
FileWeight,
|
|
85
|
+
FlexRow,
|
|
86
|
+
Info,
|
|
87
|
+
Name,
|
|
88
|
+
PlaceholderImage,
|
|
89
|
+
PopconfirmOnRemove,
|
|
90
|
+
PreviewImage,
|
|
91
|
+
RemoveButtonWrapper,
|
|
92
|
+
RemoveWrapper,
|
|
93
|
+
SizeOrError
|
|
94
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { DropzoneRootProps } from 'react-dropzone';
|
|
2
|
+
import { ExtendedFile, FileViewTexts } from '../FileUploader.types';
|
|
3
3
|
export type FileViewProps = {
|
|
4
4
|
data: ExtendedFile;
|
|
5
5
|
texts?: FileViewTexts;
|
|
@@ -8,4 +8,3 @@ export type FileViewProps = {
|
|
|
8
8
|
retry?: boolean | React.ReactNode;
|
|
9
9
|
retryButtonProps?: DropzoneRootProps;
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=FileView.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const ItemUploader: React.ForwardRefExoticComponent<Omit<import(
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FileUploaderRef } from '../FileUploader.types';
|
|
3
|
+
declare const ItemUploader: React.ForwardRefExoticComponent<Omit<import('../FileUploader.types').FileUploaderProps, "mode"> & {
|
|
4
4
|
mode: "single" | "multi";
|
|
5
5
|
} & React.RefAttributes<FileUploaderRef>>;
|
|
6
6
|
export default ItemUploader;
|
|
7
|
-
//# sourceMappingURL=ItemUploader.d.ts.map
|