@eturnity/eturnity_reusable_components 7.51.16-EPDM-13568.2 → 7.51.16-EPDM-13568.4
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
<PageContainer>
|
3
3
|
<ButtonContainer
|
4
4
|
:id="id"
|
5
|
+
:app-theme="appTheme"
|
5
6
|
:button-size="buttonSize"
|
6
7
|
:custom-color="customColor"
|
7
8
|
:data-id="dataId"
|
@@ -11,7 +12,6 @@
|
|
11
12
|
:is-disabled="isDisabled"
|
12
13
|
:min-width="minWidth"
|
13
14
|
:no-wrap="noWrap"
|
14
|
-
:theme-type="theme"
|
15
15
|
:type="type"
|
16
16
|
:variant="variant"
|
17
17
|
>
|
@@ -51,7 +51,7 @@
|
|
51
51
|
height: String,
|
52
52
|
variant: String,
|
53
53
|
buttonSize: String,
|
54
|
-
|
54
|
+
appTheme: String,
|
55
55
|
}
|
56
56
|
const ButtonContainer = styled('div', ButtonAttrs)`
|
57
57
|
display: flex;
|
@@ -62,24 +62,24 @@
|
|
62
62
|
props.theme?.mainButton?.size?.[props.buttonSize]?.fontSize};
|
63
63
|
color: ${(props) =>
|
64
64
|
props.isDisabled
|
65
|
-
? props.theme.mainButton[props.
|
65
|
+
? props.theme.mainButton[props.appTheme][props.type][props.variant]
|
66
66
|
.disabled.textColor
|
67
|
-
: props.theme.mainButton[props.
|
67
|
+
: props.theme.mainButton[props.appTheme][props.type][props.variant]
|
68
68
|
.textColor};
|
69
69
|
background-color: ${(props) =>
|
70
70
|
props.isDisabled
|
71
|
-
? props.theme.mainButton[props.
|
71
|
+
? props.theme.mainButton[props.appTheme][props.type][props.variant]
|
72
72
|
.disabled.backgroundColor
|
73
73
|
: props.customColor
|
74
74
|
? props.customColor
|
75
|
-
: props.theme.mainButton[props.
|
75
|
+
: props.theme.mainButton[props.appTheme][props.type][props.variant]
|
76
76
|
.default};
|
77
77
|
|
78
78
|
border: ${(props) => {
|
79
79
|
const borderValue = props.isDisabled
|
80
|
-
? props.theme.mainButton[props.
|
80
|
+
? props.theme.mainButton[props.appTheme][props.type][props.variant]
|
81
81
|
.disabled.borderColor
|
82
|
-
: props.theme.mainButton[props.
|
82
|
+
: props.theme.mainButton[props.appTheme][props.type][props.variant]
|
83
83
|
.borderColor
|
84
84
|
return borderValue ? '1px solid ' + borderValue : 'none'
|
85
85
|
}};
|
@@ -94,18 +94,18 @@
|
|
94
94
|
&:hover {
|
95
95
|
background-color: ${(props) =>
|
96
96
|
props.isDisabled
|
97
|
-
? props.theme.mainButton[props.
|
97
|
+
? props.theme.mainButton[props.appTheme][props.type][props.variant]
|
98
98
|
.disabled.backgroundColor
|
99
|
-
: props.theme.mainButton[props.
|
99
|
+
: props.theme.mainButton[props.appTheme][props.type][props.variant]
|
100
100
|
.hover};
|
101
101
|
}
|
102
102
|
|
103
103
|
&:active {
|
104
104
|
background-color: ${(props) =>
|
105
105
|
props.isDisabled
|
106
|
-
? props.theme.mainButton[props.
|
106
|
+
? props.theme.mainButton[props.appTheme][props.type][props.variant]
|
107
107
|
.disabled.backgroundColor
|
108
|
-
: props.theme.mainButton[props.
|
108
|
+
: props.theme.mainButton[props.appTheme][props.type][props.variant]
|
109
109
|
.active};
|
110
110
|
}
|
111
111
|
`
|
@@ -197,7 +197,7 @@
|
|
197
197
|
type: String,
|
198
198
|
default: '',
|
199
199
|
},
|
200
|
-
|
200
|
+
appTheme: {
|
201
201
|
type: String,
|
202
202
|
default: 'light',
|
203
203
|
},
|
@@ -25,18 +25,19 @@
|
|
25
25
|
item.type === 'template')
|
26
26
|
"
|
27
27
|
/>
|
28
|
-
<
|
28
|
+
<MainButton
|
29
29
|
v-if="
|
30
30
|
item.type &&
|
31
31
|
item.type === 'template' &&
|
32
32
|
(item.value === '' || item.value === '-')
|
33
33
|
"
|
34
34
|
:key="index + '_button'"
|
35
|
-
|
35
|
+
button-size="small"
|
36
|
+
:text="$gettext('Use template...')"
|
37
|
+
:type="primary"
|
38
|
+
:variant="showArchived ? 'cancel' : 'main'"
|
36
39
|
@click.stop="onTemplateClick(item.row)"
|
37
|
-
|
38
|
-
{{ $gettext('Use template...') }}
|
39
|
-
</TemplateButton>
|
40
|
+
/>
|
40
41
|
<TemplateLink
|
41
42
|
v-else-if="
|
42
43
|
item.type && item.type === 'template' && item.value !== ''
|
@@ -137,12 +138,13 @@
|
|
137
138
|
<span v-if="option !== 'template'">
|
138
139
|
{{ !!item[option] ? item[option] : '-' }}
|
139
140
|
</span>
|
140
|
-
<
|
141
|
+
<MainButton
|
141
142
|
v-else-if="option === 'template' && item.has_template"
|
143
|
+
button-size="small"
|
144
|
+
:text="$gettext('Use template...')"
|
145
|
+
:type="primary"
|
142
146
|
@click.stop="onTemplateClick(item)"
|
143
|
-
|
144
|
-
{{ $gettext('Use template...') }}
|
145
|
-
</TemplateButton>
|
147
|
+
/>
|
146
148
|
<NoTemplate
|
147
149
|
v-else-if="option === 'template' && !item.has_template"
|
148
150
|
>
|
@@ -196,6 +198,7 @@
|
|
196
198
|
import Icon from '../icon'
|
197
199
|
import theme from '@/assets/theme.js'
|
198
200
|
import InfoText from '../infoText'
|
201
|
+
import MainButton from '../buttons/mainButton'
|
199
202
|
|
200
203
|
const rowAttrs = { disabled: Boolean, isOpen: Boolean }
|
201
204
|
const DropdownRow = styled('div', rowAttrs)`
|
@@ -354,17 +357,6 @@
|
|
354
357
|
`
|
355
358
|
|
356
359
|
const templateAttrs = { showArchived: Boolean }
|
357
|
-
const TemplateButton = styled('div', templateAttrs)`
|
358
|
-
cursor: pointer;
|
359
|
-
background-color: #263238;
|
360
|
-
color: ${(props) =>
|
361
|
-
props.showArchived ? props.theme.colors.red : props.theme.colors.white};
|
362
|
-
padding: 4px 10px;
|
363
|
-
display: inline-block;
|
364
|
-
border-radius: 4px;
|
365
|
-
text-align: center;
|
366
|
-
margin-left: 15px;
|
367
|
-
`
|
368
360
|
|
369
361
|
const NoTemplate = styled('div', templateAttrs)`
|
370
362
|
color: ${(props) =>
|
@@ -458,7 +450,7 @@
|
|
458
450
|
OptionsWrapper,
|
459
451
|
OptionsItem,
|
460
452
|
SearchContainer,
|
461
|
-
|
453
|
+
MainButton,
|
462
454
|
NoTemplate,
|
463
455
|
TemplateLink,
|
464
456
|
InputText,
|