@eturnity/eturnity_reusable_components 7.18.0-qa-dev03.0 → 7.20.0

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.
Files changed (54) hide show
  1. package/.storybook/preview.js +1 -1
  2. package/package.json +19 -23
  3. package/src/App.vue +2 -2
  4. package/src/assets/svgIcons/split.svg +88 -6
  5. package/src/components/addNewButton/index.vue +5 -3
  6. package/src/components/buttons/buttonIcon/index.vue +1 -1
  7. package/src/components/buttons/closeButton/index.vue +1 -1
  8. package/src/components/buttons/mainButton/index.vue +6 -1
  9. package/src/components/card/index.vue +25 -24
  10. package/src/components/deleteIcon/DeleteIcon.stories.js +7 -7
  11. package/src/components/deleteIcon/index.vue +47 -30
  12. package/src/components/draggableInputHandle/index.vue +24 -25
  13. package/src/components/dropdown/index.vue +129 -110
  14. package/src/components/errorMessage/index.vue +10 -5
  15. package/src/components/filter/filterSettings.vue +59 -97
  16. package/src/components/filter/index.vue +3 -3
  17. package/src/components/filter/parentDropdown.vue +2 -2
  18. package/src/components/icon/iconCache.js +23 -0
  19. package/src/components/icon/iconCollection.vue +2 -2
  20. package/src/components/icon/index.vue +67 -75
  21. package/src/components/iconWrapper/index.vue +1 -4
  22. package/src/components/infoCard/index.vue +2 -3
  23. package/src/components/infoText/index.vue +1 -1
  24. package/src/components/inputs/checkbox/index.vue +21 -6
  25. package/src/components/inputs/inputNumber/index.vue +10 -10
  26. package/src/components/inputs/inputNumberQuestion/index.vue +1 -1
  27. package/src/components/inputs/inputText/index.vue +3 -3
  28. package/src/components/inputs/radioButton/index.vue +1 -1
  29. package/src/components/inputs/searchInput/index.vue +28 -11
  30. package/src/components/inputs/select/index.vue +244 -57
  31. package/src/components/inputs/select/option/index.vue +43 -12
  32. package/src/components/inputs/slider/index.vue +16 -16
  33. package/src/components/inputs/switchField/index.vue +2 -2
  34. package/src/components/inputs/textAreaInput/index.vue +1 -1
  35. package/src/components/inputs/toggle/index.vue +2 -2
  36. package/src/components/label/index.vue +27 -31
  37. package/src/components/modals/modal/index.vue +2 -6
  38. package/src/components/navigationTabs/index.vue +27 -20
  39. package/src/components/pageSubtitle/index.vue +1 -1
  40. package/src/components/pageTitle/index.vue +4 -4
  41. package/src/components/pagination/index.vue +3 -3
  42. package/src/components/progressBar/index.vue +1 -1
  43. package/src/components/projectMarker/index.vue +16 -9
  44. package/src/components/sideMenu/index.vue +1 -1
  45. package/src/components/spinner/index.vue +7 -11
  46. package/src/components/tableDropdown/index.vue +35 -45
  47. package/src/components/tables/mainTable/exampleNested.vue +1 -1
  48. package/src/components/tables/mainTable/index.vue +10 -9
  49. package/src/components/tables/viewTable/index.vue +2 -2
  50. package/src/components/threeDots/index.vue +1 -1
  51. package/src/components/videoThumbnail/index.vue +95 -100
  52. package/src/main.js +4 -11
  53. package/src/assets/svgIcons/anchor.svg +0 -18
  54. package/src/assets/svgIcons/flatten_roof.svg +0 -20
@@ -40,12 +40,7 @@
40
40
  "
41
41
  @click.stop="onSelectedTemplateClick(item.row)"
42
42
  >
43
- <img
44
- :src="require('../../assets/icons/file_icon.png')"
45
- alt="icon"
46
- width="12"
47
- height="16"
48
- />
43
+ <img :src="fileIcon" alt="icon" width="12" height="16" />
49
44
  <div>{{ item.value }}</div>
50
45
  </template-link>
51
46
  <no-template v-if="item.type && item.type === 'no-template'">
@@ -53,7 +48,7 @@
53
48
  </no-template>
54
49
  <input-container
55
50
  v-if="item.type === 'input'"
56
- @click.native.stop="onInputClick()"
51
+ @click.stop="onInputClick()"
57
52
  >
58
53
  <text-container
59
54
  v-if="customInputDisabled"
@@ -93,16 +88,11 @@
93
88
  triggerType="hover"
94
89
  ></et-popover>
95
90
  <arrow-down
96
- @click.native.stop="toggleOpen"
91
+ @click.stop="toggleOpen"
97
92
  v-if="!isOpen"
98
93
  class="arrow-dropdown"
99
- :src="require('../../assets/icons/collapse_arrow_icon.svg')"
100
- />
101
- <arrow-up
102
- @click.native.stop="toggleOpen"
103
- v-else
104
- :src="require('../../assets/icons/collapse_arrow_icon.svg')"
105
94
  />
95
+ <arrow-up @click.stop="toggleOpen" v-else />
106
96
  </arrow-wrapper>
107
97
  <options-container v-if="isOpen" ref="optionsContainer">
108
98
  <options-wrapper @click.prevent.stop>
@@ -127,20 +117,18 @@
127
117
  :key="index"
128
118
  @click="onItemClick(item)"
129
119
  :tabindex="0"
130
- @keyup.enter.native="onItemClick(item)"
120
+ @keyup.enter="onItemClick(item)"
131
121
  >
132
- <template v-for="(option, idx) in optionsDisplay">
133
- <span v-if="option !== 'template'" :key="idx">
122
+ <template v-for="(option, idx) in optionsDisplay" :key="idx">
123
+ <span v-if="option !== 'template'">
134
124
  {{ !!item[option] ? item[option] : '-' }}
135
125
  </span>
136
126
  <template-button
137
- :key="idx"
138
127
  @click.stop="onTemplateClick(item)"
139
128
  v-else-if="option === 'template' && item.has_template"
140
129
  >{{ $gettext('Use template...') }}</template-button
141
130
  >
142
131
  <no-template
143
- :key="idx"
144
132
  v-else-if="option === 'template' && !item.has_template"
145
133
  >
146
134
  {{ $gettext('No main component template') }}
@@ -183,10 +171,13 @@
183
171
  // :optionsDisplay="['display_name', 'company_item_number']" // Array. what should be displayed
184
172
  // :disabled="true"
185
173
  // />
186
- import styled from 'vue-styled-components'
187
- import Spinner from '@eturnity/eturnity_reusable_components/src/components/spinner'
188
- import SearchInput from '@eturnity/eturnity_reusable_components/src/components/inputs/searchInput'
189
- import InputText from '@eturnity/eturnity_reusable_components/src/components/inputs/inputText'
174
+ import styled from 'vue3-styled-components'
175
+ import Spinner from '../spinner'
176
+ import SearchInput from '../inputs/searchInput'
177
+ import InputText from '../inputs/inputText'
178
+ import CollapseArrowIcon from '../../assets/icons/collapse_arrow_icon.svg'
179
+ import SubpositionMarkerIcon from '../../assets/icons/subposition_marker.svg'
180
+ import fileIconPng from '../../assets/icons/file_icon.png'
190
181
 
191
182
  const rowAttrs = { disabled: Boolean, isOpen: Boolean }
192
183
  const DropdownRow = styled('div', rowAttrs)`
@@ -237,9 +228,8 @@ const ComponentContainer = styled('div', containerAttrs)`
237
228
  padding: 5px 4px;
238
229
  `
239
230
 
240
- const ArrowDown = styled.img`
231
+ const ArrowDown = styled(CollapseArrowIcon)`
241
232
  width: 8px;
242
- transform: rotate(0deg);
243
233
  transition: transform 150ms ease;
244
234
  `
245
235
 
@@ -403,9 +393,7 @@ const TextContainer = styled.div`
403
393
  align-items: center;
404
394
  `
405
395
 
406
- const NestedIcon = styled.div`
407
- background-image: ${() =>
408
- `url(${require('../../assets/icons/subposition_marker.svg')})`};
396
+ const NestedIcon = styled(SubpositionMarkerIcon)`
409
397
  height: 10px;
410
398
  width: 6px;
411
399
  `
@@ -502,7 +490,8 @@ export default {
502
490
  inputText: '',
503
491
  wasClicked: false, // prevents custom-name from being triggered on the <input-text />
504
492
  dynamicWidth: [], // for numbers
505
- dynamicGridWidth: [] // for grid values
493
+ dynamicGridWidth: [], // for grid values
494
+ fileIcon: fileIconPng
506
495
  }
507
496
  },
508
497
  methods: {
@@ -524,7 +513,7 @@ export default {
524
513
  })
525
514
  this.$emit('toggle-dropdown-open', { close: false })
526
515
  this.$nextTick(() => {
527
- this.$refs.searchInput.$el.children[0].children[0].focus()
516
+ this.$refs.searchInput.$el.children[0].children[1].focus()
528
517
  })
529
518
  } else {
530
519
  document.removeEventListener('click', this.clickOutside)
@@ -583,30 +572,28 @@ export default {
583
572
  },
584
573
  setDropdownWidth(options) {
585
574
  this.dynamicWidth = []
586
- options.map((item) => {
587
- this.optionsDisplay.map((header, index) => {
575
+
576
+ options.forEach((item) => {
577
+ this.optionsDisplay.forEach((header, index) => {
588
578
  let value =
589
579
  header === 'template'
590
580
  ? this.$gettext('No main component template')
591
581
  : item[header]
592
-
593
582
  value = value ? value : ''
594
583
 
584
+ // Update dynamicWidth with the maximum value
595
585
  if (
596
- this.optionsDisplay.length &&
597
- (this.dynamicWidth.length < this.optionsDisplay.length ||
598
- value.length > this.dynamicWidth[index])
586
+ !this.dynamicWidth[index] ||
587
+ value.length > this.dynamicWidth[index]
599
588
  ) {
600
- if (Array.isArray(this.dynamicGridWidth)) {
601
- this.dynamicGridWidth[index] = value.length + 'ch'
602
- }
603
589
  this.dynamicWidth[index] = value.length
604
590
  }
605
591
  })
606
592
  })
607
- if (this.dynamicGridWidth.length === this.optionsDisplay.length) {
608
- this.dynamicGridWidth = this.dynamicGridWidth.join(' ')
609
- }
593
+
594
+ this.dynamicGridWidth = this.dynamicWidth
595
+ .map((width) => width + 'ch')
596
+ .join(' ')
610
597
  }
611
598
  },
612
599
  computed: {
@@ -627,9 +614,12 @@ export default {
627
614
  })
628
615
  }
629
616
  },
630
- optionItems(val) {
631
- if (val && val.length) {
632
- this.setDropdownWidth(val)
617
+ optionItems: {
618
+ immediate: true,
619
+ handler(val) {
620
+ if (val && val.length) {
621
+ this.setDropdownWidth(val)
622
+ }
633
623
  }
634
624
  }
635
625
  }
@@ -161,7 +161,7 @@
161
161
 
162
162
  <script>
163
163
  import draggable from "vuedraggable"
164
- import styled from "vue-styled-components"
164
+ import styled from "vue3-styled-components"
165
165
  import MainTable from "@/components/reusable-components/tables/MainTable"
166
166
  import InputText from "@eturnity/eturnity_reusable_components/src/components/inputs/inputText"
167
167
  import DeleteIcon from "@/components/reusable-components/DeleteIcon"
@@ -29,8 +29,12 @@
29
29
  <script>
30
30
  // ToDo: add this to storybook
31
31
  // import MainTable from "@eturnity/eturnity_reusable_components/src/components/tables/mainTable"
32
- import styled from 'vue-styled-components'
32
+ import styled from 'vue3-styled-components'
33
33
  import Spinner from '../../spinner'
34
+ import dragIconSvg from '../../../assets/icons/drag_icon.svg?url'
35
+ import subpositionIconSvg from '../../../assets/icons/subposition_icon.svg?url'
36
+ import arrowDownSvg from '../../../assets/icons/arrow_down.svg?url'
37
+ import arrowUpRedSvg from '../../../assets/icons/arrow_up_red.svg?url'
34
38
 
35
39
  const pageContainerProps = {
36
40
  tableHeight: String,
@@ -122,6 +126,7 @@ const TableContainer = styled('table', containerAttrs)`
122
126
  background-color: ${(props) => props.theme.colors.white};
123
127
  cursor: ${(props) => (props.tableCursor ? props.tableCursor : 'auto')};
124
128
 
129
+ .select-button,
125
130
  .arrow-container,
126
131
  .input-placeholder,
127
132
  .table-dropdown-item {
@@ -322,8 +327,7 @@ const TableContainer = styled('table', containerAttrs)`
322
327
  height: 16px;
323
328
  cursor: grab;
324
329
  background-position: center;
325
- background-image: ${() =>
326
- `url(${require('../../../assets/icons/drag_icon.svg')})`};
330
+ background-image: ${() => `url(${dragIconSvg})`};
327
331
 
328
332
  &:active {
329
333
  cursor: grabbing;
@@ -335,8 +339,7 @@ const TableContainer = styled('table', containerAttrs)`
335
339
  height: 11px;
336
340
  background: no-repeat;
337
341
  margin-left: 10px;
338
- background-image: ${() =>
339
- `url(${require('../../../assets/icons/subposition_icon.svg')})`};
342
+ background-image: ${() => `url(${subpositionIconSvg})`};
340
343
  }
341
344
 
342
345
  .arrow-down {
@@ -344,8 +347,7 @@ const TableContainer = styled('table', containerAttrs)`
344
347
  height: 11px;
345
348
  background: no-repeat;
346
349
  background-position: center;
347
- background-image: ${() =>
348
- `url(${require('../../../assets/icons/arrow_down.svg')})`};
350
+ background-image: ${() => `url(${arrowDownSvg})`};
349
351
  }
350
352
 
351
353
  .arrow-up {
@@ -353,8 +355,7 @@ const TableContainer = styled('table', containerAttrs)`
353
355
  height: 11px;
354
356
  background: no-repeat;
355
357
  background-position: center;
356
- background-image: ${() =>
357
- `url(${require('../../../assets/icons/arrow_up_red.svg')})`};
358
+ background-image: ${() => `url(${arrowUpRedSvg})`};
358
359
  }
359
360
  }
360
361
 
@@ -29,7 +29,7 @@
29
29
  </table-item>
30
30
  <icons-container v-if="showIconsContainer">
31
31
  <delete-icon
32
- @click.native="$emit('on-click-delete', index)"
32
+ @click="$emit('on-click-delete', index)"
33
33
  color="gray"
34
34
  />
35
35
  </icons-container>
@@ -45,7 +45,7 @@
45
45
  // This is a read only table. Pass it data, and it displays it
46
46
  // ToDo: add this to storybook
47
47
  // import ViewTable from "@eturnity/eturnity_reusable_components/src/components/tables/viewTable"
48
- import styled from 'vue-styled-components'
48
+ import styled from 'vue3-styled-components'
49
49
  import DeleteIcon from '../../deleteIcon'
50
50
  import Spinner from '../../spinner'
51
51
 
@@ -123,7 +123,7 @@
123
123
  // },
124
124
  // ],
125
125
 
126
- import styled from 'vue-styled-components'
126
+ import styled from 'vue3-styled-components'
127
127
  import Spinner from '../spinner'
128
128
 
129
129
  const PageContainerAttrs = {
@@ -1,108 +1,103 @@
1
1
  <template>
2
- <wrapper :width="width" :height="height" :fit="fit">
3
- <img :src="src">
4
- <iconWrapper>
5
- <icon
6
- name="play"
7
- :size="playIconSize"
8
- :color="playIconColor"
9
- />
10
- </iconWrapper>
11
- </wrapper>
12
- </template>
13
-
14
- <script>
15
- // import VideoThumbnail from "@eturnity/eturnity_reusable_components/src/components/videoThumbnail"
16
- // How to use:
17
- //<videoThumbnail src="https://musicart.xboxlive.com/6/cfaf1e9d-0000-0000-0000-000000000009/504/image.jpg?w=1920&h=1080"
18
- // playIconColor="red"
19
- // playIconSize="20px"
20
- // width="400px"
21
- // height="600px"
22
- // />
23
-
24
- import styled from 'vue-styled-components'
25
- import Icon from '../icon'
26
-
27
- const wrapperAttrs = { width: String, height:String,fit:String }
28
- const Wrapper = styled('div', wrapperAttrs)`
29
- display: inline-block;
30
- position: relative;
31
- width:${props=>props.width};
32
- height:${props=>props.height};
33
- & img{
34
- object-fit:${props=>props.fit};
35
- width:${props=>props.width};
36
- height:${props=>props.height};
37
- }
38
- `
39
- const iconWrapper = styled('div')`
40
- position: absolute;
41
- top:0;
42
- bottom:0;
43
- left:0;
44
- right:0;
45
- display:flex;
46
- justify-content:center;
47
- align-items: center;
48
- `
2
+ <wrapper :width="width" :height="height" :fit="fit">
3
+ <img :src="src" />
4
+ <iconWrapper>
5
+ <icon name="play" :size="playIconSize" :color="playIconColor" />
6
+ </iconWrapper>
7
+ </wrapper>
8
+ </template>
9
+
10
+ <script>
11
+ // import VideoThumbnail from "@eturnity/eturnity_reusable_components/src/components/videoThumbnail"
12
+ // How to use:
13
+ //<videoThumbnail src="https://musicart.xboxlive.com/6/cfaf1e9d-0000-0000-0000-000000000009/504/image.jpg?w=1920&h=1080"
14
+ // playIconColor="red"
15
+ // playIconSize="20px"
16
+ // width="400px"
17
+ // height="600px"
18
+ // />
19
+
20
+ import styled from 'vue3-styled-components'
21
+ import Icon from '../icon'
49
22
 
50
- export default {
51
- name: 'VideoThumbnail',
52
- components: {
53
- Wrapper,
54
- Icon,
55
- iconWrapper
23
+ const wrapperAttrs = { width: String, height: String, fit: String }
24
+ const Wrapper = styled('div', wrapperAttrs)`
25
+ display: inline-block;
26
+ position: relative;
27
+ width: ${(props) => props.width};
28
+ height: ${(props) => props.height};
29
+ & img {
30
+ object-fit: ${(props) => props.fit};
31
+ width: ${(props) => props.width};
32
+ height: ${(props) => props.height};
33
+ }
34
+ `
35
+ const iconWrapper = styled('div')`
36
+ position: absolute;
37
+ top: 0;
38
+ bottom: 0;
39
+ left: 0;
40
+ right: 0;
41
+ display: flex;
42
+ justify-content: center;
43
+ align-items: center;
44
+ `
45
+
46
+ export default {
47
+ name: 'VideoThumbnail',
48
+ components: {
49
+ Wrapper,
50
+ Icon,
51
+ iconWrapper
52
+ },
53
+ props: {
54
+ src: {
55
+ required: true
56
56
  },
57
- props: {
58
- src:{
59
- required: true,
60
- },
61
- fit:{
62
- required: false,
63
- default: 'cover'
64
- },
65
- width: {
66
- required: false,
67
- default: '300px'
68
- },
69
- height: {
70
- required: false,
71
- default: '200px'
72
- },
73
- playIconSize:{
74
- required: false,
75
- default: '50px'
76
- },
77
- playIconColor:{
78
- required: false,
79
- default: 'blue'
80
- }
57
+ fit: {
58
+ required: false,
59
+ default: 'cover'
81
60
  },
82
- data() {
83
- return {
84
- isOpenByClick:false
85
- }
61
+ width: {
62
+ required: false,
63
+ default: '300px'
86
64
  },
87
- methods:{
88
- clickOutside(event) {
89
- if (this.openingMode!="click") return
90
- if (
91
- this.$refs.dropdown.$el == event.target ||
92
- this.$refs.dropdown.$el.contains(event.target)
93
- ) {
94
- return
95
- } else {
96
- this.isOpenByClick=false
97
- }
98
- },
65
+ height: {
66
+ required: false,
67
+ default: '200px'
99
68
  },
100
- mounted() {
101
- document.addEventListener('click', this.clickOutside)
102
- },
103
- beforeDestroy() {
104
- document.removeEventListener('click', this.clickOutside)
69
+ playIconSize: {
70
+ required: false,
71
+ default: '50px'
105
72
  },
73
+ playIconColor: {
74
+ required: false,
75
+ default: 'blue'
76
+ }
77
+ },
78
+ data() {
79
+ return {
80
+ isOpenByClick: false
81
+ }
82
+ },
83
+ methods: {
84
+ clickOutside(event) {
85
+ if (this.openingMode != 'click') return
86
+ if (
87
+ this.$refs.dropdown.$el == event.target ||
88
+ this.$refs.dropdown.$el.contains(event.target)
89
+ ) {
90
+ return
91
+ } else {
92
+ this.isOpenByClick = false
93
+ }
94
+ }
95
+ },
96
+ mounted() {
97
+ document.addEventListener('click', this.clickOutside)
98
+ },
99
+ beforeDestroy() {
100
+ document.removeEventListener('click', this.clickOutside)
106
101
  }
107
- </script>
108
-
102
+ }
103
+ </script>
package/src/main.js CHANGED
@@ -1,13 +1,6 @@
1
- import Vue from "vue"
2
- import App from "./App.vue"
3
- import VueCompositionAPI from "@vue/composition-api"
4
- import vClickOutside from 'v-click-outside'
1
+ import App from './App.vue'
2
+ import { createApp } from 'vue'
5
3
 
6
- Vue.config.productionTip = false
4
+ const app = createApp(App)
7
5
 
8
- Vue.use(VueCompositionAPI)
9
- Vue.use(vClickOutside)
10
-
11
- new Vue({
12
- render: (h) => h(App),
13
- }).$mount("#app")
6
+ app.mount('#app')
@@ -1,18 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
3
- <svg height="800px" width="800px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
4
- viewBox="0 0 204.851 204.851" xml:space="preserve">
5
- <g>
6
- <g>
7
- <g>
8
- <path fill="white" d="M139.518,128.595l16.834,16.336c0,0-20.644,29.877-42.725,30.473
9
- c0.479,0,0.117-84.092,0.039-104.472c14.694-4.797,25.402-18.182,25.402-34.117c0-20.009-16.697-36.218-37.273-36.218
10
- c-20.615,0-37.312,16.209-37.312,36.208c0,15.671,10.376,28.929,24.748,33.961l0.098,104.277
11
- c-26.643-1.837-42.061-27.474-42.061-27.474l17.997-17.41L0,120.505l9.887,63.301l17.362-16.795
12
- c15.036,12.105,32.017,37.244,72.876,37.244c51.332-1.309,63.184-28.939,76.344-39.804l18.993,18.514l9.389-63.907
13
- L139.518,128.595z M82.558,36.208c0-10.298,8.608-18.661,19.218-18.661s19.257,8.363,19.257,18.661
14
- c0,10.327-8.647,18.681-19.257,18.681S82.558,46.535,82.558,36.208z"/>
15
- </g>
16
- </g>
17
- </g>
18
- </svg>
@@ -1,20 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
-
4
- <svg
5
- width="16"
6
- height="8"
7
- viewBox="0 0 16 8"
8
- version="1.1"
9
- id="svg5"
10
- xmlns="http://www.w3.org/2000/svg"
11
- xmlns:svg="http://www.w3.org/2000/svg">
12
- <g
13
- transform="translate(-55.350933,-93.588073)">
14
- <path
15
- fill="#000000"
16
- d="m 61.719348,100.39494 1.004406,0.0185 -0.0013,-2.679323 0.88345,-4.27e-4 c -0.0051,-0.01381 -0.01401,2.69128 -0.01401,2.69128 l 1.05348,-0.0159 -1.582401,1.44453 z m -6.368415,-0.817395 7.856738,-5.989472 7.616581,6.321372 -1.240034,1.266145 -6.409573,-5.185912 -6.581971,5.125212 z"
17
- id="path874"
18
- />
19
- </g>
20
- </svg>