@gitlab/ui 115.11.0 → 117.0.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 (71) hide show
  1. package/dist/components/base/filtered_search/filtered_search_suggestion.js +11 -5
  2. package/dist/components/dashboards/dashboard_layout/grid_layout/grid_layout.js +2 -2
  3. package/dist/components/dashboards/dashboard_panel/dashboard_panel.js +45 -3
  4. package/dist/components/index.js +1 -4
  5. package/dist/index.css +1 -1
  6. package/dist/index.css.map +1 -1
  7. package/dist/tailwind.css +1 -1
  8. package/dist/tailwind.css.map +1 -1
  9. package/dist/tokens/common_story_options.js +1 -6
  10. package/dist/tokens/tokens_story.js +3 -16
  11. package/package.json +5 -5
  12. package/src/components/base/filtered_search/filtered_search_suggestion.vue +32 -14
  13. package/src/components/dashboards/dashboard_layout/grid_layout/grid_layout.vue +2 -2
  14. package/src/components/dashboards/dashboard_panel/dashboard_panel.md +61 -13
  15. package/src/components/dashboards/dashboard_panel/dashboard_panel.vue +46 -3
  16. package/src/components/index.js +1 -4
  17. package/src/scss/components.scss +0 -1
  18. package/src/tokens/common_story_options.js +1 -9
  19. package/src/tokens/tokens_story.vue +2 -22
  20. package/dist/components/base/form/form_checkbox_tree/checkbox_tree_node.js +0 -79
  21. package/dist/components/base/form/form_checkbox_tree/form_checkbox_tree.js +0 -138
  22. package/dist/components/base/form/form_checkbox_tree/models/constants.js +0 -12
  23. package/dist/components/base/form/form_checkbox_tree/models/node.js +0 -51
  24. package/dist/components/base/form/form_checkbox_tree/models/tree.js +0 -200
  25. package/dist/components/base/nav/nav.js +0 -132
  26. package/dist/components/base/nav/nav_item.js +0 -125
  27. package/src/components/base/form/form.md +0 -2
  28. package/src/components/base/form/form_character_count/form_character_count.md +0 -53
  29. package/src/components/base/form/form_checkbox_tree/checkbox_tree_node.vue +0 -58
  30. package/src/components/base/form/form_checkbox_tree/form_checkbox_tree.md +0 -73
  31. package/src/components/base/form/form_checkbox_tree/form_checkbox_tree.vue +0 -116
  32. package/src/components/base/form/form_checkbox_tree/models/constants.js +0 -12
  33. package/src/components/base/form/form_checkbox_tree/models/node.js +0 -48
  34. package/src/components/base/form/form_checkbox_tree/models/tree.js +0 -186
  35. package/src/components/base/form/form_combobox/form_combobox.md +0 -52
  36. package/src/components/base/form/form_date/form_date.md +0 -26
  37. package/src/components/base/form/form_fields/form_fields.md +0 -41
  38. package/src/components/base/form/form_group/form_group.md +0 -1
  39. package/src/components/base/form/form_input_group/form_input_group.md +0 -67
  40. package/src/components/base/form/input_group_text/input_group_text.md +0 -1
  41. package/src/components/base/nav/nav.md +0 -184
  42. package/src/components/base/nav/nav.scss +0 -7
  43. package/src/components/base/nav/nav.vue +0 -70
  44. package/src/components/base/nav/nav_item.vue +0 -109
  45. package/src/components/base/token_selector/token_selector.md +0 -78
  46. package/src/components/charts/bar/bar.md +0 -3
  47. package/src/components/charts/chart/chart.md +0 -19
  48. package/src/components/charts/gauge/gauge.md +0 -8
  49. package/src/components/charts/heatmap/heatmap.md +0 -7
  50. package/src/components/charts/legend/legend.md +0 -16
  51. package/src/components/charts/line/line.md +0 -7
  52. package/src/components/charts/series_label/series_label.md +0 -1
  53. package/src/components/charts/shared/tooltip/tooltip.md +0 -3
  54. package/src/components/charts/single_stat/single_stat.md +0 -8
  55. package/src/components/charts/sparkline/sparkline.md +0 -8
  56. package/src/components/charts/stacked_column/stacked_column.md +0 -10
  57. package/src/components/regions/empty_state/empty_state.md +0 -4
  58. package/src/components/utilities/animated_number/animated_number.md +0 -6
  59. package/src/components/utilities/friendly_wrap/friendly_wrap.md +0 -66
  60. package/src/components/utilities/intersection_observer/intersection_observer.md +0 -16
  61. package/src/components/utilities/intersperse/intersperse.md +0 -90
  62. package/src/components/utilities/sprintf/sprintf.md +0 -243
  63. package/src/components/utilities/truncate/truncate.md +0 -14
  64. package/src/components/utilities/truncate_text/truncate_text.md +0 -26
  65. package/src/directives/hover_load/hover_load.md +0 -22
  66. package/src/directives/outside/outside.md +0 -140
  67. package/src/directives/resize_observer/resize_observer.md +0 -54
  68. package/src/directives/safe_html/safe_html.md +0 -58
  69. package/src/directives/safe_link/safe_link.md +0 -37
  70. package/src/internal/color_contrast/color_contrast.md +0 -8
  71. package/src/internal/color_contrast/color_contrast.vue +0 -52
@@ -1,52 +0,0 @@
1
- Use this component to add a [`FormInput`](/?path=/story/base-form-form-input--default) component
2
- with synchronous autocomplete dropdown. It behaves as follows:
3
-
4
- - Typing matches tokens; dropdown disappears when there is no match
5
- - Up and down arrows navigate the dropdown
6
- - Enter selects keyboard-highlighted item; clicking overrides this
7
- - Esc closes dropdown when it is open, clears field when it is not
8
- - Browser/native autocomplete dropdown hidden when ours is open, shows when it is not
9
- - Tab selects current entered text and moves to next field
10
-
11
- This behavior based on
12
- [this w3c pattern](https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html)
13
- and [this accessible combobox example](https://alligator.io/vuejs/vue-a11y-autocomplete/).
14
-
15
- ## Usage
16
-
17
- The combobox accepts an array of string tokens, a `v-model`, and label text. Internally, it generates
18
- unique element IDs so multiple can be used on one page without clashing.
19
-
20
- On selection it sets the input value to the selected string and emits a `value-selected` event for
21
- consumption by parent components.
22
-
23
- ```html
24
- <gl-form-combobox
25
- v-model="inputVal"
26
- :token-list="tokens"
27
- label-text="Combobox Label"
28
- />
29
- ```
30
-
31
- It does not have a loading state nor does it accept tokens other than strings. It allows for one
32
- selected value.
33
-
34
- ### What if I need to load the options asynchronously?
35
-
36
- You may want to look at [`GlSearchBoxByType`] or [`GlSearchBoxByClick`].
37
-
38
- ### What if I need multiple options?
39
-
40
- The [`GlTokenSelector`] may be what you need. Alternately, [`GlFilteredSearch`] will let you search
41
- and include tokens.
42
-
43
- ## Edge cases
44
-
45
- The algorithm to match tokens with the input is very naive. If you need to use the component with a
46
- very large list of matches, you may want to update the implementation or use one of the search
47
- inputs, like [`GlSearchBoxByType`], [`GlSearchBoxByClick`], or [`GlFilteredSearch`].
48
-
49
- [`GlSearchBoxByType`]: https://design.gitlab.com/storybook?path=/story/base-search-box-by-type--default
50
- [`GlSearchBoxByClick`]: https://design.gitlab.com/storybook?path=/story/base-search-box-by-click--default
51
- [`GlTokenSelector`]: https://design.gitlab.com/storybook?path=/story/base-token-selector--default
52
- [`GlFilteredSearch`]: https://design.gitlab.com/storybook?path=/story/base-filtered-search--default
@@ -1,26 +0,0 @@
1
- `GlFormDate` allows users to choose and input a date using a keyboard by by using
2
- browser implemented calendar controls, where available.
3
-
4
- `GlFormDate` extends `<input type="date">` with an `<output>` for audible announcement
5
- of selected date, in full format, by screen-readers.
6
-
7
- ## Usage
8
-
9
- On `change` the value is emitted in `YYYY-MM-DD` format.
10
-
11
- ## Accessibility
12
-
13
- `GlFormDate` is a form `<input>` and should have an accessible name using a `<label>`.
14
-
15
- `GlFormGroup` can be used to label `GlFormDate`.
16
-
17
- ```html
18
- <gl-form-group
19
- label="Enter date"
20
- label-for="input-id"
21
- >
22
- <gl-form-date
23
- id="input-id"
24
- />
25
- </gl-form-group>
26
- ```
@@ -1,41 +0,0 @@
1
- ## Usage
2
-
3
- `GlFormFields` provides form builder functionality for ease of building simple
4
- forms out of other GitLab UI form components.
5
-
6
- For a code example, look at the story. It covers usage of `mapValue`, `validators`,
7
- custom form elements, and `inputAttrs`.
8
-
9
- ## Fields type
10
-
11
- Each value of `fields` prop is expected to be a `FieldDefinition`. See below for the shape of this type:
12
-
13
- ```ts
14
- interface FieldDefinition<TValue> {
15
- // Label text to show for this field.
16
- label: string;
17
-
18
- // Collection of validator functions
19
- validators?: Array<(value: TValue) => string | undefined>;
20
-
21
- // Function that maps the inputted string value to the field's actual value
22
- // (e.g. a Number).
23
- mapValue?: (input: string) => TValue;
24
-
25
- // Properties that are passed to the actual input for this field.
26
- inputAttrs?: {};
27
-
28
- // Properties that are passed to the group wrapping this field.
29
- groupAttrs?: {};
30
- }
31
- ```
32
-
33
- ## Slots
34
-
35
- | Name | Description |
36
- | ------ | ------ |
37
- | `input(<fieldName>)` | Used to render components other than `GlFormInput`. |
38
- | `group(<fieldName>)-label` | Used for `label` slot on `GlFormGroup` of a specific field. |
39
- | `group(<fieldName>)-description` | Used for `description` slot on `GlFormGroup` of a specific field. |
40
- | `group(<fieldName>)-label-description` | Used for `label-description` slot on `GlFormGroup` of a specific field. |
41
- | `after(<fieldName>)` | Used to render content after `GlFormGroup` of a specific field. |
@@ -1 +0,0 @@
1
- Form group adds structure to forms.
@@ -1,67 +0,0 @@
1
- The `GlFormInputGroup` component allows one to build more advanced text
2
- input fields than generic `GlFormInput` when one needs that flexibility.
3
- Basic usage of the component:
4
-
5
- ```html
6
- <div>
7
- <gl-form-input-group>
8
- <template #prepend>
9
- <!-- Content to prepend your text input field -->
10
- </template>
11
- <template #append>
12
- <!-- Content to append your text input field -->
13
- </template>
14
- </gl-form-input-group>
15
- </div>
16
- ```
17
-
18
- One can use any other component (custom or `<gl-*>`) in both slots or
19
- not to use the slots at all. In the latter, the component will fallback
20
- to simple `GlFormInput`.
21
-
22
- ## Predefined options
23
-
24
- Sometimes custom text input from the user isn't desired. Instead, the
25
- user should pick one of the predefined options that will automatically
26
- populate the input field. Typically, such cases will also include an
27
- actionable button (like **Copy**) put into the `append` slot.
28
-
29
- To achieve this effect, the `GlFormInputGroup` component accepts an
30
- array of options in the form of `predefinedOptions` param. For example:
31
-
32
- ```javascript
33
- const optionValues = [
34
- { name: 'Option #1', value: 'Option #1 is selected!' },
35
- { name: 'Option #2', value: 'Option #2 is selected!' },
36
- ];
37
- ...
38
- <gl-form-input-group :predefined-options="optionValues" />
39
- ```
40
-
41
- This will tell `GlFormInputGroup` to render a dropdown in the `prepend`
42
- slot with all of the supplied options' `name`s. When one of the options
43
- is selected, the input field is automatically populated with the
44
- option's `value`. Check the "Examples" section below for "With
45
- predefined options" example.
46
-
47
- ### Pro tips
48
-
49
- Read some useful tips below about specific usage of the component.
50
-
51
- ### Readonly input
52
-
53
- Often you want to make sure user doesn't mess up the predefined content
54
- pasted into the input field. In this case, you can set `readonly`
55
- param to `true`. You can play with `Readonly` knob on the right.
56
-
57
- ### Preselect the text to copy
58
-
59
- If you set the `readonly` param on the `GlFormInputGroup` component,
60
- users will still be able to manually select the text and copy it.
61
- However, it's more user-friendly to preselect the text for the users if
62
- they click anywhere in the input field. This can be achieved by setting
63
- the `select-on-click` param to `true`. You can play with
64
- `Select text on click` knob on the right. Even better, try enabling
65
- `Readonly`, `Select text on click`, and `Switch to predefined input`
66
- altogether. And, probably, remove `Prepend text`. Or leave it. It's your
67
- call. :)
@@ -1 +0,0 @@
1
- GlInputGroupText components are used to add text to an input group.
@@ -1,184 +0,0 @@
1
- ## Overview
2
-
3
- The base `<gl-nav>` component is built with flexbox and provides a strong foundation for building all
4
- types of navigation components. It includes some style overrides (for working with lists), some link
5
- padding for larger hit areas, and basic disabled styling. No active states are included in the base
6
- nav.
7
-
8
- `<gl-nav>` supports the `<gl-nav-item>` child component for actionable links (or router-links).
9
-
10
- ## Link appearance
11
-
12
- Two style variations are supported: `tabs` and `pills`, which support `active` state styling. These
13
- variants are mutually exclusive - use only one style or the other.
14
-
15
- ### Tab style
16
-
17
- Make the nav look like tabs by setting the `tabs` prop.
18
-
19
- ```html
20
- <div>
21
- <gl-nav tabs>
22
- <gl-nav-item active>Active</gl-nav-item>
23
- <gl-nav-item>Link</gl-nav-item>
24
- <gl-nav-item>Another Link</gl-nav-item>
25
- <gl-nav-item disabled>Disabled</gl-nav-item>
26
- </gl-nav>
27
- </div>
28
- ```
29
-
30
- ### Pill style
31
-
32
- Use the pill style by setting the `pills` prop.
33
-
34
- ```html
35
- <div>
36
- <gl-nav pills>
37
- <gl-nav-item active>Active</gl-nav-item>
38
- <gl-nav-item>Link</gl-nav-item>
39
- <gl-nav-item>Another Link</gl-nav-item>
40
- <gl-nav-item disabled>Disabled</gl-nav-item>
41
- </gl-nav>
42
- </div>
43
- ```
44
-
45
- ### Small
46
-
47
- Make the nav smaller by setting the `small` prop.
48
-
49
- ```html
50
- <div>
51
- <gl-nav small>
52
- <gl-nav-item active>Active</gl-nav-item>
53
- <gl-nav-item>Link</gl-nav-item>
54
- <gl-nav-item>Another Link</gl-nav-item>
55
- <gl-nav-item disabled>Disabled</gl-nav-item>
56
- </gl-nav>
57
- </div>
58
- ```
59
-
60
- ## Fill and justify
61
-
62
- Force your `<gl-nav>` content to extend the full available width.
63
-
64
- ### Fill
65
-
66
- To proportionately fill all available space with your `<gl-nav-item>` components, set the `fill`
67
- prop. Notice that all horizontal space is occupied, but not every nav item has the same width.
68
-
69
- ```html
70
- <div>
71
- <gl-nav tabs fill>
72
- <gl-nav-item active>Active</gl-nav-item>
73
- <gl-nav-item>Link</gl-nav-item>
74
- <gl-nav-item>Link with a long name </gl-nav-item>
75
- <gl-nav-item disabled>Disabled</gl-nav-item>
76
- </gl-nav>
77
- </div>
78
- ```
79
-
80
- ### Justified
81
-
82
- For equal-width elements, set the `justified` prop instead. All horizontal space will be occupied by
83
- nav links, but unlike `fill` above, every `<gl-nav-item>` will be the same width.
84
-
85
- ```html
86
- <div>
87
- <gl-nav tabs justified>
88
- <gl-nav-item active>Active</gl-nav-item>
89
- <gl-nav-item>Link</gl-nav-item>
90
- <gl-nav-item>Link with a long name </gl-nav-item>
91
- <gl-nav-item disabled>Disabled</gl-nav-item>
92
- </gl-nav>
93
- </div>
94
- ```
95
-
96
- ## Alignment
97
-
98
- To align your `<gl-nav-item>` components, use the `align` prop. Available values are `left`, `center`
99
- and `right`.
100
-
101
- ```html
102
- <div>
103
- <gl-nav tabs align="center">
104
- <gl-nav-item active>Active</gl-nav-item>
105
- <gl-nav-item>Link</gl-nav-item>
106
- <gl-nav-item>Link with a long name </gl-nav-item>
107
- <gl-nav-item disabled>Disabled</gl-nav-item>
108
- </gl-nav>
109
- </div>
110
- ```
111
-
112
- ## Tabbed local content support
113
-
114
- See the [`<gl-tabs>`](?path=/docs/base-tabs--docs) component for creating tabbable panes of local
115
- content (not suited for navigation).
116
-
117
- ## Card integration
118
-
119
- Use a `<gl-nav>` in a [`<gl-card>`](?path=/docs/base-card--docs) header, by enabling the
120
- `card-header` prop on `<gl-nav>` and setting either the `pills` or `tabs` props:
121
-
122
- ```html
123
- <div>
124
- <gl-card title="Card Title">
125
- <template #header>
126
- <gl-nav card-header tabs>
127
- <gl-nav-item active>Active</gl-nav-item>
128
- <gl-nav-item>Inactive</gl-nav-item>
129
- </gl-nav>
130
- </template>
131
-
132
- <template #default>
133
- <p>With supporting text below as a natural lead-in to additional content.</p>
134
- <gl-button variant="primary">Go somewhere</gl-button>
135
- </template>
136
- </gl-card>
137
- </div>
138
- ```
139
-
140
- **Plain style:**
141
-
142
- The `card-header` prop is only needed when you are applying `tabs` or `pills` style. Note that
143
- we do not have special styling for `active` state plain style nav items.
144
-
145
- ```html
146
- <div>
147
- <gl-card title="Card Title">
148
- <template #header>
149
- <gl-nav>
150
- <gl-nav-item active>Active</gl-nav-item>
151
- <gl-nav-item>Inactive</gl-nav-item>
152
- </gl-nav>
153
- </template>
154
-
155
- <template #default>
156
- <p>pWith supporting text below as a natural lead-in to additional content.</p>
157
- <gl-button variant="primary">Go somewhere</gl-button>
158
- </template>
159
- </gl-card>
160
- </div>
161
- ```
162
-
163
- ## Accessibility
164
-
165
- If you're using `<gl-nav>` to provide a navigation bar, be sure to add a `role="navigation"` to the
166
- most logical parent container of `<gl-nav>`, or wrap a `<nav>` element around `<gl-nav>`. Do **not**
167
- add the role to the `<gl-nav>` itself, as this would prevent it from being announced as an actual
168
- list by assistive technologies.
169
-
170
- ### Tabbed interface accessibility
171
-
172
- Note that navigation bars, even if visually styled as tabs, should **not** be given
173
- `role="tablist"`, `role="tab"` or `role="tabpanel"` attributes. These are only appropriate for
174
- [tabbed interfaces](?path=/docs/base-tabs--docs) that do not change the URL or `$route`, as
175
- described in the [WAI ARIA Authoring Practices](https://www.w3.org/TR/wai-aria-practices/#tabpanel).
176
- See [`<gl-tabs>`](?path=/docs/base-tabs--docs) for dynamic tabbed interfaces that are compliant with
177
- WAI ARIA.
178
-
179
- ## See also
180
-
181
- - [tabs](?path=/docs/base-tabs--docs) to create tabbable panes of local content, even via dropdown
182
- menus.
183
- - [Router Link Support reference](?path=/docs/base-link--docs#router-link-support) for information
184
- about router-link specific props available on `<gl-nav-item>`
@@ -1,7 +0,0 @@
1
- .nav {
2
- &-link {
3
- &:focus-visible {
4
- @apply gl-focus;
5
- }
6
- }
7
- }
@@ -1,70 +0,0 @@
1
- <script>
2
- export default {
3
- name: 'GlNav',
4
- props: {
5
- /**
6
- * Align the nav items in the nav: 'start' (or 'left'), 'center', 'end' (or 'right')
7
- */
8
- align: { type: String, required: false, default: '' },
9
- /**
10
- * Set this prop when the nav is placed inside a card header
11
- */
12
- cardHeader: { type: Boolean, required: false, default: false },
13
- /**
14
- * Proportionately fills all horizontal space with nav items.
15
- * All horizontal space is occupied, but not every nav item has the same width
16
- */
17
- fill: { type: Boolean, required: false, default: false },
18
- /**
19
- * Fills all horizontal space with nav items, but unlike 'fill', every nav item will be the same width
20
- */
21
- justified: { type: Boolean, required: false, default: false },
22
- /**
23
- * Renders the nav items with the appearance of pill buttons
24
- */
25
- pills: { type: Boolean, required: false, default: false },
26
- /**
27
- * Makes the nav smaller
28
- */
29
- small: { type: Boolean, required: false, default: false },
30
- /**
31
- * Renders the nav items with the appearance of tabs
32
- */
33
- tabs: { type: Boolean, required: false, default: false },
34
- /**
35
- * Specify the HTML tag to render instead of the default tag
36
- */
37
- tag: { type: String, required: false, default: 'ul' },
38
- },
39
- computed: {
40
- justifyContent() {
41
- if (!this.align) return '';
42
-
43
- const alignMapping = {
44
- left: 'start',
45
- right: 'end',
46
- };
47
-
48
- return `justify-content-${alignMapping[this.align] || this.align}`;
49
- },
50
- classes() {
51
- return {
52
- 'nav-tabs': this.tabs,
53
- 'nav-pills': this.pills && !this.tabs,
54
- 'card-header-tabs': this.cardHeader && this.tabs,
55
- 'card-header-pills': this.cardHeader && this.pills && !this.tabs,
56
- 'nav-fill': this.fill,
57
- 'nav-justified': this.justified,
58
- [this.justifyContent]: this.align,
59
- small: this.small,
60
- };
61
- },
62
- },
63
- };
64
- </script>
65
-
66
- <template>
67
- <component :is="tag" class="nav" :class="classes" v-on="$listeners">
68
- <slot></slot>
69
- </component>
70
- </template>
@@ -1,109 +0,0 @@
1
- <script>
2
- import GlLink from '../link/link.vue';
3
-
4
- export default {
5
- name: 'GlNavItem',
6
- components: {
7
- GlLink,
8
- },
9
- props: {
10
- /**
11
- * When set to `true`, places the component in the active state with active styling
12
- */
13
- active: {
14
- type: Boolean,
15
- required: false,
16
- default: false,
17
- },
18
- /**
19
- * When set to `true`, disables the component's functionality and places it in a disabled state.
20
- */
21
- disabled: {
22
- type: Boolean,
23
- required: false,
24
- default: false,
25
- },
26
- /**
27
- * Denotes the target URL of the link for standard links.
28
- */
29
- href: {
30
- type: String,
31
- required: false,
32
- default: undefined,
33
- },
34
- /**
35
- * <router-link> prop: Denotes the target route of the link.
36
- * When clicked, the value of the to prop will be passed to `router.push()` internally,
37
- * so the value can be either a string or a Location descriptor object.
38
- */
39
- to: {
40
- type: [Object, String],
41
- required: false,
42
- default: undefined,
43
- },
44
- /**
45
- * <router-link> prop: Configure the active CSS class applied when the link is active.
46
- */
47
- activeClass: {
48
- type: String,
49
- required: false,
50
- default: undefined,
51
- },
52
- /**
53
- * <router-link> prop: Configure the active CSS class applied when the link is active with exact match.
54
- */
55
- exactActiveClass: {
56
- type: String,
57
- required: false,
58
- default: undefined,
59
- },
60
- /**
61
- * Attributes for the link element
62
- */
63
- linkAttrs: {
64
- type: Object,
65
- required: false,
66
- default: null,
67
- },
68
- /**
69
- * Classes for the link element
70
- */
71
- linkClasses: {
72
- type: Array,
73
- required: false,
74
- default: () => [],
75
- },
76
- },
77
- computed: {
78
- computedLinkClasses() {
79
- const classes = this.linkClasses;
80
-
81
- // the `unstyled` link variant does not do this by itself
82
- if (this.disabled) classes.push('disabled');
83
- if (this.active) classes.push('active');
84
-
85
- return classes;
86
- },
87
- },
88
- };
89
- </script>
90
-
91
- <template>
92
- <li class="nav-item">
93
- <gl-link
94
- class="nav-link"
95
- variant="unstyled"
96
- :active="active"
97
- :class="computedLinkClasses"
98
- :disabled="disabled"
99
- :href="href"
100
- :to="to"
101
- :active-class="activeClass"
102
- :exact-active-class="exactActiveClass"
103
- v-bind="linkAttrs"
104
- v-on="$listeners"
105
- >
106
- <slot></slot>
107
- </gl-link>
108
- </li>
109
- </template>
@@ -1,78 +0,0 @@
1
- Choose from a provided list of tokens or add a user defined token.
2
-
3
- ```html
4
- <script>
5
- export default {
6
- data() {
7
- return {
8
- selectedTokens: [
9
- {
10
- id: 1,
11
- name: 'Vue.js',
12
- },
13
- ],
14
- };
15
- },
16
- };
17
- </script>
18
-
19
- <template>
20
- <div>
21
- <gl-token-selector
22
- v-model="selectedTokens"
23
- :dropdown-items="[
24
- {
25
- id: 1,
26
- name: 'Vue.js',
27
- },
28
- {
29
- id: 2,
30
- name: 'Ruby On Rails',
31
- },
32
- {
33
- id: 3,
34
- name: 'GraphQL',
35
- },
36
- {
37
- id: 4,
38
- name: 'Redis',
39
- },
40
- ]"
41
- />
42
- {{ selectedTokens }}
43
- </div>
44
- </template>
45
- ```
46
-
47
- ## User created tokens
48
-
49
- This component allows for users to create their own tokens when configured to do so.
50
- There are two props that support this functionality: `allowUserDefinedTokens` and `showAddNewAlways`.
51
-
52
- `allowUserDefinedTokens` is required to enable the functionality
53
-
54
- When set to `true` and a user's search text returns nothing,
55
- they will be presented with an additional dropdown item `Add ...`
56
- that takes their current search input and emits `@input`.
57
- The parent component can then handle the event accordingly.
58
-
59
- Additionally, there are scenarios where the user may want the ability to add a new token
60
- even if some search results are returned. This functionality can be enabled by additionally
61
- setting `showAddNewAlways` to `true`.
62
- This will allow for the `Add ...` dropdown item to appear at all times
63
- whenever a user has inputted text, regardless if results are found.
64
-
65
- ```html
66
- <template>
67
- <div>
68
- <gl-token-selector
69
- v-model="selectedTokens"
70
- :dropdown-items="dropdownItems"
71
- allow-user-defined-items
72
- show-ad-new-always
73
- @input="onTokenUpdate"
74
- />
75
- {{ selectedTokens }}
76
- </div>
77
- </template>
78
- ```
@@ -1,3 +0,0 @@
1
- A bar chart is similar to a column chart where the the length of bars represents the data value.
2
- Although alike, they are cannot be interchangeably used. Bar charts are good for displaying large
3
- number of categories on the y-axis.
@@ -1,19 +0,0 @@
1
- ### ECharts Wrapper
2
-
3
- The chart component is a Vue component wrapper around [Apache ECharts](https://echarts.apache.org/en/api.html#echarts).
4
- The chart component accepts width and height props in order to allow the user to make it responsive.
5
-
6
- > Note: When implementing a chart type that does not already have a GitLab UI component, you can use
7
- > this component alonside the [ECharts options](https://echarts.apache.org/en/api.html#echarts) to
8
- > build your chart. Each type of chart should still follow the general guidelines in the
9
- > [pajamas documentation](https://design.gitlab.com/data-visualization/charts).
10
-
11
- ### EChart Lifecycle
12
-
13
- This component emits the following events during the ECharts lifecycle:
14
-
15
- - `created`: emitted after calling `echarts.init`
16
- - `updated`: emitted after calling `echarts.setOption`
17
-
18
- In all cases, the event payload is the
19
- [echart instance](https://echarts.apache.org/en/api.html#echartsInstance).
@@ -1,8 +0,0 @@
1
- Some layout problems can be encountered with this component. Specifically, when the gauge chart's
2
- axis labels or detail text have larger widths, they can overlap with the chart elements.
3
-
4
- Also, when the containing element of the gauge chart has either of a small calculated `width` and
5
- `height`, its axis width could become bulkier in relation to other chart elements. This is because
6
- at this time [eCharts only allows for setting the axis line width in absolute units](https://echarts.apache.org/en/option.html#series-gauge.axisLine.lineStyle.width).
7
-
8
- This issue is to be addressed by [https://gitlab.com/gitlab-org/gitlab-ui/-/issues/916](https://gitlab.com/gitlab-org/gitlab-ui/-/issues/916).
@@ -1,7 +0,0 @@
1
- ## Heatmaps
2
-
3
- **Note** This component uses `<gl-legend>`, which should allow a user to click on any data point(s)
4
- in the legend and make the corresponding data point(s) on the chart rendered disappear.
5
- _See [area chart](https://design.gitlab.com/storybook?path=/story/charts-area-chart--default)
6
- for an example_ For this particular chart, there is a [known issue](https://gitlab.com/gitlab-org/gitlab-ui/issues/352)
7
- with the functionality of the legend, where clicking on it does nothing.