@mailstep/design-system 0.6.81-beta.0 → 0.6.82
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/ui/Blocks/ImageList/ImageList.js +10 -5
- package/ui/Blocks/ImageList/components/AddPhoto/index.d.ts +1 -0
- package/ui/Blocks/ImageList/components/AddPhoto/index.js +4 -4
- package/ui/Blocks/ImageList/components/AddPhoto/styles.d.ts +1 -0
- package/ui/Blocks/ImageList/components/AddPhoto/styles.js +4 -1
- package/ui/Blocks/ImageList/components/ImageElement/index.d.ts +3 -1
- package/ui/Blocks/ImageList/components/ImageElement/index.js +4 -5
- package/ui/Blocks/ImageList/components/ImageElement/styles.d.ts +7 -1
- package/ui/Blocks/ImageList/components/ImageElement/styles.js +20 -3
- package/ui/Blocks/ImageList/hooks/useControls.d.ts +11 -0
- package/ui/Blocks/ImageList/hooks/useControls.js +15 -0
- package/ui/Blocks/ImageList/hooks/useOnElementClick.d.ts +12 -0
- package/ui/Blocks/ImageList/hooks/useOnElementClick.js +20 -0
- package/ui/Blocks/ImageList/stories/ImageList.stories.d.ts +2 -0
- package/ui/Blocks/ImageList/stories/ImageList.stories.js +24 -2
- package/ui/Blocks/ImageList/styles.d.ts +5 -0
- package/ui/Blocks/ImageList/styles.js +14 -1
- package/ui/Blocks/ImageList/types.d.ts +3 -0
- package/ui/Elements/Text/types.d.ts +1 -0
- package/ui/Forms/Input/Input.js +1 -1
- package/ui/index.es.js +14778 -14182
- package/ui/index.umd.js +649 -623
package/package.json
CHANGED
|
@@ -12,18 +12,23 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useRef } from 'react';
|
|
14
14
|
import { useDraggable } from 'react-use-draggable-scroll';
|
|
15
|
+
import Icon from '../../Elements/Icon/Icon';
|
|
15
16
|
import LightBox, { useLightBox } from '../LightBox';
|
|
16
17
|
import { AddPhoto } from './components/AddPhoto';
|
|
17
18
|
import { ImageElement } from './components/ImageElement';
|
|
19
|
+
import { useControls } from './hooks/useControls';
|
|
20
|
+
import { useOnElementClick } from './hooks/useOnElementClick';
|
|
18
21
|
import { x } from '@xstyled/styled-components';
|
|
19
|
-
import { ImageListContainer } from './styles';
|
|
22
|
+
import { ImageListContainer, Control } from './styles';
|
|
20
23
|
export var ImageList = function (_a) {
|
|
21
|
-
var onImageUpload = _a.onImageUpload, onImageRemove = _a.onImageRemove, lightBoxAction = _a.lightBoxAction, lightBoxActionTitle = _a.lightBoxActionTitle, images = _a.images, isDisabled = _a.isDisabled;
|
|
24
|
+
var onImageUpload = _a.onImageUpload, onImageRemove = _a.onImageRemove, onImageClick = _a.onImageClick, lightBoxAction = _a.lightBoxAction, lightBoxActionTitle = _a.lightBoxActionTitle, images = _a.images, isDisabled = _a.isDisabled, selectable = _a.selectable, max = _a.max;
|
|
22
25
|
var ref = useRef();
|
|
23
26
|
var events = useDraggable(ref, { isMounted: !!(images === null || images === void 0 ? void 0 : images.length) }).events;
|
|
24
27
|
var _b = useLightBox(), isLightBoxOpen = _b.isLightBoxOpen, onCloseLightBox = _b.onCloseLightBox, onOpenLightBox = _b.onOpenLightBox, lightBoxData = _b.lightBoxData;
|
|
25
|
-
|
|
28
|
+
var _c = useOnElementClick({ onImageClick: onImageClick, onOpenLightBox: onOpenLightBox, selectable: selectable }), handleOnClick = _c.handleOnClick, selected = _c.selected;
|
|
29
|
+
var _d = useControls({ max: max, total: images === null || images === void 0 ? void 0 : images.length }), hasControls = _d.hasControls, position = _d.position, moveList = _d.moveList;
|
|
30
|
+
return (_jsxs(x.div, { display: "flex", alignItems: "center", children: [_jsx(AddPhoto, { onImageUpload: onImageUpload, isDisabled: isDisabled, hasRemove: !!onImageRemove }), hasControls && (_jsx(Control, { onClick: moveList(-1), isLeft: true, isDisabled: position === 0, hasRemove: !!onImageRemove, children: _jsx(Icon, { icon: "lessThen", size: "24px" }) })), images && (_jsx(ImageListContainer, __assign({ ref: ref }, events, { children: images.map(function (item, index) {
|
|
26
31
|
var _a, _b;
|
|
27
|
-
return (_jsx(ImageElement, { imageUrl: (_a = item.smallUrl) !== null && _a !== void 0 ? _a : item.url, onImageRemove: onImageRemove === null || onImageRemove === void 0 ? void 0 : onImageRemove(item.id),
|
|
28
|
-
}) }))), _jsx(LightBox, { initialSlide: lightBoxData === null || lightBoxData === void 0 ? void 0 : lightBoxData.initialSlide, isLightBoxOpen: isLightBoxOpen, onCloseLightBox: onCloseLightBox, lightBoxAction: lightBoxAction, lightBoxActionTitle: lightBoxActionTitle, images: images })] }));
|
|
32
|
+
return (_jsx(ImageElement, { imageUrl: (_a = item.smallUrl) !== null && _a !== void 0 ? _a : item.url, onImageRemove: onImageRemove === null || onImageRemove === void 0 ? void 0 : onImageRemove(item.id), onClick: handleOnClick(item, index), isDisabled: isDisabled, label: item === null || item === void 0 ? void 0 : item.label, selected: index === selected, visible: !max || (index >= position && index < position + max) }, (_b = item.id) !== null && _b !== void 0 ? _b : index));
|
|
33
|
+
}) }))), hasControls && (_jsx(Control, { onClick: moveList(1), isDisabled: !!images && !!max && position >= (images === null || images === void 0 ? void 0 : images.length) - max, hasRemove: !!onImageRemove, children: _jsx(Icon, { icon: "greaterThan", size: "24px" }) })), _jsx(LightBox, { initialSlide: lightBoxData === null || lightBoxData === void 0 ? void 0 : lightBoxData.initialSlide, isLightBoxOpen: isLightBoxOpen, onCloseLightBox: onCloseLightBox, lightBoxAction: lightBoxAction, lightBoxActionTitle: lightBoxActionTitle, images: images })] }));
|
|
29
34
|
};
|
|
@@ -36,10 +36,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
};
|
|
37
37
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
38
38
|
import { useCallback } from 'react';
|
|
39
|
-
import { Container, HiddenInput } from './styles';
|
|
40
39
|
import { AddPhoto as AddPhotoIcon } from '../../../../Elements/Icon/icons/AddPhoto';
|
|
40
|
+
import { Container, HiddenInput } from './styles';
|
|
41
41
|
export var AddPhoto = function (_a) {
|
|
42
|
-
var onImageUpload = _a.onImageUpload, isDisabled = _a.isDisabled;
|
|
42
|
+
var onImageUpload = _a.onImageUpload, isDisabled = _a.isDisabled, hasRemove = _a.hasRemove;
|
|
43
43
|
var handleImageUpload = useCallback(function (event) {
|
|
44
44
|
var _a, _b;
|
|
45
45
|
if (!((_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b[0]))
|
|
@@ -53,7 +53,7 @@ export var AddPhoto = function (_a) {
|
|
|
53
53
|
case 0: return [4 /*yield*/, (onImageUpload === null || onImageUpload === void 0 ? void 0 : onImageUpload({
|
|
54
54
|
base64image: (_a = reader.result) === null || _a === void 0 ? void 0 : _a.split(',').pop(),
|
|
55
55
|
base64WithDataDeclaration: reader.result,
|
|
56
|
-
file: (_b = event.target.files) === null || _b === void 0 ? void 0 : _b[0]
|
|
56
|
+
file: (_b = event.target.files) === null || _b === void 0 ? void 0 : _b[0]
|
|
57
57
|
}))];
|
|
58
58
|
case 1:
|
|
59
59
|
_c.sent();
|
|
@@ -64,5 +64,5 @@ export var AddPhoto = function (_a) {
|
|
|
64
64
|
}, [onImageUpload]);
|
|
65
65
|
if (!onImageUpload)
|
|
66
66
|
return null;
|
|
67
|
-
return (_jsxs(Container, { isDisabled: isDisabled, children: [_jsx(HiddenInput, { disabled: isDisabled, onChange: handleImageUpload, type: "file", accept: "image/*;capture=camera", capture: "environment" }), _jsx(AddPhotoIcon, { width: "36", height: "36" })] }));
|
|
67
|
+
return (_jsxs(Container, { isDisabled: isDisabled, hasRemove: hasRemove, children: [_jsx(HiddenInput, { disabled: isDisabled, onChange: handleImageUpload, type: "file", accept: "image/*;capture=camera", capture: "environment" }), _jsx(AddPhotoIcon, { width: "36", height: "36" })] }));
|
|
68
68
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const Container: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
2
2
|
isDisabled?: boolean | undefined;
|
|
3
|
+
hasRemove?: boolean | undefined;
|
|
3
4
|
}, never>;
|
|
4
5
|
export declare const HiddenInput: import("styled-components").StyledComponent<"input", import("@xstyled/system").Theme, {}, never>;
|
|
@@ -3,9 +3,12 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
5
|
import styled, { th } from '@xstyled/styled-components';
|
|
6
|
-
export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n flex-shrink: 0;\n transition: all 0.2s linear;\n height: 85px !important;\n width: 85px !important;\n border-radius: ", ";\n border: ", ";\n border-color: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n margin-right: 15px;\n opacity: ", ";\n"], ["\n position: relative;\n flex-shrink: 0;\n transition: all 0.2s linear;\n height: 85px !important;\n width: 85px !important;\n border-radius: ", ";\n border: ", ";\n border-color: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n margin-right: 15px;\n opacity: ", ";\n"])), th.radius('lg'), th.border('mediumSlim'), th.color('red1'), function (_a) {
|
|
6
|
+
export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n flex-shrink: 0;\n transition: all 0.2s linear;\n height: 85px !important;\n width: 85px !important;\n border-radius: ", ";\n border: ", ";\n border-color: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n margin-right: 15px;\n opacity: ", ";\n margin-top: ", ";\n"], ["\n position: relative;\n flex-shrink: 0;\n transition: all 0.2s linear;\n height: 85px !important;\n width: 85px !important;\n border-radius: ", ";\n border: ", ";\n border-color: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n margin-right: 15px;\n opacity: ", ";\n margin-top: ", ";\n"])), th.radius('lg'), th.border('mediumSlim'), th.color('red1'), function (_a) {
|
|
7
7
|
var isDisabled = _a.isDisabled;
|
|
8
8
|
return (isDisabled ? 0.6 : 1);
|
|
9
|
+
}, function (_a) {
|
|
10
|
+
var hasRemove = _a.hasRemove;
|
|
11
|
+
return (hasRemove ? '15px' : '');
|
|
9
12
|
});
|
|
10
13
|
export var HiddenInput = styled.input(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n opacity: 0;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n"], ["\n opacity: 0;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n"])));
|
|
11
14
|
var templateObject_1, templateObject_2;
|
|
@@ -2,9 +2,11 @@ import { type FC } from 'react';
|
|
|
2
2
|
interface ImageElementProps {
|
|
3
3
|
label?: string;
|
|
4
4
|
onImageRemove?: () => void;
|
|
5
|
-
|
|
5
|
+
onClick: () => void;
|
|
6
6
|
imageUrl: string | undefined;
|
|
7
7
|
isDisabled?: boolean;
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
visible: boolean;
|
|
8
10
|
}
|
|
9
11
|
export declare const ImageElement: FC<ImageElementProps>;
|
|
10
12
|
export {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Image } from './styles';
|
|
3
|
-
import { ImageTag } from '../ImageTag';
|
|
4
2
|
import { CloseButton } from '../CloseButton';
|
|
5
|
-
import {
|
|
3
|
+
import { ImageTag } from '../ImageTag';
|
|
4
|
+
import { Image, ImageWrapper } from './styles';
|
|
6
5
|
export var ImageElement = function (_a) {
|
|
7
|
-
var label = _a.label, onImageRemove = _a.onImageRemove, isDisabled = _a.isDisabled,
|
|
6
|
+
var label = _a.label, onImageRemove = _a.onImageRemove, isDisabled = _a.isDisabled, onClick = _a.onClick, imageUrl = _a.imageUrl, selected = _a.selected, visible = _a.visible;
|
|
8
7
|
if (!imageUrl)
|
|
9
8
|
return null;
|
|
10
|
-
return (_jsxs(
|
|
9
|
+
return (_jsxs(ImageWrapper, { visible: visible, hasImageRemove: !!onImageRemove, children: [_jsx(Image, { src: imageUrl, alt: "", width: "85px", height: "85px", onClick: onClick, selected: selected }), onImageRemove && _jsx(CloseButton, { onImageRemove: onImageRemove, isDisabled: isDisabled }), _jsx(ImageTag, { label: label })] }));
|
|
11
10
|
};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
export declare const Container: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
2
|
-
export declare const Image: import("styled-components").StyledComponent<"img", import("@xstyled/system").Theme, {
|
|
2
|
+
export declare const Image: import("styled-components").StyledComponent<"img", import("@xstyled/system").Theme, {
|
|
3
|
+
selected?: boolean | undefined;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const ImageWrapper: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
6
|
+
visible: boolean;
|
|
7
|
+
hasImageRemove: boolean;
|
|
8
|
+
}, never>;
|
|
@@ -2,7 +2,24 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
2
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
|
-
import styled
|
|
5
|
+
import styled from '@xstyled/styled-components';
|
|
6
|
+
import { th } from '@xstyled/system';
|
|
6
7
|
export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
7
|
-
export var Image = styled.img(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: ", ";\n"], ["\n border-radius: ", ";\n"])), th.radius('lg'))
|
|
8
|
-
var
|
|
8
|
+
export var Image = styled.img(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: ", ";\n border: ", ";\n border-color: red1;\n cursor: pointer;\n transition: all 0.2s;\n"], ["\n border-radius: ", ";\n border: ", ";\n border-color: red1;\n cursor: pointer;\n transition: all 0.2s;\n"])), th.radius('lg'), function (_a) {
|
|
9
|
+
var selected = _a.selected;
|
|
10
|
+
return (selected ? "3px solid" : '0');
|
|
11
|
+
});
|
|
12
|
+
export var ImageWrapper = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n padding-right: ", ";\n padding-top: ", ";\n width: 100px;\n height: ", ";\n display: ", ";\n user-select: none;\n"], ["\n position: relative;\n padding-right: ", ";\n padding-top: ", ";\n width: 100px;\n height: ", ";\n display: ", ";\n user-select: none;\n"])), function (_a) {
|
|
13
|
+
var hasImageRemove = _a.hasImageRemove;
|
|
14
|
+
return (hasImageRemove ? '15px' : '0');
|
|
15
|
+
}, function (_a) {
|
|
16
|
+
var hasImageRemove = _a.hasImageRemove;
|
|
17
|
+
return (hasImageRemove ? '15px' : '0');
|
|
18
|
+
}, function (_a) {
|
|
19
|
+
var hasImageRemove = _a.hasImageRemove;
|
|
20
|
+
return (hasImageRemove ? '100px' : '85px');
|
|
21
|
+
}, function (_a) {
|
|
22
|
+
var visible = _a.visible;
|
|
23
|
+
return (visible ? 'block' : 'none');
|
|
24
|
+
});
|
|
25
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useState, useCallback } from 'react';
|
|
2
|
+
export var useControls = function (_a) {
|
|
3
|
+
var max = _a.max, _b = _a.total, total = _b === void 0 ? 0 : _b;
|
|
4
|
+
var _c = useState(0), position = _c[0], setPosition = _c[1];
|
|
5
|
+
var moveList = useCallback(function (direction) { return function () {
|
|
6
|
+
if (max) {
|
|
7
|
+
setPosition(function (position) { return Math.min(Math.max(position + direction, 0), total - max); });
|
|
8
|
+
}
|
|
9
|
+
}; }, [total]);
|
|
10
|
+
return {
|
|
11
|
+
moveList: moveList,
|
|
12
|
+
position: position,
|
|
13
|
+
hasControls: !!max && total > max
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ImageData } from '../../LightBox';
|
|
2
|
+
type Props = {
|
|
3
|
+
onImageClick?: (item: ImageData) => void;
|
|
4
|
+
onOpenLightBox: (index: number) => () => void;
|
|
5
|
+
selectable?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type HookType = (props: Props) => {
|
|
8
|
+
handleOnClick: (item: ImageData, index: number) => () => void;
|
|
9
|
+
selected: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const useOnElementClick: HookType;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
export var useOnElementClick = function (_a) {
|
|
3
|
+
var onImageClick = _a.onImageClick, onOpenLightBox = _a.onOpenLightBox, selectable = _a.selectable;
|
|
4
|
+
var _b = useState(-1), selected = _b[0], setSelected = _b[1];
|
|
5
|
+
var handleOnClick = useCallback(function (item, index) { return function () {
|
|
6
|
+
if (onImageClick) {
|
|
7
|
+
onImageClick(item);
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
onOpenLightBox(index)();
|
|
11
|
+
}
|
|
12
|
+
if (selectable) {
|
|
13
|
+
setSelected(function (selected) { return selected !== index ? index : -1; });
|
|
14
|
+
}
|
|
15
|
+
}; }, [onImageClick, onOpenLightBox]);
|
|
16
|
+
return {
|
|
17
|
+
handleOnClick: handleOnClick,
|
|
18
|
+
selected: selected
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -11,3 +11,5 @@ type Story = StoryObj<typeof meta>;
|
|
|
11
11
|
export declare const ImageListDefault: Story;
|
|
12
12
|
export declare const ImageListDisabled: Story;
|
|
13
13
|
export declare const ImageListWithItemDescription: Story;
|
|
14
|
+
export declare const ImageListSelectable: Story;
|
|
15
|
+
export declare const ImageListLimited: Story;
|
|
@@ -18,8 +18,14 @@ var meta = {
|
|
|
18
18
|
};
|
|
19
19
|
export default meta;
|
|
20
20
|
var images = [
|
|
21
|
-
{ id: '1', smallUrl: 'https://picsum.photos/200/300', url: 'https://picsum.photos/
|
|
22
|
-
{ id: '
|
|
21
|
+
{ id: '1', smallUrl: 'https://picsum.photos/200/300', url: 'https://picsum.photos/200/300' },
|
|
22
|
+
{ id: '2', smallUrl: 'https://picsum.photos/200/400', url: 'https://picsum.photos/200/400' },
|
|
23
|
+
{ id: '3', smallUrl: 'https://picsum.photos/200/500', url: 'https://picsum.photos/200/500' },
|
|
24
|
+
{ id: '4', smallUrl: 'https://picsum.photos/200/700', url: 'https://picsum.photos/200/700' },
|
|
25
|
+
{ id: '5', smallUrl: 'https://picsum.photos/200/800', url: 'https://picsum.photos/200/800' },
|
|
26
|
+
{ id: '6', smallUrl: 'https://picsum.photos/100/300', url: 'https://picsum.photos/100/300' },
|
|
27
|
+
{ id: '7', smallUrl: 'https://picsum.photos/100/400', url: 'https://picsum.photos/100/400' },
|
|
28
|
+
{ id: '8', smallUrl: 'https://picsum.photos/100/500', url: 'https://picsum.photos/100/500' },
|
|
23
29
|
];
|
|
24
30
|
export var ImageListDefault = {
|
|
25
31
|
args: {
|
|
@@ -39,3 +45,19 @@ export var ImageListWithItemDescription = {
|
|
|
39
45
|
images: images.map(function (img) { return (__assign(__assign({}, img), { label: 'Lorem Ipsum', date: '24.12.2024', description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aspernatur explicabo harum' })); }),
|
|
40
46
|
},
|
|
41
47
|
};
|
|
48
|
+
export var ImageListSelectable = {
|
|
49
|
+
args: {
|
|
50
|
+
images: images,
|
|
51
|
+
selectable: true,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
export var ImageListLimited = {
|
|
55
|
+
args: {
|
|
56
|
+
images: [
|
|
57
|
+
{ id: '1', smallUrl: 'https://picsum.photos/200/300', url: 'https://picsum.photos/200/300' },
|
|
58
|
+
{ id: '2', smallUrl: 'https://picsum.photos/200/400', url: 'https://picsum.photos/200/400' },
|
|
59
|
+
],
|
|
60
|
+
selectable: true,
|
|
61
|
+
max: 1,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -1 +1,6 @@
|
|
|
1
1
|
export declare const ImageListContainer: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
2
|
+
export declare const Control: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
3
|
+
isLeft?: boolean | undefined;
|
|
4
|
+
isDisabled: boolean;
|
|
5
|
+
hasRemove?: boolean | undefined;
|
|
6
|
+
}, never>;
|
|
@@ -4,4 +4,17 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
};
|
|
5
5
|
import styled from '@xstyled/styled-components';
|
|
6
6
|
export var ImageListContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n overflow-x: scroll;\n -ms-overflow-style: none;\n scrollbar-width: none;\n position: relative;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"], ["\n display: flex;\n overflow-x: scroll;\n -ms-overflow-style: none;\n scrollbar-width: none;\n position: relative;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"])));
|
|
7
|
-
var
|
|
7
|
+
export var Control = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 24px;\n margin-right: ", ";\n margin-top: ", ";\n cursor: pointer;\n display: flex;\n transition: all 0.4s;\n\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n"], ["\n width: 24px;\n margin-right: ", ";\n margin-top: ", ";\n cursor: pointer;\n display: flex;\n transition: all 0.4s;\n\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n"])), function (_a) {
|
|
8
|
+
var isLeft = _a.isLeft;
|
|
9
|
+
return (isLeft ? '15px' : 0);
|
|
10
|
+
}, function (_a) {
|
|
11
|
+
var hasRemove = _a.hasRemove;
|
|
12
|
+
return (hasRemove ? '15px' : 0);
|
|
13
|
+
}, function (_a) {
|
|
14
|
+
var isDisabled = _a.isDisabled;
|
|
15
|
+
return (isDisabled ? 'gray' : 'black');
|
|
16
|
+
}, function (_a) {
|
|
17
|
+
var isDisabled = _a.isDisabled;
|
|
18
|
+
return (isDisabled ? 'gray' : 'red1');
|
|
19
|
+
});
|
|
20
|
+
var templateObject_1, templateObject_2;
|
|
@@ -8,7 +8,10 @@ export interface ImageListProps {
|
|
|
8
8
|
images: ImageData[] | undefined;
|
|
9
9
|
onImageUpload?: (props: ImageUploadProps) => Promise<void>;
|
|
10
10
|
onImageRemove?: (id?: string) => () => void;
|
|
11
|
+
onImageClick?: (item: ImageData) => void;
|
|
11
12
|
lightBoxAction?: (id?: string) => () => Promise<void>;
|
|
12
13
|
lightBoxActionTitle?: string;
|
|
13
14
|
isDisabled?: boolean;
|
|
15
|
+
selectable?: boolean;
|
|
16
|
+
max?: number;
|
|
14
17
|
}
|
package/ui/Forms/Input/Input.js
CHANGED
|
@@ -43,7 +43,7 @@ export var Input = function (_a) {
|
|
|
43
43
|
var ref = (inputRef || internalRef);
|
|
44
44
|
useEffect(function () {
|
|
45
45
|
var _a;
|
|
46
|
-
|
|
46
|
+
forceFocus && !disabled && !isLoading && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.focus());
|
|
47
47
|
}, [disabled, forceFocus, isLoading]);
|
|
48
48
|
var handleBlur = useCallback(function (event) {
|
|
49
49
|
var _a, _b, _c, _d, _e;
|