@eturnity/eturnity_reusable_components 1.1.74 → 1.1.77

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "1.1.74",
3
+ "version": "1.1.77",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -1,76 +1,86 @@
1
1
  <template>
2
2
  <dropdown-row
3
- :colspan="isNested ? colSpan + 1 : colSpan"
3
+ :colspan="colSpan"
4
4
  :isOpen="isOpen"
5
5
  @click="toggleOpen"
6
6
  :disabled="disabled"
7
7
  >
8
- <component-container
9
- :colSpan="isNested ? colSpan : colSpan - 1"
10
- class="table-dropdown"
11
- >
12
- <td v-if="isNested">
13
- <nested-icon />
14
- </td>
8
+ <component-container :colSpan="colSpan - 1" class="table-dropdown">
15
9
  <component-item
16
10
  v-for="(item, index) in tableItems"
17
11
  :key="index"
18
12
  ref="dropdownItem"
13
+ :isNested="isNested"
19
14
  :class="{
20
15
  'table-dropdown-item': item.type !== 'input',
21
16
  }"
22
17
  >
23
- <template-button
24
- @click.stop="onTemplateClick(item.row)"
25
- v-if="
26
- item.type &&
27
- item.type === 'template' &&
28
- (item.value === '' || item.value === '-')
29
- "
30
- :key="idx"
31
- >{{ $gettext("Use template...") }}</template-button
32
- >
33
- <template-link
34
- v-else-if="item.type && item.type === 'template' && item.value !== ''"
35
- @click.stop="onSelectedTemplateClick(item.row)"
36
- >
37
- <img
38
- :src="require('../../assets/icons/file_icon.png')"
39
- alt="icon"
40
- width="12"
41
- height="16"
18
+ <nested-container>
19
+ <nested-icon
20
+ v-if="
21
+ isNested &&
22
+ (item.type === 'input' ||
23
+ item.type === 'no-template' ||
24
+ item.type === 'template')
25
+ "
42
26
  />
43
- <div>{{ item.value }}</div>
44
- </template-link>
45
- <no-template v-if="item.type && item.type === 'no-template'">
46
- {{ $gettext("No main component template") }}
47
- </no-template>
48
- <input-container
49
- v-if="item.type === 'input'"
50
- @click.native.stop="onInputClick()"
51
- >
52
- <text-container v-if="customInputDisabled" class="input-placeholder">
27
+ <template-button
28
+ @click.stop="onTemplateClick(item.row)"
29
+ v-if="
30
+ item.type &&
31
+ item.type === 'template' &&
32
+ (item.value === '' || item.value === '-')
33
+ "
34
+ :key="idx"
35
+ >{{ $gettext("Use template...") }}</template-button
36
+ >
37
+ <template-link
38
+ v-else-if="
39
+ item.type && item.type === 'template' && item.value !== ''
40
+ "
41
+ @click.stop="onSelectedTemplateClick(item.row)"
42
+ >
43
+ <img
44
+ :src="require('../../assets/icons/file_icon.png')"
45
+ alt="icon"
46
+ width="12"
47
+ height="16"
48
+ />
49
+ <div>{{ item.value }}</div>
50
+ </template-link>
51
+ <no-template v-if="item.type && item.type === 'no-template'">
52
+ {{ $gettext("No main component template") }}
53
+ </no-template>
54
+ <input-container
55
+ v-if="item.type === 'input'"
56
+ @click.native.stop="onInputClick()"
57
+ >
58
+ <text-container
59
+ v-if="customInputDisabled"
60
+ class="input-placeholder"
61
+ >
62
+ <span> {{ item.value }}</span>
63
+ </text-container>
64
+ <input-text
65
+ v-else
66
+ class="inputField"
67
+ :value="item.value"
68
+ :noBorder="true"
69
+ :minWidth="item.value.length + 'ch'"
70
+ :disabled="customInputDisabled"
71
+ @input-change="onCustomInputChange($event)"
72
+ />
73
+ </input-container>
74
+ <text-container
75
+ v-else-if="
76
+ item.type !== 'input' &&
77
+ item.type !== 'no-template' &&
78
+ item.type !== 'template'
79
+ "
80
+ >
53
81
  <span> {{ item.value }}</span>
54
82
  </text-container>
55
- <input-text
56
- v-else
57
- class="inputField"
58
- :value="item.value"
59
- :noBorder="true"
60
- :minWidth="item.value.length + 'ch'"
61
- :disabled="customInputDisabled"
62
- @input-change="onCustomInputChange($event)"
63
- />
64
- </input-container>
65
- <text-container
66
- v-else-if="
67
- item.type !== 'input' &&
68
- item.type !== 'no-template' &&
69
- item.type !== 'template'
70
- "
71
- >
72
- <span> {{ item.value }}</span>
73
- </text-container>
83
+ </nested-container>
74
84
  </component-item>
75
85
  <arrow-container class="arrow-container">
76
86
  <arrow-wrapper :showArchived="showArchived">
@@ -198,7 +208,9 @@ const DropdownRow = styled("div", rowAttrs)`
198
208
  }
199
209
  `
200
210
 
201
- const ComponentItem = styled.td`
211
+ const ItemAttrs = { isNested: Boolean }
212
+ const ComponentItem = styled("td", ItemAttrs)`
213
+ padding-left: ${(props) => (props.isNested ? "14px !important" : "0")};
202
214
  overflow: hidden;
203
215
  text-overflow: ellipsis;
204
216
  padding-right: 0 !important;
@@ -401,6 +413,14 @@ const NestedIcon = styled.div`
401
413
  width: 6px;
402
414
  `
403
415
 
416
+ const NestedAttrs = { isNested: Boolean }
417
+ const NestedContainer = styled("div", NestedAttrs)`
418
+ display: grid;
419
+ grid-gap: 5px;
420
+ grid-template-columns: auto 1fr;
421
+ align-items: center;
422
+ `
423
+
404
424
  export default {
405
425
  name: "table-dropdown",
406
426
  components: {
@@ -428,6 +448,7 @@ export default {
428
448
  ArrowContainer,
429
449
  TextContainer,
430
450
  NestedIcon,
451
+ NestedContainer,
431
452
  },
432
453
  props: {
433
454
  colSpan: {