@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.
- package/CHANGELOG.md +30 -0
- package/README.md +1 -1
- package/dist/components/base/breadcrumb/breadcrumb.js +10 -5
- package/dist/components/base/{filtered_search/examples/filtered_search.single_unique.example.js → breadcrumb/breadcrumb_item.js} +32 -28
- package/dist/components/base/filtered_search/filtered_search.documentation.js +2 -66
- package/dist/components/base/filtered_search/filtered_search.js +38 -11
- package/dist/components/base/filtered_search/filtered_search_suggestion.documentation.js +2 -8
- package/dist/components/base/filtered_search/filtered_search_suggestion.js +4 -0
- package/dist/components/base/filtered_search/filtered_search_suggestion_list.documentation.js +2 -7
- package/dist/components/base/filtered_search/filtered_search_suggestion_list.js +4 -0
- package/dist/components/base/filtered_search/filtered_search_term.documentation.js +2 -44
- package/dist/components/base/filtered_search/filtered_search_term.js +37 -0
- package/dist/components/base/filtered_search/filtered_search_token.documentation.js +2 -31
- package/dist/components/base/filtered_search/filtered_search_token.js +49 -0
- package/dist/components/base/filtered_search/filtered_search_token_segment.documentation.js +2 -46
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +48 -0
- package/dist/components/base/form/form_radio/form_radio.js +1 -1
- package/dist/components/charts/series_label/series_label.js +6 -1
- package/dist/components/utilities/truncate/truncate.js +2 -2
- package/documentation/documented_stories.js +6 -0
- package/package.json +9 -7
- package/src/components/base/breadcrumb/breadcrumb.spec.js +24 -10
- package/src/components/base/breadcrumb/breadcrumb.vue +11 -6
- package/src/components/base/breadcrumb/breadcrumb_item.spec.js +45 -0
- package/src/components/base/breadcrumb/breadcrumb_item.vue +43 -0
- package/src/components/base/filtered_search/filtered_search.documentation.js +0 -76
- package/src/components/base/filtered_search/filtered_search.md +3 -4
- package/src/components/base/filtered_search/filtered_search.stories.js +248 -13
- package/src/components/base/filtered_search/filtered_search.vue +47 -10
- package/src/components/base/filtered_search/filtered_search_suggestion.documentation.js +0 -6
- package/src/components/base/filtered_search/filtered_search_suggestion.md +1 -7
- package/src/components/base/filtered_search/filtered_search_suggestion.stories.js +26 -18
- package/src/components/base/filtered_search/filtered_search_suggestion.vue +5 -0
- package/src/components/base/filtered_search/filtered_search_suggestion_list.documentation.js +0 -5
- package/src/components/base/filtered_search/filtered_search_suggestion_list.md +1 -7
- package/src/components/base/filtered_search/filtered_search_suggestion_list.stories.js +33 -25
- package/src/components/base/filtered_search/filtered_search_suggestion_list.vue +5 -0
- package/src/components/base/filtered_search/filtered_search_term.documentation.js +0 -41
- package/src/components/base/filtered_search/filtered_search_term.md +0 -2
- package/src/components/base/filtered_search/filtered_search_term.stories.js +33 -26
- package/src/components/base/filtered_search/filtered_search_term.vue +54 -0
- package/src/components/base/filtered_search/filtered_search_token.documentation.js +0 -26
- package/src/components/base/filtered_search/filtered_search_token.md +1 -3
- package/src/components/base/filtered_search/filtered_search_token.stories.js +136 -132
- package/src/components/base/filtered_search/filtered_search_token.vue +63 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.documentation.js +0 -43
- package/src/components/base/filtered_search/filtered_search_token_segment.md +0 -2
- package/src/components/base/filtered_search/filtered_search_token_segment.stories.js +86 -79
- package/src/components/base/filtered_search/filtered_search_token_segment.vue +42 -0
- package/src/components/base/form/form_radio/form_radio.spec.js +21 -8
- package/src/components/base/form/form_radio/form_radio.vue +0 -1
- package/src/components/charts/series_label/series_label.stories.js +6 -3
- package/src/components/charts/series_label/series_label.vue +3 -0
- package/src/components/utilities/truncate/truncate.spec.js +14 -49
- package/src/components/utilities/truncate/truncate.stories.js +1 -59
- package/src/components/utilities/truncate/truncate.vue +3 -21
- package/dist/components/base/filtered_search/examples/filtered_search.default.example.js +0 -422
- package/dist/components/base/filtered_search/examples/filtered_search.friendly.example.js +0 -423
- package/dist/components/base/filtered_search/examples/filtered_search.history.example.js +0 -91
- package/dist/components/base/filtered_search/examples/filtered_search.multi_select.example.js +0 -196
- package/dist/components/base/filtered_search/examples/index.js +0 -32
- package/src/components/base/filtered_search/examples/filtered_search.default.example.vue +0 -298
- package/src/components/base/filtered_search/examples/filtered_search.friendly.example.vue +0 -300
- package/src/components/base/filtered_search/examples/filtered_search.history.example.vue +0 -50
- package/src/components/base/filtered_search/examples/filtered_search.multi_select.example.vue +0 -132
- package/src/components/base/filtered_search/examples/filtered_search.single_unique.example.vue +0 -31
- package/src/components/base/filtered_search/examples/index.js +0 -38
package/src/components/base/filtered_search/examples/filtered_search.multi_select.example.vue
DELETED
|
@@ -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">, </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>
|
package/src/components/base/filtered_search/examples/filtered_search.single_unique.example.vue
DELETED
|
@@ -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
|
-
];
|