@eturnity/eturnity_reusable_components 6.48.2 → 6.50.1-EPDM-9012.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 +2 -2
- package/src/assets/svgIcons/erase.svg +1 -1
- package/src/assets/svgIcons/integrations.svg +3 -0
- package/src/components/buttons/mainButton/index.vue +35 -23
- package/src/components/icon/iconCollection.vue +5 -5
- package/src/components/icon/index.vue +2 -1
- package/src/components/iconWrapper/index.vue +79 -57
- package/src/components/infoText/index.vue +1 -12
- package/src/components/inputs/checkbox/index.vue +5 -0
- package/src/components/inputs/inputNumber/InputNumber.stories.js +1 -3
- package/src/components/inputs/inputNumber/index.vue +24 -18
- package/src/components/inputs/inputText/InputText.stories.js +0 -1
- package/src/components/inputs/inputText/index.vue +0 -6
- package/src/components/inputs/radioButton/index.vue +66 -49
- package/src/components/inputs/select/index.vue +5 -6
- package/src/components/inputs/select/option/index.vue +45 -6
- package/src/components/inputs/switchField/index.vue +0 -9
- package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +0 -8
- package/src/components/inputs/textAreaInput/index.vue +0 -6
- package/src/components/inputs/toggle/index.vue +82 -82
- package/src/components/modals/modal/index.vue +1 -1
- package/src/components/pageSubtitle/index.vue +1 -8
- package/src/components/pageTitle/index.vue +28 -4
- package/src/components/sideMenu/index.vue +2 -0
- package/src/components/tableDropdown/index.vue +2 -0
- package/src/helpers/numberConverter.js +5 -12
@@ -1,7 +1,12 @@
|
|
1
1
|
<template>
|
2
2
|
<component-wrapper :layout="layout">
|
3
3
|
<radio-wrapper v-for="(item, index) in options" :key="item.value">
|
4
|
-
<label-container
|
4
|
+
<label-container
|
5
|
+
:size="size"
|
6
|
+
:isDisabled="item.disabled"
|
7
|
+
:isChecked="selectedOption === item.value"
|
8
|
+
:checkmarkColor="checkmarkColor"
|
9
|
+
>
|
5
10
|
<radio
|
6
11
|
type="radio"
|
7
12
|
:value="selectedOption"
|
@@ -9,6 +14,7 @@
|
|
9
14
|
:name="'radioButtons_' + radioName"
|
10
15
|
:checked="selectedOption === item.value"
|
11
16
|
:disabled="item.disabled"
|
17
|
+
:data-id="`radio_button_${dataId}_option_${item.value}`"
|
12
18
|
/>
|
13
19
|
<span class="checkmark"></span>
|
14
20
|
<label-text :isDisabled="item.disabled">{{ item.label }}</label-text>
|
@@ -54,17 +60,17 @@
|
|
54
60
|
// { label: 'Button 4', value: 'button_4', disabled: true }
|
55
61
|
// ]
|
56
62
|
|
57
|
-
import styled from
|
58
|
-
import Modal from
|
59
|
-
import InfoText from
|
63
|
+
import styled from 'vue-styled-components'
|
64
|
+
import Modal from '../../modals/modal'
|
65
|
+
import InfoText from '../../infoText'
|
60
66
|
|
61
67
|
const wrapperProps = {
|
62
|
-
layout: String
|
68
|
+
layout: String
|
63
69
|
}
|
64
|
-
const ComponentWrapper = styled(
|
70
|
+
const ComponentWrapper = styled('div', wrapperProps)`
|
65
71
|
display: flex;
|
66
72
|
flex-direction: ${(props) =>
|
67
|
-
props.layout ===
|
73
|
+
props.layout === 'vertical' ? 'column' : 'row'};
|
68
74
|
grid-gap: 10px 5px;
|
69
75
|
flex-wrap: wrap;
|
70
76
|
`
|
@@ -83,8 +89,13 @@ const RadioWrapper = styled.div`
|
|
83
89
|
grid-gap: 10px;
|
84
90
|
`
|
85
91
|
|
86
|
-
const containerProps = {
|
87
|
-
|
92
|
+
const containerProps = {
|
93
|
+
size: String,
|
94
|
+
isDisabled: Boolean,
|
95
|
+
isChecked: Boolean,
|
96
|
+
checkmarkColor: String
|
97
|
+
}
|
98
|
+
const LabelContainer = styled('label', containerProps)`
|
88
99
|
display: grid;
|
89
100
|
grid-template-columns: auto 1fr auto;
|
90
101
|
grid-gap: 15px;
|
@@ -92,30 +103,30 @@ const LabelContainer = styled("label", containerProps)`
|
|
92
103
|
color: ${(props) =>
|
93
104
|
props.isDisabled ? props.theme.colors.grey2 : props.theme.colors.black};
|
94
105
|
position: relative;
|
95
|
-
cursor: ${(props) => (props.isDisabled ?
|
106
|
+
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
|
96
107
|
font-size: ${(props) =>
|
97
|
-
props.size ===
|
98
|
-
?
|
99
|
-
: props.size ===
|
100
|
-
|
101
|
-
|
108
|
+
props.size === 'large'
|
109
|
+
? '16px'
|
110
|
+
: props.size === 'medium'
|
111
|
+
? '13px'
|
112
|
+
: '10px'};
|
102
113
|
user-select: none;
|
103
114
|
flex: auto;
|
104
115
|
align-self: baseline;
|
105
116
|
|
106
117
|
.checkmark {
|
107
118
|
height: ${(props) =>
|
108
|
-
props.size ===
|
109
|
-
?
|
110
|
-
: props.size ===
|
111
|
-
|
112
|
-
|
119
|
+
props.size === 'large'
|
120
|
+
? '23px'
|
121
|
+
: props.size === 'medium'
|
122
|
+
? '16px'
|
123
|
+
: '12px'};
|
113
124
|
width: ${(props) =>
|
114
|
-
props.size ===
|
115
|
-
?
|
116
|
-
: props.size ===
|
117
|
-
|
118
|
-
|
125
|
+
props.size === 'large'
|
126
|
+
? '23px'
|
127
|
+
: props.size === 'medium'
|
128
|
+
? '16px'
|
129
|
+
: '12px'};
|
119
130
|
background-color: #fff;
|
120
131
|
border-radius: 100%;
|
121
132
|
border: 1px solid ${(props) => props.theme.colors.mediumGray};
|
@@ -124,28 +135,29 @@ const LabelContainer = styled("label", containerProps)`
|
|
124
135
|
justify-content: center;
|
125
136
|
|
126
137
|
&:after {
|
127
|
-
content:
|
128
|
-
display: ${(props) => props.isChecked ? 'block' : 'none'};
|
138
|
+
content: '';
|
139
|
+
display: ${(props) => (props.isChecked ? 'block' : 'none')};
|
129
140
|
width: ${(props) =>
|
130
|
-
props.size ===
|
131
|
-
?
|
132
|
-
: props.size ===
|
133
|
-
|
134
|
-
|
141
|
+
props.size === 'large'
|
142
|
+
? '10px'
|
143
|
+
: props.size === 'medium'
|
144
|
+
? '8px'
|
145
|
+
: '6px'};
|
135
146
|
height: ${(props) =>
|
136
|
-
props.size ===
|
137
|
-
?
|
138
|
-
: props.size ===
|
139
|
-
|
140
|
-
|
147
|
+
props.size === 'large'
|
148
|
+
? '10px'
|
149
|
+
: props.size === 'medium'
|
150
|
+
? '8px'
|
151
|
+
: '6px'};
|
141
152
|
border-radius: 100%;
|
142
|
-
background: ${(props) =>
|
153
|
+
background: ${(props) =>
|
154
|
+
props.checkmarkColor ? props.checkmarkColor : props.theme.colors.green};
|
143
155
|
}
|
144
156
|
}
|
145
157
|
`
|
146
158
|
|
147
159
|
const textAttrs = { isDisabled: Boolean }
|
148
|
-
const LabelText = styled(
|
160
|
+
const LabelText = styled('div', textAttrs)`
|
149
161
|
color: ${(props) =>
|
150
162
|
props.isDisabled ? props.theme.colors.grey2 : props.theme.colors.black};
|
151
163
|
`
|
@@ -186,7 +198,7 @@ const ModalImageContainer = styled.div`
|
|
186
198
|
`
|
187
199
|
|
188
200
|
export default {
|
189
|
-
name:
|
201
|
+
name: 'radio-button',
|
190
202
|
components: {
|
191
203
|
Radio,
|
192
204
|
ComponentWrapper,
|
@@ -198,24 +210,24 @@ export default {
|
|
198
210
|
ModalImage,
|
199
211
|
ModalImageContainer,
|
200
212
|
InfoText,
|
201
|
-
LabelText
|
213
|
+
LabelText
|
202
214
|
},
|
203
215
|
props: {
|
204
216
|
selectedOption: {
|
205
217
|
required: true,
|
206
|
-
default: false
|
218
|
+
default: false
|
207
219
|
},
|
208
220
|
options: {
|
209
221
|
required: true,
|
210
|
-
default: []
|
222
|
+
default: []
|
211
223
|
},
|
212
224
|
layout: {
|
213
225
|
required: false,
|
214
|
-
default:
|
226
|
+
default: 'horizontal' //2 options: 'vertical' (only 1 per row) & 'horizontal' (many per row)
|
215
227
|
},
|
216
228
|
size: {
|
217
229
|
required: false,
|
218
|
-
default:
|
230
|
+
default: 'medium' // small, medium, large
|
219
231
|
},
|
220
232
|
name: {
|
221
233
|
required: false,
|
@@ -224,6 +236,10 @@ export default {
|
|
224
236
|
checkmarkColor: {
|
225
237
|
required: false,
|
226
238
|
default: ''
|
239
|
+
},
|
240
|
+
dataId: {
|
241
|
+
type: String,
|
242
|
+
default: 'key'
|
227
243
|
}
|
228
244
|
},
|
229
245
|
data() {
|
@@ -234,17 +250,18 @@ export default {
|
|
234
250
|
},
|
235
251
|
methods: {
|
236
252
|
onInputHandler(value) {
|
237
|
-
this.$emit(
|
253
|
+
this.$emit('on-radio-change', value)
|
238
254
|
},
|
239
255
|
isImageOpen(index) {
|
240
256
|
return this.selectedImage === index
|
241
257
|
},
|
242
258
|
toggleImageModal(value) {
|
243
259
|
this.selectedImage = value
|
244
|
-
}
|
260
|
+
}
|
245
261
|
},
|
246
262
|
created() {
|
247
|
-
this.radioName =
|
248
|
-
|
263
|
+
this.radioName =
|
264
|
+
this.name.length === 0 ? Math.round(Math.random() * 10000) : this.name
|
265
|
+
}
|
249
266
|
}
|
250
267
|
</script>
|
@@ -22,9 +22,7 @@
|
|
22
22
|
<info-text
|
23
23
|
v-if="infoTextMessage"
|
24
24
|
:text="infoTextMessage"
|
25
|
-
borderColor="#ccc"
|
26
25
|
:size="fontSize ? fontSize : '16px'"
|
27
|
-
:alignText="infoTextAlign"
|
28
26
|
/>
|
29
27
|
</label-wrapper>
|
30
28
|
<select-button-wrapper :disabled="disabled">
|
@@ -313,9 +311,6 @@ export default {
|
|
313
311
|
infoTextMessage: {
|
314
312
|
required: false
|
315
313
|
},
|
316
|
-
infoTextAlign: {
|
317
|
-
required: false
|
318
|
-
},
|
319
314
|
selectWidth: {
|
320
315
|
required: false,
|
321
316
|
default: null
|
@@ -492,10 +487,14 @@ export default {
|
|
492
487
|
this.toggleDropdown()
|
493
488
|
},
|
494
489
|
clickOutside(event) {
|
490
|
+
const dropdownRef = this.$refs.dropdown
|
491
|
+
// we need to prevent closing on selecting an option, because in the case of
|
492
|
+
// a disabled option, we don't want to close the dropdown
|
495
493
|
if (!this.isClickOutsideActive) return
|
496
494
|
if (
|
497
495
|
this.$refs.select.$el == event.target ||
|
498
|
-
this.$refs.select.$el.contains(event.target)
|
496
|
+
this.$refs.select.$el.contains(event.target) ||
|
497
|
+
event.target.parentNode === dropdownRef.$el
|
499
498
|
) {
|
500
499
|
return
|
501
500
|
} else {
|
@@ -1,10 +1,18 @@
|
|
1
1
|
<template>
|
2
2
|
<optionContainer
|
3
3
|
:data-value="value"
|
4
|
-
:hoveredBgColor="
|
5
|
-
|
4
|
+
:hoveredBgColor="
|
5
|
+
colorMode == 'dark'
|
6
|
+
? '#000000'
|
7
|
+
: hoveredBgColor
|
8
|
+
? hoveredBgColor
|
9
|
+
: 'grey5'
|
10
|
+
"
|
6
11
|
@click="clickHandler"
|
7
12
|
@mouseover="hoverHandler"
|
13
|
+
:cursorType="cursorType"
|
14
|
+
:backgroundColor="colorMode == 'dark' ? '#000000' : backgroundColor"
|
15
|
+
:title="hoverText"
|
8
16
|
>
|
9
17
|
<slot></slot>
|
10
18
|
</optionContainer>
|
@@ -14,18 +22,29 @@
|
|
14
22
|
// import selectButton from './selectButton'
|
15
23
|
// import selectDropdown from './selectDropDown'
|
16
24
|
import styled from 'vue-styled-components'
|
17
|
-
const optionProps = {
|
25
|
+
const optionProps = {
|
26
|
+
hoveredBgColor: String,
|
27
|
+
cursorType: String,
|
28
|
+
backgroundColor: String
|
29
|
+
}
|
18
30
|
const optionContainer = styled('div', optionProps)`
|
19
31
|
display: flex;
|
20
|
-
cursor:
|
32
|
+
cursor: ${(props) => props.cursorType};
|
21
33
|
flex-direction: row;
|
22
34
|
justify-content: space-between;
|
23
35
|
align-items: center;
|
24
36
|
padding: 12px 10px;
|
25
37
|
gap: 14px;
|
26
38
|
width: 100%;
|
27
|
-
background-color: ${(props) =>
|
39
|
+
background-color: ${(props) =>
|
40
|
+
props.theme.colors[props.backgroundColor]
|
41
|
+
? props.theme.colors[props.backgroundColor]
|
42
|
+
: props.backgroundColor};
|
28
43
|
box-sizing: inherit;
|
44
|
+
background-color: ${(props) =>
|
45
|
+
props.theme.colors[props.backgroundColor]
|
46
|
+
? props.theme.colors[props.backgroundColor]
|
47
|
+
: props.backgroundColor};
|
29
48
|
&:hover {
|
30
49
|
background-color: ${(props) =>
|
31
50
|
props.theme.colors[props.hoveredBgColor]
|
@@ -47,6 +66,21 @@ export default {
|
|
47
66
|
colorMode: {
|
48
67
|
required: false,
|
49
68
|
default: 'light'
|
69
|
+
},
|
70
|
+
cursorType: {
|
71
|
+
required: false,
|
72
|
+
default: 'cursor'
|
73
|
+
},
|
74
|
+
backgroundColor: {
|
75
|
+
required: false,
|
76
|
+
default: 'white'
|
77
|
+
},
|
78
|
+
hoverText: {
|
79
|
+
required: false
|
80
|
+
},
|
81
|
+
isDisabled: {
|
82
|
+
required: false,
|
83
|
+
default: false
|
50
84
|
}
|
51
85
|
},
|
52
86
|
|
@@ -57,7 +91,12 @@ export default {
|
|
57
91
|
},
|
58
92
|
methods: {
|
59
93
|
clickHandler() {
|
60
|
-
|
94
|
+
if (this.isDisabled) {
|
95
|
+
// prevent emitter if the option is disabled
|
96
|
+
return
|
97
|
+
} else {
|
98
|
+
this.$parent.$emit('option-selected', this.value)
|
99
|
+
}
|
61
100
|
},
|
62
101
|
hoverHandler() {
|
63
102
|
this.$parent.$emit('option-hovered', this.value)
|
@@ -15,9 +15,6 @@
|
|
15
15
|
<info-text
|
16
16
|
v-if="infoTextMessage"
|
17
17
|
:text="infoTextMessage"
|
18
|
-
borderColor="#ccc"
|
19
|
-
size="14px"
|
20
|
-
:alignText="infoTextAlign"
|
21
18
|
/>
|
22
19
|
</label-container>
|
23
20
|
|
@@ -48,9 +45,6 @@
|
|
48
45
|
@click.native.stop
|
49
46
|
v-if="infoTextMessage"
|
50
47
|
:text="infoTextMessage"
|
51
|
-
borderColor="#ccc"
|
52
|
-
size="14px"
|
53
|
-
:alignText="infoTextAlign"
|
54
48
|
/>
|
55
49
|
</label-container>
|
56
50
|
</flex-wrapper>
|
@@ -202,9 +196,6 @@ export default {
|
|
202
196
|
infoTextMessage: {
|
203
197
|
required: false
|
204
198
|
},
|
205
|
-
infoTextAlign: {
|
206
|
-
required: false
|
207
|
-
},
|
208
199
|
colorMode: {
|
209
200
|
required: false,
|
210
201
|
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!",
|
@@ -11,9 +11,7 @@
|
|
11
11
|
<info-text
|
12
12
|
v-if="infoTextMessage"
|
13
13
|
:text="infoTextMessage"
|
14
|
-
borderColor="#ccc"
|
15
14
|
size="16px"
|
16
|
-
:alignText="infoTextAlign"
|
17
15
|
/>
|
18
16
|
</label-wrapper>
|
19
17
|
<input-container
|
@@ -47,7 +45,6 @@
|
|
47
45
|
// rowHeight="4" //optional
|
48
46
|
// :isError="false"
|
49
47
|
// :errorText="$gettext('field_required')"
|
50
|
-
// infoTextAlign="right" // left by default
|
51
48
|
// infoTextMessage="My info message"
|
52
49
|
// label="Question 5"
|
53
50
|
// alignItems="horizontal" // horizontal, vertical
|
@@ -167,9 +164,6 @@ export default {
|
|
167
164
|
infoTextMessage: {
|
168
165
|
required: false
|
169
166
|
},
|
170
|
-
infoTextAlign: {
|
171
|
-
required: false
|
172
|
-
},
|
173
167
|
label: {
|
174
168
|
required: false
|
175
169
|
},
|