@eturnity/eturnity_reusable_components 1.0.68 → 1.0.72
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
|
Binary file
|
|
@@ -34,8 +34,6 @@ const Icon = styled("span", iconAttrs)`
|
|
|
34
34
|
: `url(${require("../../assets/icons/delete_icon.svg")})`};
|
|
35
35
|
|
|
36
36
|
&:hover {
|
|
37
|
-
box-shadow: 0px 4px 9px 1px rgb(0 0 0 / 20%);
|
|
38
|
-
border-radius: 4px;
|
|
39
37
|
background-image: ${() =>
|
|
40
38
|
`url(${require("../../assets/icons/delete_icon.svg")})`};
|
|
41
39
|
}
|
|
@@ -2,7 +2,30 @@
|
|
|
2
2
|
<dropdown-row :colspan="colSpan" @click="toggleOpen" ref="dropdownItem">
|
|
3
3
|
<component-container :colSpan="colSpan">
|
|
4
4
|
<component-item v-for="(item, index) in tableItems" :key="index">
|
|
5
|
-
|
|
5
|
+
<template-button
|
|
6
|
+
@click.stop="onTemplateClick(item.row)"
|
|
7
|
+
v-if="item.type && item.type === 'template' && item.value === ''"
|
|
8
|
+
:key="idx"
|
|
9
|
+
>{{ $gettext("Use template...") }}</template-button
|
|
10
|
+
>
|
|
11
|
+
<template-link
|
|
12
|
+
v-else-if="item.type && item.type === 'template' && item.value !== ''"
|
|
13
|
+
@click.stop="onSelectedTemplateClick(item.row)"
|
|
14
|
+
>
|
|
15
|
+
<img
|
|
16
|
+
:src="require('../../assets/icons/file_icon.png')"
|
|
17
|
+
alt="icon"
|
|
18
|
+
width="12"
|
|
19
|
+
height="16"
|
|
20
|
+
/>
|
|
21
|
+
<div>{{ item.value }}</div>
|
|
22
|
+
</template-link>
|
|
23
|
+
<no-template v-else-if="item.type && item.type === 'no-template'">
|
|
24
|
+
{{ $gettext("No main component template") }}
|
|
25
|
+
</no-template>
|
|
26
|
+
<span v-else>
|
|
27
|
+
{{ item.value }}
|
|
28
|
+
</span>
|
|
6
29
|
</component-item>
|
|
7
30
|
<et-popover
|
|
8
31
|
v-if="showArchived"
|
|
@@ -50,9 +73,23 @@
|
|
|
50
73
|
:tabindex="0"
|
|
51
74
|
@keyup.enter.native="onItemClick(item)"
|
|
52
75
|
>
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
76
|
+
<template v-for="(option, idx) in optionsDisplay">
|
|
77
|
+
<span v-if="option !== 'template'" :key="idx">
|
|
78
|
+
{{ item[option] }}
|
|
79
|
+
</span>
|
|
80
|
+
<template-button
|
|
81
|
+
@click.stop="onTemplateClick(item)"
|
|
82
|
+
v-else-if="option === 'template' && item.has_template"
|
|
83
|
+
:key="idx"
|
|
84
|
+
>{{ $gettext("Use template...") }}</template-button
|
|
85
|
+
>
|
|
86
|
+
<no-template
|
|
87
|
+
v-else-if="option === 'template' && !item.has_template"
|
|
88
|
+
:key="idx"
|
|
89
|
+
>
|
|
90
|
+
{{ $gettext("No main component template") }}
|
|
91
|
+
</no-template>
|
|
92
|
+
</template>
|
|
56
93
|
</options-item>
|
|
57
94
|
</options-wrapper>
|
|
58
95
|
</options-container>
|
|
@@ -96,7 +133,7 @@ const ComponentContainer = styled("div", containerAttrs)`
|
|
|
96
133
|
grid-template-columns: repeat(${(props) => props.colSpan}, minmax(0, 1fr)) auto;
|
|
97
134
|
grid-gap: 12px;
|
|
98
135
|
align-items: center;
|
|
99
|
-
background-color:
|
|
136
|
+
background-color: ${(props) => props.theme.colors.white};
|
|
100
137
|
border-radius: 4px;
|
|
101
138
|
padding: 5px 4px;
|
|
102
139
|
`
|
|
@@ -124,7 +161,7 @@ const OptionsContainer = styled("div", optionsAttrs)`
|
|
|
124
161
|
overflow: auto;
|
|
125
162
|
border: 1px solid ${(props) => props.theme.colors.grey3};
|
|
126
163
|
z-index: 9999;
|
|
127
|
-
background:
|
|
164
|
+
background: ${(props) => props.theme.colors.white};
|
|
128
165
|
border-radius: 4px;
|
|
129
166
|
`
|
|
130
167
|
|
|
@@ -167,10 +204,35 @@ const SearchContainer = styled.div`
|
|
|
167
204
|
position: sticky;
|
|
168
205
|
top: 0;
|
|
169
206
|
padding-top: 6px;
|
|
170
|
-
background:
|
|
207
|
+
background: ${(props) => props.theme.colors.white};
|
|
171
208
|
height: 40px;
|
|
172
209
|
`
|
|
173
210
|
|
|
211
|
+
const TemplateButton = styled.div`
|
|
212
|
+
cursor: pointer;
|
|
213
|
+
background-color: #263238;
|
|
214
|
+
color: ${(props) => props.theme.colors.white};
|
|
215
|
+
padding: 4px 10px;
|
|
216
|
+
display: inline-block;
|
|
217
|
+
border-radius: 4px;
|
|
218
|
+
text-align: center;
|
|
219
|
+
`
|
|
220
|
+
|
|
221
|
+
const NoTemplate = styled.div`
|
|
222
|
+
color: ${(props) => props.theme.colors.gray1};
|
|
223
|
+
font-style: italic;
|
|
224
|
+
overflow: hidden;
|
|
225
|
+
text-overflow: ellipsis;
|
|
226
|
+
`
|
|
227
|
+
|
|
228
|
+
const TemplateLink = styled.div`
|
|
229
|
+
color: ${(props) => props.theme.colors.purple};
|
|
230
|
+
cursor: pointer;
|
|
231
|
+
display: grid;
|
|
232
|
+
grid-template-columns: auto 1fr;
|
|
233
|
+
grid-gap: 12px;
|
|
234
|
+
`
|
|
235
|
+
|
|
174
236
|
export default {
|
|
175
237
|
name: "table-dropdown",
|
|
176
238
|
components: {
|
|
@@ -186,6 +248,9 @@ export default {
|
|
|
186
248
|
OptionsWrapper,
|
|
187
249
|
OptionsItem,
|
|
188
250
|
SearchContainer,
|
|
251
|
+
TemplateButton,
|
|
252
|
+
NoTemplate,
|
|
253
|
+
TemplateLink,
|
|
189
254
|
},
|
|
190
255
|
props: {
|
|
191
256
|
colSpan: {
|
|
@@ -247,6 +312,12 @@ export default {
|
|
|
247
312
|
block: "center",
|
|
248
313
|
})
|
|
249
314
|
},
|
|
315
|
+
onTemplateClick(item) {
|
|
316
|
+
this.$emit("on-template-click", item)
|
|
317
|
+
},
|
|
318
|
+
onSelectedTemplateClick(item) {
|
|
319
|
+
this.$emit("on-selected-template-click", item)
|
|
320
|
+
},
|
|
250
321
|
onItemClick(item) {
|
|
251
322
|
this.$emit("item-selected", item)
|
|
252
323
|
},
|
|
@@ -285,5 +356,10 @@ export default {
|
|
|
285
356
|
}
|
|
286
357
|
},
|
|
287
358
|
},
|
|
359
|
+
mounted() {
|
|
360
|
+
console.log("optionsDisplay", this.optionsDisplay)
|
|
361
|
+
console.log("optionItems", this.optionItems)
|
|
362
|
+
console.log("tableItems", this.tableItems)
|
|
363
|
+
},
|
|
288
364
|
}
|
|
289
365
|
</script>
|