@eturnity/eturnity_reusable_components 1.0.84 → 1.0.88
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,21 +12,17 @@
|
|
|
12
12
|
</thead>
|
|
13
13
|
<tbody>
|
|
14
14
|
<tr>
|
|
15
|
-
<
|
|
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
|
+
/> -->
|
|
16
24
|
<td>
|
|
17
|
-
<
|
|
18
|
-
@on-toggle-change="onInputChange($event)"
|
|
19
|
-
:isChecked="isChecked"
|
|
20
|
-
labelAlign="right"
|
|
21
|
-
/>
|
|
22
|
-
</td>
|
|
23
|
-
<td>
|
|
24
|
-
<toggle
|
|
25
|
-
@on-toggle-change="onInputChange($event)"
|
|
26
|
-
:isChecked="isChecked"
|
|
27
|
-
labelAlign="right"
|
|
28
|
-
:disabled="true"
|
|
29
|
-
/>
|
|
25
|
+
<search-input />
|
|
30
26
|
</td>
|
|
31
27
|
<div class="icons-container">
|
|
32
28
|
<three-dots :options="listOptions" :isLoading="false" />
|
|
@@ -54,6 +50,8 @@ import styled from "vue-styled-components"
|
|
|
54
50
|
import MainTable from "@/components/tables/mainTable"
|
|
55
51
|
import ThreeDots from "@/components/threeDots"
|
|
56
52
|
import Toggle from "@/components/inputs/toggle"
|
|
53
|
+
import SearchInput from "@/components/inputs/searchInput"
|
|
54
|
+
// import TableDropdown from "@/components/tableDropdown"
|
|
57
55
|
|
|
58
56
|
const PageContainer = styled.div`
|
|
59
57
|
padding: 40px;
|
|
@@ -67,6 +65,8 @@ export default {
|
|
|
67
65
|
MainTable,
|
|
68
66
|
ThreeDots,
|
|
69
67
|
Toggle,
|
|
68
|
+
SearchInput,
|
|
69
|
+
// TableDropdown,
|
|
70
70
|
},
|
|
71
71
|
data() {
|
|
72
72
|
return {
|
|
@@ -78,6 +78,7 @@ export default {
|
|
|
78
78
|
number_max_allowed: 10,
|
|
79
79
|
unit_short_name: "cm",
|
|
80
80
|
},
|
|
81
|
+
dropdownOpen: false,
|
|
81
82
|
isChecked: false,
|
|
82
83
|
listOptions: [
|
|
83
84
|
{
|
|
@@ -125,6 +126,32 @@ export default {
|
|
|
125
126
|
value: "option_4",
|
|
126
127
|
},
|
|
127
128
|
],
|
|
129
|
+
itemOptions: [
|
|
130
|
+
{
|
|
131
|
+
display_name: "Test 1",
|
|
132
|
+
company_item_number: "123",
|
|
133
|
+
model: "BTB-2145 Long Text Long Text Long Text Long Text Long Text",
|
|
134
|
+
id: 1,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
display_name: "Test 2",
|
|
138
|
+
company_item_number: "1234",
|
|
139
|
+
model: "BTB-123",
|
|
140
|
+
id: 2,
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
display_name: "Test 3",
|
|
144
|
+
company_item_number: "12345",
|
|
145
|
+
model: "BTB-543",
|
|
146
|
+
id: 3,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
display_name: "Test 4",
|
|
150
|
+
company_item_number: "123456",
|
|
151
|
+
model: "BTB-4930",
|
|
152
|
+
id: 4,
|
|
153
|
+
},
|
|
154
|
+
],
|
|
128
155
|
}
|
|
129
156
|
},
|
|
130
157
|
methods: {
|
|
@@ -134,6 +161,47 @@ export default {
|
|
|
134
161
|
onInputChange(event) {
|
|
135
162
|
this.isChecked = event
|
|
136
163
|
},
|
|
164
|
+
isDropdownOpen() {
|
|
165
|
+
return this.dropdownOpen
|
|
166
|
+
},
|
|
167
|
+
toggleDropdownOpen() {
|
|
168
|
+
this.dropdownOpen = !this.dropdownOpen
|
|
169
|
+
},
|
|
170
|
+
getDropdownValues() {
|
|
171
|
+
let items = []
|
|
172
|
+
items = [
|
|
173
|
+
{
|
|
174
|
+
value: this.getComponentInfo({
|
|
175
|
+
row: this.itemOptions[0],
|
|
176
|
+
value: "display_name",
|
|
177
|
+
}),
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
value: this.getComponentInfo({
|
|
181
|
+
row: this.itemOptions[0],
|
|
182
|
+
value: "company_item_number",
|
|
183
|
+
}),
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
value: this.getComponentInfo({
|
|
187
|
+
row: this.itemOptions[0],
|
|
188
|
+
value: "model",
|
|
189
|
+
}),
|
|
190
|
+
},
|
|
191
|
+
]
|
|
192
|
+
return items
|
|
193
|
+
},
|
|
194
|
+
getComponentInfo({ row, value }) {
|
|
195
|
+
let item
|
|
196
|
+
if (row.selectedValue && row.selectedValue[value]) {
|
|
197
|
+
item = row.selectedValue[value]
|
|
198
|
+
} else if (row[value]) {
|
|
199
|
+
item = row[value]
|
|
200
|
+
} else {
|
|
201
|
+
item = "-"
|
|
202
|
+
}
|
|
203
|
+
return item
|
|
204
|
+
},
|
|
137
205
|
},
|
|
138
206
|
}
|
|
139
207
|
</script>
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<container>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
</input-wrapper>
|
|
16
|
-
</container>
|
|
2
|
+
<container>
|
|
3
|
+
<input-wrapper>
|
|
4
|
+
<input-container
|
|
5
|
+
:placeholder="placeholder"
|
|
6
|
+
:value="value"
|
|
7
|
+
@input="onChangeHandler($event)"
|
|
8
|
+
:disabled="disabled"
|
|
9
|
+
:isDisabled="disabled"
|
|
10
|
+
/>
|
|
11
|
+
<img
|
|
12
|
+
class="search-icn"
|
|
13
|
+
:src="require('../../../assets/icons/search_icon_black.svg')"
|
|
14
|
+
/>
|
|
15
|
+
</input-wrapper>
|
|
16
|
+
</container>
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script>
|
|
20
20
|
// import SearchInput from "@eturnity/eturnity_reusable_components/src/components/inputs/searchInput"
|
|
21
|
-
import styled from
|
|
21
|
+
import styled from "vue-styled-components"
|
|
22
22
|
|
|
23
23
|
const Container = styled.div`
|
|
24
24
|
width: 100%;
|
|
@@ -26,7 +26,7 @@ const Container = styled.div`
|
|
|
26
26
|
`
|
|
27
27
|
|
|
28
28
|
const inputAttrs = { isDisabled: Boolean }
|
|
29
|
-
const InputContainer = styled(
|
|
29
|
+
const InputContainer = styled("input", inputAttrs)`
|
|
30
30
|
border: 1px solid ${(props) => props.theme.colors.mediumGray};
|
|
31
31
|
padding: 11px 30px 11px 10px;
|
|
32
32
|
border-radius: 4px;
|
|
@@ -34,8 +34,8 @@ const InputContainer = styled('input', inputAttrs)`
|
|
|
34
34
|
color: ${(props) => props.theme.colors.black};
|
|
35
35
|
width: 100%;
|
|
36
36
|
box-sizing: border-box;
|
|
37
|
-
cursor: ${props => props.isDisabled ?
|
|
38
|
-
|
|
37
|
+
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "auto")};
|
|
38
|
+
background: ${(props) => props.theme.colors.white} !important;
|
|
39
39
|
&::placeholder {
|
|
40
40
|
color: ${(props) => props.theme.colors.darkGray};
|
|
41
41
|
}
|
|
@@ -60,25 +60,25 @@ export default {
|
|
|
60
60
|
components: {
|
|
61
61
|
InputContainer,
|
|
62
62
|
InputWrapper,
|
|
63
|
-
Container
|
|
63
|
+
Container,
|
|
64
64
|
},
|
|
65
65
|
props: {
|
|
66
66
|
value: {
|
|
67
|
-
required: true
|
|
67
|
+
required: true,
|
|
68
68
|
},
|
|
69
69
|
disabled: {
|
|
70
70
|
required: false,
|
|
71
|
-
default: false
|
|
71
|
+
default: false,
|
|
72
72
|
},
|
|
73
73
|
placeholder: {
|
|
74
74
|
required: false,
|
|
75
|
-
default:
|
|
76
|
-
}
|
|
75
|
+
default: "",
|
|
76
|
+
},
|
|
77
77
|
},
|
|
78
78
|
methods: {
|
|
79
79
|
onChangeHandler(event) {
|
|
80
|
-
this.$emit(
|
|
81
|
-
}
|
|
82
|
-
}
|
|
80
|
+
this.$emit("on-change", event)
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
83
|
}
|
|
84
84
|
</script>
|
|
@@ -82,11 +82,11 @@ const TableContainer = styled.table`
|
|
|
82
82
|
cursor: pointer;
|
|
83
83
|
|
|
84
84
|
.table-dropdown {
|
|
85
|
-
background-color: ${(props) => props.theme.colors.grey5}
|
|
85
|
+
background-color: ${(props) => props.theme.colors.grey5};
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
input {
|
|
89
|
-
background-color: ${(props) => props.theme.colors.grey5}
|
|
89
|
+
background-color: ${(props) => props.theme.colors.grey5};
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|