@gitlab/ui 114.3.0 → 114.7.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.
Files changed (38) hide show
  1. package/README.md +4 -2
  2. package/bin/migrate_custom_utils_to_tw.bundled.mjs +398 -401
  3. package/dist/components/base/link/link.js +6 -5
  4. package/dist/components/base/sorting/sorting.js +10 -1
  5. package/dist/components/base/table/constants.js +1 -1
  6. package/dist/components/base/toast/toast.js +1 -1
  7. package/dist/components/base/toggle/toggle.js +0 -1
  8. package/dist/config.js +1 -1
  9. package/dist/directives/safe_link/mock_data.js +1 -1
  10. package/dist/directives/safe_link/safe_link.js +1 -1
  11. package/dist/index.css +2 -2
  12. package/dist/index.css.map +1 -1
  13. package/dist/utils/is_slot_empty.js +0 -2
  14. package/dist/utils/number_utils.js +3 -3
  15. package/dist/utils/use_mock_intersection_observer.js +0 -4
  16. package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +1 -1
  17. package/package.json +9 -6
  18. package/src/components/base/button/button.md +1 -1
  19. package/src/components/base/drawer/drawer.scss +2 -1
  20. package/src/components/base/form/form_character_count/form_character_count.md +1 -1
  21. package/src/components/base/form/form_combobox/form_combobox.md +4 -4
  22. package/src/components/base/link/link.md +34 -1
  23. package/src/components/base/link/link.scss +1 -1
  24. package/src/components/base/link/link.vue +6 -4
  25. package/src/components/base/sorting/sorting.vue +11 -0
  26. package/src/components/base/table/constants.js +1 -1
  27. package/src/components/base/toast/toast.js +1 -1
  28. package/src/components/base/toggle/toggle.vue +2 -3
  29. package/src/components/charts/heatmap/heatmap.md +1 -1
  30. package/src/config.js +1 -1
  31. package/src/directives/safe_link/mock_data.js +1 -1
  32. package/src/directives/safe_link/safe_link.js +1 -1
  33. package/src/utils/is_slot_empty.js +0 -1
  34. package/src/utils/number_utils.js +3 -3
  35. package/src/utils/use_mock_intersection_observer.js +1 -3
  36. package/src/vendor/bootstrap-vue/src/components/table/_table.scss +2 -4
  37. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +1 -1
  38. package/translations.js +1 -0
@@ -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, linkVariantUnstyled } from '../../../utils/constants';
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
- * If inline variant, controls character visibility
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
- isInlineAndHasExternalIcon() {
165
- return this.showExternalIcon && this.variant === linkVariantInline && this.href && isExternalURL(this.target, this.href);
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-inline-external': this.isInlineAndHasExternalIcon
238
+ 'gl-link-external': this.shouldShowExternalIcon
238
239
  }];
239
240
  }
240
241
  },
@@ -1,3 +1,4 @@
1
+ import uniqueId from 'lodash/uniqueId';
1
2
  import { GlTooltipDirective } from '../../../directives/tooltip/tooltip';
2
3
  import GlButton from '../button/button';
3
4
  import GlButtonGroup from '../button_group/button_group';
@@ -94,7 +95,15 @@ var script = {
94
95
  default: false
95
96
  }
96
97
  },
98
+ data() {
99
+ return {
100
+ sortingListboxId: uniqueId('sorting-listbox-')
101
+ };
102
+ },
97
103
  computed: {
104
+ sortingListboxLabel() {
105
+ return translate('GlSorting.sortByLabel', 'Sort by:');
106
+ },
98
107
  localSortDirection() {
99
108
  return this.isAscending ? 'sort-lowest' : 'sort-highest';
100
109
  },
@@ -136,7 +145,7 @@ var script = {
136
145
  const __vue_script__ = script;
137
146
 
138
147
  /* template */
139
- 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"},[_c('gl-collapsible-listbox',{class:_vm.dropdownClass,attrs:{"toggle-text":_vm.text,"items":_vm.sortOptions,"selected":_vm.sortBy,"toggle-class":_vm.dropdownToggleClass,"placement":"bottom-end","block":_vm.block},on:{"select":_vm.onSortByChanged}}),_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},on:{"click":_vm.toggleSortDirection}})],1)};
148
+ 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"},[_c('gl-collapsible-listbox',{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},on:{"click":_vm.toggleSortDirection}})],1)};
140
149
  var __vue_staticRenderFns__ = [];
141
150
 
142
151
  /* style */
@@ -1,5 +1,5 @@
1
1
  const tableFullSlots = ['bottom-row', 'empty', 'emptyfiltered', 'table-busy', 'thead-top', 'top-row'];
2
2
  const tableFullProps = ['api-url', 'busy', 'current-page', 'empty-filtered-html', 'empty-filtered-text', 'empty-html', 'empty-text', 'filter', 'filter-debounce', 'filter-function', 'filter-ignored-fields', 'filter-included-fields', 'label-sort-asc', 'label-sort-clear', 'label-sort-desc', 'no-footer-sorting', 'no-local-sorting', 'no-provider-filtering', 'no-provider-paging', 'no-provider-sorting', 'no-select-on-click', 'per-page', 'select-mode', 'selectable', 'selected-variant', 'show-empty', 'sort-by', 'sort-compare', 'sort-compare-locale', 'sort-compare-options', 'sort-desc', 'sort-direction', 'sort-icon-left', 'sort-null-last'];
3
- const glTableLiteWarning = 'This GlTable could be a GlTableLite component, please consider using GlTableLite instead of GlTable to reduce the page bundlesize more about this here: https://gitlab-org.gitlab.io/gitlab-ui/?path=/docs/base-table-table-lite--default';
3
+ const glTableLiteWarning = 'This GlTable could be a GlTableLite component, please consider using GlTableLite instead of GlTable to reduce the page bundlesize more about this here: https://design.gitlab.com/storybook?path=/docs/base-table-table-lite--default';
4
4
 
5
5
  export { glTableLiteWarning, tableFullProps, tableFullSlots };
@@ -65,7 +65,7 @@ function showToast(message) {
65
65
  * Note: This is not a typical Vue component and needs to be registered before instantiating a Vue app.
66
66
  * Once registered, the toast will be globally available throughout your app.
67
67
  *
68
- * See https://gitlab-org.gitlab.io/gitlab-ui/ for detailed documentation.
68
+ * See https://design.gitlab.com/storybook for detailed documentation.
69
69
  */
70
70
  var toast = {
71
71
  install(Vue) {
@@ -90,7 +90,6 @@ var script = {
90
90
  },
91
91
  computed: {
92
92
  shouldRenderDescription() {
93
- // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
94
93
  return Boolean(this.$scopedSlots.description || this.description) && this.isVerticalLayout;
95
94
  },
96
95
  shouldRenderHelp() {
package/dist/config.js CHANGED
@@ -28,7 +28,7 @@ try {
28
28
  if (glTooltipDelay) {
29
29
  tooltipGlobalConfig.delay = JSON.parse(glTooltipDelay);
30
30
  }
31
- } catch (e) {
31
+ } catch {
32
32
  // localStorage doesn't exist (or the value is not properly formatted)
33
33
  }
34
34
  const i18n = translationKeys;
@@ -2,7 +2,7 @@ const absoluteUrls = ['http://example.org', 'http://example.org:8080', 'https://
2
2
 
3
3
  /* eslint-disable no-script-url */
4
4
  const javascriptUrls = ['javascript:', 'javascript:alert("XSS")', 'jav\tascript:alert("XSS");'];
5
- /* eslint-disable no-script-url */
5
+ /* eslint-enable no-script-url */
6
6
 
7
7
  const encodedJavaScriptUrls = ['&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041', 'javascript:alert('XSS')', '&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29', '  javascript:alert("XSS");'];
8
8
  const relativeUrls = ['./relative/link', '../relative/link', '/relative/link', '/users/sign_in', '#docs/link', '#'];
@@ -27,7 +27,7 @@ const isSafeURL = url => {
27
27
  try {
28
28
  const parsedURL = new URL(url, getBaseURL());
29
29
  return ['http:', 'https:', 'mailto:', 'ftp:'].includes(parsedURL.protocol);
30
- } catch (e) {
30
+ } catch {
31
31
  return false;
32
32
  }
33
33
  };