@eturnity/eturnity_reusable_components 7.2.0 → 7.2.2-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 +1 -1
- package/src/components/infoText/index.vue +1 -12
- package/src/components/inputs/inputNumber/InputNumber.stories.js +1 -3
- package/src/components/inputs/inputNumber/index.vue +1 -9
- package/src/components/inputs/inputText/InputText.stories.js +0 -1
- package/src/components/inputs/inputText/index.vue +0 -6
- package/src/components/inputs/select/index.vue +0 -5
- 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 +1 -11
- package/src/components/navigationTabs/index.vue +9 -7
- package/src/components/pageSubtitle/index.vue +1 -8
- package/src/components/pageTitle/index.vue +29 -28
- package/src/helpers/numberConverter.js +1 -1
package/package.json
CHANGED
@@ -10,7 +10,6 @@
|
|
10
10
|
</icon-img>
|
11
11
|
<text-overlay
|
12
12
|
v-if="showInfo"
|
13
|
-
:borderColor="borderColor"
|
14
13
|
:width="width"
|
15
14
|
:halfComputedTextInfoWidth="halfComputedTextInfoWidth"
|
16
15
|
:alignArrow="alignArrow"
|
@@ -27,7 +26,6 @@
|
|
27
26
|
//To use:
|
28
27
|
// <info-text
|
29
28
|
// text="Veritatis et quasi architecto beatae vitae"
|
30
|
-
// borderColor="#ccc"
|
31
29
|
// size="20"
|
32
30
|
// alignArrow="right" // which side the arrow should be on
|
33
31
|
// />
|
@@ -37,7 +35,6 @@ import icon from '../icon'
|
|
37
35
|
|
38
36
|
const textAttrs = {
|
39
37
|
iconSize: String,
|
40
|
-
borderColor: String,
|
41
38
|
alignArrow: String,
|
42
39
|
width: String,
|
43
40
|
halfComputedTextInfoWidth: Number
|
@@ -111,10 +108,6 @@ export default {
|
|
111
108
|
text: {
|
112
109
|
required: false
|
113
110
|
},
|
114
|
-
borderColor: {
|
115
|
-
required: false,
|
116
|
-
default: null
|
117
|
-
},
|
118
111
|
size: {
|
119
112
|
required: false,
|
120
113
|
default: '14px'
|
@@ -156,11 +149,7 @@ export default {
|
|
156
149
|
},
|
157
150
|
computed: {
|
158
151
|
iconColor() {
|
159
|
-
return
|
160
|
-
? this.borderColor
|
161
|
-
? this.borderColor
|
162
|
-
: theme.colors.secondary
|
163
|
-
: theme.colors.mediumGray
|
152
|
+
return theme.colors.mediumGray
|
164
153
|
},
|
165
154
|
halfComputedTextInfoWidth() {
|
166
155
|
return parseInt(this.width) / 2
|
@@ -32,7 +32,6 @@ const Template = (args, { argTypes }) => ({
|
|
32
32
|
// fontSize="13px"
|
33
33
|
// labelText="Number of Modules"
|
34
34
|
// labelInfoText="Here is some information for you..."
|
35
|
-
// labelInfoAlign="left"
|
36
35
|
// />
|
37
36
|
})
|
38
37
|
|
@@ -129,8 +128,7 @@ WithLabelInfo.args = {
|
|
129
128
|
textAlign: "left",
|
130
129
|
showLinearUnitName: false,
|
131
130
|
labelText: "Number Input",
|
132
|
-
labelInfoText: "Here is some information for you..."
|
133
|
-
labelInfoAlign: "right",
|
131
|
+
labelInfoText: "Here is some information for you..."
|
134
132
|
}
|
135
133
|
|
136
134
|
export const LargerFont = Template.bind({})
|
@@ -16,13 +16,10 @@
|
|
16
16
|
<label-text :labelFontColor="labelFontColor" :data-id="labelDataId">
|
17
17
|
{{ labelText }}
|
18
18
|
</label-text>
|
19
|
-
|
19
|
+
|
20
20
|
<info-text
|
21
21
|
v-if="labelInfoText"
|
22
22
|
:text="labelInfoText"
|
23
|
-
borderColor="#ccc"
|
24
|
-
size="14px"
|
25
|
-
:alignArrow="labelInfoAlign"
|
26
23
|
/>
|
27
24
|
</label-wrapper>
|
28
25
|
<input-wrapper>
|
@@ -97,7 +94,6 @@
|
|
97
94
|
// fontSize="13px"
|
98
95
|
// labelText="Number of Modules"
|
99
96
|
// labelInfoText="Here is some information for you..."
|
100
|
-
// labelInfoAlign="left"
|
101
97
|
// :minNumber="0"
|
102
98
|
// fontColor="blue"
|
103
99
|
// />
|
@@ -406,10 +402,6 @@ export default {
|
|
406
402
|
required: false,
|
407
403
|
default: null
|
408
404
|
},
|
409
|
-
labelInfoAlign: {
|
410
|
-
required: false,
|
411
|
-
default: 'left'
|
412
|
-
},
|
413
405
|
defaultNumber: {
|
414
406
|
required: false,
|
415
407
|
default: null
|
@@ -21,7 +21,6 @@ const Template = (args, { argTypes }) => ({
|
|
21
21
|
// @input-change="onInputChange({ value: $event, type: 'companyName' })"
|
22
22
|
// :isError="checkErrors()"
|
23
23
|
// :errorMessage="This is my error message"
|
24
|
-
// infoTextAlign="right" // left by default
|
25
24
|
// infoTextMessage="My info message"
|
26
25
|
// label="Question 5"
|
27
26
|
// alignItems="horizontal" // horizontal, vertical
|
@@ -17,9 +17,7 @@
|
|
17
17
|
<info-text
|
18
18
|
v-if="infoTextMessage"
|
19
19
|
:text="infoTextMessage"
|
20
|
-
borderColor="#ccc"
|
21
20
|
:size="fontSize ? fontSize : '16px'"
|
22
|
-
:alignArrow="infoTextAlign"
|
23
21
|
/>
|
24
22
|
</label-wrapper>
|
25
23
|
<input-error-wrapper>
|
@@ -206,7 +204,6 @@ export default {
|
|
206
204
|
// @input-blur="onInputBlur($event)"
|
207
205
|
// :isError="checkErrors()"
|
208
206
|
// :errorMessage="This is my error message"
|
209
|
-
// infoTextAlign="right" // left by default
|
210
207
|
// infoTextMessage="My info message"
|
211
208
|
// label="Question 5"
|
212
209
|
// alignItems="horizontal" // horizontal, vertical
|
@@ -270,9 +267,6 @@ export default {
|
|
270
267
|
infoTextMessage: {
|
271
268
|
required: false
|
272
269
|
},
|
273
|
-
infoTextAlign: {
|
274
|
-
required: false
|
275
|
-
},
|
276
270
|
label: {
|
277
271
|
required: false
|
278
272
|
},
|
@@ -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">
|
@@ -315,9 +313,6 @@ export default {
|
|
315
313
|
infoTextMessage: {
|
316
314
|
required: false
|
317
315
|
},
|
318
|
-
infoTextAlign: {
|
319
|
-
required: false
|
320
|
-
},
|
321
316
|
selectWidth: {
|
322
317
|
required: false,
|
323
318
|
default: null
|
@@ -17,9 +17,6 @@
|
|
17
17
|
<info-text
|
18
18
|
v-if="infoTextMessage"
|
19
19
|
:text="infoTextMessage"
|
20
|
-
borderColor="#ccc"
|
21
|
-
size="14px"
|
22
|
-
:alignText="infoTextAlign"
|
23
20
|
/>
|
24
21
|
</label-container>
|
25
22
|
|
@@ -51,9 +48,6 @@
|
|
51
48
|
@click.native.stop
|
52
49
|
v-if="infoTextMessage"
|
53
50
|
:text="infoTextMessage"
|
54
|
-
borderColor="#ccc"
|
55
|
-
size="14px"
|
56
|
-
:alignText="infoTextAlign"
|
57
51
|
/>
|
58
52
|
</label-container>
|
59
53
|
</flex-wrapper>
|
@@ -207,9 +201,6 @@ export default {
|
|
207
201
|
infoTextMessage: {
|
208
202
|
required: false
|
209
203
|
},
|
210
|
-
infoTextAlign: {
|
211
|
-
required: false
|
212
|
-
},
|
213
204
|
colorMode: {
|
214
205
|
required: false,
|
215
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!",
|
@@ -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
|
},
|
@@ -14,9 +14,6 @@
|
|
14
14
|
<info-text
|
15
15
|
v-if="infoTextMessage"
|
16
16
|
:text="infoTextMessage"
|
17
|
-
borderColor="#ccc"
|
18
|
-
size="14px"
|
19
|
-
:alignText="infoTextAlign"
|
20
17
|
/>
|
21
18
|
</label-container>
|
22
19
|
<toggle-wrapper
|
@@ -50,9 +47,6 @@
|
|
50
47
|
@click.native.stop
|
51
48
|
v-if="infoTextMessage"
|
52
49
|
:text="infoTextMessage"
|
53
|
-
borderColor="#ccc"
|
54
|
-
size="14px"
|
55
|
-
:alignText="infoTextAlign"
|
56
50
|
/>
|
57
51
|
</label-container>
|
58
52
|
</flex-wrapper>
|
@@ -72,7 +66,6 @@
|
|
72
66
|
// labelAlign="right"
|
73
67
|
// fontColor="black"
|
74
68
|
// :disabled="true"
|
75
|
-
// infoTextAlign="right" // left by default
|
76
69
|
// infoTextMessage="My info message"
|
77
70
|
// data-id="test_data_id"
|
78
71
|
// />
|
@@ -193,7 +186,7 @@ const ToggleDot = styled('span', toggleProps)`
|
|
193
186
|
: props.size === 'small'
|
194
187
|
? '10px'
|
195
188
|
: '14px'};
|
196
|
-
left: 3px
|
189
|
+
left: 3px;
|
197
190
|
bottom: ${(props) =>
|
198
191
|
props.size === 'medium' ? '5px' : props.size === 'small' ? '2px' : '5px'};
|
199
192
|
background-color: ${(props) =>
|
@@ -278,9 +271,6 @@ export default {
|
|
278
271
|
infoTextMessage: {
|
279
272
|
required: false
|
280
273
|
},
|
281
|
-
infoTextAlign: {
|
282
|
-
required: false
|
283
|
-
},
|
284
274
|
dataId: {
|
285
275
|
type: String,
|
286
276
|
default: ''
|
@@ -4,11 +4,11 @@
|
|
4
4
|
v-for="(tab, index) in tabsData"
|
5
5
|
:key="tab.id"
|
6
6
|
:isDisabled="!!tab['isDisabled']"
|
7
|
-
:
|
7
|
+
:textColor="tab['textColor']"
|
8
8
|
:active="isIndexKey ? index === activeTab : tab[tabKey] === activeTab"
|
9
9
|
@click="$emit('tab-click', isIndexKey ? index : tab[tabKey])"
|
10
10
|
>
|
11
|
-
<Option :isDisabled="!!tab['isDisabled']" :
|
11
|
+
<Option :isDisabled="!!tab['isDisabled']" :textColor="tab['textColor']">
|
12
12
|
<Uppercase>{{ tab[tabLabel] }}</Uppercase>
|
13
13
|
<info-text
|
14
14
|
v-if="tab['labelInfoText']"
|
@@ -29,7 +29,7 @@ import InfoText from '../infoText'
|
|
29
29
|
const TabAttr = {
|
30
30
|
active: Boolean,
|
31
31
|
isDisabled: Boolean,
|
32
|
-
|
32
|
+
textColor: String
|
33
33
|
}
|
34
34
|
|
35
35
|
const bottomLine = styled('div')`
|
@@ -57,17 +57,19 @@ const Option = styled('div',TabAttr)`
|
|
57
57
|
justify-content: center;
|
58
58
|
flex-direction: row;
|
59
59
|
gap: 10px;
|
60
|
-
color: ${props=>props.
|
60
|
+
color: ${props=>props.textColor ?
|
61
|
+
props.theme.colors[props.textColor] ? props.theme.colors[props.textColor] : props.textColor :
|
62
|
+
props.isDisabled ? props.theme.colors.grey2 : props.theme.colors.black};
|
61
63
|
`
|
62
64
|
const Tab = styled('div', TabAttr)`
|
63
65
|
padding: 16px 10px;
|
64
66
|
margin-right: 5px;
|
65
67
|
position: relative;
|
66
|
-
top: ${(props) => (props.
|
68
|
+
top: ${(props) => (props.isDisabled ? '-1px' : '0')};
|
67
69
|
z-index: 10;
|
68
70
|
border-bottom: 2px solid
|
69
71
|
${(props) => (props.active ? props.theme.colors.primary : 'transparent')};
|
70
|
-
background-color: ${(props) => (props.
|
72
|
+
background-color: ${(props) => (props.isDisabled ? props.theme.colors.grey5 : 'transparent')};
|
71
73
|
transition: 0.2s ease;
|
72
74
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
|
73
75
|
min-width: 140px;
|
@@ -76,7 +78,7 @@ const Tab = styled('div', TabAttr)`
|
|
76
78
|
justify-content: space-between;
|
77
79
|
min-height: 55px;
|
78
80
|
&:hover {
|
79
|
-
border-color: ${(props) => props.
|
81
|
+
border-color: ${(props) => props.isDisabled ? props.theme.colors.grey2 : props.theme.colors.primary};
|
80
82
|
}
|
81
83
|
`
|
82
84
|
|
@@ -4,11 +4,8 @@
|
|
4
4
|
{{ text }}
|
5
5
|
</span>
|
6
6
|
<info-text
|
7
|
-
:text="infoText"
|
8
7
|
v-if="!!infoText"
|
9
|
-
|
10
|
-
borderColor="#ccc"
|
11
|
-
:alignText="alignInfoText"
|
8
|
+
:text="infoText"
|
12
9
|
/>
|
13
10
|
</subtitle-text>
|
14
11
|
</template>
|
@@ -55,10 +52,6 @@ export default {
|
|
55
52
|
required: false,
|
56
53
|
default: null,
|
57
54
|
},
|
58
|
-
alignInfoText: {
|
59
|
-
required: false,
|
60
|
-
default: "left",
|
61
|
-
},
|
62
55
|
marginBottom: {
|
63
56
|
required: false,
|
64
57
|
default: "30px",
|
@@ -1,14 +1,13 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<title-text :color="color" :fontSize="fontSize" :uppercase="uppercase">
|
2
|
+
<title-wrap :hasInfoText="!!infoText">
|
3
|
+
<title-text :color="color" :fontSize="fontSize" :uppercase="uppercase">
|
4
|
+
{{ text }}
|
5
|
+
</title-text>
|
4
6
|
<info-text
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
:alignArrow="infoAlign"
|
10
|
-
/>
|
11
|
-
</flex>
|
7
|
+
v-if="!!infoText"
|
8
|
+
:text="infoText"
|
9
|
+
/>
|
10
|
+
</title-wrap>
|
12
11
|
</template>
|
13
12
|
|
14
13
|
<script>
|
@@ -19,33 +18,41 @@
|
|
19
18
|
// color="red"
|
20
19
|
// />
|
21
20
|
import styled from "vue-styled-components"
|
22
|
-
import InfoText from
|
23
|
-
|
24
|
-
const
|
21
|
+
import InfoText from "../infoText"
|
22
|
+
|
23
|
+
const wrapAttrs = { hasInfoText: Boolean }
|
24
|
+
const TitleWrap = styled("div", wrapAttrs)`
|
25
|
+
display: grid;
|
26
|
+
align-items: center;
|
27
|
+
grid-gap: 12px;
|
28
|
+
grid-template-columns: ${(props) =>
|
29
|
+
props.hasInfoText ? "auto auto 1fr" : "1fr"};
|
30
|
+
margin-bottom: 20px;
|
31
|
+
`
|
32
|
+
|
33
|
+
const titleAttrs = { color: String, fontSize: String, uppercase: Boolean }
|
34
|
+
const TitleText = styled('span', titleAttrs)`
|
25
35
|
color: ${(props) => (props.color ? props.color : props.theme.colors.black)};
|
26
36
|
font-weight: bold;
|
27
37
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
|
28
38
|
text-transform: ${(props) => (props.uppercase ? 'uppercase' : 'none')};
|
29
|
-
|
30
|
-
`
|
31
|
-
const flex = styled("div", textAttrs)`
|
32
|
-
display: flex;
|
33
|
-
gap:10px;
|
34
|
-
margin-bottom: 20px;
|
35
|
-
align-items: center;
|
36
39
|
`
|
37
40
|
|
38
41
|
export default {
|
39
42
|
name: "page-title",
|
40
43
|
components: {
|
41
44
|
TitleText,
|
42
|
-
|
43
|
-
|
45
|
+
TitleWrap,
|
46
|
+
InfoText
|
44
47
|
},
|
45
48
|
props: {
|
46
49
|
text: {
|
47
50
|
required: true,
|
48
51
|
},
|
52
|
+
infoText: {
|
53
|
+
required: false,
|
54
|
+
default: null,
|
55
|
+
},
|
49
56
|
color: {
|
50
57
|
required: false,
|
51
58
|
},
|
@@ -56,13 +63,7 @@ export default {
|
|
56
63
|
uppercase: {
|
57
64
|
required: false,
|
58
65
|
default: true
|
59
|
-
}
|
60
|
-
infoText: {
|
61
|
-
required: false,
|
62
|
-
},
|
63
|
-
infoAlign: {
|
64
|
-
required: false,
|
65
|
-
},
|
66
|
+
}
|
66
67
|
},
|
67
68
|
}
|
68
69
|
</script>
|
@@ -38,7 +38,7 @@ export const stringToNumber = ({
|
|
38
38
|
.replace(/[.\s]/g, '')
|
39
39
|
.replace(/[,\s]/, '.')
|
40
40
|
}
|
41
|
-
} else if (selectedLang === 'en-us') {
|
41
|
+
} else if (selectedLang === 'en-us' || selectedLang === 'en-gb') {
|
42
42
|
// replace commas with blank: 1,234.56 --> 1234.56
|
43
43
|
if (allowNegative) {
|
44
44
|
newVal = newVal.replace(/[^\d-.,']/g, '').replace(/[,\s]/g, '')
|