@gitlab/ui 115.6.1 → 115.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.
@@ -35,7 +35,7 @@ var script = {
35
35
  computed: {
36
36
  isLink() {
37
37
  var _this$item, _this$item2;
38
- return typeof ((_this$item = this.item) === null || _this$item === void 0 ? void 0 : _this$item.href) === 'string' || typeof ((_this$item2 = this.item) === null || _this$item2 === void 0 ? void 0 : _this$item2.to) === 'string';
38
+ return typeof ((_this$item = this.item) === null || _this$item === void 0 ? void 0 : _this$item.href) === 'string' || typeof ((_this$item2 = this.item) === null || _this$item2 === void 0 ? void 0 : _this$item2.to) !== 'undefined';
39
39
  },
40
40
  isCustomContent() {
41
41
  return Boolean(this.$scopedSlots.default);
@@ -19,6 +19,14 @@ const mockItems = [{
19
19
  extraAttrs: {
20
20
  'data-uuid': '1234'
21
21
  }
22
+ }, {
23
+ text: 'Lock discussion',
24
+ to: {
25
+ path: '/lock',
26
+ query: {
27
+ show: 1234
28
+ }
29
+ }
22
30
  }, {
23
31
  text: 'Close merge request',
24
32
  variant: 'danger',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "115.6.1",
3
+ "version": "115.7.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -102,7 +102,7 @@
102
102
  "@babel/preset-react": "^7.27.1",
103
103
  "@cypress/grep": "^4.1.0",
104
104
  "@gitlab/fonts": "^1.3.0",
105
- "@gitlab/svgs": "3.136.0",
105
+ "@gitlab/svgs": "3.141.0",
106
106
  "@jest/test-sequencer": "30.0.4",
107
107
  "@rollup/plugin-commonjs": "^28.0.6",
108
108
  "@rollup/plugin-node-resolve": "^16.0.1",
@@ -134,7 +134,7 @@
134
134
  "autoprefixer": "10.4.21",
135
135
  "axe-playwright": "^2.1.0",
136
136
  "babel-loader": "^9.2.1",
137
- "cypress": "14.5.1",
137
+ "cypress": "14.5.2",
138
138
  "cypress-real-events": "^1.14.0",
139
139
  "dompurify": "^3.1.2",
140
140
  "emoji-regex": "^10.4.0",
@@ -67,7 +67,7 @@ It's possible to close the disclosure dropdown programmatically by calling the `
67
67
  `close` methods on the disclosure dropdown via a template ref. For example:
68
68
 
69
69
  ```js
70
- this.$refs.disclosureDropdown.closeAndFocus()
70
+ this.$refs.disclosureDropdown.closeAndFocus();
71
71
  ```
72
72
 
73
73
  The `closeAndFocus` method is preferred in most cases, especially when triggering it from some action
@@ -79,7 +79,8 @@ some other element. For example, closing the disclosure dropdown to focus a newl
79
79
  ## Setting disclosure dropdown items
80
80
 
81
81
  Use the `items` prop to provide actions/links to the disclosure dropdown. Each
82
- item can be either an item or a group. For `Item`s, provide an `href` or `to` string to
82
+ item can be either an item or a group. For `Item`s, provide an `href` or `to` string or
83
+ [`to` location descriptor object](https://v3.router.vuejs.org/api/#to) to
83
84
  make them render as links. Otherwise, they will be buttons. Provide an `action`
84
85
  function to items to be called when they are pressed, or, listen for the
85
86
  `action` event on the top-level component. Both will receive the given item as
@@ -96,7 +97,8 @@ type Item = {
96
97
  // href link
97
98
  href?: string;
98
99
  // or, a Vue router link with `to`
99
- to?: string;
100
+ // See https://github.com/vuejs/vue-router/blob/v3.6.5/types/router.d.ts#L400-L408 for Location definition
101
+ to?: string | Location;
100
102
  // Item action
101
103
  action?: (item: Item) => void;
102
104
  // Set of extra attributes applied directly to the element
@@ -33,7 +33,7 @@ export default {
33
33
  },
34
34
  computed: {
35
35
  isLink() {
36
- return typeof this.item?.href === 'string' || typeof this.item?.to === 'string';
36
+ return typeof this.item?.href === 'string' || typeof this.item?.to !== 'undefined';
37
37
  },
38
38
  isCustomContent() {
39
39
  return Boolean(this.$scopedSlots.default);
@@ -23,6 +23,10 @@ export const mockItems = [
23
23
  'data-uuid': '1234',
24
24
  },
25
25
  },
26
+ {
27
+ text: 'Lock discussion',
28
+ to: { path: '/lock', query: { show: 1234 } },
29
+ },
26
30
  {
27
31
  text: 'Close merge request',
28
32
  variant: 'danger',