@eturnity/eturnity_reusable_components 7.24.3-EPDM-10576.1 → 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.
- package/.eslintrc.js +125 -0
- package/package.json +6 -20
- package/src/App.vue +75 -70
- package/src/components/addNewButton/index.vue +24 -27
- package/src/components/banner/actionBanner/index.vue +32 -30
- package/src/components/banner/banner/index.vue +88 -80
- package/src/components/banner/infoBanner/index.vue +36 -44
- package/src/components/buttons/buttonIcon/index.vue +83 -78
- package/src/components/buttons/closeButton/index.vue +26 -26
- package/src/components/buttons/mainButton/index.vue +80 -76
- package/src/components/card/index.vue +56 -52
- package/src/components/collapsableInfoText/index.vue +81 -76
- package/src/components/deleteIcon/index.vue +31 -28
- package/src/components/draggableInputHandle/index.vue +20 -17
- package/src/components/dropdown/Dropdown.stories.js +8 -8
- package/src/components/dropdown/index.vue +75 -72
- package/src/components/errorMessage/index.vue +23 -23
- package/src/components/filter/filterSettings.vue +349 -333
- package/src/components/filter/index.vue +130 -130
- package/src/components/filter/parentDropdown.vue +43 -40
- package/src/components/icon/Icons.stories.js +4 -4
- package/src/components/icon/iconCache.js +1 -1
- package/src/components/icon/iconCollection.vue +40 -37
- package/src/components/icon/index.vue +72 -65
- package/src/components/iconWrapper/index.vue +122 -118
- package/src/components/infoCard/index.vue +20 -17
- package/src/components/infoText/index.vue +88 -82
- package/src/components/inputs/checkbox/index.vue +91 -94
- package/src/components/inputs/inputNumber/index.vue +508 -488
- package/src/components/inputs/inputNumberQuestion/index.vue +127 -124
- package/src/components/inputs/inputText/index.vue +265 -252
- package/src/components/inputs/radioButton/index.vue +135 -120
- package/src/components/inputs/searchInput/index.vue +84 -81
- package/src/components/inputs/select/index.vue +644 -631
- 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 +159 -152
- package/src/components/inputs/textAreaInput/index.vue +120 -113
- package/src/components/inputs/toggle/index.vue +137 -127
- package/src/components/label/index.vue +64 -61
- package/src/components/markerItem/index.vue +40 -40
- package/src/components/modals/actionModal/index.vue +32 -29
- package/src/components/modals/infoModal/index.vue +34 -27
- package/src/components/modals/modal/index.vue +88 -80
- package/src/components/navigationTabs/index.vue +50 -47
- package/src/components/pageSubtitle/index.vue +33 -29
- package/src/components/pageTitle/index.vue +47 -39
- package/src/components/pagination/index.vue +64 -62
- package/src/components/progressBar/index.vue +70 -67
- package/src/components/projectMarker/index.vue +172 -163
- package/src/components/rangeSlider/Slider.vue +449 -449
- package/src/components/rangeSlider/index.vue +282 -270
- package/src/components/rangeSlider/utils/dom.js +3 -3
- package/src/components/selectedOptions/index.vue +51 -51
- package/src/components/sideMenu/index.vue +117 -109
- package/src/components/spinner/index.vue +37 -34
- package/src/components/tableDropdown/index.vue +343 -326
- package/src/components/tables/mainTable/index.vue +109 -106
- package/src/components/tables/viewTable/index.vue +105 -92
- package/src/components/threeDots/index.vue +174 -171
- package/src/components/videoThumbnail/index.vue +67 -59
- package/src/components/videoThumbnail/videoThumbnail.stories.js +6 -6
- package/.prettierrc +0 -7
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -17
@@ -1,29 +1,29 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
@click="toggleButton()"
|
2
|
+
<PageContainer
|
4
3
|
ref="pageContainer"
|
5
4
|
:activated="isOpen"
|
5
|
+
@click="toggleButton()"
|
6
6
|
>
|
7
|
-
<
|
8
|
-
<
|
9
|
-
<
|
10
|
-
<
|
11
|
-
</
|
12
|
-
<
|
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
|
-
<
|
19
|
-
<
|
20
|
-
</
|
21
|
-
<
|
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
|
-
<
|
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
|
-
</
|
44
|
-
</
|
45
|
-
<
|
46
|
-
|
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
|
-
<
|
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
|
-
</
|
69
|
-
</
|
71
|
+
</OptionItem>
|
72
|
+
</OptionsContainer>
|
70
73
|
</template>
|
71
|
-
</
|
72
|
-
</
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
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
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
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
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
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
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
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
|
-
|
356
|
-
|
357
|
-
|
358
|
+
window.getComputedStyle(element.parentElement).position === 'absolute'
|
359
|
+
) {
|
360
|
+
return element.parentElement
|
361
|
+
}
|
362
|
+
element = element.parentElement
|
358
363
|
}
|
359
|
-
|
360
|
-
}
|
361
|
-
|
362
|
-
|
363
|
-
|
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
|
-
|
368
|
-
|
370
|
+
const horizontalMidpoint = viewportWidth / 2
|
371
|
+
const verticalMidpoint = viewportHeight / 2
|
369
372
|
|
370
|
-
|
371
|
-
|
373
|
+
const isLeft = rect.left + rect.width / 2 < horizontalMidpoint
|
374
|
+
const isTop = rect.top + rect.height / 2 < verticalMidpoint
|
372
375
|
|
373
|
-
|
374
|
-
|
375
|
-
|
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
|
-
|
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
|
-
<
|
2
|
+
<Wrapper
|
3
|
+
:fit="fit"
|
4
|
+
:height="height"
|
5
|
+
:width="width"
|
6
|
+
>
|
3
7
|
<img :src="src" />
|
4
|
-
<
|
5
|
-
<
|
6
|
-
|
7
|
-
|
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
|
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
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
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
|
-
|
58
|
-
|
59
|
-
|
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
|
-
|
62
|
-
|
63
|
-
|
86
|
+
data() {
|
87
|
+
return {
|
88
|
+
isOpenByClick: false
|
89
|
+
}
|
64
90
|
},
|
65
|
-
|
66
|
-
|
67
|
-
default: '200px'
|
91
|
+
mounted() {
|
92
|
+
document.addEventListener('click', this.clickOutside)
|
68
93
|
},
|
69
|
-
|
70
|
-
|
71
|
-
default: '50px'
|
94
|
+
beforeDestroy() {
|
95
|
+
document.removeEventListener('click', this.clickOutside)
|
72
96
|
},
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
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
|
|
package/.prettierrc
DELETED
package/public/favicon.ico
DELETED
Binary file
|
package/public/index.html
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html lang="">
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
6
|
-
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
7
|
-
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
8
|
-
<title><%= htmlWebpackPlugin.options.title %></title>
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<noscript>
|
12
|
-
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
13
|
-
</noscript>
|
14
|
-
<div id="app"></div>
|
15
|
-
<!-- built files will be auto injected -->
|
16
|
-
</body>
|
17
|
-
</html>
|