@gitlab/ui 33.1.1 → 33.1.2
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 +7 -0
- package/dist/components/base/accordion/accordion.js +6 -2
- package/dist/components/base/accordion/accordion_item.js +2 -2
- package/package.json +1 -1
- package/src/components/base/accordion/accordion.vue +5 -2
- package/src/components/base/accordion/accordion_item.spec.js +2 -2
- package/src/components/base/accordion/accordion_item.stories.js +2 -2
- package/src/components/base/accordion/accordion_item.vue +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [33.1.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v33.1.1...v33.1.2) (2022-01-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Add a workaround for GlAccordion compatibility with Vue Apollo ([55deabf](https://gitlab.com/gitlab-org/gitlab-ui/commit/55deabf3260643079e20db1ad2787980afdd8e56))
|
|
7
|
+
|
|
1
8
|
## [33.1.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v33.1.0...v33.1.1) (2022-01-27)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -5,9 +5,13 @@ var script = {
|
|
|
5
5
|
name: 'GlAccordion',
|
|
6
6
|
|
|
7
7
|
provide() {
|
|
8
|
+
const accordionId = _uniqueId('accordion-set-'); // temporary fix for this issue: https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/2019#note_514671251
|
|
9
|
+
// MR for the upstream pending: https://github.com/vuejs/apollo/pull/1153
|
|
10
|
+
|
|
11
|
+
|
|
8
12
|
return {
|
|
9
|
-
defaultHeaderLevel: this.headerLevel,
|
|
10
|
-
accordionSetId: this.autoCollapse &&
|
|
13
|
+
defaultHeaderLevel: () => this.headerLevel,
|
|
14
|
+
accordionSetId: () => this.autoCollapse && accordionId
|
|
11
15
|
};
|
|
12
16
|
},
|
|
13
17
|
|
|
@@ -57,12 +57,12 @@ var script = {
|
|
|
57
57
|
|
|
58
58
|
computed: {
|
|
59
59
|
headerComponent() {
|
|
60
|
-
const level = this.headerLevel || this.defaultHeaderLevel;
|
|
60
|
+
const level = this.headerLevel || this.defaultHeaderLevel();
|
|
61
61
|
return `h${level}`;
|
|
62
62
|
},
|
|
63
63
|
|
|
64
64
|
accordion() {
|
|
65
|
-
return this.accordionSetId || undefined;
|
|
65
|
+
return this.accordionSetId() || undefined;
|
|
66
66
|
},
|
|
67
67
|
|
|
68
68
|
icon() {
|
package/package.json
CHANGED
|
@@ -4,9 +4,12 @@ import { uniqueId } from 'lodash';
|
|
|
4
4
|
export default {
|
|
5
5
|
name: 'GlAccordion',
|
|
6
6
|
provide() {
|
|
7
|
+
const accordionId = uniqueId('accordion-set-');
|
|
8
|
+
// temporary fix for this issue: https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/2019#note_514671251
|
|
9
|
+
// MR for the upstream pending: https://github.com/vuejs/apollo/pull/1153
|
|
7
10
|
return {
|
|
8
|
-
defaultHeaderLevel: this.headerLevel,
|
|
9
|
-
accordionSetId: this.autoCollapse &&
|
|
11
|
+
defaultHeaderLevel: () => this.headerLevel,
|
|
12
|
+
accordionSetId: () => this.autoCollapse && accordionId,
|
|
10
13
|
};
|
|
11
14
|
},
|
|
12
15
|
props: {
|
|
@@ -16,8 +16,8 @@ describe('GlAccordionItem', () => {
|
|
|
16
16
|
GlCollapseToggle: GlCollapseToggleDirective,
|
|
17
17
|
},
|
|
18
18
|
provide: {
|
|
19
|
-
defaultHeaderLevel,
|
|
20
|
-
accordionSetId,
|
|
19
|
+
defaultHeaderLevel: () => defaultHeaderLevel,
|
|
20
|
+
accordionSetId: () => accordionSetId,
|
|
21
21
|
},
|
|
22
22
|
propsData: {
|
|
23
23
|
title: defaultTitle,
|
|
@@ -26,8 +26,8 @@ const Template = (args) => ({
|
|
|
26
26
|
props: Object.keys(args),
|
|
27
27
|
template,
|
|
28
28
|
provide: {
|
|
29
|
-
defaultHeaderLevel: defaultValue('headerLevel'),
|
|
30
|
-
accordionSetId: '1',
|
|
29
|
+
defaultHeaderLevel: () => defaultValue('headerLevel'),
|
|
30
|
+
accordionSetId: () => '1',
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
33
|
|
|
@@ -51,11 +51,11 @@ When set, it will ensure the accordion item is initially visible
|
|
|
51
51
|
},
|
|
52
52
|
computed: {
|
|
53
53
|
headerComponent() {
|
|
54
|
-
const level = this.headerLevel || this.defaultHeaderLevel;
|
|
54
|
+
const level = this.headerLevel || this.defaultHeaderLevel();
|
|
55
55
|
return `h${level}`;
|
|
56
56
|
},
|
|
57
57
|
accordion() {
|
|
58
|
-
return this.accordionSetId || undefined;
|
|
58
|
+
return this.accordionSetId() || undefined;
|
|
59
59
|
},
|
|
60
60
|
icon() {
|
|
61
61
|
return this.isVisible ? 'chevron-down' : 'chevron-right';
|