@gitlab/ui 115.9.0 → 115.9.1
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/dist/components/base/avatar_link/avatar_link.js +1 -1
- package/dist/components/base/avatars_inline/avatars_inline.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/package.json +10 -10
- package/src/components/base/avatar_link/avatar_link.vue +1 -1
- package/src/components/base/avatars_inline/avatars_inline.vue +1 -1
- package/src/components/base/markdown/markdown_typescale_demo.html +41 -71
- package/src/scss/variables.scss +1 -1
- package/src/components/base/accordion/accordion.md +0 -3
- package/src/components/base/accordion/accordion_item.md +0 -3
- package/src/components/base/alert/alert.md +0 -35
- package/src/components/base/animated_icon/animated_icon.md +0 -4
- package/src/components/base/avatar/avatar.md +0 -1
- package/src/components/base/avatar_labeled/avatar_labeled.md +0 -20
- package/src/components/base/avatar_link/avatar_link.md +0 -33
- package/src/components/base/avatars_inline/avatars_inline.md +0 -38
- package/src/components/base/badge/badge.md +0 -30
- package/src/components/base/banner/banner.md +0 -35
- package/src/components/base/breadcrumb/breadcrumb.md +0 -52
- package/src/components/base/broadcast_message/broadcast_message.md +0 -25
- package/src/components/base/button/button.md +0 -119
- package/src/components/base/button_group/button_group.md +0 -44
- package/src/components/base/card/card.md +0 -4
- package/src/components/base/collapse/collapse.md +0 -64
- package/src/components/base/datepicker/datepicker.md +0 -8
- package/src/components/base/daterange_picker/daterange_picker.md +0 -32
- package/src/components/base/drawer/drawer.md +0 -17
- package/src/components/base/dropdown/dropdown.md +0 -72
- package/src/components/base/dropdown/dropdown_item.md +0 -2
- package/src/components/base/dropdown/dropdown_section_header.md +0 -7
- package/src/components/base/dropdown/dropdown_text.md +0 -7
- package/src/components/base/filtered_search/filtered_search.md +0 -76
- package/src/components/base/filtered_search/filtered_search_suggestion.md +0 -15
- package/src/components/base/filtered_search/filtered_search_suggestion_list.md +0 -13
- package/src/components/base/filtered_search/filtered_search_term.md +0 -7
- package/src/components/base/filtered_search/filtered_search_token.md +0 -23
- package/src/components/base/filtered_search/filtered_search_token_segment.md +0 -14
- package/src/components/base/form/form_checkbox/form_checkbox.md +0 -6
- package/src/components/base/form/form_input/form_input.md +0 -306
- package/src/components/base/form/form_radio/form_radio.md +0 -23
- package/src/components/base/form/form_radio_group/form_radio_group.md +0 -63
- package/src/components/base/form/form_select/form_select.md +0 -1
- package/src/components/base/form/form_textarea/form_textarea.md +0 -3
- package/src/components/base/icon/icon.md +0 -27
- package/src/components/base/infinite_scroll/infinite_scroll.md +0 -104
- package/src/components/base/keyset_pagination/keyset_pagination.md +0 -49
- package/src/components/base/label/label.md +0 -15
- package/src/components/base/link/link.md +0 -187
- package/src/components/base/loading_icon/loading_icon.md +0 -3
- package/src/components/base/modal/modal.md +0 -30
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.md +0 -184
- package/src/components/base/new_dropdowns/listbox/listbox.md +0 -195
- package/src/components/base/pagination/pagination.md +0 -45
- package/src/components/base/path/path.md +0 -41
- package/src/components/base/progress_bar/progress_bar.md +0 -25
- package/src/components/base/search_box_by_click/search_box_by_click.md +0 -1
- package/src/components/base/search_box_by_type/search_box_by_type.md +0 -1
- package/src/components/base/segmented_control/segmented_control.md +0 -26
- package/src/components/base/skeleton_loader/skeleton_loader.md +0 -70
- package/src/components/base/sorting/sorting.md +0 -80
- package/src/components/base/table/table.md +0 -71
- package/src/components/base/table_lite/table_lite.md +0 -68
- package/src/components/base/tabs/tabs/tabs.md +0 -80
- package/src/components/base/toast/toast.md +0 -48
- package/src/components/base/toggle/toggle.md +0 -4
- package/src/components/base/token/token.md +0 -12
- package/src/components/base/tooltip/tooltip.md +0 -52
- package/src/scss/typescale/typeface_demo.html +0 -70
- package/src/scss/typescale/typescale.md +0 -81
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
## Usage
|
|
2
|
-
|
|
3
|
-
The `GlBreadcrumb` component comes with a smart auto-resize feature. When there is not enough space
|
|
4
|
-
to show all breadcrumb `items` in a single row, the component moves items into an ellipsis dropdown,
|
|
5
|
-
starting with the first one. The last breadcrumb item (which represents the current page) stays
|
|
6
|
-
always visible.
|
|
7
|
-
|
|
8
|
-
### Auto-resize
|
|
9
|
-
|
|
10
|
-
**Important:** For the auto-resize to function correctly it is necessary that the `GlBreadcrumb`
|
|
11
|
-
component itself takes all the horizontal space it can get. How to do this depends on the
|
|
12
|
-
CSS `display` mode (block, flex, grid) of its parent element.
|
|
13
|
-
|
|
14
|
-
**Example:** In a flexbox layout, allow the component to `flex-grow`:
|
|
15
|
-
|
|
16
|
-
```js
|
|
17
|
-
<gl-breadcrumb class="gl-grow" :items="items" />
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
### `items` prop
|
|
21
|
-
|
|
22
|
-
This component also allows for optional avatars on each item.
|
|
23
|
-
|
|
24
|
-
`avatarPath` should passed along with `text` and `href` in `items`.
|
|
25
|
-
Here is an example of how an item with an avatar should look:
|
|
26
|
-
|
|
27
|
-
**note:** the component supports passing the property `to` in the list items to enable navigation
|
|
28
|
-
through `vue-router`
|
|
29
|
-
|
|
30
|
-
#### Example
|
|
31
|
-
|
|
32
|
-
```js
|
|
33
|
-
items = [
|
|
34
|
-
{
|
|
35
|
-
text: 'First item',
|
|
36
|
-
href: '#',
|
|
37
|
-
avatarPath: '/avatar.png',
|
|
38
|
-
},
|
|
39
|
-
];
|
|
40
|
-
|
|
41
|
-
<gl-breadcrumb :items="items" />
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### `size` prop
|
|
45
|
-
|
|
46
|
-
The size prop determines the size of the breadcrumb component. It accepts the following values:
|
|
47
|
-
|
|
48
|
-
"sm" (default): Small size
|
|
49
|
-
"md": Medium size
|
|
50
|
-
|
|
51
|
-
Using the default 'sm' size for all page breadcrumbs is considered a best practice
|
|
52
|
-
to ensure consistency across the application.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
Broadcast messages provide an efficient and prominent way to deliver critical messages at the
|
|
2
|
-
instance level to all users. For example, a broadcast message can be used when an admin wants to
|
|
3
|
-
announce that their platform will experience downtime during a specific period.
|
|
4
|
-
|
|
5
|
-
In comparison with an alert, broadcast messages are created by an admin and not triggered by the
|
|
6
|
-
system.
|
|
7
|
-
|
|
8
|
-
Please refer to [Pajamas' documentation](https://design.gitlab.com/components/broadcast-message)
|
|
9
|
-
for more information on when to use this component.
|
|
10
|
-
|
|
11
|
-
## Dismiss a broadcast message
|
|
12
|
-
|
|
13
|
-
The `GlBroadcastMessage` component deals with users dismissal the same way `GlAlert` does, meaning
|
|
14
|
-
it does not handle its own visibility but emits a `dismiss` event that the parent component should
|
|
15
|
-
listen to in order to hide the message. Example:
|
|
16
|
-
|
|
17
|
-
```html
|
|
18
|
-
<template>
|
|
19
|
-
...
|
|
20
|
-
<gl-broadcast-message v-if="!dismissed" @dismiss="dismissed = true">
|
|
21
|
-
An important message
|
|
22
|
-
</gl-broadcast-message>
|
|
23
|
-
...
|
|
24
|
-
</template>
|
|
25
|
-
```
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
Buttons execute an action, either in the background or foreground of an experience. Different button
|
|
2
|
-
categories help guide users through certain actions. Buttons express what action will occur when the
|
|
3
|
-
user clicks or touches it either by text, icon, or both. Additional meaning can be derived from the
|
|
4
|
-
button variant.
|
|
5
|
-
|
|
6
|
-
## Button link
|
|
7
|
-
|
|
8
|
-
A button link is a link that is styled to look like a button, semantically speaking it's a `<a>` tag
|
|
9
|
-
with the necessary classes added to make it look like a button, it shares the same functionality as
|
|
10
|
-
[<gl-link>](?path=/docs/base-link--docs)
|
|
11
|
-
|
|
12
|
-
> Note: Setting a `target` attribute without a `href` attribute, will not create any side effects.
|
|
13
|
-
> Without the presence of a `href` attribute, this component will render a `<button>`.
|
|
14
|
-
|
|
15
|
-
## Icon-only button
|
|
16
|
-
|
|
17
|
-
Icon-only buttons must have an accessible name.
|
|
18
|
-
You can provide one with the `aria-label` attribute, which is read out by screen readers.
|
|
19
|
-
|
|
20
|
-
```html
|
|
21
|
-
<gl-button icon="close" aria-label="Close" />
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Type
|
|
25
|
-
|
|
26
|
-
You can specify the button's type by setting the prop `type` to `button`, `submit` or `reset`.
|
|
27
|
-
The default type is `button`.
|
|
28
|
-
|
|
29
|
-
Note the `type` prop has no effect when either `href` or `to` props are set.
|
|
30
|
-
|
|
31
|
-
## Sizing
|
|
32
|
-
|
|
33
|
-
Specify `small` or `medium` via the `size` prop. Defaults to `medium`.
|
|
34
|
-
|
|
35
|
-
```html
|
|
36
|
-
<gl-button size="small">Small Button</gl-button>
|
|
37
|
-
<gl-button>Default Button (medium)</gl-button>
|
|
38
|
-
<gl-button size="medium">Medium Button</gl-button>
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Categories
|
|
42
|
-
|
|
43
|
-
Use the `category` prop to set the button category to `primary`, `secondary`, or `tertiary`.
|
|
44
|
-
Defaults to `primary`.
|
|
45
|
-
|
|
46
|
-
## Variants
|
|
47
|
-
|
|
48
|
-
Use the `variant` prop to set the button variant to `default`, `confirm`, `danger`, `dashed`, or `link`.
|
|
49
|
-
Defaults to `default`.
|
|
50
|
-
|
|
51
|
-
## Block level buttons
|
|
52
|
-
|
|
53
|
-
Create block level buttons, those that span the full width of a parent, by setting the `block`
|
|
54
|
-
prop.
|
|
55
|
-
|
|
56
|
-
```html
|
|
57
|
-
<gl-button block>Block Level Button</gl-button>
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Disabled state
|
|
61
|
-
|
|
62
|
-
Set the `disabled` prop to disable button default functionality. `disabled` also works with buttons
|
|
63
|
-
rendered as `<a>` elements and `<router-link>` (i.e. with the `href` or `to` prop set).
|
|
64
|
-
|
|
65
|
-
```html
|
|
66
|
-
<gl-button disabled>Disabled</gl-button>
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Router link support
|
|
70
|
-
|
|
71
|
-
Refer to the [Router support](?path=/docs/base-link--docs#router-links) reference docs for
|
|
72
|
-
the various supported `<router-link>` related props.
|
|
73
|
-
|
|
74
|
-
## Accessibility
|
|
75
|
-
|
|
76
|
-
When the `href` prop is set to `'#'`, `<gl-button>` will render a link (`<a>`) element with attribute
|
|
77
|
-
`role="button"` set and appropriate keydown listeners (<kbd>Enter</kbd> and <kbd>Space</kbd>) so
|
|
78
|
-
that the link acts like a native HTML `<button>` for screen reader and keyboard-only users. When
|
|
79
|
-
disabled, the `aria-disabled="true"` attribute will be set on the `<a>` element.
|
|
80
|
-
|
|
81
|
-
When the `href` is set to any other value (or the `to` prop is used), `role="button"` will not be
|
|
82
|
-
added, nor will the keyboard event listeners be enabled.
|
|
83
|
-
|
|
84
|
-
## Label button
|
|
85
|
-
|
|
86
|
-
A label button renders a non-interactive `span` styled as a button. This can be especially useful
|
|
87
|
-
when used in a button group to render text-only labels along with actionable buttons. To improve
|
|
88
|
-
accessibility, and when applicable, consider using [`aria-describedby`] to establish a
|
|
89
|
-
relationship between the label button and the associated button.
|
|
90
|
-
|
|
91
|
-
[`aria-describedby`]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute
|
|
92
|
-
|
|
93
|
-
## Security
|
|
94
|
-
|
|
95
|
-
This component implements a few security measures to make it as safe as possible by default.
|
|
96
|
-
See [SafeLinkDirective docs] for more details.
|
|
97
|
-
|
|
98
|
-
### Linking to an unsafe URL
|
|
99
|
-
|
|
100
|
-
If you're trying to link to a location considered unsafe by the `SafeLink` directive (when rendering
|
|
101
|
-
a download link with a [Data URL] for example), you'll need to bypass the `href` attribute's
|
|
102
|
-
sanitization. This component exposes the `is-unsafe-link` prop for that purpose.
|
|
103
|
-
|
|
104
|
-
> **Warning:** Only disable URL sanitization when absolutely necessary.
|
|
105
|
-
|
|
106
|
-
```html
|
|
107
|
-
<gl-button
|
|
108
|
-
is-unsafe-link
|
|
109
|
-
download="file.txt"
|
|
110
|
-
href="data:text/plain;charset=utf-8,GitLab%20is%20awesome">Download</gl-button>
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
[SafeLinkDirective docs]: https://design.gitlab.com/storybook?path=/docs/directives-safe-link-directive--default
|
|
114
|
-
[Data URL]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
|
|
115
|
-
|
|
116
|
-
## vue-bootstrap component
|
|
117
|
-
|
|
118
|
-
This component uses [`BButton`](https://bootstrap-vue.org/docs/components/button) from vue-bootstrap
|
|
119
|
-
internally. So please take a look also there at their extensive documentation.
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
Button groups are an easy way to group a series of buttons together.
|
|
2
|
-
|
|
3
|
-
```html
|
|
4
|
-
<gl-button-group>
|
|
5
|
-
<gl-button>Download</b-button>
|
|
6
|
-
<gl-button>Browse</b-button>
|
|
7
|
-
<gl-button variant="danger">Delete</b-button>
|
|
8
|
-
</gl-button-group>
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Split dropdowns
|
|
12
|
-
|
|
13
|
-
Both `GlCollapsibleListbox` and `GlDisclosureDropdown` can be added as the last
|
|
14
|
-
child of a button group to produce a "split" dropdown.
|
|
15
|
-
|
|
16
|
-
For the correct styling, the dropdown component must render a caret _only_.
|
|
17
|
-
This means no icon, and no visible text. For accessbility, ensure the
|
|
18
|
-
dropdown's `toggle-text` _and_ `text-sr-only` props are set.
|
|
19
|
-
|
|
20
|
-
```html
|
|
21
|
-
<gl-button-group>
|
|
22
|
-
<gl-button>Split listbox</gl-button>
|
|
23
|
-
|
|
24
|
-
<gl-collapsible-listbox
|
|
25
|
-
v-model="foo"
|
|
26
|
-
:items="items"
|
|
27
|
-
toggle-text="Choose button action"
|
|
28
|
-
text-sr-only
|
|
29
|
-
/>
|
|
30
|
-
</gl-button-group>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Vertical variation
|
|
34
|
-
|
|
35
|
-
Make a set of buttons appear vertically stacked rather than horizontally by setting the `vertical` prop.
|
|
36
|
-
Split button dropdowns are not supported here.
|
|
37
|
-
|
|
38
|
-
```html
|
|
39
|
-
<gl-button-group vertical>
|
|
40
|
-
<gl-button>Top</b-button>
|
|
41
|
-
<gl-button>Middle</b-button>
|
|
42
|
-
<gl-button>Bottom</b-button>
|
|
43
|
-
</gl-button-group>
|
|
44
|
-
```
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
Cards are a flexible component used to display content and actions in a variety of contexts.
|
|
2
|
-
They are generally restricted to a single topic and it should be easy for users to scan relevant and
|
|
3
|
-
actionable information. Content, such as images and text, should be positioned within them in a
|
|
4
|
-
manner that demonstrates their intended hierarchy.
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
Collapse is used to keep pages focused on the overview of what the user can do. Details and
|
|
2
|
-
additional actions are hidden in the fold, and can be opened if the user wants to interact with
|
|
3
|
-
those elements.
|
|
4
|
-
|
|
5
|
-
## `v-model` support
|
|
6
|
-
|
|
7
|
-
The component's collapsed (visible) state can be set with `v-model` which binds internally to
|
|
8
|
-
the `visible` prop.
|
|
9
|
-
|
|
10
|
-
Note that when using `v-model` to control `<gl-collapse>`, the `aria-*` attributes are not
|
|
11
|
-
automatically placed on the trigger button. Specifically, you should add `aria-expanded` to
|
|
12
|
-
reflect the state of the target `<gl-collapse>` component, and `aria-controls` should be set
|
|
13
|
-
to the ID(s) of the target `<gl-collapse>` component(s).
|
|
14
|
-
|
|
15
|
-
```html
|
|
16
|
-
<template>
|
|
17
|
-
<div>
|
|
18
|
-
<gl-button
|
|
19
|
-
:class="visible ? null : 'collapsed'"
|
|
20
|
-
:aria-expanded="visible ? 'true' : 'false'"
|
|
21
|
-
aria-controls="collapse-4"
|
|
22
|
-
@click="visible = !visible"
|
|
23
|
-
>
|
|
24
|
-
Toggle Collapse
|
|
25
|
-
</gl-button>
|
|
26
|
-
<gl-collapse id="collapse-4" v-model="visible">
|
|
27
|
-
<span>Surprise! But I am just a span</span>
|
|
28
|
-
</gl-collapse>
|
|
29
|
-
</div>
|
|
30
|
-
</template>
|
|
31
|
-
|
|
32
|
-
<script>
|
|
33
|
-
export default {
|
|
34
|
-
data() {
|
|
35
|
-
return {
|
|
36
|
-
visible: true
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
</script>
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Troubleshooting
|
|
44
|
-
|
|
45
|
-
When collapsing the container, padding on the collapse component causes
|
|
46
|
-
complications with the height calculations.
|
|
47
|
-
The result is a bit of jumpiness at the end of the collapse animation.
|
|
48
|
-
|
|
49
|
-
The quick solution is to bring the padding into an inner container, which
|
|
50
|
-
simplifies the height calculations and removes the jumpiness.
|
|
51
|
-
|
|
52
|
-
```html
|
|
53
|
-
<!-- bad -->
|
|
54
|
-
<gl-collapse class="gl-p-3">
|
|
55
|
-
<!-- content -->
|
|
56
|
-
</gl-collapse>
|
|
57
|
-
|
|
58
|
-
<!-- good -->
|
|
59
|
-
<gl-collapse>
|
|
60
|
-
<div class="gl-p-3">
|
|
61
|
-
<!-- content -->
|
|
62
|
-
</div>
|
|
63
|
-
</gl-collapse>
|
|
64
|
-
```
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Date picker allows users to choose and input a date by manually typing the date into the input field
|
|
2
|
-
or by using a calendar-like dropdown.
|
|
3
|
-
|
|
4
|
-
### Warning
|
|
5
|
-
|
|
6
|
-
Be careful when binding a date value using `value` prop. `value` is a watched property and Date
|
|
7
|
-
picker will emit `input` event on _initial load_. Alternatively, use `defaultDate` to set the
|
|
8
|
-
initial date then receive updated date values through `input` events.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
## Usage
|
|
2
|
-
|
|
3
|
-
Daterange picker allows users to choose a date range by manually typing the start/end date
|
|
4
|
-
into the input fields or by using a calendar-like dropdown.
|
|
5
|
-
|
|
6
|
-
A `maxDateRange` can be specified in order to limit the maximum number of days the component
|
|
7
|
-
will allow to be selected i.e. if the start date is `2020-08-01` and `maxDateRange` is set to `10`,
|
|
8
|
-
the highest selectable end date would be `2020-08-11`. This value will be offset by `1` if
|
|
9
|
-
`sameDaySelection` is set to `true`. A `defaultMaxDate` will need to be
|
|
10
|
-
provided when making use of the `maxDateRange`.
|
|
11
|
-
|
|
12
|
-
By default, the component does not allow selection of the same start and end date.
|
|
13
|
-
In a scenario where this is required, the `sameDaySelection` property can be configured.
|
|
14
|
-
This is specifically useful when a single day selection is being defined as `2020-01-01 00:00:00`
|
|
15
|
-
to `2020-01-01 23:59:59` instead of `2020-01-01 00:00:00` to `2020-01-02 00:00:00`.
|
|
16
|
-
|
|
17
|
-
When `maxDateRange` is set it's a good idea to set the `tooltip` specifying the date range limit
|
|
18
|
-
and to indicate the number of days currently selected using the default slot. For example:
|
|
19
|
-
|
|
20
|
-
```vue
|
|
21
|
-
<template #default="{ daysSelected }">
|
|
22
|
-
<span v-if="daysSelected > -1">{{ daysSelected }} days selected</span>
|
|
23
|
-
<span v-else>No days selected</span>
|
|
24
|
-
</template>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
The `daysSelected` slot prop is the effective date range, thus the value is increased by one when
|
|
28
|
-
`sameDaySelection` is set to `true`. When no date range has been selected the value is `-1`.
|
|
29
|
-
|
|
30
|
-
### Note
|
|
31
|
-
|
|
32
|
-
If specifying a maxDateRange, it is good practice to include a date range indicator and toolip.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
The drawer is used to show more information about a certain resource in the UI and potentially
|
|
2
|
-
handle actions on the information.
|
|
3
|
-
|
|
4
|
-
### By default
|
|
5
|
-
|
|
6
|
-
```html
|
|
7
|
-
<gl-drawer :open="open" @close="close" @opened="opened">
|
|
8
|
-
<template #header>Your Title</template>
|
|
9
|
-
<template>
|
|
10
|
-
...children
|
|
11
|
-
</template>
|
|
12
|
-
</gl-drawer>
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
- `v-bind:open` will be a boolean you will pass to `gl-drawer` and `@close` is a listener that will
|
|
16
|
-
be a function that will toggle open to `false`.
|
|
17
|
-
- The component emits an `opened` event after the opening animation has finished.
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
The dropdown component offers a user multiple items or actions to choose from which are initially
|
|
2
|
-
collapsed behind a button.
|
|
3
|
-
|
|
4
|
-
> **NOTE**: This component has been deprecated in favor of components
|
|
5
|
-
> more suited to the various use cases for dropdowns. Consider using a more
|
|
6
|
-
> appropriate component instead:
|
|
7
|
-
>
|
|
8
|
-
> - For single or multiselect options, use `GlCollapsibleListbox`.
|
|
9
|
-
> - For displaying a list of actions like "Edit user", "Delete user", use `GlDisclosureDropdown`.
|
|
10
|
-
>
|
|
11
|
-
> See [Which component should you use?](https://design.gitlab.com/components/dropdown-overview#which-component-should-you-use)
|
|
12
|
-
> for what to use and when.
|
|
13
|
-
|
|
14
|
-
### Icon-only dropdown
|
|
15
|
-
|
|
16
|
-
Icon-only dropdowns must have an accessible name.
|
|
17
|
-
You can provide this with the combination of `text` and `text-sr-only` props.
|
|
18
|
-
|
|
19
|
-
Optionally, you can use `no-caret` to remove the caret and `category="tertiary"` to remove the border.
|
|
20
|
-
|
|
21
|
-
```html
|
|
22
|
-
<gl-dropdown
|
|
23
|
-
icon="ellipsis_v"
|
|
24
|
-
text="More actions"
|
|
25
|
-
:text-sr-only="true"
|
|
26
|
-
category="tertiary"
|
|
27
|
-
no-caret
|
|
28
|
-
>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Button Content
|
|
32
|
-
|
|
33
|
-
There are 3 ways to set the dropdown button's content.
|
|
34
|
-
|
|
35
|
-
1. Use the `text` attribute. This will display the text with the loading spinner (shown with the
|
|
36
|
-
`loading` attribute), icon (if provided by the `icon` attribute), and dropdown caret:
|
|
37
|
-
|
|
38
|
-
```html
|
|
39
|
-
<gl-dropdown text="Button text">
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
1. Use the `button-text` template. This allows custom content for the button's text, but keeps the
|
|
43
|
-
loading spinner, icon, and dropdown caret:
|
|
44
|
-
|
|
45
|
-
```html
|
|
46
|
-
<gl-dropdown>
|
|
47
|
-
<template #button-text>
|
|
48
|
-
<!-- Loading spinner shown here -->
|
|
49
|
-
<!-- Icon shown here -->
|
|
50
|
-
Custom <strong>Content</strong> with <em>HTML</em> via Slot
|
|
51
|
-
<gl-truncate position="middle" text="Truncated button text"/>
|
|
52
|
-
<!-- Dropdown arrow shown here -->
|
|
53
|
-
</template>
|
|
54
|
-
</gl-dropdown>
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
1. Use the `button-content` template. This will replace everything in the button with the template:
|
|
58
|
-
|
|
59
|
-
```html
|
|
60
|
-
<gl-dropdown>
|
|
61
|
-
<template #button-content>
|
|
62
|
-
Custom <strong>Content</strong> with <em>HTML</em> via Slot
|
|
63
|
-
</template>
|
|
64
|
-
</gl-dropdown>
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### GlDropdownForm
|
|
68
|
-
|
|
69
|
-
Unlike `b-dropdown-form`, we do _not_ add any additional padding with the `gl-dropdown-form` component.
|
|
70
|
-
This is to prevent double padding with `gl-dropdown-item` and similar components, so in most cases
|
|
71
|
-
shouldn't be needed. To add padding, either add a padding utility class to your form, or an inner
|
|
72
|
-
element with some padding.
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
The filtered search component is responsible for managing search with possible filters.
|
|
2
|
-
|
|
3
|
-
## Usage
|
|
4
|
-
|
|
5
|
-
Each filter option (named token) requires a separate Vue component. `GlFilteredSearchToken` is an
|
|
6
|
-
example of such a token.
|
|
7
|
-
|
|
8
|
-
Prepare array of available token configurations with the following fields:
|
|
9
|
-
|
|
10
|
-
- `type`: unique identifier of token type
|
|
11
|
-
- `title`: human-readable title of the token
|
|
12
|
-
- `icon`: token icon
|
|
13
|
-
- `token`: (optional) the token Vue component to use (e.g. `AuthorToken`)
|
|
14
|
-
- `dataType`: (optional) identifier of type (for example "user") for this filter. Tokens
|
|
15
|
-
of the same type could be switched without losing their values
|
|
16
|
-
- `unique`: (optional) indicate this token could appear only once in the filter
|
|
17
|
-
- `disabled`: (optional) indicate this token should be hidden from the dropdown
|
|
18
|
-
- `operators`: (optional) an array of selectable operators.
|
|
19
|
-
Each array item is an object that must contain `value` and `description`, and optionally `default`
|
|
20
|
-
(e.g. `{ value: '=', description: 'is', default: 'true' }`)
|
|
21
|
-
- `multiSelect`: (optional) when `true`, the suggestions list becomes multi-select instead of single-select.
|
|
22
|
-
It is discouraged to use this together with `unique`, as `unique` is intended for single-select.
|
|
23
|
-
- `options`: (optional) an array of options which the user can pick after the
|
|
24
|
-
operator has been selected. The option object can have the following
|
|
25
|
-
properties defined: `value: string`, `icon: string`, `title: string`,
|
|
26
|
-
`component: Object` and `default: boolean`. If `component` is provided, it is
|
|
27
|
-
is used to render the option in the suggestions list.
|
|
28
|
-
- `optionComponent`: (optional) A component used to render the token option
|
|
29
|
-
itself when adding a new token or replacing an existing one
|
|
30
|
-
- any additional fields required to configure your component
|
|
31
|
-
|
|
32
|
-
Each token for filtered search is a Vue component with the following props:
|
|
33
|
-
|
|
34
|
-
- `value`: an object with a `data` property containing the current value, and optionally an
|
|
35
|
-
`operator` value containing the operator value
|
|
36
|
-
- `active`: indicates if the token is currently active. It's the token's responsibility
|
|
37
|
-
to render proper control for editing (for example input).
|
|
38
|
-
- `current-value`: current tokens of the filtered search.
|
|
39
|
-
- `index`: current token position in the filtered search.
|
|
40
|
-
- `config`: additional configuration, supplied in filtered search config for this token.
|
|
41
|
-
|
|
42
|
-
The token should emit the following events:
|
|
43
|
-
|
|
44
|
-
- `activate`: when the token requests activation (for example, when being clicked).
|
|
45
|
-
- `deactivate`: when token requests deactivation (for example due to losing blur on input).
|
|
46
|
-
- `destroy`: when token requests self-destruction (for instance for clicking "X" sign).
|
|
47
|
-
- `replace`: token requests its replacement with another token.
|
|
48
|
-
- `split`: token requests adding string values after the current token.
|
|
49
|
-
- `complete`: token indicates its editing is completed.
|
|
50
|
-
|
|
51
|
-
### Improve space handling
|
|
52
|
-
|
|
53
|
-
Set the `terms-as-tokens` prop to `true` to enable new term rendering and
|
|
54
|
-
interaction behavior. This makes it easier to input/edit free text tokens, and
|
|
55
|
-
removes the need for quoting values with spaces and other workarounds.
|
|
56
|
-
|
|
57
|
-
In future, this prop will be enabled by default and eventually removed. Opt in
|
|
58
|
-
to this earlier rather than later to ease migration.
|
|
59
|
-
|
|
60
|
-
## Examples
|
|
61
|
-
|
|
62
|
-
Define a list of available tokens:
|
|
63
|
-
|
|
64
|
-
```js
|
|
65
|
-
const availableTokens = [
|
|
66
|
-
{ type: 'static', icon: 'label', title: 'static:token', token: staticToken },
|
|
67
|
-
{ type: 'dynamic', icon: 'rocket', title: 'dynamic:~token', token: dynamicToken },
|
|
68
|
-
];
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Pass the list of tokens to the search component. Optionally, you can use `v-model` to receive
|
|
72
|
-
realtime updates:
|
|
73
|
-
|
|
74
|
-
```html
|
|
75
|
-
<gl-filtered-search :available-tokens="tokens" v-model="value" terms-as-tokens />
|
|
76
|
-
```
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
The filtered search suggestion component is a wrapper around `GlDropdownItem`, which registers
|
|
2
|
-
suggestions in a top-level suggestion list:
|
|
3
|
-
|
|
4
|
-
```html
|
|
5
|
-
<gl-filtered-search-suggestion-list>
|
|
6
|
-
<gl-filtered-search-suggestion value="foo" key="foo-0">Example suggestion</gl-filtered-search-suggestion>
|
|
7
|
-
<gl-filtered-search-suggestion value="bar" key="bar-1">Example suggestion 2</gl-filtered-search-suggestion>
|
|
8
|
-
</gl-filtered-search-suggestion-list>
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
> NOTE: Provide a `key` to suggestions of the form `${value}-${index}` (or
|
|
12
|
-
> similar). While using the index in keys is usually frowned upon for
|
|
13
|
-
> performance reasons, the current implementation relies on all suggestions
|
|
14
|
-
> getting destroyed and recreated to keep rendering order in sync with
|
|
15
|
-
> <kbd>Up</kbd>/<kbd>Down</kbd> keyboard interaction.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
The filtered search suggestion list component is responsible for managing underlying suggestion instances.
|
|
2
|
-
You obtain the ref for this component and manage suggestion selection via the component public API:
|
|
3
|
-
|
|
4
|
-
- `getValue()` - Retrieves the current selected suggestion.
|
|
5
|
-
- `nextItem()` - Selects the next suggestion. If last suggestion was selected, selection is cleared.
|
|
6
|
-
- `prevItem()` - Selects the previous suggestion. If first suggestion was selected, selection is cleared.
|
|
7
|
-
|
|
8
|
-
```html
|
|
9
|
-
<gl-filtered-search-suggestion-list ref="suggestions">
|
|
10
|
-
<gl-filtered-search-suggestion value="foo">Example suggestion</gl-filtered-search-suggestion>
|
|
11
|
-
<gl-filtered-search-suggestion value="bar">Example suggestion 2</gl-filtered-search-suggestion>
|
|
12
|
-
</gl-filtered-search-suggestion-list>
|
|
13
|
-
```
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
The filtered search term is a component for managing "free input" in the filtered search component.
|
|
2
|
-
It is responsible for autocompleting available tokens and "converting" to a relevant
|
|
3
|
-
component when an autocomplete item is selected.
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
This component is internal and is not intended to be used by `@gitlab/ui` users.
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
Filtered search token is a helper component, intended to
|
|
2
|
-
simplify the creation of filters tokens which consist of a title, operators
|
|
3
|
-
and an editable value with autocomplete. This component abstracts token management
|
|
4
|
-
logic and allows you to focus on implementing autocomplete or view logic.
|
|
5
|
-
|
|
6
|
-
This component is not intended to be used outside of the `GlFilteredSearch` component.
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
Make sure to pass `$listeners` to `gl-filtered-search-token`, or route events properly:
|
|
11
|
-
|
|
12
|
-
```html
|
|
13
|
-
<gl-filtered-search-token title="Confidential" :active="active" :value="value" v-on="$listeners">
|
|
14
|
-
<template #suggestions>
|
|
15
|
-
<gl-filtered-search-suggestion value="Yes"
|
|
16
|
-
><gl-icon name="eye-slash" :size="16" /> Yes</gl-filtered-search-suggestion
|
|
17
|
-
>
|
|
18
|
-
<gl-filtered-search-suggestion value="No"
|
|
19
|
-
><gl-icon name="eye" :size="16" /> No</gl-filtered-search-suggestion
|
|
20
|
-
>
|
|
21
|
-
</template>
|
|
22
|
-
</gl-filtered-search-token>
|
|
23
|
-
```
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
The filtered search token segment is a component for managing token input either via free typing
|
|
2
|
-
or by selecting item through dropdown list
|
|
3
|
-
|
|
4
|
-
## Usage
|
|
5
|
-
|
|
6
|
-
This component is internal and is not intended to be used by `@gitlab/ui` users.
|
|
7
|
-
|
|
8
|
-
## Internet Explorer 11
|
|
9
|
-
|
|
10
|
-
This component uses [`String.prototype.startsWith()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)
|
|
11
|
-
and [`String.prototype.endsWith()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)
|
|
12
|
-
under the hood. Make sure those methods are polyfilled if you plan on using the component on IE11.
|
|
13
|
-
|
|
14
|
-
> NOTE: These methods are already polyfilled in GitLab: [`app/assets/javascripts/commons/polyfills.js#L15-16`](https://gitlab.com/gitlab-org/gitlab/blob/dc60dee6ed6234dda9f032195577cd8fad9646d8/app/assets/javascripts/commons/polyfills.js#L15-16)
|