@eturnity/eturnity_reusable_components 1.2.2-QA15092022.1 → 1.2.11
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/src/App.vue +116 -58
- package/src/components/inputs/inputNumber/index.vue +71 -80
- package/src/components/inputs/radioButton/index.vue +7 -10
- package/src/components/modals/modal/index.vue +6 -22
- package/src/components/modals/modal/modal.stories.js +1 -2
- package/src/components/spinner/index.vue +13 -20
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -1,100 +1,158 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
|
|
3
3
|
<page-container>
|
|
4
|
+
<main-table titleText="My Table">
|
|
5
|
+
<thead>
|
|
6
|
+
<tr>
|
|
7
|
+
<th>Column 1</th>
|
|
8
|
+
<th>Column 2</th>
|
|
9
|
+
<th>Column 3</th>
|
|
10
|
+
<div />
|
|
11
|
+
</tr>
|
|
12
|
+
</thead>
|
|
13
|
+
<tbody>
|
|
14
|
+
<tr>
|
|
15
|
+
<!-- <table-dropdown
|
|
16
|
+
:colSpan="3"
|
|
17
|
+
:tableItems="getDropdownValues()"
|
|
18
|
+
@toggle-dropdown-open="toggleDropdownOpen()"
|
|
19
|
+
@item-selected="onItemSelected({ item: $event, index })"
|
|
20
|
+
:isOpen="isDropdownOpen()"
|
|
21
|
+
:optionItems="itemOptions"
|
|
22
|
+
:optionsDisplay="['display_name', 'company_item_number', 'model']"
|
|
23
|
+
/> -->
|
|
24
|
+
<td>Test</td>
|
|
25
|
+
<div class="icons-container">
|
|
26
|
+
<three-dots :options="listOptions" :isLoading="false" />
|
|
27
|
+
</div>
|
|
28
|
+
</tr>
|
|
29
|
+
</tbody>
|
|
30
|
+
</main-table>
|
|
31
|
+
<br />
|
|
32
|
+
<br />
|
|
33
|
+
<toggle
|
|
34
|
+
@on-toggle-change="onInputChange($event)"
|
|
35
|
+
:isChecked="inputValue"
|
|
36
|
+
label="My Label Text"
|
|
37
|
+
infoTextMessage="This is my test message"
|
|
38
|
+
infoTextAlign="right"
|
|
39
|
+
labelAlign="right"
|
|
40
|
+
:disabled="false"
|
|
41
|
+
/>
|
|
42
|
+
<br />
|
|
4
43
|
<input-number
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
44
|
+
placeholder="Enter distance"
|
|
45
|
+
:numberPrecision="2"
|
|
46
|
+
:value="inputValue"
|
|
47
|
+
@input-change="onInputChange($event)"
|
|
48
|
+
/>
|
|
49
|
+
<br />
|
|
50
|
+
<page-subtitle text="My Subtitle" infoText="My info Text" />
|
|
51
|
+
<spinner size="30px" />
|
|
52
|
+
<checkbox
|
|
53
|
+
label="Do you accept the Terms?"
|
|
54
|
+
:isChecked="true"
|
|
55
|
+
size="small"
|
|
56
|
+
:isDisabled="false"
|
|
11
57
|
/>
|
|
58
|
+
<external-button text="Click me!" minWidth="500px" />
|
|
12
59
|
</page-container>
|
|
13
60
|
</ThemeProvider>
|
|
14
61
|
</template>
|
|
15
62
|
|
|
16
63
|
<script>
|
|
17
|
-
import { ThemeProvider } from
|
|
18
|
-
import theme from
|
|
19
|
-
import styled from
|
|
20
|
-
import
|
|
64
|
+
import { ThemeProvider } from "vue-styled-components"
|
|
65
|
+
import theme from "./assets/theme"
|
|
66
|
+
import styled from "vue-styled-components"
|
|
67
|
+
import MainTable from "@/components/tables/mainTable"
|
|
68
|
+
import ThreeDots from "@/components/threeDots"
|
|
69
|
+
import Toggle from "@/components/inputs/toggle"
|
|
70
|
+
import InputNumber from "@/components/inputs/inputNumber"
|
|
71
|
+
import Checkbox from "@/components/inputs/checkbox"
|
|
72
|
+
import PageSubtitle from "@/components/pageSubtitle"
|
|
73
|
+
import Spinner from "@/components/spinner"
|
|
74
|
+
import ExternalButton from "@/components/buttons/externalButton"
|
|
75
|
+
// import TableDropdown from "@/components/tableDropdown"
|
|
21
76
|
|
|
22
77
|
const PageContainer = styled.div`
|
|
23
78
|
padding: 40px;
|
|
24
79
|
`
|
|
25
80
|
|
|
26
81
|
export default {
|
|
27
|
-
name:
|
|
82
|
+
name: "App",
|
|
28
83
|
components: {
|
|
29
84
|
ThemeProvider,
|
|
30
85
|
PageContainer,
|
|
31
|
-
|
|
86
|
+
MainTable,
|
|
87
|
+
ThreeDots,
|
|
88
|
+
Toggle,
|
|
89
|
+
InputNumber,
|
|
90
|
+
PageSubtitle,
|
|
91
|
+
Spinner,
|
|
92
|
+
Checkbox,
|
|
93
|
+
ExternalButton,
|
|
32
94
|
// TableDropdown,
|
|
33
95
|
},
|
|
34
96
|
data() {
|
|
35
97
|
return {
|
|
36
|
-
num: 42,
|
|
37
98
|
inputValue: null,
|
|
38
|
-
checkedOption:
|
|
99
|
+
checkedOption: "button_1",
|
|
39
100
|
question: {
|
|
40
101
|
number_format_precision: 4,
|
|
41
102
|
number_min_allowed: 0,
|
|
42
103
|
number_max_allowed: 10,
|
|
43
|
-
unit_short_name:
|
|
104
|
+
unit_short_name: "cm",
|
|
44
105
|
},
|
|
45
106
|
dropdownOpen: false,
|
|
46
107
|
isChecked: false,
|
|
47
108
|
listOptions: [
|
|
48
109
|
{
|
|
49
|
-
name:
|
|
50
|
-
value:
|
|
51
|
-
disabled: true
|
|
110
|
+
name: "Option 1",
|
|
111
|
+
value: "option_1",
|
|
112
|
+
disabled: true,
|
|
52
113
|
},
|
|
53
114
|
{
|
|
54
|
-
name:
|
|
55
|
-
value:
|
|
115
|
+
name: "Option 2",
|
|
116
|
+
value: "option_2",
|
|
56
117
|
},
|
|
57
118
|
{
|
|
58
|
-
name:
|
|
59
|
-
value:
|
|
119
|
+
name: "Option 3",
|
|
120
|
+
value: "option_3",
|
|
60
121
|
},
|
|
61
122
|
{
|
|
62
|
-
name:
|
|
63
|
-
value:
|
|
64
|
-
}
|
|
123
|
+
name: "Option 4",
|
|
124
|
+
value: "option_4",
|
|
125
|
+
},
|
|
65
126
|
],
|
|
66
127
|
itemOptions: [
|
|
67
128
|
{
|
|
68
|
-
display_name:
|
|
69
|
-
company_item_number:
|
|
70
|
-
model:
|
|
71
|
-
id: 1
|
|
129
|
+
display_name: "Test 1",
|
|
130
|
+
company_item_number: "123",
|
|
131
|
+
model: "BTB-2145 Long Text Long Text Long Text Long Text Long Text",
|
|
132
|
+
id: 1,
|
|
72
133
|
},
|
|
73
134
|
{
|
|
74
|
-
display_name:
|
|
75
|
-
company_item_number:
|
|
76
|
-
model:
|
|
77
|
-
id: 2
|
|
135
|
+
display_name: "Test 2",
|
|
136
|
+
company_item_number: "1234",
|
|
137
|
+
model: "BTB-123",
|
|
138
|
+
id: 2,
|
|
78
139
|
},
|
|
79
140
|
{
|
|
80
|
-
display_name:
|
|
81
|
-
company_item_number:
|
|
82
|
-
model:
|
|
83
|
-
id: 3
|
|
141
|
+
display_name: "Test 3",
|
|
142
|
+
company_item_number: "12345",
|
|
143
|
+
model: "BTB-543",
|
|
144
|
+
id: 3,
|
|
84
145
|
},
|
|
85
146
|
{
|
|
86
|
-
display_name:
|
|
87
|
-
company_item_number:
|
|
88
|
-
model:
|
|
89
|
-
id: 4
|
|
90
|
-
}
|
|
91
|
-
]
|
|
147
|
+
display_name: "Test 4",
|
|
148
|
+
company_item_number: "123456",
|
|
149
|
+
model: "BTB-4930",
|
|
150
|
+
id: 4,
|
|
151
|
+
},
|
|
152
|
+
],
|
|
92
153
|
}
|
|
93
154
|
},
|
|
94
155
|
methods: {
|
|
95
|
-
keydownHandler(e) {
|
|
96
|
-
console.log('test', e)
|
|
97
|
-
},
|
|
98
156
|
getTheme() {
|
|
99
157
|
return theme
|
|
100
158
|
},
|
|
@@ -105,7 +163,7 @@ export default {
|
|
|
105
163
|
return this.dropdownOpen
|
|
106
164
|
},
|
|
107
165
|
onClickButton() {
|
|
108
|
-
console.log(
|
|
166
|
+
console.log("Test")
|
|
109
167
|
},
|
|
110
168
|
toggleDropdownOpen() {
|
|
111
169
|
this.dropdownOpen = !this.dropdownOpen
|
|
@@ -116,21 +174,21 @@ export default {
|
|
|
116
174
|
{
|
|
117
175
|
value: this.getComponentInfo({
|
|
118
176
|
row: this.itemOptions[0],
|
|
119
|
-
value:
|
|
120
|
-
})
|
|
177
|
+
value: "display_name",
|
|
178
|
+
}),
|
|
121
179
|
},
|
|
122
180
|
{
|
|
123
181
|
value: this.getComponentInfo({
|
|
124
182
|
row: this.itemOptions[0],
|
|
125
|
-
value:
|
|
126
|
-
})
|
|
183
|
+
value: "company_item_number",
|
|
184
|
+
}),
|
|
127
185
|
},
|
|
128
186
|
{
|
|
129
187
|
value: this.getComponentInfo({
|
|
130
188
|
row: this.itemOptions[0],
|
|
131
|
-
value:
|
|
132
|
-
})
|
|
133
|
-
}
|
|
189
|
+
value: "model",
|
|
190
|
+
}),
|
|
191
|
+
},
|
|
134
192
|
]
|
|
135
193
|
return items
|
|
136
194
|
},
|
|
@@ -141,11 +199,11 @@ export default {
|
|
|
141
199
|
} else if (row[value]) {
|
|
142
200
|
item = row[value]
|
|
143
201
|
} else {
|
|
144
|
-
item =
|
|
202
|
+
item = "-"
|
|
145
203
|
}
|
|
146
204
|
return item
|
|
147
|
-
}
|
|
148
|
-
}
|
|
205
|
+
},
|
|
206
|
+
},
|
|
149
207
|
}
|
|
150
208
|
</script>
|
|
151
209
|
|
|
@@ -155,4 +213,4 @@ body {
|
|
|
155
213
|
height: 100%;
|
|
156
214
|
margin: 0;
|
|
157
215
|
}
|
|
158
|
-
</style>
|
|
216
|
+
</style>
|
|
@@ -14,10 +14,9 @@
|
|
|
14
14
|
</label-wrapper>
|
|
15
15
|
<input-wrapper>
|
|
16
16
|
<input-container
|
|
17
|
-
v-bind="$attrs"
|
|
18
17
|
ref="inputField1"
|
|
19
18
|
:hasUnit="unitName && !!unitName.length"
|
|
20
|
-
:placeholder="
|
|
19
|
+
:placeholder="placeholder"
|
|
21
20
|
:isError="isError"
|
|
22
21
|
:inputWidth="inputWidth"
|
|
23
22
|
:minWidth="minWidth"
|
|
@@ -31,7 +30,6 @@
|
|
|
31
30
|
:textAlign="textAlign"
|
|
32
31
|
:fontSize="fontSize"
|
|
33
32
|
:fontColor="fontColor"
|
|
34
|
-
v-on="$listeners"
|
|
35
33
|
/>
|
|
36
34
|
<unit-container
|
|
37
35
|
v-if="unitName && showLinearUnitName"
|
|
@@ -70,12 +68,12 @@
|
|
|
70
68
|
// :minNumber="0"
|
|
71
69
|
// fontColor="blue"
|
|
72
70
|
// />
|
|
73
|
-
import styled from
|
|
71
|
+
import styled from "vue-styled-components"
|
|
74
72
|
import {
|
|
75
73
|
stringToNumber,
|
|
76
|
-
numberToString
|
|
77
|
-
} from
|
|
78
|
-
import InfoText from
|
|
74
|
+
numberToString,
|
|
75
|
+
} from "../../../helpers/numberConverter"
|
|
76
|
+
import InfoText from "../../infoText"
|
|
79
77
|
|
|
80
78
|
const Container = styled.div`
|
|
81
79
|
width: 100%;
|
|
@@ -91,31 +89,31 @@ const inputProps = {
|
|
|
91
89
|
noBorder: Boolean,
|
|
92
90
|
textAlign: String,
|
|
93
91
|
fontSize: String,
|
|
94
|
-
fontColor: String
|
|
92
|
+
fontColor: String,
|
|
95
93
|
}
|
|
96
|
-
const InputContainer = styled(
|
|
94
|
+
const InputContainer = styled("input", inputProps)`
|
|
97
95
|
border: ${(props) =>
|
|
98
96
|
props.isError
|
|
99
|
-
?
|
|
97
|
+
? "1px solid " + props.theme.colors.red
|
|
100
98
|
: props.noBorder
|
|
101
|
-
?
|
|
102
|
-
:
|
|
99
|
+
? "none"
|
|
100
|
+
: "1px solid " + props.theme.colors.mediumGray};
|
|
103
101
|
padding: ${(props) =>
|
|
104
|
-
props.hasUnit ?
|
|
102
|
+
props.hasUnit ? "11px 40px 11px 10px" : "11px 5px 11px 10px"};
|
|
105
103
|
border-radius: 4px;
|
|
106
104
|
text-align: ${(props) => props.textAlign};
|
|
107
|
-
cursor: ${(props) => (props.isDisabled ?
|
|
108
|
-
font-size: ${(props) => (props.fontSize ? props.fontSize :
|
|
105
|
+
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "auto")};
|
|
106
|
+
font-size: ${(props) => (props.fontSize ? props.fontSize : "13px")};
|
|
109
107
|
color: ${(props) =>
|
|
110
108
|
props.isError
|
|
111
109
|
? props.theme.colors.red
|
|
112
110
|
: props.fontColor
|
|
113
|
-
? props.fontColor +
|
|
111
|
+
? props.fontColor + " !important"
|
|
114
112
|
: props.theme.colors.black};
|
|
115
|
-
width: ${(props) => (props.inputWidth ? props.inputWidth :
|
|
116
|
-
min-width: ${(props) => (props.minWidth ? props.minWidth :
|
|
113
|
+
width: ${(props) => (props.inputWidth ? props.inputWidth : "100%")};
|
|
114
|
+
min-width: ${(props) => (props.minWidth ? props.minWidth : "unset")};
|
|
117
115
|
background-color: ${(props) =>
|
|
118
|
-
props.isDisabled ? props.theme.colors.grey5 :
|
|
116
|
+
props.isDisabled ? props.theme.colors.grey5 : "#fff"};
|
|
119
117
|
box-sizing: border-box;
|
|
120
118
|
|
|
121
119
|
&::placeholder {
|
|
@@ -132,7 +130,7 @@ const InputWrapper = styled.span`
|
|
|
132
130
|
position: relative;
|
|
133
131
|
`
|
|
134
132
|
|
|
135
|
-
const UnitContainer = styled(
|
|
133
|
+
const UnitContainer = styled("span", inputProps)`
|
|
136
134
|
border-left: 1px solid
|
|
137
135
|
${(props) =>
|
|
138
136
|
props.isError
|
|
@@ -171,7 +169,7 @@ const LabelText = styled.div`
|
|
|
171
169
|
`
|
|
172
170
|
|
|
173
171
|
export default {
|
|
174
|
-
name:
|
|
172
|
+
name: "input-number",
|
|
175
173
|
components: {
|
|
176
174
|
Container,
|
|
177
175
|
InputContainer,
|
|
@@ -180,138 +178,131 @@ export default {
|
|
|
180
178
|
ErrorMessage,
|
|
181
179
|
LabelWrapper,
|
|
182
180
|
LabelText,
|
|
183
|
-
InfoText
|
|
181
|
+
InfoText,
|
|
184
182
|
},
|
|
185
|
-
inheritAttrs: false,
|
|
186
183
|
data() {
|
|
187
184
|
return {
|
|
188
|
-
textInput:
|
|
189
|
-
isFocused: false
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
computed: {
|
|
193
|
-
displayedPlaceholder() {
|
|
194
|
-
if (this.placeholder) return this.placeholder
|
|
195
|
-
return `${this.minNumber || 0} ${this.unitName ? this.unitName : ''}`
|
|
185
|
+
textInput: "",
|
|
186
|
+
isFocused: false,
|
|
196
187
|
}
|
|
197
188
|
},
|
|
198
189
|
props: {
|
|
199
190
|
placeholder: {
|
|
200
191
|
required: false,
|
|
201
|
-
default:
|
|
192
|
+
default: "",
|
|
202
193
|
},
|
|
203
194
|
isError: {
|
|
204
195
|
required: false,
|
|
205
|
-
default: false
|
|
196
|
+
default: false,
|
|
206
197
|
},
|
|
207
198
|
inputWidth: {
|
|
208
199
|
required: false,
|
|
209
|
-
default: null
|
|
200
|
+
default: null,
|
|
210
201
|
},
|
|
211
202
|
minWidth: {
|
|
212
203
|
required: false,
|
|
213
|
-
default: null
|
|
204
|
+
default: null,
|
|
214
205
|
},
|
|
215
206
|
value: {
|
|
216
207
|
required: true,
|
|
217
|
-
default: null
|
|
208
|
+
default: null,
|
|
218
209
|
},
|
|
219
210
|
clearInput: {
|
|
220
211
|
required: false,
|
|
221
|
-
default: false
|
|
212
|
+
default: false,
|
|
222
213
|
},
|
|
223
214
|
errorMessage: {
|
|
224
215
|
required: false,
|
|
225
|
-
default:
|
|
216
|
+
default: "Please insert a correct number",
|
|
226
217
|
},
|
|
227
218
|
numberPrecision: {
|
|
228
219
|
required: false,
|
|
229
|
-
default: 0
|
|
220
|
+
default: 0,
|
|
230
221
|
},
|
|
231
222
|
unitName: {
|
|
232
223
|
required: false,
|
|
233
|
-
default:
|
|
224
|
+
default: "",
|
|
234
225
|
},
|
|
235
226
|
showLinearUnitName: {
|
|
236
227
|
required: false,
|
|
237
|
-
default: false
|
|
228
|
+
default: false,
|
|
238
229
|
},
|
|
239
230
|
disabled: {
|
|
240
231
|
required: false,
|
|
241
|
-
default: false
|
|
232
|
+
default: false,
|
|
242
233
|
},
|
|
243
234
|
noBorder: {
|
|
244
235
|
required: false,
|
|
245
|
-
default: false
|
|
236
|
+
default: false,
|
|
246
237
|
},
|
|
247
238
|
textAlign: {
|
|
248
239
|
required: false,
|
|
249
|
-
default:
|
|
240
|
+
default: "left",
|
|
250
241
|
},
|
|
251
242
|
fontSize: {
|
|
252
243
|
required: false,
|
|
253
|
-
default:
|
|
244
|
+
default: "13px",
|
|
254
245
|
},
|
|
255
246
|
labelText: {
|
|
256
247
|
required: false,
|
|
257
|
-
default: null
|
|
248
|
+
default: null,
|
|
258
249
|
},
|
|
259
250
|
labelInfoText: {
|
|
260
251
|
required: false,
|
|
261
|
-
default: null
|
|
252
|
+
default: null,
|
|
262
253
|
},
|
|
263
254
|
labelInfoAlign: {
|
|
264
255
|
required: false,
|
|
265
|
-
default:
|
|
256
|
+
default: "right",
|
|
266
257
|
},
|
|
267
258
|
minNumber: {
|
|
268
259
|
required: false,
|
|
269
|
-
default: null
|
|
260
|
+
default: null,
|
|
270
261
|
},
|
|
271
262
|
fontColor: {
|
|
272
263
|
required: false,
|
|
273
|
-
default: null
|
|
264
|
+
default: null,
|
|
274
265
|
},
|
|
275
266
|
numberToStringEnabled: {
|
|
276
267
|
required: false,
|
|
277
|
-
default: true
|
|
278
|
-
}
|
|
268
|
+
default: true,
|
|
269
|
+
},
|
|
279
270
|
},
|
|
280
271
|
methods: {
|
|
281
272
|
onChangeHandler(event) {
|
|
282
273
|
if (isNaN(event)) {
|
|
283
274
|
event = this.minNumber || this.minNumber === 0 ? this.minNumber : event
|
|
284
275
|
}
|
|
285
|
-
this.$emit(
|
|
276
|
+
this.$emit("input-change", event)
|
|
286
277
|
},
|
|
287
278
|
onEvaluateCode(val) {
|
|
288
279
|
// function to perform math on the code
|
|
289
280
|
// filter the string in case of any malicious content
|
|
290
|
-
let filtered = val.replace(/[^-()\d/*+.,]/g,
|
|
281
|
+
let filtered = val.replace(/[^-()\d/*+.,]/g, "")
|
|
291
282
|
filtered = filtered.split(/([-+*/()])/)
|
|
292
283
|
let formatted = filtered.map((item) => {
|
|
293
284
|
if (
|
|
294
|
-
item ===
|
|
295
|
-
item ===
|
|
296
|
-
item ===
|
|
297
|
-
item ===
|
|
298
|
-
item ===
|
|
299
|
-
item ===
|
|
300
|
-
item ===
|
|
285
|
+
item === "+" ||
|
|
286
|
+
item === "-" ||
|
|
287
|
+
item === "*" ||
|
|
288
|
+
item === "/" ||
|
|
289
|
+
item === "(" ||
|
|
290
|
+
item === ")" ||
|
|
291
|
+
item === ""
|
|
301
292
|
) {
|
|
302
293
|
return item
|
|
303
294
|
} else {
|
|
304
295
|
let num = stringToNumber({
|
|
305
296
|
value: item,
|
|
306
|
-
numberPrecision: false
|
|
297
|
+
numberPrecision: false,
|
|
307
298
|
})
|
|
308
299
|
return num
|
|
309
300
|
}
|
|
310
301
|
})
|
|
311
|
-
let evaluated = eval(formatted.join(
|
|
302
|
+
let evaluated = eval(formatted.join(""))
|
|
312
303
|
evaluated = stringToNumber({
|
|
313
304
|
value: evaluated,
|
|
314
|
-
numberPrecision: this.numberPrecision
|
|
305
|
+
numberPrecision: this.numberPrecision,
|
|
315
306
|
})
|
|
316
307
|
return evaluated
|
|
317
308
|
},
|
|
@@ -324,7 +315,7 @@ export default {
|
|
|
324
315
|
this.textInput = numberToString({
|
|
325
316
|
value:
|
|
326
317
|
evaluatedInput && value.length ? evaluatedInput : this.minNumber,
|
|
327
|
-
numberPrecision: this.numberPrecision
|
|
318
|
+
numberPrecision: this.numberPrecision,
|
|
328
319
|
})
|
|
329
320
|
}
|
|
330
321
|
let adjustedMinValue =
|
|
@@ -332,8 +323,8 @@ export default {
|
|
|
332
323
|
? value
|
|
333
324
|
: this.minNumber || this.minNumber === 0
|
|
334
325
|
? this.minNumber
|
|
335
|
-
:
|
|
336
|
-
this.$emit(
|
|
326
|
+
: ""
|
|
327
|
+
this.$emit("input-blur", adjustedMinValue)
|
|
337
328
|
},
|
|
338
329
|
focusInput() {
|
|
339
330
|
if (this.disabled) {
|
|
@@ -350,38 +341,38 @@ export default {
|
|
|
350
341
|
? value
|
|
351
342
|
: this.minNumber || this.minNumber === 0
|
|
352
343
|
? this.minNumber
|
|
353
|
-
:
|
|
344
|
+
: ""
|
|
354
345
|
if ((adjustedMinValue || adjustedMinValue === 0) && !this.isFocused) {
|
|
355
346
|
let input = this.numberToStringEnabled
|
|
356
347
|
? numberToString({
|
|
357
348
|
value: adjustedMinValue,
|
|
358
|
-
numberPrecision: this.numberPrecision
|
|
349
|
+
numberPrecision: this.numberPrecision,
|
|
359
350
|
})
|
|
360
351
|
: adjustedMinValue
|
|
361
|
-
let unit = this.showLinearUnitName ?
|
|
362
|
-
return input +
|
|
352
|
+
let unit = this.showLinearUnitName ? "" : this.unitName
|
|
353
|
+
return input + " " + unit
|
|
363
354
|
} else if (!adjustedMinValue && adjustedMinValue !== 0) {
|
|
364
|
-
return
|
|
355
|
+
return ""
|
|
365
356
|
} else {
|
|
366
357
|
return this.numberToStringEnabled
|
|
367
358
|
? numberToString({
|
|
368
359
|
value: adjustedMinValue,
|
|
369
|
-
numberPrecision: this.numberPrecision
|
|
360
|
+
numberPrecision: this.numberPrecision,
|
|
370
361
|
})
|
|
371
362
|
: adjustedMinValue
|
|
372
363
|
}
|
|
373
|
-
}
|
|
364
|
+
},
|
|
374
365
|
},
|
|
375
366
|
created() {
|
|
376
367
|
if (this.value) {
|
|
377
368
|
this.textInput = numberToString({
|
|
378
369
|
value: this.value,
|
|
379
|
-
numberPrecision: this.numberPrecision
|
|
370
|
+
numberPrecision: this.numberPrecision,
|
|
380
371
|
})
|
|
381
372
|
} else if (this.minNumber !== null) {
|
|
382
373
|
this.textInput = numberToString({
|
|
383
374
|
value: this.minNumber,
|
|
384
|
-
numberPrecision: this.numberPrecision
|
|
375
|
+
numberPrecision: this.numberPrecision,
|
|
385
376
|
})
|
|
386
377
|
}
|
|
387
378
|
},
|
|
@@ -389,9 +380,9 @@ export default {
|
|
|
389
380
|
clearInput: function (value) {
|
|
390
381
|
if (value) {
|
|
391
382
|
// If the value is typed, then we should clear the textInput on Continue
|
|
392
|
-
this.textInput =
|
|
383
|
+
this.textInput = ""
|
|
393
384
|
}
|
|
394
|
-
}
|
|
395
|
-
}
|
|
385
|
+
},
|
|
386
|
+
},
|
|
396
387
|
}
|
|
397
|
-
</script>
|
|
388
|
+
</script>
|
|
@@ -107,46 +107,43 @@ const LabelContainer = styled("label", containerProps)`
|
|
|
107
107
|
align-self: baseline;
|
|
108
108
|
|
|
109
109
|
.checkmark {
|
|
110
|
-
position: relative;
|
|
111
110
|
height: ${(props) =>
|
|
112
111
|
props.size === "large"
|
|
113
112
|
? "23px"
|
|
114
113
|
: props.size === "medium"
|
|
115
|
-
? "
|
|
114
|
+
? "16px"
|
|
116
115
|
: "12px"};
|
|
117
116
|
width: ${(props) =>
|
|
118
117
|
props.size === "large"
|
|
119
118
|
? "23px"
|
|
120
119
|
: props.size === "medium"
|
|
121
|
-
? "
|
|
120
|
+
? "16px"
|
|
122
121
|
: "12px"};
|
|
123
122
|
background-color: #fff;
|
|
124
123
|
border-radius: 100%;
|
|
125
124
|
border: 1px solid ${(props) => props.theme.colors.mediumGray};
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
justify-content: center;
|
|
126
128
|
|
|
127
129
|
&:after {
|
|
128
130
|
content: "";
|
|
129
|
-
position: absolute;
|
|
130
131
|
display: none;
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
.checkmark:after {
|
|
135
|
-
top: ${(props) =>
|
|
136
|
-
props.size === "large" ? "6px" : props.size === "medium" ? "5px" : "3px"};
|
|
137
|
-
left: ${(props) =>
|
|
138
|
-
props.size === "large" ? "7px" : props.size === "medium" ? "5px" : "3px"};
|
|
139
136
|
width: ${(props) =>
|
|
140
137
|
props.size === "large"
|
|
141
138
|
? "10px"
|
|
142
139
|
: props.size === "medium"
|
|
143
|
-
? "
|
|
140
|
+
? "8px"
|
|
144
141
|
: "6px"};
|
|
145
142
|
height: ${(props) =>
|
|
146
143
|
props.size === "large"
|
|
147
144
|
? "10px"
|
|
148
145
|
: props.size === "medium"
|
|
149
|
-
? "
|
|
146
|
+
? "8px"
|
|
150
147
|
: "6px"};
|
|
151
148
|
border-radius: 100%;
|
|
152
149
|
background: ${(props) => props.theme.colors.primary};
|
|
@@ -3,18 +3,15 @@
|
|
|
3
3
|
:isOpen="isOpen"
|
|
4
4
|
:class="{ visible: isOpen, hidden: !isOpen }"
|
|
5
5
|
@click.native="onOutsideClose()"
|
|
6
|
-
:backdrop="backdrop"
|
|
7
6
|
>
|
|
8
7
|
<modal-container @click.stop>
|
|
9
|
-
<spinner v-if="isLoading" size="50px" :
|
|
10
|
-
<content-container :visible="!isLoading">
|
|
11
|
-
<slot />
|
|
12
|
-
</content-container>
|
|
8
|
+
<spinner v-if="isLoading" size="50px" :fullWidth="true" />
|
|
13
9
|
<close-button
|
|
14
10
|
v-if="!hideClose"
|
|
15
11
|
@click.native="onCloseModal()"
|
|
16
12
|
class="close"
|
|
17
13
|
/>
|
|
14
|
+
<slot />
|
|
18
15
|
</modal-container>
|
|
19
16
|
</page-wrapper>
|
|
20
17
|
</template>
|
|
@@ -31,12 +28,7 @@ import styled from 'vue-styled-components'
|
|
|
31
28
|
import CloseButton from '../../buttons/closeButton'
|
|
32
29
|
import Spinner from '../../spinner'
|
|
33
30
|
|
|
34
|
-
const
|
|
35
|
-
const ContentContainer = styled('div', contentAttrs)`
|
|
36
|
-
visibility: ${(props) => (props.visible ? 'inherit' : 'hidden')};
|
|
37
|
-
`
|
|
38
|
-
|
|
39
|
-
const pageAttrs = { isOpen: Boolean, backdrop: String }
|
|
31
|
+
const pageAttrs = { isOpen: Boolean }
|
|
40
32
|
const PageWrapper = styled('div', pageAttrs)`
|
|
41
33
|
position: fixed;
|
|
42
34
|
display: grid;
|
|
@@ -44,10 +36,7 @@ const PageWrapper = styled('div', pageAttrs)`
|
|
|
44
36
|
left: 0;
|
|
45
37
|
width: 100%;
|
|
46
38
|
height: 100%;
|
|
47
|
-
background-color:
|
|
48
|
-
props.backdrop == 'dark'
|
|
49
|
-
? 'rgba(0, 0, 0, 0.4)'
|
|
50
|
-
: 'rgba(255, 255, 255, 0.9)'};
|
|
39
|
+
background-color: rgba(255, 255, 255, 0.9);
|
|
51
40
|
z-index: 99999;
|
|
52
41
|
overflow: auto;
|
|
53
42
|
|
|
@@ -109,8 +98,7 @@ export default {
|
|
|
109
98
|
PageWrapper,
|
|
110
99
|
ModalContainer,
|
|
111
100
|
CloseButton,
|
|
112
|
-
Spinner
|
|
113
|
-
ContentContainer
|
|
101
|
+
Spinner
|
|
114
102
|
},
|
|
115
103
|
props: {
|
|
116
104
|
isOpen: {
|
|
@@ -128,10 +116,6 @@ export default {
|
|
|
128
116
|
hideClose: {
|
|
129
117
|
required: false,
|
|
130
118
|
default: false
|
|
131
|
-
},
|
|
132
|
-
backdrop: {
|
|
133
|
-
required: false,
|
|
134
|
-
default: 'white'
|
|
135
119
|
}
|
|
136
120
|
},
|
|
137
121
|
methods: {
|
|
@@ -151,4 +135,4 @@ export default {
|
|
|
151
135
|
}
|
|
152
136
|
}
|
|
153
137
|
}
|
|
154
|
-
</script>
|
|
138
|
+
</script>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/>
|
|
8
8
|
</container>
|
|
9
9
|
</spinner-container>
|
|
10
|
-
<container v-else
|
|
10
|
+
<container v-else>
|
|
11
11
|
<spinner-wrapper
|
|
12
12
|
:size="size"
|
|
13
13
|
:src="require('../../assets/icons/black_spinner.svg')"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<script>
|
|
19
19
|
// import Spinner from "@eturnity/eturnity_reusable_components/src/components/spinner"
|
|
20
20
|
// <spinner size="30px" />
|
|
21
|
-
import styled from
|
|
21
|
+
import styled from "vue-styled-components"
|
|
22
22
|
|
|
23
23
|
const SpinnerContainer = styled.div`
|
|
24
24
|
position: fixed;
|
|
@@ -32,41 +32,34 @@ const SpinnerContainer = styled.div`
|
|
|
32
32
|
justify-items: center;
|
|
33
33
|
z-index: 100;
|
|
34
34
|
`
|
|
35
|
-
|
|
36
|
-
const Container = styled
|
|
35
|
+
|
|
36
|
+
const Container = styled.div`
|
|
37
37
|
display: grid;
|
|
38
38
|
align-items: center;
|
|
39
39
|
justify-items: center;
|
|
40
|
-
position: ${(props) => (props.limitedToModal ? 'absolute' : 'inherit')};
|
|
41
|
-
height: ${(props) => (props.limitedToModal ? '100%' : 'inherit')};
|
|
42
|
-
width: ${(props) => (props.limitedToModal ? '100%' : 'inherit')};
|
|
43
40
|
`
|
|
44
41
|
|
|
45
42
|
const spinnerAttrs = { size: String }
|
|
46
|
-
const SpinnerWrapper = styled(
|
|
47
|
-
width: ${(props) => (props.size ? props.size :
|
|
43
|
+
const SpinnerWrapper = styled("img", spinnerAttrs)`
|
|
44
|
+
width: ${(props) => (props.size ? props.size : "60px")};
|
|
48
45
|
`
|
|
49
46
|
|
|
50
47
|
export default {
|
|
51
|
-
name:
|
|
48
|
+
name: "spinner",
|
|
52
49
|
components: {
|
|
53
50
|
Container,
|
|
54
51
|
SpinnerWrapper,
|
|
55
|
-
SpinnerContainer
|
|
52
|
+
SpinnerContainer,
|
|
56
53
|
},
|
|
57
54
|
props: {
|
|
58
55
|
fullWidth: {
|
|
59
56
|
required: false,
|
|
60
|
-
default: false
|
|
61
|
-
},
|
|
62
|
-
limitedToModal: {
|
|
63
|
-
required: false,
|
|
64
|
-
default: false
|
|
57
|
+
default: false,
|
|
65
58
|
},
|
|
66
59
|
size: {
|
|
67
60
|
required: false,
|
|
68
|
-
default: null
|
|
69
|
-
}
|
|
70
|
-
}
|
|
61
|
+
default: null,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
71
64
|
}
|
|
72
|
-
</script>
|
|
65
|
+
</script>
|