@eturnity/eturnity_reusable_components 7.24.3-EPDM-11250.0 → 7.24.3-EPDM-11320.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 (68) hide show
  1. package/.eslintrc.js +125 -0
  2. package/package.json +6 -20
  3. package/src/App.vue +75 -70
  4. package/src/components/addNewButton/index.vue +24 -27
  5. package/src/components/banner/actionBanner/index.vue +32 -30
  6. package/src/components/banner/banner/index.vue +88 -80
  7. package/src/components/banner/infoBanner/index.vue +36 -44
  8. package/src/components/buttons/buttonIcon/index.vue +83 -78
  9. package/src/components/buttons/closeButton/index.vue +26 -26
  10. package/src/components/buttons/mainButton/index.vue +80 -76
  11. package/src/components/card/index.vue +56 -52
  12. package/src/components/collapsableInfoText/index.vue +81 -76
  13. package/src/components/deleteIcon/index.vue +31 -28
  14. package/src/components/draggableInputHandle/index.vue +20 -17
  15. package/src/components/dropdown/Dropdown.stories.js +8 -8
  16. package/src/components/dropdown/index.vue +75 -72
  17. package/src/components/errorMessage/index.vue +23 -23
  18. package/src/components/filter/filterSettings.vue +349 -329
  19. package/src/components/filter/index.vue +130 -130
  20. package/src/components/filter/parentDropdown.vue +43 -40
  21. package/src/components/icon/Icons.stories.js +4 -4
  22. package/src/components/icon/iconCache.js +1 -1
  23. package/src/components/icon/iconCollection.vue +40 -37
  24. package/src/components/icon/index.vue +72 -65
  25. package/src/components/iconWrapper/index.vue +122 -118
  26. package/src/components/infoCard/index.vue +20 -17
  27. package/src/components/infoText/index.vue +88 -82
  28. package/src/components/inputs/checkbox/index.vue +91 -94
  29. package/src/components/inputs/inputNumber/index.vue +508 -488
  30. package/src/components/inputs/inputNumberQuestion/index.vue +127 -124
  31. package/src/components/inputs/inputText/index.vue +265 -252
  32. package/src/components/inputs/radioButton/index.vue +135 -120
  33. package/src/components/inputs/searchInput/index.vue +84 -81
  34. package/src/components/inputs/select/index.vue +644 -631
  35. package/src/components/inputs/select/option/index.vue +91 -91
  36. package/src/components/inputs/select/select.stories.js +7 -7
  37. package/src/components/inputs/slider/index.vue +46 -46
  38. package/src/components/inputs/switchField/index.vue +159 -152
  39. package/src/components/inputs/textAreaInput/index.vue +120 -113
  40. package/src/components/inputs/toggle/index.vue +137 -127
  41. package/src/components/label/index.vue +64 -61
  42. package/src/components/markerItem/index.vue +40 -40
  43. package/src/components/modals/actionModal/index.vue +32 -29
  44. package/src/components/modals/infoModal/index.vue +34 -27
  45. package/src/components/modals/modal/index.vue +88 -80
  46. package/src/components/navigationTabs/index.vue +50 -47
  47. package/src/components/pageSubtitle/index.vue +33 -29
  48. package/src/components/pageTitle/index.vue +47 -39
  49. package/src/components/pagination/index.vue +64 -62
  50. package/src/components/progressBar/index.vue +70 -67
  51. package/src/components/projectMarker/index.vue +172 -163
  52. package/src/components/rangeSlider/Slider.vue +449 -449
  53. package/src/components/rangeSlider/index.vue +282 -270
  54. package/src/components/rangeSlider/utils/dom.js +3 -3
  55. package/src/components/selectedOptions/index.vue +51 -51
  56. package/src/components/sideMenu/index.vue +117 -109
  57. package/src/components/spinner/index.vue +37 -34
  58. package/src/components/tableDropdown/index.vue +343 -326
  59. package/src/components/tables/mainTable/index.vue +109 -106
  60. package/src/components/tables/viewTable/index.vue +105 -92
  61. package/src/components/threeDots/index.vue +174 -171
  62. package/src/components/videoThumbnail/index.vue +67 -59
  63. package/src/components/videoThumbnail/videoThumbnail.stories.js +6 -6
  64. package/src/helpers/numberConverter.js +1 -3
  65. package/src/helpers/translateLang.js +10 -13
  66. package/.prettierrc +0 -7
  67. package/public/favicon.ico +0 -0
  68. package/public/index.html +0 -17
@@ -1,29 +1,29 @@
1
1
  <template>
2
- <page-container
3
- @click="toggleButton()"
2
+ <PageContainer
4
3
  ref="pageContainer"
5
4
  :activated="isOpen"
5
+ @click="toggleButton()"
6
6
  >
7
- <button-container ref="dropdownItem">
8
- <dot-item />
9
- <dot-item />
10
- <dot-item />
11
- </button-container>
12
- <dropdown-container
13
- @click.stop
14
- :containerWidth="childOpen ? 440 : 240"
7
+ <ButtonContainer ref="dropdownItem">
8
+ <DotItem />
9
+ <DotItem />
10
+ <DotItem />
11
+ </ButtonContainer>
12
+ <DropdownContainer
15
13
  ref="dropdownContainer"
14
+ :container-width="childOpen ? 440 : 240"
15
+ @click.stop
16
16
  >
17
17
  <template v-if="isOpen">
18
- <loading-container v-if="isLoading">
19
- <spinner />
20
- </loading-container>
21
- <children-container
22
- class="child"
23
- :isOpen="hoverItem !== null"
18
+ <LoadingContainer v-if="isLoading">
19
+ <Spinner />
20
+ </LoadingContainer>
21
+ <ChildrenContainer
24
22
  v-if="hoverItem !== null && !isLoading"
23
+ class="child"
24
+ :is-open="hoverItem !== null"
25
25
  >
26
- <option-child
26
+ <OptionChild
27
27
  v-for="child in childOpen"
28
28
  :key="child.value"
29
29
  @click.stop="
@@ -40,14 +40,19 @@
40
40
  "
41
41
  >
42
42
  {{ child.name }}
43
- </option-child>
44
- </children-container>
45
- <options-container v-if="!isLoading" :textWrap="textWrap">
46
- <option-item
43
+ </OptionChild>
44
+ </ChildrenContainer>
45
+ <OptionsContainer
46
+ v-if="!isLoading"
47
+ :text-wrap="textWrap"
48
+ >
49
+ <OptionItem
47
50
  v-for="(item, index) in options"
48
51
  :key="item.value"
49
52
  :data-id="item.dataId"
53
+ :is-disabled="item.disabled"
50
54
  tabindex="0"
55
+ :title="item.title"
51
56
  @click.stop="
52
57
  onSelect({ item: item, hasChildren: hasChildren(item) })
53
58
  "
@@ -55,21 +60,19 @@
55
60
  onSelect({ item: item, hasChildren: hasChildren(item) })
56
61
  "
57
62
  @mouseover="onItemHover({ index, item })"
58
- :isDisabled="item.disabled"
59
- :title="item.title"
60
63
  >
61
- <arrow-left
62
- :hasChildren="hasChildren(item)"
64
+ <ArrowLeft
63
65
  v-if="hasChildren(item)"
66
+ :has-children="hasChildren(item)"
64
67
  />
65
68
  <span>
66
69
  {{ item.name }}
67
70
  </span>
68
- </option-item>
69
- </options-container>
71
+ </OptionItem>
72
+ </OptionsContainer>
70
73
  </template>
71
- </dropdown-container>
72
- </page-container>
74
+ </DropdownContainer>
75
+ </PageContainer>
73
76
  </template>
74
77
 
75
78
  <script>
@@ -129,13 +132,13 @@
129
132
  // },
130
133
  // ],
131
134
 
132
- import styled from 'vue3-styled-components'
133
- import Spinner from '../spinner'
135
+ import styled from 'vue3-styled-components'
136
+ import Spinner from '../spinner'
134
137
 
135
- const PageContainerAttrs = {
136
- activated: Boolean
137
- }
138
- const PageContainer = styled('div', PageContainerAttrs)`
138
+ const PageContainerAttrs = {
139
+ activated: Boolean
140
+ }
141
+ const PageContainer = styled('div', PageContainerAttrs)`
139
142
  display: grid;
140
143
  align-items: center;
141
144
  justify-items: center;
@@ -143,14 +146,14 @@ const PageContainer = styled('div', PageContainerAttrs)`
143
146
  height: 30px;
144
147
  border-radius: 4px;
145
148
  background-color: ${(props) =>
146
- props.activated ? props.theme.colors.grey5 : ''};
149
+ props.activated ? props.theme.colors.grey5 : ''};
147
150
 
148
151
  &:hover {
149
152
  background-color: ${(props) => props.theme.colors.grey5};
150
153
  }
151
154
  `
152
155
 
153
- const ButtonContainer = styled.div`
156
+ const ButtonContainer = styled.div`
154
157
  display: flex;
155
158
  flex-direction: column;
156
159
  align-items: center;
@@ -164,24 +167,24 @@ const ButtonContainer = styled.div`
164
167
  }
165
168
  `
166
169
 
167
- const DotItem = styled.div`
170
+ const DotItem = styled.div`
168
171
  width: 4px;
169
172
  height: 4px;
170
173
  margin: 1px;
171
174
  border-radius: 50%;
172
175
  `
173
176
 
174
- const dropdownAttrs = {
175
- containerWidth: Number
176
- }
177
- const DropdownContainer = styled('div', dropdownAttrs)`
177
+ const dropdownAttrs = {
178
+ containerWidth: Number
179
+ }
180
+ const DropdownContainer = styled('div', dropdownAttrs)`
178
181
  z-index: 99;
179
182
  position: absolute;
180
183
  display: grid;
181
184
  grid-template-columns: auto auto;
182
185
  `
183
186
 
184
- const LoadingContainer = styled.div`
187
+ const LoadingContainer = styled.div`
185
188
  border: 1px solid ${(props) => props.theme.colors.grey3};
186
189
  display: grid;
187
190
  grid-template-columns: 1fr;
@@ -192,8 +195,8 @@ const LoadingContainer = styled.div`
192
195
  background: #fff;
193
196
  `
194
197
 
195
- const OptionsContainerAttrs = { textWrap: Boolean }
196
- const OptionsContainer = styled('div', OptionsContainerAttrs)`
198
+ const OptionsContainerAttrs = { textWrap: Boolean }
199
+ const OptionsContainer = styled('div', OptionsContainerAttrs)`
197
200
  border: 1px solid ${(props) => props.theme.colors.grey3};
198
201
  display: grid;
199
202
  grid-template-columns: 1fr;
@@ -206,8 +209,8 @@ const OptionsContainer = styled('div', OptionsContainerAttrs)`
206
209
  ${(props) => props.textWrap ? 'white-space: normal' : 'white-space: nowrap'};
207
210
  `
208
211
 
209
- const optionAttrs = { isDisabled: Boolean }
210
- const OptionItem = styled('div', optionAttrs)`
212
+ const optionAttrs = { isDisabled: Boolean }
213
+ const OptionItem = styled('div', optionAttrs)`
211
214
  padding: 12px;
212
215
  cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
213
216
  font-size: 13px;
@@ -224,7 +227,7 @@ const OptionItem = styled('div', optionAttrs)`
224
227
  background-color: #ebeef4;
225
228
  }
226
229
  `
227
- const OptionChild = styled.div`
230
+ const OptionChild = styled.div`
228
231
  padding: 12px;
229
232
  cursor: pointer;
230
233
  font-size: 13px;
@@ -240,8 +243,8 @@ const OptionChild = styled.div`
240
243
  }
241
244
  `
242
245
 
243
- const arrowAttrs = { hasChildren: Boolean }
244
- const ArrowLeft = styled('span', arrowAttrs)`
246
+ const arrowAttrs = { hasChildren: Boolean }
247
+ const ArrowLeft = styled('span', arrowAttrs)`
245
248
  border: solid #9f9f9f;
246
249
  border-width: 0 1.5px 1.5px 0;
247
250
  display: inline-block;
@@ -252,10 +255,10 @@ const ArrowLeft = styled('span', arrowAttrs)`
252
255
  visibility: ${(props) => (props.hasChildren ? 'visible' : 'hidden')};
253
256
  `
254
257
 
255
- const childAttrs = { isOpen: Boolean }
256
- const ChildrenContainer = styled('div', childAttrs)`
258
+ const childAttrs = { isOpen: Boolean }
259
+ const ChildrenContainer = styled('div', childAttrs)`
257
260
  border: ${(props) =>
258
- props.isOpen ? '1px solid' + props.theme.colors.grey3 : 'none'};
261
+ props.isOpen ? '1px solid' + props.theme.colors.grey3 : 'none'};
259
262
  display: grid;
260
263
  grid-template-columns: 1fr;
261
264
  min-width: 200px;
@@ -273,135 +276,135 @@ const ChildrenContainer = styled('div', childAttrs)`
273
276
  right: 100%;
274
277
  `
275
278
 
276
- export default {
277
- name: 'three-dots',
278
- components: {
279
- PageContainer,
280
- ButtonContainer,
281
- DotItem,
282
- OptionsContainer,
283
- OptionItem,
284
- ChildrenContainer,
285
- OptionChild,
286
- ArrowLeft,
287
- DropdownContainer,
288
- Spinner,
289
- LoadingContainer
290
- },
291
- props: {
292
- options: {
293
- required: true
279
+ export default {
280
+ name: 'ThreeDots',
281
+ components: {
282
+ PageContainer,
283
+ ButtonContainer,
284
+ DotItem,
285
+ OptionsContainer,
286
+ OptionItem,
287
+ ChildrenContainer,
288
+ OptionChild,
289
+ ArrowLeft,
290
+ DropdownContainer,
291
+ Spinner,
292
+ LoadingContainer
294
293
  },
295
- isLoading: {
296
- required: false,
297
- default: false
298
- },
299
- textWrap: {
300
- required: false,
301
- default: true
302
- }
303
- },
304
- data() {
305
- return {
306
- isOpen: false,
307
- hoverItem: null,
308
- childOpen: null,
309
- containerWidth: 16
310
- }
311
- },
312
- methods: {
313
- toggleButton() {
314
- this.isOpen = !this.isOpen
315
-
316
- if (this.isOpen) {
317
- this.setContextMenuPosition()
318
- window.addEventListener('resize', this.toggleButton)
319
- document.addEventListener('click', this.clickOutside)
320
- } else {
321
- window.removeEventListener('resize', this.toggleButton)
322
- document.removeEventListener('click', this.clickOutside)
294
+ props: {
295
+ options: {
296
+ required: true
297
+ },
298
+ isLoading: {
299
+ required: false,
300
+ default: false
301
+ },
302
+ textWrap: {
303
+ required: false,
304
+ default: true
323
305
  }
324
306
  },
325
- setContextMenuPosition() {
326
- const contextMenu = this.$refs.dropdownContainer.$el
327
- const button = this.$refs.pageContainer.$el
328
- const rectButton = button.getBoundingClientRect()
329
- const relativeParent = this.findRelativeParent(contextMenu)
330
- const rectRelativeParent = relativeParent.getBoundingClientRect()
331
-
332
- const positionArray = this.determineElementQuarter(button, rectButton)
333
- contextMenu.style.transform = ''
334
- if (positionArray.includes('left')) {
335
- contextMenu.style.left =
336
- rectButton.right - rectRelativeParent.left + 5 + 'px'
337
- } else {
338
- contextMenu.style.left =
339
- rectButton.left - rectRelativeParent.left - 5 + 'px'
340
- contextMenu.style.transform = 'translateX(-100%)'
341
- }
342
- if (positionArray.includes('top')) {
343
- contextMenu.style.top = rectButton.top - rectRelativeParent.top + 'px'
344
- } else {
345
- contextMenu.style.top =
346
- rectButton.bottom - rectRelativeParent.top + 'px'
347
- contextMenu.style.transform += ' translateY(-100%)'
307
+ data() {
308
+ return {
309
+ isOpen: false,
310
+ hoverItem: null,
311
+ childOpen: null,
312
+ containerWidth: 16
348
313
  }
349
314
  },
350
- findRelativeParent(element) {
351
- while (element.parentElement) {
352
- if (
353
- window.getComputedStyle(element.parentElement).position ===
315
+ methods: {
316
+ toggleButton() {
317
+ this.isOpen = !this.isOpen
318
+
319
+ if (this.isOpen) {
320
+ this.setContextMenuPosition()
321
+ window.addEventListener('resize', this.toggleButton)
322
+ document.addEventListener('click', this.clickOutside)
323
+ } else {
324
+ window.removeEventListener('resize', this.toggleButton)
325
+ document.removeEventListener('click', this.clickOutside)
326
+ }
327
+ },
328
+ setContextMenuPosition() {
329
+ const contextMenu = this.$refs.dropdownContainer.$el
330
+ const button = this.$refs.pageContainer.$el
331
+ const rectButton = button.getBoundingClientRect()
332
+ const relativeParent = this.findRelativeParent(contextMenu)
333
+ const rectRelativeParent = relativeParent.getBoundingClientRect()
334
+
335
+ const positionArray = this.determineElementQuarter(button, rectButton)
336
+ contextMenu.style.transform = ''
337
+ if (positionArray.includes('left')) {
338
+ contextMenu.style.left =
339
+ rectButton.right - rectRelativeParent.left + 5 + 'px'
340
+ } else {
341
+ contextMenu.style.left =
342
+ rectButton.left - rectRelativeParent.left - 5 + 'px'
343
+ contextMenu.style.transform = 'translateX(-100%)'
344
+ }
345
+ if (positionArray.includes('top')) {
346
+ contextMenu.style.top = rectButton.top - rectRelativeParent.top + 'px'
347
+ } else {
348
+ contextMenu.style.top =
349
+ rectButton.bottom - rectRelativeParent.top + 'px'
350
+ contextMenu.style.transform += ' translateY(-100%)'
351
+ }
352
+ },
353
+ findRelativeParent(element) {
354
+ while (element.parentElement) {
355
+ if (
356
+ window.getComputedStyle(element.parentElement).position ===
354
357
  'relative' ||
355
- window.getComputedStyle(element.parentElement).position === 'absolute'
356
- ) {
357
- return element.parentElement
358
+ window.getComputedStyle(element.parentElement).position === 'absolute'
359
+ ) {
360
+ return element.parentElement
361
+ }
362
+ element = element.parentElement
358
363
  }
359
- element = element.parentElement
360
- }
361
- return null
362
- },
363
- determineElementQuarter(element, rect) {
364
- const viewportWidth = window.innerWidth
365
- const viewportHeight = window.innerHeight
364
+ return null
365
+ },
366
+ determineElementQuarter(element, rect) {
367
+ const viewportWidth = window.innerWidth
368
+ const viewportHeight = window.innerHeight
366
369
 
367
- const horizontalMidpoint = viewportWidth / 2
368
- const verticalMidpoint = viewportHeight / 2
370
+ const horizontalMidpoint = viewportWidth / 2
371
+ const verticalMidpoint = viewportHeight / 2
369
372
 
370
- const isLeft = rect.left + rect.width / 2 < horizontalMidpoint
371
- const isTop = rect.top + rect.height / 2 < verticalMidpoint
373
+ const isLeft = rect.left + rect.width / 2 < horizontalMidpoint
374
+ const isTop = rect.top + rect.height / 2 < verticalMidpoint
372
375
 
373
- if (isLeft && isTop) {
374
- return ['left', 'top']
375
- } else if (isLeft && !isTop) {
376
- return ['left', 'bottom']
377
- } else if (!isLeft && isTop) {
378
- return ['right', 'top']
379
- } else {
380
- return ['right', 'bottom']
381
- }
382
- },
383
- hasChildren(item) {
384
- return !!item.children && !!item.children.length
385
- },
386
- onItemHover({ index, item }) {
387
- this.hoverItem = item.children && item.children.length ? index : null
388
- this.childOpen =
389
- item.children && item.children.length ? item.children : null
390
- },
391
- onSelect({ item, hasChildren }) {
392
- if (hasChildren || item.disabled) {
393
- this.$emit('on-click', item)
394
- return
395
- }
396
- this.$emit('on-select', item)
397
- this.isOpen = false
398
- },
399
- clickOutside(event) {
400
- if (this.$el.contains(event.target) || !this.isOpen) {
401
- return
376
+ if (isLeft && isTop) {
377
+ return ['left', 'top']
378
+ } else if (isLeft && !isTop) {
379
+ return ['left', 'bottom']
380
+ } else if (!isLeft && isTop) {
381
+ return ['right', 'top']
382
+ } else {
383
+ return ['right', 'bottom']
384
+ }
385
+ },
386
+ hasChildren(item) {
387
+ return !!item.children && !!item.children.length
388
+ },
389
+ onItemHover({ index, item }) {
390
+ this.hoverItem = item.children && item.children.length ? index : null
391
+ this.childOpen =
392
+ item.children && item.children.length ? item.children : null
393
+ },
394
+ onSelect({ item, hasChildren }) {
395
+ if (hasChildren || item.disabled) {
396
+ this.$emit('on-click', item)
397
+ return
398
+ }
399
+ this.$emit('on-select', item)
400
+ this.isOpen = false
401
+ },
402
+ clickOutside(event) {
403
+ if (this.$el.contains(event.target) || !this.isOpen) {
404
+ return
405
+ }
406
+ this.toggleButton()
402
407
  }
403
- this.toggleButton()
404
408
  }
405
409
  }
406
- }
407
410
  </script>
@@ -1,10 +1,18 @@
1
1
  <template>
2
- <wrapper :width="width" :height="height" :fit="fit">
2
+ <Wrapper
3
+ :fit="fit"
4
+ :height="height"
5
+ :width="width"
6
+ >
3
7
  <img :src="src" />
4
- <iconWrapper>
5
- <icon name="play" :size="playIconSize" :color="playIconColor" />
6
- </iconWrapper>
7
- </wrapper>
8
+ <IconWrapper>
9
+ <Icon
10
+ :color="playIconColor"
11
+ name="play"
12
+ :size="playIconSize"
13
+ />
14
+ </IconWrapper>
15
+ </Wrapper>
8
16
  </template>
9
17
 
10
18
  <script>
@@ -17,11 +25,11 @@
17
25
  // height="600px"
18
26
  // />
19
27
 
20
- import styled from 'vue3-styled-components'
21
- import Icon from '../icon'
28
+ import styled from 'vue3-styled-components'
29
+ import Icon from '../icon'
22
30
 
23
- const wrapperAttrs = { width: String, height: String, fit: String }
24
- const Wrapper = styled('div', wrapperAttrs)`
31
+ const wrapperAttrs = { width: String, height: String, fit: String }
32
+ const Wrapper = styled('div', wrapperAttrs)`
25
33
  display: inline-block;
26
34
  position: relative;
27
35
  width: ${(props) => props.width};
@@ -32,7 +40,7 @@ const Wrapper = styled('div', wrapperAttrs)`
32
40
  height: ${(props) => props.height};
33
41
  }
34
42
  `
35
- const iconWrapper = styled('div')`
43
+ const IconWrapper = styled('div')`
36
44
  position: absolute;
37
45
  top: 0;
38
46
  bottom: 0;
@@ -43,61 +51,61 @@ const iconWrapper = styled('div')`
43
51
  align-items: center;
44
52
  `
45
53
 
46
- export default {
47
- name: 'VideoThumbnail',
48
- components: {
49
- Wrapper,
50
- Icon,
51
- iconWrapper
52
- },
53
- props: {
54
- src: {
55
- required: true
54
+ export default {
55
+ name: 'VideoThumbnail',
56
+ components: {
57
+ Wrapper,
58
+ Icon,
59
+ IconWrapper
56
60
  },
57
- fit: {
58
- required: false,
59
- default: 'cover'
61
+ props: {
62
+ src: {
63
+ required: true
64
+ },
65
+ fit: {
66
+ required: false,
67
+ default: 'cover'
68
+ },
69
+ width: {
70
+ required: false,
71
+ default: '300px'
72
+ },
73
+ height: {
74
+ required: false,
75
+ default: '200px'
76
+ },
77
+ playIconSize: {
78
+ required: false,
79
+ default: '50px'
80
+ },
81
+ playIconColor: {
82
+ required: false,
83
+ default: 'blue'
84
+ }
60
85
  },
61
- width: {
62
- required: false,
63
- default: '300px'
86
+ data() {
87
+ return {
88
+ isOpenByClick: false
89
+ }
64
90
  },
65
- height: {
66
- required: false,
67
- default: '200px'
91
+ mounted() {
92
+ document.addEventListener('click', this.clickOutside)
68
93
  },
69
- playIconSize: {
70
- required: false,
71
- default: '50px'
94
+ beforeDestroy() {
95
+ document.removeEventListener('click', this.clickOutside)
72
96
  },
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
97
+ methods: {
98
+ clickOutside(event) {
99
+ if (this.openingMode != 'click') return
100
+ if (
101
+ this.$refs.dropdown.$el == event.target ||
102
+ this.$refs.dropdown.$el.contains(event.target)
103
+ ) {
104
+ return
105
+ } else {
106
+ this.isOpenByClick = false
107
+ }
93
108
  }
94
109
  }
95
- },
96
- mounted() {
97
- document.addEventListener('click', this.clickOutside)
98
- },
99
- beforeDestroy() {
100
- document.removeEventListener('click', this.clickOutside)
101
110
  }
102
- }
103
111
  </script>
@@ -24,12 +24,12 @@ const Template = (args, { argTypes }) => ({
24
24
 
25
25
  export const Default = Template.bind({})
26
26
  Default.args = {
27
- src:"https://musicart.xboxlive.com/6/cfaf1e9d-0000-0000-0000-000000000009/504/image.jpg?w=1920&h=1080",
28
- playIconSize:"50px",
29
- playIconColor:"red",
30
- width:"400px",
31
- height:"300px",
32
- fit:"cover"
27
+ src: "https://musicart.xboxlive.com/6/cfaf1e9d-0000-0000-0000-000000000009/504/image.jpg?w=1920&h=1080",
28
+ playIconSize: "50px",
29
+ playIconColor: "red",
30
+ width: "400px",
31
+ height: "300px",
32
+ fit: "cover"
33
33
  }
34
34
 
35
35
 
@@ -7,9 +7,7 @@ export const stringToNumber = ({
7
7
  }) => {
8
8
  // This is for saving. It converts our input string to a readable number
9
9
  let newVal = value.toString()
10
- const selectedLang = sessionStorage.getItem('lang')
11
- ? sessionStorage.getItem('lang')
12
- : localStorage.getItem('lang')
10
+ const selectedLang = localStorage.getItem('lang')
13
11
  // The first replace will replace not allowed characters with a blank
14
12
  if (
15
13
  selectedLang === 'de-DE' ||