@eturnity/eturnity_reusable_components 1.0.83 → 1.0.87
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,22 +12,15 @@
|
|
|
12
12
|
</thead>
|
|
13
13
|
<tbody>
|
|
14
14
|
<tr>
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<toggle
|
|
25
|
-
@on-toggle-change="onInputChange($event)"
|
|
26
|
-
:isChecked="isChecked"
|
|
27
|
-
labelAlign="right"
|
|
28
|
-
:disabled="true"
|
|
29
|
-
/>
|
|
30
|
-
</td>
|
|
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
|
+
/> -->
|
|
31
24
|
<div class="icons-container">
|
|
32
25
|
<three-dots :options="listOptions" :isLoading="false" />
|
|
33
26
|
</div>
|
|
@@ -54,6 +47,7 @@ import styled from "vue-styled-components"
|
|
|
54
47
|
import MainTable from "@/components/tables/mainTable"
|
|
55
48
|
import ThreeDots from "@/components/threeDots"
|
|
56
49
|
import Toggle from "@/components/inputs/toggle"
|
|
50
|
+
// import TableDropdown from "@/components/tableDropdown"
|
|
57
51
|
|
|
58
52
|
const PageContainer = styled.div`
|
|
59
53
|
padding: 40px;
|
|
@@ -67,6 +61,7 @@ export default {
|
|
|
67
61
|
MainTable,
|
|
68
62
|
ThreeDots,
|
|
69
63
|
Toggle,
|
|
64
|
+
// TableDropdown,
|
|
70
65
|
},
|
|
71
66
|
data() {
|
|
72
67
|
return {
|
|
@@ -78,6 +73,7 @@ export default {
|
|
|
78
73
|
number_max_allowed: 10,
|
|
79
74
|
unit_short_name: "cm",
|
|
80
75
|
},
|
|
76
|
+
dropdownOpen: false,
|
|
81
77
|
isChecked: false,
|
|
82
78
|
listOptions: [
|
|
83
79
|
{
|
|
@@ -125,6 +121,32 @@ export default {
|
|
|
125
121
|
value: "option_4",
|
|
126
122
|
},
|
|
127
123
|
],
|
|
124
|
+
itemOptions: [
|
|
125
|
+
{
|
|
126
|
+
display_name: "Test 1",
|
|
127
|
+
company_item_number: "123",
|
|
128
|
+
model: "BTB-2145 Long Text Long Text Long Text Long Text Long Text",
|
|
129
|
+
id: 1,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
display_name: "Test 2",
|
|
133
|
+
company_item_number: "1234",
|
|
134
|
+
model: "BTB-123",
|
|
135
|
+
id: 2,
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
display_name: "Test 3",
|
|
139
|
+
company_item_number: "12345",
|
|
140
|
+
model: "BTB-543",
|
|
141
|
+
id: 3,
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
display_name: "Test 4",
|
|
145
|
+
company_item_number: "123456",
|
|
146
|
+
model: "BTB-4930",
|
|
147
|
+
id: 4,
|
|
148
|
+
},
|
|
149
|
+
],
|
|
128
150
|
}
|
|
129
151
|
},
|
|
130
152
|
methods: {
|
|
@@ -134,6 +156,47 @@ export default {
|
|
|
134
156
|
onInputChange(event) {
|
|
135
157
|
this.isChecked = event
|
|
136
158
|
},
|
|
159
|
+
isDropdownOpen() {
|
|
160
|
+
return this.dropdownOpen
|
|
161
|
+
},
|
|
162
|
+
toggleDropdownOpen() {
|
|
163
|
+
this.dropdownOpen = !this.dropdownOpen
|
|
164
|
+
},
|
|
165
|
+
getDropdownValues() {
|
|
166
|
+
let items = []
|
|
167
|
+
items = [
|
|
168
|
+
{
|
|
169
|
+
value: this.getComponentInfo({
|
|
170
|
+
row: this.itemOptions[0],
|
|
171
|
+
value: "display_name",
|
|
172
|
+
}),
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
value: this.getComponentInfo({
|
|
176
|
+
row: this.itemOptions[0],
|
|
177
|
+
value: "company_item_number",
|
|
178
|
+
}),
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
value: this.getComponentInfo({
|
|
182
|
+
row: this.itemOptions[0],
|
|
183
|
+
value: "model",
|
|
184
|
+
}),
|
|
185
|
+
},
|
|
186
|
+
]
|
|
187
|
+
return items
|
|
188
|
+
},
|
|
189
|
+
getComponentInfo({ row, value }) {
|
|
190
|
+
let item
|
|
191
|
+
if (row.selectedValue && row.selectedValue[value]) {
|
|
192
|
+
item = row.selectedValue[value]
|
|
193
|
+
} else if (row[value]) {
|
|
194
|
+
item = row[value]
|
|
195
|
+
} else {
|
|
196
|
+
item = "-"
|
|
197
|
+
}
|
|
198
|
+
return item
|
|
199
|
+
},
|
|
137
200
|
},
|
|
138
201
|
}
|
|
139
202
|
</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
|
|
|
@@ -255,10 +255,6 @@ const TableContainer = styled.table`
|
|
|
255
255
|
width: 20px;
|
|
256
256
|
min-width: 20px;
|
|
257
257
|
height: 40px;
|
|
258
|
-
vertical-align: middle;
|
|
259
|
-
display: grid;
|
|
260
|
-
align-items: center;
|
|
261
|
-
justify-items: center;
|
|
262
258
|
}
|
|
263
259
|
|
|
264
260
|
.drag-wrapper {
|