@gitlab/ui 101.9.0 → 101.11.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.
Files changed (31) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/charts/legend/legend.js +2 -1
  3. package/dist/index.css +1 -1
  4. package/dist/index.css.map +1 -1
  5. package/dist/tokens/build/js/tokens.dark.js +1 -1
  6. package/dist/tokens/build/js/tokens.js +1 -1
  7. package/dist/tokens/css/tokens.css +1 -1
  8. package/dist/tokens/css/tokens.dark.css +1 -1
  9. package/dist/tokens/js/tokens.dark.js +1 -1
  10. package/dist/tokens/js/tokens.js +1 -1
  11. package/dist/tokens/json/tokens.dark.json +3 -3
  12. package/dist/tokens/json/tokens.json +3 -3
  13. package/dist/tokens/scss/_tokens.dark.scss +1 -1
  14. package/dist/tokens/scss/_tokens.scss +1 -1
  15. package/dist/vendor/bootstrap-vue/src/components/link/link.js +89 -45
  16. package/package.json +1 -1
  17. package/src/components/charts/legend/legend.vue +2 -1
  18. package/src/tokens/build/css/tokens.css +1 -1
  19. package/src/tokens/build/css/tokens.dark.css +1 -1
  20. package/src/tokens/build/js/tokens.dark.js +1 -1
  21. package/src/tokens/build/js/tokens.js +1 -1
  22. package/src/tokens/build/json/tokens.dark.json +3 -3
  23. package/src/tokens/build/json/tokens.json +3 -3
  24. package/src/tokens/build/scss/_tokens.dark.scss +1 -1
  25. package/src/tokens/build/scss/_tokens.scss +1 -1
  26. package/src/tokens/contextual/filtered-search.tokens.json +2 -2
  27. package/src/vendor/bootstrap-vue/src/components/link/link.js +105 -62
  28. package/src/vendor/bootstrap-vue/src/directives/modal/index.d.ts +0 -8
  29. package/src/vendor/bootstrap-vue/src/directives/toggle/index.d.ts +0 -7
  30. package/src/vendor/bootstrap-vue/src/directives/tooltip/index.d.ts +0 -7
  31. package/src/vendor/bootstrap-vue/src/directives/visible/index.d.ts +0 -7
@@ -1,18 +1,11 @@
1
1
  import { extend } from '../../vue'
2
2
  import { NAME_LINK } from '../../constants/components'
3
3
  import { EVENT_NAME_CLICK } from '../../constants/events'
4
- import {
5
- PROP_TYPE_ARRAY_STRING,
6
- PROP_TYPE_BOOLEAN,
7
- PROP_TYPE_OBJECT_STRING,
8
- PROP_TYPE_STRING
9
- } from '../../constants/props'
10
4
  import { concat } from '../../utils/array'
11
5
  import { attemptBlur, attemptFocus, isTag } from '../../utils/dom'
12
6
  import { getRootEventName, stopEvent } from '../../utils/events'
13
7
  import { isBoolean, isEvent, isFunction, isUndefined } from '../../utils/inspect'
14
- import { omit, sortKeys } from '../../utils/object'
15
- import { makeProp, makePropsConfigurable, pluckProps } from '../../utils/props'
8
+ import { pluckProps } from '../../utils/props'
16
9
  import { computeHref, computeRel, computeTag, isRouterLink } from '../../utils/router'
17
10
  import { attrsMixin } from '../../mixins/attrs'
18
11
  import { listenOnRootMixin } from '../../mixins/listen-on-root'
@@ -25,52 +18,92 @@ const ROOT_EVENT_NAME_CLICKED = getRootEventName(NAME_LINK, 'clicked')
25
18
 
26
19
  // --- Props ---
27
20
 
28
- // `<router-link>` specific props
29
- export const routerLinkProps = {
30
- activeClass: makeProp(PROP_TYPE_STRING),
31
- append: makeProp(PROP_TYPE_BOOLEAN, false),
32
- event: makeProp(PROP_TYPE_ARRAY_STRING),
33
- exact: makeProp(PROP_TYPE_BOOLEAN, false),
34
- exactActiveClass: makeProp(PROP_TYPE_STRING),
35
- exactPath: makeProp(PROP_TYPE_BOOLEAN, false),
36
- exactPathActiveClass: makeProp(PROP_TYPE_STRING),
37
- replace: makeProp(PROP_TYPE_BOOLEAN, false),
38
- routerTag: makeProp(PROP_TYPE_STRING),
39
- to: makeProp(PROP_TYPE_OBJECT_STRING)
40
- }
41
-
42
- // `<nuxt-link>` specific props
43
- export const nuxtLinkProps = {
44
- noPrefetch: makeProp(PROP_TYPE_BOOLEAN, false),
21
+ export const props = {
22
+ active: {
23
+ type: Boolean,
24
+ default: false
25
+ },
26
+ disabled: {
27
+ type: Boolean,
28
+ default: false
29
+ },
30
+ href: {
31
+ type: String,
32
+ default: undefined
33
+ },
34
+ // Must be `null` if no value provided
35
+ rel: {
36
+ type: String,
37
+ default: null
38
+ },
39
+ // To support 3rd party router links based on `<router-link>` (i.e. `g-link` for Gridsome)
40
+ // Default is to auto choose between `<router-link>` and `<nuxt-link>`
41
+ // Gridsome doesn't provide a mechanism to auto detect and has caveats
42
+ // such as not supporting FQDN URLs or hash only URLs
43
+ routerComponentName: {
44
+ type: String,
45
+ default: undefined
46
+ },
47
+ target: {
48
+ type: String,
49
+ default: '_self'
50
+ },
51
+ activeClass: {
52
+ type: String,
53
+ default: undefined
54
+ },
55
+ append: {
56
+ type: Boolean,
57
+ default: false
58
+ },
59
+ event: {
60
+ type: [Array, String],
61
+ default: undefined
62
+ },
63
+ exact: {
64
+ type: Boolean,
65
+ default: false
66
+ },
67
+ exactActiveClass: {
68
+ type: String,
69
+ default: undefined
70
+ },
71
+ exactPath: {
72
+ type: Boolean,
73
+ default: false
74
+ },
75
+ exactPathActiveClass: {
76
+ type: String,
77
+ default: undefined
78
+ },
79
+ replace: {
80
+ type: Boolean,
81
+ default: false
82
+ },
83
+ routerTag: {
84
+ type: String,
85
+ default: undefined
86
+ },
87
+ to: {
88
+ type: [Object, String],
89
+ default: undefined
90
+ },
91
+ noPrefetch: {
92
+ type: Boolean,
93
+ default: false
94
+ },
45
95
  // Must be `null` to fall back to the value defined in the
46
96
  // `nuxt.config.js` configuration file for `router.prefetchLinks`
47
97
  // We convert `null` to `undefined`, so that Nuxt.js will use the
48
98
  // compiled default
49
99
  // Vue treats `undefined` as default of `false` for Boolean props,
50
100
  // so we must set it as `null` here to be a true tri-state prop
51
- prefetch: makeProp(PROP_TYPE_BOOLEAN, null)
101
+ prefetch: {
102
+ type: Boolean,
103
+ default: null
104
+ }
52
105
  }
53
106
 
54
- // All `<b-link>` props
55
- export const props = makePropsConfigurable(
56
- sortKeys({
57
- ...nuxtLinkProps,
58
- ...routerLinkProps,
59
- active: makeProp(PROP_TYPE_BOOLEAN, false),
60
- disabled: makeProp(PROP_TYPE_BOOLEAN, false),
61
- href: makeProp(PROP_TYPE_STRING),
62
- // Must be `null` if no value provided
63
- rel: makeProp(PROP_TYPE_STRING, null),
64
- // To support 3rd party router links based on `<router-link>` (i.e. `g-link` for Gridsome)
65
- // Default is to auto choose between `<router-link>` and `<nuxt-link>`
66
- // Gridsome doesn't provide a mechanism to auto detect and has caveats
67
- // such as not supporting FQDN URLs or hash only URLs
68
- routerComponentName: makeProp(PROP_TYPE_STRING),
69
- target: makeProp(PROP_TYPE_STRING, '_self')
70
- }),
71
- NAME_LINK
72
- )
73
-
74
107
  // --- Main component ---
75
108
 
76
109
  // @vue/component
@@ -86,6 +119,9 @@ export const BLink = /*#__PURE__*/ extend({
86
119
  const { to, disabled, routerComponentName } = this
87
120
  return computeTag({ to, disabled, routerComponentName }, this)
88
121
  },
122
+ isNuxtLink() {
123
+ return this.computedTag === 'nuxt-link'
124
+ },
89
125
  isRouterLink() {
90
126
  return isRouterLink(this.computedTag)
91
127
  },
@@ -100,23 +136,30 @@ export const BLink = /*#__PURE__*/ extend({
100
136
  return computeHref({ to, href }, this.computedTag)
101
137
  },
102
138
  computedProps() {
139
+ if (!this.isRouterLink) return {}
140
+
103
141
  const { event, prefetch, routerTag } = this
104
- return this.isRouterLink
105
- ? {
106
- ...pluckProps(
107
- omit(
108
- { ...routerLinkProps, ...(this.computedTag === 'nuxt-link' ? nuxtLinkProps : {}) },
109
- ['event', 'prefetch', 'routerTag']
110
- ),
111
- this
112
- ),
113
- // Only add these props, when actually defined
114
- ...(event ? { event } : {}),
115
- ...(isBoolean(prefetch) ? { prefetch } : {}),
116
- // Pass `router-tag` as `tag` prop
117
- ...(routerTag ? { tag: routerTag } : {})
118
- }
119
- : {}
142
+
143
+ const propsToPass = [
144
+ 'activeClass',
145
+ 'append',
146
+ 'exact',
147
+ 'exactActiveClass',
148
+ 'exactPath',
149
+ 'exactPathActiveClass',
150
+ 'replace',
151
+ 'to'
152
+ ]
153
+ if (this.isNuxtLink) propsToPass.push('noPrefetch')
154
+
155
+ return {
156
+ ...pluckProps(propsToPass, this),
157
+ // Only add these props, when actually defined
158
+ ...(event ? { event } : {}),
159
+ ...(isBoolean(prefetch) ? { prefetch } : {}),
160
+ // Pass `router-tag` as `tag` prop
161
+ ...(routerTag ? { tag: routerTag } : {})
162
+ }
120
163
  },
121
164
  computedAttrs() {
122
165
  const {
@@ -1,8 +0,0 @@
1
- //
2
- // VBModal
3
- //
4
- import { DirectiveOptions } from 'vue'
5
-
6
-
7
- // directive: v-b-modal
8
- export declare const VBModal: DirectiveOptions
@@ -1,7 +0,0 @@
1
- //
2
- // VBToggle
3
- //
4
- import { DirectiveOptions } from 'vue'
5
-
6
- // directive: v-b-toggle
7
- export declare const VBToggle: DirectiveOptions
@@ -1,7 +0,0 @@
1
- //
2
- // VBTooltip
3
- //
4
- import { DirectiveOptions } from 'vue'
5
-
6
- // directive: v-b-tooltip
7
- export declare const VBTooltip: DirectiveOptions
@@ -1,7 +0,0 @@
1
- //
2
- // VBVisible
3
- //
4
- import { DirectiveOptions } from 'vue'
5
-
6
- // Directive: v-b-visible
7
- export declare const VBVisible: DirectiveOptions