@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,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
- documentedStoriesOf('base/filtered-search/suggestion-list', readme)
8
- .addDecorator(withKnobs)
9
- .add('default', () => ({
10
- components: { GlFilteredSearchSuggestionList, GlFilteredSearchSuggestion },
11
- data() {
12
- return {
13
- iteration: 1,
14
- items: Array.from({ length: 5 }).map((_, idx) => `item-${idx}-iteration-1`),
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
- provide,
18
- methods: {
19
- change() {
20
- this.iteration += 1;
21
- this.items = Array.from({ length: 3 + Math.floor(Math.random() * 5) }).map(
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,5 +1,3 @@
1
- # Filtered Search Term
2
-
3
1
  The filtered search term is a component for managing "free input" in the filtered search component.
4
2
  It is responsible for autocompleting available tokens and "converting" to a relevant
5
3
  component when an autocomplete item is selected.
@@ -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
- documentedStoriesOf('base/filtered-search/term', readme)
17
- .addDecorator(withKnobs)
18
- .add('default', () => ({
19
- components: {
20
- GlFilteredSearchTerm,
21
- },
22
- provide,
23
- props: {
24
- active: {
25
- type: Boolean,
26
- default: boolean('active', true),
27
- },
28
- },
29
- data() {
30
- return {
31
- value: { data: 'demo' },
32
- availableTokens,
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
- ```js
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
- documentedStoriesOf('base/filtered-search/token', readme)
14
- .addDecorator(withKnobs)
15
- .add('default', () => ({
16
- components: {
17
- GlFilteredSearchToken,
18
- GlFilteredSearchSuggestion,
19
- GlIcon,
20
- },
21
- provide,
22
- props: {
23
- active: {
24
- type: Boolean,
25
- default: boolean('active', true),
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
- data() {
29
- return {
30
- value: { operator: '=', data: 'Yes' },
31
- config: {
32
- title: 'Confidential',
33
- },
34
- };
35
- },
36
- mounted() {
37
- this.$nextTick(() => {
38
- document.activeElement.blur();
39
- });
40
- },
41
- template: `
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
- <div> {{ value }} </div>
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
- .add('with custom operators options', () => ({
64
- components: {
65
- GlFilteredSearchToken,
66
- GlFilteredSearchSuggestion,
67
- },
68
- provide,
69
- props: {
70
- active: {
71
- type: Boolean,
72
- default: boolean('active', true),
73
- },
74
- },
75
- data() {
76
- return {
77
- value: { operator: '=', data: 'Yes' },
78
- config: {
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
- mounted() {
88
- this.$nextTick(() => {
89
- document.activeElement.blur();
90
- });
91
- },
92
- template: `
93
- <div>
94
- <div> {{ value }} </div>
95
- <div class="gl-border-1 gl-border-solid gl-border-gray-200">
96
- <gl-filtered-search-token
97
- v-model="value"
98
- class="gl-h-full"
99
- :config="config"
100
- :active="active"
101
- :operators="operators"
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
- </div>
108
- <div>
109
- <portal-target name="portal" class="gl-relative" />
110
- </div>
100
+ </gl-filtered-search-token>
111
101
  </div>
112
- `,
113
- }))
114
- .add('with static options', () => ({
115
- components: {
116
- GlFilteredSearchToken,
117
- GlFilteredSearchSuggestion,
118
- },
119
- provide,
120
- props: {
121
- active: {
122
- type: Boolean,
123
- default: boolean('active', true),
124
- },
125
- },
126
- data() {
127
- return {
128
- value: { operator: '=', data: 'first' },
129
- config: {
130
- title: 'Confidential',
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
- mounted() {
140
- this.$nextTick(() => {
141
- document.activeElement.blur();
142
- });
143
- },
144
- template: `
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
- <div> {{ value }} </div>
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
+ };