@gitlab/ui 64.11.0 → 64.12.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 +19 -0
- package/dist/components/base/new_dropdowns/listbox/listbox.js +2 -2
- package/dist/components/base/new_dropdowns/listbox/mock_data.js +1 -7
- package/dist/config.js +2 -0
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/package.json +18 -18
- package/src/components/base/new_dropdowns/listbox/listbox.spec.js +10 -36
- package/src/components/base/new_dropdowns/listbox/listbox.vue +2 -2
- package/src/components/base/new_dropdowns/listbox/mock_data.js +0 -2
- package/src/config.js +2 -0
- package/src/scss/utilities.scss +48 -0
- package/src/scss/utility-mixins/sizing.scss +24 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "64.
|
|
3
|
+
"version": "64.12.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"cy:edge": "cypress run --browser edge",
|
|
31
31
|
"cy:run": "cypress run --browser firefox",
|
|
32
32
|
"start": "yarn storybook",
|
|
33
|
-
"storybook": "yarn storybook-prep && storybook dev --ci --host localhost --port 9001 -c .storybook",
|
|
34
|
-
"storybook-vue3": "yarn storybook-prep && VUE_VERSION=3 storybook dev --ci --host localhost --port 9001 -c .storybook",
|
|
33
|
+
"storybook": "yarn storybook-prep && storybook dev --ci --host ${STORYBOOK_HOST:-localhost} --port 9001 -c .storybook",
|
|
34
|
+
"storybook-vue3": "yarn storybook-prep && VUE_VERSION=3 storybook dev --ci --host ${STORYBOOK_HOST:-localhost} --port 9001 -c .storybook",
|
|
35
35
|
"storybook-prep": "run-s generate-utilities build-scss-variables copy-fonts",
|
|
36
36
|
"storybook-static": "yarn storybook-prep && storybook build -c .storybook -o storybook",
|
|
37
37
|
"pretest:unit": "yarn build-scss-variables",
|
|
38
38
|
"test": "run-s test:unit test:visual",
|
|
39
|
-
"test:integration": "NODE_ENV=test start-server-and-test start http
|
|
39
|
+
"test:integration": "NODE_ENV=test start-server-and-test start http://${STORYBOOK_HOST:-localhost}:9001/iframe.html cy:run",
|
|
40
40
|
"test:unit": "NODE_ENV=test jest --testPathIgnorePatterns storyshots.spec.js",
|
|
41
41
|
"test:unit:watch": "yarn test:unit --watch",
|
|
42
42
|
"test:unit:debug": "NODE_ENV=test node --inspect node_modules/.bin/jest --testPathIgnorePatterns storyshot.spec.js --watch --runInBand",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"test:visual": "./bin/run-visual-tests.sh 'jest ./tests/storyshots.spec.js'",
|
|
47
47
|
"test:visual:minimal": "node ./bin/run_minimal_visual_tests.js",
|
|
48
48
|
"test:visual:update": "./bin/run-visual-tests.sh 'JEST_IMAGE_SNAPSHOT_TRACK_OBSOLETE=1 jest ./tests/storyshots.spec.js --updateSnapshot'",
|
|
49
|
-
"test:visual:internal": "NODE_ENV=test IS_VISUAL_TEST=true start-test http-get
|
|
49
|
+
"test:visual:internal": "NODE_ENV=test IS_VISUAL_TEST=true start-test http-get://${STORYBOOK_HOST:-localhost}:9001/iframe.html",
|
|
50
50
|
"prettier": "prettier --check '**/*.{js,vue}'",
|
|
51
51
|
"prettier:fix": "prettier --write '**/*.{js,vue}'",
|
|
52
52
|
"eslint": "eslint --max-warnings 0 --ext .js,.vue .",
|
|
@@ -94,18 +94,18 @@
|
|
|
94
94
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
95
95
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
96
96
|
"@rollup/plugin-replace": "^2.3.2",
|
|
97
|
-
"@storybook/addon-a11y": "7.0.
|
|
98
|
-
"@storybook/addon-docs": "7.0.
|
|
99
|
-
"@storybook/addon-essentials": "7.0.
|
|
100
|
-
"@storybook/addon-storyshots": "7.0.
|
|
101
|
-
"@storybook/addon-storyshots-puppeteer": "7.0.
|
|
102
|
-
"@storybook/addon-viewport": "7.0.
|
|
103
|
-
"@storybook/builder-webpack5": "7.0.
|
|
104
|
-
"@storybook/theming": "7.0.
|
|
105
|
-
"@storybook/vue": "7.0.
|
|
106
|
-
"@storybook/vue-webpack5": "7.0.
|
|
107
|
-
"@storybook/vue3": "7.0.
|
|
108
|
-
"@storybook/vue3-webpack5": "7.0.
|
|
97
|
+
"@storybook/addon-a11y": "7.0.21",
|
|
98
|
+
"@storybook/addon-docs": "7.0.21",
|
|
99
|
+
"@storybook/addon-essentials": "7.0.21",
|
|
100
|
+
"@storybook/addon-storyshots": "7.0.21",
|
|
101
|
+
"@storybook/addon-storyshots-puppeteer": "7.0.21",
|
|
102
|
+
"@storybook/addon-viewport": "7.0.21",
|
|
103
|
+
"@storybook/builder-webpack5": "7.0.21",
|
|
104
|
+
"@storybook/theming": "7.0.21",
|
|
105
|
+
"@storybook/vue": "7.0.21",
|
|
106
|
+
"@storybook/vue-webpack5": "7.0.21",
|
|
107
|
+
"@storybook/vue3": "7.0.21",
|
|
108
|
+
"@storybook/vue3-webpack5": "7.0.21",
|
|
109
109
|
"@vue/compat": "^3.2.40",
|
|
110
110
|
"@vue/compiler-sfc": "^3.2.40",
|
|
111
111
|
"@vue/test-utils": "1.3.0",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"sass-loader": "^10.2.0",
|
|
154
154
|
"sass-true": "^6.1.0",
|
|
155
155
|
"start-server-and-test": "^1.10.6",
|
|
156
|
-
"storybook": "7.0.
|
|
156
|
+
"storybook": "7.0.21",
|
|
157
157
|
"storybook-dark-mode": "3.0.0",
|
|
158
158
|
"stylelint": "14.9.1",
|
|
159
159
|
"stylelint-config-prettier": "^9.0.5",
|
|
@@ -18,7 +18,7 @@ import GlIntersectionObserver from '../../../utilities/intersection_observer/int
|
|
|
18
18
|
import GlCollapsibleListbox, { ITEM_SELECTOR } from './listbox.vue';
|
|
19
19
|
import GlListboxItem from './listbox_item.vue';
|
|
20
20
|
import GlListboxGroup from './listbox_group.vue';
|
|
21
|
-
import { mockOptions,
|
|
21
|
+
import { mockOptions, mockGroups, mockGroupsWithTextSrOnly } from './mock_data';
|
|
22
22
|
|
|
23
23
|
jest.mock('@floating-ui/dom');
|
|
24
24
|
autoUpdate.mockImplementation(() => {
|
|
@@ -485,16 +485,16 @@ describe('GlCollapsibleListbox', () => {
|
|
|
485
485
|
});
|
|
486
486
|
|
|
487
487
|
it.each`
|
|
488
|
-
|
|
489
|
-
${
|
|
490
|
-
${
|
|
488
|
+
multiple
|
|
489
|
+
${true}
|
|
490
|
+
${false}
|
|
491
491
|
`(
|
|
492
|
-
'
|
|
493
|
-
({ multiple
|
|
492
|
+
'shows the reset button if the label is provided and the selection is not empty and mode if multiple mode is $multiple',
|
|
493
|
+
({ multiple }) => {
|
|
494
494
|
buildWrapper({
|
|
495
495
|
headerText: 'Select assignee',
|
|
496
496
|
resetButtonLabel: 'Unassign',
|
|
497
|
-
selected,
|
|
497
|
+
selected: mockOptions[1].value,
|
|
498
498
|
items: mockOptions,
|
|
499
499
|
multiple,
|
|
500
500
|
});
|
|
@@ -503,7 +503,7 @@ describe('GlCollapsibleListbox', () => {
|
|
|
503
503
|
}
|
|
504
504
|
);
|
|
505
505
|
|
|
506
|
-
it('
|
|
506
|
+
it('shows the reset button if the label is provided and the selection is not empty', () => {
|
|
507
507
|
buildWrapper({
|
|
508
508
|
headerText: 'Select assignee',
|
|
509
509
|
resetButtonLabel: 'Unassign',
|
|
@@ -512,7 +512,7 @@ describe('GlCollapsibleListbox', () => {
|
|
|
512
512
|
multiple: true,
|
|
513
513
|
});
|
|
514
514
|
|
|
515
|
-
expect(findResetButton().
|
|
515
|
+
expect(findResetButton().text()).toBe('Unassign');
|
|
516
516
|
});
|
|
517
517
|
|
|
518
518
|
it('hides reset button if dropdown has no items', () => {
|
|
@@ -546,7 +546,7 @@ describe('GlCollapsibleListbox', () => {
|
|
|
546
546
|
buildWrapper({
|
|
547
547
|
headerText: 'Select assignee',
|
|
548
548
|
resetButtonLabel: 'Unassign',
|
|
549
|
-
selected:
|
|
549
|
+
selected: mockOptions[1].value,
|
|
550
550
|
items: mockOptions,
|
|
551
551
|
multiple: true,
|
|
552
552
|
});
|
|
@@ -605,32 +605,6 @@ describe('GlCollapsibleListbox', () => {
|
|
|
605
605
|
expect(findSelectAllButton().exists()).toBe(false);
|
|
606
606
|
});
|
|
607
607
|
|
|
608
|
-
it('hides select all button if all items are selected', () => {
|
|
609
|
-
buildWrapper({
|
|
610
|
-
headerText: 'Select assignee',
|
|
611
|
-
resetButtonLabel: 'Unassign',
|
|
612
|
-
showSelectAllButtonLabel: 'Select All',
|
|
613
|
-
selected: mockOptionsValues,
|
|
614
|
-
items: mockOptions,
|
|
615
|
-
multiple: true,
|
|
616
|
-
});
|
|
617
|
-
|
|
618
|
-
expect(findSelectAllButton().exists()).toBe(false);
|
|
619
|
-
});
|
|
620
|
-
|
|
621
|
-
it('has the label text "Select All" if the label is provided and some items are selected', () => {
|
|
622
|
-
buildWrapper({
|
|
623
|
-
headerText: 'Select assignee',
|
|
624
|
-
resetButtonLabel: 'Unassign',
|
|
625
|
-
showSelectAllButtonLabel: 'Select All',
|
|
626
|
-
selected: [mockOptions[1].value],
|
|
627
|
-
items: mockOptions,
|
|
628
|
-
multiple: true,
|
|
629
|
-
});
|
|
630
|
-
|
|
631
|
-
expect(findSelectAllButton().text()).toBe('Select All');
|
|
632
|
-
});
|
|
633
|
-
|
|
634
608
|
it('has the label text "Select All" if the label is provided and the selection is empty', () => {
|
|
635
609
|
buildWrapper({
|
|
636
610
|
headerText: 'Select assignee',
|
|
@@ -411,7 +411,7 @@ export default {
|
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
if (this.multiple) {
|
|
414
|
-
return this.selected.length
|
|
414
|
+
return this.selected.length > 0;
|
|
415
415
|
}
|
|
416
416
|
return Boolean(this.selected);
|
|
417
417
|
},
|
|
@@ -432,7 +432,7 @@ export default {
|
|
|
432
432
|
return false;
|
|
433
433
|
}
|
|
434
434
|
|
|
435
|
-
return this.selected.length
|
|
435
|
+
return this.selected.length === 0;
|
|
436
436
|
},
|
|
437
437
|
showIntersectionObserver() {
|
|
438
438
|
return this.infiniteScroll && !this.infiniteScrollLoading && !this.loading && !this.searching;
|
package/src/config.js
CHANGED
package/src/scss/utilities.scss
CHANGED
|
@@ -5164,6 +5164,54 @@
|
|
|
5164
5164
|
min-width: 0 !important;
|
|
5165
5165
|
}
|
|
5166
5166
|
|
|
5167
|
+
.gl-min-w-1 {
|
|
5168
|
+
min-width: $gl-spacing-scale-1;
|
|
5169
|
+
}
|
|
5170
|
+
|
|
5171
|
+
.gl-min-w-1\! {
|
|
5172
|
+
min-width: $gl-spacing-scale-1 !important;
|
|
5173
|
+
}
|
|
5174
|
+
|
|
5175
|
+
.gl-min-w-2 {
|
|
5176
|
+
min-width: $gl-spacing-scale-2;
|
|
5177
|
+
}
|
|
5178
|
+
|
|
5179
|
+
.gl-min-w-2\! {
|
|
5180
|
+
min-width: $gl-spacing-scale-2 !important;
|
|
5181
|
+
}
|
|
5182
|
+
|
|
5183
|
+
.gl-min-w-3 {
|
|
5184
|
+
min-width: $gl-spacing-scale-3;
|
|
5185
|
+
}
|
|
5186
|
+
|
|
5187
|
+
.gl-min-w-3\! {
|
|
5188
|
+
min-width: $gl-spacing-scale-3 !important;
|
|
5189
|
+
}
|
|
5190
|
+
|
|
5191
|
+
.gl-min-w-4 {
|
|
5192
|
+
min-width: $gl-spacing-scale-4;
|
|
5193
|
+
}
|
|
5194
|
+
|
|
5195
|
+
.gl-min-w-4\! {
|
|
5196
|
+
min-width: $gl-spacing-scale-4 !important;
|
|
5197
|
+
}
|
|
5198
|
+
|
|
5199
|
+
.gl-min-w-5 {
|
|
5200
|
+
min-width: $gl-spacing-scale-5;
|
|
5201
|
+
}
|
|
5202
|
+
|
|
5203
|
+
.gl-min-w-5\! {
|
|
5204
|
+
min-width: $gl-spacing-scale-5 !important;
|
|
5205
|
+
}
|
|
5206
|
+
|
|
5207
|
+
.gl-min-w-6 {
|
|
5208
|
+
min-width: $gl-spacing-scale-6;
|
|
5209
|
+
}
|
|
5210
|
+
|
|
5211
|
+
.gl-min-w-6\! {
|
|
5212
|
+
min-width: $gl-spacing-scale-6 !important;
|
|
5213
|
+
}
|
|
5214
|
+
|
|
5167
5215
|
.gl-min-w-7 {
|
|
5168
5216
|
min-width: $gl-spacing-scale-7;
|
|
5169
5217
|
}
|
|
@@ -344,6 +344,30 @@
|
|
|
344
344
|
min-width: 0;
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
+
@mixin gl-min-w-1 {
|
|
348
|
+
min-width: $gl-spacing-scale-1;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
@mixin gl-min-w-2 {
|
|
352
|
+
min-width: $gl-spacing-scale-2;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
@mixin gl-min-w-3 {
|
|
356
|
+
min-width: $gl-spacing-scale-3;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
@mixin gl-min-w-4 {
|
|
360
|
+
min-width: $gl-spacing-scale-4;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
@mixin gl-min-w-5 {
|
|
364
|
+
min-width: $gl-spacing-scale-5;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
@mixin gl-min-w-6 {
|
|
368
|
+
min-width: $gl-spacing-scale-6;
|
|
369
|
+
}
|
|
370
|
+
|
|
347
371
|
@mixin gl-min-w-7 {
|
|
348
372
|
min-width: $gl-spacing-scale-7;
|
|
349
373
|
}
|