@gitlab/ui 105.7.0 → 106.1.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.
- package/CHANGELOG.md +20 -0
- package/dist/components/base/button_group/button_group.js +10 -4
- package/dist/components/dashboards/dashboard_panel/dashboard_panel.js +7 -10
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/tokens/build/js/tokens.dark.js +1 -1
- package/dist/tokens/build/js/tokens.js +1 -1
- package/dist/tokens/css/tokens.css +1 -1
- package/dist/tokens/css/tokens.dark.css +1 -1
- package/dist/tokens/js/tokens.dark.js +1 -1
- package/dist/tokens/js/tokens.js +1 -1
- package/dist/tokens/json/tokens.dark.json +3 -3
- package/dist/tokens/json/tokens.json +3 -3
- package/dist/tokens/scss/_tokens.dark.scss +1 -1
- package/dist/tokens/scss/_tokens.scss +1 -1
- package/dist/tokens/tailwind/tokens.cjs +1 -1
- package/dist/vendor/bootstrap-vue/src/constants/components.js +1 -2
- package/dist/vendor/bootstrap-vue/src/vue.js +17 -0
- package/package.json +8 -6
- package/src/components/base/button_group/button_group.md +19 -3
- package/src/components/base/button_group/button_group.vue +11 -6
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.md +15 -0
- package/src/components/base/new_dropdowns/listbox/listbox.md +15 -0
- package/src/components/dashboards/dashboard_panel/dashboard_panel.vue +5 -5
- package/src/tokens/build/css/tokens.css +1 -1
- package/src/tokens/build/css/tokens.dark.css +1 -1
- package/src/tokens/build/js/tokens.dark.js +1 -1
- package/src/tokens/build/js/tokens.js +1 -1
- package/src/tokens/build/json/tokens.dark.json +3 -3
- package/src/tokens/build/json/tokens.json +3 -3
- package/src/tokens/build/scss/_tokens.dark.scss +1 -1
- package/src/tokens/build/scss/_tokens.scss +1 -1
- package/src/tokens/build/tailwind/tokens.cjs +1 -1
- package/src/tokens/icon.tokens.json +2 -2
- package/src/vendor/bootstrap-vue/src/constants/components.js +0 -1
- package/src/vendor/bootstrap-vue/src/vue.js +18 -0
- package/dist/vendor/bootstrap-vue/src/components/button-group/button-group.js +0 -44
- package/dist/vendor/bootstrap-vue/src/components/button-group/index.js +0 -1
- package/src/vendor/bootstrap-vue/src/components/button-group/README.md +0 -107
- package/src/vendor/bootstrap-vue/src/components/button-group/button-group.js +0 -42
- package/src/vendor/bootstrap-vue/src/components/button-group/button-group.spec.js +0 -98
- package/src/vendor/bootstrap-vue/src/components/button-group/index.js +0 -3
- package/src/vendor/bootstrap-vue/src/components/button-group/package.json +0 -29
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Component names
|
|
2
2
|
export const NAME_BUTTON = 'BButton'
|
|
3
3
|
export const NAME_BUTTON_CLOSE = 'BButtonClose'
|
|
4
|
-
export const NAME_BUTTON_GROUP = 'BButtonGroup'
|
|
5
4
|
export const NAME_COL = 'BCol'
|
|
6
5
|
export const NAME_COLLAPSE = 'BCollapse'
|
|
7
6
|
export const NAME_DROPDOWN = 'BDropdown'
|
|
@@ -33,18 +33,36 @@ if (isVue3) {
|
|
|
33
33
|
const originalVModelDynamicCreated = Vue.vModelDynamic.created
|
|
34
34
|
const originalVModelDynamicBeforeUpdate = Vue.vModelDynamic.beforeUpdate
|
|
35
35
|
|
|
36
|
+
let assignSymbol
|
|
37
|
+
|
|
36
38
|
// See https://github.com/vuejs/vue-next/pull/4121 for details
|
|
37
39
|
Vue.vModelDynamic.created = function(el, binding, vnode) {
|
|
38
40
|
originalVModelDynamicCreated.call(this, el, binding, vnode)
|
|
39
41
|
if (!el._assign) {
|
|
40
42
|
el._assign = () => {}
|
|
41
43
|
}
|
|
44
|
+
|
|
45
|
+
// Added check for Symbol('_assign') to fix in compat 3.3.5+ based on https://github.com/bootstrap-vue/bootstrap-vue/issues/7181
|
|
46
|
+
if (!assignSymbol) {
|
|
47
|
+
assignSymbol = Object.getOwnPropertySymbols(el).find(s => s.description === '_assign')
|
|
48
|
+
}
|
|
49
|
+
if (!el[assignSymbol]) {
|
|
50
|
+
el[assignSymbol] = function() {}
|
|
51
|
+
}
|
|
42
52
|
}
|
|
43
53
|
Vue.vModelDynamic.beforeUpdate = function(el, binding, vnode) {
|
|
44
54
|
originalVModelDynamicBeforeUpdate.call(this, el, binding, vnode)
|
|
45
55
|
if (!el._assign) {
|
|
46
56
|
el._assign = () => {}
|
|
47
57
|
}
|
|
58
|
+
|
|
59
|
+
// Added check for Symbol('_assign') to fix in 3.3.5+ based on https://github.com/bootstrap-vue/bootstrap-vue/issues/7181
|
|
60
|
+
if (!assignSymbol) {
|
|
61
|
+
assignSymbol = Object.getOwnPropertySymbols(el).find(s => s.description === '_assign')
|
|
62
|
+
}
|
|
63
|
+
if (!el[assignSymbol]) {
|
|
64
|
+
el[assignSymbol] = function() {}
|
|
65
|
+
}
|
|
48
66
|
}
|
|
49
67
|
extend = function patchedBootstrapVueExtend(definition) {
|
|
50
68
|
if (typeof definition === 'object' && definition.render && !definition.__alreadyPatched) {
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { extend, mergeData } from '../../vue';
|
|
2
|
-
import { NAME_BUTTON_GROUP } from '../../constants/components';
|
|
3
|
-
import { PROP_TYPE_STRING, PROP_TYPE_BOOLEAN } from '../../constants/props';
|
|
4
|
-
import { sortKeys, pick } from '../../utils/object';
|
|
5
|
-
import { makePropsConfigurable, makeProp } from '../../utils/props';
|
|
6
|
-
import { props as props$1 } from '../button/button';
|
|
7
|
-
|
|
8
|
-
// --- Props ---
|
|
9
|
-
|
|
10
|
-
const props = makePropsConfigurable(sortKeys({
|
|
11
|
-
...pick(props$1, ['size']),
|
|
12
|
-
ariaRole: makeProp(PROP_TYPE_STRING, 'group'),
|
|
13
|
-
size: makeProp(PROP_TYPE_STRING),
|
|
14
|
-
tag: makeProp(PROP_TYPE_STRING, 'div'),
|
|
15
|
-
vertical: makeProp(PROP_TYPE_BOOLEAN, false)
|
|
16
|
-
}), NAME_BUTTON_GROUP);
|
|
17
|
-
|
|
18
|
-
// --- Main component ---
|
|
19
|
-
|
|
20
|
-
// @vue/component
|
|
21
|
-
const BButtonGroup = /*#__PURE__*/extend({
|
|
22
|
-
name: NAME_BUTTON_GROUP,
|
|
23
|
-
functional: true,
|
|
24
|
-
props,
|
|
25
|
-
render(h, _ref) {
|
|
26
|
-
let {
|
|
27
|
-
props,
|
|
28
|
-
data,
|
|
29
|
-
children
|
|
30
|
-
} = _ref;
|
|
31
|
-
return h(props.tag, mergeData(data, {
|
|
32
|
-
class: {
|
|
33
|
-
'btn-group': !props.vertical,
|
|
34
|
-
'btn-group-vertical': props.vertical,
|
|
35
|
-
[`btn-group-${props.size}`]: props.size
|
|
36
|
-
},
|
|
37
|
-
attrs: {
|
|
38
|
-
role: props.ariaRole
|
|
39
|
-
}
|
|
40
|
-
}), children);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
export { BButtonGroup, props };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { BButtonGroup } from './button-group';
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
# Button Group
|
|
2
|
-
|
|
3
|
-
> Group a series of buttons together on a single line with `<b-button-group>`.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
Button Groups are an easy way to group a series of buttons together.
|
|
8
|
-
|
|
9
|
-
```html
|
|
10
|
-
<div>
|
|
11
|
-
<div>
|
|
12
|
-
<b-button-group>
|
|
13
|
-
<b-button>Button 1</b-button>
|
|
14
|
-
<b-button>Button 2</b-button>
|
|
15
|
-
<b-button>Button 3</b-button>
|
|
16
|
-
</b-button-group>
|
|
17
|
-
</div>
|
|
18
|
-
<div class="mt-3">
|
|
19
|
-
<b-button-group>
|
|
20
|
-
<b-button variant="success">Success</b-button>
|
|
21
|
-
<b-button variant="info">Info</b-button>
|
|
22
|
-
<b-button variant="warning">Warning</b-button>
|
|
23
|
-
</b-button-group>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<!-- b-button-group.vue -->
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Sizing
|
|
31
|
-
|
|
32
|
-
Set the `size` prop to `lg` or `sm` to render larger or smaller, respectively, buttons. There is no
|
|
33
|
-
need to specify the size on the individual buttons.
|
|
34
|
-
|
|
35
|
-
```html
|
|
36
|
-
<div>
|
|
37
|
-
<div>
|
|
38
|
-
<b-button-group>
|
|
39
|
-
<b-button>Button 1</b-button>
|
|
40
|
-
<b-button>Button 2</b-button>
|
|
41
|
-
<b-button>Button 3</b-button>
|
|
42
|
-
</b-button-group>
|
|
43
|
-
</div>
|
|
44
|
-
<div class="mt-3">
|
|
45
|
-
<b-button-group size="sm">
|
|
46
|
-
<b-button>Left</b-button>
|
|
47
|
-
<b-button>Middle</b-button>
|
|
48
|
-
<b-button>Right</b-button>
|
|
49
|
-
</b-button-group>
|
|
50
|
-
</div>
|
|
51
|
-
<div class="mt-3">
|
|
52
|
-
<b-button-group size="lg">
|
|
53
|
-
<b-button>Left</b-button>
|
|
54
|
-
<b-button>Middle</b-button>
|
|
55
|
-
<b-button>Right</b-button>
|
|
56
|
-
</b-button-group>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
<!-- b-button-group-sizes.vue -->
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Vertical variation
|
|
64
|
-
|
|
65
|
-
Make a set of buttons appear vertically stacked rather than horizontally by setting the `vertical`
|
|
66
|
-
prop. Split button dropdowns are not supported here.
|
|
67
|
-
|
|
68
|
-
```html
|
|
69
|
-
<div>
|
|
70
|
-
<b-button-group vertical>
|
|
71
|
-
<b-button>Top</b-button>
|
|
72
|
-
<b-button>Middle</b-button>
|
|
73
|
-
<b-button>Bottom</b-button>
|
|
74
|
-
</b-button-group>
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
<!-- b-button-group-vertical.vue -->
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## Dropdown menu support
|
|
81
|
-
|
|
82
|
-
Add [`<b-dropdown>`](/docs/components/dropdown) menus directly inside your `<b-button-group>`. Note
|
|
83
|
-
that split dropdown menus are not supported when prop `vertical` is set.
|
|
84
|
-
|
|
85
|
-
```html
|
|
86
|
-
<div>
|
|
87
|
-
<b-button-group>
|
|
88
|
-
<b-button>Button</b-button>
|
|
89
|
-
<b-dropdown right text="Menu">
|
|
90
|
-
<b-dropdown-item>Item 1</b-dropdown-item>
|
|
91
|
-
<b-dropdown-item>Item 2</b-dropdown-item>
|
|
92
|
-
<b-dropdown-divider></b-dropdown-divider>
|
|
93
|
-
<b-dropdown-item>Item 3</b-dropdown-item>
|
|
94
|
-
</b-dropdown>
|
|
95
|
-
<b-dropdown right split text="Split Menu">
|
|
96
|
-
<b-dropdown-item>Item 1</b-dropdown-item>
|
|
97
|
-
<b-dropdown-item>Item 2</b-dropdown-item>
|
|
98
|
-
<b-dropdown-divider></b-dropdown-divider>
|
|
99
|
-
<b-dropdown-item>Item 3</b-dropdown-item>
|
|
100
|
-
</b-dropdown>
|
|
101
|
-
</b-button-group>
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
<!-- b-button-group-menu.vue -->
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
<!-- Component reference added automatically from component package.json -->
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { extend, mergeData } from '../../vue'
|
|
2
|
-
import { NAME_BUTTON_GROUP } from '../../constants/components'
|
|
3
|
-
import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../constants/props'
|
|
4
|
-
import { pick, sortKeys } from '../../utils/object'
|
|
5
|
-
import { makeProp, makePropsConfigurable } from '../../utils/props'
|
|
6
|
-
import { props as buttonProps } from '../button/button'
|
|
7
|
-
|
|
8
|
-
// --- Props ---
|
|
9
|
-
|
|
10
|
-
export const props = makePropsConfigurable(
|
|
11
|
-
sortKeys({
|
|
12
|
-
...pick(buttonProps, ['size']),
|
|
13
|
-
ariaRole: makeProp(PROP_TYPE_STRING, 'group'),
|
|
14
|
-
size: makeProp(PROP_TYPE_STRING),
|
|
15
|
-
tag: makeProp(PROP_TYPE_STRING, 'div'),
|
|
16
|
-
vertical: makeProp(PROP_TYPE_BOOLEAN, false)
|
|
17
|
-
}),
|
|
18
|
-
NAME_BUTTON_GROUP
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
// --- Main component ---
|
|
22
|
-
|
|
23
|
-
// @vue/component
|
|
24
|
-
export const BButtonGroup = /*#__PURE__*/ extend({
|
|
25
|
-
name: NAME_BUTTON_GROUP,
|
|
26
|
-
functional: true,
|
|
27
|
-
props,
|
|
28
|
-
render(h, { props, data, children }) {
|
|
29
|
-
return h(
|
|
30
|
-
props.tag,
|
|
31
|
-
mergeData(data, {
|
|
32
|
-
class: {
|
|
33
|
-
'btn-group': !props.vertical,
|
|
34
|
-
'btn-group-vertical': props.vertical,
|
|
35
|
-
[`btn-group-${props.size}`]: props.size
|
|
36
|
-
},
|
|
37
|
-
attrs: { role: props.ariaRole }
|
|
38
|
-
}),
|
|
39
|
-
children
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
})
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { mount } from '@vue/test-utils'
|
|
2
|
-
import { BButtonGroup } from './button-group'
|
|
3
|
-
|
|
4
|
-
describe('button-group', () => {
|
|
5
|
-
it('has expected default structure', async () => {
|
|
6
|
-
const wrapper = mount(BButtonGroup)
|
|
7
|
-
|
|
8
|
-
expect(wrapper.element.tagName).toBe('DIV')
|
|
9
|
-
expect(wrapper.classes()).toContain('btn-group')
|
|
10
|
-
expect(wrapper.classes().length).toBe(1)
|
|
11
|
-
expect(wrapper.attributes('role')).toBeDefined()
|
|
12
|
-
expect(wrapper.attributes('role')).toBe('group')
|
|
13
|
-
expect(wrapper.text()).toBe('')
|
|
14
|
-
|
|
15
|
-
wrapper.destroy()
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
it('should render default slot', async () => {
|
|
19
|
-
const wrapper = mount(BButtonGroup, {
|
|
20
|
-
slots: {
|
|
21
|
-
default: '<span>foobar</span>'
|
|
22
|
-
}
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
expect(wrapper.element.tagName).toBe('DIV')
|
|
26
|
-
expect(wrapper.classes()).toContain('btn-group')
|
|
27
|
-
expect(wrapper.classes().length).toBe(1)
|
|
28
|
-
expect(wrapper.attributes('role')).toBeDefined()
|
|
29
|
-
expect(wrapper.attributes('role')).toBe('group')
|
|
30
|
-
expect(wrapper.find('span').exists()).toBe(true)
|
|
31
|
-
expect(wrapper.text()).toBe('foobar')
|
|
32
|
-
|
|
33
|
-
wrapper.destroy()
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
it('should apply vertical class', async () => {
|
|
37
|
-
const wrapper = mount(BButtonGroup, {
|
|
38
|
-
propsData: {
|
|
39
|
-
vertical: true
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
expect(wrapper.element.tagName).toBe('DIV')
|
|
44
|
-
expect(wrapper.classes()).toContain('btn-group-vertical')
|
|
45
|
-
expect(wrapper.classes()).not.toContain('btn-group')
|
|
46
|
-
expect(wrapper.classes().length).toBe(1)
|
|
47
|
-
|
|
48
|
-
wrapper.destroy()
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
it('should apply size class', async () => {
|
|
52
|
-
const wrapper = mount(BButtonGroup, {
|
|
53
|
-
propsData: {
|
|
54
|
-
size: 'sm'
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
expect(wrapper.element.tagName).toBe('DIV')
|
|
59
|
-
expect(wrapper.classes()).toContain('btn-group')
|
|
60
|
-
expect(wrapper.classes()).toContain('btn-group-sm')
|
|
61
|
-
expect(wrapper.classes().length).toBe(2)
|
|
62
|
-
|
|
63
|
-
wrapper.destroy()
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
it('should apply size class when vertical', async () => {
|
|
67
|
-
const wrapper = mount(BButtonGroup, {
|
|
68
|
-
propsData: {
|
|
69
|
-
size: 'sm',
|
|
70
|
-
vertical: true
|
|
71
|
-
}
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
expect(wrapper.element.tagName).toBe('DIV')
|
|
75
|
-
expect(wrapper.classes()).toContain('btn-group-sm')
|
|
76
|
-
expect(wrapper.classes()).toContain('btn-group-vertical')
|
|
77
|
-
expect(wrapper.classes()).not.toContain('btn-group')
|
|
78
|
-
expect(wrapper.classes().length).toBe(2)
|
|
79
|
-
|
|
80
|
-
wrapper.destroy()
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
it('has custom role when aria-role prop set', async () => {
|
|
84
|
-
const wrapper = mount(BButtonGroup, {
|
|
85
|
-
propsData: {
|
|
86
|
-
ariaRole: 'foobar'
|
|
87
|
-
}
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
expect(wrapper.element.tagName).toBe('DIV')
|
|
91
|
-
expect(wrapper.classes()).toContain('btn-group')
|
|
92
|
-
expect(wrapper.classes().length).toBe(1)
|
|
93
|
-
expect(wrapper.attributes('role')).toBeDefined()
|
|
94
|
-
expect(wrapper.attributes('role')).toBe('foobar')
|
|
95
|
-
|
|
96
|
-
wrapper.destroy()
|
|
97
|
-
})
|
|
98
|
-
})
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@bootstrap-vue/button-group",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"meta": {
|
|
5
|
-
"title": "Button Group",
|
|
6
|
-
"description": "Group a series of buttons together on a single line with <b-button-group>.",
|
|
7
|
-
"components": [
|
|
8
|
-
{
|
|
9
|
-
"component": "BButtonGroup",
|
|
10
|
-
"description": "Group a series of buttons together on a single line",
|
|
11
|
-
"aliases": [
|
|
12
|
-
"BBtnGroup"
|
|
13
|
-
],
|
|
14
|
-
"props": [
|
|
15
|
-
{
|
|
16
|
-
"prop": "vertical",
|
|
17
|
-
"description": "When set, rendered the button group in vertical mode"
|
|
18
|
-
}
|
|
19
|
-
],
|
|
20
|
-
"slots": [
|
|
21
|
-
{
|
|
22
|
-
"name": "default",
|
|
23
|
-
"description": "Content (buttons) to place in the button group"
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
}
|