@eturnity/eturnity_reusable_components 1.0.59 → 1.0.63
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
package/src/App.vue
CHANGED
|
@@ -24,12 +24,19 @@
|
|
|
24
24
|
</main-table>
|
|
25
25
|
<br />
|
|
26
26
|
<br />
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
<input-wrapper>
|
|
28
|
+
<input-number
|
|
29
|
+
placeholder="Enter Value"
|
|
30
|
+
unitName="kWh"
|
|
31
|
+
:value="inputValue"
|
|
32
|
+
@input-change="onInputChange($event)"
|
|
33
|
+
textAlign="left"
|
|
34
|
+
fontSize="13px"
|
|
35
|
+
labelText="Number of Modules"
|
|
36
|
+
labelInfoText="Here is some information for you..."
|
|
37
|
+
:disabled="true"
|
|
38
|
+
/>
|
|
39
|
+
</input-wrapper>
|
|
33
40
|
</page-container>
|
|
34
41
|
</ThemeProvider>
|
|
35
42
|
</template>
|
|
@@ -40,12 +47,17 @@ import theme from "./assets/theme"
|
|
|
40
47
|
import styled from "vue-styled-components"
|
|
41
48
|
import MainTable from "@/components/tables/mainTable"
|
|
42
49
|
import ThreeDots from "@/components/threeDots"
|
|
43
|
-
import
|
|
50
|
+
import InputNumber from "@/components/inputs/inputNumber"
|
|
44
51
|
|
|
45
52
|
const PageContainer = styled.div`
|
|
46
53
|
padding: 40px;
|
|
47
54
|
`
|
|
48
55
|
|
|
56
|
+
const InputWrapper = styled.div`
|
|
57
|
+
height: 36px;
|
|
58
|
+
width: 180px;
|
|
59
|
+
`
|
|
60
|
+
|
|
49
61
|
export default {
|
|
50
62
|
name: "App",
|
|
51
63
|
components: {
|
|
@@ -53,11 +65,12 @@ export default {
|
|
|
53
65
|
PageContainer,
|
|
54
66
|
MainTable,
|
|
55
67
|
ThreeDots,
|
|
56
|
-
|
|
68
|
+
InputNumber,
|
|
69
|
+
InputWrapper,
|
|
57
70
|
},
|
|
58
71
|
data() {
|
|
59
72
|
return {
|
|
60
|
-
inputValue:
|
|
73
|
+
inputValue: 10,
|
|
61
74
|
checkedOption: "button_1",
|
|
62
75
|
question: {
|
|
63
76
|
number_format_precision: 4,
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
:size="size"
|
|
7
7
|
:borderColor="borderColor"
|
|
8
8
|
@click.prevent="toggleShowInfo()"
|
|
9
|
+
@mouseenter="toggleShowInfo()"
|
|
10
|
+
@mouseleave="toggleShowInfo()"
|
|
9
11
|
>
|
|
10
12
|
<svg
|
|
11
13
|
class="img-icon"
|
|
@@ -52,35 +54,28 @@ const IconWrapper = styled.div`
|
|
|
52
54
|
const textAttrs = { borderColor: String, alignText: String }
|
|
53
55
|
const TextOverlay = styled("div", textAttrs)`
|
|
54
56
|
position: absolute;
|
|
55
|
-
top:
|
|
57
|
+
top: 26px;
|
|
56
58
|
right: ${(props) => (props.alignText === "left" ? "-10px" : "inherit")};
|
|
57
59
|
left: ${(props) => (props.alignText === "left" ? "inherit" : "-10px")};
|
|
58
|
-
background:
|
|
59
|
-
|
|
60
|
-
${(props) =>
|
|
61
|
-
props.borderColor ? props.borderColor : props.theme.colors.secondary};
|
|
62
|
-
padding: 16px;
|
|
60
|
+
background: ${(props) => props.theme.colors.black};
|
|
61
|
+
padding: 10px;
|
|
63
62
|
width: max-content;
|
|
64
63
|
max-width: 400px;
|
|
65
|
-
font-size:
|
|
64
|
+
font-size: 13px;
|
|
66
65
|
font-weight: 400;
|
|
67
66
|
border-radius: 4px;
|
|
68
67
|
z-index: 99;
|
|
69
|
-
color: ${(props) => props.theme.colors.
|
|
68
|
+
color: ${(props) => props.theme.colors.white};
|
|
70
69
|
|
|
71
70
|
:before {
|
|
72
71
|
content: "";
|
|
73
|
-
background-color:
|
|
72
|
+
background-color: ${(props) => props.theme.colors.black};
|
|
74
73
|
position: absolute;
|
|
75
74
|
top: 2px;
|
|
76
75
|
right: ${(props) => (props.alignText === "left" ? "-12px" : "inherit")};
|
|
77
76
|
left: ${(props) => (props.alignText === "left" ? "inherit" : "40px")};
|
|
78
77
|
height: 8px;
|
|
79
78
|
width: 8px;
|
|
80
|
-
border: 1px solid
|
|
81
|
-
${(props) =>
|
|
82
|
-
props.borderColor ? props.borderColor : props.theme.colors.secondary};
|
|
83
|
-
border-width: 1px 0 0 1px;
|
|
84
79
|
transform-origin: center center;
|
|
85
80
|
transform: translate(-2em, -0.5em) rotate(45deg);
|
|
86
81
|
}
|
|
@@ -49,7 +49,7 @@ const Container = styled("label", containerAttrs)`
|
|
|
49
49
|
align-content: center;
|
|
50
50
|
color: ${(props) => props.theme.colors.black};
|
|
51
51
|
position: relative;
|
|
52
|
-
padding-left: 42px;
|
|
52
|
+
/* padding-left: 42px; */
|
|
53
53
|
margin-bottom: 12px;
|
|
54
54
|
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
|
|
55
55
|
font-size: 16px;
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<container>
|
|
3
|
+
<label-wrapper v-if="labelText">
|
|
4
|
+
<label-text>
|
|
5
|
+
{{ labelText }}
|
|
6
|
+
</label-text>
|
|
7
|
+
<info-text
|
|
8
|
+
v-if="labelInfoText"
|
|
9
|
+
:text="labelInfoText"
|
|
10
|
+
borderColor="#ccc"
|
|
11
|
+
size="13"
|
|
12
|
+
:alignText="labelInfoAlign"
|
|
13
|
+
/>
|
|
14
|
+
</label-wrapper>
|
|
3
15
|
<input-wrapper>
|
|
4
16
|
<input-container
|
|
5
17
|
:hasUnit="unitName && !!unitName.length"
|
|
@@ -15,6 +27,7 @@
|
|
|
15
27
|
:isDisabled="disabled"
|
|
16
28
|
:noBorder="noBorder"
|
|
17
29
|
:textAlign="textAlign"
|
|
30
|
+
:fontSize="fontSize"
|
|
18
31
|
/>
|
|
19
32
|
<unit-container
|
|
20
33
|
v-if="unitName && showLinearUnitName"
|
|
@@ -28,7 +41,7 @@
|
|
|
28
41
|
</template>
|
|
29
42
|
|
|
30
43
|
<script>
|
|
31
|
-
// import
|
|
44
|
+
// import InputNumber from "@eturnity/eturnity_reusable_components/src/components/inputs/inputNumber"
|
|
32
45
|
//This component should be used for questions with input fields only
|
|
33
46
|
//How to use:
|
|
34
47
|
// <input-number
|
|
@@ -37,7 +50,6 @@
|
|
|
37
50
|
// inputWidth="150px" //by default, this is 100%
|
|
38
51
|
// :numberPrecision="3"
|
|
39
52
|
// unitName="pc"
|
|
40
|
-
// :numberPrecision="4"
|
|
41
53
|
// :value="inputValue" //required -- String
|
|
42
54
|
// @input-change="onInputChange($event)" //required
|
|
43
55
|
// @on-enter-click="onInputSubmit()"
|
|
@@ -46,12 +58,16 @@
|
|
|
46
58
|
// :noBorder="true"
|
|
47
59
|
// textAlign="left" // "left, right, center"
|
|
48
60
|
// :showLinearUnitName="true"
|
|
61
|
+
// fontSize="13px"
|
|
62
|
+
// labelText="Number of Modules"
|
|
63
|
+
// labelInfoText="Here is some information for you..."
|
|
49
64
|
// />
|
|
50
65
|
import styled from "vue-styled-components"
|
|
51
66
|
import {
|
|
52
67
|
stringToNumber,
|
|
53
68
|
numberToString,
|
|
54
69
|
} from "../../../helpers/numberConverter"
|
|
70
|
+
import InfoText from "../../infoText"
|
|
55
71
|
|
|
56
72
|
const Container = styled.div`
|
|
57
73
|
width: 100%;
|
|
@@ -66,6 +82,7 @@ const inputProps = {
|
|
|
66
82
|
isDisabled: Boolean,
|
|
67
83
|
noBorder: Boolean,
|
|
68
84
|
textAlign: String,
|
|
85
|
+
fontSize: String,
|
|
69
86
|
}
|
|
70
87
|
const InputContainer = styled("input", inputProps)`
|
|
71
88
|
border: ${(props) =>
|
|
@@ -81,7 +98,7 @@ const InputContainer = styled("input", inputProps)`
|
|
|
81
98
|
border-radius: 4px;
|
|
82
99
|
text-align: ${(props) => props.textAlign};
|
|
83
100
|
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "auto")};
|
|
84
|
-
font-size:
|
|
101
|
+
font-size: ${(props) => (props.fontSize ? props.fontSize : "13px")};
|
|
85
102
|
color: ${(props) =>
|
|
86
103
|
props.isError ? props.theme.colors.red : props.theme.colors.black};
|
|
87
104
|
width: ${(props) => (props.inputWidth ? props.inputWidth : "100%")};
|
|
@@ -89,7 +106,7 @@ const InputContainer = styled("input", inputProps)`
|
|
|
89
106
|
props.isDisabled
|
|
90
107
|
? props.theme.colors.grey5 + " !important"
|
|
91
108
|
: "#fff !important"};
|
|
92
|
-
|
|
109
|
+
box-sizing: border-box;
|
|
93
110
|
|
|
94
111
|
&::placeholder {
|
|
95
112
|
color: ${(props) =>
|
|
@@ -131,6 +148,17 @@ const ErrorMessage = styled.div`
|
|
|
131
148
|
padding-top: 16px;
|
|
132
149
|
`
|
|
133
150
|
|
|
151
|
+
const LabelWrapper = styled.div`
|
|
152
|
+
display: flex;
|
|
153
|
+
gap: 10px;
|
|
154
|
+
margin-bottom: 8px;
|
|
155
|
+
`
|
|
156
|
+
|
|
157
|
+
const LabelText = styled.div`
|
|
158
|
+
font-weight: bold;
|
|
159
|
+
font-size: 13px;
|
|
160
|
+
`
|
|
161
|
+
|
|
134
162
|
export default {
|
|
135
163
|
name: "input-number",
|
|
136
164
|
components: {
|
|
@@ -139,6 +167,9 @@ export default {
|
|
|
139
167
|
InputWrapper,
|
|
140
168
|
UnitContainer,
|
|
141
169
|
ErrorMessage,
|
|
170
|
+
LabelWrapper,
|
|
171
|
+
LabelText,
|
|
172
|
+
InfoText,
|
|
142
173
|
},
|
|
143
174
|
data() {
|
|
144
175
|
return {
|
|
@@ -195,6 +226,22 @@ export default {
|
|
|
195
226
|
required: false,
|
|
196
227
|
default: "left",
|
|
197
228
|
},
|
|
229
|
+
fontSize: {
|
|
230
|
+
required: false,
|
|
231
|
+
default: "13px",
|
|
232
|
+
},
|
|
233
|
+
labelText: {
|
|
234
|
+
required: false,
|
|
235
|
+
default: null,
|
|
236
|
+
},
|
|
237
|
+
labelInfoText: {
|
|
238
|
+
required: false,
|
|
239
|
+
default: null,
|
|
240
|
+
},
|
|
241
|
+
labelInfoAlign: {
|
|
242
|
+
required: false,
|
|
243
|
+
default: "right",
|
|
244
|
+
},
|
|
198
245
|
},
|
|
199
246
|
methods: {
|
|
200
247
|
onChangeHandler(event) {
|
|
@@ -81,11 +81,15 @@ const TableContainer = styled.table`
|
|
|
81
81
|
background-color: ${(props) => props.theme.colors.grey5};
|
|
82
82
|
cursor: pointer;
|
|
83
83
|
}
|
|
84
|
+
|
|
85
|
+
td {
|
|
86
|
+
height: 40px;
|
|
87
|
+
}
|
|
84
88
|
}
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
th {
|
|
88
|
-
padding: 11px
|
|
92
|
+
padding: 11px 15px;
|
|
89
93
|
background-color: ${(props) => props.theme.colors.blue1};
|
|
90
94
|
|
|
91
95
|
.ordering {
|
|
@@ -96,7 +100,7 @@ const TableContainer = styled.table`
|
|
|
96
100
|
}
|
|
97
101
|
|
|
98
102
|
td {
|
|
99
|
-
padding: 7px
|
|
103
|
+
padding: 7px 15px;
|
|
100
104
|
border-bottom: 1px solid ${(props) => props.theme.colors.grey4};
|
|
101
105
|
|
|
102
106
|
&.empty {
|
|
@@ -154,7 +158,7 @@ const TableContainer = styled.table`
|
|
|
154
158
|
}
|
|
155
159
|
|
|
156
160
|
&.checkbox {
|
|
157
|
-
padding: 7px
|
|
161
|
+
padding: 7px 15px !important;
|
|
158
162
|
width: 40px;
|
|
159
163
|
}
|
|
160
164
|
|
|
@@ -180,7 +184,7 @@ const TableContainer = styled.table`
|
|
|
180
184
|
}
|
|
181
185
|
|
|
182
186
|
.text {
|
|
183
|
-
padding: 10px
|
|
187
|
+
padding: 10px 15px 10px 15px;
|
|
184
188
|
color: ${(props) => props.theme.colors.black};
|
|
185
189
|
}
|
|
186
190
|
|