@eturnity/eturnity_reusable_components 7.45.5-EPDM-11313.0 → 7.45.5-EPDM-11313-EPDM-11314.0
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -1,10 +1,18 @@
|
|
1
1
|
<template>
|
2
2
|
<InfoContainer
|
3
|
-
|
3
|
+
:min-width="minWidth"
|
4
|
+
:color="color"
|
5
|
+
:align-items="alignItems"
|
6
|
+
:padding="padding"
|
4
7
|
:border-color="borderColor"
|
5
|
-
:
|
8
|
+
:border-style="borderStyle"
|
9
|
+
:preset-styles="presetStyles"
|
6
10
|
>
|
7
|
-
<RCIcon
|
11
|
+
<RCIcon
|
12
|
+
name="info"
|
13
|
+
size="24px"
|
14
|
+
:color="color ? color : presetStyles.iconColor"
|
15
|
+
/>
|
8
16
|
<TextContainer>
|
9
17
|
<slot></slot>
|
10
18
|
</TextContainer>
|
@@ -13,26 +21,37 @@
|
|
13
21
|
|
14
22
|
<script>
|
15
23
|
import styled from 'vue3-styled-components'
|
24
|
+
import theme from '../../assets/theme.js'
|
16
25
|
import RCIcon from '../icon'
|
17
|
-
|
18
|
-
|
19
|
-
|
26
|
+
|
27
|
+
const infoContainerAttrs = {
|
28
|
+
minWidth: String,
|
29
|
+
color: String,
|
30
|
+
alignItems: String,
|
31
|
+
padding: String,
|
20
32
|
borderColor: String,
|
33
|
+
borderStyle: String,
|
34
|
+
presetStyles: Object,
|
21
35
|
}
|
22
|
-
const InfoContainer = styled('div',
|
36
|
+
const InfoContainer = styled('div', infoContainerAttrs)`
|
23
37
|
display: flex;
|
38
|
+
align-items: ${(props) =>
|
39
|
+
props.alignItems ? props.alignItems : props.presetStyles.alignItems};
|
24
40
|
gap: 15px;
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
? props.theme.colors[props.borderColor]
|
30
|
-
: props.borderColor};
|
31
|
-
background-color: ${(props) =>
|
32
|
-
props.theme.colors[props.backgroundColor]
|
33
|
-
? props.theme.colors[props.backgroundColor]
|
34
|
-
: props.backgroundColor};
|
41
|
+
min-width: ${(props) => props.minWidth};
|
42
|
+
padding: ${(props) =>
|
43
|
+
props.padding ? props.padding : props.presetStyles.padding};
|
44
|
+
color: ${(props) => (props.color ? props.color : props.presetStyles.color)};
|
35
45
|
border-radius: 4px;
|
46
|
+
background-color: ${(props) =>
|
47
|
+
props.backgroundColor
|
48
|
+
? props.backgroundColor
|
49
|
+
: props.presetStyles.backgroundColor};
|
50
|
+
border-width: ${(props) => props.presetStyles.borderWidth};
|
51
|
+
border-style: ${(props) =>
|
52
|
+
props.borderStyle ? props.borderStyle : props.presetStyles.borderStyle};
|
53
|
+
border-color: ${(props) =>
|
54
|
+
props.borderColor ? props.borderColor : props.presetStyles.borderColor};
|
36
55
|
`
|
37
56
|
|
38
57
|
const TextContainer = styled.div`
|
@@ -48,19 +67,59 @@
|
|
48
67
|
TextContainer,
|
49
68
|
},
|
50
69
|
props: {
|
70
|
+
type: {
|
71
|
+
required: false,
|
72
|
+
type: String,
|
73
|
+
default: 'info',
|
74
|
+
},
|
75
|
+
minWidth: {
|
76
|
+
required: false,
|
77
|
+
type: String,
|
78
|
+
},
|
51
79
|
color: {
|
52
80
|
required: false,
|
53
81
|
},
|
54
|
-
|
82
|
+
alignItems: {
|
55
83
|
required: false,
|
84
|
+
type: String,
|
56
85
|
},
|
57
|
-
|
86
|
+
padding: {
|
58
87
|
required: false,
|
59
|
-
|
88
|
+
type: String,
|
60
89
|
},
|
61
90
|
borderColor: {
|
62
91
|
required: false,
|
63
|
-
|
92
|
+
type: String,
|
93
|
+
},
|
94
|
+
borderStyle: {
|
95
|
+
required: false,
|
96
|
+
type: String,
|
97
|
+
},
|
98
|
+
},
|
99
|
+
computed: {
|
100
|
+
isInfo() {
|
101
|
+
return this.type === 'info'
|
102
|
+
},
|
103
|
+
isWarning() {
|
104
|
+
return this.type === 'warning'
|
105
|
+
},
|
106
|
+
presetStyles() {
|
107
|
+
let stylesCollection = {}
|
108
|
+
|
109
|
+
if (this.isWarning) {
|
110
|
+
stylesCollection.alignItems = 'center'
|
111
|
+
stylesCollection.padding = '6px 10px'
|
112
|
+
stylesCollection.color = theme.colors.white
|
113
|
+
stylesCollection.backgroundColor = theme.colors.yellow
|
114
|
+
stylesCollection.iconColor = theme.colors.white
|
115
|
+
} else {
|
116
|
+
stylesCollection.padding = '20px'
|
117
|
+
stylesCollection.borderWidth = '1px'
|
118
|
+
stylesCollection.borderStyle = 'dashed'
|
119
|
+
stylesCollection.borderColor = theme.colors.grey4
|
120
|
+
}
|
121
|
+
|
122
|
+
return stylesCollection
|
64
123
|
},
|
65
124
|
},
|
66
125
|
}
|
@@ -86,6 +86,7 @@
|
|
86
86
|
/>
|
87
87
|
<Selector
|
88
88
|
v-else
|
89
|
+
:disabled="disabled"
|
89
90
|
:padding-left="paddingLeft"
|
90
91
|
:select-width="selectWidth"
|
91
92
|
:show-border="showBorder"
|
@@ -96,7 +97,9 @@
|
|
96
97
|
<Icon
|
97
98
|
v-if="isDropdownOpen"
|
98
99
|
:color="
|
99
|
-
caretColor ||
|
100
|
+
caretColor || disabled
|
101
|
+
? 'grey2'
|
102
|
+
: colorMode == 'dark'
|
100
103
|
? 'white'
|
101
104
|
: 'transparentBlack1'
|
102
105
|
"
|
@@ -106,7 +109,9 @@
|
|
106
109
|
<Icon
|
107
110
|
v-else
|
108
111
|
:color="
|
109
|
-
caretColor ||
|
112
|
+
caretColor || disabled
|
113
|
+
? 'grey2'
|
114
|
+
: colorMode == 'dark'
|
110
115
|
? 'white'
|
111
116
|
: 'transparentBlack1'
|
112
117
|
"
|
@@ -199,11 +204,13 @@
|
|
199
204
|
`
|
200
205
|
|
201
206
|
const selectorProps = {
|
207
|
+
disabled: String,
|
202
208
|
selectWidth: String,
|
203
209
|
paddingLeft: String,
|
204
210
|
showBorder: Boolean,
|
205
211
|
}
|
206
212
|
const Selector = styled('div', selectorProps)`
|
213
|
+
color: ${(props) => (props.disabled ? props.theme.colors.grey2 : '')};
|
207
214
|
${(props) =>
|
208
215
|
props.selectWidth === '100%'
|
209
216
|
? 'width: 100%;'
|
@@ -5,7 +5,7 @@
|
|
5
5
|
:is-open="isOpen"
|
6
6
|
:position="position"
|
7
7
|
>
|
8
|
-
<ModalContainer @click="onClickModalContainer">
|
8
|
+
<ModalContainer :overflow="overflowRule" @click="onClickModalContainer">
|
9
9
|
<Spinner v-if="isLoading" :limited-to-modal="true" size="50px" />
|
10
10
|
<ContentContainer :visible="!isLoading">
|
11
11
|
<slot></slot>
|
@@ -67,7 +67,8 @@
|
|
67
67
|
}
|
68
68
|
`
|
69
69
|
|
70
|
-
const
|
70
|
+
const modalContainerAttrs = { overflow: String }
|
71
|
+
const ModalContainer = styled('div', modalContainerAttrs)`
|
71
72
|
align-self: center;
|
72
73
|
justify-self: center;
|
73
74
|
position: relative;
|
@@ -75,7 +76,7 @@
|
|
75
76
|
border-radius: 4px;
|
76
77
|
background: white;
|
77
78
|
margin: 0 auto;
|
78
|
-
overflow:
|
79
|
+
overflow: ${(props) => props.overflow};
|
79
80
|
max-width: 95%;
|
80
81
|
max-height: 95%;
|
81
82
|
min-width: 100px;
|
@@ -152,6 +153,11 @@
|
|
152
153
|
type: Boolean,
|
153
154
|
default: true,
|
154
155
|
},
|
156
|
+
overflowRule: {
|
157
|
+
required: false,
|
158
|
+
type: String,
|
159
|
+
default: 'auto',
|
160
|
+
},
|
155
161
|
},
|
156
162
|
watch: {
|
157
163
|
isOpen: {
|