@gitlab/ui 137.1.0 → 137.1.2

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.
@@ -1,5 +1,6 @@
1
1
  import { isString, isObject, toString, isBoolean, concat, isFunction } from 'lodash-es';
2
2
  import { SafeLinkDirective, isExternalURL } from '../../../directives/safe_link/safe_link';
3
+ import { translate } from '../../../utils/i18n';
3
4
  import { stopEvent } from '../../../utils/utils';
4
5
  import { buildQueryString } from '../../../utils/url_utils';
5
6
  import { safeVueInstance, isVue3 } from '../../../utils/vue_utils';
@@ -175,6 +176,9 @@ var script = {
175
176
  isVue3RouterLink() {
176
177
  return this.tag === VUE_ROUTER_LINK_TAG && isVue3(this);
177
178
  },
179
+ externalLinkLabel() {
180
+ return this.shouldShowExternalIcon ? translate('GlLink.externalLink', '(external link)') : undefined;
181
+ },
178
182
  shouldShowExternalIcon() {
179
183
  const allowedVariants = [linkVariantInline, linkVariantMeta, null]; // null represents default/UI variant
180
184
  return this.showExternalIcon && allowedVariants.includes(this.variant) && this.href && isExternalURL(this.target, this.href);
@@ -314,7 +318,7 @@ var _obj;
314
318
  var routerLinkHref = ref.href;
315
319
  var isActive = ref.isActive;
316
320
  var isExactActive = ref.isExactActive;
317
- var navigate = ref.navigate;return [_c('a',_vm._g(_vm._b({directives:[{name:"safe-link",rawName:"v-safe-link:[safeLinkConfig]",arg:_vm.safeLinkConfig}],class:[_vm.computedClass, ( _obj = {}, _obj[_vm.activeClass] = isActive, _obj[_vm.exactActiveClass] = isExactActive, _obj )],attrs:{"href":routerLinkHref},on:{"click":function($event){return _vm.onClick($event, navigate)}}},'a',_vm.$attrs,false),_vm.computedListeners),[_vm._t("default")],2)]}}],null,true)},'component',_vm.computedProps,false)):(_vm.isRouterLink)?_c(_vm.tag,_vm._g(_vm._b({directives:[{name:"safe-link",rawName:"v-safe-link:[safeLinkConfig]",arg:_vm.safeLinkConfig}],tag:"component",class:_vm.computedClass,nativeOn:{"click":function($event){return _vm.onClick.apply(null, arguments)}}},'component',_vm.computedProps,false),_vm.computedListeners),[_vm._t("default")],2):_c(_vm.tag,_vm._g(_vm._b({directives:[{name:"safe-link",rawName:"v-safe-link:[safeLinkConfig]",arg:_vm.safeLinkConfig}],tag:"component",class:_vm.computedClass,on:{"click":_vm.onClick}},'component',_vm.computedProps,false),_vm.computedListeners),[_vm._t("default")],2)};
321
+ var navigate = ref.navigate;return [_c('a',_vm._g(_vm._b({directives:[{name:"safe-link",rawName:"v-safe-link:[safeLinkConfig]",arg:_vm.safeLinkConfig}],class:[_vm.computedClass, ( _obj = {}, _obj[_vm.activeClass] = isActive, _obj[_vm.exactActiveClass] = isExactActive, _obj )],attrs:{"href":routerLinkHref,"data-alt":_vm.externalLinkLabel},on:{"click":function($event){return _vm.onClick($event, navigate)}}},'a',_vm.$attrs,false),_vm.computedListeners),[_vm._t("default")],2)]}}],null,true)},'component',_vm.computedProps,false)):(_vm.isRouterLink)?_c(_vm.tag,_vm._g(_vm._b({directives:[{name:"safe-link",rawName:"v-safe-link:[safeLinkConfig]",arg:_vm.safeLinkConfig}],tag:"component",class:_vm.computedClass,attrs:{"data-alt":_vm.externalLinkLabel},nativeOn:{"click":function($event){return _vm.onClick.apply(null, arguments)}}},'component',_vm.computedProps,false),_vm.computedListeners),[_vm._t("default")],2):_c(_vm.tag,_vm._g(_vm._b({directives:[{name:"safe-link",rawName:"v-safe-link:[safeLinkConfig]",arg:_vm.safeLinkConfig}],tag:"component",class:_vm.computedClass,attrs:{"data-alt":_vm.externalLinkLabel},on:{"click":_vm.onClick}},'component',_vm.computedProps,false),_vm.computedListeners),[_vm._t("default")],2)};
318
322
  var __vue_staticRenderFns__ = [];
319
323
 
320
324
  /* style */
@@ -101,7 +101,8 @@ var script = {
101
101
  },
102
102
  data() {
103
103
  return {
104
- sortingListboxId: uniqueId('sorting-listbox-')
104
+ sortingListboxId: uniqueId('sorting-listbox-'),
105
+ toggleId: uniqueId('sorting-toggle-')
105
106
  };
106
107
  },
107
108
  computed: {
@@ -166,7 +167,7 @@ var script = {
166
167
  const __vue_script__ = script;
167
168
 
168
169
  /* template */
169
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-button-group',{staticClass:"gl-sorting gl-flex"},[_c('gl-collapsible-listbox',{staticClass:"gl-w-full",class:_vm.dropdownClass,attrs:{"toggle-text":_vm.text,"items":_vm.sortOptions,"selected":_vm.sortBy,"toggle-class":_vm.dropdownToggleClass,"placement":"bottom-end","block":_vm.block,"toggle-aria-labelled-by":_vm.sortingListboxId},on:{"select":_vm.onSortByChanged}}),_vm._v(" "),_c('span',{staticClass:"gl-sr-only",attrs:{"id":_vm.sortingListboxId}},[_vm._v(_vm._s(_vm.sortingListboxLabel))]),_vm._v(" "),_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip"}],class:['sorting-direction-button', _vm.sortDirectionToggleClass],attrs:{"title":_vm.sortDirectionText,"icon":_vm.localSortDirection,"aria-label":_vm.sortDirectionText,"disabled":_vm.isDirectionToggleDisabled,"accessible-disabled":_vm.isDirectionToggleDisabled},on:{"click":_vm.toggleSortDirection}})],1)};
170
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-button-group',{staticClass:"gl-sorting gl-flex"},[_c('gl-collapsible-listbox',{staticClass:"gl-w-full",class:_vm.dropdownClass,attrs:{"toggle-text":_vm.text,"items":_vm.sortOptions,"selected":_vm.sortBy,"toggle-class":_vm.dropdownToggleClass,"placement":"bottom-end","block":_vm.block,"toggle-id":_vm.toggleId,"toggle-aria-labelled-by":(_vm.sortingListboxId + " " + _vm.toggleId)},on:{"select":_vm.onSortByChanged}}),_vm._v(" "),_c('span',{staticClass:"gl-sr-only",attrs:{"id":_vm.sortingListboxId}},[_vm._v(_vm._s(_vm.sortingListboxLabel))]),_vm._v(" "),_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip"}],class:['sorting-direction-button', _vm.sortDirectionToggleClass],attrs:{"title":_vm.sortDirectionText,"icon":_vm.localSortDirection,"aria-label":_vm.sortDirectionText,"disabled":_vm.isDirectionToggleDisabled,"accessible-disabled":_vm.isDirectionToggleDisabled},on:{"click":_vm.toggleSortDirection}})],1)};
170
171
  var __vue_staticRenderFns__ = [];
171
172
 
172
173
  /* style */