@eturnity/eturnity_reusable_components 6.37.0-EPDM-8148.7 → 6.37.0-EPDM-2198.1
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 +1 -1
- package/src/App.vue +42 -181
- package/src/assets/svgIcons/charger_icon_white.svg +44 -0
- package/src/assets/svgIcons/collections.svg +3 -0
- package/src/assets/svgIcons/dashboard.svg +3 -0
- package/src/assets/svgIcons/energy_meter.svg +12 -0
- package/src/assets/svgIcons/erase.svg +1 -1
- package/src/assets/svgIcons/expand.svg +1 -0
- package/src/assets/svgIcons/logout.svg +3 -0
- package/src/assets/svgIcons/split.svg +94 -0
- package/src/assets/svgIcons/subscriptions.svg +3 -0
- package/src/assets/theme.js +3 -0
- package/src/components/addNewButton/index.vue +12 -8
- package/src/components/buttons/mainButton/index.vue +35 -23
- package/src/components/card/index.vue +95 -0
- package/src/components/draggableInputHandle/index.vue +47 -0
- package/src/components/errorMessage/index.vue +1 -3
- package/src/components/filter/filterSettings.vue +15 -10
- package/src/components/filter/index.vue +12 -1
- package/src/components/icon/iconCollection.vue +5 -5
- package/src/components/icon/index.vue +10 -2
- package/src/components/iconWrapper/index.vue +17 -12
- package/src/components/infoCard/index.vue +36 -0
- package/src/components/infoText/index.vue +2 -12
- package/src/components/inputs/checkbox/index.vue +5 -0
- package/src/components/inputs/inputNumber/index.vue +48 -17
- package/src/components/inputs/inputText/index.vue +24 -5
- package/src/components/inputs/radioButton/index.vue +66 -49
- package/src/components/inputs/searchInput/index.vue +6 -0
- package/src/components/inputs/select/index.vue +122 -58
- package/src/components/inputs/select/option/index.vue +5 -1
- package/src/components/inputs/switchField/index.vue +7 -11
- package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +0 -8
- package/src/components/inputs/textAreaInput/index.vue +12 -7
- package/src/components/inputs/toggle/index.vue +82 -82
- package/src/components/label/index.vue +103 -0
- package/src/components/modals/modal/index.vue +46 -13
- package/src/components/navigationTabs/index.vue +105 -0
- package/src/components/pageSubtitle/index.vue +1 -8
- package/src/components/pageTitle/index.vue +32 -4
- package/src/components/pagination/index.vue +136 -129
- package/src/components/projectMarker/index.vue +39 -33
- package/src/components/sideMenu/index.vue +270 -0
- package/src/components/tables/mainTable/index.vue +3 -3
- package/src/components/threeDots/index.vue +31 -22
- package/src/helpers/numberConverter.js +4 -2
- package/src/helpers/translateLang.js +9 -1
@@ -11,6 +11,7 @@
|
|
11
11
|
@click="clickHandler"
|
12
12
|
@mouseover="hoverHandler"
|
13
13
|
:cursorType="cursorType"
|
14
|
+
:isDisabled="isDisabled"
|
14
15
|
:backgroundColor="colorMode == 'dark' ? '#000000' : backgroundColor"
|
15
16
|
:title="hoverText"
|
16
17
|
>
|
@@ -23,13 +24,14 @@
|
|
23
24
|
// import selectDropdown from './selectDropDown'
|
24
25
|
import styled from 'vue-styled-components'
|
25
26
|
const optionProps = {
|
27
|
+
isDisabled: Boolean,
|
26
28
|
hoveredBgColor: String,
|
27
29
|
cursorType: String,
|
28
30
|
backgroundColor: String
|
29
31
|
}
|
30
32
|
const optionContainer = styled('div', optionProps)`
|
31
33
|
display: flex;
|
32
|
-
cursor: ${(props) => props.cursorType};
|
34
|
+
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : props.cursorType)};
|
33
35
|
flex-direction: row;
|
34
36
|
justify-content: space-between;
|
35
37
|
align-items: center;
|
@@ -45,6 +47,8 @@ const optionContainer = styled('div', optionProps)`
|
|
45
47
|
props.theme.colors[props.backgroundColor]
|
46
48
|
? props.theme.colors[props.backgroundColor]
|
47
49
|
: props.backgroundColor};
|
50
|
+
color: ${(props) =>
|
51
|
+
props.isDisabled ? props.theme.colors.grey3 : 'inherit'};
|
48
52
|
&:hover {
|
49
53
|
background-color: ${(props) =>
|
50
54
|
props.theme.colors[props.hoveredBgColor]
|
@@ -10,14 +10,13 @@
|
|
10
10
|
v-if="label && labelAlign === 'left'"
|
11
11
|
:hasInfoMessage="!!infoTextMessage"
|
12
12
|
:colorMode="colorMode"
|
13
|
+
:primaryColor="primaryColor"
|
14
|
+
:secondaryColor="secondaryColor"
|
13
15
|
>
|
14
16
|
<label-text :size="size">{{ label }}</label-text>
|
15
17
|
<info-text
|
16
18
|
v-if="infoTextMessage"
|
17
19
|
:text="infoTextMessage"
|
18
|
-
borderColor="#ccc"
|
19
|
-
size="14px"
|
20
|
-
:alignText="infoTextAlign"
|
21
20
|
/>
|
22
21
|
</label-container>
|
23
22
|
|
@@ -35,6 +34,7 @@
|
|
35
34
|
:primaryColor="primaryColor"
|
36
35
|
:secondaryColor="secondaryColor"
|
37
36
|
:inactiveColor="inactiveColor"
|
37
|
+
:data-id="item.hasOwnProperty('dataId') ? item.dataId : ''"
|
38
38
|
>
|
39
39
|
{{ item.content }}
|
40
40
|
</switchOption>
|
@@ -48,9 +48,6 @@
|
|
48
48
|
@click.native.stop
|
49
49
|
v-if="infoTextMessage"
|
50
50
|
:text="infoTextMessage"
|
51
|
-
borderColor="#ccc"
|
52
|
-
size="14px"
|
53
|
-
:alignText="infoTextAlign"
|
54
51
|
/>
|
55
52
|
</label-container>
|
56
53
|
</flex-wrapper>
|
@@ -99,10 +96,12 @@ const toggleAttrs = {
|
|
99
96
|
fontColor: String,
|
100
97
|
disabled: Boolean,
|
101
98
|
backgroundColor: String,
|
102
|
-
isChecked: Boolean
|
99
|
+
isChecked: Boolean,
|
100
|
+
secondaryColor: String,
|
101
|
+
primaryColor: String,
|
103
102
|
}
|
104
103
|
const LabelText = styled('div', toggleAttrs)`
|
105
|
-
color:
|
104
|
+
color: ${(props) => props.primaryColor };
|
106
105
|
font-size: 13px;
|
107
106
|
font-weight: 700;
|
108
107
|
`
|
@@ -202,9 +201,6 @@ export default {
|
|
202
201
|
infoTextMessage: {
|
203
202
|
required: false
|
204
203
|
},
|
205
|
-
infoTextAlign: {
|
206
|
-
required: false
|
207
|
-
},
|
208
204
|
colorMode: {
|
209
205
|
required: false,
|
210
206
|
default: 'light'
|
@@ -22,7 +22,6 @@ const Template = (args, { argTypes }) => ({
|
|
22
22
|
// rowHeight="4" //optional
|
23
23
|
// :isError="false"
|
24
24
|
// :errorText="$gettext('field_required')"
|
25
|
-
// infoTextAlign="right" // left by default
|
26
25
|
// infoTextMessage="My info message"
|
27
26
|
// label="Question 5"
|
28
27
|
// alignItems="horizontal" // horizontal, vertical
|
@@ -37,7 +36,6 @@ Default.args = {
|
|
37
36
|
rowHeight: "2",
|
38
37
|
isError: false,
|
39
38
|
errorText: "This field is required",
|
40
|
-
infoTextAlign: "right",
|
41
39
|
infoTextMessage: "",
|
42
40
|
label: "",
|
43
41
|
value: "",
|
@@ -52,7 +50,6 @@ Disabled.args = {
|
|
52
50
|
rowHeight: "2",
|
53
51
|
isError: false,
|
54
52
|
errorText: "This field is required",
|
55
|
-
infoTextAlign: "right",
|
56
53
|
infoTextMessage: "",
|
57
54
|
label: "",
|
58
55
|
value: "",
|
@@ -67,7 +64,6 @@ Error.args = {
|
|
67
64
|
rowHeight: "2",
|
68
65
|
isError: true,
|
69
66
|
errorText: "This field is required",
|
70
|
-
infoTextAlign: "right",
|
71
67
|
infoTextMessage: "",
|
72
68
|
label: "",
|
73
69
|
value: "",
|
@@ -82,7 +78,6 @@ WithLabel.args = {
|
|
82
78
|
rowHeight: "2",
|
83
79
|
isError: false,
|
84
80
|
errorText: "This field is required",
|
85
|
-
infoTextAlign: "right",
|
86
81
|
infoTextMessage: "Here is some information",
|
87
82
|
label: "Description",
|
88
83
|
value: "Here is my description!",
|
@@ -97,7 +92,6 @@ HorizontalLabel.args = {
|
|
97
92
|
rowHeight: "2",
|
98
93
|
isError: false,
|
99
94
|
errorText: "This field is required",
|
100
|
-
infoTextAlign: "right",
|
101
95
|
infoTextMessage: "Here is some information",
|
102
96
|
label: "Description",
|
103
97
|
value: "Here is my description!",
|
@@ -112,7 +106,6 @@ LargerTextArea.args = {
|
|
112
106
|
rowHeight: "5",
|
113
107
|
isError: false,
|
114
108
|
errorText: "This field is required",
|
115
|
-
infoTextAlign: "right",
|
116
109
|
infoTextMessage: "Here is some information",
|
117
110
|
label: "Description",
|
118
111
|
value: "Here is my description!",
|
@@ -127,7 +120,6 @@ LargerFontSize.args = {
|
|
127
120
|
fontSize: "24px",
|
128
121
|
isError: false,
|
129
122
|
errorText: "This field is required",
|
130
|
-
infoTextAlign: "right",
|
131
123
|
infoTextMessage: "Here is some information",
|
132
124
|
label: "Description",
|
133
125
|
value: "Here is my description!",
|
@@ -5,13 +5,13 @@
|
|
5
5
|
:hasLabel="label && label.length > 0"
|
6
6
|
>
|
7
7
|
<label-wrapper v-if="label">
|
8
|
-
<input-label :fontSize="fontSize">{{
|
8
|
+
<input-label :fontSize="fontSize" :data-id="labelDataId">{{
|
9
|
+
label
|
10
|
+
}}</input-label>
|
9
11
|
<info-text
|
10
12
|
v-if="infoTextMessage"
|
11
13
|
:text="infoTextMessage"
|
12
|
-
borderColor="#ccc"
|
13
14
|
size="16px"
|
14
|
-
:alignText="infoTextAlign"
|
15
15
|
/>
|
16
16
|
</label-wrapper>
|
17
17
|
<input-container
|
@@ -27,6 +27,7 @@
|
|
27
27
|
:disabled="isDisabled"
|
28
28
|
@input="onChangeHandler"
|
29
29
|
:resize="resize"
|
30
|
+
:data-id="inputDataId"
|
30
31
|
/>
|
31
32
|
</input-container>
|
32
33
|
</input-wrapper>
|
@@ -44,7 +45,6 @@
|
|
44
45
|
// rowHeight="4" //optional
|
45
46
|
// :isError="false"
|
46
47
|
// :errorText="$gettext('field_required')"
|
47
|
-
// infoTextAlign="right" // left by default
|
48
48
|
// infoTextMessage="My info message"
|
49
49
|
// label="Question 5"
|
50
50
|
// alignItems="horizontal" // horizontal, vertical
|
@@ -164,9 +164,6 @@ export default {
|
|
164
164
|
infoTextMessage: {
|
165
165
|
required: false
|
166
166
|
},
|
167
|
-
infoTextAlign: {
|
168
|
-
required: false
|
169
|
-
},
|
170
167
|
label: {
|
171
168
|
required: false
|
172
169
|
},
|
@@ -181,6 +178,14 @@ export default {
|
|
181
178
|
resize: {
|
182
179
|
required: false,
|
183
180
|
default: 'none'
|
181
|
+
},
|
182
|
+
labelDataId: {
|
183
|
+
required: false,
|
184
|
+
default: ''
|
185
|
+
},
|
186
|
+
inputDataId: {
|
187
|
+
required: false,
|
188
|
+
default: ''
|
184
189
|
}
|
185
190
|
},
|
186
191
|
methods: {
|
@@ -1,6 +1,11 @@
|
|
1
1
|
<template>
|
2
2
|
<container>
|
3
|
-
<flex-wrapper
|
3
|
+
<flex-wrapper
|
4
|
+
:size="size"
|
5
|
+
:disabled="disabled"
|
6
|
+
@click="onToggleChange"
|
7
|
+
:data-id="dataId"
|
8
|
+
>
|
4
9
|
<label-container
|
5
10
|
v-if="label && labelAlign === 'left'"
|
6
11
|
:hasInfoMessage="!!infoTextMessage"
|
@@ -9,9 +14,6 @@
|
|
9
14
|
<info-text
|
10
15
|
v-if="infoTextMessage"
|
11
16
|
:text="infoTextMessage"
|
12
|
-
borderColor="#ccc"
|
13
|
-
size="14px"
|
14
|
-
:alignText="infoTextAlign"
|
15
17
|
/>
|
16
18
|
</label-container>
|
17
19
|
<toggle-wrapper
|
@@ -45,9 +47,6 @@
|
|
45
47
|
@click.native.stop
|
46
48
|
v-if="infoTextMessage"
|
47
49
|
:text="infoTextMessage"
|
48
|
-
borderColor="#ccc"
|
49
|
-
size="14px"
|
50
|
-
:alignText="infoTextAlign"
|
51
50
|
/>
|
52
51
|
</label-container>
|
53
52
|
</flex-wrapper>
|
@@ -67,29 +66,29 @@
|
|
67
66
|
// labelAlign="right"
|
68
67
|
// fontColor="black"
|
69
68
|
// :disabled="true"
|
70
|
-
// infoTextAlign="right" // left by default
|
71
69
|
// infoTextMessage="My info message"
|
70
|
+
// data-id="test_data_id"
|
72
71
|
// />
|
73
72
|
|
74
|
-
import styled from
|
75
|
-
import InfoText from
|
73
|
+
import styled from 'vue-styled-components'
|
74
|
+
import InfoText from '../../infoText'
|
76
75
|
|
77
76
|
const Container = styled.div`
|
78
77
|
display: inline-block;
|
79
78
|
`
|
80
79
|
|
81
80
|
const flexAttrs = { size: String, disabled: Boolean }
|
82
|
-
const FlexWrapper = styled(
|
81
|
+
const FlexWrapper = styled('div', flexAttrs)`
|
83
82
|
display: grid;
|
84
83
|
grid-template-columns: auto 1fr;
|
85
84
|
grid-gap: ${(props) =>
|
86
|
-
props.size ===
|
87
|
-
?
|
88
|
-
: props.size ===
|
89
|
-
?
|
90
|
-
:
|
85
|
+
props.size === 'medium'
|
86
|
+
? '20px'
|
87
|
+
: props.size === 'small'
|
88
|
+
? '10px'
|
89
|
+
: '20px'};
|
91
90
|
align-items: center;
|
92
|
-
cursor: ${(props) => (props.disabled ?
|
91
|
+
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
|
93
92
|
`
|
94
93
|
|
95
94
|
const toggleAttrs = {
|
@@ -97,43 +96,43 @@ const toggleAttrs = {
|
|
97
96
|
fontColor: String,
|
98
97
|
disabled: Boolean,
|
99
98
|
backgroundColor: String,
|
100
|
-
isChecked: Boolean
|
99
|
+
isChecked: Boolean
|
101
100
|
}
|
102
|
-
const LabelText = styled(
|
101
|
+
const LabelText = styled('div', toggleAttrs)`
|
103
102
|
color: ${(props) =>
|
104
103
|
props.fontColor ? props.fontColor : props.theme.colors.darkGray};
|
105
104
|
font-size: ${(props) =>
|
106
|
-
props.size ===
|
107
|
-
?
|
108
|
-
: props.size ===
|
109
|
-
?
|
110
|
-
:
|
105
|
+
props.size === 'medium'
|
106
|
+
? '16px'
|
107
|
+
: props.size === 'small'
|
108
|
+
? '13px'
|
109
|
+
: '16px'};
|
111
110
|
`
|
112
111
|
|
113
|
-
const ToggleWrapper = styled(
|
112
|
+
const ToggleWrapper = styled('span', toggleAttrs)`
|
114
113
|
display: inline-block;
|
115
114
|
border: ${(props) =>
|
116
115
|
props.disabled
|
117
|
-
?
|
116
|
+
? '1px solid ' + props.theme.colors.disabled
|
118
117
|
: props.isChecked
|
119
118
|
? props.backgroundColor
|
120
|
-
?
|
121
|
-
:
|
122
|
-
:
|
119
|
+
? '1px solid ' + props.backgroundColor
|
120
|
+
: '1px solid ' + props.theme.colors.green
|
121
|
+
: '1px solid ' + props.theme.colors.grey3}
|
123
122
|
position: relative;
|
124
|
-
cursor: ${(props) => (props.disabled ?
|
123
|
+
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
|
125
124
|
width: ${(props) =>
|
126
|
-
props.size ===
|
127
|
-
?
|
128
|
-
: props.size ===
|
129
|
-
?
|
130
|
-
:
|
125
|
+
props.size === 'medium'
|
126
|
+
? '50px'
|
127
|
+
: props.size === 'small'
|
128
|
+
? '29px'
|
129
|
+
: '50px'};
|
131
130
|
height: ${(props) =>
|
132
|
-
props.size ===
|
133
|
-
?
|
134
|
-
: props.size ===
|
135
|
-
?
|
136
|
-
:
|
131
|
+
props.size === 'medium'
|
132
|
+
? '24px'
|
133
|
+
: props.size === 'small'
|
134
|
+
? '16px'
|
135
|
+
: '24px'};
|
137
136
|
border-radius: 100px;
|
138
137
|
|
139
138
|
&:focus {
|
@@ -149,9 +148,9 @@ const ToggleWrapper = styled("span", toggleAttrs)`
|
|
149
148
|
const backgroundAttrs = {
|
150
149
|
backgroundColor: String,
|
151
150
|
isChecked: Boolean,
|
152
|
-
disabled: Boolean
|
151
|
+
disabled: Boolean
|
153
152
|
}
|
154
|
-
const ToggleBackground = styled(
|
153
|
+
const ToggleBackground = styled('span', backgroundAttrs)`
|
155
154
|
display: block;
|
156
155
|
border-radius: 100px;
|
157
156
|
height: 100%;
|
@@ -171,25 +170,25 @@ const toggleProps = {
|
|
171
170
|
isChecked: Boolean,
|
172
171
|
toggleColor: String,
|
173
172
|
size: String,
|
174
|
-
disabled: Boolean
|
173
|
+
disabled: Boolean
|
175
174
|
}
|
176
|
-
const ToggleDot = styled(
|
175
|
+
const ToggleDot = styled('span', toggleProps)`
|
177
176
|
position: absolute;
|
178
177
|
height: ${(props) =>
|
179
|
-
props.size ===
|
180
|
-
?
|
181
|
-
: props.size ===
|
182
|
-
?
|
183
|
-
:
|
178
|
+
props.size === 'medium'
|
179
|
+
? '14px'
|
180
|
+
: props.size === 'small'
|
181
|
+
? '10px'
|
182
|
+
: '14px'};
|
184
183
|
width: ${(props) =>
|
185
|
-
props.size ===
|
186
|
-
?
|
187
|
-
: props.size ===
|
188
|
-
?
|
189
|
-
:
|
190
|
-
left: 3px
|
184
|
+
props.size === 'medium'
|
185
|
+
? '14px'
|
186
|
+
: props.size === 'small'
|
187
|
+
? '10px'
|
188
|
+
: '14px'};
|
189
|
+
left: 3px;
|
191
190
|
bottom: ${(props) =>
|
192
|
-
props.size ===
|
191
|
+
props.size === 'medium' ? '5px' : props.size === 'small' ? '2px' : '5px'};
|
193
192
|
background-color: ${(props) =>
|
194
193
|
props.disabled
|
195
194
|
? props.theme.colors.disabled
|
@@ -202,33 +201,33 @@ const ToggleDot = styled("span", toggleProps)`
|
|
202
201
|
transition: transform 0.4s ease;
|
203
202
|
transform: ${(props) =>
|
204
203
|
props.isChecked
|
205
|
-
? props.size ===
|
206
|
-
?
|
207
|
-
: props.size ===
|
208
|
-
?
|
209
|
-
:
|
210
|
-
:
|
204
|
+
? props.size === 'medium'
|
205
|
+
? 'translateX(25px)'
|
206
|
+
: props.size === 'small'
|
207
|
+
? 'translateX(12px)'
|
208
|
+
: 'translateX(25px)'
|
209
|
+
: 'translateX(0)'};
|
211
210
|
|
212
211
|
@media (max-width: ${(props) => props.theme.screen.mobile}) {
|
213
212
|
height: 24px;
|
214
213
|
width: 24px;
|
215
214
|
transform: ${(props) =>
|
216
|
-
props.isChecked ?
|
215
|
+
props.isChecked ? 'translateX(25px)' : 'translateX(0)'};
|
217
216
|
bottom: 8px;
|
218
217
|
}
|
219
218
|
`
|
220
219
|
|
221
220
|
const labelAttrs = { hasInfoMessage: Boolean }
|
222
|
-
const LabelContainer = styled(
|
221
|
+
const LabelContainer = styled('div', labelAttrs)`
|
223
222
|
display: inline-grid;
|
224
223
|
grid-template-columns: ${(props) =>
|
225
|
-
props.hasInfoMessage ?
|
224
|
+
props.hasInfoMessage ? 'auto 1fr' : 'auto'};
|
226
225
|
grid-gap: 12px;
|
227
226
|
align-items: center;
|
228
227
|
`
|
229
228
|
|
230
229
|
export default {
|
231
|
-
name:
|
230
|
+
name: 'toggle',
|
232
231
|
components: {
|
233
232
|
Container,
|
234
233
|
ToggleBackground,
|
@@ -237,52 +236,53 @@ export default {
|
|
237
236
|
FlexWrapper,
|
238
237
|
LabelText,
|
239
238
|
InfoText,
|
240
|
-
LabelContainer
|
239
|
+
LabelContainer
|
241
240
|
},
|
242
241
|
props: {
|
243
242
|
label: {
|
244
243
|
required: false,
|
245
|
-
default:
|
244
|
+
default: ''
|
246
245
|
},
|
247
246
|
isChecked: {
|
248
247
|
required: true,
|
249
|
-
default: false
|
248
|
+
default: false
|
250
249
|
},
|
251
250
|
toggleColor: {
|
252
|
-
required: false
|
251
|
+
required: false
|
253
252
|
},
|
254
253
|
backgroundColor: {
|
255
|
-
required: false
|
254
|
+
required: false
|
256
255
|
},
|
257
256
|
size: {
|
258
257
|
required: false,
|
259
|
-
default:
|
258
|
+
default: 'small'
|
260
259
|
},
|
261
260
|
labelAlign: {
|
262
261
|
required: false,
|
263
|
-
default:
|
262
|
+
default: 'right'
|
264
263
|
},
|
265
264
|
fontColor: {
|
266
|
-
required: false
|
265
|
+
required: false
|
267
266
|
},
|
268
267
|
disabled: {
|
269
268
|
required: false,
|
270
|
-
default: false
|
269
|
+
default: false
|
271
270
|
},
|
272
271
|
infoTextMessage: {
|
273
|
-
required: false
|
274
|
-
},
|
275
|
-
infoTextAlign: {
|
276
|
-
required: false,
|
272
|
+
required: false
|
277
273
|
},
|
274
|
+
dataId: {
|
275
|
+
type: String,
|
276
|
+
default: ''
|
277
|
+
}
|
278
278
|
},
|
279
279
|
methods: {
|
280
280
|
onToggleChange() {
|
281
281
|
if (this.disabled) {
|
282
282
|
return
|
283
283
|
}
|
284
|
-
this.$emit(
|
285
|
-
}
|
286
|
-
}
|
284
|
+
this.$emit('on-toggle-change', !this.isChecked)
|
285
|
+
}
|
286
|
+
}
|
287
287
|
}
|
288
288
|
</script>
|
@@ -0,0 +1,103 @@
|
|
1
|
+
<template>
|
2
|
+
<label-wrapper
|
3
|
+
:labelAlign="labelAlign">
|
4
|
+
<input-label
|
5
|
+
:labelFontColor="labelFontColor"
|
6
|
+
:fontSize="fontSize"
|
7
|
+
>
|
8
|
+
<slot></slot>
|
9
|
+
<optionalLabel v-if="labelOptional"
|
10
|
+
>({{ $gettext('Optional') }})</optionalLabel
|
11
|
+
></input-label
|
12
|
+
>
|
13
|
+
<info-text
|
14
|
+
v-if="infoTextMessage"
|
15
|
+
:text="infoTextMessage"
|
16
|
+
:size="fontSize ? fontSize : '16px'"
|
17
|
+
:alignArrow="infoTextAlign"
|
18
|
+
/>
|
19
|
+
</label-wrapper>
|
20
|
+
</template>
|
21
|
+
|
22
|
+
<script>
|
23
|
+
import styled from 'vue-styled-components'
|
24
|
+
import InfoText from '../infoText'
|
25
|
+
|
26
|
+
|
27
|
+
const labelAttrs = { fontSize: String, labelFontColor: String }
|
28
|
+
const InputLabel = styled('div', labelAttrs)`
|
29
|
+
color: ${(props) =>
|
30
|
+
props.theme.colors[props.labelFontColor]
|
31
|
+
? props.theme.colors[props.labelFontColor]
|
32
|
+
: props.labelFontColor
|
33
|
+
? props.labelFontColor
|
34
|
+
: props.theme.colors.eturnityGrey};
|
35
|
+
|
36
|
+
font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
|
37
|
+
font-weight: 700;
|
38
|
+
`
|
39
|
+
const optionalLabel = styled.span`
|
40
|
+
font-weight: 300;
|
41
|
+
`
|
42
|
+
|
43
|
+
const LabelWrapper = styled('div',{labelAlign:String})`
|
44
|
+
${props=>props.labelAlign=='horizontal'?
|
45
|
+
'display: inline-grid;':
|
46
|
+
'display: grid;'
|
47
|
+
}
|
48
|
+
${props=>props.labelAlign=='horizontal'?
|
49
|
+
'margin-right: 10px;':
|
50
|
+
'margin-bottom: 8px;'
|
51
|
+
}
|
52
|
+
vertical-align: center;
|
53
|
+
grid-template-columns: auto auto;
|
54
|
+
grid-gap: 12px;
|
55
|
+
align-items: center;
|
56
|
+
justify-content: start;
|
57
|
+
`
|
58
|
+
export default {
|
59
|
+
// import labelText from "@eturnity/eturnity_reusable_components/src/components/label"
|
60
|
+
// To use:
|
61
|
+
// <label-text
|
62
|
+
// infoTextAlign="right" // left by default
|
63
|
+
// infoTextMessage="My info message"
|
64
|
+
// label="Question 5"
|
65
|
+
// />
|
66
|
+
name: 'input-text',
|
67
|
+
components: {
|
68
|
+
InfoText,
|
69
|
+
InputLabel,
|
70
|
+
LabelWrapper,
|
71
|
+
optionalLabel
|
72
|
+
},
|
73
|
+
data() {
|
74
|
+
return {
|
75
|
+
inputTypeData: 'text'
|
76
|
+
}
|
77
|
+
},
|
78
|
+
props: {
|
79
|
+
infoTextMessage: {
|
80
|
+
required: false
|
81
|
+
},
|
82
|
+
infoTextAlign: {
|
83
|
+
required: false
|
84
|
+
},
|
85
|
+
labelOptional: {
|
86
|
+
required: false,
|
87
|
+
default: false
|
88
|
+
},
|
89
|
+
fontSize: {
|
90
|
+
required: false,
|
91
|
+
default: null
|
92
|
+
},
|
93
|
+
labelFontColor: {
|
94
|
+
required: false,
|
95
|
+
default: 'black'
|
96
|
+
},
|
97
|
+
labelAlign: {
|
98
|
+
required: false,
|
99
|
+
default: 'vertical'
|
100
|
+
},
|
101
|
+
},
|
102
|
+
}
|
103
|
+
</script>
|