@eturnity/eturnity_reusable_components 1.1.58 → 1.1.61
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
|
@@ -46,6 +46,13 @@
|
|
|
46
46
|
/>
|
|
47
47
|
<br />
|
|
48
48
|
<page-subtitle text="My Subtitle" infoText="My info Text" />
|
|
49
|
+
<spinner size="30px" />
|
|
50
|
+
<checkbox
|
|
51
|
+
label="Do you accept the Terms?"
|
|
52
|
+
:isChecked="true"
|
|
53
|
+
size="small"
|
|
54
|
+
:isDisabled="false"
|
|
55
|
+
/>
|
|
49
56
|
</page-container>
|
|
50
57
|
</ThemeProvider>
|
|
51
58
|
</template>
|
|
@@ -58,7 +65,9 @@ import MainTable from "@/components/tables/mainTable"
|
|
|
58
65
|
import ThreeDots from "@/components/threeDots"
|
|
59
66
|
import Toggle from "@/components/inputs/toggle"
|
|
60
67
|
import InputNumber from "@/components/inputs/inputNumber"
|
|
68
|
+
import Checkbox from "@/components/inputs/checkbox"
|
|
61
69
|
import PageSubtitle from "@/components/pageSubtitle"
|
|
70
|
+
import Spinner from "@/components/spinner"
|
|
62
71
|
// import TableDropdown from "@/components/tableDropdown"
|
|
63
72
|
|
|
64
73
|
const PageContainer = styled.div`
|
|
@@ -75,6 +84,8 @@ export default {
|
|
|
75
84
|
Toggle,
|
|
76
85
|
InputNumber,
|
|
77
86
|
PageSubtitle,
|
|
87
|
+
Spinner,
|
|
88
|
+
Checkbox,
|
|
78
89
|
// TableDropdown,
|
|
79
90
|
},
|
|
80
91
|
data() {
|
|
@@ -7,13 +7,16 @@
|
|
|
7
7
|
:backgroundColor="backgroundColor"
|
|
8
8
|
:isChecked="isChecked"
|
|
9
9
|
:isDisabled="isDisabled"
|
|
10
|
-
|
|
10
|
+
>
|
|
11
11
|
<input-checkbox
|
|
12
12
|
type="checkbox"
|
|
13
13
|
:checked="isChecked"
|
|
14
14
|
@change="onChangeHandler(!isChecked)"
|
|
15
15
|
/>
|
|
16
|
-
<
|
|
16
|
+
<div>
|
|
17
|
+
<span class="checkmark"></span>
|
|
18
|
+
</div>
|
|
19
|
+
<label-text v-if="!!label.length">{{ label }}</label-text>
|
|
17
20
|
</container>
|
|
18
21
|
</component-wrapper>
|
|
19
22
|
</template>
|
|
@@ -34,6 +37,7 @@ import styled from "vue-styled-components"
|
|
|
34
37
|
|
|
35
38
|
const ComponentWrapper = styled.div`
|
|
36
39
|
display: inline-block;
|
|
40
|
+
min-height: 18px;
|
|
37
41
|
`
|
|
38
42
|
|
|
39
43
|
const containerAttrs = {
|
|
@@ -46,20 +50,18 @@ const containerAttrs = {
|
|
|
46
50
|
}
|
|
47
51
|
const Container = styled("label", containerAttrs)`
|
|
48
52
|
display: grid;
|
|
49
|
-
|
|
53
|
+
grid-template-columns: ${(props) => (props.hasLabel ? "18px auto" : "18px")};
|
|
54
|
+
grid-gap: 16px;
|
|
50
55
|
align-content: center;
|
|
56
|
+
/* align-items: center; */
|
|
51
57
|
color: ${(props) => props.theme.colors.black};
|
|
52
58
|
position: relative;
|
|
53
|
-
/* padding-left: 42px; */
|
|
54
|
-
margin-bottom: 12px;
|
|
55
59
|
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
|
|
56
60
|
font-size: 16px;
|
|
57
61
|
user-select: none;
|
|
58
62
|
|
|
59
63
|
.checkmark {
|
|
60
64
|
position: absolute;
|
|
61
|
-
top: 0;
|
|
62
|
-
left: 0;
|
|
63
65
|
height: ${(props) =>
|
|
64
66
|
props.size === "medium"
|
|
65
67
|
? "25px"
|
|
@@ -131,12 +133,20 @@ const InputCheckbox = styled.input`
|
|
|
131
133
|
width: 0;
|
|
132
134
|
`
|
|
133
135
|
|
|
136
|
+
const LabelText = styled.div`
|
|
137
|
+
font-size: 13px;
|
|
138
|
+
display: grid;
|
|
139
|
+
align-items: center;
|
|
140
|
+
min-height: 18px;
|
|
141
|
+
`
|
|
142
|
+
|
|
134
143
|
export default {
|
|
135
144
|
name: "checkbox",
|
|
136
145
|
components: {
|
|
137
146
|
ComponentWrapper,
|
|
138
147
|
Container,
|
|
139
148
|
InputCheckbox,
|
|
149
|
+
LabelText,
|
|
140
150
|
},
|
|
141
151
|
props: {
|
|
142
152
|
label: {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@click.native="onOutsideClose()"
|
|
6
6
|
>
|
|
7
7
|
<modal-container @click.stop>
|
|
8
|
+
<spinner v-if="isLoading" size="50px" :fullWidth="true" />
|
|
8
9
|
<close-button @click.native="onCloseModal()" class="close" />
|
|
9
10
|
<slot />
|
|
10
11
|
</modal-container>
|
|
@@ -15,12 +16,13 @@
|
|
|
15
16
|
// import Modal from "@eturnity/eturnity_reusable_components/src/components/modals/modal"
|
|
16
17
|
// This is a more flexible modal box, where the parent can decide how the body of the modal looks
|
|
17
18
|
// To use:
|
|
18
|
-
// <modal :isOpen="isOpen" @on-close="$emit('on-close-summary')" :preventOutsideClose="true">
|
|
19
|
+
// <modal :isOpen="isOpen" @on-close="$emit('on-close-summary')" :preventOutsideClose="true" :isLoading="true">
|
|
19
20
|
// <div>Data....</div>
|
|
20
21
|
// </modal>
|
|
21
22
|
|
|
22
23
|
import styled from "vue-styled-components"
|
|
23
24
|
import CloseButton from "../../buttons/closeButton"
|
|
25
|
+
import Spinner from "../../spinner"
|
|
24
26
|
|
|
25
27
|
const pageAttrs = { isOpen: Boolean }
|
|
26
28
|
const PageWrapper = styled("div", pageAttrs)`
|
|
@@ -92,6 +94,7 @@ export default {
|
|
|
92
94
|
PageWrapper,
|
|
93
95
|
ModalContainer,
|
|
94
96
|
CloseButton,
|
|
97
|
+
Spinner,
|
|
95
98
|
},
|
|
96
99
|
props: {
|
|
97
100
|
isOpen: {
|
|
@@ -102,6 +105,10 @@ export default {
|
|
|
102
105
|
required: false,
|
|
103
106
|
default: false,
|
|
104
107
|
},
|
|
108
|
+
isLoading: {
|
|
109
|
+
required: false,
|
|
110
|
+
default: false,
|
|
111
|
+
},
|
|
105
112
|
},
|
|
106
113
|
methods: {
|
|
107
114
|
onCloseModal() {
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<spinner-container v-if="fullWidth">
|
|
3
3
|
<container>
|
|
4
|
-
<spinner-wrapper
|
|
4
|
+
<spinner-wrapper
|
|
5
|
+
:size="size"
|
|
6
|
+
:src="require('../../assets/icons/black_spinner.svg')"
|
|
7
|
+
/>
|
|
5
8
|
</container>
|
|
6
9
|
</spinner-container>
|
|
7
10
|
<container v-else>
|
|
8
|
-
<spinner-wrapper
|
|
11
|
+
<spinner-wrapper
|
|
12
|
+
:size="size"
|
|
13
|
+
:src="require('../../assets/icons/black_spinner.svg')"
|
|
14
|
+
/>
|
|
9
15
|
</container>
|
|
10
16
|
</template>
|
|
11
17
|
|
|
12
18
|
<script>
|
|
13
19
|
// import Spinner from "@eturnity/eturnity_reusable_components/src/components/spinner"
|
|
20
|
+
// <spinner size="30px" />
|
|
14
21
|
import styled from "vue-styled-components"
|
|
15
22
|
|
|
16
23
|
const SpinnerContainer = styled.div`
|
|
@@ -32,8 +39,9 @@ const Container = styled.div`
|
|
|
32
39
|
justify-items: center;
|
|
33
40
|
`
|
|
34
41
|
|
|
35
|
-
const
|
|
36
|
-
|
|
42
|
+
const spinnerAttrs = { size: String }
|
|
43
|
+
const SpinnerWrapper = styled("img", spinnerAttrs)`
|
|
44
|
+
width: ${(props) => (props.size ? props.size : "60px")};
|
|
37
45
|
`
|
|
38
46
|
|
|
39
47
|
export default {
|
|
@@ -48,6 +56,10 @@ export default {
|
|
|
48
56
|
required: false,
|
|
49
57
|
default: false,
|
|
50
58
|
},
|
|
59
|
+
size: {
|
|
60
|
+
required: false,
|
|
61
|
+
default: null,
|
|
62
|
+
},
|
|
51
63
|
},
|
|
52
64
|
}
|
|
53
65
|
</script>
|