@gitlab/ui 101.16.0 → 102.0.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 +32 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_details_modal/duo_chat_context_item_details_modal.js +3 -0
- package/dist/vendor/bootstrap-vue/src/components/button/button.js +0 -4
- package/dist/vendor/bootstrap-vue/src/components/nav/nav.js +6 -9
- package/dist/vendor/bootstrap-vue/src/components/tabs/tabs.js +6 -30
- package/dist/vendor/bootstrap-vue/src/index.js +1 -11
- package/dist/vendor/bootstrap-vue/src/mixins/form-radio-check-group.js +2 -16
- package/dist/vendor/bootstrap-vue/src/mixins/form-radio-check.js +14 -104
- package/package.json +1 -2
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_details_modal/duo_chat_context_item_details_modal.vue +3 -0
- package/src/vendor/bootstrap-vue/src/components/button/MODIFICATIONS.md +16 -0
- package/src/vendor/bootstrap-vue/src/components/button/README.md +0 -39
- package/src/vendor/bootstrap-vue/src/components/button/button.js +0 -4
- package/src/vendor/bootstrap-vue/src/components/button/button.spec.js +0 -36
- package/src/vendor/bootstrap-vue/src/components/form-checkbox/README.md +3 -174
- package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox-group.spec.js +0 -117
- package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox.spec.js +0 -409
- package/src/vendor/bootstrap-vue/src/components/form-radio/README.md +0 -129
- package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio-group.spec.js +0 -112
- package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio.spec.js +0 -365
- package/src/vendor/bootstrap-vue/src/components/nav/README.md +0 -20
- package/src/vendor/bootstrap-vue/src/components/nav/nav.js +7 -9
- package/src/vendor/bootstrap-vue/src/components/nav/nav.spec.js +0 -67
- package/src/vendor/bootstrap-vue/src/components/tabs/README.md +45 -187
- package/src/vendor/bootstrap-vue/src/components/tabs/tabs.js +6 -29
- package/src/vendor/bootstrap-vue/src/components/tabs/tabs.spec.js +0 -58
- package/src/vendor/bootstrap-vue/src/index.js +0 -17
- package/src/vendor/bootstrap-vue/src/mixins/form-radio-check-group.js +3 -20
- package/src/vendor/bootstrap-vue/src/mixins/form-radio-check.js +19 -114
- package/src/vendor/bootstrap-vue/src/utils/config.spec.js +0 -18
- package/dist/index.css +0 -7
- package/dist/index.css.map +0 -1
- package/dist/index.js +0 -115
- package/dist/vendor/bootstrap-vue/src/components/index.js +0 -11
- package/src/index.js +0 -130
- package/src/vendor/bootstrap-vue/src/components/index.js +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
# [102.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v101.16.0...v102.0.0) (2024-11-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **GlCheckbox:** always add a label, even for empty content ([4154c08](https://gitlab.com/gitlab-org/gitlab-ui/commit/4154c082e5935031f1f5670fc16ad3c87b736251))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **FormRadio,FormCheckbox:** Remove buttons style ([5ca17b0](https://gitlab.com/gitlab-org/gitlab-ui/commit/5ca17b0841d2d13c5a977cc674ef24a7273fa1d4))
|
|
12
|
+
* **GlButton:** Remove pill and squared properties ([7c61763](https://gitlab.com/gitlab-org/gitlab-ui/commit/7c617631e03f4e042caf95471d3d15a22856fac3))
|
|
13
|
+
* **GlFormRadio,GlFormCheckbox:** Remove plain style ([415542c](https://gitlab.com/gitlab-org/gitlab-ui/commit/415542c144bcd599428065c736db16233801526a))
|
|
14
|
+
* **GlNav,GlTabs:** Remove vertical and card designs ([8bd8b00](https://gitlab.com/gitlab-org/gitlab-ui/commit/8bd8b00821494e80aacffb5210b24c73fc9a608a))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### BREAKING CHANGES
|
|
18
|
+
|
|
19
|
+
* **GlNav,GlTabs:** BootstrapVue's Nav and Tabs components support a vertical, and card
|
|
20
|
+
styles. These styles are now removed in GitLab UI.
|
|
21
|
+
* **GlFormRadio,GlFormCheckbox:** The GlFormRadio and GlFormCheckbox do not support the property 'plain'
|
|
22
|
+
anymore. Prefer overriding the CSS styles in case native browser styles
|
|
23
|
+
should be used instead.
|
|
24
|
+
* **FormRadio,FormCheckbox:** BootstrapVue's Radio Buttons and Checkboxes support a button style mode
|
|
25
|
+
which was never documented within our system. We do not support adding
|
|
26
|
+
the property 'button' on GlFormRadio and GlFormCheckbox.
|
|
27
|
+
* **GlButton:** The GlButton does not support the properties 'pill' and 'squared'
|
|
28
|
+
anymore.
|
|
29
|
+
Prefer using the styles with the usual border radius. When absolutely
|
|
30
|
+
necessary, apply GitLab UI Util CSS classes to override the border
|
|
31
|
+
radius
|
|
32
|
+
|
|
1
33
|
# [101.16.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v101.15.0...v101.16.0) (2024-11-07)
|
|
2
34
|
|
|
3
35
|
|
|
@@ -20,12 +20,10 @@ const props = makePropsConfigurable(sortKeys({
|
|
|
20
20
|
...linkProps,
|
|
21
21
|
block: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
22
22
|
disabled: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
23
|
-
pill: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
24
23
|
// Tri-state: `true`, `false` or `null`
|
|
25
24
|
// => On, off, not a toggle
|
|
26
25
|
pressed: makeProp(PROP_TYPE_BOOLEAN, null),
|
|
27
26
|
size: makeProp(PROP_TYPE_STRING),
|
|
28
|
-
squared: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
29
27
|
tag: makeProp(PROP_TYPE_STRING, 'button'),
|
|
30
28
|
type: makeProp(PROP_TYPE_STRING, 'button'),
|
|
31
29
|
variant: makeProp(PROP_TYPE_STRING, 'secondary')
|
|
@@ -60,8 +58,6 @@ const isNonStandardTag = props => !isLink(props) && !isButton(props);
|
|
|
60
58
|
const computeClass = props => [`btn-${props.variant || 'secondary'}`, {
|
|
61
59
|
[`btn-${props.size}`]: props.size,
|
|
62
60
|
'btn-block': props.block,
|
|
63
|
-
'rounded-pill': props.pill,
|
|
64
|
-
'rounded-0': props.squared && !props.pill,
|
|
65
61
|
disabled: props.disabled,
|
|
66
62
|
active: props.pressed
|
|
67
63
|
}];
|
|
@@ -21,8 +21,7 @@ const props = makePropsConfigurable({
|
|
|
21
21
|
pills: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
22
22
|
small: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
23
23
|
tabs: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
24
|
-
tag: makeProp(PROP_TYPE_STRING, 'ul')
|
|
25
|
-
vertical: makeProp(PROP_TYPE_BOOLEAN, false)
|
|
24
|
+
tag: makeProp(PROP_TYPE_STRING, 'ul')
|
|
26
25
|
}, NAME_NAV);
|
|
27
26
|
|
|
28
27
|
// --- Main component ---
|
|
@@ -41,7 +40,6 @@ const BNav = /*#__PURE__*/extend({
|
|
|
41
40
|
const {
|
|
42
41
|
tabs,
|
|
43
42
|
pills,
|
|
44
|
-
vertical,
|
|
45
43
|
align,
|
|
46
44
|
cardHeader
|
|
47
45
|
} = props;
|
|
@@ -50,12 +48,11 @@ const BNav = /*#__PURE__*/extend({
|
|
|
50
48
|
class: {
|
|
51
49
|
'nav-tabs': tabs,
|
|
52
50
|
'nav-pills': pills && !tabs,
|
|
53
|
-
'card-header-tabs':
|
|
54
|
-
'card-header-pills':
|
|
55
|
-
'
|
|
56
|
-
'nav-
|
|
57
|
-
|
|
58
|
-
[computeJustifyContent(align)]: !vertical && align,
|
|
51
|
+
'card-header-tabs': cardHeader && tabs,
|
|
52
|
+
'card-header-pills': cardHeader && pills && !tabs,
|
|
53
|
+
'nav-fill': props.fill,
|
|
54
|
+
'nav-justified': props.justified,
|
|
55
|
+
[computeJustifyContent(align)]: align,
|
|
59
56
|
small: props.small
|
|
60
57
|
}
|
|
61
58
|
}), children);
|
|
@@ -175,7 +175,6 @@ const props = makePropsConfigurable(sortKeys({
|
|
|
175
175
|
// Only applied to the currently active `<b-tab>`
|
|
176
176
|
// This prop is sniffed by the `<b-tab>` child
|
|
177
177
|
activeTabClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
|
|
178
|
-
card: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
179
178
|
contentClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
|
|
180
179
|
// Synonym for 'bottom'
|
|
181
180
|
end: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
@@ -215,13 +214,6 @@ const BTabs = /*#__PURE__*/extend({
|
|
|
215
214
|
fade() {
|
|
216
215
|
// This computed prop is sniffed by the tab child
|
|
217
216
|
return !this.noFade;
|
|
218
|
-
},
|
|
219
|
-
localNavClass() {
|
|
220
|
-
const classes = [];
|
|
221
|
-
if (this.card && this.vertical) {
|
|
222
|
-
classes.push('card-header', 'h-100', 'border-bottom-0', 'rounded-0');
|
|
223
|
-
}
|
|
224
|
-
return [...classes, this.navClass];
|
|
225
217
|
}
|
|
226
218
|
},
|
|
227
219
|
watch: {
|
|
@@ -489,7 +481,6 @@ const BTabs = /*#__PURE__*/extend({
|
|
|
489
481
|
render(h) {
|
|
490
482
|
const {
|
|
491
483
|
align,
|
|
492
|
-
card,
|
|
493
484
|
end,
|
|
494
485
|
fill,
|
|
495
486
|
firstTab,
|
|
@@ -501,8 +492,7 @@ const BTabs = /*#__PURE__*/extend({
|
|
|
501
492
|
pills,
|
|
502
493
|
previousTab,
|
|
503
494
|
small,
|
|
504
|
-
tabs: $tabs
|
|
505
|
-
vertical
|
|
495
|
+
tabs: $tabs
|
|
506
496
|
} = this;
|
|
507
497
|
|
|
508
498
|
// Currently active tab
|
|
@@ -553,7 +543,7 @@ const BTabs = /*#__PURE__*/extend({
|
|
|
553
543
|
});
|
|
554
544
|
});
|
|
555
545
|
let $nav = h(BNav, {
|
|
556
|
-
class: this.
|
|
546
|
+
class: this.navClass,
|
|
557
547
|
attrs: {
|
|
558
548
|
role: 'tablist',
|
|
559
549
|
id: this.safeId('_BV_tab_controls_')
|
|
@@ -564,35 +554,25 @@ const BTabs = /*#__PURE__*/extend({
|
|
|
564
554
|
align,
|
|
565
555
|
tabs: !noNavStyle && !pills,
|
|
566
556
|
pills: !noNavStyle && pills,
|
|
567
|
-
|
|
568
|
-
small,
|
|
569
|
-
cardHeader: card && !vertical
|
|
557
|
+
small
|
|
570
558
|
},
|
|
571
559
|
ref: 'nav'
|
|
572
560
|
}, [this.normalizeSlot(SLOT_NAME_TABS_START) || h(), $buttons, this.normalizeSlot(SLOT_NAME_TABS_END) || h()]);
|
|
573
561
|
$nav = h('div', {
|
|
574
|
-
class:
|
|
575
|
-
'card-header': card && !vertical && !end,
|
|
576
|
-
'card-footer': card && !vertical && end,
|
|
577
|
-
'col-auto': vertical
|
|
578
|
-
}, this.navWrapperClass],
|
|
562
|
+
class: this.navWrapperClass,
|
|
579
563
|
key: 'bv-tabs-nav'
|
|
580
564
|
}, [$nav]);
|
|
581
565
|
const $children = this.normalizeSlot() || [];
|
|
582
566
|
let $empty = h();
|
|
583
567
|
if ($children.length === 0) {
|
|
584
568
|
$empty = h('div', {
|
|
585
|
-
class: ['tab-pane', 'active',
|
|
586
|
-
'card-body': card
|
|
587
|
-
}],
|
|
569
|
+
class: ['tab-pane', 'active'],
|
|
588
570
|
key: 'bv-empty-tab'
|
|
589
571
|
}, this.normalizeSlot(SLOT_NAME_EMPTY));
|
|
590
572
|
}
|
|
591
573
|
const $content = h('div', {
|
|
592
574
|
staticClass: 'tab-content',
|
|
593
|
-
class:
|
|
594
|
-
col: vertical
|
|
595
|
-
}, this.contentClass],
|
|
575
|
+
class: this.contentClass,
|
|
596
576
|
attrs: {
|
|
597
577
|
id: this.safeId('_BV_tab_container_')
|
|
598
578
|
},
|
|
@@ -603,10 +583,6 @@ const BTabs = /*#__PURE__*/extend({
|
|
|
603
583
|
// Render final output
|
|
604
584
|
return h(this.tag, {
|
|
605
585
|
staticClass: 'tabs',
|
|
606
|
-
class: {
|
|
607
|
-
row: vertical,
|
|
608
|
-
'no-gutters': vertical && card
|
|
609
|
-
},
|
|
610
586
|
attrs: {
|
|
611
587
|
id: this.safeId()
|
|
612
588
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { installFactory } from './utils/plugins';
|
|
2
|
-
import { componentsPlugin } from './components';
|
|
3
1
|
export { BVConfigPlugin as BVConfig, BVConfigPlugin } from './bv-config';
|
|
4
2
|
export { BVToastPlugin } from './components/toast/helpers/bv-toast';
|
|
5
3
|
export { BBreadcrumb } from './components/breadcrumb/breadcrumb';
|
|
@@ -65,18 +63,10 @@ export { VBVisible } from './directives/visible/visible';
|
|
|
65
63
|
|
|
66
64
|
const NAME = 'BootstrapVue';
|
|
67
65
|
|
|
68
|
-
// --- BootstrapVue installer ---
|
|
69
|
-
const install = /*#__PURE__*/installFactory({
|
|
70
|
-
plugins: {
|
|
71
|
-
componentsPlugin
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
|
|
75
66
|
// --- BootstrapVue plugin ---
|
|
76
67
|
const BootstrapVue = {
|
|
77
|
-
install,
|
|
78
68
|
NAME
|
|
79
69
|
};
|
|
80
70
|
|
|
81
71
|
export default BootstrapVue;
|
|
82
|
-
export { BootstrapVue, NAME
|
|
72
|
+
export { BootstrapVue, NAME };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { extend } from '../vue';
|
|
2
|
-
import { PROP_TYPE_BOOLEAN_STRING,
|
|
2
|
+
import { PROP_TYPE_BOOLEAN_STRING, PROP_TYPE_BOOLEAN } from '../constants/props';
|
|
3
3
|
import { SLOT_NAME_FIRST } from '../constants/slots';
|
|
4
4
|
import { htmlOrText } from '../utils/html';
|
|
5
5
|
import { looseEqual } from '../utils/loose-equal';
|
|
@@ -38,10 +38,6 @@ const props = makePropsConfigurable(sortKeys({
|
|
|
38
38
|
...props$5,
|
|
39
39
|
...props$6,
|
|
40
40
|
ariaInvalid: makeProp(PROP_TYPE_BOOLEAN_STRING, false),
|
|
41
|
-
// Only applicable when rendered with button style
|
|
42
|
-
buttonVariant: makeProp(PROP_TYPE_STRING),
|
|
43
|
-
// Render as button style
|
|
44
|
-
buttons: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
45
41
|
stacked: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
46
42
|
validated: makeProp(PROP_TYPE_BOOLEAN, false)
|
|
47
43
|
}), 'formRadioCheckGroups');
|
|
@@ -69,21 +65,11 @@ const formRadioCheckGroupMixin = extend({
|
|
|
69
65
|
},
|
|
70
66
|
groupClasses() {
|
|
71
67
|
const {
|
|
72
|
-
inline,
|
|
73
|
-
size,
|
|
74
68
|
validated
|
|
75
69
|
} = this;
|
|
76
|
-
|
|
70
|
+
return {
|
|
77
71
|
'was-validated': validated
|
|
78
72
|
};
|
|
79
|
-
if (this.buttons) {
|
|
80
|
-
classes = [classes, 'btn-group-toggle', {
|
|
81
|
-
'btn-group': inline,
|
|
82
|
-
'btn-group-vertical': !inline,
|
|
83
|
-
[`btn-group-${size}`]: size
|
|
84
|
-
}];
|
|
85
|
-
}
|
|
86
|
-
return classes;
|
|
87
73
|
}
|
|
88
74
|
},
|
|
89
75
|
watch: {
|
|
@@ -37,10 +37,6 @@ const props = makePropsConfigurable(sortKeys({
|
|
|
37
37
|
...props$5,
|
|
38
38
|
ariaLabel: makeProp(PROP_TYPE_STRING),
|
|
39
39
|
ariaLabelledby: makeProp(PROP_TYPE_STRING),
|
|
40
|
-
// Only applicable in standalone mode (non group)
|
|
41
|
-
button: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
42
|
-
// Only applicable when rendered with button style
|
|
43
|
-
buttonVariant: makeProp(PROP_TYPE_STRING),
|
|
44
40
|
inline: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
45
41
|
value: makeProp(PROP_TYPE_ANY)
|
|
46
42
|
}), 'formRadioCheckControls');
|
|
@@ -54,8 +50,7 @@ const formRadioCheckMixin = extend({
|
|
|
54
50
|
props,
|
|
55
51
|
data() {
|
|
56
52
|
return {
|
|
57
|
-
localChecked: this.isGroup ? this.bvGroup[MODEL_PROP_NAME] : this[MODEL_PROP_NAME]
|
|
58
|
-
hasFocus: false
|
|
53
|
+
localChecked: this.isGroup ? this.bvGroup[MODEL_PROP_NAME] : this[MODEL_PROP_NAME]
|
|
59
54
|
};
|
|
60
55
|
},
|
|
61
56
|
computed: {
|
|
@@ -81,19 +76,9 @@ const formRadioCheckMixin = extend({
|
|
|
81
76
|
// Is this check/radio a child of check-group or radio-group?
|
|
82
77
|
return !!this.bvGroup;
|
|
83
78
|
},
|
|
84
|
-
isBtnMode() {
|
|
85
|
-
// Support button style in single input mode
|
|
86
|
-
return this.isGroup ? this.bvGroup.buttons : this.button;
|
|
87
|
-
},
|
|
88
|
-
isPlain() {
|
|
89
|
-
return this.isBtnMode ? false : this.isGroup ? this.bvGroup.plain : this.plain;
|
|
90
|
-
},
|
|
91
|
-
isCustom() {
|
|
92
|
-
return this.isBtnMode ? false : !this.isPlain;
|
|
93
|
-
},
|
|
94
79
|
isSwitch() {
|
|
95
80
|
// Custom switch styling (checkboxes only)
|
|
96
|
-
return this.
|
|
81
|
+
return this.isRadio ? false : this.isGroup ? this.bvGroup.switches : this.switch;
|
|
97
82
|
},
|
|
98
83
|
isInline() {
|
|
99
84
|
return this.isGroup ? this.bvGroup.inline : this.inline;
|
|
@@ -121,33 +106,6 @@ const formRadioCheckMixin = extend({
|
|
|
121
106
|
computedState() {
|
|
122
107
|
return this.isGroup ? this.bvGroup.computedState : isBoolean(this.state) ? this.state : null;
|
|
123
108
|
},
|
|
124
|
-
computedButtonVariant() {
|
|
125
|
-
// Local variant preferred over group variant
|
|
126
|
-
const {
|
|
127
|
-
buttonVariant
|
|
128
|
-
} = this;
|
|
129
|
-
if (buttonVariant) {
|
|
130
|
-
return buttonVariant;
|
|
131
|
-
}
|
|
132
|
-
if (this.isGroup && this.bvGroup.buttonVariant) {
|
|
133
|
-
return this.bvGroup.buttonVariant;
|
|
134
|
-
}
|
|
135
|
-
return 'secondary';
|
|
136
|
-
},
|
|
137
|
-
buttonClasses() {
|
|
138
|
-
const {
|
|
139
|
-
computedSize
|
|
140
|
-
} = this;
|
|
141
|
-
return ['btn', `btn-${this.computedButtonVariant}`, {
|
|
142
|
-
[`btn-${computedSize}`]: computedSize,
|
|
143
|
-
// 'disabled' class makes "button" look disabled
|
|
144
|
-
disabled: this.isDisabled,
|
|
145
|
-
// 'active' class makes "button" look pressed
|
|
146
|
-
active: this.isChecked,
|
|
147
|
-
// Focus class makes button look focused
|
|
148
|
-
focus: this.hasFocus
|
|
149
|
-
}];
|
|
150
|
-
},
|
|
151
109
|
computedAttrs() {
|
|
152
110
|
const {
|
|
153
111
|
isDisabled: disabled,
|
|
@@ -209,17 +167,6 @@ const formRadioCheckMixin = extend({
|
|
|
209
167
|
}
|
|
210
168
|
});
|
|
211
169
|
},
|
|
212
|
-
handleFocus(event) {
|
|
213
|
-
// When in buttons mode, we need to add 'focus' class to label when input focused
|
|
214
|
-
// As it is the hidden input which has actual focus
|
|
215
|
-
if (event.target) {
|
|
216
|
-
if (event.type === 'focus') {
|
|
217
|
-
this.hasFocus = true;
|
|
218
|
-
} else if (event.type === 'blur') {
|
|
219
|
-
this.hasFocus = false;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
170
|
// Convenience methods for focusing the input
|
|
224
171
|
focus() {
|
|
225
172
|
if (!this.isDisabled) {
|
|
@@ -235,9 +182,6 @@ const formRadioCheckMixin = extend({
|
|
|
235
182
|
render(h) {
|
|
236
183
|
const {
|
|
237
184
|
isRadio,
|
|
238
|
-
isBtnMode,
|
|
239
|
-
isPlain,
|
|
240
|
-
isCustom,
|
|
241
185
|
isInline,
|
|
242
186
|
isSwitch,
|
|
243
187
|
computedSize,
|
|
@@ -245,12 +189,7 @@ const formRadioCheckMixin = extend({
|
|
|
245
189
|
} = this;
|
|
246
190
|
const $content = this.normalizeSlot();
|
|
247
191
|
const $input = h('input', {
|
|
248
|
-
class: [
|
|
249
|
-
'form-check-input': isPlain,
|
|
250
|
-
'custom-control-input': isCustom,
|
|
251
|
-
// https://github.com/bootstrap-vue/bootstrap-vue/issues/2911
|
|
252
|
-
'position-static': isPlain && !$content
|
|
253
|
-
}, isBtnMode ? '' : this.stateClass],
|
|
192
|
+
class: ['custom-control-input', this.stateClass],
|
|
254
193
|
directives: [{
|
|
255
194
|
name: 'model',
|
|
256
195
|
value: this.computedLocalChecked
|
|
@@ -261,55 +200,26 @@ const formRadioCheckMixin = extend({
|
|
|
261
200
|
checked: this.isChecked
|
|
262
201
|
},
|
|
263
202
|
on: {
|
|
264
|
-
change: this.handleChange
|
|
265
|
-
...(isBtnMode ? {
|
|
266
|
-
focus: this.handleFocus,
|
|
267
|
-
blur: this.handleFocus
|
|
268
|
-
} : {})
|
|
203
|
+
change: this.handleChange
|
|
269
204
|
},
|
|
270
205
|
key: 'input',
|
|
271
206
|
ref: 'input'
|
|
272
207
|
});
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
if (!this.isGroup) {
|
|
278
|
-
// Standalone button mode, so wrap in 'btn-group-toggle'
|
|
279
|
-
// and flag it as inline-block to mimic regular buttons
|
|
280
|
-
$button = h('div', {
|
|
281
|
-
class: ['btn-group-toggle', 'd-inline-block']
|
|
282
|
-
}, [$button]);
|
|
208
|
+
const $label = h('label', {
|
|
209
|
+
class: 'custom-control-label',
|
|
210
|
+
attrs: {
|
|
211
|
+
for: this.safeId()
|
|
283
212
|
}
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// If no label content in plain mode we dont render the label
|
|
288
|
-
// See: https://github.com/bootstrap-vue/bootstrap-vue/issues/2911
|
|
289
|
-
let $label = h();
|
|
290
|
-
if (!(isPlain && !$content)) {
|
|
291
|
-
$label = h('label', {
|
|
292
|
-
class: {
|
|
293
|
-
'form-check-label': isPlain,
|
|
294
|
-
'custom-control-label': isCustom
|
|
295
|
-
},
|
|
296
|
-
attrs: {
|
|
297
|
-
for: this.safeId()
|
|
298
|
-
}
|
|
299
|
-
}, $content);
|
|
300
|
-
}
|
|
213
|
+
}, $content);
|
|
301
214
|
return h('div', {
|
|
302
215
|
class: [{
|
|
303
|
-
'
|
|
304
|
-
'
|
|
305
|
-
'custom-control': isCustom,
|
|
306
|
-
'custom-control-inline': isCustom && isInline,
|
|
307
|
-
'custom-checkbox': isCustom && !isRadio && !isSwitch,
|
|
216
|
+
'custom-control-inline': isInline,
|
|
217
|
+
'custom-checkbox': !isRadio && !isSwitch,
|
|
308
218
|
'custom-switch': isSwitch,
|
|
309
|
-
'custom-radio':
|
|
219
|
+
'custom-radio': isRadio,
|
|
310
220
|
// Temporary until Bootstrap v4 supports sizing (most likely in V5)
|
|
311
|
-
[`b-custom-control-${computedSize}`]: computedSize
|
|
312
|
-
}, bvAttrs.class],
|
|
221
|
+
[`b-custom-control-${computedSize}`]: computedSize
|
|
222
|
+
}, 'custom-control', bvAttrs.class],
|
|
313
223
|
style: bvAttrs.style
|
|
314
224
|
}, [$input, $label]);
|
|
315
225
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "102.0.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -115,7 +115,6 @@
|
|
|
115
115
|
"@jest/test-sequencer": "^29.7.0",
|
|
116
116
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
117
117
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
118
|
-
"@rollup/plugin-replace": "^2.3.2",
|
|
119
118
|
"@storybook/addon-a11y": "^7.6.20",
|
|
120
119
|
"@storybook/addon-docs": "^7.6.20",
|
|
121
120
|
"@storybook/addon-essentials": "^7.6.20",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Modifications to Vendored Code
|
|
2
|
+
|
|
3
|
+
**Library**: BootstrapVue
|
|
4
|
+
**Version**: 2.23.1 **Link:** https://bootstrap-vue.org **Source:**
|
|
5
|
+
https://github.com/bootstrap-vue/bootstrap-vue **Copyright:** (c) 2016-2024 BootstrapVue
|
|
6
|
+
**License:** (c)
|
|
7
|
+
[2016-2024 BootstrapVue](https://github.com/bootstrap-vue/bootstrap-vue/blob/master/LICENSE)
|
|
8
|
+
|
|
9
|
+
This file documents modifications made to the original BootstrapVue component files.
|
|
10
|
+
|
|
11
|
+
## Removed unnecessary properties
|
|
12
|
+
|
|
13
|
+
The following properties have been removed as they are no longer supported in our implementation:
|
|
14
|
+
|
|
15
|
+
- `pill`
|
|
16
|
+
- `squared`
|
|
@@ -134,45 +134,6 @@ prop.
|
|
|
134
134
|
<!-- b-button-block.vue -->
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
## Pill style
|
|
138
|
-
|
|
139
|
-
Prefer buttons with a more rounded-pill style? Just set the prop `pill` to true.
|
|
140
|
-
|
|
141
|
-
```html
|
|
142
|
-
<div>
|
|
143
|
-
<b-button pill>Button</b-button>
|
|
144
|
-
<b-button pill variant="primary">Button</b-button>
|
|
145
|
-
<b-button pill variant="outline-secondary">Button</b-button>
|
|
146
|
-
<b-button pill variant="success">Button</b-button>
|
|
147
|
-
<b-button pill variant="outline-danger">Button</b-button>
|
|
148
|
-
<b-button pill variant="info">Button</b-button>
|
|
149
|
-
</div>
|
|
150
|
-
|
|
151
|
-
<!-- b-button-pill.vue -->
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
This prop adds the Bootstrap v4.3 utility class `.rounded-pill` on the rendered button.
|
|
155
|
-
|
|
156
|
-
## Squared style
|
|
157
|
-
|
|
158
|
-
Prefer buttons with a more square corner style? Just set the prop `squared` to true.
|
|
159
|
-
|
|
160
|
-
```html
|
|
161
|
-
<div>
|
|
162
|
-
<b-button squared>Button</b-button>
|
|
163
|
-
<b-button squared variant="primary">Button</b-button>
|
|
164
|
-
<b-button squared variant="outline-secondary">Button</b-button>
|
|
165
|
-
<b-button squared variant="success">Button</b-button>
|
|
166
|
-
<b-button squared variant="outline-danger">Button</b-button>
|
|
167
|
-
<b-button squared variant="info">Button</b-button>
|
|
168
|
-
</div>
|
|
169
|
-
|
|
170
|
-
<!-- b-button-square.vue -->
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
The `squared` prop adds the Bootstrap v4.3 utility class `.rounded-0` on the rendered button. The
|
|
174
|
-
`pill` prop takes precedence over the `squared` prop.
|
|
175
|
-
|
|
176
137
|
## Disabled state
|
|
177
138
|
|
|
178
139
|
Set the `disabled` prop to disable button default functionality. `disabled` also works with buttons
|
|
@@ -22,12 +22,10 @@ export const props = makePropsConfigurable(
|
|
|
22
22
|
...linkProps,
|
|
23
23
|
block: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
24
24
|
disabled: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
25
|
-
pill: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
26
25
|
// Tri-state: `true`, `false` or `null`
|
|
27
26
|
// => On, off, not a toggle
|
|
28
27
|
pressed: makeProp(PROP_TYPE_BOOLEAN, null),
|
|
29
28
|
size: makeProp(PROP_TYPE_STRING),
|
|
30
|
-
squared: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
31
29
|
tag: makeProp(PROP_TYPE_STRING, 'button'),
|
|
32
30
|
type: makeProp(PROP_TYPE_STRING, 'button'),
|
|
33
31
|
variant: makeProp(PROP_TYPE_STRING, 'secondary')
|
|
@@ -66,8 +64,6 @@ const computeClass = props => [
|
|
|
66
64
|
{
|
|
67
65
|
[`btn-${props.size}`]: props.size,
|
|
68
66
|
'btn-block': props.block,
|
|
69
|
-
'rounded-pill': props.pill,
|
|
70
|
-
'rounded-0': props.squared && !props.pill,
|
|
71
67
|
disabled: props.disabled,
|
|
72
68
|
active: props.pressed
|
|
73
69
|
}
|
|
@@ -100,42 +100,6 @@ describe('button', () => {
|
|
|
100
100
|
wrapper.destroy()
|
|
101
101
|
})
|
|
102
102
|
|
|
103
|
-
it('applies rounded-pill class when pill prop set', async () => {
|
|
104
|
-
const wrapper = mount(BButton, {
|
|
105
|
-
propsData: {
|
|
106
|
-
pill: true
|
|
107
|
-
}
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
expect(wrapper.element.tagName).toBe('BUTTON')
|
|
111
|
-
expect(wrapper.attributes('type')).toBeDefined()
|
|
112
|
-
expect(wrapper.attributes('type')).toBe('button')
|
|
113
|
-
expect(wrapper.classes()).toContain('btn')
|
|
114
|
-
expect(wrapper.classes()).toContain('btn-secondary')
|
|
115
|
-
expect(wrapper.classes()).toContain('rounded-pill')
|
|
116
|
-
expect(wrapper.classes().length).toBe(3)
|
|
117
|
-
|
|
118
|
-
wrapper.destroy()
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
it('applies rounded-0 class when squared prop set', async () => {
|
|
122
|
-
const wrapper = mount(BButton, {
|
|
123
|
-
propsData: {
|
|
124
|
-
squared: true
|
|
125
|
-
}
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
expect(wrapper.element.tagName).toBe('BUTTON')
|
|
129
|
-
expect(wrapper.attributes('type')).toBeDefined()
|
|
130
|
-
expect(wrapper.attributes('type')).toBe('button')
|
|
131
|
-
expect(wrapper.classes()).toContain('btn')
|
|
132
|
-
expect(wrapper.classes()).toContain('btn-secondary')
|
|
133
|
-
expect(wrapper.classes()).toContain('rounded-0')
|
|
134
|
-
expect(wrapper.classes().length).toBe(3)
|
|
135
|
-
|
|
136
|
-
wrapper.destroy()
|
|
137
|
-
})
|
|
138
|
-
|
|
139
103
|
it('renders custom root element', async () => {
|
|
140
104
|
const wrapper = mount(BButton, {
|
|
141
105
|
propsData: {
|