@rpg-engine/long-bow 0.2.19 → 0.2.21
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/shared/Ellipsis.d.ts +7 -0
- package/dist/long-bow.cjs.development.js +54 -77
- 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 +54 -77
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Dropdown.tsx +12 -19
- package/src/components/PropertySelect/PropertySelect.tsx +8 -3
- package/src/components/RangeSlider.tsx +14 -21
- package/src/components/shared/Ellipsis.tsx +46 -0
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
-
import { RPGUIForceRenderStart } from './RPGUIForceRenderStart';
|
|
4
3
|
import { _RPGUI } from './RPGUIRoot';
|
|
5
4
|
|
|
6
5
|
export interface IOptionsProps {
|
|
@@ -41,24 +40,18 @@ export const Dropdown: React.FC<IDropdownProps> = ({
|
|
|
41
40
|
}, [selectedValue]);
|
|
42
41
|
|
|
43
42
|
return (
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
<select
|
|
44
|
+
id={`rpgui-dropdown-${dropdownId}`}
|
|
45
|
+
style={{ width: width }}
|
|
46
|
+
className="rpgui-dropdown"
|
|
48
47
|
>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{option.option}
|
|
58
|
-
</option>
|
|
59
|
-
);
|
|
60
|
-
})}
|
|
61
|
-
</select>
|
|
62
|
-
</RPGUIForceRenderStart>
|
|
48
|
+
{options.map(option => {
|
|
49
|
+
return (
|
|
50
|
+
<option key={option.id} value={option.value}>
|
|
51
|
+
{option.option}
|
|
52
|
+
</option>
|
|
53
|
+
);
|
|
54
|
+
})}
|
|
55
|
+
</select>
|
|
63
56
|
);
|
|
64
57
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
+
import { Ellipsis } from '../shared/Ellipsis';
|
|
3
4
|
import LeftArrowClickIcon from './img/ui-arrows/arrow01-left-clicked.png';
|
|
4
5
|
import LeftArrowIcon from './img/ui-arrows/arrow01-left.png';
|
|
5
6
|
import RightArrowClickIcon from './img/ui-arrows/arrow01-right-clicked.png';
|
|
@@ -52,9 +53,12 @@ export const PropertySelect: React.FC<IPropertySelectProps> = ({
|
|
|
52
53
|
return (
|
|
53
54
|
<Container>
|
|
54
55
|
<TextOverlay>
|
|
55
|
-
<Item>
|
|
56
|
+
<Item>
|
|
57
|
+
<Ellipsis maxLines={1}>{getCurrentSelectionName()}</Ellipsis>
|
|
58
|
+
</Item>
|
|
56
59
|
</TextOverlay>
|
|
57
60
|
<div className="rpgui-progress-track"></div>
|
|
61
|
+
|
|
58
62
|
<LeftArrow onClick={onLeftClick} onTouchStart={onLeftClick}></LeftArrow>
|
|
59
63
|
<RightArrow
|
|
60
64
|
onClick={onRightClick}
|
|
@@ -70,9 +74,8 @@ const Item = styled.span`
|
|
|
70
74
|
text-align: center;
|
|
71
75
|
z-index: 1;
|
|
72
76
|
position: absolute;
|
|
73
|
-
left: 50%;
|
|
74
|
-
transform: translateX(-50%);
|
|
75
77
|
top: 12px;
|
|
78
|
+
width: 100%;
|
|
76
79
|
`;
|
|
77
80
|
|
|
78
81
|
const TextOverlay = styled.div`
|
|
@@ -106,6 +109,7 @@ const LeftArrow = styled.div`
|
|
|
106
109
|
:active {
|
|
107
110
|
background-image: url(${LeftArrowClickIcon});
|
|
108
111
|
}
|
|
112
|
+
z-index: 2;
|
|
109
113
|
`;
|
|
110
114
|
|
|
111
115
|
const RightArrow = styled.div`
|
|
@@ -118,6 +122,7 @@ const RightArrow = styled.div`
|
|
|
118
122
|
:active {
|
|
119
123
|
background-image: url(${RightArrowClickIcon});
|
|
120
124
|
}
|
|
125
|
+
z-index: 2;
|
|
121
126
|
`;
|
|
122
127
|
|
|
123
128
|
export default PropertySelect;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { v4 as uuidv4 } from 'uuid';
|
|
4
|
-
import { RPGUIForceRenderStart } from './RPGUIForceRenderStart';
|
|
5
4
|
import { _RPGUI } from './RPGUIRoot';
|
|
6
5
|
|
|
7
6
|
export enum RangeSliderType {
|
|
@@ -34,26 +33,20 @@ export const RangeSlider: React.FC<IRangeSliderProps> = ({
|
|
|
34
33
|
};
|
|
35
34
|
|
|
36
35
|
return (
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
min={valueMin}
|
|
52
|
-
max={valueMax}
|
|
53
|
-
id={`rpgui-slider-${sliderId}`}
|
|
54
|
-
/>
|
|
55
|
-
</div>
|
|
56
|
-
</RPGUIForceRenderStart>
|
|
36
|
+
<div onMouseUp={onHandleMouseUp}>
|
|
37
|
+
<Input
|
|
38
|
+
className={
|
|
39
|
+
type === RangeSliderType.Slider
|
|
40
|
+
? RangeSliderType.Slider
|
|
41
|
+
: RangeSliderType.GoldSlider
|
|
42
|
+
}
|
|
43
|
+
type="range"
|
|
44
|
+
style={{ width: width }}
|
|
45
|
+
min={valueMin}
|
|
46
|
+
max={valueMax}
|
|
47
|
+
id={`rpgui-slider-${sliderId}`}
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
57
50
|
);
|
|
58
51
|
};
|
|
59
52
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
interface IProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
maxLines: 1 | 2 | 3;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const Ellipsis = ({ children, maxLines }: IProps) => {
|
|
10
|
+
console.log('Ellipsis Component 2');
|
|
11
|
+
return (
|
|
12
|
+
<Container>
|
|
13
|
+
<div className={`ellipsis-${maxLines}-lines`}>{children}</div>
|
|
14
|
+
</Container>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const Container = styled.div`
|
|
19
|
+
.ellipsis-1-lines {
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
}
|
|
24
|
+
.ellipsis-2-lines {
|
|
25
|
+
display: -webkit-box;
|
|
26
|
+
max-width: 100%;
|
|
27
|
+
height: 25px;
|
|
28
|
+
margin: 0 auto;
|
|
29
|
+
line-height: 1;
|
|
30
|
+
-webkit-line-clamp: 2;
|
|
31
|
+
-webkit-box-orient: vertical;
|
|
32
|
+
text-overflow: ellipsis;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
}
|
|
35
|
+
.ellipsis-3-lines {
|
|
36
|
+
display: -webkit-box;
|
|
37
|
+
max-width: 100%;
|
|
38
|
+
height: 43px;
|
|
39
|
+
margin: 0 auto;
|
|
40
|
+
line-height: 1;
|
|
41
|
+
-webkit-line-clamp: 3;
|
|
42
|
+
-webkit-box-orient: vertical;
|
|
43
|
+
text-overflow: ellipsis;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
}
|
|
46
|
+
`;
|