@gitlab/ui 46.1.0 → 47.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 +18 -0
- package/dist/components/base/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/base/datepicker/datepicker.js +17 -11
- package/dist/components/base/dropdown/dropdown.js +3 -3
- package/dist/components/base/filtered_search/filtered_search.js +1 -1
- package/dist/components/base/form/form_checkbox_tree/form_checkbox_tree.js +1 -1
- package/dist/components/base/form/form_checkbox_tree/models/tree.js +0 -1
- package/dist/components/base/infinite_scroll/infinite_scroll.js +17 -26
- package/dist/components/base/pagination/pagination.js +3 -1
- package/dist/components/base/search_box_by_click/search_box_by_click.js +1 -1
- package/dist/components/charts/column/column.js +0 -1
- package/dist/components/utilities/intersperse/intersperse.js +1 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/package.json +7 -7
- package/src/components/base/alert/alert.spec.js +3 -3
- package/src/components/base/breadcrumb/breadcrumb.spec.js +0 -2
- package/src/components/base/breadcrumb/breadcrumb.vue +1 -1
- package/src/components/base/datepicker/datepicker.vue +18 -11
- package/src/components/base/daterange_picker/daterange_picker.spec.js +1 -3
- package/src/components/base/dropdown/dropdown.vue +4 -4
- package/src/components/base/filtered_search/filtered_search.vue +29 -30
- package/src/components/base/form/form_checkbox_tree/form_checkbox_tree.vue +1 -1
- package/src/components/base/form/form_checkbox_tree/models/tree.js +0 -1
- package/src/components/base/form/form_group/form_group.spec.js +1 -0
- package/src/components/base/infinite_scroll/infinite_scroll.vue +15 -24
- package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.spec.js +1 -0
- package/src/components/base/new_dropdowns/listbox/listbox.spec.js +1 -0
- package/src/components/base/new_dropdowns/listbox/listbox.stories.js +64 -99
- package/src/components/base/pagination/pagination.spec.js +1 -1
- package/src/components/base/pagination/pagination.vue +6 -4
- package/src/components/base/search_box_by_click/search_box_by_click.spec.js +6 -5
- package/src/components/base/search_box_by_click/search_box_by_click.vue +1 -1
- package/src/components/base/sorting/sorting.spec.js +0 -17
- package/src/components/base/tabs/tab/tab.spec.js +2 -3
- package/src/components/base/tabs/tabs/scrollable_tabs.spec.js +3 -1
- package/src/components/charts/column/column.vue +1 -1
- package/src/components/utilities/intersection_observer/intersection_observer.spec.js +1 -1
- package/src/components/utilities/intersperse/intersperse.vue +1 -1
- package/src/components/utilities/sprintf/sprintf.spec.js +1 -5
- package/src/components/utilities/truncate/truncate.spec.js +4 -5
- package/src/directives/hover_load/hover_load.spec.js +1 -1
- package/src/directives/safe_link/safe_link.spec.js +11 -13
- package/src/scss/utilities.scss +2 -12
- package/src/scss/utility-mixins/spacing.scss +1 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "47.0.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@arkweid/lefthook": "0.7.7",
|
|
80
80
|
"@babel/core": "^7.19.3",
|
|
81
|
-
"@babel/preset-env": "^7.19.
|
|
81
|
+
"@babel/preset-env": "^7.19.4",
|
|
82
82
|
"@gitlab/eslint-plugin": "18.1.0",
|
|
83
83
|
"@gitlab/stylelint-config": "4.1.0",
|
|
84
84
|
"@gitlab/svgs": "3.4.0",
|
|
@@ -102,12 +102,12 @@
|
|
|
102
102
|
"babel-plugin-require-context-hook": "^1.0.0",
|
|
103
103
|
"babel-preset-vue": "^2.0.2",
|
|
104
104
|
"bootstrap": "4.5.3",
|
|
105
|
-
"cypress": "^10.
|
|
105
|
+
"cypress": "^10.10.0",
|
|
106
106
|
"emoji-regex": "^10.0.0",
|
|
107
|
-
"eslint": "8.
|
|
107
|
+
"eslint": "8.25.0",
|
|
108
108
|
"eslint-import-resolver-jest": "3.0.2",
|
|
109
109
|
"eslint-plugin-cypress": "2.12.1",
|
|
110
|
-
"eslint-plugin-storybook": "0.6.
|
|
110
|
+
"eslint-plugin-storybook": "0.6.5",
|
|
111
111
|
"file-loader": "^4.2.0",
|
|
112
112
|
"glob": "^7.2.0",
|
|
113
113
|
"identity-obj-proxy": "^3.0.0",
|
|
@@ -142,9 +142,9 @@
|
|
|
142
142
|
"stylelint": "14.9.1",
|
|
143
143
|
"stylelint-config-prettier": "9.0.3",
|
|
144
144
|
"stylelint-prettier": "2.0.0",
|
|
145
|
-
"vue": "2.7.
|
|
145
|
+
"vue": "2.7.13",
|
|
146
146
|
"vue-loader": "^15.8.3",
|
|
147
|
-
"vue-template-compiler": "2.7.
|
|
147
|
+
"vue-template-compiler": "2.7.13"
|
|
148
148
|
},
|
|
149
149
|
"release": {
|
|
150
150
|
"branches": [
|
|
@@ -133,9 +133,9 @@ describe('Alert component', () => {
|
|
|
133
133
|
const button = buttons.at(0);
|
|
134
134
|
expect(button.text()).toContain(secondaryButtonText);
|
|
135
135
|
|
|
136
|
-
const
|
|
137
|
-
expect('href' in
|
|
138
|
-
expect(
|
|
136
|
+
const props = button.props();
|
|
137
|
+
expect('href' in props).toBe(false);
|
|
138
|
+
expect(props.category).toEqual(buttonCategoryOptions.secondary);
|
|
139
139
|
});
|
|
140
140
|
|
|
141
141
|
it('emits a secondaryAction event when secondary button is clicked', () => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
2
|
import { nextTick } from 'vue';
|
|
3
|
-
import { createMockDirective } from '~helpers/vue_mock_directive';
|
|
4
3
|
import Breadcrumb, { COLLAPSE_AT_SIZE } from './breadcrumb.vue';
|
|
5
4
|
import GlBreadcrumbItem from './breadcrumb_item.vue';
|
|
6
5
|
|
|
@@ -42,7 +41,6 @@ describe('Breadcrumb component', () => {
|
|
|
42
41
|
avatar: '<div data-testid="avatar-slot"></div>',
|
|
43
42
|
separator: '<div data-testid="separator-slot"></div>',
|
|
44
43
|
},
|
|
45
|
-
directives: { GlTooltip: createMockDirective('gl-tooltip') },
|
|
46
44
|
stubs: {
|
|
47
45
|
GlBreadcrumbItem,
|
|
48
46
|
},
|
|
@@ -88,8 +88,8 @@ export default {
|
|
|
88
88
|
<slot name="avatar"></slot>
|
|
89
89
|
<b-breadcrumb class="gl-breadcrumb-list" v-bind="$attrs" v-on="$listeners">
|
|
90
90
|
<template v-for="(item, index) in items">
|
|
91
|
+
<!-- eslint-disable-next-line vue/valid-v-for -->
|
|
91
92
|
<gl-breadcrumb-item
|
|
92
|
-
:key="index"
|
|
93
93
|
:ref="isFirstItem(index) ? 'firstItem' : null"
|
|
94
94
|
:text="item.text"
|
|
95
95
|
:href="item.href"
|
|
@@ -179,7 +179,7 @@ export default {
|
|
|
179
179
|
},
|
|
180
180
|
computed: {
|
|
181
181
|
formattedDate() {
|
|
182
|
-
return this.calendar && this.calendar.toString();
|
|
182
|
+
return this.$options.pikaday.calendar && this.$options.pikaday.calendar.toString();
|
|
183
183
|
},
|
|
184
184
|
customTrigger() {
|
|
185
185
|
return isString(this.target) && this.target !== '';
|
|
@@ -207,21 +207,21 @@ export default {
|
|
|
207
207
|
},
|
|
208
208
|
watch: {
|
|
209
209
|
value(val) {
|
|
210
|
-
if (!areDatesEqual(val, this.calendar.getDate())) {
|
|
211
|
-
this.calendar.setDate(val, true);
|
|
210
|
+
if (!areDatesEqual(val, this.$options.pikaday.calendar.getDate())) {
|
|
211
|
+
this.$options.pikaday.calendar.setDate(val, true);
|
|
212
212
|
}
|
|
213
213
|
},
|
|
214
214
|
minDate(minDate) {
|
|
215
|
-
this.calendar.setMinDate(minDate);
|
|
215
|
+
this.$options.pikaday.calendar.setMinDate(minDate);
|
|
216
216
|
},
|
|
217
217
|
maxDate(maxDate) {
|
|
218
|
-
this.calendar.setMaxDate(maxDate);
|
|
218
|
+
this.$options.pikaday.calendar.setMaxDate(maxDate);
|
|
219
219
|
},
|
|
220
220
|
startRange(startRange) {
|
|
221
|
-
this.calendar.setStartRange(startRange);
|
|
221
|
+
this.$options.pikaday.calendar.setStartRange(startRange);
|
|
222
222
|
},
|
|
223
223
|
endRange(endRange) {
|
|
224
|
-
this.calendar.setEndRange(endRange);
|
|
224
|
+
this.$options.pikaday.calendar.setEndRange(endRange);
|
|
225
225
|
},
|
|
226
226
|
},
|
|
227
227
|
mounted() {
|
|
@@ -279,14 +279,14 @@ export default {
|
|
|
279
279
|
pikadayConfig.i18n = this.i18n;
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
this.calendar = new Pikaday(pikadayConfig);
|
|
282
|
+
this.$options.pikaday.calendar = new Pikaday(pikadayConfig);
|
|
283
283
|
|
|
284
284
|
if (this.startOpened) {
|
|
285
|
-
this.calendar.show();
|
|
285
|
+
this.$options.pikaday.calendar.show();
|
|
286
286
|
}
|
|
287
287
|
},
|
|
288
288
|
beforeDestroy() {
|
|
289
|
-
this.calendar.destroy();
|
|
289
|
+
this.$options.pikaday.calendar.destroy();
|
|
290
290
|
},
|
|
291
291
|
methods: {
|
|
292
292
|
selected(date) {
|
|
@@ -324,11 +324,18 @@ export default {
|
|
|
324
324
|
onKeydown() {
|
|
325
325
|
if (this.textInput === '') {
|
|
326
326
|
const resetDate = this.minDate || null;
|
|
327
|
-
this.calendar.setDate(resetDate);
|
|
327
|
+
this.$options.pikaday.calendar.setDate(resetDate);
|
|
328
328
|
this.selected(resetDate);
|
|
329
329
|
}
|
|
330
330
|
},
|
|
331
331
|
},
|
|
332
|
+
|
|
333
|
+
// Vue3 will make this.$options shallow-readonly
|
|
334
|
+
// that means that in order to store anything in $options
|
|
335
|
+
// we need an object as a container
|
|
336
|
+
pikaday: {
|
|
337
|
+
calendar: null,
|
|
338
|
+
},
|
|
332
339
|
};
|
|
333
340
|
</script>
|
|
334
341
|
|
|
@@ -242,9 +242,7 @@ describe('Daterange Picker', () => {
|
|
|
242
242
|
const findTooltipIcon = () => wrapper.findComponent(Icon);
|
|
243
243
|
|
|
244
244
|
const slots = {
|
|
245
|
-
default: `<
|
|
246
|
-
{{ daysSelected }} days selected
|
|
247
|
-
</template>`,
|
|
245
|
+
default: `<div>{{ props.daysSelected }} days selected</div>`,
|
|
248
246
|
};
|
|
249
247
|
|
|
250
248
|
it('does not show default slot or tooltip icon by default', () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
<!-- eslint-disable vue/multi-word-component-names -->
|
|
1
|
+
<!-- eslint-disable vue/multi-word-component-names vue/one-component-per-file -->
|
|
2
2
|
<script>
|
|
3
|
+
import Vue from 'vue';
|
|
3
4
|
import { BDropdown } from 'bootstrap-vue';
|
|
4
5
|
import { isVisible, selectAll } from 'bootstrap-vue/src/utils/dom';
|
|
5
6
|
import {
|
|
@@ -24,14 +25,13 @@ const Selector = {
|
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
// see https://gitlab.com/gitlab-org/gitlab-ui/merge_requests/130#note_126406721
|
|
27
|
-
const ExtendedBDropdown = {
|
|
28
|
-
extends: BDropdown,
|
|
28
|
+
const ExtendedBDropdown = Vue.extend(BDropdown, {
|
|
29
29
|
methods: {
|
|
30
30
|
getItems() {
|
|
31
31
|
return filterVisible(selectAll(Selector.ITEM_SELECTOR, this.$refs.menu));
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
|
-
};
|
|
34
|
+
});
|
|
35
35
|
|
|
36
36
|
export default {
|
|
37
37
|
components: {
|
|
@@ -368,36 +368,35 @@ export default {
|
|
|
368
368
|
class="gl-filtered-search-scrollable"
|
|
369
369
|
:class="{ 'gl-bg-gray-10! gl-inset-border-1-gray-100!': viewOnly }"
|
|
370
370
|
>
|
|
371
|
-
<
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
</template>
|
|
371
|
+
<component
|
|
372
|
+
:is="getTokenComponent(token.type)"
|
|
373
|
+
v-for="(token, idx) in tokens"
|
|
374
|
+
ref="tokens"
|
|
375
|
+
:key="token.id"
|
|
376
|
+
v-model="token.value"
|
|
377
|
+
:config="getTokenEntry(token.type)"
|
|
378
|
+
:active="activeTokenIdx === idx"
|
|
379
|
+
:cursor-position="intendedCursorPosition"
|
|
380
|
+
:available-tokens="currentAvailableTokens"
|
|
381
|
+
:current-value="tokens"
|
|
382
|
+
:index="idx"
|
|
383
|
+
:placeholder="termPlaceholder"
|
|
384
|
+
:show-friendly-text="showFriendlyText"
|
|
385
|
+
:search-input-attributes="searchInputAttributes"
|
|
386
|
+
:view-only="viewOnly"
|
|
387
|
+
:is-last-token="isLastToken(idx)"
|
|
388
|
+
class="gl-filtered-search-item"
|
|
389
|
+
:class="{ 'gl-filtered-search-last-item': isLastToken(idx) && !viewOnly }"
|
|
390
|
+
@activate="activate(idx)"
|
|
391
|
+
@deactivate="deactivate(token)"
|
|
392
|
+
@destroy="destroyToken(idx, $event)"
|
|
393
|
+
@replace="replaceToken(idx, $event)"
|
|
394
|
+
@complete="completeToken"
|
|
395
|
+
@submit="submit"
|
|
396
|
+
@split="createTokens(idx, $event)"
|
|
397
|
+
@previous="activatePreviousToken"
|
|
398
|
+
@next="activateNextToken"
|
|
399
|
+
/>
|
|
401
400
|
</div>
|
|
402
401
|
<portal-target
|
|
403
402
|
ref="menu"
|
|
@@ -106,7 +106,7 @@ export default {
|
|
|
106
106
|
class="gl-form-checkbox-tree-toggle-all"
|
|
107
107
|
:checked="tree.allOptionsChecked"
|
|
108
108
|
:indeterminate="tree.someOptionsChecked"
|
|
109
|
-
@change="tree.toggleAllOptions"
|
|
109
|
+
@change="tree.toggleAllOptions($event)"
|
|
110
110
|
>
|
|
111
111
|
{{ toggleAllLabel }}
|
|
112
112
|
</gl-form-checkbox>
|
|
@@ -56,8 +56,21 @@ export default {
|
|
|
56
56
|
const { scrollHeight, scrollTop } = this.$refs.infiniteContainer;
|
|
57
57
|
// Only when scrolled to the top
|
|
58
58
|
if (scrollHeight !== 0 && scrollTop === 0) {
|
|
59
|
-
//
|
|
60
|
-
this.$
|
|
59
|
+
// Wait until the DOM is fully updated to adjust scroll
|
|
60
|
+
this.$nextTick(() => {
|
|
61
|
+
const { scrollHeight: newScrollHeight } = this.$refs.infiniteContainer;
|
|
62
|
+
|
|
63
|
+
// New scrollTop is the new height, minus the old height
|
|
64
|
+
// minus a small space to allow the user to trigger a scroll once more
|
|
65
|
+
let top = newScrollHeight - scrollHeight - adjustScrollGap;
|
|
66
|
+
|
|
67
|
+
// Never adjust to 0, or a new event may be be triggered
|
|
68
|
+
if (top < 1) {
|
|
69
|
+
top = 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
this.scrollTo({ top });
|
|
73
|
+
});
|
|
61
74
|
}
|
|
62
75
|
}
|
|
63
76
|
},
|
|
@@ -72,28 +85,6 @@ export default {
|
|
|
72
85
|
});
|
|
73
86
|
},
|
|
74
87
|
|
|
75
|
-
updated() {
|
|
76
|
-
// Wait until the DOM is fully updated to adjust scroll
|
|
77
|
-
this.$nextTick(() => {
|
|
78
|
-
if (this.$options.adjustScrollHeight) {
|
|
79
|
-
const { scrollHeight } = this.$refs.infiniteContainer;
|
|
80
|
-
|
|
81
|
-
// New scrollTop is the new height, minus the old height
|
|
82
|
-
// minus a small space to allow the user to trigger a scroll once more
|
|
83
|
-
let top = scrollHeight - this.$options.adjustScrollHeight - adjustScrollGap;
|
|
84
|
-
|
|
85
|
-
// Never adjust to 0, or a new event may be be triggered
|
|
86
|
-
if (top < 1) {
|
|
87
|
-
top = 1;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
this.scrollTo({ top });
|
|
91
|
-
// Prevent subsequent updates
|
|
92
|
-
this.$options.adjustScrollHeight = null;
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
},
|
|
96
|
-
|
|
97
88
|
methods: {
|
|
98
89
|
/**
|
|
99
90
|
* Scroll to the top of the container, leaving a gap
|
|
@@ -61,37 +61,45 @@ const generateProps = ({
|
|
|
61
61
|
startOpened,
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
+
const makeBindings = (overrides = {}) =>
|
|
65
|
+
Object.entries({
|
|
66
|
+
':items': 'items',
|
|
67
|
+
':category': 'category',
|
|
68
|
+
':variant': 'variant',
|
|
69
|
+
':size': 'size',
|
|
70
|
+
':disabled': 'disabled',
|
|
71
|
+
':loading': 'loading',
|
|
72
|
+
':searchable': 'searchable',
|
|
73
|
+
':searching': 'searching',
|
|
74
|
+
':no-results-text': 'noResultsText',
|
|
75
|
+
':no-caret': 'noCaret',
|
|
76
|
+
':right': 'right',
|
|
77
|
+
':toggle-text': 'toggleText',
|
|
78
|
+
':text-sr-only': 'textSrOnly',
|
|
79
|
+
':icon': 'icon',
|
|
80
|
+
':multiple': 'multiple',
|
|
81
|
+
':is-check-centered': 'isCheckCentered',
|
|
82
|
+
':toggle-aria-labelled-by': 'toggleAriaLabelledBy',
|
|
83
|
+
':list-aria-labelled-by': 'listAriaLabelledBy',
|
|
84
|
+
...overrides,
|
|
85
|
+
})
|
|
86
|
+
.map(([key, value]) => `${key}="${value}"`)
|
|
87
|
+
.join('\n');
|
|
88
|
+
|
|
64
89
|
function openListbox(component) {
|
|
65
90
|
component.$nextTick(() => {
|
|
66
91
|
component.$refs.listbox.open();
|
|
67
92
|
});
|
|
68
93
|
}
|
|
69
94
|
|
|
70
|
-
const template = (content, label = '') => `
|
|
95
|
+
const template = (content, { label = '', bindingOverrides = {} } = {}) => `
|
|
71
96
|
<div>
|
|
72
97
|
${label}
|
|
73
|
-
<br/>
|
|
98
|
+
${label && '<br/>'}
|
|
74
99
|
<gl-listbox
|
|
75
100
|
ref="listbox"
|
|
76
101
|
v-model="selected"
|
|
77
|
-
|
|
78
|
-
:category="category"
|
|
79
|
-
:variant="variant"
|
|
80
|
-
:size="size"
|
|
81
|
-
:disabled="disabled"
|
|
82
|
-
:loading="loading"
|
|
83
|
-
:searchable="searchable"
|
|
84
|
-
:searching="searching"
|
|
85
|
-
:no-results-text="noResultsText"
|
|
86
|
-
:no-caret="noCaret"
|
|
87
|
-
:right="right"
|
|
88
|
-
:toggle-text="toggleText"
|
|
89
|
-
:text-sr-only="textSrOnly"
|
|
90
|
-
:icon="icon"
|
|
91
|
-
:multiple="multiple"
|
|
92
|
-
:is-check-centered="isCheckCentered"
|
|
93
|
-
:toggle-aria-labelled-by="toggleAriaLabelledBy"
|
|
94
|
-
:list-aria-labelled-by="listAriaLabelledBy"
|
|
102
|
+
${makeBindings(bindingOverrides)}
|
|
95
103
|
>
|
|
96
104
|
${content}
|
|
97
105
|
</gl-listbox>
|
|
@@ -113,7 +121,9 @@ export const Default = (args, { argTypes }) => ({
|
|
|
113
121
|
openListbox(this);
|
|
114
122
|
}
|
|
115
123
|
},
|
|
116
|
-
template: template('',
|
|
124
|
+
template: template('', {
|
|
125
|
+
label: `<span class="gl-my-0" id="listbox-label">Select a department</span>`,
|
|
126
|
+
}),
|
|
117
127
|
});
|
|
118
128
|
Default.args = generateProps({ toggleAriaLabelledBy: 'listbox-label' });
|
|
119
129
|
Default.decorators = [makeContainer({ height: '370px' })];
|
|
@@ -181,36 +191,14 @@ export const CustomListItem = (args, { argTypes }) => ({
|
|
|
181
191
|
}
|
|
182
192
|
},
|
|
183
193
|
computed: {
|
|
184
|
-
|
|
194
|
+
customToggleText() {
|
|
185
195
|
return this.selected.length !== 1
|
|
186
196
|
? `${this.selected.length} assignees`
|
|
187
197
|
: this.items.find(({ value }) => value === this.selected[0]).text;
|
|
188
198
|
},
|
|
189
199
|
},
|
|
190
|
-
template:
|
|
191
|
-
|
|
192
|
-
ref="listbox"
|
|
193
|
-
v-model="selected"
|
|
194
|
-
:items="items"
|
|
195
|
-
:category="category"
|
|
196
|
-
:variant="variant"
|
|
197
|
-
:size="size"
|
|
198
|
-
:disabled="disabled"
|
|
199
|
-
:loading="loading"
|
|
200
|
-
:searchable="searchable"
|
|
201
|
-
:searching="searching"
|
|
202
|
-
:no-results-text="noResultsText"
|
|
203
|
-
:no-caret="noCaret"
|
|
204
|
-
:right="right"
|
|
205
|
-
:toggle-text="headerText"
|
|
206
|
-
:text-sr-only="textSrOnly"
|
|
207
|
-
:icon="icon"
|
|
208
|
-
:multiple="multiple"
|
|
209
|
-
:is-check-centered="isCheckCentered"
|
|
210
|
-
:toggle-aria-labelled-by="toggleAriaLabelledBy"
|
|
211
|
-
:list-aria-labelled-by="listAriaLabelledBy"
|
|
212
|
-
>
|
|
213
|
-
<template #list-item="{ item }">
|
|
200
|
+
template: template(
|
|
201
|
+
`<template #list-item="{ item }">
|
|
214
202
|
<span class="gl-display-flex gl-align-items-center">
|
|
215
203
|
<gl-avatar :size="32" class-="gl-mr-3"/>
|
|
216
204
|
<span class="gl-display-flex gl-flex-direction-column">
|
|
@@ -219,8 +207,13 @@ export const CustomListItem = (args, { argTypes }) => ({
|
|
|
219
207
|
</span>
|
|
220
208
|
</span>
|
|
221
209
|
</template>
|
|
222
|
-
</gl-listbox>
|
|
223
210
|
`,
|
|
211
|
+
{
|
|
212
|
+
bindingOverrides: {
|
|
213
|
+
':toggle-text': 'customToggleText',
|
|
214
|
+
},
|
|
215
|
+
}
|
|
216
|
+
),
|
|
224
217
|
});
|
|
225
218
|
|
|
226
219
|
CustomListItem.args = generateProps({
|
|
@@ -364,31 +357,8 @@ export const Searchable = (args, { argTypes }) => ({
|
|
|
364
357
|
return this.filteredItems.length === 1 ? '1 result' : `${this.filteredItems.length} results`;
|
|
365
358
|
},
|
|
366
359
|
},
|
|
367
|
-
template:
|
|
368
|
-
|
|
369
|
-
ref="listbox"
|
|
370
|
-
v-model="selected"
|
|
371
|
-
:items="filteredItems"
|
|
372
|
-
:category="category"
|
|
373
|
-
:variant="variant"
|
|
374
|
-
:size="size"
|
|
375
|
-
:disabled="disabled"
|
|
376
|
-
:loading="loading"
|
|
377
|
-
:no-caret="noCaret"
|
|
378
|
-
:right="right"
|
|
379
|
-
:toggle-text="customToggleText"
|
|
380
|
-
:text-sr-only="textSrOnly"
|
|
381
|
-
:icon="icon"
|
|
382
|
-
:multiple="multiple"
|
|
383
|
-
:is-check-centered="isCheckCentered"
|
|
384
|
-
:toggle-aria-labelled-by="toggleAriaLabelledBy"
|
|
385
|
-
:list-aria-labelled-by="headerId"
|
|
386
|
-
:searchable="searchable"
|
|
387
|
-
:searching="searchInProgress"
|
|
388
|
-
:no-results-text="noResultsText"
|
|
389
|
-
@search="filterList"
|
|
390
|
-
>
|
|
391
|
-
<template #header>
|
|
360
|
+
template: template(
|
|
361
|
+
`<template #header>
|
|
392
362
|
<p :id="headerId"
|
|
393
363
|
class="gl-font-weight-bold gl-font-sm gl-m-0 gl-text-center gl-py-2 gl-border-1 gl-border-b-solid gl-border-gray-200">
|
|
394
364
|
Assign to department</p>
|
|
@@ -396,8 +366,17 @@ export const Searchable = (args, { argTypes }) => ({
|
|
|
396
366
|
<template #search-summary-sr-only>
|
|
397
367
|
{{ numberOfSearchResults }}
|
|
398
368
|
</template>
|
|
399
|
-
</gl-listbox>
|
|
400
369
|
`,
|
|
370
|
+
{
|
|
371
|
+
bindingOverrides: {
|
|
372
|
+
':items': 'filteredItems',
|
|
373
|
+
':list-aria-labelled-by': 'headerId',
|
|
374
|
+
':toggle-text': 'customToggleText',
|
|
375
|
+
':searching': 'searchInProgress',
|
|
376
|
+
'@search': 'filterList',
|
|
377
|
+
},
|
|
378
|
+
}
|
|
379
|
+
),
|
|
401
380
|
});
|
|
402
381
|
Searchable.args = generateProps({ searchable: true });
|
|
403
382
|
Searchable.decorators = [makeContainer({ height: '370px' })];
|
|
@@ -470,31 +449,8 @@ export const SearchableGroups = (args, { argTypes }) => ({
|
|
|
470
449
|
}, 2000);
|
|
471
450
|
},
|
|
472
451
|
},
|
|
473
|
-
template:
|
|
474
|
-
|
|
475
|
-
ref="listbox"
|
|
476
|
-
v-model="selected"
|
|
477
|
-
:items="filteredGroupOptions"
|
|
478
|
-
:category="category"
|
|
479
|
-
:variant="variant"
|
|
480
|
-
:size="size"
|
|
481
|
-
:disabled="disabled"
|
|
482
|
-
:loading="loading"
|
|
483
|
-
:no-caret="noCaret"
|
|
484
|
-
:right="right"
|
|
485
|
-
:toggle-text="customToggleText"
|
|
486
|
-
:text-sr-only="textSrOnly"
|
|
487
|
-
:icon="icon"
|
|
488
|
-
:multiple="multiple"
|
|
489
|
-
:is-check-centered="isCheckCentered"
|
|
490
|
-
:toggle-aria-labelled-by="toggleAriaLabelledBy"
|
|
491
|
-
:list-aria-labelled-by="headerId"
|
|
492
|
-
:searching="searchInProgress"
|
|
493
|
-
:no-results-text="noResultsText"
|
|
494
|
-
:searchable="searchable"
|
|
495
|
-
@search="filterList"
|
|
496
|
-
>
|
|
497
|
-
<template #header>
|
|
452
|
+
template: template(
|
|
453
|
+
`<template #header>
|
|
498
454
|
<p :id="headerId"
|
|
499
455
|
class="gl-font-weight-bold gl-font-sm gl-m-0 gl-text-center gl-py-2 gl-border-1 gl-border-b-solid gl-border-gray-200">
|
|
500
456
|
Assign to department</p>
|
|
@@ -502,8 +458,17 @@ export const SearchableGroups = (args, { argTypes }) => ({
|
|
|
502
458
|
<template #search-summary-sr-only>
|
|
503
459
|
{{ numberOfSearchResults }}
|
|
504
460
|
</template>
|
|
505
|
-
</gl-listbox>
|
|
506
461
|
`,
|
|
462
|
+
{
|
|
463
|
+
bindingOverrides: {
|
|
464
|
+
':items': 'filteredGroupOptions',
|
|
465
|
+
':list-aria-labelled-by': 'headerId',
|
|
466
|
+
':toggle-text': 'customToggleText',
|
|
467
|
+
':searching': 'searchInProgress',
|
|
468
|
+
'@search': 'filterList',
|
|
469
|
+
},
|
|
470
|
+
}
|
|
471
|
+
),
|
|
507
472
|
});
|
|
508
473
|
SearchableGroups.args = generateProps({ searchable: true, items: mockGroups });
|
|
509
474
|
SearchableGroups.decorators = [makeContainer({ height: '370px' })];
|
|
@@ -339,6 +339,8 @@ export default {
|
|
|
339
339
|
slot: `ellipsis-${side}`,
|
|
340
340
|
component: 'span',
|
|
341
341
|
disabled: true,
|
|
342
|
+
slotData: {},
|
|
343
|
+
listeners: {},
|
|
342
344
|
};
|
|
343
345
|
},
|
|
344
346
|
handleClick(event, value) {
|
|
@@ -395,8 +397,8 @@ export default {
|
|
|
395
397
|
:href="prevPageHref"
|
|
396
398
|
@click="handlePrevious($event, value - 1)"
|
|
397
399
|
>
|
|
398
|
-
<!--
|
|
399
|
-
@slot Content for the "previous" button. Overrides the "prevText" prop.
|
|
400
|
+
<!--
|
|
401
|
+
@slot Content for the "previous" button. Overrides the "prevText" prop.
|
|
400
402
|
@binding {boolean} active
|
|
401
403
|
@binding {boolean} disabled
|
|
402
404
|
@binding {number} number
|
|
@@ -458,8 +460,8 @@ export default {
|
|
|
458
460
|
:href="nextPageHref"
|
|
459
461
|
@click="handleNext($event, value + 1)"
|
|
460
462
|
>
|
|
461
|
-
<!--
|
|
462
|
-
@slot Content for the "next" button. Overrides the "nextText" prop.
|
|
463
|
+
<!--
|
|
464
|
+
@slot Content for the "next" button. Overrides the "nextText" prop.
|
|
463
465
|
@binding {boolean} active
|
|
464
466
|
@binding {boolean} disabled
|
|
465
467
|
@binding {number} number
|