@eturnity/eturnity_reusable_components 1.2.0 → 1.2.1-beta.0
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
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
|
|
3
3
|
<page-container>
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
<br />
|
|
5
|
+
<modal backdrop="dark" :isLoading="false" :isOpen="true">
|
|
6
|
+
<main-table titleText="My Table">
|
|
7
|
+
<thead>
|
|
8
|
+
<tr>
|
|
9
|
+
<th>Column 1</th>
|
|
10
|
+
<th>Column 2</th>
|
|
11
|
+
<th>Column 3</th>
|
|
12
|
+
<div />
|
|
13
|
+
</tr>
|
|
14
|
+
</thead>
|
|
15
|
+
<tbody>
|
|
16
|
+
<tr>
|
|
17
|
+
<!-- <table-dropdown
|
|
16
18
|
:colSpan="3"
|
|
17
19
|
:tableItems="getDropdownValues()"
|
|
18
20
|
@toggle-dropdown-open="toggleDropdownOpen()"
|
|
@@ -21,14 +23,14 @@
|
|
|
21
23
|
:optionItems="itemOptions"
|
|
22
24
|
:optionsDisplay="['display_name', 'company_item_number', 'model']"
|
|
23
25
|
/> -->
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
<td>Test</td>
|
|
27
|
+
<div class="icons-container">
|
|
28
|
+
<three-dots :options="listOptions" :isLoading="false" />
|
|
29
|
+
</div>
|
|
30
|
+
</tr>
|
|
31
|
+
</tbody>
|
|
32
|
+
</main-table>
|
|
33
|
+
</modal>
|
|
32
34
|
<br />
|
|
33
35
|
<toggle
|
|
34
36
|
@on-toggle-change="onInputChange($event)"
|
|
@@ -61,17 +63,18 @@
|
|
|
61
63
|
</template>
|
|
62
64
|
|
|
63
65
|
<script>
|
|
64
|
-
import { ThemeProvider } from
|
|
65
|
-
import theme from
|
|
66
|
-
import styled from
|
|
67
|
-
import MainTable from
|
|
68
|
-
import ThreeDots from
|
|
69
|
-
import Toggle from
|
|
70
|
-
import InputNumber from
|
|
71
|
-
import Checkbox from
|
|
72
|
-
import PageSubtitle from
|
|
73
|
-
import Spinner from
|
|
74
|
-
import ExternalButton from
|
|
66
|
+
import { ThemeProvider } from 'vue-styled-components'
|
|
67
|
+
import theme from './assets/theme'
|
|
68
|
+
import styled from 'vue-styled-components'
|
|
69
|
+
import MainTable from '@/components/tables/mainTable'
|
|
70
|
+
import ThreeDots from '@/components/threeDots'
|
|
71
|
+
import Toggle from '@/components/inputs/toggle'
|
|
72
|
+
import InputNumber from '@/components/inputs/inputNumber'
|
|
73
|
+
import Checkbox from '@/components/inputs/checkbox'
|
|
74
|
+
import PageSubtitle from '@/components/pageSubtitle'
|
|
75
|
+
import Spinner from '@/components/spinner'
|
|
76
|
+
import ExternalButton from '@/components/buttons/externalButton'
|
|
77
|
+
import Modal from '@/components/modals/modal'
|
|
75
78
|
// import TableDropdown from "@/components/tableDropdown"
|
|
76
79
|
|
|
77
80
|
const PageContainer = styled.div`
|
|
@@ -79,7 +82,7 @@ const PageContainer = styled.div`
|
|
|
79
82
|
`
|
|
80
83
|
|
|
81
84
|
export default {
|
|
82
|
-
name:
|
|
85
|
+
name: 'App',
|
|
83
86
|
components: {
|
|
84
87
|
ThemeProvider,
|
|
85
88
|
PageContainer,
|
|
@@ -91,62 +94,62 @@ export default {
|
|
|
91
94
|
Spinner,
|
|
92
95
|
Checkbox,
|
|
93
96
|
ExternalButton,
|
|
94
|
-
|
|
97
|
+
Modal,
|
|
95
98
|
},
|
|
96
99
|
data() {
|
|
97
100
|
return {
|
|
98
101
|
inputValue: null,
|
|
99
|
-
checkedOption:
|
|
102
|
+
checkedOption: 'button_1',
|
|
100
103
|
question: {
|
|
101
104
|
number_format_precision: 4,
|
|
102
105
|
number_min_allowed: 0,
|
|
103
106
|
number_max_allowed: 10,
|
|
104
|
-
unit_short_name:
|
|
107
|
+
unit_short_name: 'cm',
|
|
105
108
|
},
|
|
106
109
|
dropdownOpen: false,
|
|
107
110
|
isChecked: false,
|
|
108
111
|
listOptions: [
|
|
109
112
|
{
|
|
110
|
-
name:
|
|
111
|
-
value:
|
|
113
|
+
name: 'Option 1',
|
|
114
|
+
value: 'option_1',
|
|
112
115
|
disabled: true,
|
|
113
116
|
},
|
|
114
117
|
{
|
|
115
|
-
name:
|
|
116
|
-
value:
|
|
118
|
+
name: 'Option 2',
|
|
119
|
+
value: 'option_2',
|
|
117
120
|
},
|
|
118
121
|
{
|
|
119
|
-
name:
|
|
120
|
-
value:
|
|
122
|
+
name: 'Option 3',
|
|
123
|
+
value: 'option_3',
|
|
121
124
|
},
|
|
122
125
|
{
|
|
123
|
-
name:
|
|
124
|
-
value:
|
|
126
|
+
name: 'Option 4',
|
|
127
|
+
value: 'option_4',
|
|
125
128
|
},
|
|
126
129
|
],
|
|
127
130
|
itemOptions: [
|
|
128
131
|
{
|
|
129
|
-
display_name:
|
|
130
|
-
company_item_number:
|
|
131
|
-
model:
|
|
132
|
+
display_name: 'Test 1',
|
|
133
|
+
company_item_number: '123',
|
|
134
|
+
model: 'BTB-2145 Long Text Long Text Long Text Long Text Long Text',
|
|
132
135
|
id: 1,
|
|
133
136
|
},
|
|
134
137
|
{
|
|
135
|
-
display_name:
|
|
136
|
-
company_item_number:
|
|
137
|
-
model:
|
|
138
|
+
display_name: 'Test 2',
|
|
139
|
+
company_item_number: '1234',
|
|
140
|
+
model: 'BTB-123',
|
|
138
141
|
id: 2,
|
|
139
142
|
},
|
|
140
143
|
{
|
|
141
|
-
display_name:
|
|
142
|
-
company_item_number:
|
|
143
|
-
model:
|
|
144
|
+
display_name: 'Test 3',
|
|
145
|
+
company_item_number: '12345',
|
|
146
|
+
model: 'BTB-543',
|
|
144
147
|
id: 3,
|
|
145
148
|
},
|
|
146
149
|
{
|
|
147
|
-
display_name:
|
|
148
|
-
company_item_number:
|
|
149
|
-
model:
|
|
150
|
+
display_name: 'Test 4',
|
|
151
|
+
company_item_number: '123456',
|
|
152
|
+
model: 'BTB-4930',
|
|
150
153
|
id: 4,
|
|
151
154
|
},
|
|
152
155
|
],
|
|
@@ -163,7 +166,7 @@ export default {
|
|
|
163
166
|
return this.dropdownOpen
|
|
164
167
|
},
|
|
165
168
|
onClickButton() {
|
|
166
|
-
console.log(
|
|
169
|
+
console.log('Test')
|
|
167
170
|
},
|
|
168
171
|
toggleDropdownOpen() {
|
|
169
172
|
this.dropdownOpen = !this.dropdownOpen
|
|
@@ -174,19 +177,19 @@ export default {
|
|
|
174
177
|
{
|
|
175
178
|
value: this.getComponentInfo({
|
|
176
179
|
row: this.itemOptions[0],
|
|
177
|
-
value:
|
|
180
|
+
value: 'display_name',
|
|
178
181
|
}),
|
|
179
182
|
},
|
|
180
183
|
{
|
|
181
184
|
value: this.getComponentInfo({
|
|
182
185
|
row: this.itemOptions[0],
|
|
183
|
-
value:
|
|
186
|
+
value: 'company_item_number',
|
|
184
187
|
}),
|
|
185
188
|
},
|
|
186
189
|
{
|
|
187
190
|
value: this.getComponentInfo({
|
|
188
191
|
row: this.itemOptions[0],
|
|
189
|
-
value:
|
|
192
|
+
value: 'model',
|
|
190
193
|
}),
|
|
191
194
|
},
|
|
192
195
|
]
|
|
@@ -199,7 +202,7 @@ export default {
|
|
|
199
202
|
} else if (row[value]) {
|
|
200
203
|
item = row[value]
|
|
201
204
|
} else {
|
|
202
|
-
item =
|
|
205
|
+
item = '-'
|
|
203
206
|
}
|
|
204
207
|
return item
|
|
205
208
|
},
|
|
@@ -213,4 +216,4 @@ body {
|
|
|
213
216
|
height: 100%;
|
|
214
217
|
margin: 0;
|
|
215
218
|
}
|
|
216
|
-
</style>
|
|
219
|
+
</style>
|
|
@@ -3,15 +3,19 @@
|
|
|
3
3
|
:isOpen="isOpen"
|
|
4
4
|
:class="{ visible: isOpen, hidden: !isOpen }"
|
|
5
5
|
@click.native="onOutsideClose()"
|
|
6
|
+
:backdrop="backdrop"
|
|
7
|
+
:fullwidthSpinner="fullwidthSpinner"
|
|
6
8
|
>
|
|
7
9
|
<modal-container @click.stop>
|
|
8
|
-
<spinner v-if="isLoading" size="50px" :fullWidth="
|
|
10
|
+
<spinner v-if="isLoading" size="50px" :fullWidth="fullwidthSpinner" />
|
|
11
|
+
<content-container :visible="!isLoading">
|
|
12
|
+
<slot />
|
|
13
|
+
</content-container>
|
|
9
14
|
<close-button
|
|
10
15
|
v-if="!hideClose"
|
|
11
16
|
@click.native="onCloseModal()"
|
|
12
17
|
class="close"
|
|
13
18
|
/>
|
|
14
|
-
<slot />
|
|
15
19
|
</modal-container>
|
|
16
20
|
</page-wrapper>
|
|
17
21
|
</template>
|
|
@@ -28,7 +32,12 @@ import styled from 'vue-styled-components'
|
|
|
28
32
|
import CloseButton from '../../buttons/closeButton'
|
|
29
33
|
import Spinner from '../../spinner'
|
|
30
34
|
|
|
31
|
-
const
|
|
35
|
+
const contentAttrs = { visible: Boolean }
|
|
36
|
+
const ContentContainer = styled('div', contentAttrs)`
|
|
37
|
+
visibility: ${(props) => (props.visible ? 'inherit' : 'hidden')};
|
|
38
|
+
`
|
|
39
|
+
|
|
40
|
+
const pageAttrs = { isOpen: Boolean, backdrop: String }
|
|
32
41
|
const PageWrapper = styled('div', pageAttrs)`
|
|
33
42
|
position: fixed;
|
|
34
43
|
display: grid;
|
|
@@ -36,7 +45,10 @@ const PageWrapper = styled('div', pageAttrs)`
|
|
|
36
45
|
left: 0;
|
|
37
46
|
width: 100%;
|
|
38
47
|
height: 100%;
|
|
39
|
-
background-color:
|
|
48
|
+
background-color: ${(props) =>
|
|
49
|
+
props.backdrop == 'dark'
|
|
50
|
+
? 'rgba(0, 0, 0, 0.4)'
|
|
51
|
+
: 'rgba(255, 255, 255, 0.9)'};
|
|
40
52
|
z-index: 99999;
|
|
41
53
|
overflow: auto;
|
|
42
54
|
|
|
@@ -98,7 +110,8 @@ export default {
|
|
|
98
110
|
PageWrapper,
|
|
99
111
|
ModalContainer,
|
|
100
112
|
CloseButton,
|
|
101
|
-
Spinner
|
|
113
|
+
Spinner,
|
|
114
|
+
ContentContainer
|
|
102
115
|
},
|
|
103
116
|
props: {
|
|
104
117
|
isOpen: {
|
|
@@ -116,6 +129,14 @@ export default {
|
|
|
116
129
|
hideClose: {
|
|
117
130
|
required: false,
|
|
118
131
|
default: false
|
|
132
|
+
},
|
|
133
|
+
backdrop: {
|
|
134
|
+
required: false,
|
|
135
|
+
default: 'white'
|
|
136
|
+
},
|
|
137
|
+
fullwidthSpinner: {
|
|
138
|
+
required: false,
|
|
139
|
+
default: true
|
|
119
140
|
}
|
|
120
141
|
},
|
|
121
142
|
methods: {
|
|
@@ -135,4 +156,4 @@ export default {
|
|
|
135
156
|
}
|
|
136
157
|
}
|
|
137
158
|
}
|
|
138
|
-
</script>
|
|
159
|
+
</script>
|
|
@@ -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;
|
|
@@ -37,29 +37,32 @@ const Container = styled.div`
|
|
|
37
37
|
display: grid;
|
|
38
38
|
align-items: center;
|
|
39
39
|
justify-items: center;
|
|
40
|
+
position: absolute;
|
|
41
|
+
width: 100%;
|
|
42
|
+
height: 100%;
|
|
40
43
|
`
|
|
41
44
|
|
|
42
45
|
const spinnerAttrs = { size: String }
|
|
43
|
-
const SpinnerWrapper = styled(
|
|
44
|
-
width: ${(props) => (props.size ? props.size :
|
|
46
|
+
const SpinnerWrapper = styled('img', spinnerAttrs)`
|
|
47
|
+
width: ${(props) => (props.size ? props.size : '60px')};
|
|
45
48
|
`
|
|
46
49
|
|
|
47
50
|
export default {
|
|
48
|
-
name:
|
|
51
|
+
name: 'spinner',
|
|
49
52
|
components: {
|
|
50
53
|
Container,
|
|
51
54
|
SpinnerWrapper,
|
|
52
|
-
SpinnerContainer
|
|
55
|
+
SpinnerContainer
|
|
53
56
|
},
|
|
54
57
|
props: {
|
|
55
58
|
fullWidth: {
|
|
56
59
|
required: false,
|
|
57
|
-
default: false
|
|
60
|
+
default: false
|
|
58
61
|
},
|
|
59
62
|
size: {
|
|
60
63
|
required: false,
|
|
61
|
-
default: null
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
+
default: null
|
|
65
|
+
}
|
|
66
|
+
}
|
|
64
67
|
}
|
|
65
|
-
</script>
|
|
68
|
+
</script>
|