@eturnity/eturnity_reusable_components 6.33.1-EPDM-6487 → 6.33.1-EPDM-7956

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 (40) hide show
  1. package/.storybook/preview.js +1 -1
  2. package/package.json +15 -18
  3. package/src/App.vue +2 -2
  4. package/src/components/addNewButton/index.vue +1 -1
  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 +1 -1
  8. package/src/components/deleteIcon/index.vue +1 -1
  9. package/src/components/dropdown/index.vue +129 -110
  10. package/src/components/errorMessage/index.vue +1 -1
  11. package/src/components/icon/iconCollection.vue +2 -2
  12. package/src/components/icon/index.vue +36 -42
  13. package/src/components/iconWrapper/index.vue +1 -1
  14. package/src/components/infoText/index.vue +2 -6
  15. package/src/components/inputs/checkbox/index.vue +1 -1
  16. package/src/components/inputs/inputNumber/index.vue +3 -34
  17. package/src/components/inputs/inputNumberQuestion/index.vue +1 -1
  18. package/src/components/inputs/inputText/index.vue +3 -3
  19. package/src/components/inputs/radioButton/index.vue +1 -1
  20. package/src/components/inputs/searchInput/index.vue +1 -1
  21. package/src/components/inputs/select/index.vue +22 -28
  22. package/src/components/inputs/select/option/index.vue +1 -1
  23. package/src/components/inputs/slider/index.vue +1 -1
  24. package/src/components/inputs/switchField/index.vue +1 -1
  25. package/src/components/inputs/textAreaInput/index.vue +1 -1
  26. package/src/components/inputs/toggle/index.vue +1 -1
  27. package/src/components/modals/modal/index.vue +1 -1
  28. package/src/components/pageSubtitle/index.vue +1 -1
  29. package/src/components/pageTitle/index.vue +1 -1
  30. package/src/components/pagination/index.vue +12 -12
  31. package/src/components/progressBar/index.vue +1 -1
  32. package/src/components/projectMarker/index.vue +1 -1
  33. package/src/components/spinner/index.vue +1 -1
  34. package/src/components/tableDropdown/index.vue +4 -4
  35. package/src/components/tables/mainTable/exampleNested.vue +1 -1
  36. package/src/components/tables/mainTable/index.vue +1 -1
  37. package/src/components/tables/viewTable/index.vue +3 -3
  38. package/src/components/threeDots/index.vue +1 -1
  39. package/src/components/videoThumbnail/index.vue +95 -100
  40. package/src/main.js +4 -9
@@ -1,4 +1,4 @@
1
- import { ThemeProvider } from "vue-styled-components"
1
+ import { ThemeProvider } from "vue3-styled-components"
2
2
 
3
3
  const theme = {
4
4
  colors: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "6.33.1-EPDM-6487",
3
+ "version": "6.33.1-EPDM-7956",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -10,27 +10,24 @@
10
10
  "build-storybook": "build-storybook"
11
11
  },
12
12
  "dependencies": {
13
+ "@storybook/vue3": "^7.0.18",
14
+ "@vue/compat": "^3.3.4",
13
15
  "@vueform/slider": "1.0.5",
14
- "core-js": "^3.31.1",
16
+ "external-svg-loader": "^1.6.7",
15
17
  "html-loader": "0.5.5",
16
18
  "v-click-outside": "2.1.4",
17
- "vue": "2.6.11",
18
- "vue-styled-components": "1.6.0"
19
+ "vue": "3.3.4",
20
+ "vue3-styled-components": "^1.2.1"
19
21
  },
20
22
  "devDependencies": {
21
- "@storybook/addon-actions": "6.2.8",
22
- "@storybook/addon-docs": "6.4.19",
23
- "@storybook/addon-essentials": "6.2.8",
24
- "@storybook/addon-links": "6.2.8",
25
- "@storybook/vue": "6.4.19",
26
- "@vue/cli-plugin-babel": "~4.5.0",
27
- "@vue/cli-plugin-eslint": "~4.5.0",
28
- "@vue/cli-service": "~4.5.0",
29
- "@vue/composition-api": "1.0.0-rc.10",
30
- "babel-eslint": "10.1.0",
31
- "eslint": "6.7.2",
32
- "eslint-plugin-vue": "6.2.2",
33
- "vue-template-compiler": "2.6.11"
23
+ "@babel/core": "^7.12.16",
24
+ "@babel/eslint-parser": "^7.12.16",
25
+ "@vue/cli-plugin-babel": "^5.0.8",
26
+ "@vue/cli-plugin-eslint": "^5.0.8",
27
+ "@vue/cli-service": "5.0.8",
28
+ "@vue/compiler-sfc": "^3.3.4",
29
+ "eslint": "^7.32.0",
30
+ "eslint-plugin-vue": "^8.0.3"
34
31
  },
35
32
  "eslintConfig": {
36
33
  "root": true,
@@ -42,7 +39,7 @@
42
39
  "eslint:recommended"
43
40
  ],
44
41
  "parserOptions": {
45
- "parser": "babel-eslint"
42
+ "parser": "@babel/eslint-parser"
46
43
  },
47
44
  "rules": {}
48
45
  },
package/src/App.vue CHANGED
@@ -94,9 +94,9 @@
94
94
  </template>
95
95
 
96
96
  <script>
97
- import { ThemeProvider } from 'vue-styled-components'
97
+ import { ThemeProvider } from 'vue3-styled-components'
98
98
  import theme from './assets/theme'
99
- import styled from 'vue-styled-components'
99
+ import styled from 'vue3-styled-components'
100
100
  import InputNumber from '@/components/inputs/inputNumber'
101
101
  import Select from '@/components/inputs/select'
102
102
  import SwitchField from '@/components/inputs/switchField'
@@ -8,7 +8,7 @@
8
8
 
9
9
  <script>
10
10
  // import AddNewButton from "@eturnity/eturnity_reusable_components/src/components/addNewButton"
11
- import styled from "vue-styled-components"
11
+ import styled from "vue3-styled-components"
12
12
 
13
13
  const pageAttrs = { shouldPosition: Boolean }
14
14
  const PageContainer = styled("div", pageAttrs)`
@@ -32,7 +32,7 @@
32
32
  // />
33
33
 
34
34
  import Icon from "../../icon"
35
- import styled from "vue-styled-components"
35
+ import styled from "vue3-styled-components"
36
36
  import Theme from "@/assets/theme";
37
37
 
38
38
  const PageContainer = styled.div``
@@ -13,7 +13,7 @@
13
13
  // <close-button
14
14
  // color="#fff"
15
15
  // />
16
- import styled from 'vue-styled-components'
16
+ import styled from 'vue3-styled-components'
17
17
 
18
18
  const Container = styled.div`
19
19
  position: relative;
@@ -22,7 +22,7 @@
22
22
  // :minWidth="minWidth"
23
23
  // />
24
24
 
25
- import styled from "vue-styled-components"
25
+ import styled from "vue3-styled-components"
26
26
 
27
27
  const PageContainer = styled.div``
28
28
 
@@ -19,7 +19,7 @@
19
19
  <script>
20
20
  // To use:
21
21
  // <delete-icon @click.native="onDeleteItem(item)" :isDisabled="true" />
22
- import styled from "vue-styled-components"
22
+ import styled from "vue3-styled-components"
23
23
 
24
24
  const wrapperAttrs = { isDisabled: Boolean }
25
25
  const Wrapper = styled("div", wrapperAttrs)`
@@ -1,119 +1,138 @@
1
1
  <template>
2
- <wrapper ref="dropdown" :openingMode="openingMode">
3
- <WrapperButton @click="isOpenByClick=!isOpenByClick">
4
- <slot name="trigger"/>
5
- </WrapperButton>
6
- <WrapperDropdown class="dropdown-content" :class="{openDropdown:isOpenByClick && openingMode=='click'}" :justify="justify" :position="position" :width="width" :backgroundColor="backgroundColor">
7
- <DropdownWindow :gap="gap" :backgroundColor="backgroundColor" :width="width">
8
- <slot name="dropdown"/>
9
- </DropdownWindow>
10
- </WrapperDropdown>
11
- </wrapper>
12
- </template>
13
-
14
- <script>
15
- // import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
16
- // How to use:
17
- //<DropdownComponent
18
- // width="300px"
19
- // backgroundColor="red">
2
+ <wrapper ref="dropdown" :openingMode="openingMode">
3
+ <WrapperButton @click="isOpenByClick = !isOpenByClick">
4
+ <slot name="trigger" />
5
+ </WrapperButton>
6
+ <WrapperDropdown
7
+ class="dropdown-content"
8
+ :class="{ openDropdown: isOpenByClick && openingMode == 'click' }"
9
+ :justify="justify"
10
+ :position="position"
11
+ :width="width"
12
+ :backgroundColor="backgroundColor"
13
+ >
14
+ <DropdownWindow
15
+ :gap="gap"
16
+ :backgroundColor="backgroundColor"
17
+ :width="width"
18
+ >
19
+ <slot name="dropdown" />
20
+ </DropdownWindow>
21
+ </WrapperDropdown>
22
+ </wrapper>
23
+ </template>
20
24
 
21
- // <DropdownComponent/>
22
-
23
- import styled from 'vue-styled-components'
24
-
25
- const wrapperAttrs = { width: String, backgroundColor:String,openingMode:String,gap:String,justify:String }
26
- const Wrapper = styled('div', wrapperAttrs)`
27
- display: inline-block;
28
- position: relative;
25
+ <script>
26
+ // import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
27
+ // How to use:
28
+ //<DropdownComponent
29
+ // width="300px"
30
+ // backgroundColor="red">
29
31
 
30
- &:hover .dropdown-content {
31
- ${props=>props.openingMode=='hover'?"display:block":""}
32
- }
33
- & .openDropdown{
34
- ${props=>props.openingMode=='click'?"display:block !important":""}
35
- }
36
- `
37
- const WrapperDropdown = styled('div', wrapperAttrs)`
38
- margin-top: 0;
39
- display: none;
40
- position: absolute;
41
- z-index: 1;
42
- ${(props) => props.justify=="right"?"right:0;":""}
43
- `
44
- const DropdownWindow = styled('div', wrapperAttrs)`
45
- width: ${(props) => props.width};
46
- background-color: ${(props) => props.theme.colors[props.backgroundColor] || props.backgroundColor};
47
- margin-top: ${(props) => props.gap};
48
- border-radius: 4px;
49
- position: relative;
50
- min-width: 160px;
51
- box-shadow: -1px 0px 5px rgba(0, 0, 0, 0.302);
52
- z-index: 1;
53
- `
54
-
55
- const WrapperButton = styled('div', wrapperAttrs)`
56
- display: inline-block;
57
- `
58
-
59
- export default {
60
- name: 'DropdownComponent',
61
- components: {
62
- WrapperDropdown,
63
- WrapperButton,
64
- Wrapper,
65
- DropdownWindow
66
- },
67
- props: {
68
- width: {
69
- required: false,
70
- default: '300px'
71
- },
72
- gap: {
73
- required: false,
74
- default: '10px'
75
- },
76
- position: {
77
- required: false,
78
- default: 'bottom'
79
- },
80
- justify: {
81
- required: false,
82
- default: 'left'
83
- },
84
- openingMode: {
85
- required: false,
86
- default: 'hover'
87
- },
88
- backgroundColor: {
89
- required: false,
90
- default: 'white'
91
- }
32
+ // <DropdownComponent/>
33
+
34
+ import styled from 'vue3-styled-components'
35
+
36
+ const wrapperAttrs = {
37
+ width: String,
38
+ backgroundColor: String,
39
+ openingMode: String,
40
+ gap: String,
41
+ justify: String
42
+ }
43
+ const Wrapper = styled('div', wrapperAttrs)`
44
+ display: inline-block;
45
+ position: relative;
46
+
47
+ &:hover .dropdown-content {
48
+ ${(props) => (props.openingMode == 'hover' ? 'display:block' : '')}
49
+ }
50
+ & .openDropdown {
51
+ ${(props) =>
52
+ props.openingMode == 'click' ? 'display:block !important' : ''}
53
+ }
54
+ `
55
+ const WrapperDropdown = styled('div', wrapperAttrs)`
56
+ margin-top: 0;
57
+ display: none;
58
+ position: absolute;
59
+ z-index: 1;
60
+ ${(props) => (props.justify == 'right' ? 'right:0;' : '')}
61
+ `
62
+ const DropdownWindow = styled('div', wrapperAttrs)`
63
+ width: ${(props) => props.width};
64
+ background-color: ${(props) =>
65
+ props.theme.colors[props.backgroundColor] || props.backgroundColor};
66
+ margin-top: ${(props) => props.gap};
67
+ border-radius: 4px;
68
+ position: relative;
69
+ min-width: 160px;
70
+ box-shadow: -1px 0px 5px rgba(0, 0, 0, 0.302);
71
+ z-index: 1;
72
+ `
73
+
74
+ const WrapperButton = styled('div', wrapperAttrs)`
75
+ display: inline-block;
76
+ `
77
+
78
+ export default {
79
+ name: 'DropdownComponent',
80
+ components: {
81
+ WrapperDropdown,
82
+ WrapperButton,
83
+ Wrapper,
84
+ DropdownWindow
85
+ },
86
+ props: {
87
+ width: {
88
+ required: false,
89
+ default: '300px'
92
90
  },
93
- data() {
94
- return {
95
- isOpenByClick:false
96
- }
91
+ gap: {
92
+ required: false,
93
+ default: '10px'
97
94
  },
98
- methods:{
99
- clickOutside(event) {
100
- if (this.openingMode!="click") return
101
- if (
102
- this.$refs.dropdown.$el == event.target ||
103
- this.$refs.dropdown.$el.contains(event.target)
104
- ) {
105
- return
106
- } else {
107
- this.isOpenByClick=false
108
- }
109
- },
95
+ position: {
96
+ required: false,
97
+ default: 'bottom'
110
98
  },
111
- mounted() {
112
- document.addEventListener('click', this.clickOutside)
99
+ justify: {
100
+ required: false,
101
+ default: 'left'
113
102
  },
114
- beforeDestroy() {
115
- document.removeEventListener('click', this.clickOutside)
103
+ openingMode: {
104
+ required: false,
105
+ default: 'hover'
116
106
  },
107
+ backgroundColor: {
108
+ required: false,
109
+ default: 'white'
110
+ }
111
+ },
112
+ data() {
113
+ return {
114
+ isOpenByClick: false
115
+ }
116
+ },
117
+ methods: {
118
+ clickOutside(event) {
119
+ if (this.openingMode != 'click') return
120
+ if (
121
+ this.$refs.dropdown &&
122
+ (this.$refs.dropdown.$el == event.target ||
123
+ this.$refs.dropdown.$el.contains(event.target))
124
+ ) {
125
+ return
126
+ } else {
127
+ this.isOpenByClick = false
128
+ }
129
+ }
130
+ },
131
+ mounted() {
132
+ document.addEventListener('click', this.clickOutside)
133
+ },
134
+ beforeDestroy() {
135
+ document.removeEventListener('click', this.clickOutside)
117
136
  }
118
- </script>
119
-
137
+ }
138
+ </script>
@@ -13,7 +13,7 @@
13
13
  // alignText="right" // default is left
14
14
  // />
15
15
 
16
- import styled from 'vue-styled-components'
16
+ import styled from 'vue3-styled-components'
17
17
 
18
18
  const TextOverlay = styled.div`
19
19
  position: absolute;
@@ -16,7 +16,7 @@
16
16
 
17
17
  <script>
18
18
  import icon from './index.vue'
19
- import styled from 'vue-styled-components'
19
+ import styled from 'vue3-styled-components'
20
20
 
21
21
  const Wrapper = styled.div`
22
22
  display: block;
@@ -36,7 +36,7 @@ const IconWrapper = styled.div`
36
36
  margin: 10px;
37
37
  `
38
38
  export default {
39
- name: 'collection',
39
+ name: 'collectionComponent',
40
40
  components: { icon, IconWrapper, Wrapper },
41
41
  props: {
42
42
  size: { required: false },
@@ -1,18 +1,12 @@
1
1
  <template>
2
2
  <Wrapper :isDisabled="disabled" :size="size" :cursor="cursor">
3
- <icon-image
4
- :disabled="disabled"
5
- :size="size"
6
- :color="color"
7
- :hoveredColor="hoveredColor"
8
- v-html="
9
- require(`!html-loader!./../../assets/svgIcons/${name.toLowerCase()}.svg`)
10
- "
11
- ></icon-image>
3
+ <IconImage :size="size" :color="color" :hoveredColor="hoveredColor">
4
+ <i v-html="svgIconModule"></i>
5
+ </IconImage>
12
6
  </Wrapper>
13
7
  </template>
14
8
 
15
- <script>
9
+ <script setup>
16
10
  // import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
17
11
  // How to use:
18
12
  //<icon
@@ -23,8 +17,8 @@
23
17
  // cursor="default"
24
18
  // />
25
19
 
26
- import styled from 'vue-styled-components'
27
-
20
+ import { computed } from 'vue'
21
+ import styled from 'vue3-styled-components'
28
22
  const wrapperAttrs = { isDisabled: Boolean, size: String, cursor: String }
29
23
  const Wrapper = styled('div', wrapperAttrs)`
30
24
  display: flex;
@@ -52,37 +46,37 @@ const IconImage = styled('div', IconImageProps)`
52
46
  }
53
47
  `
54
48
 
55
- export default {
56
- name: 'icon',
57
- components: {
58
- IconImage,
59
- Wrapper
49
+ const props = defineProps({
50
+ disabled: {
51
+ required: false,
52
+ default: false
53
+ },
54
+ name: {
55
+ required: true
56
+ },
57
+ color: {
58
+ required: false
59
+ },
60
+ hoveredColor: {
61
+ required: false
60
62
  },
61
- props: {
62
- disabled: {
63
- required: false,
64
- default: false
65
- },
66
- name: {
67
- required: true
68
- },
69
- color: {
70
- required: false
71
- },
72
- hoveredColor: {
73
- required: false
74
- },
75
- size: {
76
- required: false,
77
- default: '30px'
78
- },
79
- cursor: {
80
- required: false,
81
- default: null
82
- }
63
+ size: {
64
+ required: false,
65
+ default: '30px'
83
66
  },
84
- data() {
85
- return {}
67
+ cursor: {
68
+ required: false,
69
+ default: null
86
70
  }
87
- }
71
+ })
72
+
73
+ const svgIconsContext = import.meta.glob('../../assets/svgIcons/*.svg', {
74
+ as: 'raw'
75
+ })
76
+
77
+ const svgIconModule = computed(() => {
78
+ const moduleKey = `../../assets/svgIcons/${props.name}.svg`
79
+
80
+ return svgIconsContext[moduleKey]
81
+ })
88
82
  </script>
@@ -34,7 +34,7 @@
34
34
  // size="60px" by default, this is 30px
35
35
  // />
36
36
 
37
- import styled from 'vue-styled-components'
37
+ import styled from 'vue3-styled-components'
38
38
  import icon from '../icon'
39
39
  const wrapperAttrs = { isHovered:Boolean,borderRadius:String,disabled: Boolean, size: String,backgroundColor:String,hoveredBackgroundColor:String }
40
40
  const Wrapper = styled('div', wrapperAttrs)`
@@ -32,7 +32,7 @@
32
32
  // alignArrow="right" // which side the arrow should be on
33
33
  // />
34
34
  import theme from '../../assets/theme.js'
35
- import styled from 'vue-styled-components'
35
+ import styled from 'vue3-styled-components'
36
36
  import icon from '../icon'
37
37
 
38
38
  const textAttrs = {
@@ -156,11 +156,7 @@ export default {
156
156
  },
157
157
  computed: {
158
158
  iconColor() {
159
- return this.isActive
160
- ? this.borderColor
161
- ? this.borderColor
162
- : theme.colors.secondary
163
- : theme.colors.mediumGray
159
+ return theme.colors.mediumGray
164
160
  },
165
161
  halfComputedTextInfoWidth() {
166
162
  return parseInt(this.width) / 2
@@ -33,7 +33,7 @@
33
33
  // backgroundColor="red"
34
34
  // :isDisabled="true"
35
35
  // />
36
- import styled from 'vue-styled-components'
36
+ import styled from 'vue3-styled-components'
37
37
 
38
38
  const ComponentWrapper = styled.div`
39
39
  min-height: 18px;
@@ -48,7 +48,6 @@
48
48
  :fontSize="fontSize"
49
49
  :fontColor="fontColor"
50
50
  :backgroundColor="backgroundColor"
51
- v-on="$listeners"
52
51
  :hasSlot="hasSlot"
53
52
  :hasLabelSlot="hasLabelSlot"
54
53
  :slotSize="slotSize"
@@ -98,7 +97,7 @@
98
97
  // :minNumber="0"
99
98
  // fontColor="blue"
100
99
  // />
101
- import styled from 'vue-styled-components'
100
+ import styled from 'vue3-styled-components'
102
101
  import {
103
102
  stringToNumber,
104
103
  numberToString
@@ -311,8 +310,7 @@ export default {
311
310
  return {
312
311
  textInput: '',
313
312
  isFocused: false,
314
- warningIcon: warningIcon,
315
- isBlurred: false
313
+ warningIcon: warningIcon
316
314
  }
317
315
  },
318
316
  props: {
@@ -489,9 +487,7 @@ export default {
489
487
  return num
490
488
  }
491
489
  })
492
- let evaluated
493
- formatted = this.removeStringItemsAfterLastNumber(formatted)
494
- evaluated = eval(formatted.join(' '))
490
+ let evaluated = eval(formatted.join(''))
495
491
  if (typeof evaluated === 'string') {
496
492
  evaluated = stringToNumber({
497
493
  value: evaluated,
@@ -502,32 +498,7 @@ export default {
502
498
  }
503
499
  return evaluated
504
500
  },
505
- removeStringItemsAfterLastNumber(array) {
506
- // fixed in EPDM-6487, in order to prevent 'Unexpected end of input'
507
- let lastNumberIndex = -1
508
- // Find the index of the last number in the array
509
- for (let i = array.length - 1; i >= 0; i--) {
510
- if (typeof array[i] === 'number') {
511
- lastNumberIndex = i
512
- break
513
- }
514
- }
515
- // if there are no numbers, return an empty array
516
- if (lastNumberIndex === -1) {
517
- return []
518
- }
519
- // Remove non-numeric items after the last number
520
- if (lastNumberIndex !== -1) {
521
- const newArray = array.slice(0, lastNumberIndex + 1)
522
- return newArray
523
- }
524
- return array
525
- },
526
501
  onInput(value) {
527
- if (this.isBlurred) {
528
- this.isBlurred = false
529
- return
530
- }
531
502
  if (value === '') {
532
503
  this.$emit('on-input', '')
533
504
  }
@@ -542,8 +513,6 @@ export default {
542
513
  },
543
514
  onInputBlur(e) {
544
515
  this.isFocused = false
545
- // setting isBlurred so we don't trigger onInput as well
546
- this.isBlurred = true
547
516
  let value = e.target.value
548
517
  let evaluatedInput = this.onEvaluateCode(value)
549
518
  this.onChangeHandler(evaluatedInput ? evaluatedInput : value)
@@ -44,7 +44,7 @@
44
44
  // number_max_allowed: 10,
45
45
  // unit_short_name: "cm",
46
46
  // },
47
- import styled from "vue-styled-components"
47
+ import styled from "vue3-styled-components"
48
48
  import {
49
49
  stringToNumber,
50
50
  numberToString,
@@ -59,7 +59,7 @@
59
59
  </template>
60
60
 
61
61
  <script>
62
- import styled from 'vue-styled-components'
62
+ import styled from 'vue3-styled-components'
63
63
  import InfoText from '../../infoText'
64
64
  import Icon from '../../icon'
65
65
  import ErrorMessage from '../../errorMessage'
@@ -313,8 +313,8 @@ export default {
313
313
  }
314
314
  },
315
315
  methods: {
316
- onChangeHandler($event) {
317
- this.$emit('input-change', $event)
316
+ onChangeHandler(event) {
317
+ this.$emit('input-change', event.target.value)
318
318
  },
319
319
  onInputBlur($event) {
320
320
  this.$emit('input-blur', $event.target.value)
@@ -54,7 +54,7 @@
54
54
  // { label: 'Button 4', value: 'button_4', disabled: true }
55
55
  // ]
56
56
 
57
- import styled from "vue-styled-components"
57
+ import styled from "vue3-styled-components"
58
58
  import Modal from "../../modals/modal"
59
59
  import InfoText from "../../infoText"
60
60
 
@@ -29,7 +29,7 @@
29
29
  // inputWidth="250px"
30
30
  // @on-change="function($event)"
31
31
  // />
32
- import styled from 'vue-styled-components'
32
+ import styled from 'vue3-styled-components'
33
33
 
34
34
  const Container = styled.div`
35
35
  width: 100%;
@@ -14,9 +14,11 @@
14
14
  labelFontColor || colorMode == 'dark' ? 'white' : 'eturnityGrey'
15
15
  "
16
16
  :fontSize="fontSize"
17
- >{{ label }} <optionalLabel v-if="labelOptional"> ({{ $gettext('Optional') }})</optionalLabel>
18
- </input-label
19
- >
17
+ >{{ label }}
18
+ <optionalLabel v-if="labelOptional">
19
+ ({{ $gettext('Optional') }})</optionalLabel
20
+ >
21
+ </input-label>
20
22
  <info-text
21
23
  v-if="infoTextMessage"
22
24
  :text="infoTextMessage"
@@ -129,7 +131,7 @@
129
131
  // </template>
130
132
  // </Select>
131
133
 
132
- import styled from 'vue-styled-components'
134
+ import styled from 'vue3-styled-components'
133
135
  import InfoText from '../../infoText'
134
136
  import icon from '../../icon'
135
137
  import inputText from '../inputText'
@@ -162,7 +164,6 @@ const InputLabel = styled('div', labelAttrs)`
162
164
  `
163
165
  const optionalLabel = styled.span`
164
166
  font-weight: 300;
165
-
166
167
  `
167
168
  const inputProps = { selectWidth: String, optionWidth: String }
168
169
  const Container = styled('div', inputProps)`
@@ -198,8 +199,7 @@ const selectButton = styled('div', selectButtonAttrs)`
198
199
  position: relative;
199
200
  box-sizing: border-box;
200
201
  border-radius: 4px;
201
- padding: ${(props) =>
202
- props.isSearchBarVisible ? '0' : '0px 0px 0 15px'};
202
+ padding: ${(props) => (props.isSearchBarVisible ? '0' : '0px 0px 0 15px')};
203
203
  text-align: left;
204
204
  border-radius: 4px;
205
205
  min-height: 36px;
@@ -427,9 +427,7 @@ export default {
427
427
  const optionElement = this.$el.querySelector(`[data-value="${e}"]`)
428
428
  if (this.$refs.dropdown) {
429
429
  this.hoveredIndex =
430
- this.$refs.dropdown.$children
431
- .map((component) => component.$el)
432
- .indexOf(optionElement) + 1
430
+ [...this.$refs.dropdown.$el.children].indexOf(optionElement) + 1
433
431
  }
434
432
  },
435
433
  mouseEnterHandler() {
@@ -446,15 +444,13 @@ export default {
446
444
  searchChange(value) {
447
445
  this.textSearch = value
448
446
  this.$emit('search-change', value)
449
- this.$refs.dropdown.$children
450
- .map((component) => component.$el)
451
- .forEach((el) => {
452
- if (!el.textContent.toLowerCase().includes(value.toLowerCase())) {
453
- el.style.display = 'none'
454
- } else {
455
- el.style.display = 'inherit'
456
- }
457
- })
447
+ ;[...this.$refs.dropdown.$el.children].forEach((el) => {
448
+ if (!el.textContent.toLowerCase().includes(value.toLowerCase())) {
449
+ el.style.display = 'none'
450
+ } else {
451
+ el.style.display = 'inherit'
452
+ }
453
+ })
458
454
  },
459
455
  onSelectSlotClick() {
460
456
  this.toggleDropdown()
@@ -476,10 +472,9 @@ export default {
476
472
  } else if (e.key == 'ArrowUp') {
477
473
  this.onArrowPress(-1)
478
474
  } else if (e.key == 'Enter') {
479
- const optionHoveredComponent =
480
- this.$refs.dropdown.$children[
481
- (this.hoveredIndex - 1 + this.optionLength) % this.optionLength
482
- ]
475
+ const optionHoveredComponent = [...this.$refs.dropdown.$el.children][
476
+ (this.hoveredIndex - 1 + this.optionLength) % this.optionLength
477
+ ]
483
478
  this.optionSelected(optionHoveredComponent.$el.dataset.value)
484
479
  }
485
480
  },
@@ -488,10 +483,9 @@ export default {
488
483
  ((this.hoveredIndex + dir + this.optionLength - 1) %
489
484
  this.optionLength) +
490
485
  1
491
- const optionHoveredComponent =
492
- this.$refs.dropdown.$children[
493
- (this.hoveredIndex - 1 + this.optionLength) % this.optionLength
494
- ]
486
+ const optionHoveredComponent = [...this.$refs.dropdown.$el.children][
487
+ (this.hoveredIndex - 1 + this.optionLength) % this.optionLength
488
+ ]
495
489
  const topPos = optionHoveredComponent.$el.offsetTop
496
490
  this.$refs.dropdown.$el.scrollTop = topPos
497
491
  }
@@ -499,7 +493,7 @@ export default {
499
493
  computed: {
500
494
  optionLength() {
501
495
  if (this.isDropdownOpen) {
502
- return this.$refs.dropdown.$children.length
496
+ return this.$refs.dropdown.$el.childElementCount
503
497
  } else {
504
498
  return 0
505
499
  }
@@ -7,7 +7,7 @@
7
7
  <script>
8
8
  // import selectButton from './selectButton'
9
9
  // import selectDropdown from './selectDropDown'
10
- import styled from 'vue-styled-components'
10
+ import styled from 'vue3-styled-components'
11
11
  const optionProps={hoveredBgColor:String}
12
12
  const optionContainer = styled('div',optionProps)`
13
13
  display:flex;
@@ -22,7 +22,7 @@
22
22
  // :maxValue="500" //default is 100 if not specified
23
23
  // />
24
24
  import Slider from "@vueform/slider/dist/slider.vue2.js"
25
- import styled from "vue-styled-components"
25
+ import styled from "vue3-styled-components"
26
26
 
27
27
  const Container = styled.div`
28
28
  margin: 16px 0 16px 21px;
@@ -73,7 +73,7 @@
73
73
  // :disabled="false"
74
74
  // />
75
75
 
76
- import styled from 'vue-styled-components'
76
+ import styled from 'vue3-styled-components'
77
77
  import InfoText from '../../infoText'
78
78
  import theme from '../../../assets/theme'
79
79
  const Container = styled.div``
@@ -51,7 +51,7 @@
51
51
  // :isDisabled="true"
52
52
  // . fontSize="13px"
53
53
  // />
54
- import styled from 'vue-styled-components'
54
+ import styled from 'vue3-styled-components'
55
55
  import InfoText from '../../infoText'
56
56
  import ErrorMessage from '../../errorMessage'
57
57
 
@@ -71,7 +71,7 @@
71
71
  // infoTextMessage="My info message"
72
72
  // />
73
73
 
74
- import styled from "vue-styled-components"
74
+ import styled from "vue3-styled-components"
75
75
  import InfoText from "../../infoText"
76
76
 
77
77
  const Container = styled.div`
@@ -28,7 +28,7 @@
28
28
  // <div>Data....</div>
29
29
  // </modal>
30
30
 
31
- import styled from 'vue-styled-components'
31
+ import styled from 'vue3-styled-components'
32
32
  import CloseButton from '../../buttons/closeButton'
33
33
  import Spinner from '../../spinner'
34
34
 
@@ -21,7 +21,7 @@
21
21
  // color="red"
22
22
  // infoText="My info text"
23
23
  // />
24
- import styled from "vue-styled-components"
24
+ import styled from "vue3-styled-components"
25
25
  import InfoText from "../infoText"
26
26
 
27
27
  const textAttrs = { color: String, hasInfoText: Boolean, marginBottom: String }
@@ -9,7 +9,7 @@
9
9
  // text="My Page Title"
10
10
  // color="red"
11
11
  // />
12
- import styled from "vue-styled-components"
12
+ import styled from "vue3-styled-components"
13
13
 
14
14
  const textAttrs = { color: String, fontSize: String, uppercase: Boolean }
15
15
  const TitleText = styled("div", textAttrs)`
@@ -11,17 +11,17 @@
11
11
  </arrowIconContainer>
12
12
  <arrowText>{{ $gettext('back') }}</arrowText>
13
13
  </paginationLink>
14
-
14
+
15
15
  <!-- First page -->
16
16
  <paginationLink
17
17
  v-if="currentPage > 2 && paginationParams.pages > 3"
18
18
  @click="fetchPage(1)"
19
19
  >1</paginationLink
20
20
  >
21
-
21
+
22
22
  <!-- Back tree dots -->
23
23
  <span v-if="currentPage > 3 && paginationParams.pages > 4">...</span>
24
-
24
+
25
25
  <!-- Current block -->
26
26
  <paginationLink
27
27
  v-for="number in paginationNumbers()"
@@ -30,7 +30,7 @@
30
30
  @click="fetchPage(number)"
31
31
  >{{ number }}</paginationLink
32
32
  >
33
-
33
+
34
34
  <!-- Forward tree dots -->
35
35
  <span
36
36
  v-if="
@@ -38,7 +38,7 @@
38
38
  "
39
39
  >...</span
40
40
  >
41
-
41
+
42
42
  <!-- End page -->
43
43
  <paginationLink
44
44
  v-if="
@@ -47,7 +47,7 @@
47
47
  @click="fetchPage(paginationParams.pages)"
48
48
  >{{ paginationParams.pages }}</paginationLink
49
49
  >
50
-
50
+
51
51
  <!-- Forward button -->
52
52
  <paginationLink
53
53
  v-if="paginationParams.next"
@@ -60,11 +60,12 @@
60
60
  </paginationLink>
61
61
  </paginationWrapper>
62
62
  </template>
63
-
64
- <script>
65
- import styled from "vue-styled-components"
66
- import icon from "../icon"
67
- const paginationWrapper=styled.nav`
63
+
64
+ <script>
65
+ import styled from "vue3-styled-components"
66
+ import icon from "../icon"
67
+
68
+ const paginationWrapper=styled.nav`
68
69
  color: #1a237e;
69
70
  font-size: 13px;
70
71
  display: -webkit-box;
@@ -134,4 +135,3 @@ import styled from "vue-styled-components"
134
135
  }
135
136
  }
136
137
  </script>
137
-
@@ -31,7 +31,7 @@
31
31
  // stepNumber="4"
32
32
  // :labelText="translate('step')"
33
33
  // />
34
- import styled from "vue-styled-components"
34
+ import styled from "vue3-styled-components"
35
35
 
36
36
  const Container = styled.div`
37
37
  display: grid;
@@ -88,7 +88,7 @@
88
88
  // @deleteHandler="onMarkerDelete($event)"
89
89
  // />
90
90
 
91
- import styled from "vue-styled-components"
91
+ import styled from "vue3-styled-components"
92
92
  import Icon from "../icon"
93
93
  import Modal from '../modals/modal'
94
94
  import PageTitle from '../pageTitle'
@@ -18,7 +18,7 @@
18
18
  <script>
19
19
  // import Spinner from "@eturnity/eturnity_reusable_components/src/components/spinner"
20
20
  // <spinner size="30px" />
21
- import styled from 'vue-styled-components'
21
+ import styled from 'vue3-styled-components'
22
22
 
23
23
  const SpinnerContainer = styled.div`
24
24
  position: fixed;
@@ -186,10 +186,10 @@
186
186
  // :optionsDisplay="['display_name', 'company_item_number']" // Array. what should be displayed
187
187
  // :disabled="true"
188
188
  // />
189
- import styled from 'vue-styled-components'
190
- import Spinner from '@eturnity/eturnity_reusable_components/src/components/spinner'
191
- import SearchInput from '@eturnity/eturnity_reusable_components/src/components/inputs/searchInput'
192
- import InputText from '@eturnity/eturnity_reusable_components/src/components/inputs/inputText'
189
+ import styled from 'vue3-styled-components'
190
+ import Spinner from '@/components/spinner'
191
+ import SearchInput from '@/components/inputs/searchInput'
192
+ import InputText from '@/components/inputs/inputText'
193
193
 
194
194
  const rowAttrs = { disabled: Boolean, isOpen: Boolean }
195
195
  const DropdownRow = styled('div', rowAttrs)`
@@ -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"
@@ -23,7 +23,7 @@
23
23
  <script>
24
24
  // ToDo: add this to storybook
25
25
  // import MainTable from "@eturnity/eturnity_reusable_components/src/components/tables/mainTable"
26
- import styled from 'vue-styled-components'
26
+ import styled from 'vue3-styled-components'
27
27
  import Spinner from '../../spinner'
28
28
 
29
29
  const PageContainer = styled.div``
@@ -45,9 +45,9 @@
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'
49
- import DeleteIcon from '../../deleteIcon'
50
- import Spinner from '../../spinner'
48
+ import styled from "vue3-styled-components"
49
+ import DeleteIcon from "../../deleteIcon"
50
+ import Spinner from "../../spinner"
51
51
 
52
52
  const TableScroll = styled.div`
53
53
  position: relative;
@@ -121,7 +121,7 @@
121
121
  // },
122
122
  // ],
123
123
 
124
- import styled from 'vue-styled-components'
124
+ import styled from 'vue3-styled-components'
125
125
  import Spinner from '../spinner'
126
126
 
127
127
  const PageContainer = styled.div`
@@ -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,8 @@
1
- import Vue from "vue"
2
1
  import App from "./App.vue"
3
- import VueCompositionAPI from "@vue/composition-api"
4
- import vClickOutside from 'v-click-outside'
5
2
 
6
- Vue.config.productionTip = false
3
+ import { createApp } from 'vue'
7
4
 
8
- Vue.use(VueCompositionAPI)
9
- Vue.use(vClickOutside)
5
+ const app = createApp(App)
6
+
7
+ app.mount('#app')
10
8
 
11
- new Vue({
12
- render: (h) => h(App),
13
- }).$mount("#app")