@mailstep/design-system 0.6.79 → 0.6.80-beta.1
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 +2 -2
- package/ui/Blocks/ImageList/components/ImageElement/index.d.ts +1 -1
- package/ui/Blocks/ImageList/components/ImageElement/index.js +2 -2
- package/ui/Blocks/ImageList/types.d.ts +1 -0
- package/ui/index.es.js +17 -16
- package/ui/index.umd.js +122 -122
package/package.json
CHANGED
|
@@ -18,12 +18,12 @@ import { ImageElement } from './components/ImageElement';
|
|
|
18
18
|
import { x } from '@xstyled/styled-components';
|
|
19
19
|
import { ImageListContainer } from './styles';
|
|
20
20
|
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;
|
|
21
|
+
var onImageUpload = _a.onImageUpload, onImageRemove = _a.onImageRemove, onImageClick = _a.onImageClick, lightBoxAction = _a.lightBoxAction, lightBoxActionTitle = _a.lightBoxActionTitle, images = _a.images, isDisabled = _a.isDisabled;
|
|
22
22
|
var ref = useRef();
|
|
23
23
|
var events = useDraggable(ref, { isMounted: !!(images === null || images === void 0 ? void 0 : images.length) }).events;
|
|
24
24
|
var _b = useLightBox(), isLightBoxOpen = _b.isLightBoxOpen, onCloseLightBox = _b.onCloseLightBox, onOpenLightBox = _b.onOpenLightBox, lightBoxData = _b.lightBoxData;
|
|
25
25
|
return (_jsxs(x.div, { display: "flex", alignItems: "flex-end", children: [_jsx(AddPhoto, { onImageUpload: onImageUpload, isDisabled: isDisabled }), images && (_jsx(ImageListContainer, __assign({ ref: ref }, events, { children: images.map(function (item, index) {
|
|
26
26
|
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),
|
|
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), onClick: onImageClick ? onImageClick(item) : onOpenLightBox(index), isDisabled: isDisabled, label: item === null || item === void 0 ? void 0 : item.label }, (_b = item.id) !== null && _b !== void 0 ? _b : index));
|
|
28
28
|
}) }))), _jsx(LightBox, { initialSlide: lightBoxData === null || lightBoxData === void 0 ? void 0 : lightBoxData.initialSlide, isLightBoxOpen: isLightBoxOpen, onCloseLightBox: onCloseLightBox, lightBoxAction: lightBoxAction, lightBoxActionTitle: lightBoxActionTitle, images: images })] }));
|
|
29
29
|
};
|
|
@@ -4,8 +4,8 @@ import { ImageTag } from '../ImageTag';
|
|
|
4
4
|
import { CloseButton } from '../CloseButton';
|
|
5
5
|
import { x } from '@xstyled/styled-components';
|
|
6
6
|
export var ImageElement = function (_a) {
|
|
7
|
-
var label = _a.label, onImageRemove = _a.onImageRemove, isDisabled = _a.isDisabled,
|
|
7
|
+
var label = _a.label, onImageRemove = _a.onImageRemove, isDisabled = _a.isDisabled, onClick = _a.onClick, imageUrl = _a.imageUrl;
|
|
8
8
|
if (!imageUrl)
|
|
9
9
|
return null;
|
|
10
|
-
return (_jsxs(x.div, { position: "relative", pr: "15px", pt: "15px", w: "100px", h: "100px", children: [_jsx(Image, { src: imageUrl, alt: "", width: "85px", height: "85px", onClick:
|
|
10
|
+
return (_jsxs(x.div, { position: "relative", pr: "15px", pt: "15px", w: "100px", h: "100px", children: [_jsx(Image, { src: imageUrl, alt: "", width: "85px", height: "85px", onClick: onClick }), onImageRemove && _jsx(CloseButton, { onImageRemove: onImageRemove, isDisabled: isDisabled }), _jsx(ImageTag, { label: label })] }));
|
|
11
11
|
};
|
|
@@ -8,6 +8,7 @@ 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;
|
package/ui/index.es.js
CHANGED
|
@@ -50505,7 +50505,7 @@ const jEe = q.img`
|
|
|
50505
50505
|
label: e,
|
|
50506
50506
|
onImageRemove: t,
|
|
50507
50507
|
isDisabled: r,
|
|
50508
|
-
|
|
50508
|
+
onClick: n,
|
|
50509
50509
|
imageUrl: i
|
|
50510
50510
|
}) => i ? /* @__PURE__ */ g.jsxs(it.div, { position: "relative", pr: "15px", pt: "15px", w: "100px", h: "100px", children: [
|
|
50511
50511
|
/* @__PURE__ */ g.jsx(jEe, { src: i, alt: "", width: "85px", height: "85px", onClick: n }),
|
|
@@ -50524,25 +50524,26 @@ const jEe = q.img`
|
|
|
50524
50524
|
`, iTe = ({
|
|
50525
50525
|
onImageUpload: e,
|
|
50526
50526
|
onImageRemove: t,
|
|
50527
|
-
|
|
50528
|
-
|
|
50529
|
-
|
|
50530
|
-
|
|
50527
|
+
onImageClick: r,
|
|
50528
|
+
lightBoxAction: n,
|
|
50529
|
+
lightBoxActionTitle: i,
|
|
50530
|
+
images: o,
|
|
50531
|
+
isDisabled: l
|
|
50531
50532
|
}) => {
|
|
50532
|
-
const
|
|
50533
|
-
events:
|
|
50534
|
-
} = eSe(
|
|
50535
|
-
isMounted: !!(
|
|
50533
|
+
const c = We(), {
|
|
50534
|
+
events: u
|
|
50535
|
+
} = eSe(c, {
|
|
50536
|
+
isMounted: !!(o != null && o.length)
|
|
50536
50537
|
}), {
|
|
50537
|
-
isLightBoxOpen:
|
|
50538
|
-
onCloseLightBox:
|
|
50539
|
-
onOpenLightBox:
|
|
50540
|
-
lightBoxData:
|
|
50538
|
+
isLightBoxOpen: f,
|
|
50539
|
+
onCloseLightBox: p,
|
|
50540
|
+
onOpenLightBox: A,
|
|
50541
|
+
lightBoxData: v
|
|
50541
50542
|
} = REe();
|
|
50542
50543
|
return /* @__PURE__ */ g.jsxs(it.div, { display: "flex", alignItems: "flex-end", children: [
|
|
50543
|
-
/* @__PURE__ */ g.jsx(VEe, { onImageUpload: e, isDisabled:
|
|
50544
|
-
|
|
50545
|
-
/* @__PURE__ */ g.jsx(NEe, { initialSlide:
|
|
50544
|
+
/* @__PURE__ */ g.jsx(VEe, { onImageUpload: e, isDisabled: l }),
|
|
50545
|
+
o && /* @__PURE__ */ g.jsx(KEe, { ref: c, ...u, children: o.map((m, y) => /* @__PURE__ */ g.jsx(QEe, { imageUrl: m.smallUrl ?? m.url, onImageRemove: t == null ? void 0 : t(m.id), onClick: r ? r(m) : A(y), isDisabled: l, label: m == null ? void 0 : m.label }, m.id ?? y)) }),
|
|
50546
|
+
/* @__PURE__ */ g.jsx(NEe, { initialSlide: v == null ? void 0 : v.initialSlide, isLightBoxOpen: f, onCloseLightBox: p, lightBoxAction: n, lightBoxActionTitle: i, images: o })
|
|
50546
50547
|
] });
|
|
50547
50548
|
}, qEe = q.div`
|
|
50548
50549
|
cursor: pointer;
|