@eturnity/eturnity_reusable_components 1.2.69 → 1.2.70-EPDM-7253.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
CHANGED
@@ -5,7 +5,9 @@
|
|
5
5
|
:alignItems="alignItems"
|
6
6
|
>
|
7
7
|
<label-wrapper v-if="label">
|
8
|
-
<input-label :labelFontColor="labelFontColor" :fontSize="fontSize">{{
|
8
|
+
<input-label :labelFontColor="labelFontColor" :fontSize="fontSize">{{
|
9
|
+
label
|
10
|
+
}}</input-label>
|
9
11
|
<info-text
|
10
12
|
v-if="infoTextMessage"
|
11
13
|
:text="infoTextMessage"
|
@@ -65,17 +67,17 @@ const Container = styled.div`
|
|
65
67
|
position: relative;
|
66
68
|
`
|
67
69
|
|
68
|
-
const labelAttrs = { fontSize: String,labelFontColor:String
|
70
|
+
const labelAttrs = { fontSize: String, labelFontColor: String }
|
69
71
|
const InputLabel = styled('div', labelAttrs)`
|
70
|
-
color: ${(props) =>
|
71
|
-
props.theme.colors[props.labelFontColor]
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
72
|
+
color: ${(props) =>
|
73
|
+
props.theme.colors[props.labelFontColor]
|
74
|
+
? props.theme.colors[props.labelFontColor]
|
75
|
+
: props.labelFontColor
|
76
|
+
? props.labelFontColor
|
77
|
+
: props.theme.colors.eturnityGrey};
|
76
78
|
|
77
79
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
|
78
|
-
font-
|
80
|
+
font-weight: 700;
|
79
81
|
`
|
80
82
|
|
81
83
|
const LabelWrapper = styled.div`
|
@@ -102,21 +104,21 @@ const inputProps = {
|
|
102
104
|
fontSize: String,
|
103
105
|
inputType: String,
|
104
106
|
fontColor: String,
|
105
|
-
backgroundColor:String,
|
106
|
-
borderColor:String,
|
107
|
-
inputHeight:String,
|
108
|
-
disabledBackgroundColor:String
|
107
|
+
backgroundColor: String,
|
108
|
+
borderColor: String,
|
109
|
+
inputHeight: String,
|
110
|
+
disabledBackgroundColor: String
|
109
111
|
}
|
110
112
|
const InputContainer = styled('input', inputProps)`
|
111
113
|
border: ${(props) =>
|
112
|
-
|
114
|
+
props.isError
|
113
115
|
? '1px solid ' + props.theme.colors.red
|
114
116
|
: props.noBorder
|
115
117
|
? 'none'
|
116
|
-
: props.borderColor
|
117
|
-
props.theme.colors[props.borderColor]
|
118
|
-
|
119
|
-
|
118
|
+
: props.borderColor
|
119
|
+
? props.theme.colors[props.borderColor]
|
120
|
+
? '1px solid ' + props.theme.colors[props.borderColor]
|
121
|
+
: '1px solid ' + props.borderColor
|
120
122
|
: '1px solid ' + props.theme.colors.grey4};
|
121
123
|
padding: ${(props) =>
|
122
124
|
props.isError
|
@@ -135,19 +137,21 @@ const InputContainer = styled('input', inputProps)`
|
|
135
137
|
: props.fontColor
|
136
138
|
? props.fontColor + ' !important'
|
137
139
|
: props.theme.colors.black};
|
138
|
-
|
140
|
+
|
139
141
|
width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
|
140
142
|
min-width: ${(props) => (props.minWidth ? props.minWidth : 'unset')};
|
141
143
|
max-height: ${(props) => props.inputHeight};
|
142
144
|
box-sizing: border-box; // to allow width of 100% with padding
|
143
145
|
font-weight: 400;
|
144
146
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'auto')};
|
145
|
-
background-color: ${(props) =>
|
146
|
-
props.isDisabled
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
147
|
+
background-color: ${(props) =>
|
148
|
+
props.isDisabled
|
149
|
+
? props.disabledBackgroundColor
|
150
|
+
? props.disabledBackgroundColor + ' !important'
|
151
|
+
: props.theme.colors.grey5
|
152
|
+
: props.backgroundColor
|
153
|
+
? props.backgroundColor + ' !important'
|
154
|
+
: props.theme.colors.white};
|
151
155
|
&::placeholder {
|
152
156
|
color: ${(props) => props.theme.colors.grey2};
|
153
157
|
}
|
@@ -276,25 +280,25 @@ export default {
|
|
276
280
|
required: false,
|
277
281
|
default: 'text'
|
278
282
|
},
|
279
|
-
labelFontColor:{
|
280
|
-
required:false,
|
281
|
-
default:'black'
|
282
|
-
},
|
283
|
-
backgroundColor:{
|
284
|
-
required:false,
|
285
|
-
default:'white'
|
283
|
+
labelFontColor: {
|
284
|
+
required: false,
|
285
|
+
default: 'black'
|
286
286
|
},
|
287
|
-
|
288
|
-
required:false,
|
289
|
-
default:
|
287
|
+
backgroundColor: {
|
288
|
+
required: false,
|
289
|
+
default: 'white'
|
290
290
|
},
|
291
|
-
|
292
|
-
required:false,
|
293
|
-
default:
|
291
|
+
disabledBackgroundColor: {
|
292
|
+
required: false,
|
293
|
+
default: null
|
294
294
|
},
|
295
|
-
|
296
|
-
required:false,
|
295
|
+
fontColor: {
|
296
|
+
required: false,
|
297
|
+
default: 'black'
|
297
298
|
},
|
299
|
+
borderColor: {
|
300
|
+
required: false
|
301
|
+
}
|
298
302
|
},
|
299
303
|
methods: {
|
300
304
|
onChangeHandler($event) {
|
@@ -1,244 +1,260 @@
|
|
1
1
|
<template>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
<container>
|
3
|
+
<flex-wrapper
|
4
|
+
:size="size"
|
5
|
+
:disabled="disabled"
|
6
|
+
:alignItems="alignItems"
|
7
|
+
:label="label"
|
8
|
+
>
|
9
|
+
<label-container
|
10
|
+
v-if="label && labelAlign === 'left'"
|
11
|
+
:hasInfoMessage="!!infoTextMessage"
|
12
|
+
:colorMode="colorMode"
|
13
|
+
>
|
14
|
+
<label-text :size="size">{{ label }}</label-text>
|
15
|
+
<info-text
|
16
|
+
v-if="infoTextMessage"
|
17
|
+
:text="infoTextMessage"
|
18
|
+
borderColor="#ccc"
|
19
|
+
size="14px"
|
20
|
+
:alignText="infoTextAlign"
|
21
|
+
/>
|
22
|
+
</label-container>
|
23
|
+
|
24
|
+
<switch-wrapper
|
25
|
+
:size="size"
|
26
|
+
:disabled="disabled"
|
27
|
+
:backgroundColor="backgroundColor"
|
28
|
+
>
|
29
|
+
<switchOption
|
30
|
+
v-for="(item, index) in options"
|
31
|
+
:key="index"
|
32
|
+
@click="selectItem(item.value)"
|
33
|
+
:isActive="selectedValue == item.value"
|
7
34
|
:colorMode="colorMode"
|
35
|
+
:primaryColor="primaryColor"
|
36
|
+
:secondaryColor="secondaryColor"
|
37
|
+
:inactiveColor="inactiveColor"
|
8
38
|
>
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
// size="large"
|
65
|
-
// backgroundColor="blue"
|
66
|
-
// labelAlign="left"
|
67
|
-
// fontColor="black"
|
68
|
-
// :disabled="false"
|
69
|
-
// />
|
70
|
-
|
71
|
-
import styled from "vue-styled-components"
|
72
|
-
import InfoText from "../../infoText"
|
73
|
-
import theme from "../../../assets/theme"
|
74
|
-
const Container = styled.div``
|
75
|
-
|
76
|
-
const flexAttrs = { label:String,size: String, disabled: Boolean,alignItems: String }
|
77
|
-
const FlexWrapper = styled("div", flexAttrs)`
|
78
|
-
display: grid;
|
79
|
-
grid-template-columns: auto 1fr;
|
80
|
-
grid-gap: 10px;
|
81
|
-
align-items: center;
|
82
|
-
cursor: ${(props) => (props.disabled ? "not-allowed" : "pointer")};
|
83
|
-
grid-template-columns: ${(props) =>
|
39
|
+
{{ item.content }}
|
40
|
+
</switchOption>
|
41
|
+
</switch-wrapper>
|
42
|
+
<label-container
|
43
|
+
v-if="label && labelAlign === 'right'"
|
44
|
+
:hasInfoMessage="!!infoTextMessage"
|
45
|
+
>
|
46
|
+
<label-text :size="size" :fontColor="fontColor">{{ label }}</label-text>
|
47
|
+
<info-text
|
48
|
+
@click.native.stop
|
49
|
+
v-if="infoTextMessage"
|
50
|
+
:text="infoTextMessage"
|
51
|
+
borderColor="#ccc"
|
52
|
+
size="14px"
|
53
|
+
:alignText="infoTextAlign"
|
54
|
+
/>
|
55
|
+
</label-container>
|
56
|
+
</flex-wrapper>
|
57
|
+
</container>
|
58
|
+
</template>
|
59
|
+
|
60
|
+
<script>
|
61
|
+
// import Toggle from "@eturnity/eturnity_reusable_components/src/components/inputs/toggle"
|
62
|
+
// To use:
|
63
|
+
// <SwitchField
|
64
|
+
// @on-switch-change="onInputChange($event)"
|
65
|
+
// :options="[{value:0,content:'zero'},{value:1,content:'one'},{value:2,content:'two'}]"
|
66
|
+
// :value="1"
|
67
|
+
// label="label"
|
68
|
+
// toggleColor="red"
|
69
|
+
// size="large"
|
70
|
+
// backgroundColor="blue"
|
71
|
+
// labelAlign="left"
|
72
|
+
// fontColor="black"
|
73
|
+
// :disabled="false"
|
74
|
+
// />
|
75
|
+
|
76
|
+
import styled from 'vue-styled-components'
|
77
|
+
import InfoText from '../../infoText'
|
78
|
+
import theme from '../../../assets/theme'
|
79
|
+
const Container = styled.div``
|
80
|
+
|
81
|
+
const flexAttrs = {
|
82
|
+
label: String,
|
83
|
+
size: String,
|
84
|
+
disabled: Boolean,
|
85
|
+
alignItems: String
|
86
|
+
}
|
87
|
+
const FlexWrapper = styled('div', flexAttrs)`
|
88
|
+
display: grid;
|
89
|
+
grid-template-columns: auto 1fr;
|
90
|
+
grid-gap: 10px;
|
91
|
+
align-items: center;
|
92
|
+
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
|
93
|
+
grid-template-columns: ${(props) =>
|
84
94
|
props.alignItems === 'vertical' || !props.label ? '1fr' : 'auto 1fr'};
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
95
|
+
`
|
96
|
+
|
97
|
+
const toggleAttrs = {
|
98
|
+
size: String,
|
99
|
+
fontColor: String,
|
100
|
+
disabled: Boolean,
|
101
|
+
backgroundColor: String,
|
102
|
+
isChecked: Boolean
|
103
|
+
}
|
104
|
+
const LabelText = styled('div', toggleAttrs)`
|
105
|
+
color: white;
|
106
|
+
font-size: 13px;
|
107
|
+
font-weight: 700;
|
108
|
+
`
|
109
|
+
|
110
|
+
const SwitchWrapper = styled('span', toggleAttrs)`
|
111
|
+
display: flex;
|
112
|
+
position: relative;
|
113
|
+
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
|
114
|
+
height: ${(props) =>
|
115
|
+
props.size === 'medium'
|
116
|
+
? '24px'
|
117
|
+
: props.size === 'small'
|
118
|
+
? '16px'
|
119
|
+
: '24px'};
|
120
|
+
`
|
121
|
+
const optionAttrs = {
|
122
|
+
isActive: Boolean,
|
123
|
+
primaryColor: String,
|
124
|
+
secondaryColor: String,
|
125
|
+
inactiveColor: String
|
126
|
+
}
|
127
|
+
const switchOption = styled('div', optionAttrs)`
|
128
|
+
color: ${(props) =>
|
129
|
+
props.isActive ? props.primaryColor : props.inactiveColor};
|
130
|
+
background-color: ${(props) =>
|
131
|
+
props.isActive ? props.secondaryColor : 'transparent'};
|
132
|
+
border: 1px solid
|
133
|
+
${(props) => (props.isActive ? props.secondaryColor : props.inactiveColor)};
|
134
|
+
display: flex;
|
135
|
+
align-items: center;
|
136
|
+
justify-content: center;
|
137
|
+
flex-grow: 1;
|
138
|
+
font-size: 13px;
|
139
|
+
line-height: 1;
|
140
|
+
text-align: center;
|
141
|
+
padding: 10px;
|
142
|
+
margin-right: -1px;
|
143
|
+
transition: all 0.1s ease-in-out;
|
144
|
+
overflow: hidden;
|
145
|
+
& :hover {
|
146
|
+
cursor: pointer;
|
93
147
|
}
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
display: flex;
|
102
|
-
position: relative;
|
103
|
-
cursor: ${(props) => (props.disabled ? "not-allowed" : "pointer")};
|
104
|
-
height: ${(props) =>
|
105
|
-
props.size === "medium"
|
106
|
-
? "24px"
|
107
|
-
: props.size === "small"
|
108
|
-
? "16px"
|
109
|
-
: "24px"};
|
110
|
-
`
|
111
|
-
const optionAttrs={isActive:Boolean,primaryColor:String,secondaryColor:String,inactiveColor:String}
|
112
|
-
const switchOption=styled('div',optionAttrs)`
|
113
|
-
color:${props=>props.isActive?props.primaryColor:props.inactiveColor};
|
114
|
-
background-color:${props=>props.isActive?props.secondaryColor:"transparent"};
|
115
|
-
border:1px solid ${props=>props.isActive?props.secondaryColor:props.inactiveColor};
|
116
|
-
display:flex;
|
117
|
-
align-items:center;
|
118
|
-
justify-content: center;
|
119
|
-
flex-grow:1;
|
120
|
-
font-size: 13px;
|
121
|
-
line-height: 1;
|
122
|
-
text-align: center;
|
123
|
-
padding: 10px;
|
124
|
-
margin-right: -1px;
|
125
|
-
transition: all 0.1s ease-in-out;
|
126
|
-
overflow:hidden;
|
127
|
-
& :hover{
|
128
|
-
cursor: pointer;
|
129
|
-
}
|
130
|
-
&:first-child {
|
131
|
-
border-radius: 4px 0 0 4px;
|
132
|
-
}
|
133
|
-
&:last-child {
|
134
|
-
border-radius: 0 4px 4px 0;
|
135
|
-
}
|
148
|
+
&:first-child {
|
149
|
+
border-radius: 4px 0 0 4px;
|
150
|
+
}
|
151
|
+
&:last-child {
|
152
|
+
border-radius: 0 4px 4px 0;
|
153
|
+
}
|
154
|
+
`
|
136
155
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
156
|
+
const labelAttrs = { hasInfoMessage: Boolean }
|
157
|
+
const LabelContainer = styled('div', labelAttrs)`
|
158
|
+
display: inline-grid;
|
159
|
+
grid-template-columns: ${(props) =>
|
160
|
+
props.hasInfoMessage ? 'auto 1fr' : 'auto'};
|
161
|
+
grid-gap: 12px;
|
162
|
+
align-items: center;
|
163
|
+
`
|
164
|
+
|
165
|
+
export default {
|
166
|
+
name: 'switchField',
|
167
|
+
components: {
|
168
|
+
Container,
|
169
|
+
SwitchWrapper,
|
170
|
+
FlexWrapper,
|
171
|
+
LabelText,
|
172
|
+
InfoText,
|
173
|
+
LabelContainer,
|
174
|
+
switchOption
|
175
|
+
},
|
176
|
+
props: {
|
177
|
+
label: {
|
178
|
+
required: false,
|
179
|
+
default: ''
|
180
|
+
},
|
181
|
+
toggleColor: {
|
182
|
+
required: false
|
183
|
+
},
|
184
|
+
backgroundColor: {
|
185
|
+
required: false
|
186
|
+
},
|
187
|
+
size: {
|
188
|
+
required: false,
|
189
|
+
default: 'small'
|
190
|
+
},
|
191
|
+
labelAlign: {
|
192
|
+
required: false,
|
193
|
+
default: 'left'
|
194
|
+
},
|
195
|
+
fontColor: {
|
196
|
+
required: false
|
197
|
+
},
|
198
|
+
disabled: {
|
199
|
+
required: false,
|
200
|
+
default: false
|
158
201
|
},
|
159
|
-
|
160
|
-
|
161
|
-
required: false,
|
162
|
-
default: "",
|
163
|
-
},
|
164
|
-
toggleColor: {
|
165
|
-
required: false,
|
166
|
-
},
|
167
|
-
backgroundColor: {
|
168
|
-
required: false,
|
169
|
-
},
|
170
|
-
size: {
|
171
|
-
required: false,
|
172
|
-
default: "small",
|
173
|
-
},
|
174
|
-
labelAlign: {
|
175
|
-
required: false,
|
176
|
-
default: "left",
|
177
|
-
},
|
178
|
-
fontColor: {
|
179
|
-
required: false,
|
180
|
-
},
|
181
|
-
disabled: {
|
182
|
-
required: false,
|
183
|
-
default: false,
|
184
|
-
},
|
185
|
-
infoTextMessage: {
|
186
|
-
required: false,
|
187
|
-
},
|
188
|
-
infoTextAlign: {
|
189
|
-
required: false,
|
190
|
-
},
|
191
|
-
colorMode: {
|
192
|
-
required: false,
|
193
|
-
default:'light'
|
194
|
-
},
|
195
|
-
alignItems:{
|
196
|
-
required: false,
|
197
|
-
default: 'horizontal'
|
198
|
-
},
|
199
|
-
options:{
|
200
|
-
required:true
|
201
|
-
},
|
202
|
-
value:{
|
203
|
-
required:false,
|
204
|
-
default:null
|
205
|
-
},
|
202
|
+
infoTextMessage: {
|
203
|
+
required: false
|
206
204
|
},
|
207
|
-
|
208
|
-
|
209
|
-
selectedValue:null,
|
210
|
-
primaryColor:"white",
|
211
|
-
secondaryColor:"black",
|
212
|
-
inactiveColor:"grey6"
|
213
|
-
}
|
205
|
+
infoTextAlign: {
|
206
|
+
required: false
|
214
207
|
},
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
if(this.colorMode=='dark'){
|
219
|
-
this.primaryColor=theme.colors.black
|
220
|
-
this.secondaryColor=theme.colors.white
|
221
|
-
this.inactiveColor=theme.colors.grey6
|
222
|
-
}else{
|
223
|
-
this.primaryColor=theme.colors.white
|
224
|
-
this.secondaryColor=theme.colors.black
|
225
|
-
this.inactiveColor=theme.colors.grey6
|
226
|
-
}
|
208
|
+
colorMode: {
|
209
|
+
required: false,
|
210
|
+
default: 'light'
|
227
211
|
},
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
return
|
232
|
-
}
|
233
|
-
this.selectedValue=value
|
234
|
-
this.$emit("on-switch-change", this.selectedValue)
|
235
|
-
},
|
212
|
+
alignItems: {
|
213
|
+
required: false,
|
214
|
+
default: 'horizontal'
|
236
215
|
},
|
237
|
-
|
238
|
-
|
239
|
-
|
216
|
+
options: {
|
217
|
+
required: true
|
218
|
+
},
|
219
|
+
value: {
|
220
|
+
required: false,
|
221
|
+
default: null
|
222
|
+
}
|
223
|
+
},
|
224
|
+
data() {
|
225
|
+
return {
|
226
|
+
selectedValue: null,
|
227
|
+
primaryColor: 'white',
|
228
|
+
secondaryColor: 'black',
|
229
|
+
inactiveColor: 'grey6'
|
230
|
+
}
|
231
|
+
},
|
232
|
+
created() {
|
233
|
+
this.selectedValue = this.value
|
234
|
+
|
235
|
+
if (this.colorMode == 'dark') {
|
236
|
+
this.primaryColor = theme.colors.black
|
237
|
+
this.secondaryColor = theme.colors.white
|
238
|
+
this.inactiveColor = theme.colors.grey6
|
239
|
+
} else {
|
240
|
+
this.primaryColor = theme.colors.white
|
241
|
+
this.secondaryColor = theme.colors.black
|
242
|
+
this.inactiveColor = theme.colors.grey6
|
243
|
+
}
|
244
|
+
},
|
245
|
+
methods: {
|
246
|
+
selectItem(value) {
|
247
|
+
if (this.disabled) {
|
248
|
+
return
|
240
249
|
}
|
250
|
+
this.selectedValue = value
|
251
|
+
this.$emit('on-switch-change', this.selectedValue)
|
252
|
+
}
|
253
|
+
},
|
254
|
+
watch: {
|
255
|
+
value(val) {
|
256
|
+
this.selectedValue = val
|
241
257
|
}
|
242
258
|
}
|
243
|
-
|
244
|
-
|
259
|
+
}
|
260
|
+
</script>
|
@@ -45,9 +45,9 @@
|
|
45
45
|
// This is a read only table. Pass it data, and it displays it
|
46
46
|
// ToDo: add this to storybook
|
47
47
|
// import ViewTable from "@eturnity/eturnity_reusable_components/src/components/tables/viewTable"
|
48
|
-
import styled from
|
49
|
-
import DeleteIcon from
|
50
|
-
import Spinner from
|
48
|
+
import styled from 'vue-styled-components'
|
49
|
+
import DeleteIcon from '../../deleteIcon'
|
50
|
+
import Spinner from '../../spinner'
|
51
51
|
|
52
52
|
const TableScroll = styled.div`
|
53
53
|
position: relative;
|
@@ -55,8 +55,8 @@ const TableScroll = styled.div`
|
|
55
55
|
`
|
56
56
|
|
57
57
|
const wrapperAttrs = { fullWidth: Boolean }
|
58
|
-
const TableWrapper = styled(
|
59
|
-
width: ${(props) => (props.fullWidth ?
|
58
|
+
const TableWrapper = styled('div', wrapperAttrs)`
|
59
|
+
width: ${(props) => (props.fullWidth ? '100%' : 'fit-content')};
|
60
60
|
max-width: 100%;
|
61
61
|
overflow: auto;
|
62
62
|
|
@@ -89,7 +89,7 @@ const TableItem = styled.td`
|
|
89
89
|
|
90
90
|
const TableHeader = styled(TableItem)`
|
91
91
|
background-color: #e6e8ee;
|
92
|
-
font-
|
92
|
+
font-weight: 700;
|
93
93
|
text-align: left;
|
94
94
|
`
|
95
95
|
|
@@ -101,7 +101,7 @@ const TableRow = styled.tr`
|
|
101
101
|
`
|
102
102
|
|
103
103
|
const TitleText = styled.div`
|
104
|
-
font-
|
104
|
+
font-weight: 700;
|
105
105
|
margin-bottom: 6px;
|
106
106
|
`
|
107
107
|
|
@@ -141,7 +141,7 @@ const EmptyTd = styled.td`
|
|
141
141
|
`
|
142
142
|
|
143
143
|
export default {
|
144
|
-
name:
|
144
|
+
name: 'view-table',
|
145
145
|
components: {
|
146
146
|
TableScroll,
|
147
147
|
TableWrapper,
|
@@ -156,40 +156,40 @@ export default {
|
|
156
156
|
Spinner,
|
157
157
|
SpinnerWrapper,
|
158
158
|
EmptyContainer,
|
159
|
-
EmptyTd
|
159
|
+
EmptyTd
|
160
160
|
},
|
161
161
|
props: {
|
162
162
|
headerItems: {
|
163
|
-
required: true
|
163
|
+
required: true
|
164
164
|
},
|
165
165
|
tableItems: {
|
166
|
-
required: true
|
166
|
+
required: true
|
167
167
|
},
|
168
168
|
fullWidth: {
|
169
169
|
required: false,
|
170
|
-
default: true
|
170
|
+
default: true
|
171
171
|
},
|
172
172
|
tableTitle: {
|
173
173
|
required: false,
|
174
|
-
default: null
|
174
|
+
default: null
|
175
175
|
},
|
176
176
|
showDeleteButton: {
|
177
177
|
required: false,
|
178
|
-
default: false
|
178
|
+
default: false
|
179
179
|
},
|
180
180
|
isLoading: {
|
181
181
|
required: false,
|
182
|
-
default: false
|
182
|
+
default: false
|
183
183
|
},
|
184
184
|
emptyText: {
|
185
185
|
required: false,
|
186
|
-
default:
|
187
|
-
}
|
186
|
+
default: 'There are no items'
|
187
|
+
}
|
188
188
|
},
|
189
189
|
computed: {
|
190
190
|
showIconsContainer() {
|
191
191
|
return this.showDeleteButton
|
192
|
-
}
|
193
|
-
}
|
192
|
+
}
|
193
|
+
}
|
194
194
|
}
|
195
195
|
</script>
|