@erst-vg/vg-design-wrapper 2.0.2 → 2.1.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 (192) hide show
  1. package/CHANGELOG.md +49 -45
  2. package/README.md +2 -2
  3. package/dist/src/components/VgVideo.vue.d.ts +0 -8
  4. package/dist/vg-design-wrapper.js +518 -563
  5. package/dist/vg-design-wrapper.umd.cjs +24 -24
  6. package/package.json +91 -89
  7. package/src/assets/icons/abonnementFilled.svg +4 -4
  8. package/src/assets/icons/abonnementOutline.svg +4 -4
  9. package/src/assets/icons/accordion.svg +2 -2
  10. package/src/assets/icons/accordionClose.svg +2 -2
  11. package/src/assets/icons/accordionCloseOld.svg +6 -6
  12. package/src/assets/icons/accordionOpen.svg +3 -3
  13. package/src/assets/icons/accordionOpenOld.svg +6 -6
  14. package/src/assets/icons/accountCircle.svg +2 -2
  15. package/src/assets/icons/add.svg +5 -5
  16. package/src/assets/icons/addBig.svg +5 -5
  17. package/src/assets/icons/afpublicer.svg +2 -2
  18. package/src/assets/icons/agenda.svg +3 -3
  19. package/src/assets/icons/anchorlink.svg +3 -3
  20. package/src/assets/icons/anchormenuer.svg +3 -3
  21. package/src/assets/icons/anden.svg +3 -3
  22. package/src/assets/icons/angleArrowDown.svg +2 -2
  23. package/src/assets/icons/angleArrowUp.svg +2 -2
  24. package/src/assets/icons/ansoegninger.svg +6 -6
  25. package/src/assets/icons/antal-gange.svg +6 -6
  26. package/src/assets/icons/applikationer.svg +2 -2
  27. package/src/assets/icons/arrowLeft.svg +2 -2
  28. package/src/assets/icons/arrowRight.svg +2 -2
  29. package/src/assets/icons/bell.svg +2 -2
  30. package/src/assets/icons/bellAlarmFilled.svg +2 -2
  31. package/src/assets/icons/bellAlarmOutline.svg +2 -2
  32. package/src/assets/icons/bellOvercrossed.svg +2 -2
  33. package/src/assets/icons/beskedcenter.svg +2 -2
  34. package/src/assets/icons/billede.svg +2 -2
  35. package/src/assets/icons/bogmaerker.svg +2 -2
  36. package/src/assets/icons/bookmarkFilled.svg +2 -2
  37. package/src/assets/icons/bookmarkOutline.svg +2 -2
  38. package/src/assets/icons/breadcrumbArrow.svg +3 -3
  39. package/src/assets/icons/bred_smal.svg +3 -3
  40. package/src/assets/icons/cSRDAddDatapunkt.svg +5 -5
  41. package/src/assets/icons/cSRDAddMultipleDatapunkter.svg +7 -7
  42. package/src/assets/icons/cSRDLockedDatapunkt.svg +4 -4
  43. package/src/assets/icons/cSRDRemoveDatapunkt.svg +5 -5
  44. package/src/assets/icons/cSRDRemoveDatapunktOversigt.svg +4 -4
  45. package/src/assets/icons/calendar.svg +2 -2
  46. package/src/assets/icons/calendarOutline.svg +2 -2
  47. package/src/assets/icons/callToAction.svg +2 -2
  48. package/src/assets/icons/card.svg +2 -2
  49. package/src/assets/icons/carouselArrowLeft.svg +2 -2
  50. package/src/assets/icons/carouselArrowRight.svg +2 -2
  51. package/src/assets/icons/category.svg +2 -2
  52. package/src/assets/icons/center.svg +3 -3
  53. package/src/assets/icons/check.svg +2 -2
  54. package/src/assets/icons/chevronLeft.svg +2 -2
  55. package/src/assets/icons/circularArrow.svg +3 -3
  56. package/src/assets/icons/close.svg +2 -2
  57. package/src/assets/icons/closeCircleOutline.svg +2 -2
  58. package/src/assets/icons/closeCirleFilled.svg +2 -2
  59. package/src/assets/icons/copyLink.svg +2 -2
  60. package/src/assets/icons/datahub.svg +2 -2
  61. package/src/assets/icons/deleteOutline.svg +3 -3
  62. package/src/assets/icons/deltagelsesgange.svg +2 -2
  63. package/src/assets/icons/dots.svg +4 -4
  64. package/src/assets/icons/dotsHorizontal.svg +2 -2
  65. package/src/assets/icons/doubleArrow.svg +2 -2
  66. package/src/assets/icons/downRightArrow.svg +2 -2
  67. package/src/assets/icons/download.svg +2 -2
  68. package/src/assets/icons/draggable.svg +5 -5
  69. package/src/assets/icons/email.svg +5 -5
  70. package/src/assets/icons/emner.svg +2 -2
  71. package/src/assets/icons/en_spalte.svg +3 -3
  72. package/src/assets/icons/envelopeFilled.svg +2 -2
  73. package/src/assets/icons/envelopeOutline.svg +4 -4
  74. package/src/assets/icons/error.svg +2 -2
  75. package/src/assets/icons/excel.svg +4 -4
  76. package/src/assets/icons/expandCircleRight.svg +3 -3
  77. package/src/assets/icons/eyeHide.svg +2 -2
  78. package/src/assets/icons/file.svg +5 -5
  79. package/src/assets/icons/filter.svg +2 -2
  80. package/src/assets/icons/filter2.svg +20 -20
  81. package/src/assets/icons/fire_spalter.svg +3 -3
  82. package/src/assets/icons/graph.svg +2 -2
  83. package/src/assets/icons/helpCircleOutline.svg +5 -5
  84. package/src/assets/icons/hero.svg +2 -2
  85. package/src/assets/icons/highlightArrow.svg +3 -3
  86. package/src/assets/icons/history.svg +2 -2
  87. package/src/assets/icons/home.svg +5 -5
  88. package/src/assets/icons/image.svg +5 -5
  89. package/src/assets/icons/indsaet.svg +2 -2
  90. package/src/assets/icons/indstillinger.svg +2 -2
  91. package/src/assets/icons/info.svg +4 -4
  92. package/src/assets/icons/infobox.svg +2 -2
  93. package/src/assets/icons/knap.svg +2 -2
  94. package/src/assets/icons/kontaktformular.svg +2 -2
  95. package/src/assets/icons/kopi.svg +2 -2
  96. package/src/assets/icons/leftUpCurvedArrow.svg +2 -2
  97. package/src/assets/icons/letter.svg +2 -2
  98. package/src/assets/icons/link.svg +2 -2
  99. package/src/assets/icons/linkboks.svg +4 -4
  100. package/src/assets/icons/linkedin.svg +5 -5
  101. package/src/assets/icons/liste.svg +2 -2
  102. package/src/assets/icons/listecard.svg +2 -2
  103. package/src/assets/icons/loading.svg +2 -2
  104. package/src/assets/icons/location.svg +2 -2
  105. package/src/assets/icons/lock.svg +6 -6
  106. package/src/assets/icons/loginbanner.svg +2 -2
  107. package/src/assets/icons/magnify.svg +2 -2
  108. package/src/assets/icons/magnifyBig.svg +2 -2
  109. package/src/assets/icons/map.svg +2 -2
  110. package/src/assets/icons/menu.svg +2 -2
  111. package/src/assets/icons/menuDown.svg +2 -2
  112. package/src/assets/icons/menuUp.svg +2 -2
  113. package/src/assets/icons/minus.svg +2 -2
  114. package/src/assets/icons/mitId.svg +3 -3
  115. package/src/assets/icons/notVerified.svg +2 -2
  116. package/src/assets/icons/notes.svg +5 -5
  117. package/src/assets/icons/online.svg +2 -2
  118. package/src/assets/icons/openInNew.svg +2 -2
  119. package/src/assets/icons/paere.svg +7 -7
  120. package/src/assets/icons/paginationChevronLeft.svg +4 -4
  121. package/src/assets/icons/paginationChevronRight.svg +4 -4
  122. package/src/assets/icons/paginationFirstPage.svg +4 -4
  123. package/src/assets/icons/paginationLastPage.svg +4 -4
  124. package/src/assets/icons/partnergruppe.svg +5 -5
  125. package/src/assets/icons/pause.svg +2 -2
  126. package/src/assets/icons/pdf.svg +4 -4
  127. package/src/assets/icons/pdfDownload.svg +2 -2
  128. package/src/assets/icons/pencil.svg +2 -2
  129. package/src/assets/icons/pencilOutline.svg +2 -2
  130. package/src/assets/icons/people.svg +4 -4
  131. package/src/assets/icons/phone.svg +5 -5
  132. package/src/assets/icons/play.svg +4 -4
  133. package/src/assets/icons/playVideo.svg +4 -4
  134. package/src/assets/icons/plus.svg +2 -2
  135. package/src/assets/icons/powerpoint.svg +4 -4
  136. package/src/assets/icons/praedefineretSoegning.svg +2 -2
  137. package/src/assets/icons/questionmark.svg +3 -3
  138. package/src/assets/icons/quote.svg +2 -2
  139. package/src/assets/icons/redaktion.svg +2 -2
  140. package/src/assets/icons/remove.svg +2 -2
  141. package/src/assets/icons/removeRedEyeOutline.svg +2 -2
  142. package/src/assets/icons/revert.svg +3 -3
  143. package/src/assets/icons/richtext.svg +2 -2
  144. package/src/assets/icons/roundCheckmark.svg +2 -2
  145. package/src/assets/icons/save.svg +2 -2
  146. package/src/assets/icons/sektionsoverskrift.svg +5 -5
  147. package/src/assets/icons/smal_bred.svg +3 -3
  148. package/src/assets/icons/starFilled.svg +2 -2
  149. package/src/assets/icons/starOutline.svg +2 -2
  150. package/src/assets/icons/tag.svg +2 -2
  151. package/src/assets/icons/teaser.svg +3 -3
  152. package/src/assets/icons/teaserbillede.svg +2 -2
  153. package/src/assets/icons/tekstgruppe.svg +2 -2
  154. package/src/assets/icons/time.svg +6 -6
  155. package/src/assets/icons/to_spalter.svg +3 -3
  156. package/src/assets/icons/top.svg +3 -3
  157. package/src/assets/icons/trashCan.svg +2 -2
  158. package/src/assets/icons/tre_spalter.svg +3 -3
  159. package/src/assets/icons/udvidedeCardgruppe.svg +2 -2
  160. package/src/assets/icons/unlock.svg +2 -2
  161. package/src/assets/icons/verified.svg +2 -2
  162. package/src/assets/icons/video.svg +2 -2
  163. package/src/assets/icons/word.svg +10 -10
  164. package/src/assets/icons/zoom.svg +2 -2
  165. package/src/components/VgAccordion.vue +97 -97
  166. package/src/components/VgButton.vue +18 -18
  167. package/src/components/VgButtons.vue +27 -27
  168. package/src/components/VgCard.vue +96 -96
  169. package/src/components/VgCardGroup.vue +18 -18
  170. package/src/components/VgDesignWrapper.vue +45 -45
  171. package/src/components/VgIcon.vue +54 -54
  172. package/src/components/VgKalturaVideo.vue +70 -0
  173. package/src/components/VgListe.vue +73 -73
  174. package/src/components/VgListeCard.vue +41 -41
  175. package/src/components/VgLoginButton.vue +7 -7
  176. package/src/components/VgPagination.vue +207 -207
  177. package/src/components/VgVideo.vue +59 -0
  178. package/src/components/VgVideoToolVideo.vue +70 -0
  179. package/src/styles/custom/_vgAccordion.scss +39 -39
  180. package/src/styles/custom/_vgCard.scss +15 -15
  181. package/src/styles/custom/_vgIcon.scss +3 -3
  182. package/src/styles/custom/_vgListe.scss +3 -3
  183. package/src/styles/custom/_vgVideo.scss +86 -0
  184. package/src/styles/custom/_vgVideoFrame.scss +9 -0
  185. package/src/styles/utility.scss +2 -2
  186. package/src/styles/vg/_vg-colors.scss +209 -209
  187. package/src/styles/vg/accordion/_vg-accordion.scss +140 -142
  188. package/src/styles/vg/buttons/_vg-buttons.scss +365 -365
  189. package/src/styles/vg/mixins/_vg-mediaquery-helpers.scss +159 -159
  190. package/src/styles/vg/pagination/_vg-pagination.scss +69 -69
  191. package/dist/src/components/VgVimeoVideo.vue.d.ts +0 -39
  192. package/dist/tests/unit/components/VgVimeoVideo.spec.d.ts +0 -1
@@ -1,97 +1,97 @@
1
- <template>
2
- <div>
3
- <button
4
- v-if="bulk"
5
- type="button"
6
- class="accordion-bulk-button"
7
- data-accordion-bulk-expand="true"
8
- data-testid="button-bulk"
9
- data-cy="button-bulk"
10
- @click="$emit('toggle-bulk')"
11
- >
12
- Åbn alle
13
- </button>
14
- <ul :id="`accordion-list-${accordionListId}`" class="accordion vg-accordion">
15
- <li v-for="(data, index) in accordions" :key="index" data-testid="accordion" data-cy="accordion">
16
- <div class="top-wrapper">
17
- <slot name="before" :data="data" :index="index" />
18
- <component :is="heading" class="my-0">
19
- <button
20
- type="button"
21
- class="accordion-button"
22
- :aria-expanded="false"
23
- :aria-controls="`accordion-${accordionListId}-${index}`"
24
- @click="toggle($event, index)"
25
- >
26
- <span class="accordion-title h4">
27
- <template v-if="hasKey('titel', index)">{{ data.titel }}</template>
28
- <slot v-else name="titel" :data="data" :index="index" />
29
- </span>
30
- <VgIcon class="open" icon="accordionOpen" />
31
- <VgIcon class="close" icon="accordionClose" />
32
- </button>
33
- </component>
34
- </div>
35
- <div :id="`accordion-${accordionListId}-${index}`" :aria-hidden="true" class="accordion-content" data-testid="accordion-content">
36
- <template v-if="hasKey('indhold', index)">
37
- <p>{{ data.indhold }}</p>
38
- </template>
39
- <slot v-else name="indhold" :data="data" :index="index" />
40
- </div>
41
- </li>
42
- </ul>
43
- </div>
44
- </template>
45
-
46
- <script setup lang="ts">
47
- import VgIcon from '@/components/VgIcon.vue';
48
- import * as DKFDS from 'dkfds';
49
- import { computed, onMounted, PropType } from 'vue';
50
-
51
- const emits = defineEmits(['toggle', 'toggle-bulk']);
52
-
53
- const props = defineProps({
54
- accordions: {
55
- type: Array as PropType<any>,
56
- default: null
57
- },
58
- id: {
59
- type: String,
60
- default: undefined,
61
- required: false
62
- },
63
- bulk: {
64
- type: Boolean,
65
- default: false
66
- },
67
- heading: {
68
- type: String as PropType<'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'>,
69
- default: 'h2'
70
- }
71
- });
72
-
73
- const accordionListId = computed((): string => props.id ?? Math.random().toString().replace('.', ''));
74
-
75
- onMounted(() => {
76
- const selector = `#accordion-list-${accordionListId.value}`;
77
- const elm = document.querySelector(`.applikation-container ${selector}`);
78
-
79
- if (!elm) {
80
- // eslint-disable-next-line no-console
81
- console.warn(`vg-design-wrapper: kan ikke finde accordion element ud fra selector ${selector}`);
82
- } else {
83
- new DKFDS.Accordion(elm).init();
84
- }
85
- });
86
-
87
- const hasKey = (key: string, index: number): boolean => !!props.accordions[index]?.[key];
88
-
89
- const toggle = (event: Event, index: number) => {
90
- const button = event.target as HTMLButtonElement;
91
- emits('toggle', button.ariaExpanded === 'false', accordionListId.value, index);
92
- };
93
- </script>
94
-
95
- <style lang="scss" scoped>
96
- @use '@/styles/custom/_vgAccordion.scss';
97
- </style>
1
+ <template>
2
+ <div>
3
+ <button
4
+ v-if="bulk"
5
+ type="button"
6
+ class="accordion-bulk-button"
7
+ data-accordion-bulk-expand="true"
8
+ data-testid="button-bulk"
9
+ data-cy="button-bulk"
10
+ @click="$emit('toggle-bulk')"
11
+ >
12
+ Åbn alle
13
+ </button>
14
+ <ul :id="`accordion-list-${accordionListId}`" class="accordion vg-accordion">
15
+ <li v-for="(data, index) in accordions" :key="index" data-testid="accordion" data-cy="accordion">
16
+ <div class="top-wrapper">
17
+ <slot name="before" :data="data" :index="index" />
18
+ <component :is="heading" class="my-0">
19
+ <button
20
+ type="button"
21
+ class="accordion-button"
22
+ :aria-expanded="false"
23
+ :aria-controls="`accordion-${accordionListId}-${index}`"
24
+ @click="toggle($event, index)"
25
+ >
26
+ <span class="accordion-title h4">
27
+ <template v-if="hasKey('titel', index)">{{ data.titel }}</template>
28
+ <slot v-else name="titel" :data="data" :index="index" />
29
+ </span>
30
+ <VgIcon class="open" icon="accordionOpen" />
31
+ <VgIcon class="close" icon="accordionClose" />
32
+ </button>
33
+ </component>
34
+ </div>
35
+ <div :id="`accordion-${accordionListId}-${index}`" :aria-hidden="true" class="accordion-content" data-testid="accordion-content">
36
+ <template v-if="hasKey('indhold', index)">
37
+ <p>{{ data.indhold }}</p>
38
+ </template>
39
+ <slot v-else name="indhold" :data="data" :index="index" />
40
+ </div>
41
+ </li>
42
+ </ul>
43
+ </div>
44
+ </template>
45
+
46
+ <script setup lang="ts">
47
+ import VgIcon from '@/components/VgIcon.vue';
48
+ import * as DKFDS from 'dkfds';
49
+ import { computed, onMounted, PropType } from 'vue';
50
+
51
+ const emits = defineEmits(['toggle', 'toggle-bulk']);
52
+
53
+ const props = defineProps({
54
+ accordions: {
55
+ type: Array as PropType<any>,
56
+ default: null
57
+ },
58
+ id: {
59
+ type: String,
60
+ default: undefined,
61
+ required: false
62
+ },
63
+ bulk: {
64
+ type: Boolean,
65
+ default: false
66
+ },
67
+ heading: {
68
+ type: String as PropType<'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'>,
69
+ default: 'h2'
70
+ }
71
+ });
72
+
73
+ const accordionListId = computed((): string => props.id ?? Math.random().toString().replace('.', ''));
74
+
75
+ onMounted(() => {
76
+ const selector = `#accordion-list-${accordionListId.value}`;
77
+ const elm = document.querySelector(`.applikation-container ${selector}`);
78
+
79
+ if (!elm) {
80
+ // eslint-disable-next-line no-console
81
+ console.warn(`vg-design-wrapper: kan ikke finde accordion element ud fra selector ${selector}`);
82
+ } else {
83
+ new DKFDS.Accordion(elm).init();
84
+ }
85
+ });
86
+
87
+ const hasKey = (key: string, index: number): boolean => !!props.accordions[index]?.[key];
88
+
89
+ const toggle = (event: Event, index: number) => {
90
+ const button = event.target as HTMLButtonElement;
91
+ emits('toggle', button.ariaExpanded === 'false', accordionListId.value, index);
92
+ };
93
+ </script>
94
+
95
+ <style lang="scss" scoped>
96
+ @use '@/styles/custom/_vgAccordion.scss';
97
+ </style>
@@ -1,18 +1,18 @@
1
- <template>
2
- <button type="button" class="button">
3
- <VgIcon v-if="icon" :icon="icon" />
4
- <slot />
5
- </button>
6
- </template>
7
-
8
- <script setup lang="ts">
9
- import VgIcon from '@/components/VgIcon.vue';
10
-
11
- defineProps({
12
- icon: {
13
- type: String,
14
- required: false,
15
- default: ''
16
- }
17
- });
18
- </script>
1
+ <template>
2
+ <button type="button" class="button">
3
+ <VgIcon v-if="icon" :icon="icon" />
4
+ <slot />
5
+ </button>
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ import VgIcon from '@/components/VgIcon.vue';
10
+
11
+ defineProps({
12
+ icon: {
13
+ type: String,
14
+ required: false,
15
+ default: ''
16
+ }
17
+ });
18
+ </script>
@@ -1,27 +1,27 @@
1
- <template>
2
- <div>
3
- <h4>Primærknap</h4>
4
- <div class="d-md-flex">
5
- <button type="button" class="button button-primary">knap</button>
6
- <button type="button" class="button button-primary disabled">knap</button>
7
- </div>
8
- <h4>Sekundærknapper</h4>
9
- <div class="d-md-flex">
10
- <button type="button" class="button button-secondary">knap</button>
11
- <button type="button" class="button button-secondary disabled">knap</button>
12
- </div>
13
- <h4>Tertiærknapper</h4>
14
- <div>Anvendes ikke</div>
15
- <h4>Link knap</h4>
16
- <VgButton icon="arrowLeft" class="button-link">Foobar</VgButton>
17
- <h4>Knap med ikon</h4>
18
- <VgButton icon="arrowLeft" class="button-primary">Knap med ikon </VgButton>
19
- <h4>Login-knap med MitID design</h4>
20
- <VgLoginButton />
21
- </div>
22
- </template>
23
-
24
- <script setup lang="ts">
25
- import VgButton from '@/components/VgButton.vue';
26
- import VgLoginButton from '@/components/VgLoginButton.vue';
27
- </script>
1
+ <template>
2
+ <div>
3
+ <h4>Primærknap</h4>
4
+ <div class="d-md-flex">
5
+ <button type="button" class="button button-primary">knap</button>
6
+ <button type="button" class="button button-primary disabled">knap</button>
7
+ </div>
8
+ <h4>Sekundærknapper</h4>
9
+ <div class="d-md-flex">
10
+ <button type="button" class="button button-secondary">knap</button>
11
+ <button type="button" class="button button-secondary disabled">knap</button>
12
+ </div>
13
+ <h4>Tertiærknapper</h4>
14
+ <div>Anvendes ikke</div>
15
+ <h4>Link knap</h4>
16
+ <VgButton icon="arrowLeft" class="button-link">Foobar</VgButton>
17
+ <h4>Knap med ikon</h4>
18
+ <VgButton icon="arrowLeft" class="button-primary">Knap med ikon </VgButton>
19
+ <h4>Login-knap med MitID design</h4>
20
+ <VgLoginButton />
21
+ </div>
22
+ </template>
23
+
24
+ <script setup lang="ts">
25
+ import VgButton from '@/components/VgButton.vue';
26
+ import VgLoginButton from '@/components/VgLoginButton.vue';
27
+ </script>
@@ -1,96 +1,96 @@
1
- <template>
2
- <div class="udvidet-card-container">
3
- <a
4
- :href="link.href"
5
- :target="link.external ? '_blank' : undefined"
6
- :title="link.title"
7
- class="udvidet-cardgruppe-card udvidet-card"
8
- :class="{ 'without-image': !billede?.url }"
9
- >
10
- <div v-if="showBilleder" class="picture-container">
11
- <div class="picture-wrapper">
12
- <div
13
- v-if="billede?.url"
14
- role="img"
15
- :aria-label="billede.label"
16
- class="card-picture"
17
- :data-src="billede?.url"
18
- lazy="loaded"
19
- data-testid="billede"
20
- :style="{ backgroundImage: `url('${billede?.url}')` }"
21
- ></div>
22
- <div v-else class="picture-empty" />
23
- </div>
24
- </div>
25
- <div class="text-wrapper">
26
- <div>
27
- <div class="text">
28
- <div v-if="label" class="label-container">
29
- <p class="h6 m-0 show-spaces break-word" data-testid="label">{{ label }}</p>
30
- </div>
31
- <div class="card-titel">
32
- <h3 class="h4 mt-0 mb-3 break-word" data-testid="overskrift">{{ overskrift }}</h3>
33
- </div>
34
- <pre class="mt-0 mb-3 break-word">
35
- <slot name="text"/>
36
- </pre>
37
- </div>
38
- </div>
39
- <div v-if="linkText" class="bottom mt-3">
40
- <div class="fremhaevet-link" :class="{ 'line-limit': true }" data-testid="link">
41
- <span class="mr-3" data-testid="link-text">{{ linkText }}</span>
42
- <VgIcon
43
- :icon="link.external ? 'openInNew' : 'highlightArrow'"
44
- :class="{
45
- 'external-link-icon': link.external,
46
- 'link-icon': true
47
- }"
48
- />
49
- </div>
50
- </div>
51
- </div>
52
- </a>
53
- </div>
54
- </template>
55
-
56
- <script setup lang="ts">
57
- import VgIcon from '@/components/VgIcon.vue';
58
- import { PropType } from 'vue';
59
- defineProps({
60
- billede: {
61
- type: Object as PropType<{
62
- url: string;
63
- label?: string;
64
- }>,
65
- default: undefined
66
- },
67
- showBilleder: {
68
- type: Boolean,
69
- default: true
70
- },
71
- label: {
72
- type: String,
73
- default: undefined
74
- },
75
- overskrift: {
76
- type: String,
77
- required: true
78
- },
79
- linkText: {
80
- type: String,
81
- default: undefined
82
- },
83
- link: {
84
- type: Object as PropType<{
85
- href: string;
86
- title: string;
87
- external: boolean;
88
- }>,
89
- required: true
90
- }
91
- });
92
- </script>
93
-
94
- <style lang="scss" scoped>
95
- @use '@/styles/custom/_vgCard.scss';
96
- </style>
1
+ <template>
2
+ <div class="udvidet-card-container">
3
+ <a
4
+ :href="link.href"
5
+ :target="link.external ? '_blank' : undefined"
6
+ :title="link.title"
7
+ class="udvidet-cardgruppe-card udvidet-card"
8
+ :class="{ 'without-image': !billede?.url }"
9
+ >
10
+ <div v-if="showBilleder" class="picture-container">
11
+ <div class="picture-wrapper">
12
+ <div
13
+ v-if="billede?.url"
14
+ role="img"
15
+ :aria-label="billede.label"
16
+ class="card-picture"
17
+ :data-src="billede?.url"
18
+ lazy="loaded"
19
+ data-testid="billede"
20
+ :style="{ backgroundImage: `url('${billede?.url}')` }"
21
+ ></div>
22
+ <div v-else class="picture-empty" />
23
+ </div>
24
+ </div>
25
+ <div class="text-wrapper">
26
+ <div>
27
+ <div class="text">
28
+ <div v-if="label" class="label-container">
29
+ <p class="h6 m-0 show-spaces break-word" data-testid="label">{{ label }}</p>
30
+ </div>
31
+ <div class="card-titel">
32
+ <h3 class="h4 mt-0 mb-3 break-word" data-testid="overskrift">{{ overskrift }}</h3>
33
+ </div>
34
+ <pre class="mt-0 mb-3 break-word">
35
+ <slot name="text"/>
36
+ </pre>
37
+ </div>
38
+ </div>
39
+ <div v-if="linkText" class="bottom mt-3">
40
+ <div class="fremhaevet-link" :class="{ 'line-limit': true }" data-testid="link">
41
+ <span class="mr-3" data-testid="link-text">{{ linkText }}</span>
42
+ <VgIcon
43
+ :icon="link.external ? 'openInNew' : 'highlightArrow'"
44
+ :class="{
45
+ 'external-link-icon': link.external,
46
+ 'link-icon': true
47
+ }"
48
+ />
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </a>
53
+ </div>
54
+ </template>
55
+
56
+ <script setup lang="ts">
57
+ import VgIcon from '@/components/VgIcon.vue';
58
+ import { PropType } from 'vue';
59
+ defineProps({
60
+ billede: {
61
+ type: Object as PropType<{
62
+ url: string;
63
+ label?: string;
64
+ }>,
65
+ default: undefined
66
+ },
67
+ showBilleder: {
68
+ type: Boolean,
69
+ default: true
70
+ },
71
+ label: {
72
+ type: String,
73
+ default: undefined
74
+ },
75
+ overskrift: {
76
+ type: String,
77
+ required: true
78
+ },
79
+ linkText: {
80
+ type: String,
81
+ default: undefined
82
+ },
83
+ link: {
84
+ type: Object as PropType<{
85
+ href: string;
86
+ title: string;
87
+ external: boolean;
88
+ }>,
89
+ required: true
90
+ }
91
+ });
92
+ </script>
93
+
94
+ <style lang="scss" scoped>
95
+ @use '@/styles/custom/_vgCard.scss';
96
+ </style>
@@ -1,18 +1,18 @@
1
- <template>
2
- <div class="udvidet-cardgruppe">
3
- <h2 class="udvidet-cardgruppe__titel mt-0 mb-6" data-testid="titel">{{ titel }}</h2>
4
- <div class="row cardrow">
5
- <slot />
6
- </div>
7
- </div>
8
- </template>
9
-
10
- <script setup lang="ts">
11
- defineProps({
12
- titel: {
13
- type: String,
14
- required: false,
15
- default: undefined
16
- }
17
- });
18
- </script>
1
+ <template>
2
+ <div class="udvidet-cardgruppe">
3
+ <h2 class="udvidet-cardgruppe__titel mt-0 mb-6" data-testid="titel">{{ titel }}</h2>
4
+ <div class="row cardrow">
5
+ <slot />
6
+ </div>
7
+ </div>
8
+ </template>
9
+
10
+ <script setup lang="ts">
11
+ defineProps({
12
+ titel: {
13
+ type: String,
14
+ required: false,
15
+ default: undefined
16
+ }
17
+ });
18
+ </script>
@@ -1,45 +1,45 @@
1
- <template>
2
- <div class="applikation-container" data-testid="applikation-container">
3
- <div v-if="customSvgIcons.length > 0" class="hide-base-svg">
4
- <!-- eslint-disable-next-line vue/no-v-html -->
5
- <svg xmlns="http://www.w3.org/2000/svg" v-html="customSvgIcons"></svg>
6
- </div>
7
- <slot />
8
- </div>
9
- </template>
10
-
11
- <script setup lang="ts">
12
- import { computed, inject, onMounted, ref, Ref } from 'vue';
13
- const siteIkoner = inject('siteIkoner');
14
-
15
- const customIcons: Ref<string[]> = ref([]);
16
-
17
- const customSvgIcons = computed((): string => customIcons.value.join(''));
18
-
19
- onMounted(() => {
20
- if (siteIkoner) {
21
- const parser = new DOMParser();
22
- const svgSymbol = 'symbol';
23
- Object.entries(siteIkoner).forEach(([key, value]) => {
24
- if (value.includes(`<${svgSymbol}`)) {
25
- const doc = parser.parseFromString(value, 'image/svg+xml');
26
- const symbolEl = doc.querySelector(svgSymbol);
27
- if (symbolEl) {
28
- // Sæt ID så SVG kan vises med xlink:href
29
- symbolEl.id = key;
30
- customIcons.value.push(symbolEl.outerHTML);
31
- }
32
- }
33
- });
34
- }
35
- });
36
- </script>
37
-
38
- <style lang="scss">
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';
45
- </style>
1
+ <template>
2
+ <div class="applikation-container" data-testid="applikation-container">
3
+ <div v-if="customSvgIcons.length > 0" class="hide-base-svg">
4
+ <!-- eslint-disable-next-line vue/no-v-html -->
5
+ <svg xmlns="http://www.w3.org/2000/svg" v-html="customSvgIcons"></svg>
6
+ </div>
7
+ <slot />
8
+ </div>
9
+ </template>
10
+
11
+ <script setup lang="ts">
12
+ import { computed, inject, onMounted, ref, Ref } from 'vue';
13
+ const siteIkoner = inject('siteIkoner');
14
+
15
+ const customIcons: Ref<string[]> = ref([]);
16
+
17
+ const customSvgIcons = computed((): string => customIcons.value.join(''));
18
+
19
+ onMounted(() => {
20
+ if (siteIkoner) {
21
+ const parser = new DOMParser();
22
+ const svgSymbol = 'symbol';
23
+ Object.entries(siteIkoner).forEach(([key, value]) => {
24
+ if (value.includes(`<${svgSymbol}`)) {
25
+ const doc = parser.parseFromString(value, 'image/svg+xml');
26
+ const symbolEl = doc.querySelector(svgSymbol);
27
+ if (symbolEl) {
28
+ // Sæt ID så SVG kan vises med xlink:href
29
+ symbolEl.id = key;
30
+ customIcons.value.push(symbolEl.outerHTML);
31
+ }
32
+ }
33
+ });
34
+ }
35
+ });
36
+ </script>
37
+
38
+ <style lang="scss">
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';
45
+ </style>