@erst-vg/vg-design-wrapper 1.0.12 → 2.0.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/CHANGELOG.md +12 -0
- package/dist/src/App.vue.d.ts +1 -1
- package/dist/src/VgDesign.vue.d.ts +2 -2
- package/dist/src/components/VgAccordion.vue.d.ts +6 -6
- package/dist/src/components/VgButton.vue.d.ts +4 -4
- package/dist/src/components/VgButtons.vue.d.ts +1 -1
- package/dist/src/components/VgCard.vue.d.ts +4 -4
- package/dist/src/components/VgCardGroup.vue.d.ts +4 -4
- package/dist/src/components/VgDesignWrapper.vue.d.ts +1 -1
- package/dist/src/components/VgIcon.vue.d.ts +4 -4
- package/dist/src/components/VgKalturaVideo.vue.d.ts +39 -0
- package/dist/src/components/VgListe.vue.d.ts +6 -6
- package/dist/src/components/VgListeCard.vue.d.ts +4 -4
- package/dist/src/components/VgLoginButton.vue.d.ts +1 -1
- package/dist/src/components/VgPagination.vue.d.ts +5 -5
- package/dist/src/components/VgVideo.vue.d.ts +28 -0
- package/dist/src/components/VgVideoToolVideo.vue.d.ts +39 -0
- package/dist/src/components/VgVimeoVideo.vue.d.ts +39 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/tests/unit/components/VgKalturaVideo.spec.d.ts +1 -0
- package/dist/tests/unit/components/VgVideo.spec.d.ts +1 -0
- package/dist/tests/unit/components/VgVideoToolVideo.spec.d.ts +1 -0
- package/dist/tests/unit/components/VgVimeoVideo.spec.d.ts +1 -0
- package/dist/vg-design-wrapper.js +3820 -1856
- package/dist/vg-design-wrapper.umd.cjs +68 -63
- package/package.json +30 -33
- package/src/assets/icons/agenda.svg +3 -0
- package/src/assets/icons/breadcrumbArrow.svg +1 -1
- package/src/components/VgAccordion.vue +2 -2
- package/src/components/VgCard.vue +1 -1
- package/src/components/VgDesignWrapper.vue +7 -10
- package/src/components/VgIcon.vue +1 -1
- package/src/components/VgKalturaVideo.vue +70 -0
- package/src/components/VgListe.vue +1 -1
- package/src/components/VgListeCard.vue +1 -1
- package/src/components/VgLoginButton.vue +1 -1
- package/src/components/VgVideo.vue +65 -0
- package/src/components/VgVideoToolVideo.vue +70 -0
- package/src/components/VgVimeoVideo.vue +64 -0
- package/src/styles/custom/_vgAccordion.scss +1 -0
- package/src/styles/custom/_vgVideo.scss +86 -0
- package/src/styles/custom/_vgVideoFrame.scss +9 -0
- package/src/styles/utility.scss +2 -0
- package/src/styles/vg/_vg-colors.scss +3 -0
- package/src/styles/vg/accordion/_vg-accordion.scss +32 -1
- package/src/styles/vg/buttons/_vg-buttons.scss +9 -2
- package/src/styles/vg/card/_vg-cardText.scss +3 -0
- package/src/styles/vg/card/_vg-udvidedecardgrupper.scss +51 -5
- package/src/styles/vg/mixins/_vg-mediaquery-helpers.scss +16 -9
- package/src/styles/vg/pagination/_vg-pagination.scss +2 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@erst-vg/vg-design-wrapper",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"types": "./dist/src/index.d.ts",
|
|
28
28
|
"import": "./dist/vg-design-wrapper.js",
|
|
29
29
|
"require": "./dist/vg-design-wrapper.umd.cjs"
|
|
30
|
-
}
|
|
30
|
+
},
|
|
31
|
+
"./styles/utility": "./src/styles/utility.scss"
|
|
31
32
|
},
|
|
32
33
|
"scripts": {
|
|
33
34
|
"dev": "vite",
|
|
@@ -37,51 +38,47 @@
|
|
|
37
38
|
"clean": "rm -rf ./src/styles/vg ./src/assets && mkdir -p src/assets/icons/ src/styles/vg",
|
|
38
39
|
"clean-windows": "rmdir src\\styles\\vg src\\assets /s && mkdir src\\assets\\icons src\\styles\\vg",
|
|
39
40
|
"prepack-windows": "npm run clean-windows && xcopy ..\\content-web\\src\\main\\vue\\src\\styles\\external\\** .\\src\\styles\\vg /e && xcopy ..\\content-web\\src\\main\\vue\\src\\assets\\icons\\*.svg .\\src\\assets\\icons /e",
|
|
40
|
-
"lint": "cross-env
|
|
41
|
+
"lint": "cross-env eslint \"**/*.{ts,js,vue}\" --fix --format=pretty",
|
|
41
42
|
"prettierfix": "prettier --write \"**/*.{vue,ts}\" ",
|
|
42
43
|
"prettiercheck": "prettier --check \"**/*.{vue,ts}\" "
|
|
43
44
|
},
|
|
44
45
|
"dependencies": {
|
|
45
|
-
"
|
|
46
|
+
"axios": "1.12.2",
|
|
46
47
|
"dkfds": "npm:@erst-vg/dkfds-vite@8.0.1",
|
|
47
48
|
"lodash": "4.17.21",
|
|
48
|
-
"sass": "1.
|
|
49
|
-
"vue": "
|
|
50
|
-
"vue-inline-svg": "
|
|
49
|
+
"sass": "1.93.2",
|
|
50
|
+
"vue": "3.5.22",
|
|
51
|
+
"vue-inline-svg": "4.0.1"
|
|
51
52
|
},
|
|
52
53
|
"peerDependencies": {
|
|
53
|
-
"vue": "
|
|
54
|
+
"vue": "3.5.22"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@stylistic/eslint-plugin": "2.6.2",
|
|
57
|
-
"@types/lodash": "
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
58
|
+
"@types/lodash": "4.17.7",
|
|
59
|
+
"@types/node": "24.9.2",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "8.45.0",
|
|
61
|
+
"@vitejs/plugin-vue": "5.2.3",
|
|
62
|
+
"@vitest/coverage-v8": "3.2.4",
|
|
63
|
+
"@vue/test-utils": "2.4.6",
|
|
61
64
|
"cross-env": "7.0.3",
|
|
62
|
-
"eslint": "
|
|
63
|
-
"eslint-config-prettier": "
|
|
64
|
-
"eslint-formatter-pretty": "
|
|
65
|
-
"eslint-import-resolver-typescript": "
|
|
66
|
-
"eslint-plugin-import": "2.
|
|
67
|
-
"eslint-plugin-vue": "
|
|
68
|
-
"husky": "
|
|
69
|
-
"jsdom": "
|
|
70
|
-
"lint-staged": "
|
|
71
|
-
"path": "
|
|
72
|
-
"prettier": "
|
|
73
|
-
"typescript": "5.
|
|
74
|
-
"vite": "5.4.
|
|
65
|
+
"eslint": "9.37.0",
|
|
66
|
+
"eslint-config-prettier": "10.1.8",
|
|
67
|
+
"eslint-formatter-pretty": "7.0.0",
|
|
68
|
+
"eslint-import-resolver-typescript": "4.4.4",
|
|
69
|
+
"eslint-plugin-import": "2.32.0",
|
|
70
|
+
"eslint-plugin-vue": "10.5.0",
|
|
71
|
+
"husky": "9.1.7",
|
|
72
|
+
"jsdom": "25.0.1",
|
|
73
|
+
"lint-staged": "16.2.3",
|
|
74
|
+
"path": "0.12.7",
|
|
75
|
+
"prettier": "3.6.2",
|
|
76
|
+
"typescript": "5.9.3",
|
|
77
|
+
"vite": "5.4.20",
|
|
75
78
|
"vite-plugin-css-injected-by-js": "3.5.1",
|
|
76
79
|
"vite-plugin-dts": "4.1.0",
|
|
77
|
-
"vitest": "2.
|
|
78
|
-
"vue-tsc": "2.0.29"
|
|
79
|
-
"@vue/test-utils": "2.4.0"
|
|
80
|
-
},
|
|
81
|
-
"husky": {
|
|
82
|
-
"hooks": {
|
|
83
|
-
"pre-commit": "lint-staged --allow-empty"
|
|
84
|
-
}
|
|
80
|
+
"vitest": "3.2.4",
|
|
81
|
+
"vue-tsc": "2.0.29"
|
|
85
82
|
},
|
|
86
83
|
"lint-staged": {
|
|
87
84
|
"*.{ts,vue}": [
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="m19.675 20.375.7-.7L18.5 17.8V15h-1v3.2l2.175 2.175zM5 21c-.55 0-1.02-.196-1.413-.587A1.926 1.926 0 0 1 3 19V5c0-.55.196-1.02.587-1.413A1.926 1.926 0 0 1 5 3h14c.55 0 1.02.196 1.413.587C20.803 3.98 21 4.45 21 5v6.7a8.184 8.184 0 0 0-.975-.387A6.104 6.104 0 0 0 19 11.075V5H5v14h6.05c.05.367.13.717.237 1.05.109.333.238.65.388.95H5zm0-3v1V5v6.075V11v7zm2-1h4.075c.05-.35.13-.692.238-1.025.108-.333.229-.658.362-.975H7v2zm0-4h6.1c.533-.5 1.13-.917 1.787-1.25A7.043 7.043 0 0 1 17 11.075V11H7v2zm0-4h10V7H7v2zm11 14c-1.383 0-2.563-.488-3.537-1.462C13.488 20.562 13 19.383 13 18s.488-2.563 1.463-3.537C15.438 13.488 16.617 13 18 13s2.563.488 3.538 1.463C22.512 15.438 23 16.617 23 18s-.488 2.563-1.462 3.538C20.562 22.512 19.383 23 18 23z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M8.59 16.59 10 18l6-6-6-6-1.41 1.41L13.17 12l-4.58 4.59z" fill="
|
|
2
|
+
<path d="M8.59 16.59 10 18l6-6-6-6-1.41 1.41L13.17 12l-4.58 4.59z" fill="currentColor"/>
|
|
3
3
|
</svg>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<li v-for="(data, index) in accordions" :key="index" data-testid="accordion" data-cy="accordion">
|
|
16
16
|
<div class="top-wrapper">
|
|
17
17
|
<slot name="before" :data="data" :index="index" />
|
|
18
|
-
<component :is="heading">
|
|
18
|
+
<component :is="heading" class="my-0">
|
|
19
19
|
<button
|
|
20
20
|
type="button"
|
|
21
21
|
class="accordion-button"
|
|
@@ -93,5 +93,5 @@ const toggle = (event: Event, index: number) => {
|
|
|
93
93
|
</script>
|
|
94
94
|
|
|
95
95
|
<style lang="scss" scoped>
|
|
96
|
-
@
|
|
96
|
+
@use '@/styles/custom/_vgAccordion.scss';
|
|
97
97
|
</style>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="applikation-container" data-testid="applikation-container">
|
|
3
3
|
<div v-if="customSvgIcons.length > 0" class="hide-base-svg">
|
|
4
|
+
<!-- eslint-disable-next-line vue/no-v-html -->
|
|
4
5
|
<svg xmlns="http://www.w3.org/2000/svg" v-html="customSvgIcons"></svg>
|
|
5
6
|
</div>
|
|
6
7
|
<slot />
|
|
@@ -35,14 +36,10 @@ onMounted(() => {
|
|
|
35
36
|
</script>
|
|
36
37
|
|
|
37
38
|
<style lang="scss">
|
|
38
|
-
|
|
39
|
-
.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
@import '@/styles/vg/buttons/_vg-buttons.scss';
|
|
45
|
-
@import '@/styles/vg/card/_vg-cardText.scss';
|
|
46
|
-
@import '@/styles/vg/card/_vg-udvidedecardgrupper.scss';
|
|
47
|
-
}
|
|
39
|
+
// Importer de forskellige komponenter, så leverandør af 3parts applikation ikke selv skal gøre det.
|
|
40
|
+
@use '@/styles/vg/pagination/_vg-pagination.scss';
|
|
41
|
+
@use '@/styles/vg/accordion/_vg-accordion.scss';
|
|
42
|
+
@use '@/styles/vg/buttons/_vg-buttons.scss';
|
|
43
|
+
@use '@/styles/vg/card/_vg-cardText.scss';
|
|
44
|
+
@use '@/styles/vg/card/_vg-udvidedecardgrupper.scss';
|
|
48
45
|
</style>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<iframe
|
|
4
|
+
v-if="playVideo && videoUrl"
|
|
5
|
+
:src="videoUrl"
|
|
6
|
+
:alt="alt"
|
|
7
|
+
class="video-frame"
|
|
8
|
+
title="Kaltura afspiller"
|
|
9
|
+
allow="autoplay"
|
|
10
|
+
allowfullscreen
|
|
11
|
+
webkitallowfullscreen
|
|
12
|
+
mozAllowFullScreen
|
|
13
|
+
data-testid="video-frame"
|
|
14
|
+
/>
|
|
15
|
+
<slot name="preview" :thumbnail-url="thumbnailUrl" />
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { computed } from 'vue';
|
|
21
|
+
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
src: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
alt: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
playVideo: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
required: true
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const videoUrl = computed(() => {
|
|
38
|
+
let link = props.src;
|
|
39
|
+
const autoPlay = 'flashvars[autoPlay]';
|
|
40
|
+
if (!link.includes(autoPlay)) {
|
|
41
|
+
link = addQuerystring(link, `${autoPlay}=true`);
|
|
42
|
+
}
|
|
43
|
+
return link;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const thumbnailUrl = computed<string>(() => {
|
|
47
|
+
let url = '';
|
|
48
|
+
const groups = props.src.match(/https:\/\/(.*)\/p\/(\d*)\/.*?.*entry_id=([a-zA-Z0-9_]+)(?=&|$)/); // NOSONAR
|
|
49
|
+
if (groups?.length === 4) {
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
51
|
+
const [_, domain, partnerId, entryId] = groups;
|
|
52
|
+
url = `https://${domain}/p/${partnerId}/thumbnail/entry_id/${entryId}/width/800/quality/100`;
|
|
53
|
+
}
|
|
54
|
+
return url;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
function addQuerystring(url: string, query: string): string {
|
|
58
|
+
const firstParamPrefix = '?';
|
|
59
|
+
const subsequentParamPrefix = '&';
|
|
60
|
+
if (query.indexOf(firstParamPrefix) === 0 || query.indexOf(subsequentParamPrefix) === 0) {
|
|
61
|
+
query = query.substring(1);
|
|
62
|
+
}
|
|
63
|
+
const qsPrefix = url.indexOf(firstParamPrefix) > 0 ? subsequentParamPrefix : firstParamPrefix;
|
|
64
|
+
return url + qsPrefix + query;
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<style lang="scss" scoped>
|
|
69
|
+
@use '@/styles/custom/_vgVideoFrame.scss';
|
|
70
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<button type="button" class="button mitid-button d-inline-flex align-items-center"><VgIcon icon="mitId" class="mr-4" />Log
|
|
2
|
+
<button type="button" class="button mitid-button d-inline-flex align-items-center"><VgIcon icon="mitId" class="mr-4" />Log ind med MitID</button>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script setup lang="ts">
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="video">
|
|
3
|
+
<component :is="videoudbyder" :src="src" :alt="alt" :play-video="playVideo" class="video-player">
|
|
4
|
+
<template #preview="{ thumbnailUrl }">
|
|
5
|
+
<div v-if="!playVideo">
|
|
6
|
+
<button class="button-wrapper" aria-label="Afspil video" title="Afspil video" type="button" @click="playVideo = true">
|
|
7
|
+
<VgIcon icon="playVideo" />
|
|
8
|
+
<div class="video-frame" :style="thumbnailUrl && { 'background-image': 'url(' + thumbnailUrl + ')' }" />
|
|
9
|
+
</button>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
</component>
|
|
13
|
+
<div class="cookie-banner">
|
|
14
|
+
<!-- eslint-disable-next-line vue/no-v-html -->
|
|
15
|
+
<div v-html="cookiebanner" />
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import VgIcon from '@/components/VgIcon.vue';
|
|
22
|
+
import VgKalturaVideo from '@/components/VgKalturaVideo.vue';
|
|
23
|
+
import VgVideoToolVideo from '@/components/VgVideoToolVideo.vue';
|
|
24
|
+
import VgVimeoVideo from '@/components/VgVimeoVideo.vue';
|
|
25
|
+
import { computed, ref } from 'vue';
|
|
26
|
+
|
|
27
|
+
const components = {
|
|
28
|
+
VgVimeoVideo,
|
|
29
|
+
VgVideoToolVideo,
|
|
30
|
+
VgKalturaVideo
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const props = defineProps({
|
|
34
|
+
src: {
|
|
35
|
+
type: String,
|
|
36
|
+
required: true
|
|
37
|
+
},
|
|
38
|
+
alt: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: true
|
|
41
|
+
},
|
|
42
|
+
cookiebanner: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: true
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const playVideo = ref(false);
|
|
49
|
+
|
|
50
|
+
const videoudbyder = computed(() => {
|
|
51
|
+
if (props.src.includes('vimeo')) {
|
|
52
|
+
return components.VgVimeoVideo;
|
|
53
|
+
} else if (props.src.includes('videotool')) {
|
|
54
|
+
return components.VgVideoToolVideo;
|
|
55
|
+
} else if (props.src.includes('kaltura')) {
|
|
56
|
+
return components.VgKalturaVideo;
|
|
57
|
+
}
|
|
58
|
+
return '';
|
|
59
|
+
});
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<style lang="scss" scoped>
|
|
63
|
+
@use '@/styles/custom/_vgVideo.scss';
|
|
64
|
+
@use '@/styles/custom/_vgVideoFrame.scss';
|
|
65
|
+
</style>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<iframe
|
|
4
|
+
v-if="playVideo"
|
|
5
|
+
class="video-frame"
|
|
6
|
+
title="Videotool player"
|
|
7
|
+
type="text/html"
|
|
8
|
+
:alt="alt"
|
|
9
|
+
:src="src"
|
|
10
|
+
webkitallowfullscreen
|
|
11
|
+
mozallowfullscreen
|
|
12
|
+
allowfullscreen
|
|
13
|
+
allow="autoplay; fullscreen"
|
|
14
|
+
data-testid="iframe"
|
|
15
|
+
></iframe>
|
|
16
|
+
<slot name="preview" :thumbnail-url="thumbnailUrl" />
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import axios, { AxiosRequestConfig } from 'axios';
|
|
22
|
+
import { onMounted, ref } from 'vue';
|
|
23
|
+
|
|
24
|
+
const props = defineProps({
|
|
25
|
+
src: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: true
|
|
28
|
+
},
|
|
29
|
+
alt: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: true
|
|
32
|
+
},
|
|
33
|
+
playVideo: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
required: true
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const thumbnailUrl = ref<string>('');
|
|
40
|
+
|
|
41
|
+
onMounted(async () => {
|
|
42
|
+
getThumbnailUrl(props.src).then(url => (thumbnailUrl.value = url));
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
async function getThumbnailUrl(pageUrl: string): Promise<string> {
|
|
46
|
+
let url = '';
|
|
47
|
+
const options: AxiosRequestConfig = {
|
|
48
|
+
method: 'GET',
|
|
49
|
+
headers: { 'content-type': 'text/html' },
|
|
50
|
+
url: pageUrl
|
|
51
|
+
};
|
|
52
|
+
try {
|
|
53
|
+
const xhr = await axios(options);
|
|
54
|
+
if (xhr) {
|
|
55
|
+
const groups = xhr.data?.match(/<meta property="og:image" content="https:(.*?)">/);
|
|
56
|
+
if (groups?.length > 0) {
|
|
57
|
+
url = groups[1];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
} catch {
|
|
61
|
+
// eslint-disable-next-line no-console
|
|
62
|
+
console.log(`Error resolving thumbnail url from "${pageUrl}"`);
|
|
63
|
+
}
|
|
64
|
+
return url;
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<style lang="scss" scoped>
|
|
69
|
+
@use '@/styles/custom/_vgVideoFrame.scss';
|
|
70
|
+
</style>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<iframe
|
|
4
|
+
v-if="playVideo && videoUrl"
|
|
5
|
+
class="video-frame"
|
|
6
|
+
title="Vimeo afspiller"
|
|
7
|
+
:alt="alt"
|
|
8
|
+
:src="videoUrl"
|
|
9
|
+
webkitallowfullscreen
|
|
10
|
+
mozallowfullscreen
|
|
11
|
+
allowfullscreen
|
|
12
|
+
allow="autoplay"
|
|
13
|
+
></iframe>
|
|
14
|
+
<slot name="preview" :thumbnail-url="thumbnailUrl" />
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import axios, { AxiosPromise } from 'axios';
|
|
20
|
+
import { onMounted, ref } from 'vue';
|
|
21
|
+
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
src: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
alt: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
playVideo: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
required: true
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const videoUrl = ref('');
|
|
38
|
+
const thumbnailUrl = ref('');
|
|
39
|
+
const baseOembedVimeoUrl = 'https://vimeo.com/api/oembed.json';
|
|
40
|
+
|
|
41
|
+
const getVimeoVideo = (link: string, params: { [key: string]: string } = {}): AxiosPromise => {
|
|
42
|
+
const urlParams = new URLSearchParams(params).toString();
|
|
43
|
+
const qs = urlParams ? `&${urlParams}` : '';
|
|
44
|
+
return axios.get(`${baseOembedVimeoUrl}?url=${encodeURIComponent(link)}${qs}`);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
onMounted((): void => {
|
|
48
|
+
getVimeoVideo(props.src, { dnt: '1', autoplay: '1' }).then(response => {
|
|
49
|
+
const thumbnailUrlResponse: string = response.data.thumbnail_url;
|
|
50
|
+
if (thumbnailUrlResponse) {
|
|
51
|
+
// Fjerner angivelse af billedeopløsning, for at få billede i fuld størrelse. Linket slutter på fx -d_123x123
|
|
52
|
+
const index = thumbnailUrlResponse.indexOf('-d_');
|
|
53
|
+
thumbnailUrl.value = index !== -1 ? thumbnailUrlResponse.slice(0, index + 2) : thumbnailUrlResponse;
|
|
54
|
+
}
|
|
55
|
+
const { html } = response.data;
|
|
56
|
+
// extract the src attribute from the iframe
|
|
57
|
+
videoUrl.value = html.match(/src="(.*?)"/)![1];
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<style lang="scss" scoped>
|
|
63
|
+
@use '@/styles/custom/_vgVideoFrame.scss';
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
@use '@/styles/utility' as *;
|
|
2
|
+
|
|
3
|
+
.video {
|
|
4
|
+
.video-player {
|
|
5
|
+
position: relative;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
padding-top: 56.25%;
|
|
8
|
+
width: 100%;
|
|
9
|
+
background-color: $color-very-dark-gray;
|
|
10
|
+
|
|
11
|
+
.button-wrapper {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
height: 100%;
|
|
16
|
+
width: 100%;
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 0;
|
|
19
|
+
border: none;
|
|
20
|
+
left: 0;
|
|
21
|
+
|
|
22
|
+
&:focus {
|
|
23
|
+
.icon-svg {
|
|
24
|
+
outline: 2px solid $color-black !important;
|
|
25
|
+
border-radius: 50%;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.icon-svg {
|
|
30
|
+
color: var(--site-primary);
|
|
31
|
+
width: 72px;
|
|
32
|
+
height: 72px;
|
|
33
|
+
position: relative;
|
|
34
|
+
z-index: 3;
|
|
35
|
+
|
|
36
|
+
@include media-breakpoint-down-em(sm) {
|
|
37
|
+
width: 1.5em;
|
|
38
|
+
height: 1.5em;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:hover {
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:deep(*) {
|
|
46
|
+
color: var(--site-primary);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.video-frame {
|
|
52
|
+
position: absolute;
|
|
53
|
+
background-size: cover;
|
|
54
|
+
background-repeat: no-repeat;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
background-color: $background-alternative;
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
width: 100%;
|
|
61
|
+
|
|
62
|
+
&:before {
|
|
63
|
+
content: '';
|
|
64
|
+
position: absolute;
|
|
65
|
+
background-color: rgba($color-very-dark-blue, 0.25);
|
|
66
|
+
height: 100%;
|
|
67
|
+
width: 100%;
|
|
68
|
+
top: 0;
|
|
69
|
+
left: 0;
|
|
70
|
+
z-index: 2;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.cookie-banner {
|
|
76
|
+
width: 100%;
|
|
77
|
+
font-size: 0.875em;
|
|
78
|
+
font-style: italic;
|
|
79
|
+
color: $color-grey-1;
|
|
80
|
+
padding-top: 16px;
|
|
81
|
+
|
|
82
|
+
:deep(a) {
|
|
83
|
+
color: $color-grey-1 !important;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -155,6 +155,9 @@ $color-darkbg-disabled: #758a9f;
|
|
|
155
155
|
$color-mint-green: #eeffe2;
|
|
156
156
|
$color-grey-1: #4f4f4f;
|
|
157
157
|
|
|
158
|
+
// Masterbrand colors
|
|
159
|
+
$virksomhedsudvikling-danmark-color: #D2D0BB;
|
|
160
|
+
|
|
158
161
|
/* CSS variables used for site design which can be overridden on site level
|
|
159
162
|
Remember to override in siteDesign.service.ts. Only variables added to
|
|
160
163
|
/api/content/sites/, for component specific colors, should be added here. */
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
@use './../vg-colors' as *;
|
|
2
|
+
@use './../mixins/vg-mediaquery-helpers' as *;
|
|
3
|
+
|
|
1
4
|
.accordion-wrapper.ydelse {
|
|
2
5
|
& > :last-child {
|
|
3
|
-
margin-bottom:
|
|
6
|
+
margin-bottom: 16px;
|
|
4
7
|
}
|
|
5
8
|
|
|
6
9
|
button.accordion-bulk-button {
|
|
@@ -109,3 +112,31 @@
|
|
|
109
112
|
}
|
|
110
113
|
}
|
|
111
114
|
}
|
|
115
|
+
|
|
116
|
+
.wide-accordion {
|
|
117
|
+
.accordion {
|
|
118
|
+
li {
|
|
119
|
+
margin-bottom: 0;
|
|
120
|
+
border-top: 1px solid $color-light-gray;
|
|
121
|
+
|
|
122
|
+
&:last-child {
|
|
123
|
+
border-bottom: 1px solid $color-light-gray;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.accordion-button {
|
|
127
|
+
padding: 16px 16px 16px 0;
|
|
128
|
+
background-color: transparent;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.accordion-content {
|
|
132
|
+
padding: 8px 16px 8px 0;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&.white-text {
|
|
138
|
+
button.accordion-bulk-button {
|
|
139
|
+
color: $color-white;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@use './../vg-colors' as *;
|
|
2
|
+
@use './../mixins/vg-mediaquery-helpers' as *;
|
|
3
|
+
|
|
1
4
|
.button {
|
|
2
5
|
font-size: 16px;
|
|
3
6
|
font-weight: 400 !important;
|
|
@@ -20,7 +23,7 @@
|
|
|
20
23
|
|
|
21
24
|
&:disabled,
|
|
22
25
|
&.disabled {
|
|
23
|
-
opacity: 0.
|
|
26
|
+
opacity: 0.6 !important;
|
|
24
27
|
cursor: not-allowed;
|
|
25
28
|
}
|
|
26
29
|
|
|
@@ -234,11 +237,15 @@
|
|
|
234
237
|
|
|
235
238
|
&:disabled {
|
|
236
239
|
text-decoration: none;
|
|
237
|
-
opacity: 0.
|
|
240
|
+
opacity: 0.6;
|
|
238
241
|
cursor: not-allowed;
|
|
239
242
|
}
|
|
240
243
|
}
|
|
241
244
|
|
|
245
|
+
.no-decoration {
|
|
246
|
+
text-decoration: none !important;
|
|
247
|
+
}
|
|
248
|
+
|
|
242
249
|
.redaktion {
|
|
243
250
|
button.lightbg {
|
|
244
251
|
color: $color-black;
|