@eturnity/eturnity_reusable_components 1.0.40 → 1.0.44
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
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
@focus="focusInput()"
|
|
13
13
|
@keyup.enter="$emit('on-enter-click')"
|
|
14
14
|
:disabled="disabled"
|
|
15
|
+
:isDisabled="disabled"
|
|
15
16
|
:noBorder="noBorder"
|
|
16
17
|
:textAlign="textAlign"
|
|
17
18
|
/>
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
// inputWidth="150px" //by default, this is 100%
|
|
37
38
|
// :numberPrecision="3"
|
|
38
39
|
// unitName="pc"
|
|
40
|
+
// :numberPrecision="4"
|
|
39
41
|
// :value="inputValue" //required -- String
|
|
40
42
|
// @input-change="onInputChange($event)" //required
|
|
41
43
|
// @on-enter-click="onInputSubmit()"
|
|
@@ -61,7 +63,7 @@ const inputProps = {
|
|
|
61
63
|
hasUnit: Boolean,
|
|
62
64
|
inputWidth: String,
|
|
63
65
|
hasLength: Boolean,
|
|
64
|
-
|
|
66
|
+
isDisabled: Boolean,
|
|
65
67
|
noBorder: Boolean,
|
|
66
68
|
textAlign: String,
|
|
67
69
|
}
|
|
@@ -78,13 +80,13 @@ const InputContainer = styled("input", inputProps)`
|
|
|
78
80
|
props.hasUnit ? "11px 40px 11px 10px" : "11px 5px 11px 10px"};
|
|
79
81
|
border-radius: 4px;
|
|
80
82
|
text-align: ${(props) => props.textAlign};
|
|
81
|
-
cursor: ${(props) => (props.
|
|
83
|
+
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "auto")};
|
|
82
84
|
font-size: 16px;
|
|
83
85
|
color: ${(props) =>
|
|
84
86
|
props.isError ? props.theme.colors.red : props.theme.colors.black};
|
|
85
87
|
width: ${(props) => (props.inputWidth ? props.inputWidth : "100%")};
|
|
86
88
|
background-color: ${(props) =>
|
|
87
|
-
props.
|
|
89
|
+
props.isDisabled
|
|
88
90
|
? props.theme.colors.grey5 + " !important"
|
|
89
91
|
: "#fff !important"};
|
|
90
92
|
|
|
@@ -240,6 +242,9 @@ export default {
|
|
|
240
242
|
}
|
|
241
243
|
},
|
|
242
244
|
focusInput() {
|
|
245
|
+
if (this.disabled) {
|
|
246
|
+
return
|
|
247
|
+
}
|
|
243
248
|
this.isFocused = true
|
|
244
249
|
},
|
|
245
250
|
formatWithCurrency(value) {
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<table-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<table-
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
<page-container>
|
|
3
|
+
<table-title v-if="titleText">
|
|
4
|
+
{{ titleText }}
|
|
5
|
+
</table-title>
|
|
6
|
+
<table-scroll>
|
|
7
|
+
<table-wrapper :fullWidth="fullWidth">
|
|
8
|
+
<spinner-wrapper v-if="isLoading">
|
|
9
|
+
<spinner />
|
|
10
|
+
</spinner-wrapper>
|
|
11
|
+
<table-container v-else>
|
|
12
|
+
<slot />
|
|
13
|
+
</table-container>
|
|
14
|
+
</table-wrapper>
|
|
15
|
+
</table-scroll>
|
|
16
|
+
</page-container>
|
|
12
17
|
</template>
|
|
13
18
|
|
|
14
19
|
<script>
|
|
@@ -17,6 +22,14 @@
|
|
|
17
22
|
import styled from "vue-styled-components"
|
|
18
23
|
import Spinner from "../../spinner"
|
|
19
24
|
|
|
25
|
+
const PageContainer = styled.div``
|
|
26
|
+
|
|
27
|
+
const TableTitle = styled.div`
|
|
28
|
+
margin-bottom: 6px;
|
|
29
|
+
font-weight: bold;
|
|
30
|
+
font-size: 13px;
|
|
31
|
+
`
|
|
32
|
+
|
|
20
33
|
const TableScroll = styled.div`
|
|
21
34
|
position: relative;
|
|
22
35
|
max-width: 100%;
|
|
@@ -193,8 +206,8 @@ const TableContainer = styled.table`
|
|
|
193
206
|
}
|
|
194
207
|
|
|
195
208
|
&:hover {
|
|
196
|
-
input {
|
|
197
|
-
background-color: ${(props) => props.theme.colors.grey5};
|
|
209
|
+
input:disabled {
|
|
210
|
+
background-color: ${(props) => props.theme.colors.grey5 + "!important"};
|
|
198
211
|
}
|
|
199
212
|
|
|
200
213
|
.drag-icon {
|
|
@@ -204,7 +217,7 @@ const TableContainer = styled.table`
|
|
|
204
217
|
|
|
205
218
|
.drag-container {
|
|
206
219
|
display: table-cell;
|
|
207
|
-
width:
|
|
220
|
+
width: 12px;
|
|
208
221
|
vertical-align: middle;
|
|
209
222
|
}
|
|
210
223
|
|
|
@@ -253,6 +266,7 @@ const TableContainer = styled.table`
|
|
|
253
266
|
input {
|
|
254
267
|
font-size: 13px;
|
|
255
268
|
padding: 5px 10px;
|
|
269
|
+
background: #fff !important;
|
|
256
270
|
}
|
|
257
271
|
|
|
258
272
|
.open-container {
|
|
@@ -270,6 +284,8 @@ export default {
|
|
|
270
284
|
SpinnerWrapper,
|
|
271
285
|
Spinner,
|
|
272
286
|
TableContainer,
|
|
287
|
+
PageContainer,
|
|
288
|
+
TableTitle,
|
|
273
289
|
},
|
|
274
290
|
props: {
|
|
275
291
|
fullWidth: {
|
|
@@ -280,6 +296,10 @@ export default {
|
|
|
280
296
|
required: false,
|
|
281
297
|
default: false,
|
|
282
298
|
},
|
|
299
|
+
titleText: {
|
|
300
|
+
required: false,
|
|
301
|
+
default: null,
|
|
302
|
+
},
|
|
283
303
|
},
|
|
284
304
|
}
|
|
285
305
|
</script>
|