@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.
- package/.prettierrc +7 -0
- package/package.json +20 -6
- package/public/favicon.ico +0 -0
- package/public/index.html +17 -0
- package/src/App.vue +70 -75
- package/src/assets/svgIcons/copy.svg +10 -0
- package/src/components/addNewButton/index.vue +27 -24
- package/src/components/banner/actionBanner/index.vue +30 -32
- package/src/components/banner/banner/index.vue +80 -88
- package/src/components/banner/infoBanner/index.vue +44 -36
- package/src/components/buttons/buttonIcon/index.vue +78 -83
- package/src/components/buttons/closeButton/index.vue +26 -26
- package/src/components/buttons/mainButton/index.vue +76 -80
- package/src/components/card/index.vue +52 -56
- package/src/components/collapsableInfoText/index.vue +76 -81
- package/src/components/deleteIcon/index.vue +28 -31
- package/src/components/draggableInputHandle/index.vue +17 -20
- package/src/components/dropdown/Dropdown.stories.js +8 -8
- package/src/components/dropdown/index.vue +72 -75
- package/src/components/errorMessage/index.vue +23 -23
- package/src/components/filter/filterSettings.vue +329 -349
- package/src/components/filter/index.vue +130 -130
- package/src/components/filter/parentDropdown.vue +40 -43
- package/src/components/icon/Icons.stories.js +4 -4
- package/src/components/icon/iconCache.js +1 -1
- package/src/components/icon/iconCollection.vue +37 -40
- package/src/components/icon/index.vue +65 -72
- package/src/components/iconWrapper/index.vue +118 -122
- package/src/components/infoCard/index.vue +17 -20
- package/src/components/infoText/index.vue +82 -88
- package/src/components/inputs/checkbox/index.vue +94 -91
- package/src/components/inputs/inputNumber/index.vue +488 -508
- package/src/components/inputs/inputNumberQuestion/index.vue +124 -127
- package/src/components/inputs/inputText/index.vue +252 -265
- package/src/components/inputs/radioButton/index.vue +120 -135
- package/src/components/inputs/searchInput/index.vue +81 -84
- package/src/components/inputs/select/index.vue +631 -644
- package/src/components/inputs/select/option/index.vue +91 -91
- package/src/components/inputs/select/select.stories.js +7 -7
- package/src/components/inputs/slider/index.vue +46 -46
- package/src/components/inputs/switchField/index.vue +152 -159
- package/src/components/inputs/textAreaInput/index.vue +113 -120
- package/src/components/inputs/toggle/index.vue +127 -137
- package/src/components/label/index.vue +61 -64
- package/src/components/markerItem/index.vue +40 -40
- package/src/components/modals/actionModal/index.vue +29 -32
- package/src/components/modals/infoModal/index.vue +27 -34
- package/src/components/modals/modal/index.vue +80 -88
- package/src/components/navigationTabs/index.vue +47 -50
- package/src/components/pageSubtitle/index.vue +29 -33
- package/src/components/pageTitle/index.vue +39 -47
- package/src/components/pagination/index.vue +62 -64
- package/src/components/progressBar/index.vue +67 -70
- package/src/components/projectMarker/index.vue +163 -172
- package/src/components/rangeSlider/Slider.vue +449 -449
- package/src/components/rangeSlider/index.vue +270 -282
- package/src/components/rangeSlider/utils/dom.js +3 -3
- package/src/components/selectedOptions/index.vue +51 -51
- package/src/components/sideMenu/index.vue +109 -117
- package/src/components/spinner/index.vue +34 -37
- package/src/components/tableDropdown/index.vue +326 -343
- package/src/components/tables/mainTable/index.vue +106 -109
- package/src/components/tables/viewTable/index.vue +92 -105
- package/src/components/threeDots/index.vue +171 -174
- package/src/components/videoThumbnail/index.vue +59 -67
- package/src/components/videoThumbnail/videoThumbnail.stories.js +6 -6
- package/.eslintrc.js +0 -125
@@ -1,29 +1,29 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
2
|
+
<page-container
|
3
|
+
@click="toggleButton()"
|
3
4
|
ref="pageContainer"
|
4
5
|
:activated="isOpen"
|
5
|
-
@click="toggleButton()"
|
6
6
|
>
|
7
|
-
<
|
8
|
-
<
|
9
|
-
<
|
10
|
-
<
|
11
|
-
</
|
12
|
-
<
|
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
|
-
<
|
19
|
-
<
|
20
|
-
</
|
21
|
-
<
|
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
|
-
:
|
23
|
+
:isOpen="hoverItem !== null"
|
24
|
+
v-if="hoverItem !== null && !isLoading"
|
25
25
|
>
|
26
|
-
<
|
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
|
-
</
|
44
|
-
</
|
45
|
-
<
|
46
|
-
|
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
|
-
<
|
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
|
-
</
|
72
|
-
</
|
68
|
+
</option-item>
|
69
|
+
</options-container>
|
73
70
|
</template>
|
74
|
-
</
|
75
|
-
</
|
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
|
-
|
136
|
-
|
132
|
+
import styled from 'vue3-styled-components'
|
133
|
+
import Spinner from '../spinner'
|
137
134
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
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
|
-
|
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
|
-
|
199
|
-
|
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
|
-
|
213
|
-
|
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
|
-
|
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
|
-
|
247
|
-
|
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
|
-
|
259
|
-
|
255
|
+
const childAttrs = { isOpen: Boolean }
|
256
|
+
const ChildrenContainer = styled('div', childAttrs)`
|
260
257
|
border: ${(props) =>
|
261
|
-
|
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
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
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
|
-
|
295
|
-
|
296
|
-
|
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
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
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
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
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
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
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
|
-
|
359
|
-
|
360
|
-
|
361
|
-
}
|
362
|
-
element = element.parentElement
|
355
|
+
window.getComputedStyle(element.parentElement).position === 'absolute'
|
356
|
+
) {
|
357
|
+
return element.parentElement
|
363
358
|
}
|
364
|
-
|
365
|
-
}
|
366
|
-
|
367
|
-
|
368
|
-
|
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
|
-
|
371
|
-
|
367
|
+
const horizontalMidpoint = viewportWidth / 2
|
368
|
+
const verticalMidpoint = viewportHeight / 2
|
372
369
|
|
373
|
-
|
374
|
-
|
370
|
+
const isLeft = rect.left + rect.width / 2 < horizontalMidpoint
|
371
|
+
const isTop = rect.top + rect.height / 2 < verticalMidpoint
|
375
372
|
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
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
|
-
<
|
3
|
-
:fit="fit"
|
4
|
-
:height="height"
|
5
|
-
:width="width"
|
6
|
-
>
|
2
|
+
<wrapper :width="width" :height="height" :fit="fit">
|
7
3
|
<img :src="src" />
|
8
|
-
<
|
9
|
-
<
|
10
|
-
|
11
|
-
|
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
|
-
|
29
|
-
|
20
|
+
import styled from 'vue3-styled-components'
|
21
|
+
import Icon from '../icon'
|
30
22
|
|
31
|
-
|
32
|
-
|
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
|
-
|
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
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
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
|
-
|
62
|
-
|
63
|
-
|
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
|
-
|
87
|
-
|
88
|
-
|
89
|
-
}
|
61
|
+
width: {
|
62
|
+
required: false,
|
63
|
+
default: '300px'
|
90
64
|
},
|
91
|
-
|
92
|
-
|
65
|
+
height: {
|
66
|
+
required: false,
|
67
|
+
default: '200px'
|
93
68
|
},
|
94
|
-
|
95
|
-
|
69
|
+
playIconSize: {
|
70
|
+
required: false,
|
71
|
+
default: '50px'
|
96
72
|
},
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
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:
|
28
|
-
playIconSize:
|
29
|
-
playIconColor:
|
30
|
-
width:
|
31
|
-
height:
|
32
|
-
fit:
|
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
|
|