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