@gitlab/ui 114.6.0 → 114.7.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.
|
@@ -10,7 +10,7 @@ import { isEvent } from '../../../vendor/bootstrap-vue/src/utils/inspect';
|
|
|
10
10
|
import { stringifyQueryObj } from '../../../vendor/bootstrap-vue/src/utils/router';
|
|
11
11
|
import { safeVueInstance } from '../../../vendor/bootstrap-vue/src/utils/safe-vue-instance';
|
|
12
12
|
import { attemptFocus, attemptBlur } from '../../../vendor/bootstrap-vue/src/utils/dom';
|
|
13
|
-
import { linkVariantOptions, isVue3, linkVariantInline,
|
|
13
|
+
import { linkVariantOptions, isVue3, linkVariantUnstyled, linkVariantInline, linkVariantMeta } from '../../../utils/constants';
|
|
14
14
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
15
15
|
|
|
16
16
|
//
|
|
@@ -124,7 +124,7 @@ var script = {
|
|
|
124
124
|
default: null
|
|
125
125
|
},
|
|
126
126
|
/**
|
|
127
|
-
*
|
|
127
|
+
* Controls ↗ character visibility for external links
|
|
128
128
|
*/
|
|
129
129
|
showExternalIcon: {
|
|
130
130
|
type: Boolean,
|
|
@@ -161,8 +161,9 @@ var script = {
|
|
|
161
161
|
isVue3RouterLink() {
|
|
162
162
|
return this.tag === VUE_ROUTER_LINK_TAG && isVue3;
|
|
163
163
|
},
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
shouldShowExternalIcon() {
|
|
165
|
+
const allowedVariants = [linkVariantInline, linkVariantMeta, null]; // null represents default/UI variant
|
|
166
|
+
return this.showExternalIcon && allowedVariants.includes(this.variant) && this.href && isExternalURL(this.target, this.href);
|
|
166
167
|
},
|
|
167
168
|
computedHref() {
|
|
168
169
|
const fallback = '#';
|
|
@@ -234,7 +235,7 @@ var script = {
|
|
|
234
235
|
return ['gl-link', linkVariantOptions[this.variant], {
|
|
235
236
|
disabled: this.disabled,
|
|
236
237
|
active: this.active,
|
|
237
|
-
'gl-link-
|
|
238
|
+
'gl-link-external': this.shouldShowExternalIcon
|
|
238
239
|
}];
|
|
239
240
|
}
|
|
240
241
|
},
|