@mailstep/design-system 0.6.80-beta.4 → 0.6.80
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ImageData } from '../../LightBox';
|
|
2
2
|
type Props = {
|
|
3
3
|
onImageClick?: (item: ImageData) => void;
|
|
4
|
-
onOpenLightBox: (index: number) => void;
|
|
4
|
+
onOpenLightBox: (index: number) => () => void;
|
|
5
5
|
selectable?: boolean;
|
|
6
6
|
};
|
|
7
7
|
type HookType = (props: Props) => {
|
|
@@ -4,10 +4,12 @@ export var useOnElementClick = function (_a) {
|
|
|
4
4
|
var _b = useState(-1), selected = _b[0], setSelected = _b[1];
|
|
5
5
|
var handleOnClick = useCallback(function (item, index) { return function () {
|
|
6
6
|
if (onImageClick) {
|
|
7
|
+
console.log('test 2');
|
|
7
8
|
onImageClick(item);
|
|
8
9
|
}
|
|
9
10
|
else {
|
|
10
|
-
|
|
11
|
+
console.log('test 3');
|
|
12
|
+
onOpenLightBox(index)();
|
|
11
13
|
}
|
|
12
14
|
if (selectable) {
|
|
13
15
|
setSelected(function (selected) { return selected !== index ? index : -1; });
|
|
@@ -53,8 +53,11 @@ export var ImageListSelectable = {
|
|
|
53
53
|
};
|
|
54
54
|
export var ImageListLimited = {
|
|
55
55
|
args: {
|
|
56
|
-
images:
|
|
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
|
+
],
|
|
57
60
|
selectable: true,
|
|
58
|
-
max:
|
|
61
|
+
max: 1,
|
|
59
62
|
},
|
|
60
63
|
};
|
package/ui/index.es.js
CHANGED
|
@@ -50555,7 +50555,7 @@ const QEe = K.img`
|
|
|
50555
50555
|
const [n, i] = Be(-1);
|
|
50556
50556
|
return {
|
|
50557
50557
|
handleOnClick: we((l, c) => () => {
|
|
50558
|
-
e ? e(l) : t(c), r && i((u) => u !== c ? c : -1);
|
|
50558
|
+
e ? (console.log("test 2"), e(l)) : (console.log("test 3"), t(c)()), r && i((u) => u !== c ? c : -1);
|
|
50559
50559
|
}, [e, t]),
|
|
50560
50560
|
selected: n
|
|
50561
50561
|
};
|
package/ui/index.umd.js
CHANGED
|
@@ -3334,7 +3334,7 @@ ${$.current.stack}
|
|
|
3334
3334
|
height: ${({hasImageRemove:e})=>e?"100px":"85px"};
|
|
3335
3335
|
display: ${({visible:e})=>e?"block":"none"};
|
|
3336
3336
|
user-select: none;
|
|
3337
|
-
`,qIe=({label:e,onImageRemove:t,isDisabled:r,onClick:n,imageUrl:i,selected:o,visible:l})=>i?g.jsxs(KIe,{visible:l,hasImageRemove:!!t,children:[g.jsx(QIe,{src:i,alt:"",width:"85px",height:"85px",onClick:n,selected:o}),t&&g.jsx(HIe,{onImageRemove:t,isDisabled:r}),g.jsx(XIe,{label:e})]}):null,$Ie=({max:e,total:t=0})=>{const[r,n]=I.useState(0);return{moveList:I.useCallback(o=>()=>{e&&n(l=>Math.min(Math.max(l+o,0),t-e))},[]),position:r,hasControls:!!e&&t>e}},eke=({onImageClick:e,onOpenLightBox:t,selectable:r})=>{const[n,i]=I.useState(-1);return{handleOnClick:I.useCallback((l,c)=>()=>{e?e(l):t(c),r&&i(u=>u!==c?c:-1)},[e,t]),selected:n}},tke=q.div`
|
|
3337
|
+
`,qIe=({label:e,onImageRemove:t,isDisabled:r,onClick:n,imageUrl:i,selected:o,visible:l})=>i?g.jsxs(KIe,{visible:l,hasImageRemove:!!t,children:[g.jsx(QIe,{src:i,alt:"",width:"85px",height:"85px",onClick:n,selected:o}),t&&g.jsx(HIe,{onImageRemove:t,isDisabled:r}),g.jsx(XIe,{label:e})]}):null,$Ie=({max:e,total:t=0})=>{const[r,n]=I.useState(0);return{moveList:I.useCallback(o=>()=>{e&&n(l=>Math.min(Math.max(l+o,0),t-e))},[]),position:r,hasControls:!!e&&t>e}},eke=({onImageClick:e,onOpenLightBox:t,selectable:r})=>{const[n,i]=I.useState(-1);return{handleOnClick:I.useCallback((l,c)=>()=>{e?(console.log("test 2"),e(l)):(console.log("test 3"),t(c)()),r&&i(u=>u!==c?c:-1)},[e,t]),selected:n}},tke=q.div`
|
|
3338
3338
|
display: flex;
|
|
3339
3339
|
overflow-x: scroll;
|
|
3340
3340
|
-ms-overflow-style: none;
|