@eturnity/eturnity_reusable_components 1.1.73 → 1.1.76

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.73",
3
+ "version": "1.1.76",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -1,74 +1,79 @@
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
- >
8
+ <component-container :colSpan="colSpan - 1" class="table-dropdown">
12
9
  <component-item
13
10
  v-for="(item, index) in tableItems"
14
11
  :key="index"
15
12
  ref="dropdownItem"
13
+ :isNested="isNested"
16
14
  :class="{
17
15
  'table-dropdown-item': item.type !== 'input',
18
16
  }"
19
17
  >
20
- <nested-icon v-if="isNested" />
21
- <template-button
22
- @click.stop="onTemplateClick(item.row)"
23
- v-if="
24
- item.type &&
25
- item.type === 'template' &&
26
- (item.value === '' || item.value === '-')
27
- "
28
- :key="idx"
29
- >{{ $gettext("Use template...") }}</template-button
30
- >
31
- <template-link
32
- v-else-if="item.type && item.type === 'template' && item.value !== ''"
33
- @click.stop="onSelectedTemplateClick(item.row)"
34
- >
35
- <img
36
- :src="require('../../assets/icons/file_icon.png')"
37
- alt="icon"
38
- width="12"
39
- height="16"
40
- />
41
- <div>{{ item.value }}</div>
42
- </template-link>
43
- <no-template v-if="item.type && item.type === 'no-template'">
44
- {{ $gettext("No main component template") }}
45
- </no-template>
46
- <input-container
47
- v-if="item.type === 'input'"
48
- @click.native.stop="onInputClick()"
49
- >
50
- <text-container v-if="customInputDisabled" class="input-placeholder">
18
+ <nested-container>
19
+ <nested-icon v-if="isNested" />
20
+ <template-button
21
+ @click.stop="onTemplateClick(item.row)"
22
+ v-if="
23
+ item.type &&
24
+ item.type === 'template' &&
25
+ (item.value === '' || item.value === '-')
26
+ "
27
+ :key="idx"
28
+ >{{ $gettext("Use template...") }}</template-button
29
+ >
30
+ <template-link
31
+ v-else-if="
32
+ item.type && item.type === 'template' && item.value !== ''
33
+ "
34
+ @click.stop="onSelectedTemplateClick(item.row)"
35
+ >
36
+ <img
37
+ :src="require('../../assets/icons/file_icon.png')"
38
+ alt="icon"
39
+ width="12"
40
+ height="16"
41
+ />
42
+ <div>{{ item.value }}</div>
43
+ </template-link>
44
+ <no-template v-if="item.type && item.type === 'no-template'">
45
+ {{ $gettext("No main component template") }}
46
+ </no-template>
47
+ <input-container
48
+ v-if="item.type === 'input'"
49
+ @click.native.stop="onInputClick()"
50
+ >
51
+ <text-container
52
+ v-if="customInputDisabled"
53
+ class="input-placeholder"
54
+ >
55
+ <span> {{ item.value }}</span>
56
+ </text-container>
57
+ <input-text
58
+ v-else
59
+ class="inputField"
60
+ :value="item.value"
61
+ :noBorder="true"
62
+ :minWidth="item.value.length + 'ch'"
63
+ :disabled="customInputDisabled"
64
+ @input-change="onCustomInputChange($event)"
65
+ />
66
+ </input-container>
67
+ <text-container
68
+ v-else-if="
69
+ item.type !== 'input' &&
70
+ item.type !== 'no-template' &&
71
+ item.type !== 'template'
72
+ "
73
+ >
51
74
  <span> {{ item.value }}</span>
52
75
  </text-container>
53
- <input-text
54
- v-else
55
- class="inputField"
56
- :value="item.value"
57
- :noBorder="true"
58
- :minWidth="item.value.length + 'ch'"
59
- :disabled="customInputDisabled"
60
- @input-change="onCustomInputChange($event)"
61
- />
62
- </input-container>
63
- <text-container
64
- v-else-if="
65
- item.type !== 'input' &&
66
- item.type !== 'no-template' &&
67
- item.type !== 'template'
68
- "
69
- >
70
- <span> {{ item.value }}</span>
71
- </text-container>
76
+ </nested-container>
72
77
  </component-item>
73
78
  <arrow-container class="arrow-container">
74
79
  <arrow-wrapper :showArchived="showArchived">
@@ -196,7 +201,9 @@ const DropdownRow = styled("div", rowAttrs)`
196
201
  }
197
202
  `
198
203
 
199
- const ComponentItem = styled.td`
204
+ const ItemAttrs = { isNested: Boolean }
205
+ const ComponentItem = styled("td", ItemAttrs)`
206
+ padding-left: ${(props) => (props.isNested ? "14px !important" : "0")};
200
207
  overflow: hidden;
201
208
  text-overflow: ellipsis;
202
209
  padding-right: 0 !important;
@@ -395,6 +402,16 @@ const TextContainer = styled.div`
395
402
  const NestedIcon = styled.div`
396
403
  background-image: ${() =>
397
404
  `url(${require("../../assets/icons/subposition_marker.svg")})`};
405
+ height: 10px;
406
+ width: 6px;
407
+ `
408
+
409
+ const NestedAttrs = { isNested: Boolean }
410
+ const NestedContainer = styled("div", NestedAttrs)`
411
+ display: grid;
412
+ grid-gap: 5px;
413
+ grid-template-columns: auto 1fr;
414
+ align-items: center;
398
415
  `
399
416
 
400
417
  export default {
@@ -424,6 +441,7 @@ export default {
424
441
  ArrowContainer,
425
442
  TextContainer,
426
443
  NestedIcon,
444
+ NestedContainer,
427
445
  },
428
446
  props: {
429
447
  colSpan: {