@gitlab/ui 42.22.1 → 42.23.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 +7 -0
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/package.json +7 -5
- package/src/components/base/form/form_checkbox_tree/form_checkbox_tree.spec.js +15 -16
- package/src/components/base/form/form_radio/form_radio.spec.js +6 -5
- package/src/components/base/form/form_radio_group/form_radio_group.spec.js +7 -6
- package/src/scss/utilities.scss +10 -0
- package/src/scss/utility-mixins/spacing.scss +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "42.
|
|
3
|
+
"version": "42.23.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@babel/preset-env": "^7.10.2",
|
|
84
84
|
"@gitlab/eslint-plugin": "14.0.0",
|
|
85
85
|
"@gitlab/stylelint-config": "4.1.0",
|
|
86
|
-
"@gitlab/svgs": "2.
|
|
86
|
+
"@gitlab/svgs": "2.30.0",
|
|
87
87
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
88
88
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
89
89
|
"@rollup/plugin-replace": "^2.3.2",
|
|
@@ -96,8 +96,9 @@
|
|
|
96
96
|
"@storybook/theming": "6.5.9",
|
|
97
97
|
"@storybook/vue": "6.5.9",
|
|
98
98
|
"@vue/test-utils": "1.3.0",
|
|
99
|
+
"@vue/vue2-jest": "27.0.0",
|
|
99
100
|
"autoprefixer": "^9.7.6",
|
|
100
|
-
"babel-jest": "^
|
|
101
|
+
"babel-jest": "^27.5.1",
|
|
101
102
|
"babel-loader": "^8.0.5",
|
|
102
103
|
"babel-plugin-lodash": "^3.3.4",
|
|
103
104
|
"babel-plugin-require-context-hook": "^1.0.0",
|
|
@@ -113,7 +114,9 @@
|
|
|
113
114
|
"glob": "^7.2.0",
|
|
114
115
|
"identity-obj-proxy": "^3.0.0",
|
|
115
116
|
"inquirer-select-directory": "^1.2.0",
|
|
116
|
-
"jest": "^
|
|
117
|
+
"jest": "^27.5.1",
|
|
118
|
+
"jest-circus": "27.5.1",
|
|
119
|
+
"jest-environment-jsdom": "27.5.1",
|
|
117
120
|
"jest-raw-loader": "^1.0.1",
|
|
118
121
|
"jest-serializer-vue": "^2.0.2",
|
|
119
122
|
"markdownlint-cli": "^0.29.0",
|
|
@@ -144,7 +147,6 @@
|
|
|
144
147
|
"stylelint-config-prettier": "9.0.3",
|
|
145
148
|
"stylelint-prettier": "2.0.0",
|
|
146
149
|
"vue": "2.6.11",
|
|
147
|
-
"vue-jest": "4.0.0-rc.0",
|
|
148
150
|
"vue-loader": "^15.8.3",
|
|
149
151
|
"vue-template-compiler": "2.6.11"
|
|
150
152
|
},
|
|
@@ -64,6 +64,7 @@ const SHAPE = {
|
|
|
64
64
|
___.4
|
|
65
65
|
___.5
|
|
66
66
|
`,
|
|
67
|
+
|
|
67
68
|
COMPLEX: `
|
|
68
69
|
_.1
|
|
69
70
|
__.2
|
|
@@ -149,11 +150,10 @@ describe('GlFormCheckboxTree', () => {
|
|
|
149
150
|
`('when checking a parent checkbox in a $description tree', ({ shape, boxToCheck }) => {
|
|
150
151
|
let checkbox;
|
|
151
152
|
|
|
152
|
-
beforeEach(() => {
|
|
153
|
+
beforeEach(async () => {
|
|
153
154
|
createWrapper({ options: getOptions(shape) });
|
|
154
155
|
checkbox = wrapper.find(`[data-qa-selector="${QA_PREFIX}${boxToCheck}"]`);
|
|
155
|
-
checkbox.find('input').
|
|
156
|
-
return wrapper.vm.$nextTick();
|
|
156
|
+
await checkbox.find('input').setChecked();
|
|
157
157
|
});
|
|
158
158
|
|
|
159
159
|
it("checks all of the checkbox's children, if any", () => {
|
|
@@ -174,10 +174,11 @@ describe('GlFormCheckboxTree', () => {
|
|
|
174
174
|
`(
|
|
175
175
|
'when checking child checkboxes in a $description tree',
|
|
176
176
|
({ shape, boxesToCheck, indeterminateBoxes, checkedParents }) => {
|
|
177
|
-
beforeEach(() => {
|
|
177
|
+
beforeEach(async () => {
|
|
178
178
|
createWrapper({ options: getOptions(shape) });
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
await Promise.allSettled(
|
|
180
|
+
boxesToCheck.map((box) => findCheckboxInput(findCheckboxByValue(box)).setChecked())
|
|
181
|
+
);
|
|
181
182
|
});
|
|
182
183
|
|
|
183
184
|
it('parents that have remaining unchecked children become indeterminate', () => {
|
|
@@ -205,12 +206,11 @@ describe('GlFormCheckboxTree', () => {
|
|
|
205
206
|
`(
|
|
206
207
|
'when unchecking checkboxes in a $description tree',
|
|
207
208
|
({ shape, initiallyChecked, boxesToUncheck, indeterminateBoxes, uncheckedBoxes }) => {
|
|
208
|
-
beforeEach(() => {
|
|
209
|
+
beforeEach(async () => {
|
|
209
210
|
createWrapper({ options: getOptions(shape), [V_MODEL.PROP]: initiallyChecked });
|
|
210
|
-
|
|
211
|
-
findCheckboxInput(findCheckboxByValue(box)).
|
|
211
|
+
await Promise.allSettled(
|
|
212
|
+
boxesToUncheck.map((box) => findCheckboxInput(findCheckboxByValue(box)).setChecked(false))
|
|
212
213
|
);
|
|
213
|
-
return wrapper.vm.$nextTick();
|
|
214
214
|
});
|
|
215
215
|
|
|
216
216
|
it("unchecks all of the checkbox's children if any", () => {
|
|
@@ -253,12 +253,11 @@ describe('GlFormCheckboxTree', () => {
|
|
|
253
253
|
});
|
|
254
254
|
|
|
255
255
|
it('once toggled, puts all checkboxes in the correct state', async () => {
|
|
256
|
-
await toggleAllCheckbox.
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
});
|
|
256
|
+
await toggleAllCheckbox.setChecked(finallyChecked);
|
|
257
|
+
|
|
258
|
+
findCheckboxes().wrappers.forEach((checkbox) => {
|
|
259
|
+
expect(findCheckboxInput(checkbox).element.checked).toBe(finallyChecked);
|
|
260
|
+
expect(findCheckboxInput(checkbox).element.indeterminate).toBe(false);
|
|
262
261
|
});
|
|
263
262
|
});
|
|
264
263
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils';
|
|
2
|
-
import { nextTick } from 'vue';
|
|
3
2
|
import GlFormRadio from './form_radio.vue';
|
|
4
3
|
|
|
5
4
|
describe('GlFormRadio', () => {
|
|
@@ -64,7 +63,6 @@ describe('GlFormRadio', () => {
|
|
|
64
63
|
describe('when the selected value is changed programmatically', () => {
|
|
65
64
|
beforeEach(() => {
|
|
66
65
|
wrapper.vm.selected = secondOption.value;
|
|
67
|
-
return nextTick();
|
|
68
66
|
});
|
|
69
67
|
|
|
70
68
|
it('emits an input event, but not a change event on each radio', () => {
|
|
@@ -83,11 +81,14 @@ describe('GlFormRadio', () => {
|
|
|
83
81
|
describe('when the selected value is changed by the user', () => {
|
|
84
82
|
let radio;
|
|
85
83
|
|
|
86
|
-
beforeEach(() => {
|
|
84
|
+
beforeEach(async () => {
|
|
87
85
|
radio = findRadio(secondOption.value);
|
|
88
86
|
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
// NOTE: We can't use "setChecked" here because
|
|
88
|
+
// it sets value programmatically under the hood and this
|
|
89
|
+
// does not pass value for the "change" event.
|
|
90
|
+
await radio.trigger('click');
|
|
91
|
+
await radio.trigger('change');
|
|
91
92
|
});
|
|
92
93
|
|
|
93
94
|
it('emits an input event on each radio, and a change event on the newly selected radio', () => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils';
|
|
2
|
-
import { nextTick } from 'vue';
|
|
3
2
|
import GlFormRadioGroup from './form_radio_group.vue';
|
|
4
3
|
|
|
5
4
|
describe('GlFormRadioGroup', () => {
|
|
@@ -43,7 +42,6 @@ describe('GlFormRadioGroup', () => {
|
|
|
43
42
|
describe('when the selected value is changed programmatically', () => {
|
|
44
43
|
beforeEach(() => {
|
|
45
44
|
wrapper.vm.selected = secondOption.value;
|
|
46
|
-
return nextTick();
|
|
47
45
|
});
|
|
48
46
|
|
|
49
47
|
it('emits an input event, but not a change event', () => {
|
|
@@ -60,14 +58,17 @@ describe('GlFormRadioGroup', () => {
|
|
|
60
58
|
describe('when the selected value is changed by the user', () => {
|
|
61
59
|
let radio;
|
|
62
60
|
|
|
63
|
-
beforeEach(() => {
|
|
61
|
+
beforeEach(async () => {
|
|
64
62
|
radio = findRadio(secondOption.value);
|
|
65
63
|
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
// NOTE: We can't use "setChecked" here because
|
|
65
|
+
// it sets value programmatically under the hood and this
|
|
66
|
+
// does not pass value for the "change" event.
|
|
67
|
+
await radio.trigger('click');
|
|
68
|
+
await radio.trigger('change');
|
|
68
69
|
});
|
|
69
70
|
|
|
70
|
-
it('emits an input event and a change event', () => {
|
|
71
|
+
it('emits an input event and a change event', async () => {
|
|
71
72
|
expect(wrapper.findComponent(GlFormRadioGroup).emitted()).toEqual({
|
|
72
73
|
input: [[secondOption.value]],
|
|
73
74
|
change: [[secondOption.value]],
|
package/src/scss/utilities.scss
CHANGED
|
@@ -6340,6 +6340,16 @@
|
|
|
6340
6340
|
margin-bottom: $gl-spacing-scale-5 !important;
|
|
6341
6341
|
}
|
|
6342
6342
|
}
|
|
6343
|
+
.gl-md-ml-2 {
|
|
6344
|
+
@include gl-media-breakpoint-up(md) {
|
|
6345
|
+
margin-left: $gl-spacing-scale-2;
|
|
6346
|
+
}
|
|
6347
|
+
}
|
|
6348
|
+
.gl-md-ml-2\! {
|
|
6349
|
+
@include gl-media-breakpoint-up(md) {
|
|
6350
|
+
margin-left: $gl-spacing-scale-2 !important;
|
|
6351
|
+
}
|
|
6352
|
+
}
|
|
6343
6353
|
.gl-md-ml-3 {
|
|
6344
6354
|
@include gl-media-breakpoint-up(md) {
|
|
6345
6355
|
margin-left: $gl-spacing-scale-3;
|