@chem-po/react-web 0.0.23 → 0.0.24
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/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/form/input/file.tsx +2 -2
- package/src/components/loading/LoadingImage.tsx +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chem-po/react-web",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"author": "",
|
|
17
17
|
"license": "ISC",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@chem-po/core": "0.0.
|
|
20
|
-
"@chem-po/react": "0.0.
|
|
19
|
+
"@chem-po/core": "0.0.24",
|
|
20
|
+
"@chem-po/react": "0.0.24",
|
|
21
21
|
"@chakra-ui/anatomy": "^2.3.4",
|
|
22
22
|
"@chakra-ui/icons": "^2.2.4",
|
|
23
23
|
"@chakra-ui/react": "^2.10.7",
|
|
@@ -98,7 +98,7 @@ const ImageFileView = ({
|
|
|
98
98
|
const [loaded, setLoaded] = useState(false)
|
|
99
99
|
const { url, loading } = useObjectUrl(value)
|
|
100
100
|
const [imageSize, setImageSize] = useState({ width: 0, height: 0 })
|
|
101
|
-
const { shape, placeholder, objectFit,
|
|
101
|
+
const { shape, placeholder, objectFit, withFullView, background } = options ?? {}
|
|
102
102
|
const {
|
|
103
103
|
src: placeholderSrc,
|
|
104
104
|
opacity: placeholderOpacity,
|
|
@@ -138,7 +138,7 @@ const ImageFileView = ({
|
|
|
138
138
|
<LoadingImage
|
|
139
139
|
width={width}
|
|
140
140
|
height={height}
|
|
141
|
-
|
|
141
|
+
withFullView={!hasUpload || withFullView}
|
|
142
142
|
overflow="hidden"
|
|
143
143
|
borderRadius={shape === 'circle' ? 'full' : 4}
|
|
144
144
|
boxShadow={shape ? '1px 1px 3px #00000066' : 'none'}
|
|
@@ -9,7 +9,7 @@ export interface LoadingImageProps {
|
|
|
9
9
|
loadingOverride?: boolean
|
|
10
10
|
onLoad?: ImageProps['onLoad']
|
|
11
11
|
alt?: string
|
|
12
|
-
|
|
12
|
+
withFullView?: boolean
|
|
13
13
|
buttonFullView?: boolean
|
|
14
14
|
imageProps?: Omit<ImageProps, 'onLoad'>
|
|
15
15
|
}
|
|
@@ -23,7 +23,7 @@ export const LoadingImage = ({
|
|
|
23
23
|
onLoad,
|
|
24
24
|
width,
|
|
25
25
|
height,
|
|
26
|
-
|
|
26
|
+
withFullView,
|
|
27
27
|
buttonFullView,
|
|
28
28
|
imageProps,
|
|
29
29
|
...boxProps
|
|
@@ -65,12 +65,12 @@ export const LoadingImage = ({
|
|
|
65
65
|
<Image
|
|
66
66
|
src={src ?? emptyPng}
|
|
67
67
|
alt={alt}
|
|
68
|
-
onClick={
|
|
68
|
+
onClick={!withFullView || buttonFullView ? undefined : () => setViewing(true)}
|
|
69
69
|
onLoad={handleImageLoad}
|
|
70
70
|
onLoadStart={() => setImageLoading(true)}
|
|
71
71
|
top={0}
|
|
72
72
|
left={0}
|
|
73
|
-
cursor={
|
|
73
|
+
cursor={!withFullView || buttonFullView ? 'default' : 'pointer'}
|
|
74
74
|
draggable={false}
|
|
75
75
|
opacity={src && !loading ? 1 : 0}
|
|
76
76
|
transition="opacity 300ms ease-in-out"
|