@eturnity/eturnity_reusable_components 7.18.0--EPDM-5518.4 → 7.18.0-EPDM-10335.1

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/components/addNewButton/index.vue +5 -3
  5. package/src/components/buttons/buttonIcon/index.vue +1 -1
  6. package/src/components/buttons/closeButton/index.vue +1 -1
  7. package/src/components/buttons/mainButton/index.vue +6 -1
  8. package/src/components/card/index.vue +25 -24
  9. package/src/components/deleteIcon/DeleteIcon.stories.js +7 -7
  10. package/src/components/deleteIcon/index.vue +25 -21
  11. package/src/components/draggableInputHandle/index.vue +24 -25
  12. package/src/components/dropdown/index.vue +129 -110
  13. package/src/components/errorMessage/index.vue +10 -5
  14. package/src/components/filter/filterSettings.vue +57 -113
  15. package/src/components/filter/index.vue +3 -3
  16. package/src/components/filter/parentDropdown.vue +2 -2
  17. package/src/components/icon/iconCache.js +23 -0
  18. package/src/components/icon/iconCollection.vue +2 -2
  19. package/src/components/icon/index.vue +67 -75
  20. package/src/components/iconWrapper/index.vue +1 -4
  21. package/src/components/infoCard/index.vue +2 -3
  22. package/src/components/infoText/index.vue +1 -1
  23. package/src/components/inputs/checkbox/index.vue +24 -16
  24. package/src/components/inputs/inputNumber/index.vue +7 -10
  25. package/src/components/inputs/inputNumberQuestion/index.vue +1 -1
  26. package/src/components/inputs/inputText/index.vue +4 -4
  27. package/src/components/inputs/radioButton/index.vue +1 -1
  28. package/src/components/inputs/searchInput/index.vue +28 -11
  29. package/src/components/inputs/select/index.vue +212 -91
  30. package/src/components/inputs/select/option/index.vue +36 -11
  31. package/src/components/inputs/slider/index.vue +16 -16
  32. package/src/components/inputs/switchField/index.vue +2 -2
  33. package/src/components/inputs/textAreaInput/index.vue +2 -2
  34. package/src/components/inputs/toggle/index.vue +2 -2
  35. package/src/components/label/index.vue +27 -31
  36. package/src/components/modals/modal/index.vue +2 -6
  37. package/src/components/navigationTabs/index.vue +27 -20
  38. package/src/components/pageSubtitle/index.vue +1 -1
  39. package/src/components/pageTitle/index.vue +4 -4
  40. package/src/components/pagination/index.vue +6 -7
  41. package/src/components/progressBar/index.vue +1 -1
  42. package/src/components/projectMarker/index.vue +17 -10
  43. package/src/components/sideMenu/index.vue +1 -1
  44. package/src/components/spinner/index.vue +7 -11
  45. package/src/components/tableDropdown/index.vue +30 -37
  46. package/src/components/tables/mainTable/exampleNested.vue +1 -1
  47. package/src/components/tables/mainTable/index.vue +10 -9
  48. package/src/components/tables/viewTable/index.vue +2 -2
  49. package/src/components/threeDots/index.vue +1 -1
  50. package/src/components/videoThumbnail/index.vue +95 -100
  51. package/src/main.js +4 -11
  52. package/src/assets/svgIcons/clock_full.svg +0 -3
  53. package/src/components/markerItem/index.vue +0 -96
  54. package/src/components/selectedOptions/index.vue +0 -145
@@ -53,7 +53,7 @@
53
53
  </no-template>
54
54
  <input-container
55
55
  v-if="item.type === 'input'"
56
- @click.native.stop="onInputClick()"
56
+ @click.stop="onInputClick()"
57
57
  >
58
58
  <text-container
59
59
  v-if="customInputDisabled"
@@ -93,16 +93,11 @@
93
93
  triggerType="hover"
94
94
  ></et-popover>
95
95
  <arrow-down
96
- @click.native.stop="toggleOpen"
96
+ @click.stop="toggleOpen"
97
97
  v-if="!isOpen"
98
98
  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
99
  />
100
+ <arrow-up @click.stop="toggleOpen" v-else />
106
101
  </arrow-wrapper>
107
102
  <options-container v-if="isOpen" ref="optionsContainer">
108
103
  <options-wrapper @click.prevent.stop>
@@ -127,20 +122,18 @@
127
122
  :key="index"
128
123
  @click="onItemClick(item)"
129
124
  :tabindex="0"
130
- @keyup.enter.native="onItemClick(item)"
125
+ @keyup.enter="onItemClick(item)"
131
126
  >
132
- <template v-for="(option, idx) in optionsDisplay">
133
- <span v-if="option !== 'template'" :key="idx">
127
+ <template v-for="(option, idx) in optionsDisplay" :key="idx">
128
+ <span v-if="option !== 'template'">
134
129
  {{ !!item[option] ? item[option] : '-' }}
135
130
  </span>
136
131
  <template-button
137
- :key="idx"
138
132
  @click.stop="onTemplateClick(item)"
139
133
  v-else-if="option === 'template' && item.has_template"
140
134
  >{{ $gettext('Use template...') }}</template-button
141
135
  >
142
136
  <no-template
143
- :key="idx"
144
137
  v-else-if="option === 'template' && !item.has_template"
145
138
  >
146
139
  {{ $gettext('No main component template') }}
@@ -183,10 +176,12 @@
183
176
  // :optionsDisplay="['display_name', 'company_item_number']" // Array. what should be displayed
184
177
  // :disabled="true"
185
178
  // />
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'
179
+ import styled from 'vue3-styled-components'
180
+ import Spinner from '../spinner'
181
+ import SearchInput from '../inputs/searchInput'
182
+ import InputText from '../inputs/inputText'
183
+ import CollapseArrowIcon from '../../assets/icons/collapse_arrow_icon.svg'
184
+ import SubpositionMarkerIcon from '../../assets/icons/subposition_marker.svg'
190
185
 
191
186
  const rowAttrs = { disabled: Boolean, isOpen: Boolean }
192
187
  const DropdownRow = styled('div', rowAttrs)`
@@ -237,9 +232,8 @@ const ComponentContainer = styled('div', containerAttrs)`
237
232
  padding: 5px 4px;
238
233
  `
239
234
 
240
- const ArrowDown = styled.img`
235
+ const ArrowDown = styled(CollapseArrowIcon)`
241
236
  width: 8px;
242
- transform: rotate(0deg);
243
237
  transition: transform 150ms ease;
244
238
  `
245
239
 
@@ -403,9 +397,7 @@ const TextContainer = styled.div`
403
397
  align-items: center;
404
398
  `
405
399
 
406
- const NestedIcon = styled.div`
407
- background-image: ${() =>
408
- `url(${require('../../assets/icons/subposition_marker.svg')})`};
400
+ const NestedIcon = styled(SubpositionMarkerIcon)`
409
401
  height: 10px;
410
402
  width: 6px;
411
403
  `
@@ -583,30 +575,28 @@ export default {
583
575
  },
584
576
  setDropdownWidth(options) {
585
577
  this.dynamicWidth = []
586
- options.map((item) => {
587
- this.optionsDisplay.map((header, index) => {
578
+
579
+ options.forEach((item) => {
580
+ this.optionsDisplay.forEach((header, index) => {
588
581
  let value =
589
582
  header === 'template'
590
583
  ? this.$gettext('No main component template')
591
584
  : item[header]
592
-
593
585
  value = value ? value : ''
594
586
 
587
+ // Update dynamicWidth with the maximum value
595
588
  if (
596
- this.optionsDisplay.length &&
597
- (this.dynamicWidth.length < this.optionsDisplay.length ||
598
- value.length > this.dynamicWidth[index])
589
+ !this.dynamicWidth[index] ||
590
+ value.length > this.dynamicWidth[index]
599
591
  ) {
600
- if (Array.isArray(this.dynamicGridWidth)) {
601
- this.dynamicGridWidth[index] = value.length + 'ch'
602
- }
603
592
  this.dynamicWidth[index] = value.length
604
593
  }
605
594
  })
606
595
  })
607
- if (this.dynamicGridWidth.length === this.optionsDisplay.length) {
608
- this.dynamicGridWidth = this.dynamicGridWidth.join(' ')
609
- }
596
+
597
+ this.dynamicGridWidth = this.dynamicWidth
598
+ .map((width) => width + 'ch')
599
+ .join(' ')
610
600
  }
611
601
  },
612
602
  computed: {
@@ -627,9 +617,12 @@ export default {
627
617
  })
628
618
  }
629
619
  },
630
- optionItems(val) {
631
- if (val && val.length) {
632
- this.setDropdownWidth(val)
620
+ optionItems: {
621
+ immediate: true,
622
+ handler(val) {
623
+ if (val && val.length) {
624
+ this.setDropdownWidth(val)
625
+ }
633
626
  }
634
627
  }
635
628
  }
@@ -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,3 +0,0 @@
1
- <svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M5 10C7.76142 10 10 7.76142 10 5C10 2.23858 7.76142 0 5 0C2.23858 0 0 2.23858 0 5C0 7.76142 2.23858 10 5 10ZM5.875 5.05243V2.125H4.125V5.92743L6.19061 7.47663L7.24061 6.07663L5.875 5.05243Z" fill="white"/>
3
- </svg>
@@ -1,96 +0,0 @@
1
- <template>
2
- <page-container>
3
- <marker-container
4
- :backgroundColor="backgroundColor"
5
- :hasIcon="!!iconName"
6
- :cursor="cursor"
7
- >
8
- <icon
9
- v-if="!!iconName"
10
- :name="iconName"
11
- color="white"
12
- size="10px"
13
- :cursor="cursor"
14
- />
15
- <span>{{ label }}</span>
16
- </marker-container>
17
- </page-container>
18
- </template>
19
-
20
- <script>
21
- // import MarkerItem from "@eturnity/eturnity_reusable_components/src/components/markerItem"
22
- // To use:
23
- // <marker-item
24
- // label="Label"
25
- // backgroundColor="#ab5348"
26
- // iconName="icon_name"
27
- // cursor="pointer"
28
- // />
29
-
30
- import styled from 'vue-styled-components'
31
- import Icon from '../icon'
32
- import Modal from '../modals/modal'
33
- import PageTitle from '../pageTitle'
34
- import DeleteIcon from '../deleteIcon'
35
- import PageSubtitle from '../pageSubtitle'
36
- import MainButton from '../buttons/mainButton'
37
-
38
- const PageContainer = styled.div`
39
- display: flex;
40
- align-items: center;
41
- font-size: 12px;
42
- line-height: 14px;
43
- `
44
-
45
- const MarkerAttrs = {
46
- backgroundColor: String,
47
- hasIcon: Boolean,
48
- cursor: String
49
- }
50
- const MarkerContainer = styled('div', MarkerAttrs)`
51
- display: grid;
52
- grid-template-columns: ${(props) => (props.hasIcon ? 'auto 1fr' : '1fr')};
53
- grid-gap: 5px;
54
- position: relative;
55
- align-items: center;
56
- padding: 2px 7px;
57
- color: ${(props) => props.theme.colors.white};
58
- background-color: ${(props) =>
59
- props.backgroundColor ? props.backgroundColor : props.theme.colors.grey3};
60
- border: 1px solid
61
- ${(props) =>
62
- props.backgroundColor ? props.backgroundColor : props.theme.colors.grey3};
63
- border-radius: 4px;
64
- white-space: nowrap;
65
- cursor: ${(props) => (props.isEditionAllowed ? 'pointer' : props.cursor)};
66
- `
67
-
68
- // const IconContainer = styled.div`
69
- // padding: 8px;
70
- // line-height: 0;
71
- // `
72
-
73
- export default {
74
- name: 'project-marker',
75
- components: {
76
- PageContainer,
77
- MarkerContainer,
78
- Icon
79
- },
80
- props: {
81
- backgroundColor: {
82
- required: false
83
- },
84
- iconName: {
85
- required: false
86
- },
87
- label: {
88
- required: true
89
- },
90
- cursor: {
91
- required: false,
92
- default: 'default'
93
- }
94
- }
95
- }
96
- </script>