@gitlab/ui 80.6.0 → 80.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.
- package/CHANGELOG.md +14 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +1 -1
- package/src/components/base/form/form_group/form_group.scss +6 -2
- package/src/components/base/new_dropdowns/listbox/listbox.spec.js +13 -13
- package/src/components/base/new_dropdowns/listbox/listbox.stories.js +1 -13
package/package.json
CHANGED
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
.invalid-feedback,
|
|
22
22
|
.valid-feedback,
|
|
23
|
-
.text-gl-muted
|
|
23
|
+
.text-gl-muted,
|
|
24
|
+
.gl-text-secondary {
|
|
24
25
|
@include gl-font-base;
|
|
25
26
|
@include gl-line-height-normal;
|
|
26
27
|
}
|
|
@@ -29,13 +30,16 @@
|
|
|
29
30
|
+ .invalid-feedback,
|
|
30
31
|
+ .valid-feedback,
|
|
31
32
|
+ .text-gl-muted,
|
|
32
|
-
&.is-valid + .invalid-feedback + .text-gl-muted
|
|
33
|
+
&.is-valid + .invalid-feedback + .text-gl-muted,
|
|
34
|
+
+ .gl-text-secondary,
|
|
35
|
+
&.is-valid + .invalid-feedback + .gl-text-secondary {
|
|
33
36
|
// See https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/2806
|
|
34
37
|
// for the reasoning behind the "valid+invalid" selector above
|
|
35
38
|
@include gl-mt-3;
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
|
|
42
|
+
// Deprecated, soon to be removed
|
|
39
43
|
.text-gl-muted {
|
|
40
44
|
@include gl-text-gray-500;
|
|
41
45
|
}
|
|
@@ -614,7 +614,7 @@ describe('GlCollapsibleListbox', () => {
|
|
|
614
614
|
describe('with select all action', () => {
|
|
615
615
|
it('throws an error when enabling the select action without a header', () => {
|
|
616
616
|
expect(() => {
|
|
617
|
-
buildWrapper({ showSelectAllButtonLabel: 'Select
|
|
617
|
+
buildWrapper({ showSelectAllButtonLabel: 'Select all' });
|
|
618
618
|
}).toThrow(
|
|
619
619
|
'The select all button cannot be rendered without a header. Either provide a header via the headerText prop, or do not provide the showSelectAllButtonLabel prop.'
|
|
620
620
|
);
|
|
@@ -633,7 +633,7 @@ describe('GlCollapsibleListbox', () => {
|
|
|
633
633
|
buildWrapper({
|
|
634
634
|
headerText: 'Select assignee',
|
|
635
635
|
resetButtonLabel: 'Unassign',
|
|
636
|
-
showSelectAllButtonLabel: 'Select
|
|
636
|
+
showSelectAllButtonLabel: 'Select all',
|
|
637
637
|
items: mockOptions,
|
|
638
638
|
selected,
|
|
639
639
|
multiple,
|
|
@@ -654,7 +654,7 @@ describe('GlCollapsibleListbox', () => {
|
|
|
654
654
|
buildWrapper({
|
|
655
655
|
headerText: 'Select assignee',
|
|
656
656
|
resetButtonLabel: 'Unassign',
|
|
657
|
-
showSelectAllButtonLabel: 'Select
|
|
657
|
+
showSelectAllButtonLabel: 'Select all',
|
|
658
658
|
items: mockOptions,
|
|
659
659
|
selected: mockOptionsValues.slice(0, 1),
|
|
660
660
|
multiple: true,
|
|
@@ -668,7 +668,7 @@ describe('GlCollapsibleListbox', () => {
|
|
|
668
668
|
buildWrapper({
|
|
669
669
|
headerText: 'Select assignee',
|
|
670
670
|
resetButtonLabel: 'Unassign',
|
|
671
|
-
showSelectAllButtonLabel: 'Select
|
|
671
|
+
showSelectAllButtonLabel: 'Select all',
|
|
672
672
|
items: [],
|
|
673
673
|
multiple: true,
|
|
674
674
|
});
|
|
@@ -680,7 +680,7 @@ describe('GlCollapsibleListbox', () => {
|
|
|
680
680
|
buildWrapper({
|
|
681
681
|
headerText: 'Select assignee',
|
|
682
682
|
resetButtonLabel: 'Unassign',
|
|
683
|
-
showSelectAllButtonLabel: 'Select
|
|
683
|
+
showSelectAllButtonLabel: 'Select all',
|
|
684
684
|
selected: mockOptionsValues,
|
|
685
685
|
items: mockOptions,
|
|
686
686
|
multiple: true,
|
|
@@ -689,37 +689,37 @@ describe('GlCollapsibleListbox', () => {
|
|
|
689
689
|
expect(findSelectAllButton().exists()).toBe(false);
|
|
690
690
|
});
|
|
691
691
|
|
|
692
|
-
it('has the label text "Select
|
|
692
|
+
it('has the label text "Select all" if the label is provided and some items are selected', () => {
|
|
693
693
|
buildWrapper({
|
|
694
694
|
headerText: 'Select assignee',
|
|
695
695
|
resetButtonLabel: 'Unassign',
|
|
696
|
-
showSelectAllButtonLabel: 'Select
|
|
696
|
+
showSelectAllButtonLabel: 'Select all',
|
|
697
697
|
selected: [mockOptions[1].value],
|
|
698
698
|
items: mockOptions,
|
|
699
699
|
multiple: true,
|
|
700
700
|
});
|
|
701
701
|
|
|
702
|
-
expect(findSelectAllButton().text()).toBe('Select
|
|
702
|
+
expect(findSelectAllButton().text()).toBe('Select all');
|
|
703
703
|
});
|
|
704
704
|
|
|
705
|
-
it('has the label text "Select
|
|
705
|
+
it('has the label text "Select all" if the label is provided and the selection is empty', () => {
|
|
706
706
|
buildWrapper({
|
|
707
707
|
headerText: 'Select assignee',
|
|
708
708
|
resetButtonLabel: 'Unassign',
|
|
709
|
-
showSelectAllButtonLabel: 'Select
|
|
709
|
+
showSelectAllButtonLabel: 'Select all',
|
|
710
710
|
selected: [],
|
|
711
711
|
items: mockOptions,
|
|
712
712
|
multiple: true,
|
|
713
713
|
});
|
|
714
714
|
|
|
715
|
-
expect(findSelectAllButton().text()).toBe('Select
|
|
715
|
+
expect(findSelectAllButton().text()).toBe('Select all');
|
|
716
716
|
});
|
|
717
717
|
|
|
718
718
|
it('on click, emits the `select-all` event and calls `closeAndFocus`', () => {
|
|
719
719
|
buildWrapper({
|
|
720
720
|
headerText: 'Select assignee',
|
|
721
721
|
resetButtonLabel: 'Unassign',
|
|
722
|
-
showSelectAllButtonLabel: 'Select
|
|
722
|
+
showSelectAllButtonLabel: 'Select all',
|
|
723
723
|
selected: [],
|
|
724
724
|
items: mockOptions,
|
|
725
725
|
multiple: true,
|
|
@@ -737,7 +737,7 @@ describe('GlCollapsibleListbox', () => {
|
|
|
737
737
|
buildWrapper({
|
|
738
738
|
headerText: 'Select assignee',
|
|
739
739
|
resetButtonLabel: 'Unassign',
|
|
740
|
-
showSelectAllButtonLabel: 'Select
|
|
740
|
+
showSelectAllButtonLabel: 'Select all',
|
|
741
741
|
selected: mockGroupOptionsValues,
|
|
742
742
|
items: mockGroups,
|
|
743
743
|
multiple: true,
|
|
@@ -175,22 +175,10 @@ export const HeaderAndFooter = (args, { argTypes }) => ({
|
|
|
175
175
|
selected: [],
|
|
176
176
|
};
|
|
177
177
|
},
|
|
178
|
-
methods: {
|
|
179
|
-
selectAllItems() {
|
|
180
|
-
const allValues = mockOptions.map(({ value }) => value);
|
|
181
|
-
this.selected = [...allValues];
|
|
182
|
-
},
|
|
183
|
-
onReset() {
|
|
184
|
-
this.selected = [];
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
178
|
template: template(
|
|
188
179
|
`
|
|
189
180
|
<template #footer>
|
|
190
181
|
<div class="gl-border-t-solid gl-border-t-1 gl-border-t-gray-200 gl-display-flex gl-flex-direction-column gl-p-2! gl-pt-0!">
|
|
191
|
-
<gl-button @click="selectAllItems" category="tertiary" block class="gl-justify-content-start! gl-mt-2!">
|
|
192
|
-
Select all
|
|
193
|
-
</gl-button>
|
|
194
182
|
<gl-button category="tertiary" block class="gl-justify-content-start! gl-mt-2!" data-testid="footer-bottom-button">
|
|
195
183
|
Manage departments
|
|
196
184
|
</gl-button>
|
|
@@ -251,7 +239,7 @@ HeaderActions.args = generateProps({
|
|
|
251
239
|
toggleText: 'Header actions',
|
|
252
240
|
headerText: 'Assign to department',
|
|
253
241
|
resetButtonLabel: 'Unassign',
|
|
254
|
-
showSelectAllButtonLabel: 'Select
|
|
242
|
+
showSelectAllButtonLabel: 'Select all',
|
|
255
243
|
multiple: true,
|
|
256
244
|
block: true,
|
|
257
245
|
});
|