@eturnity/eturnity_reusable_components 1.0.65 → 1.0.69
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 +1 -1
- package/src/assets/icons/file_icon.svg +3 -0
- package/src/components/inputs/checkbox/index.vue +1 -0
- package/src/components/inputs/inputNumber/index.vue +1 -1
- package/src/components/inputs/toggle/index.vue +6 -3
- package/src/components/tableDropdown/index.vue +83 -7
- package/src/components/tables/mainTable/index.vue +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="16" viewBox="0 0 12 16">
|
|
2
|
+
<image id="Vector_Smart_Object1" data-name="Vector Smart Object1" width="12" height="16" xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAYAAAAiYZ4HAAAAqklEQVQokWNUNbT4z4Ab/GFgYOi8ff5EDUwFEx7FIMDCwMBQrWpo0UKsBhiAa2IhUgNME4qGWwwMDN+hbGkGBgYRLJrKkZ0Ufvv8CQMQZmBgWIrDFhZi/QAHJGtAjocvDAwMf6FsTgYGBjasbkJi8xBjA7KGzQwMDO9wqBNiYGDwRddQd/v8iQvYVKsaWoBCDkNDqaqhxWscNohic1IUEV4gPVhJ08DAwAAAIKIf0LAB5vMAAAAASUVORK5CYII="/>
|
|
3
|
+
</svg>
|
|
@@ -297,7 +297,7 @@ export default {
|
|
|
297
297
|
this.isFocused = true
|
|
298
298
|
},
|
|
299
299
|
formatWithCurrency(value) {
|
|
300
|
-
if (value && !this.isFocused) {
|
|
300
|
+
if ((value || value === 0) && !this.isFocused) {
|
|
301
301
|
let input = numberToString({
|
|
302
302
|
value: value,
|
|
303
303
|
numberPrecision: this.numberPrecision,
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<container>
|
|
3
3
|
<flex-wrapper :size="size">
|
|
4
|
-
<label-text
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
<label-text
|
|
5
|
+
v-if="labelAlign === 'left'"
|
|
6
|
+
:size="size"
|
|
7
|
+
@click="onToggleChange"
|
|
8
|
+
>{{ label }}</label-text
|
|
9
|
+
>
|
|
7
10
|
<toggle-wrapper
|
|
8
11
|
role="checkbox"
|
|
9
12
|
:checked="isChecked"
|
|
@@ -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.svg')"
|
|
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>
|
|
@@ -195,6 +195,7 @@ const TableContainer = styled.table`
|
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
.icons-container {
|
|
198
|
+
padding-right: 2px; // so that the icons are not cut off when hovering
|
|
198
199
|
width: 1%; // necessary so it doesn't take up too much white space
|
|
199
200
|
display: table-cell;
|
|
200
201
|
flex-wrap: nowrap;
|