@gitlab/ui 37.10.0 → 38.1.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.
Files changed (67) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +1 -1
  3. package/dist/components/base/breadcrumb/breadcrumb.js +10 -5
  4. package/dist/components/base/{filtered_search/examples/filtered_search.single_unique.example.js → breadcrumb/breadcrumb_item.js} +32 -28
  5. package/dist/components/base/filtered_search/filtered_search.documentation.js +2 -66
  6. package/dist/components/base/filtered_search/filtered_search.js +38 -11
  7. package/dist/components/base/filtered_search/filtered_search_suggestion.documentation.js +2 -8
  8. package/dist/components/base/filtered_search/filtered_search_suggestion.js +4 -0
  9. package/dist/components/base/filtered_search/filtered_search_suggestion_list.documentation.js +2 -7
  10. package/dist/components/base/filtered_search/filtered_search_suggestion_list.js +4 -0
  11. package/dist/components/base/filtered_search/filtered_search_term.documentation.js +2 -44
  12. package/dist/components/base/filtered_search/filtered_search_term.js +37 -0
  13. package/dist/components/base/filtered_search/filtered_search_token.documentation.js +2 -31
  14. package/dist/components/base/filtered_search/filtered_search_token.js +49 -0
  15. package/dist/components/base/filtered_search/filtered_search_token_segment.documentation.js +2 -46
  16. package/dist/components/base/filtered_search/filtered_search_token_segment.js +48 -0
  17. package/dist/components/base/form/form_radio/form_radio.js +1 -1
  18. package/dist/components/charts/series_label/series_label.js +6 -1
  19. package/dist/components/utilities/truncate/truncate.js +2 -2
  20. package/documentation/documented_stories.js +6 -0
  21. package/package.json +9 -7
  22. package/src/components/base/breadcrumb/breadcrumb.spec.js +24 -10
  23. package/src/components/base/breadcrumb/breadcrumb.vue +11 -6
  24. package/src/components/base/breadcrumb/breadcrumb_item.spec.js +45 -0
  25. package/src/components/base/breadcrumb/breadcrumb_item.vue +43 -0
  26. package/src/components/base/filtered_search/filtered_search.documentation.js +0 -76
  27. package/src/components/base/filtered_search/filtered_search.md +3 -4
  28. package/src/components/base/filtered_search/filtered_search.stories.js +248 -13
  29. package/src/components/base/filtered_search/filtered_search.vue +47 -10
  30. package/src/components/base/filtered_search/filtered_search_suggestion.documentation.js +0 -6
  31. package/src/components/base/filtered_search/filtered_search_suggestion.md +1 -7
  32. package/src/components/base/filtered_search/filtered_search_suggestion.stories.js +26 -18
  33. package/src/components/base/filtered_search/filtered_search_suggestion.vue +5 -0
  34. package/src/components/base/filtered_search/filtered_search_suggestion_list.documentation.js +0 -5
  35. package/src/components/base/filtered_search/filtered_search_suggestion_list.md +1 -7
  36. package/src/components/base/filtered_search/filtered_search_suggestion_list.stories.js +33 -25
  37. package/src/components/base/filtered_search/filtered_search_suggestion_list.vue +5 -0
  38. package/src/components/base/filtered_search/filtered_search_term.documentation.js +0 -41
  39. package/src/components/base/filtered_search/filtered_search_term.md +0 -2
  40. package/src/components/base/filtered_search/filtered_search_term.stories.js +33 -26
  41. package/src/components/base/filtered_search/filtered_search_term.vue +54 -0
  42. package/src/components/base/filtered_search/filtered_search_token.documentation.js +0 -26
  43. package/src/components/base/filtered_search/filtered_search_token.md +1 -3
  44. package/src/components/base/filtered_search/filtered_search_token.stories.js +136 -132
  45. package/src/components/base/filtered_search/filtered_search_token.vue +63 -0
  46. package/src/components/base/filtered_search/filtered_search_token_segment.documentation.js +0 -43
  47. package/src/components/base/filtered_search/filtered_search_token_segment.md +0 -2
  48. package/src/components/base/filtered_search/filtered_search_token_segment.stories.js +86 -79
  49. package/src/components/base/filtered_search/filtered_search_token_segment.vue +42 -0
  50. package/src/components/base/form/form_radio/form_radio.spec.js +21 -8
  51. package/src/components/base/form/form_radio/form_radio.vue +0 -1
  52. package/src/components/charts/series_label/series_label.stories.js +6 -3
  53. package/src/components/charts/series_label/series_label.vue +3 -0
  54. package/src/components/utilities/truncate/truncate.spec.js +14 -49
  55. package/src/components/utilities/truncate/truncate.stories.js +1 -59
  56. package/src/components/utilities/truncate/truncate.vue +3 -21
  57. package/dist/components/base/filtered_search/examples/filtered_search.default.example.js +0 -422
  58. package/dist/components/base/filtered_search/examples/filtered_search.friendly.example.js +0 -423
  59. package/dist/components/base/filtered_search/examples/filtered_search.history.example.js +0 -91
  60. package/dist/components/base/filtered_search/examples/filtered_search.multi_select.example.js +0 -196
  61. package/dist/components/base/filtered_search/examples/index.js +0 -32
  62. package/src/components/base/filtered_search/examples/filtered_search.default.example.vue +0 -298
  63. package/src/components/base/filtered_search/examples/filtered_search.friendly.example.vue +0 -300
  64. package/src/components/base/filtered_search/examples/filtered_search.history.example.vue +0 -50
  65. package/src/components/base/filtered_search/examples/filtered_search.multi_select.example.vue +0 -132
  66. package/src/components/base/filtered_search/examples/filtered_search.single_unique.example.vue +0 -31
  67. package/src/components/base/filtered_search/examples/index.js +0 -38
@@ -16,12 +16,10 @@ describe('Truncate component', () => {
16
16
  text: 'ee/app/assets/javascripts/vue_shared/src/utils_reports/components/utils/index.js',
17
17
  };
18
18
 
19
- const findByTestId = (testId) => wrapper.find(`[data-testid="${testId}"]`);
20
-
21
- const createComponent = (props, slots = {}) => {
19
+ const createComponent = (props) => {
22
20
  wrapper = shallowMount(
23
21
  { extends: Truncate, directives: { GlTooltip: createMockDirective('gl-tooltip') } },
24
- { propsData: { ...defaultProps, ...props }, slots }
22
+ { propsData: { ...defaultProps, ...props } }
25
23
  );
26
24
  };
27
25
 
@@ -57,13 +55,12 @@ describe('Truncate component', () => {
57
55
  createComponent({ position: 'start' });
58
56
  });
59
57
 
60
- it('should have the truncate-start class on the text span', () => {
61
- const textSpan = wrapper.findComponent({ ref: 'text' });
62
- expect(textSpan.classes('gl-truncate-start')).toBe(true);
58
+ it('should have the truncate-start class', () => {
59
+ expect(wrapper.find('.gl-truncate-start').exists()).toBe(true);
63
60
  });
64
61
 
65
62
  it('should have the special char surrounded', () => {
66
- const spanTag = wrapper.findComponent({ ref: 'text' }).text();
63
+ const spanTag = wrapper.findAll('.gl-truncate span').at(0).text();
67
64
 
68
65
  expect(spanTag.charAt(0)).toBe('\u200E');
69
66
  expect(spanTag.charAt(spanTag.length - 1)).toBe('\u200E');
@@ -71,27 +68,27 @@ describe('Truncate component', () => {
71
68
  });
72
69
 
73
70
  describe('middle truncation', () => {
74
- let firstTextSpan;
75
- let secondTextSpan;
71
+ let firstSpan;
72
+ let secondSpan;
76
73
 
77
74
  beforeEach(() => {
78
75
  createComponent({ position: 'middle' });
79
- firstTextSpan = findByTestId('text-beginning');
80
- secondTextSpan = findByTestId('text-ending');
76
+ firstSpan = wrapper.findAll('.gl-truncate span').at(0);
77
+ secondSpan = wrapper.findAll('.gl-truncate span').at(1);
81
78
  });
82
79
 
83
80
  it('should have appropriate classes applied', () => {
84
- expect(firstTextSpan.classes('gl-truncate-end')).toBe(true);
85
- expect(secondTextSpan.classes('gl-truncate-start')).toBe(true);
81
+ expect(firstSpan.classes('gl-truncate-end')).toBe(true);
82
+ expect(secondSpan.classes('gl-truncate-start')).toBe(true);
86
83
  });
87
84
 
88
85
  it('should have the spans positioned correctly', () => {
89
- expect(firstTextSpan.text()).toBe('ee/app/assets/javascripts/vue_shared/src');
90
- expect(secondTextSpan.text()).toBe('‎/utils_reports/components/utils/index.js‎');
86
+ expect(firstSpan.text()).toBe('ee/app/assets/javascripts/vue_shared/src');
87
+ expect(secondSpan.text()).toBe('‎/utils_reports/components/utils/index.js‎');
91
88
  });
92
89
 
93
90
  it('last part should have the special char surrounded', () => {
94
- const lastPart = secondTextSpan.text();
91
+ const lastPart = secondSpan.text();
95
92
 
96
93
  expect(lastPart.charAt(0)).toBe('\u200E');
97
94
  expect(lastPart.charAt(lastPart.length - 1)).toBe('\u200E');
@@ -111,36 +108,4 @@ describe('Truncate component', () => {
111
108
  expect(wrapper.find('.gl-truncate-end').exists()).toBe(true);
112
109
  });
113
110
  });
114
-
115
- describe('slots', () => {
116
- const beforeText = 'Before Text Slot';
117
- const afterText = 'After Text Slot';
118
- const slotOptions = {
119
- 'before-text': {
120
- slot: `<span id="before-text">${beforeText}</span>`,
121
- text: beforeText,
122
- },
123
- 'after-text': {
124
- slot: `<span id="after-text">${afterText}</span>`,
125
- text: afterText,
126
- },
127
- };
128
-
129
- it.each`
130
- position | slotType
131
- ${'start'} | ${'before-text'}
132
- ${'start'} | ${'after-text'}
133
- ${'middle'} | ${'before-text'}
134
- ${'middle'} | ${'after-text'}
135
- ${'end'} | ${'before-text'}
136
- ${'end'} | ${'after-text'}
137
- `('$position truncation $slot slot', ({ position, slotType }) => {
138
- const slot = { [slotType]: slotOptions[slotType].slot };
139
-
140
- createComponent({ position }, slot);
141
-
142
- const slotComponent = wrapper.find(`#${slotType}`);
143
- expect(slotComponent.text()).toBe(slotOptions[slotType].text);
144
- });
145
- });
146
111
  });
@@ -1,21 +1,8 @@
1
- import { GlIcon, GlTruncate } from '../../../index';
1
+ import { GlTruncate } from '../../../index';
2
2
  import { POSITION } from './constants';
3
3
  import readme from './truncate.md';
4
4
 
5
5
  const template = '<gl-truncate :text="text" :position="position" :with-tooltip="withTooltip" />';
6
- const beforeTextTemplate = `
7
- <gl-truncate :text="text" :position="position" :with-tooltip="withTooltip">
8
- <template #before-text><gl-icon name="container-image" /></template>
9
- </gl-truncate>`;
10
- const afterTextTemplate = `
11
- <gl-truncate :text="text" :position="position" :with-tooltip="withTooltip">
12
- <template #after-text><gl-icon name="abuse" /></template>
13
- </gl-truncate>`;
14
- const bothSlotsTemplate = `
15
- <gl-truncate :text="text" :position="position" :with-tooltip="withTooltip">
16
- <template #before-text><gl-icon name="rocket" /></template>
17
- <template #after-text><gl-icon name="requirements" /></template>
18
- </gl-truncate>`;
19
6
 
20
7
  const generateProps = ({
21
8
  text = 'src/thisIs/AVeryLongFilePath/that/needs/to/be/smartly/truncated/from/the/middle/so/we/dont/lose/important/information/here.vue',
@@ -37,51 +24,6 @@ const Template = (args, { argTypes }) => ({
37
24
  export const Default = Template.bind({});
38
25
  Default.args = generateProps();
39
26
 
40
- const BeforeTextTemplate = (args, { argTypes }) => ({
41
- components: { GlIcon, GlTruncate },
42
- props: Object.keys(argTypes),
43
- template: beforeTextTemplate,
44
- });
45
- export const BeforeText = BeforeTextTemplate.bind({});
46
- BeforeText.args = generateProps({ position: 'start' });
47
- BeforeText.parameters = {
48
- docs: {
49
- source: {
50
- code: beforeTextTemplate,
51
- },
52
- },
53
- };
54
-
55
- const AfterTextTemplate = (args, { argTypes }) => ({
56
- components: { GlIcon, GlTruncate },
57
- props: Object.keys(argTypes),
58
- template: afterTextTemplate,
59
- });
60
- export const AfterText = AfterTextTemplate.bind({});
61
- AfterText.args = generateProps({ position: 'end' });
62
- AfterText.parameters = {
63
- docs: {
64
- source: {
65
- code: afterTextTemplate,
66
- },
67
- },
68
- };
69
-
70
- const BothSlotsTemplate = (args, { argTypes }) => ({
71
- components: { GlIcon, GlTruncate },
72
- props: Object.keys(argTypes),
73
- template: bothSlotsTemplate,
74
- });
75
- export const BothSlots = BothSlotsTemplate.bind({});
76
- BothSlots.args = generateProps();
77
- BothSlots.parameters = {
78
- docs: {
79
- source: {
80
- code: bothSlotsTemplate,
81
- },
82
- },
83
- };
84
-
85
27
  export default {
86
28
  title: 'utilities/truncate',
87
29
  component: GlTruncate,
@@ -1,6 +1,6 @@
1
1
  <script>
2
- import { GlResizeObserverDirective } from '../../../directives/resize_observer/resize_observer';
3
2
  import { GlTooltipDirective } from '../../../directives/tooltip';
3
+ import { GlResizeObserverDirective } from '../../../directives/resize_observer/resize_observer';
4
4
  import { POSITION } from './constants';
5
5
 
6
6
  export default {
@@ -81,15 +81,9 @@ export default {
81
81
  class="gl-truncate"
82
82
  :title="text"
83
83
  >
84
- <span v-if="$scopedSlots['before-text']" class="gl-pr-3">
85
- <slot name="before-text"></slot>
86
- </span>
87
84
  <span ref="text" class="gl-truncate-start gl-text-overflow-ellipsis!"
88
85
  >&lrm;{{ text }}&lrm;</span
89
86
  >
90
- <span v-if="$scopedSlots['after-text']" class="gl-pl-3">
91
- <slot name="after-text"></slot>
92
- </span>
93
87
  </span>
94
88
 
95
89
  <!-- MIDDLE -->
@@ -100,14 +94,8 @@ export default {
100
94
  class="gl-truncate"
101
95
  :title="text"
102
96
  >
103
- <span v-if="$scopedSlots['before-text']" class="gl-pr-3">
104
- <slot name="before-text"></slot>
105
- </span>
106
- <span ref="text" class="gl-truncate-end" data-testid="text-beginning">{{ first }}</span
107
- ><span class="gl-truncate-start" data-testid="text-ending">&lrm;{{ last }}&lrm;</span>
108
- <span v-if="$scopedSlots['after-text']" class="gl-pl-3">
109
- <slot name="after-text"></slot>
110
- </span>
97
+ <span ref="text" class="gl-truncate-end">{{ first }}</span
98
+ ><span class="gl-truncate-start">&lrm;{{ last }}&lrm;</span>
111
99
  </span>
112
100
 
113
101
  <!-- END -->
@@ -119,12 +107,6 @@ export default {
119
107
  data-testid="truncate-end-container"
120
108
  :title="text"
121
109
  >
122
- <span v-if="$scopedSlots['before-text']" class="gl-pr-3">
123
- <slot name="before-text"></slot>
124
- </span>
125
110
  <span ref="text" class="gl-truncate-end">{{ text }}</span>
126
- <span v-if="$scopedSlots['after-text']" class="gl-pl-3">
127
- <slot name="after-text"></slot>
128
- </span>
129
111
  </span>
130
112
  </template>
@@ -1,422 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- const fakeUsers = [{
4
- id: 1,
5
- name: 'User Alpha',
6
- username: 'alpha'
7
- }, {
8
- id: 2,
9
- name: 'User Beta',
10
- username: 'beta'
11
- }, {
12
- id: 3,
13
- name: 'User Gamma',
14
- username: 'gamma'
15
- }, {
16
- id: 4,
17
- name: 'User Delta',
18
- username: 'delta'
19
- }, {
20
- id: 5,
21
- name: 'User Epsilon',
22
- username: 'epsilon'
23
- }];
24
- const fakeMilestones = [{
25
- id: 1,
26
- title: '12.7',
27
- name: '%12.7'
28
- }, {
29
- id: 2,
30
- title: '12.8',
31
- name: '%12.8'
32
- }, {
33
- id: 3,
34
- title: '12.9',
35
- name: '%12.9'
36
- }, {
37
- id: 4,
38
- title: '12.10',
39
- name: '%12.10'
40
- }, {
41
- id: 5,
42
- title: 'Backlog',
43
- name: 'Backlog'
44
- }];
45
- const fakeLabels = [{
46
- id: 1,
47
- title: 'Bug',
48
- color: '#D9534F',
49
- text_color: '#FFFFFF'
50
- }, {
51
- id: 2,
52
- title: 'Enhancement',
53
- color: '#F0AD4E',
54
- text_color: '#FFFFFF'
55
- }, {
56
- id: 3,
57
- title: 'Backlog',
58
- color: '#cccccc',
59
- text_color: '#333333'
60
- }, {
61
- id: 4,
62
- title: 'Feature',
63
- color: '#A8D695',
64
- text_color: '#333333'
65
- }, {
66
- id: 5,
67
- title: 'Documentation',
68
- color: '#5CB85C',
69
- text_color: '#FFFFFF'
70
- }];
71
- const UserToken = {
72
- props: ['value', 'active'],
73
- inheritAttrs: false,
74
-
75
- data() {
76
- return {
77
- loadingView: false,
78
- loadingSuggestions: false,
79
- users: [],
80
- activeUser: null
81
- };
82
- },
83
-
84
- methods: {
85
- loadView() {
86
- this.loadingView = true;
87
- setTimeout(() => {
88
- this.loadingView = false;
89
- this.activeUser = fakeUsers.find(u => u.username === this.value.data);
90
- }, 1000);
91
- },
92
-
93
- loadSuggestions() {
94
- this.loadingSuggestions = true;
95
- setTimeout(() => {
96
- this.loadingSuggestions = false;
97
- this.users = fakeUsers;
98
- }, 2000);
99
- }
100
-
101
- },
102
- watch: {
103
- // eslint-disable-next-line func-names
104
- 'value.data': function () {
105
- if (this.active) {
106
- this.loadSuggestions();
107
- }
108
- },
109
- active: {
110
- immediate: true,
111
-
112
- handler(newValue) {
113
- if (!newValue) {
114
- this.loadView();
115
- } else {
116
- this.loadSuggestions();
117
- }
118
- }
119
-
120
- }
121
- },
122
- template: `
123
- <gl-filtered-search-token
124
- v-bind="{ ...this.$props, ...this.$attrs }"
125
- v-on="$listeners"
126
- >
127
- <template #view="{ inputValue }">
128
- <gl-loading-icon size="sm" v-if="loadingView" class="gl-mr-2" />
129
- <gl-avatar :size="16" :entity-name="inputValue" shape="circle" class="gl-mr-2" v-else />
130
- {{ activeUser ? activeUser.name : inputValue }}
131
- </template>
132
- <template #suggestions>
133
- <template v-if="loadingSuggestions">
134
- <gl-loading-icon />
135
- </template>
136
- <template v-else>
137
- <gl-filtered-search-suggestion :key="user.id" v-for="user in users" :value="user.username">
138
- <div class="gl-display-flex">
139
- <gl-avatar :size="32" :entity-name="user.username" />
140
- <div>
141
- <p class="gl-m-0">{{ user.name }}</p>
142
- <p class="gl-m-0">@{{ user.username }}</p>
143
- </div>
144
- </div>
145
- </gl-filtered-search-suggestion>
146
- </template>
147
- </template>
148
- </gl-filtered-search-token>
149
- `
150
- };
151
- const MilestoneToken = {
152
- props: ['value', 'active'],
153
- inheritAttrs: false,
154
-
155
- data() {
156
- return {
157
- loadingView: false,
158
- loadingSuggestions: false,
159
- milestones: []
160
- };
161
- },
162
-
163
- methods: {
164
- loadSuggestions() {
165
- this.loadingSuggestions = true;
166
- setTimeout(() => {
167
- this.loadingSuggestions = false;
168
- this.milestones = fakeMilestones;
169
- }, 2000);
170
- }
171
-
172
- },
173
- watch: {
174
- // eslint-disable-next-line func-names
175
- 'value.data': function () {
176
- if (this.active) {
177
- this.loadSuggestions();
178
- }
179
- },
180
- active: {
181
- immediate: true,
182
-
183
- handler(newValue) {
184
- if (newValue) {
185
- this.loadSuggestions();
186
- }
187
- }
188
-
189
- }
190
- },
191
- template: `
192
- <gl-filtered-search-token
193
- v-bind="{ ...this.$props, ...this.$attrs }"
194
- v-on="$listeners"
195
- >
196
- <template #suggestions>
197
- <gl-filtered-search-suggestion value="None">None</gl-filtered-search-suggestion>
198
- <gl-filtered-search-suggestion value="Any">Any</gl-filtered-search-suggestion>
199
- <gl-filtered-search-suggestion value="Upcoming">Upcoming</gl-filtered-search-suggestion>
200
- <gl-filtered-search-suggestion value="Started">Started</gl-filtered-search-suggestion>
201
- <gl-dropdown-divider v-if="loadingSuggestions || milestones.length" />
202
- <template v-if="loadingSuggestions">
203
- <gl-loading-icon />
204
- </template>
205
- <template v-else>
206
- <gl-filtered-search-suggestion :key="milestone.id" v-for="milestone in milestones" :value="milestone.name">
207
- {{ milestone.title }}
208
- </gl-filtered-search-suggestion>
209
- </template>
210
- </template>
211
- </gl-filtered-search-token>
212
- `
213
- };
214
- const LabelToken = {
215
- props: ['value', 'active'],
216
- inheritAttrs: false,
217
-
218
- data() {
219
- return {
220
- loadingView: false,
221
- loadingSuggestions: false,
222
- labels: [],
223
- activeLabel: null
224
- };
225
- },
226
-
227
- computed: {
228
- currentValue() {
229
- return this.value.data.toLowerCase();
230
- },
231
-
232
- containerStyle() {
233
- if (this.activeLabel) {
234
- const {
235
- color,
236
- text_color
237
- } = this.activeLabel;
238
- return {
239
- backgroundColor: color,
240
- color: text_color
241
- };
242
- }
243
-
244
- return {};
245
- }
246
-
247
- },
248
- methods: {
249
- loadView() {
250
- this.loadingView = true;
251
- setTimeout(() => {
252
- this.loadingView = false;
253
- this.activeLabel = fakeLabels.find(l => l.title === this.value.data);
254
- }, 100);
255
- },
256
-
257
- loadSuggestions() {
258
- this.loadingSuggestions = true;
259
- setTimeout(() => {
260
- this.loadingSuggestions = false;
261
- this.labels = fakeLabels;
262
- }, 2000);
263
- }
264
-
265
- },
266
- watch: {
267
- // eslint-disable-next-line func-names
268
- 'value.data': function () {
269
- if (this.active) {
270
- this.loadSuggestions();
271
- }
272
- },
273
- active: {
274
- immediate: true,
275
-
276
- handler(newValue) {
277
- if (!newValue) {
278
- this.loadView();
279
- } else {
280
- this.loadSuggestions();
281
- }
282
- }
283
-
284
- }
285
- },
286
- template: `
287
- <gl-filtered-search-token
288
- v-bind="{ ...this.$props, ...this.$attrs }"
289
- v-on="$listeners"
290
- >
291
- <template #view-token="{ inputValue, cssClasses, listeners }">
292
- <gl-token variant="search-value" :class="cssClasses" :style="containerStyle" v-on="listeners">
293
- {{ activeLabel ? activeLabel.title : inputValue }}
294
- </gl-token>
295
- </template>
296
- <template #suggestions>
297
- <gl-filtered-search-suggestion value="None">None</gl-filtered-search-suggestion>
298
- <gl-filtered-search-suggestion value="Any">Any</gl-filtered-search-suggestion>
299
- <gl-dropdown-divider v-if="loadingSuggestions || labels.length" />
300
- <template v-if="loadingSuggestions">
301
- <gl-loading-icon />
302
- </template>
303
- <template v-else>
304
- <gl-filtered-search-suggestion :key="label.id" v-for="label in labels" :value="label.title">
305
- <div class="d-flex">
306
- <span
307
- :style="{ backgroundColor: label.color, height: '16px', width: '16px' }"
308
- class="d-inline-block mr-2"
309
- ></span>
310
- {{ label.title }}
311
- </div>
312
- </gl-filtered-search-suggestion>
313
- </template>
314
- </template>
315
- </gl-filtered-search-token>
316
- `
317
- };
318
- const tokens = [{
319
- type: 'author',
320
- icon: 'pencil',
321
- title: 'Author',
322
- dataType: 'user',
323
- unique: true,
324
- token: UserToken
325
- }, {
326
- type: 'user',
327
- icon: 'user',
328
- title: 'Assignee',
329
- dataType: 'user',
330
- token: UserToken
331
- }, {
332
- type: 'milestone',
333
- icon: 'clock',
334
- title: 'Milestone',
335
- unique: true,
336
- token: MilestoneToken
337
- }, {
338
- type: 'label',
339
- icon: 'labels',
340
- title: 'Label',
341
- token: LabelToken
342
- }, {
343
- type: 'weight',
344
- icon: 'weight',
345
- title: 'Weight',
346
- unique: true,
347
- token: 'gl-filtered-search-token'
348
- }, {
349
- type: 'confidential',
350
- icon: 'eye-slash',
351
- title: 'Confidential',
352
- unique: true,
353
- token: 'gl-filtered-search-token',
354
- options: [{
355
- icon: 'eye-slash',
356
- value: true,
357
- title: 'Yes'
358
- }, {
359
- icon: 'eye',
360
- value: false,
361
- title: 'No'
362
- }]
363
- }];
364
- var script = {
365
- data() {
366
- return {
367
- tokens,
368
- value: [{
369
- type: 'author',
370
- value: {
371
- data: 'beta',
372
- operator: '='
373
- }
374
- }, {
375
- type: 'label',
376
- value: {
377
- data: 'Bug',
378
- operator: '='
379
- }
380
- }, 'raw text']
381
- };
382
- }
383
-
384
- };
385
-
386
- /* script */
387
- const __vue_script__ = script;
388
-
389
- /* template */
390
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-filtered-search',{attrs:{"available-tokens":_vm.tokens},model:{value:(_vm.value),callback:function ($$v) {_vm.value=$$v;},expression:"value"}})};
391
- var __vue_staticRenderFns__ = [];
392
-
393
- /* style */
394
- const __vue_inject_styles__ = undefined;
395
- /* scoped */
396
- const __vue_scope_id__ = undefined;
397
- /* module identifier */
398
- const __vue_module_identifier__ = undefined;
399
- /* functional template */
400
- const __vue_is_functional_template__ = false;
401
- /* style inject */
402
-
403
- /* style inject SSR */
404
-
405
- /* style inject shadow dom */
406
-
407
-
408
-
409
- const __vue_component__ = __vue_normalize__(
410
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
411
- __vue_inject_styles__,
412
- __vue_script__,
413
- __vue_scope_id__,
414
- __vue_is_functional_template__,
415
- __vue_module_identifier__,
416
- false,
417
- undefined,
418
- undefined,
419
- undefined
420
- );
421
-
422
- export default __vue_component__;