@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.
- package/CHANGELOG.md +7 -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 -0
- 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/charts/series_label/series_label.js +6 -1
- 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 +45 -0
- 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/charts/series_label/series_label.stories.js +6 -3
- package/src/components/charts/series_label/series_label.vue +3 -0
- 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
|
@@ -1,32 +1,28 @@
|
|
|
1
|
-
import { withKnobs } from '@storybook/addon-knobs';
|
|
2
1
|
import { GlFilteredSearchSuggestionList, GlFilteredSearchSuggestion } from '../../../index';
|
|
3
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
4
2
|
import { provide } from './common_story_options';
|
|
5
3
|
import readme from './filtered_search_suggestion_list.md';
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
export const Default = () => ({
|
|
6
|
+
components: { GlFilteredSearchSuggestionList, GlFilteredSearchSuggestion },
|
|
7
|
+
data() {
|
|
8
|
+
return {
|
|
9
|
+
iteration: 1,
|
|
10
|
+
items: Array.from({ length: 5 }).map((_, idx) => `item-${idx}-iteration-1`),
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
provide,
|
|
14
|
+
methods: {
|
|
15
|
+
change() {
|
|
16
|
+
this.iteration += 1;
|
|
17
|
+
this.items = Array.from({ length: 3 + Math.floor(Math.random() * 5) }).map(
|
|
18
|
+
(_, idx) => `item-${idx}-iteration-${this.iteration}`
|
|
19
|
+
);
|
|
16
20
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
(_, idx) => `item-${idx}-iteration-${this.iteration}`
|
|
23
|
-
);
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
mounted() {
|
|
27
|
-
this.$refs.suggestions.nextItem();
|
|
28
|
-
},
|
|
29
|
-
template: `
|
|
21
|
+
},
|
|
22
|
+
mounted() {
|
|
23
|
+
this.$refs.suggestions.nextItem();
|
|
24
|
+
},
|
|
25
|
+
template: `
|
|
30
26
|
<div>
|
|
31
27
|
<button @click="$refs.suggestions.prevItem()">prev</button>
|
|
32
28
|
<button @click="$refs.suggestions.nextItem()">next</button>
|
|
@@ -38,4 +34,16 @@ documentedStoriesOf('base/filtered-search/suggestion-list', readme)
|
|
|
38
34
|
</gl-filtered-search-suggestion-list>
|
|
39
35
|
</div>
|
|
40
36
|
`,
|
|
41
|
-
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export default {
|
|
40
|
+
title: 'base/filtered-search/suggestion-list',
|
|
41
|
+
component: GlFilteredSearchSuggestionList,
|
|
42
|
+
parameters: {
|
|
43
|
+
docs: {
|
|
44
|
+
description: {
|
|
45
|
+
component: readme,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
export default {
|
|
3
|
+
name: 'GlFilteredSearchSuggestionList',
|
|
3
4
|
inject: ['suggestionsListClass'],
|
|
4
5
|
provide() {
|
|
5
6
|
return {
|
|
@@ -7,6 +8,9 @@ export default {
|
|
|
7
8
|
};
|
|
8
9
|
},
|
|
9
10
|
props: {
|
|
11
|
+
/**
|
|
12
|
+
* Value to be initially selected in list.
|
|
13
|
+
*/
|
|
10
14
|
initialValue: {
|
|
11
15
|
required: false,
|
|
12
16
|
validator: () => true,
|
|
@@ -84,6 +88,7 @@ export default {
|
|
|
84
88
|
</script>
|
|
85
89
|
<template>
|
|
86
90
|
<ul :class="listClasses">
|
|
91
|
+
<!-- @slot The suggestions (implemented with GlFilteredSearchSuggestion). -->
|
|
87
92
|
<slot></slot>
|
|
88
93
|
</ul>
|
|
89
94
|
</template>
|
|
@@ -2,45 +2,4 @@ import * as description from './filtered_search_term.md';
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
description,
|
|
5
|
-
bootstrapComponent: null,
|
|
6
|
-
propsInfo: {
|
|
7
|
-
availableTokens: {
|
|
8
|
-
additionalInfo: 'Tokens available for this filtered search instance',
|
|
9
|
-
},
|
|
10
|
-
active: {
|
|
11
|
-
additionalInfo: 'If this term token is currently active',
|
|
12
|
-
},
|
|
13
|
-
value: {
|
|
14
|
-
additionalInfo: 'Current term value',
|
|
15
|
-
},
|
|
16
|
-
searchInputAttributes: {
|
|
17
|
-
additionalInfo: 'HTML attributes to add to the search input',
|
|
18
|
-
},
|
|
19
|
-
isLastToken: {
|
|
20
|
-
additionalInfo: 'If this is the last token',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
events: [
|
|
24
|
-
{ event: 'activate', description: 'Emitted when this term token is clicked' },
|
|
25
|
-
{ event: 'deactivate', description: 'Emitted when this term token loses its focus' },
|
|
26
|
-
{
|
|
27
|
-
event: 'destroy',
|
|
28
|
-
description: 'Emitted when token value is empty and backspace is pressed',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
event: 'replace',
|
|
32
|
-
args: [{ arg: 'token', description: '(Object) Replacement token configuration' }],
|
|
33
|
-
description: 'Emitted when autocomplete entry is selected',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
event: 'split',
|
|
37
|
-
args: [
|
|
38
|
-
{
|
|
39
|
-
arg: 'newTokens',
|
|
40
|
-
description: '(Array) Token configurations',
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
description: 'Emitted when Space is pressed in-between term text',
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
5
|
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { withKnobs, boolean } from '@storybook/addon-knobs';
|
|
2
1
|
import PortalVue from 'portal-vue';
|
|
3
2
|
import Vue from 'vue';
|
|
4
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
5
3
|
import { provide } from './common_story_options';
|
|
6
4
|
import readme from './filtered_search_term.md';
|
|
7
5
|
import GlFilteredSearchTerm from './filtered_search_term.vue';
|
|
@@ -13,29 +11,25 @@ const availableTokens = [
|
|
|
13
11
|
{ title: 'Demo2', type: 'demo2', icon: 'rocket', token: {} },
|
|
14
12
|
];
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
mounted() {
|
|
36
|
-
this.$nextTick(() => document.activeElement.blur());
|
|
37
|
-
},
|
|
38
|
-
template: `
|
|
14
|
+
const generateProps = ({ active = true } = {}) => ({ active });
|
|
15
|
+
|
|
16
|
+
// eslint-disable-next-line no-unused-vars
|
|
17
|
+
export const Default = (_args, { argTypes }) => ({
|
|
18
|
+
props: ['active'],
|
|
19
|
+
components: {
|
|
20
|
+
GlFilteredSearchTerm,
|
|
21
|
+
},
|
|
22
|
+
provide,
|
|
23
|
+
data() {
|
|
24
|
+
return {
|
|
25
|
+
value: { data: 'demo' },
|
|
26
|
+
availableTokens,
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
mounted() {
|
|
30
|
+
this.$nextTick(() => document.activeElement.blur());
|
|
31
|
+
},
|
|
32
|
+
template: `
|
|
39
33
|
<div>
|
|
40
34
|
<div> {{ value.data }} </div>
|
|
41
35
|
<div class="gl-border-1 gl-border-solid gl-border-gray-200">
|
|
@@ -51,4 +45,17 @@ documentedStoriesOf('base/filtered-search/term', readme)
|
|
|
51
45
|
</div>
|
|
52
46
|
</div>
|
|
53
47
|
`,
|
|
54
|
-
|
|
48
|
+
});
|
|
49
|
+
Default.args = generateProps();
|
|
50
|
+
|
|
51
|
+
export default {
|
|
52
|
+
title: 'base/filtered-search/term',
|
|
53
|
+
component: GlFilteredSearchTerm,
|
|
54
|
+
parameters: {
|
|
55
|
+
docs: {
|
|
56
|
+
description: {
|
|
57
|
+
component: readme,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
};
|
|
@@ -4,21 +4,31 @@ import GlFilteredSearchTokenSegment from './filtered_search_token_segment.vue';
|
|
|
4
4
|
import { INTENT_ACTIVATE_PREVIOUS } from './filtered_search_utils';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
+
name: 'GlFilteredSearchTerm',
|
|
7
8
|
components: {
|
|
8
9
|
GlFilteredSearchTokenSegment,
|
|
9
10
|
GlFilteredSearchSuggestion,
|
|
10
11
|
},
|
|
11
12
|
inheritAttrs: false,
|
|
12
13
|
props: {
|
|
14
|
+
/**
|
|
15
|
+
* Tokens available for this filtered search instance.
|
|
16
|
+
*/
|
|
13
17
|
availableTokens: {
|
|
14
18
|
type: Array,
|
|
15
19
|
required: true,
|
|
16
20
|
},
|
|
21
|
+
/**
|
|
22
|
+
* Determines if the term is being edited or not.
|
|
23
|
+
*/
|
|
17
24
|
active: {
|
|
18
25
|
type: Boolean,
|
|
19
26
|
required: false,
|
|
20
27
|
default: false,
|
|
21
28
|
},
|
|
29
|
+
/**
|
|
30
|
+
* Current term value.
|
|
31
|
+
*/
|
|
22
32
|
value: {
|
|
23
33
|
type: Object,
|
|
24
34
|
required: false,
|
|
@@ -29,16 +39,25 @@ export default {
|
|
|
29
39
|
required: false,
|
|
30
40
|
default: '',
|
|
31
41
|
},
|
|
42
|
+
/**
|
|
43
|
+
* HTML attributes to add to the search input.
|
|
44
|
+
*/
|
|
32
45
|
searchInputAttributes: {
|
|
33
46
|
type: Object,
|
|
34
47
|
required: false,
|
|
35
48
|
default: () => ({}),
|
|
36
49
|
},
|
|
50
|
+
/**
|
|
51
|
+
* If this is the last token.
|
|
52
|
+
*/
|
|
37
53
|
isLastToken: {
|
|
38
54
|
type: Boolean,
|
|
39
55
|
required: false,
|
|
40
56
|
default: false,
|
|
41
57
|
},
|
|
58
|
+
/**
|
|
59
|
+
* The current `value` (tokens) of the ancestor GlFilteredSearch component.
|
|
60
|
+
*/
|
|
42
61
|
currentValue: {
|
|
43
62
|
type: Array,
|
|
44
63
|
required: false,
|
|
@@ -56,12 +75,25 @@ export default {
|
|
|
56
75
|
return this.value.data;
|
|
57
76
|
},
|
|
58
77
|
set(data) {
|
|
78
|
+
/**
|
|
79
|
+
* Emitted when the token changes its value.
|
|
80
|
+
*
|
|
81
|
+
* @event input
|
|
82
|
+
* @type {object} dataObj Object containing the update value.
|
|
83
|
+
*/
|
|
59
84
|
this.$emit('input', { data });
|
|
60
85
|
},
|
|
61
86
|
},
|
|
62
87
|
},
|
|
63
88
|
methods: {
|
|
64
89
|
onBackspace() {
|
|
90
|
+
/**
|
|
91
|
+
* Emitted when token value is empty and backspace is pressed.
|
|
92
|
+
* Includes user intent to activate previous token.
|
|
93
|
+
*
|
|
94
|
+
* @event destroy
|
|
95
|
+
* @type {object} details The user intent
|
|
96
|
+
*/
|
|
65
97
|
this.$emit('destroy', { intent: INTENT_ACTIVATE_PREVIOUS });
|
|
66
98
|
},
|
|
67
99
|
},
|
|
@@ -70,6 +102,28 @@ export default {
|
|
|
70
102
|
|
|
71
103
|
<template>
|
|
72
104
|
<div class="gl-h-auto gl-filtered-search-term">
|
|
105
|
+
<!--
|
|
106
|
+
Emitted when this term token is clicked.
|
|
107
|
+
@event activate
|
|
108
|
+
-->
|
|
109
|
+
<!--
|
|
110
|
+
Emitted when this term token will lose its focus.
|
|
111
|
+
@event deactivate
|
|
112
|
+
-->
|
|
113
|
+
<!--
|
|
114
|
+
Emitted when autocomplete entry is selected.
|
|
115
|
+
@event replace
|
|
116
|
+
@property {object} token Replacement token configuration.
|
|
117
|
+
-->
|
|
118
|
+
<!--
|
|
119
|
+
Emitted when the token is submitted.
|
|
120
|
+
@event submit
|
|
121
|
+
-->
|
|
122
|
+
<!--
|
|
123
|
+
Emitted when Space is pressed in-between term text.
|
|
124
|
+
@event split
|
|
125
|
+
@property {array} newTokens Token configurations
|
|
126
|
+
-->
|
|
73
127
|
<gl-filtered-search-token-segment
|
|
74
128
|
v-model="internalValue"
|
|
75
129
|
class="gl-filtered-search-term-token"
|
|
@@ -2,30 +2,4 @@ import * as description from './filtered_search_token.md';
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
description,
|
|
5
|
-
bootstrapComponent: null,
|
|
6
|
-
propsInfo: {
|
|
7
|
-
title: {
|
|
8
|
-
additionalInfo: 'Token title',
|
|
9
|
-
},
|
|
10
|
-
config: {
|
|
11
|
-
additionalInfo: 'Token configuration with available operators and options',
|
|
12
|
-
},
|
|
13
|
-
active: {
|
|
14
|
-
additionalInfo: 'If this token is currently active',
|
|
15
|
-
},
|
|
16
|
-
value: {
|
|
17
|
-
additionalInfo: 'Current value',
|
|
18
|
-
},
|
|
19
|
-
replace: {
|
|
20
|
-
args: [{ arg: 'token', description: '(Object) Replacement token configuration' }],
|
|
21
|
-
description: 'Emitted when this token is converted to another type',
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
slots: [
|
|
25
|
-
{ name: 'view', description: 'Template for token value in inactive state' },
|
|
26
|
-
{
|
|
27
|
-
name: 'suggestions',
|
|
28
|
-
description: 'Slot for rendering autocomplete suggestions when no options are provided.',
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
5
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# Filtered Search Binary Token
|
|
2
|
-
|
|
3
1
|
Filtered search token is a helper component, intended to
|
|
4
2
|
simplify the creation of filters tokens which consist of a title, operators
|
|
5
3
|
and an editable value with autocomplete. This component abstracts token management
|
|
@@ -11,7 +9,7 @@ This component is not intended to be used outside of the `GlFilteredSearch` comp
|
|
|
11
9
|
|
|
12
10
|
Make sure to pass `$listeners` to `gl-filtered-search-token`, or route events properly:
|
|
13
11
|
|
|
14
|
-
```
|
|
12
|
+
```html
|
|
15
13
|
<gl-filtered-search-token
|
|
16
14
|
title="Confidential"
|
|
17
15
|
:active="active"
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { withKnobs, boolean } from '@storybook/addon-knobs';
|
|
2
1
|
import PortalVue from 'portal-vue';
|
|
3
2
|
import Vue from 'vue';
|
|
4
|
-
import { documentedStoriesOf } from '../../../../documentation/documented_stories';
|
|
5
3
|
import { GlIcon } from '../../../index';
|
|
6
4
|
import { provide } from './common_story_options';
|
|
7
5
|
import GlFilteredSearchSuggestion from './filtered_search_suggestion.vue';
|
|
@@ -10,152 +8,158 @@ import GlFilteredSearchToken from './filtered_search_token.vue';
|
|
|
10
8
|
|
|
11
9
|
Vue.use(PortalVue);
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
const generateProps = ({ active = true } = {}) => ({
|
|
12
|
+
active,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
// eslint-disable-next-line no-unused-vars
|
|
16
|
+
export const Default = (args, { argTypes }) => ({
|
|
17
|
+
components: {
|
|
18
|
+
GlFilteredSearchToken,
|
|
19
|
+
GlFilteredSearchSuggestion,
|
|
20
|
+
GlIcon,
|
|
21
|
+
},
|
|
22
|
+
provide,
|
|
23
|
+
props: ['active'],
|
|
24
|
+
data() {
|
|
25
|
+
return {
|
|
26
|
+
value: { operator: '=', data: 'Yes' },
|
|
27
|
+
config: {
|
|
28
|
+
title: 'Confidential',
|
|
26
29
|
},
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
mounted() {
|
|
33
|
+
this.$nextTick(() => {
|
|
34
|
+
document.activeElement.blur();
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
template: `
|
|
38
|
+
<div>
|
|
39
|
+
<div> {{ value }} </div>
|
|
40
|
+
<div class="gl-border-1 gl-border-solid gl-border-gray-200">
|
|
41
|
+
<gl-filtered-search-token
|
|
42
|
+
v-model="value"
|
|
43
|
+
class="gl-h-full"
|
|
44
|
+
:config="config"
|
|
45
|
+
:active="active"
|
|
46
|
+
>
|
|
47
|
+
<template #suggestions>
|
|
48
|
+
<gl-filtered-search-suggestion value="Yes"><gl-icon name="eye-slash" :size="16"/> Yes</gl-filtered-search-suggestion>
|
|
49
|
+
<gl-filtered-search-suggestion value="No"><gl-icon name="eye" :size="16"/> No</gl-filtered-search-suggestion>
|
|
50
|
+
</template>
|
|
51
|
+
</gl-filtered-search-token>
|
|
52
|
+
</div>
|
|
42
53
|
<div>
|
|
43
|
-
<
|
|
44
|
-
<div class="gl-border-1 gl-border-solid gl-border-gray-200">
|
|
45
|
-
<gl-filtered-search-token
|
|
46
|
-
v-model="value"
|
|
47
|
-
class="gl-h-full"
|
|
48
|
-
:config="config"
|
|
49
|
-
:active="active"
|
|
50
|
-
>
|
|
51
|
-
<template #suggestions>
|
|
52
|
-
<gl-filtered-search-suggestion value="Yes"><gl-icon name="eye-slash" :size="16"/> Yes</gl-filtered-search-suggestion>
|
|
53
|
-
<gl-filtered-search-suggestion value="No"><gl-icon name="eye" :size="16"/> No</gl-filtered-search-suggestion>
|
|
54
|
-
</template>
|
|
55
|
-
</gl-filtered-search-token>
|
|
56
|
-
</div>
|
|
57
|
-
<div>
|
|
58
|
-
<portal-target name="portal" class="gl-relative" />
|
|
59
|
-
</div>
|
|
54
|
+
<portal-target name="portal" class="gl-relative" />
|
|
60
55
|
</div>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
title: 'Confidential',
|
|
80
|
-
},
|
|
56
|
+
</div>
|
|
57
|
+
`,
|
|
58
|
+
});
|
|
59
|
+
Default.args = generateProps();
|
|
60
|
+
|
|
61
|
+
// eslint-disable-next-line no-unused-vars
|
|
62
|
+
export const WithCustomOperatorsOptions = (args, { argTypes }) => ({
|
|
63
|
+
components: {
|
|
64
|
+
GlFilteredSearchToken,
|
|
65
|
+
GlFilteredSearchSuggestion,
|
|
66
|
+
},
|
|
67
|
+
provide,
|
|
68
|
+
props: ['active'],
|
|
69
|
+
data() {
|
|
70
|
+
return {
|
|
71
|
+
value: { operator: '!', data: 'Yes' },
|
|
72
|
+
config: {
|
|
73
|
+
title: 'Confidential',
|
|
81
74
|
operators: [
|
|
82
75
|
{ value: '^', description: 'or' },
|
|
83
76
|
{ value: '!', description: 'is not', default: 'true' },
|
|
84
77
|
],
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
mounted() {
|
|
82
|
+
this.$nextTick(() => {
|
|
83
|
+
document.activeElement.blur();
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
template: `
|
|
87
|
+
<div>
|
|
88
|
+
<div> {{ value }} </div>
|
|
89
|
+
<div class="gl-border-1 gl-border-solid gl-border-gray-200">
|
|
90
|
+
<gl-filtered-search-token
|
|
91
|
+
v-model="value"
|
|
92
|
+
class="gl-h-full"
|
|
93
|
+
:config="config"
|
|
94
|
+
:active="active"
|
|
95
|
+
>
|
|
103
96
|
<template #suggestions>
|
|
104
97
|
<gl-filtered-search-suggestion value="Yes"><gl-icon name="eye-slash" :size="16"/> Yes</gl-filtered-search-suggestion>
|
|
105
98
|
<gl-filtered-search-suggestion value="No"><gl-icon name="eye" :size="16"/> No</gl-filtered-search-suggestion>
|
|
106
99
|
</template>
|
|
107
|
-
</
|
|
108
|
-
<div>
|
|
109
|
-
<portal-target name="portal" class="gl-relative" />
|
|
110
|
-
</div>
|
|
100
|
+
</gl-filtered-search-token>
|
|
111
101
|
</div>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
102
|
+
<div>
|
|
103
|
+
<portal-target name="portal" class="gl-relative" />
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
`,
|
|
107
|
+
});
|
|
108
|
+
WithCustomOperatorsOptions.args = generateProps();
|
|
109
|
+
|
|
110
|
+
// eslint-disable-next-line no-unused-vars
|
|
111
|
+
export const WithStaticOptions = (args, { argTypes }) => ({
|
|
112
|
+
components: {
|
|
113
|
+
GlFilteredSearchToken,
|
|
114
|
+
GlFilteredSearchSuggestion,
|
|
115
|
+
},
|
|
116
|
+
provide,
|
|
117
|
+
props: ['active'],
|
|
118
|
+
data() {
|
|
119
|
+
return {
|
|
120
|
+
value: { operator: '=', data: 'first' },
|
|
121
|
+
config: {
|
|
122
|
+
title: 'Confidential',
|
|
132
123
|
options: [
|
|
133
124
|
{ icon: 'hourglass', title: 'first', value: 'one' },
|
|
134
125
|
{ title: 'second-without-icon', value: 'two' },
|
|
135
126
|
{ icon: 'issues', title: 'third', value: 'three' },
|
|
136
127
|
],
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
mounted() {
|
|
132
|
+
this.$nextTick(() => {
|
|
133
|
+
document.activeElement.blur();
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
template: `
|
|
137
|
+
<div>
|
|
138
|
+
<div> {{ value }} </div>
|
|
139
|
+
<div class="gl-border-1 gl-border-solid gl-border-gray-200">
|
|
140
|
+
<gl-filtered-search-token
|
|
141
|
+
v-model="value"
|
|
142
|
+
class="gl-h-full"
|
|
143
|
+
:config="config"
|
|
144
|
+
:active="active"
|
|
145
|
+
/>
|
|
146
|
+
</div>
|
|
145
147
|
<div>
|
|
146
|
-
<
|
|
147
|
-
<div class="gl-border-1 gl-border-solid gl-border-gray-200">
|
|
148
|
-
<gl-filtered-search-token
|
|
149
|
-
v-model="value"
|
|
150
|
-
class="gl-h-full"
|
|
151
|
-
:config="config"
|
|
152
|
-
:active="active"
|
|
153
|
-
:options="options"
|
|
154
|
-
/>
|
|
155
|
-
</div>
|
|
156
|
-
<div>
|
|
157
|
-
<portal-target name="portal" class="gl-relative" />
|
|
158
|
-
</div>
|
|
148
|
+
<portal-target name="portal" class="gl-relative" />
|
|
159
149
|
</div>
|
|
160
|
-
|
|
161
|
-
|
|
150
|
+
</div>
|
|
151
|
+
`,
|
|
152
|
+
});
|
|
153
|
+
WithStaticOptions.args = generateProps();
|
|
154
|
+
|
|
155
|
+
export default {
|
|
156
|
+
title: 'base/filtered-search/token',
|
|
157
|
+
component: GlFilteredSearchToken,
|
|
158
|
+
parameters: {
|
|
159
|
+
docs: {
|
|
160
|
+
description: {
|
|
161
|
+
component: readme,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
};
|