@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,132 +0,0 @@
1
- <script>
2
- const fakeUsers = [
3
- { id: 1, name: 'User Alpha', username: 'alpha' },
4
- { id: 2, name: 'User Beta', username: 'beta' },
5
- { id: 3, name: 'User Gamma', username: 'gamma' },
6
- { id: 4, name: 'User Delta', username: 'delta' },
7
- { id: 5, name: 'User Epsilon', username: 'epsilon' },
8
- ];
9
-
10
- const UserToken = {
11
- props: ['value', 'active', 'config'],
12
- inheritAttrs: false,
13
- data() {
14
- return {
15
- users: fakeUsers,
16
- selectedUsernames: this.value.data ? this.value.data.split(',') : [],
17
- activeUser: null,
18
- };
19
- },
20
- computed: {
21
- filteredUsers() {
22
- return this.users.filter((user) => user.username.includes(this.value.data));
23
- },
24
- selectedUsers() {
25
- return this.config.multiSelect
26
- ? this.users.filter((user) => this.selectedUsernames.includes(user.username))
27
- : this.users.filter((user) => user.username === this.activeUser);
28
- },
29
- },
30
- methods: {
31
- loadView() {
32
- this.activeUser = fakeUsers.find((u) => u.username === this.value.data);
33
- },
34
- loadSuggestions() {
35
- this.users = fakeUsers;
36
- },
37
- handleSelect(username) {
38
- if (!this.config.multiSelect) {
39
- return;
40
- }
41
-
42
- if (this.selectedUsernames.includes(username)) {
43
- this.selectedUsernames = this.selectedUsernames.filter((user) => user !== username);
44
- } else {
45
- this.selectedUsernames.push(username);
46
- }
47
- },
48
- isLastUser(index) {
49
- return index === this.selectedUsers.length - 1;
50
- },
51
- },
52
- watch: {
53
- // eslint-disable-next-line func-names
54
- 'value.data': function () {
55
- if (this.active) {
56
- this.loadSuggestions();
57
- }
58
- },
59
- active: {
60
- immediate: true,
61
- handler(newValue) {
62
- if (!newValue) {
63
- this.loadView();
64
- } else {
65
- this.loadSuggestions();
66
- }
67
- },
68
- },
69
- },
70
- template: `
71
- <gl-filtered-search-token
72
- v-bind="{ ...this.$props, ...this.$attrs }"
73
- v-on="$listeners"
74
- :multi-select-values="selectedUsernames"
75
- @select="handleSelect"
76
- >
77
- <template #view="{ inputValue }">
78
- <template v-for="(user, index) in selectedUsers">
79
- <gl-avatar :size="16" :entity-name="user.username" shape="circle" />
80
- {{ user.name }}
81
- <span v-if="!isLastUser(index)" class="gl-mx-2">,&nbsp;</span>
82
- </template>
83
- </template>
84
- <template #suggestions>
85
- <gl-filtered-search-suggestion :key="user.id" v-for="user in filteredUsers" :value="user.username">
86
- <div class="gl-display-flex gl-align-items-center">
87
- <gl-icon
88
- v-if="config.multiSelect"
89
- name="check"
90
- class="gl-mr-3 gl-text-gray-700"
91
- :class="{ 'gl-visibility-hidden': !selectedUsernames.includes(user.username) }"
92
- />
93
- <gl-avatar :size="32" :entity-name="user.username" />
94
- <div>
95
- <p class="gl-m-0">{{ user.name }}</p>
96
- <p class="gl-m-0">@{{ user.username }}</p>
97
- </div>
98
- </div>
99
- </gl-filtered-search-suggestion>
100
- </template>
101
- </gl-filtered-search-token>
102
- `,
103
- };
104
-
105
- const tokens = [
106
- {
107
- type: 'assignee',
108
- icon: 'user',
109
- title: 'Assignee',
110
- token: UserToken,
111
- operators: [
112
- { value: '=', description: 'is', default: 'true' },
113
- { value: '!=', description: 'is not one of' },
114
- { value: '||', description: 'is one of' },
115
- ],
116
- multiSelect: true,
117
- },
118
- ];
119
-
120
- export default {
121
- data() {
122
- return {
123
- tokens,
124
- value: [{ type: 'assignee', value: { data: 'alpha,beta', operator: '=' } }],
125
- };
126
- },
127
- };
128
- </script>
129
-
130
- <template>
131
- <gl-filtered-search v-model="value" :available-tokens="tokens" :show-friendly-text="true" />
132
- </template>
@@ -1,31 +0,0 @@
1
- <script>
2
- const testTokens = [
3
- {
4
- type: 'unique',
5
- title: 'Unique',
6
- icon: 'document',
7
- token: 'gl-filtered-search-token',
8
- operators: [{ value: '=', description: 'is', default: 'true' }],
9
- options: [
10
- { icon: 'heart', title: 'heart', value: 1 },
11
- { icon: 'hook', title: 'hook', value: 2 },
12
- ],
13
- unique: true,
14
- },
15
- ];
16
-
17
- export default {
18
- data() {
19
- return {
20
- tokens: testTokens,
21
- value: [],
22
- };
23
- },
24
- };
25
- </script>
26
- <template>
27
- <div>
28
- {{ value }}
29
- <gl-filtered-search v-model="value" :available-tokens="tokens" />
30
- </div>
31
- </template>
@@ -1,38 +0,0 @@
1
- import FilteredSearchDefaultExample from './filtered_search.default.example.vue';
2
- import FilteredSearchFriendlyExample from './filtered_search.friendly.example.vue';
3
- import FilteredSearchHistoryExample from './filtered_search.history.example.vue';
4
- import FilteredSearchMultiSelectExample from './filtered_search.multi_select.example.vue';
5
- import FilteredSearchSingleUniqueExample from './filtered_search.single_unique.example.vue';
6
-
7
- export default [
8
- {
9
- name: 'Filtered search',
10
- items: [
11
- {
12
- id: 'filtered-search',
13
- name: 'default',
14
- component: FilteredSearchDefaultExample,
15
- },
16
- {
17
- id: 'filtered-search-single-unique',
18
- name: 'single-unique',
19
- component: FilteredSearchSingleUniqueExample,
20
- },
21
- {
22
- id: 'filtered-search-history',
23
- name: 'with-history',
24
- component: FilteredSearchHistoryExample,
25
- },
26
- {
27
- id: 'filtered-search-friendly-text',
28
- name: 'with-friendly-text',
29
- component: FilteredSearchFriendlyExample,
30
- },
31
- {
32
- id: 'filtered-search-multi-select',
33
- name: 'with-multi-select',
34
- component: FilteredSearchMultiSelectExample,
35
- },
36
- ],
37
- },
38
- ];