@rpg-engine/long-bow 0.7.26 → 0.7.28
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/components/Multitab/TabsContainer.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +40 -16
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +40 -16
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Multitab/TabsContainer.tsx +59 -17
package/package.json
CHANGED
|
@@ -29,6 +29,7 @@ export interface ITabsContainer {
|
|
|
29
29
|
imgSrc?: string;
|
|
30
30
|
imgWidth?: string;
|
|
31
31
|
};
|
|
32
|
+
isDraggableModal?: boolean;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
export const TabsContainer: React.FC<ITabsContainer> = ({
|
|
@@ -36,9 +37,10 @@ export const TabsContainer: React.FC<ITabsContainer> = ({
|
|
|
36
37
|
onCloseButton,
|
|
37
38
|
tabs,
|
|
38
39
|
type = MultitabType.Brown,
|
|
39
|
-
styles = {},
|
|
40
|
+
styles = {},
|
|
41
|
+
isDraggableModal = false,
|
|
40
42
|
}) => {
|
|
41
|
-
const [selectedTab, setSelectedTab] = useState(tabs[0].id);
|
|
43
|
+
const [selectedTab, setSelectedTab] = useState(tabs[0].id);
|
|
42
44
|
|
|
43
45
|
const onRenderTabs = () =>
|
|
44
46
|
tabs.map((tab, index) => (
|
|
@@ -62,20 +64,8 @@ export const TabsContainer: React.FC<ITabsContainer> = ({
|
|
|
62
64
|
}
|
|
63
65
|
};
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
onCloseButton={onCloseButton}
|
|
68
|
-
type={onGetContainerType()}
|
|
69
|
-
cancelDrag=".tabs-container *" // Disable drag on all elements inside .tabs-container
|
|
70
|
-
width={styles?.width} // use optional chaining
|
|
71
|
-
height={styles?.height}
|
|
72
|
-
minWidth={styles?.minWidth}
|
|
73
|
-
minHeight={styles?.minHeight}
|
|
74
|
-
className={styles?.className}
|
|
75
|
-
title={styles?.title}
|
|
76
|
-
imgSrc={styles?.imgSrc}
|
|
77
|
-
imgWidth={styles?.imgWidth}
|
|
78
|
-
>
|
|
67
|
+
const TabsCore = () => (
|
|
68
|
+
<>
|
|
79
69
|
{onRenderTabs()}
|
|
80
70
|
<BodyContainer
|
|
81
71
|
selectedTab={selectedTab}
|
|
@@ -83,7 +73,38 @@ export const TabsContainer: React.FC<ITabsContainer> = ({
|
|
|
83
73
|
>
|
|
84
74
|
{children}
|
|
85
75
|
</BodyContainer>
|
|
86
|
-
|
|
76
|
+
</>
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
if (isDraggableModal) {
|
|
80
|
+
return (
|
|
81
|
+
<DraggableContainer
|
|
82
|
+
onCloseButton={onCloseButton}
|
|
83
|
+
type={onGetContainerType()}
|
|
84
|
+
cancelDrag=".tabs-container *"
|
|
85
|
+
width={styles?.width}
|
|
86
|
+
height={styles?.height}
|
|
87
|
+
minWidth={styles?.minWidth}
|
|
88
|
+
minHeight={styles?.minHeight}
|
|
89
|
+
className={styles?.className}
|
|
90
|
+
title={styles?.title}
|
|
91
|
+
imgSrc={styles?.imgSrc}
|
|
92
|
+
imgWidth={styles?.imgWidth}
|
|
93
|
+
>
|
|
94
|
+
{TabsCore()}
|
|
95
|
+
</DraggableContainer>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<NonDraggableWrapper
|
|
101
|
+
width={styles?.width}
|
|
102
|
+
height={styles?.height}
|
|
103
|
+
minWidth={styles?.minWidth}
|
|
104
|
+
minHeight={styles?.minHeight}
|
|
105
|
+
>
|
|
106
|
+
{TabsCore()}
|
|
107
|
+
</NonDraggableWrapper>
|
|
87
108
|
);
|
|
88
109
|
};
|
|
89
110
|
|
|
@@ -92,6 +113,7 @@ interface IBodyContainer {
|
|
|
92
113
|
}
|
|
93
114
|
|
|
94
115
|
const BodyContainer = styled.div<IBodyContainer>`
|
|
116
|
+
|
|
95
117
|
display: flex;
|
|
96
118
|
width: 100%;
|
|
97
119
|
height: 100%;
|
|
@@ -115,3 +137,23 @@ const BodyContainer = styled.div<IBodyContainer>`
|
|
|
115
137
|
border-radius: 5px;
|
|
116
138
|
padding: 0.5rem;
|
|
117
139
|
`;
|
|
140
|
+
|
|
141
|
+
interface INonDraggableWrapperProps {
|
|
142
|
+
width?: string;
|
|
143
|
+
height?: string;
|
|
144
|
+
minWidth?: string;
|
|
145
|
+
minHeight?: string;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const NonDraggableWrapper = styled.div<INonDraggableWrapperProps>`
|
|
149
|
+
height: ${props => props.height || 'auto'};
|
|
150
|
+
width: ${props => props.width || '50%'};
|
|
151
|
+
min-width: ${props => props.minWidth || 'auto'};
|
|
152
|
+
min-height: ${props => props.minHeight || 'auto'};
|
|
153
|
+
display: flex;
|
|
154
|
+
flex-wrap: wrap;
|
|
155
|
+
image-rendering: pixelated;
|
|
156
|
+
overflow-y: hidden;
|
|
157
|
+
padding-top: 1.5rem;
|
|
158
|
+
position: relative;
|
|
159
|
+
`;
|