@gitlab/ui 38.0.1 → 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 (61) hide show
  1. package/CHANGELOG.md +7 -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 -0
  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/charts/series_label/series_label.js +6 -1
  18. package/documentation/documented_stories.js +6 -0
  19. package/package.json +9 -7
  20. package/src/components/base/breadcrumb/breadcrumb.spec.js +24 -10
  21. package/src/components/base/breadcrumb/breadcrumb.vue +11 -6
  22. package/src/components/base/breadcrumb/breadcrumb_item.spec.js +45 -0
  23. package/src/components/base/breadcrumb/breadcrumb_item.vue +43 -0
  24. package/src/components/base/filtered_search/filtered_search.documentation.js +0 -76
  25. package/src/components/base/filtered_search/filtered_search.md +3 -4
  26. package/src/components/base/filtered_search/filtered_search.stories.js +248 -13
  27. package/src/components/base/filtered_search/filtered_search.vue +45 -0
  28. package/src/components/base/filtered_search/filtered_search_suggestion.documentation.js +0 -6
  29. package/src/components/base/filtered_search/filtered_search_suggestion.md +1 -7
  30. package/src/components/base/filtered_search/filtered_search_suggestion.stories.js +26 -18
  31. package/src/components/base/filtered_search/filtered_search_suggestion.vue +5 -0
  32. package/src/components/base/filtered_search/filtered_search_suggestion_list.documentation.js +0 -5
  33. package/src/components/base/filtered_search/filtered_search_suggestion_list.md +1 -7
  34. package/src/components/base/filtered_search/filtered_search_suggestion_list.stories.js +33 -25
  35. package/src/components/base/filtered_search/filtered_search_suggestion_list.vue +5 -0
  36. package/src/components/base/filtered_search/filtered_search_term.documentation.js +0 -41
  37. package/src/components/base/filtered_search/filtered_search_term.md +0 -2
  38. package/src/components/base/filtered_search/filtered_search_term.stories.js +33 -26
  39. package/src/components/base/filtered_search/filtered_search_term.vue +54 -0
  40. package/src/components/base/filtered_search/filtered_search_token.documentation.js +0 -26
  41. package/src/components/base/filtered_search/filtered_search_token.md +1 -3
  42. package/src/components/base/filtered_search/filtered_search_token.stories.js +136 -132
  43. package/src/components/base/filtered_search/filtered_search_token.vue +63 -0
  44. package/src/components/base/filtered_search/filtered_search_token_segment.documentation.js +0 -43
  45. package/src/components/base/filtered_search/filtered_search_token_segment.md +0 -2
  46. package/src/components/base/filtered_search/filtered_search_token_segment.stories.js +86 -79
  47. package/src/components/base/filtered_search/filtered_search_token_segment.vue +42 -0
  48. package/src/components/base/form/form_radio/form_radio.spec.js +21 -8
  49. package/src/components/charts/series_label/series_label.stories.js +6 -3
  50. package/src/components/charts/series_label/series_label.vue +3 -0
  51. package/dist/components/base/filtered_search/examples/filtered_search.default.example.js +0 -422
  52. package/dist/components/base/filtered_search/examples/filtered_search.friendly.example.js +0 -423
  53. package/dist/components/base/filtered_search/examples/filtered_search.history.example.js +0 -91
  54. package/dist/components/base/filtered_search/examples/filtered_search.multi_select.example.js +0 -196
  55. package/dist/components/base/filtered_search/examples/index.js +0 -32
  56. package/src/components/base/filtered_search/examples/filtered_search.default.example.vue +0 -298
  57. package/src/components/base/filtered_search/examples/filtered_search.friendly.example.vue +0 -300
  58. package/src/components/base/filtered_search/examples/filtered_search.history.example.vue +0 -50
  59. package/src/components/base/filtered_search/examples/filtered_search.multi_select.example.vue +0 -132
  60. package/src/components/base/filtered_search/examples/filtered_search.single_unique.example.vue +0 -31
  61. package/src/components/base/filtered_search/examples/index.js +0 -38
@@ -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__;