@eturnity/eturnity_reusable_components 1.2.39-EPDM-5626.4 → 1.2.40
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
@@ -1,9 +1,8 @@
|
|
1
1
|
<template>
|
2
2
|
<page-container>
|
3
3
|
<button-container
|
4
|
-
:type="type"
|
5
|
-
:minWidth="minWidth"
|
6
4
|
:isDisabled="isDisabled"
|
5
|
+
:type="type"
|
7
6
|
:customColor="customColor"
|
8
7
|
>
|
9
8
|
{{ text }}
|
@@ -15,39 +14,37 @@
|
|
15
14
|
// To use:
|
16
15
|
// import MainButton from "@eturnity/eturnity_reusable_components/src/components/buttons/mainButton"
|
17
16
|
// <main-button
|
18
|
-
// text="Click Me"
|
19
|
-
// customColor="#ab5348"
|
20
17
|
// type="secondary" // primary, secondary, cancel
|
21
18
|
// :isDisabled="true"
|
22
|
-
//
|
19
|
+
// text="Click Me"
|
20
|
+
// customColor="#ab5348"
|
23
21
|
// />
|
24
22
|
|
25
23
|
import styled from "vue-styled-components"
|
26
24
|
|
27
25
|
const PageContainer = styled.div``
|
28
26
|
|
29
|
-
const ButtonAttrs = { type: String, isDisabled: Boolean,
|
27
|
+
const ButtonAttrs = { type: String, isDisabled: Boolean, customColor: String }
|
30
28
|
const ButtonContainer = styled("div", ButtonAttrs)`
|
31
29
|
padding: 7px 15px;
|
32
30
|
font-size: 13px;
|
33
31
|
color: ${(props) => props.theme.colors.white};
|
34
32
|
background-color: ${(props) =>
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
33
|
+
props.isDisabled
|
34
|
+
? props.theme.colors.disabled
|
35
|
+
: props.customColor
|
36
|
+
? props.customColor
|
37
|
+
: props.type === "primary"
|
38
|
+
? props.theme.colors.black
|
39
|
+
: props.type === "secondary"
|
40
|
+
? props.theme.colors.grey3
|
41
|
+
: props.type === "cancel"
|
42
|
+
? props.theme.colors.red
|
43
|
+
: props.theme.colors.black};
|
46
44
|
border-radius: 4px;
|
47
45
|
text-align: center;
|
48
46
|
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
|
49
47
|
user-select: none;
|
50
|
-
${(props) => (props.minWidth ? `min-width: ${props.minWidth};` : '')};
|
51
48
|
|
52
49
|
&:hover {
|
53
50
|
opacity: ${(props) => (props.isDisabled ? "1" : "0.8")};
|
@@ -80,10 +77,6 @@ export default {
|
|
80
77
|
required: false,
|
81
78
|
default: null,
|
82
79
|
},
|
83
|
-
minWidth: {
|
84
|
-
required: false,
|
85
|
-
default: null
|
86
|
-
}
|
87
80
|
},
|
88
81
|
}
|
89
82
|
</script>
|
@@ -57,11 +57,9 @@
|
|
57
57
|
:isError="isError"
|
58
58
|
>{{ unitName }}</unit-container
|
59
59
|
>
|
60
|
-
<icon
|
61
|
-
|
62
|
-
|
63
|
-
:src="isError ? warningIcon : inputIconImage"
|
64
|
-
/>
|
60
|
+
<icon-wrapper v-if="isError && !showLinearUnitName" size="16px">
|
61
|
+
<icon name="warning" size="16px" cursor="default" />
|
62
|
+
</icon-wrapper>
|
65
63
|
</input-wrapper>
|
66
64
|
<error-message v-if="isError">{{ errorMessage }}</error-message>
|
67
65
|
</container>
|
@@ -101,6 +99,7 @@ import {
|
|
101
99
|
import InfoText from '../../infoText'
|
102
100
|
import ErrorMessage from '../../errorMessage'
|
103
101
|
import warningIcon from '../../../assets/icons/error_icon.png'
|
102
|
+
import Icon from '../../icon'
|
104
103
|
|
105
104
|
const inputProps = {
|
106
105
|
isError: Boolean,
|
@@ -178,15 +177,6 @@ const InputContainer = styled('input', inputProps)`
|
|
178
177
|
outline: none;
|
179
178
|
}
|
180
179
|
`
|
181
|
-
const IconProps = {
|
182
|
-
inputIconHeight: String
|
183
|
-
}
|
184
|
-
|
185
|
-
const Icon = styled('img', IconProps)`
|
186
|
-
position: absolute;
|
187
|
-
right: 10px;
|
188
|
-
top: 2px;
|
189
|
-
`
|
190
180
|
|
191
181
|
const InputWrapper = styled.span`
|
192
182
|
position: relative;
|
@@ -259,6 +249,16 @@ const LabelText = styled('div', inputProps)`
|
|
259
249
|
font-weight: 700;
|
260
250
|
`
|
261
251
|
|
252
|
+
const IconAttrs = { size: String }
|
253
|
+
const IconWrapper = styled('div', IconAttrs)`
|
254
|
+
position: absolute;
|
255
|
+
top: 0;
|
256
|
+
bottom: 0;
|
257
|
+
margin: auto;
|
258
|
+
right: 5px;
|
259
|
+
height: ${(props) => (props.size ? props.size : 'auto')};
|
260
|
+
`
|
261
|
+
|
262
262
|
export default {
|
263
263
|
name: 'input-number',
|
264
264
|
components: {
|
@@ -272,7 +272,8 @@ export default {
|
|
272
272
|
LabelText,
|
273
273
|
InfoText,
|
274
274
|
Icon,
|
275
|
-
SlotContainer
|
275
|
+
SlotContainer,
|
276
|
+
IconWrapper
|
276
277
|
},
|
277
278
|
inheritAttrs: false,
|
278
279
|
data() {
|
@@ -386,25 +387,10 @@ export default {
|
|
386
387
|
required: false,
|
387
388
|
default: true
|
388
389
|
},
|
389
|
-
inputIcon: {
|
390
|
-
require: false,
|
391
|
-
type: Boolean,
|
392
|
-
default: false
|
393
|
-
},
|
394
|
-
inputIconImage: {
|
395
|
-
require: false,
|
396
|
-
type: String,
|
397
|
-
default: ''
|
398
|
-
},
|
399
390
|
allowNegative: {
|
400
391
|
required: false,
|
401
392
|
default: true
|
402
393
|
},
|
403
|
-
inputIconImageClass: {
|
404
|
-
require: false,
|
405
|
-
type: Array,
|
406
|
-
default: () => []
|
407
|
-
},
|
408
394
|
slotSize: {
|
409
395
|
required: false
|
410
396
|
},
|
@@ -74,7 +74,7 @@ const InputLabel = styled('div', labelAttrs)`
|
|
74
74
|
};
|
75
75
|
|
76
76
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
|
77
|
-
font-
|
77
|
+
font-weight: 700;
|
78
78
|
`
|
79
79
|
|
80
80
|
const LabelWrapper = styled.div`
|
@@ -138,7 +138,7 @@ const InputContainer = styled('input', inputProps)`
|
|
138
138
|
min-width: ${(props) => (props.minWidth ? props.minWidth : 'unset')};
|
139
139
|
max-height: ${(props) => props.inputHeight};
|
140
140
|
box-sizing: border-box; // to allow width of 100% with padding
|
141
|
-
font-weight:
|
141
|
+
font-weight: 500;
|
142
142
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'auto')};
|
143
143
|
background-color: ${(props) =>
|
144
144
|
props.isDisabled ? props.theme.colors.grey5 :
|
@@ -1,7 +1,7 @@
|
|
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 :size="size" :isDisabled="item.disabled" :isChecked="selectedOption === item.value"
|
4
|
+
<label-container :size="size" :isDisabled="item.disabled" :isChecked="selectedOption === item.value">
|
5
5
|
<radio
|
6
6
|
type="radio"
|
7
7
|
:value="selectedOption"
|
@@ -83,7 +83,7 @@ const RadioWrapper = styled.div`
|
|
83
83
|
grid-gap: 10px;
|
84
84
|
`
|
85
85
|
|
86
|
-
const containerProps = { size: String, isDisabled: Boolean, isChecked: Boolean
|
86
|
+
const containerProps = { size: String, isDisabled: Boolean, isChecked: Boolean }
|
87
87
|
const LabelContainer = styled("label", containerProps)`
|
88
88
|
display: grid;
|
89
89
|
grid-template-columns: auto 1fr auto;
|
@@ -139,7 +139,7 @@ const LabelContainer = styled("label", containerProps)`
|
|
139
139
|
? "8px"
|
140
140
|
: "6px"};
|
141
141
|
border-radius: 100%;
|
142
|
-
background: ${(props) => props.
|
142
|
+
background: ${(props) => props.theme.colors.primary};
|
143
143
|
}
|
144
144
|
}
|
145
145
|
`
|
@@ -220,10 +220,6 @@ export default {
|
|
220
220
|
name: {
|
221
221
|
required: false,
|
222
222
|
default: ''
|
223
|
-
},
|
224
|
-
checkmarkColor: {
|
225
|
-
required: false,
|
226
|
-
default: ''
|
227
223
|
}
|
228
224
|
},
|
229
225
|
data() {
|