@eturnity/eturnity_reusable_components 7.24.3-EPDM-11320.0 → 7.24.3-EPDM-11143.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 (67) hide show
  1. package/.prettierrc +7 -0
  2. package/package.json +20 -6
  3. package/public/favicon.ico +0 -0
  4. package/public/index.html +17 -0
  5. package/src/App.vue +70 -75
  6. package/src/assets/svgIcons/copy.svg +10 -0
  7. package/src/components/addNewButton/index.vue +27 -24
  8. package/src/components/banner/actionBanner/index.vue +30 -32
  9. package/src/components/banner/banner/index.vue +80 -88
  10. package/src/components/banner/infoBanner/index.vue +44 -36
  11. package/src/components/buttons/buttonIcon/index.vue +78 -83
  12. package/src/components/buttons/closeButton/index.vue +26 -26
  13. package/src/components/buttons/mainButton/index.vue +76 -80
  14. package/src/components/card/index.vue +52 -56
  15. package/src/components/collapsableInfoText/index.vue +76 -81
  16. package/src/components/deleteIcon/index.vue +28 -31
  17. package/src/components/draggableInputHandle/index.vue +17 -20
  18. package/src/components/dropdown/Dropdown.stories.js +8 -8
  19. package/src/components/dropdown/index.vue +72 -75
  20. package/src/components/errorMessage/index.vue +23 -23
  21. package/src/components/filter/filterSettings.vue +329 -349
  22. package/src/components/filter/index.vue +130 -130
  23. package/src/components/filter/parentDropdown.vue +40 -43
  24. package/src/components/icon/Icons.stories.js +4 -4
  25. package/src/components/icon/iconCache.js +1 -1
  26. package/src/components/icon/iconCollection.vue +37 -40
  27. package/src/components/icon/index.vue +65 -72
  28. package/src/components/iconWrapper/index.vue +118 -122
  29. package/src/components/infoCard/index.vue +17 -20
  30. package/src/components/infoText/index.vue +82 -88
  31. package/src/components/inputs/checkbox/index.vue +94 -91
  32. package/src/components/inputs/inputNumber/index.vue +488 -508
  33. package/src/components/inputs/inputNumberQuestion/index.vue +124 -127
  34. package/src/components/inputs/inputText/index.vue +252 -265
  35. package/src/components/inputs/radioButton/index.vue +120 -135
  36. package/src/components/inputs/searchInput/index.vue +81 -84
  37. package/src/components/inputs/select/index.vue +631 -644
  38. package/src/components/inputs/select/option/index.vue +91 -91
  39. package/src/components/inputs/select/select.stories.js +7 -7
  40. package/src/components/inputs/slider/index.vue +46 -46
  41. package/src/components/inputs/switchField/index.vue +152 -159
  42. package/src/components/inputs/textAreaInput/index.vue +113 -120
  43. package/src/components/inputs/toggle/index.vue +127 -137
  44. package/src/components/label/index.vue +61 -64
  45. package/src/components/markerItem/index.vue +40 -40
  46. package/src/components/modals/actionModal/index.vue +29 -32
  47. package/src/components/modals/infoModal/index.vue +27 -34
  48. package/src/components/modals/modal/index.vue +80 -88
  49. package/src/components/navigationTabs/index.vue +47 -50
  50. package/src/components/pageSubtitle/index.vue +29 -33
  51. package/src/components/pageTitle/index.vue +39 -47
  52. package/src/components/pagination/index.vue +62 -64
  53. package/src/components/progressBar/index.vue +67 -70
  54. package/src/components/projectMarker/index.vue +163 -172
  55. package/src/components/rangeSlider/Slider.vue +449 -449
  56. package/src/components/rangeSlider/index.vue +270 -282
  57. package/src/components/rangeSlider/utils/dom.js +3 -3
  58. package/src/components/selectedOptions/index.vue +51 -51
  59. package/src/components/sideMenu/index.vue +109 -117
  60. package/src/components/spinner/index.vue +34 -37
  61. package/src/components/tableDropdown/index.vue +326 -343
  62. package/src/components/tables/mainTable/index.vue +106 -109
  63. package/src/components/tables/viewTable/index.vue +92 -105
  64. package/src/components/threeDots/index.vue +171 -174
  65. package/src/components/videoThumbnail/index.vue +59 -67
  66. package/src/components/videoThumbnail/videoThumbnail.stories.js +6 -6
  67. package/.eslintrc.js +0 -125
@@ -1,29 +1,29 @@
1
1
  <template>
2
- <PageContainer
2
+ <page-container
3
+ @click="toggleButton()"
3
4
  ref="pageContainer"
4
5
  :activated="isOpen"
5
- @click="toggleButton()"
6
6
  >
7
- <ButtonContainer ref="dropdownItem">
8
- <DotItem />
9
- <DotItem />
10
- <DotItem />
11
- </ButtonContainer>
12
- <DropdownContainer
13
- ref="dropdownContainer"
14
- :container-width="childOpen ? 440 : 240"
7
+ <button-container ref="dropdownItem">
8
+ <dot-item />
9
+ <dot-item />
10
+ <dot-item />
11
+ </button-container>
12
+ <dropdown-container
15
13
  @click.stop
14
+ :containerWidth="childOpen ? 440 : 240"
15
+ ref="dropdownContainer"
16
16
  >
17
17
  <template v-if="isOpen">
18
- <LoadingContainer v-if="isLoading">
19
- <Spinner />
20
- </LoadingContainer>
21
- <ChildrenContainer
22
- v-if="hoverItem !== null && !isLoading"
18
+ <loading-container v-if="isLoading">
19
+ <spinner />
20
+ </loading-container>
21
+ <children-container
23
22
  class="child"
24
- :is-open="hoverItem !== null"
23
+ :isOpen="hoverItem !== null"
24
+ v-if="hoverItem !== null && !isLoading"
25
25
  >
26
- <OptionChild
26
+ <option-child
27
27
  v-for="child in childOpen"
28
28
  :key="child.value"
29
29
  @click.stop="
@@ -40,19 +40,14 @@
40
40
  "
41
41
  >
42
42
  {{ child.name }}
43
- </OptionChild>
44
- </ChildrenContainer>
45
- <OptionsContainer
46
- v-if="!isLoading"
47
- :text-wrap="textWrap"
48
- >
49
- <OptionItem
43
+ </option-child>
44
+ </children-container>
45
+ <options-container v-if="!isLoading" :textWrap="textWrap">
46
+ <option-item
50
47
  v-for="(item, index) in options"
51
48
  :key="item.value"
52
49
  :data-id="item.dataId"
53
- :is-disabled="item.disabled"
54
50
  tabindex="0"
55
- :title="item.title"
56
51
  @click.stop="
57
52
  onSelect({ item: item, hasChildren: hasChildren(item) })
58
53
  "
@@ -60,19 +55,21 @@
60
55
  onSelect({ item: item, hasChildren: hasChildren(item) })
61
56
  "
62
57
  @mouseover="onItemHover({ index, item })"
58
+ :isDisabled="item.disabled"
59
+ :title="item.title"
63
60
  >
64
- <ArrowLeft
61
+ <arrow-left
62
+ :hasChildren="hasChildren(item)"
65
63
  v-if="hasChildren(item)"
66
- :has-children="hasChildren(item)"
67
64
  />
68
65
  <span>
69
66
  {{ item.name }}
70
67
  </span>
71
- </OptionItem>
72
- </OptionsContainer>
68
+ </option-item>
69
+ </options-container>
73
70
  </template>
74
- </DropdownContainer>
75
- </PageContainer>
71
+ </dropdown-container>
72
+ </page-container>
76
73
  </template>
77
74
 
78
75
  <script>
@@ -132,13 +129,13 @@
132
129
  // },
133
130
  // ],
134
131
 
135
- import styled from 'vue3-styled-components'
136
- import Spinner from '../spinner'
132
+ import styled from 'vue3-styled-components'
133
+ import Spinner from '../spinner'
137
134
 
138
- const PageContainerAttrs = {
139
- activated: Boolean
140
- }
141
- const PageContainer = styled('div', PageContainerAttrs)`
135
+ const PageContainerAttrs = {
136
+ activated: Boolean
137
+ }
138
+ const PageContainer = styled('div', PageContainerAttrs)`
142
139
  display: grid;
143
140
  align-items: center;
144
141
  justify-items: center;
@@ -146,14 +143,14 @@
146
143
  height: 30px;
147
144
  border-radius: 4px;
148
145
  background-color: ${(props) =>
149
- props.activated ? props.theme.colors.grey5 : ''};
146
+ props.activated ? props.theme.colors.grey5 : ''};
150
147
 
151
148
  &:hover {
152
149
  background-color: ${(props) => props.theme.colors.grey5};
153
150
  }
154
151
  `
155
152
 
156
- const ButtonContainer = styled.div`
153
+ const ButtonContainer = styled.div`
157
154
  display: flex;
158
155
  flex-direction: column;
159
156
  align-items: center;
@@ -167,24 +164,24 @@
167
164
  }
168
165
  `
169
166
 
170
- const DotItem = styled.div`
167
+ const DotItem = styled.div`
171
168
  width: 4px;
172
169
  height: 4px;
173
170
  margin: 1px;
174
171
  border-radius: 50%;
175
172
  `
176
173
 
177
- const dropdownAttrs = {
178
- containerWidth: Number
179
- }
180
- const DropdownContainer = styled('div', dropdownAttrs)`
174
+ const dropdownAttrs = {
175
+ containerWidth: Number
176
+ }
177
+ const DropdownContainer = styled('div', dropdownAttrs)`
181
178
  z-index: 99;
182
179
  position: absolute;
183
180
  display: grid;
184
181
  grid-template-columns: auto auto;
185
182
  `
186
183
 
187
- const LoadingContainer = styled.div`
184
+ const LoadingContainer = styled.div`
188
185
  border: 1px solid ${(props) => props.theme.colors.grey3};
189
186
  display: grid;
190
187
  grid-template-columns: 1fr;
@@ -195,8 +192,8 @@
195
192
  background: #fff;
196
193
  `
197
194
 
198
- const OptionsContainerAttrs = { textWrap: Boolean }
199
- const OptionsContainer = styled('div', OptionsContainerAttrs)`
195
+ const OptionsContainerAttrs = { textWrap: Boolean }
196
+ const OptionsContainer = styled('div', OptionsContainerAttrs)`
200
197
  border: 1px solid ${(props) => props.theme.colors.grey3};
201
198
  display: grid;
202
199
  grid-template-columns: 1fr;
@@ -209,8 +206,8 @@
209
206
  ${(props) => props.textWrap ? 'white-space: normal' : 'white-space: nowrap'};
210
207
  `
211
208
 
212
- const optionAttrs = { isDisabled: Boolean }
213
- const OptionItem = styled('div', optionAttrs)`
209
+ const optionAttrs = { isDisabled: Boolean }
210
+ const OptionItem = styled('div', optionAttrs)`
214
211
  padding: 12px;
215
212
  cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
216
213
  font-size: 13px;
@@ -227,7 +224,7 @@
227
224
  background-color: #ebeef4;
228
225
  }
229
226
  `
230
- const OptionChild = styled.div`
227
+ const OptionChild = styled.div`
231
228
  padding: 12px;
232
229
  cursor: pointer;
233
230
  font-size: 13px;
@@ -243,8 +240,8 @@
243
240
  }
244
241
  `
245
242
 
246
- const arrowAttrs = { hasChildren: Boolean }
247
- const ArrowLeft = styled('span', arrowAttrs)`
243
+ const arrowAttrs = { hasChildren: Boolean }
244
+ const ArrowLeft = styled('span', arrowAttrs)`
248
245
  border: solid #9f9f9f;
249
246
  border-width: 0 1.5px 1.5px 0;
250
247
  display: inline-block;
@@ -255,10 +252,10 @@
255
252
  visibility: ${(props) => (props.hasChildren ? 'visible' : 'hidden')};
256
253
  `
257
254
 
258
- const childAttrs = { isOpen: Boolean }
259
- const ChildrenContainer = styled('div', childAttrs)`
255
+ const childAttrs = { isOpen: Boolean }
256
+ const ChildrenContainer = styled('div', childAttrs)`
260
257
  border: ${(props) =>
261
- props.isOpen ? '1px solid' + props.theme.colors.grey3 : 'none'};
258
+ props.isOpen ? '1px solid' + props.theme.colors.grey3 : 'none'};
262
259
  display: grid;
263
260
  grid-template-columns: 1fr;
264
261
  min-width: 200px;
@@ -276,135 +273,135 @@
276
273
  right: 100%;
277
274
  `
278
275
 
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
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
293
294
  },
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
305
- }
295
+ isLoading: {
296
+ required: false,
297
+ default: false
306
298
  },
307
- data() {
308
- return {
309
- isOpen: false,
310
- hoverItem: null,
311
- childOpen: null,
312
- containerWidth: 16
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)
313
323
  }
314
324
  },
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()
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()
334
331
 
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 ===
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%)'
348
+ }
349
+ },
350
+ findRelativeParent(element) {
351
+ while (element.parentElement) {
352
+ if (
353
+ window.getComputedStyle(element.parentElement).position ===
357
354
  'relative' ||
358
- window.getComputedStyle(element.parentElement).position === 'absolute'
359
- ) {
360
- return element.parentElement
361
- }
362
- element = element.parentElement
355
+ window.getComputedStyle(element.parentElement).position === 'absolute'
356
+ ) {
357
+ return element.parentElement
363
358
  }
364
- return null
365
- },
366
- determineElementQuarter(element, rect) {
367
- const viewportWidth = window.innerWidth
368
- const viewportHeight = window.innerHeight
359
+ element = element.parentElement
360
+ }
361
+ return null
362
+ },
363
+ determineElementQuarter(element, rect) {
364
+ const viewportWidth = window.innerWidth
365
+ const viewportHeight = window.innerHeight
369
366
 
370
- const horizontalMidpoint = viewportWidth / 2
371
- const verticalMidpoint = viewportHeight / 2
367
+ const horizontalMidpoint = viewportWidth / 2
368
+ const verticalMidpoint = viewportHeight / 2
372
369
 
373
- const isLeft = rect.left + rect.width / 2 < horizontalMidpoint
374
- const isTop = rect.top + rect.height / 2 < verticalMidpoint
370
+ const isLeft = rect.left + rect.width / 2 < horizontalMidpoint
371
+ const isTop = rect.top + rect.height / 2 < verticalMidpoint
375
372
 
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()
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
407
402
  }
403
+ this.toggleButton()
408
404
  }
409
405
  }
406
+ }
410
407
  </script>
@@ -1,18 +1,10 @@
1
1
  <template>
2
- <Wrapper
3
- :fit="fit"
4
- :height="height"
5
- :width="width"
6
- >
2
+ <wrapper :width="width" :height="height" :fit="fit">
7
3
  <img :src="src" />
8
- <IconWrapper>
9
- <Icon
10
- :color="playIconColor"
11
- name="play"
12
- :size="playIconSize"
13
- />
14
- </IconWrapper>
15
- </Wrapper>
4
+ <iconWrapper>
5
+ <icon name="play" :size="playIconSize" :color="playIconColor" />
6
+ </iconWrapper>
7
+ </wrapper>
16
8
  </template>
17
9
 
18
10
  <script>
@@ -25,11 +17,11 @@
25
17
  // height="600px"
26
18
  // />
27
19
 
28
- import styled from 'vue3-styled-components'
29
- import Icon from '../icon'
20
+ import styled from 'vue3-styled-components'
21
+ import Icon from '../icon'
30
22
 
31
- const wrapperAttrs = { width: String, height: String, fit: String }
32
- const Wrapper = styled('div', wrapperAttrs)`
23
+ const wrapperAttrs = { width: String, height: String, fit: String }
24
+ const Wrapper = styled('div', wrapperAttrs)`
33
25
  display: inline-block;
34
26
  position: relative;
35
27
  width: ${(props) => props.width};
@@ -40,7 +32,7 @@
40
32
  height: ${(props) => props.height};
41
33
  }
42
34
  `
43
- const IconWrapper = styled('div')`
35
+ const iconWrapper = styled('div')`
44
36
  position: absolute;
45
37
  top: 0;
46
38
  bottom: 0;
@@ -51,61 +43,61 @@
51
43
  align-items: center;
52
44
  `
53
45
 
54
- export default {
55
- name: 'VideoThumbnail',
56
- components: {
57
- Wrapper,
58
- Icon,
59
- IconWrapper
46
+ export default {
47
+ name: 'VideoThumbnail',
48
+ components: {
49
+ Wrapper,
50
+ Icon,
51
+ iconWrapper
52
+ },
53
+ props: {
54
+ src: {
55
+ required: true
60
56
  },
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
- }
57
+ fit: {
58
+ required: false,
59
+ default: 'cover'
85
60
  },
86
- data() {
87
- return {
88
- isOpenByClick: false
89
- }
61
+ width: {
62
+ required: false,
63
+ default: '300px'
90
64
  },
91
- mounted() {
92
- document.addEventListener('click', this.clickOutside)
65
+ height: {
66
+ required: false,
67
+ default: '200px'
93
68
  },
94
- beforeDestroy() {
95
- document.removeEventListener('click', this.clickOutside)
69
+ playIconSize: {
70
+ required: false,
71
+ default: '50px'
96
72
  },
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
- }
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
108
93
  }
109
94
  }
95
+ },
96
+ mounted() {
97
+ document.addEventListener('click', this.clickOutside)
98
+ },
99
+ beforeDestroy() {
100
+ document.removeEventListener('click', this.clickOutside)
110
101
  }
102
+ }
111
103
  </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