@asd20/ui 3.2.1012 → 3.2.1014

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "*.scss",
6
6
  "*.vue"
7
7
  ],
8
- "version": "3.2.1012",
8
+ "version": "3.2.1014",
9
9
  "private": false,
10
10
  "license": "MIT",
11
11
  "repository": {
@@ -19,6 +19,9 @@
19
19
  <div v-if="shortDescription" class="lead short-description">
20
20
  <span v-html="shortDescription"></span>
21
21
  <a v-if="detailLink" :href="detailLink">{{ detailLinkLabel }}</a>
22
+ <span class="external-link" v-if="isAbsoluteUrl(detailLink)">
23
+ <asd20-icon name="external" size="sm" />
24
+ </span>
22
25
  </div>
23
26
  <p
24
27
  v-if="longDescription"
@@ -48,9 +51,11 @@
48
51
 
49
52
  <script>
50
53
  import Asd20Button from '../Asd20Button'
54
+ import Asd20Icon from '../Asd20Icon'
55
+
51
56
  export default {
52
57
  name: 'Asd20Messaging',
53
- components: { Asd20Button },
58
+ components: { Asd20Button, Asd20Icon },
54
59
  props: {
55
60
  images: { type: Array, default: () => [] },
56
61
  heading: { type: String, default: '' },
@@ -67,10 +72,7 @@ export default {
67
72
 
68
73
  computed: {
69
74
  hash() {
70
- return this.heading
71
- .toLowerCase()
72
- .split(' ')
73
- .join('-')
75
+ return this.heading.toLowerCase().split(' ').join('-')
74
76
  },
75
77
  classes() {
76
78
  return {
@@ -94,7 +96,11 @@ export default {
94
96
  if (coverImage) {
95
97
  const coverImageFiles = coverImage.files || []
96
98
  const coverImageFull = coverImageFiles.find(f => f.name === 'full')
97
- if (coverImageFull && coverImageFull.filename && coverImageFull.filename.includes('headerimage')) {
99
+ if (
100
+ coverImageFull &&
101
+ coverImageFull.filename &&
102
+ coverImageFull.filename.includes('headerimage')
103
+ ) {
98
104
  messageImageUrl = ''
99
105
  } else {
100
106
  messageImageUrl = coverImageFull
@@ -112,6 +118,13 @@ export default {
112
118
  return coverImage.metadata.alt
113
119
  },
114
120
  },
121
+ methods: {
122
+ isAbsoluteUrl(url) {
123
+ if (!url || typeof url !== 'string') return false
124
+ const s = url.trim()
125
+ return /^https?:\/\//i.test(s) || s.startsWith('//')
126
+ },
127
+ },
115
128
  }
116
129
  </script>
117
130
 
@@ -159,6 +172,11 @@ export default {
159
172
  }
160
173
  &__content {
161
174
  align-self: stretch;
175
+ .external-link {
176
+ display: inline-block;
177
+ line-height: 0;
178
+ vertical-align: -0.3rem;
179
+ }
162
180
  }
163
181
  &__body-content {
164
182
  margin-bottom: space(1);
@@ -108,7 +108,13 @@
108
108
  :target="
109
109
  !item.url || item.url.startsWith('/') ? undefined : '_blank'
110
110
  "
111
- >{{ item.title }}</a
111
+ >{{ item.title }}
112
+ <asd20-icon
113
+ v-if="isAbsoluteUrl(item.url)"
114
+ name="external"
115
+ size="sm"
116
+ style="margin-left: 0.25rem"
117
+ /></a
112
118
  >
113
119
  </div>
114
120
  </div>
@@ -290,6 +296,11 @@ export default {
290
296
  shiftKeyNotPressed() {
291
297
  this.next()
292
298
  },
299
+ isAbsoluteUrl(url) {
300
+ if (!url || typeof url !== 'string') return false
301
+ const s = url.trim()
302
+ return /^https?:\/\//i.test(s) || s.startsWith('//')
303
+ },
293
304
  },
294
305
  }
295
306
  </script>
@@ -510,7 +510,7 @@
510
510
  "id": "d7d84e8e-446e-11ea-9d5c-c35d5b2134f1",
511
511
  "title": "Meals and nutrition details.",
512
512
  "trackingCode": null,
513
- "url": "/student-services/nutrition-and-food-services"
513
+ "url": "https://asd20.org/student-services/nutrition-and-food-services"
514
514
  }
515
515
  }
516
516
  ],
@@ -830,7 +830,7 @@
830
830
  "parentMenuItemId": "de03c667-3742-11ea-a71e-a93d820ffeff",
831
831
  "order": 1,
832
832
  "title": "Alternative Education",
833
- "url": "/academics/alternative-education",
833
+ "url": "https://asd20.org/academics/alternative-education",
834
834
  "icon": ""
835
835
  },
836
836
  {