@gitlab/ui 114.5.0 → 114.6.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/README.md +2 -2
- package/dist/components/base/sorting/sorting.js +10 -1
- package/dist/components/base/table/constants.js +1 -1
- package/dist/components/base/toast/toast.js +1 -1
- package/package.json +1 -1
- package/src/components/base/button/button.md +1 -1
- package/src/components/base/form/form_character_count/form_character_count.md +1 -1
- package/src/components/base/form/form_combobox/form_combobox.md +4 -4
- package/src/components/base/link/link.md +1 -1
- package/src/components/base/sorting/sorting.vue +11 -0
- package/src/components/base/table/constants.js +1 -1
- package/src/components/base/toast/toast.js +1 -1
- package/src/components/charts/heatmap/heatmap.md +1 -1
- package/translations.js +1 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ design system. GitLab UI is written in [Vue.js](https://vuejs.org) and its objec
|
|
|
6
6
|
- Create reusable UI components to accelerate frontend development.
|
|
7
7
|
- Create UI consistency for all components within GitLab.
|
|
8
8
|
|
|
9
|
-
See <https://
|
|
9
|
+
See <https://design.gitlab.com/storybook> for documentation.
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
@@ -53,7 +53,7 @@ or newer.
|
|
|
53
53
|
|
|
54
54
|
```sh
|
|
55
55
|
# Clone the project
|
|
56
|
-
git clone git@gitlab.com:gitlab-org/gitlab-
|
|
56
|
+
git clone git@gitlab.com:gitlab-org/gitlab-services/design.gitlab.com.git
|
|
57
57
|
|
|
58
58
|
# Navigate to the root of the project
|
|
59
59
|
cd gitlab-ui
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import uniqueId from 'lodash/uniqueId';
|
|
1
2
|
import { GlTooltipDirective } from '../../../directives/tooltip/tooltip';
|
|
2
3
|
import GlButton from '../button/button';
|
|
3
4
|
import GlButtonGroup from '../button_group/button_group';
|
|
@@ -94,7 +95,15 @@ var script = {
|
|
|
94
95
|
default: false
|
|
95
96
|
}
|
|
96
97
|
},
|
|
98
|
+
data() {
|
|
99
|
+
return {
|
|
100
|
+
sortingListboxId: uniqueId('sorting-listbox-')
|
|
101
|
+
};
|
|
102
|
+
},
|
|
97
103
|
computed: {
|
|
104
|
+
sortingListboxLabel() {
|
|
105
|
+
return translate('GlSorting.sortByLabel', 'Sort by:');
|
|
106
|
+
},
|
|
98
107
|
localSortDirection() {
|
|
99
108
|
return this.isAscending ? 'sort-lowest' : 'sort-highest';
|
|
100
109
|
},
|
|
@@ -136,7 +145,7 @@ var script = {
|
|
|
136
145
|
const __vue_script__ = script;
|
|
137
146
|
|
|
138
147
|
/* template */
|
|
139
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-button-group',{staticClass:"gl-sorting"},[_c('gl-collapsible-listbox',{class:_vm.dropdownClass,attrs:{"toggle-text":_vm.text,"items":_vm.sortOptions,"selected":_vm.sortBy,"toggle-class":_vm.dropdownToggleClass,"placement":"bottom-end","block":_vm.block},on:{"select":_vm.onSortByChanged}}),_vm._v(" "),_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip"}],class:['sorting-direction-button', _vm.sortDirectionToggleClass],attrs:{"title":_vm.sortDirectionText,"icon":_vm.localSortDirection,"aria-label":_vm.sortDirectionText},on:{"click":_vm.toggleSortDirection}})],1)};
|
|
148
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-button-group',{staticClass:"gl-sorting"},[_c('gl-collapsible-listbox',{class:_vm.dropdownClass,attrs:{"toggle-text":_vm.text,"items":_vm.sortOptions,"selected":_vm.sortBy,"toggle-class":_vm.dropdownToggleClass,"placement":"bottom-end","block":_vm.block,"toggle-aria-labelled-by":_vm.sortingListboxId},on:{"select":_vm.onSortByChanged}}),_vm._v(" "),_c('span',{staticClass:"gl-sr-only",attrs:{"id":_vm.sortingListboxId}},[_vm._v(_vm._s(_vm.sortingListboxLabel))]),_vm._v(" "),_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip"}],class:['sorting-direction-button', _vm.sortDirectionToggleClass],attrs:{"title":_vm.sortDirectionText,"icon":_vm.localSortDirection,"aria-label":_vm.sortDirectionText},on:{"click":_vm.toggleSortDirection}})],1)};
|
|
140
149
|
var __vue_staticRenderFns__ = [];
|
|
141
150
|
|
|
142
151
|
/* style */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const tableFullSlots = ['bottom-row', 'empty', 'emptyfiltered', 'table-busy', 'thead-top', 'top-row'];
|
|
2
2
|
const tableFullProps = ['api-url', 'busy', 'current-page', 'empty-filtered-html', 'empty-filtered-text', 'empty-html', 'empty-text', 'filter', 'filter-debounce', 'filter-function', 'filter-ignored-fields', 'filter-included-fields', 'label-sort-asc', 'label-sort-clear', 'label-sort-desc', 'no-footer-sorting', 'no-local-sorting', 'no-provider-filtering', 'no-provider-paging', 'no-provider-sorting', 'no-select-on-click', 'per-page', 'select-mode', 'selectable', 'selected-variant', 'show-empty', 'sort-by', 'sort-compare', 'sort-compare-locale', 'sort-compare-options', 'sort-desc', 'sort-direction', 'sort-icon-left', 'sort-null-last'];
|
|
3
|
-
const glTableLiteWarning = 'This GlTable could be a GlTableLite component, please consider using GlTableLite instead of GlTable to reduce the page bundlesize more about this here: https://
|
|
3
|
+
const glTableLiteWarning = 'This GlTable could be a GlTableLite component, please consider using GlTableLite instead of GlTable to reduce the page bundlesize more about this here: https://design.gitlab.com/storybook?path=/docs/base-table-table-lite--default';
|
|
4
4
|
|
|
5
5
|
export { glTableLiteWarning, tableFullProps, tableFullSlots };
|
|
@@ -65,7 +65,7 @@ function showToast(message) {
|
|
|
65
65
|
* Note: This is not a typical Vue component and needs to be registered before instantiating a Vue app.
|
|
66
66
|
* Once registered, the toast will be globally available throughout your app.
|
|
67
67
|
*
|
|
68
|
-
* See https://
|
|
68
|
+
* See https://design.gitlab.com/storybook for detailed documentation.
|
|
69
69
|
*/
|
|
70
70
|
var toast = {
|
|
71
71
|
install(Vue) {
|
package/package.json
CHANGED
|
@@ -110,7 +110,7 @@ sanitization. This component exposes the `is-unsafe-link` prop for that purpose.
|
|
|
110
110
|
href="data:text/plain;charset=utf-8,GitLab%20is%20awesome">Download</gl-button>
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
[SafeLinkDirective docs]: https://
|
|
113
|
+
[SafeLinkDirective docs]: https://design.gitlab.com/storybook?path=/docs/directives-safe-link-directive--default
|
|
114
114
|
[Data URL]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
|
|
115
115
|
|
|
116
116
|
## vue-bootstrap component
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
## Usage
|
|
2
2
|
|
|
3
3
|
`GlFormCharacterCount` can be used to add a character count to an input.
|
|
4
|
-
If you are using `GlFormTextarea` on its own see [with character count example](https://
|
|
4
|
+
If you are using `GlFormTextarea` on its own see [with character count example](https://design.gitlab.com/storybook?path=/story/base-form-form-textarea--with-character-count).
|
|
5
5
|
If you are wrapping your input, such as in a markdown component, and need the character
|
|
6
6
|
count separate from the input, use `GlFormCharacterCount`.
|
|
7
7
|
|
|
@@ -46,7 +46,7 @@ The algorithm to match tokens with the input is very naive. If you need to use t
|
|
|
46
46
|
very large list of matches, you may want to update the implementation or use one of the search
|
|
47
47
|
inputs, like [`GlSearchBoxByType`], [`GlSearchBoxByClick`], or [`GlFilteredSearch`].
|
|
48
48
|
|
|
49
|
-
[`GlSearchBoxByType`]: https://
|
|
50
|
-
[`GlSearchBoxByClick`]: https://
|
|
51
|
-
[`GlTokenSelector`]: https://
|
|
52
|
-
[`GlFilteredSearch`]: https://
|
|
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
|
|
@@ -150,5 +150,5 @@ sanitization. This component exposes the `is-unsafe-link` prop for that purpose.
|
|
|
150
150
|
</gl-link>
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
[SafeLinkDirective docs]: https://
|
|
153
|
+
[SafeLinkDirective docs]: https://design.gitlab.com/storybook?path=/docs/directives-safe-link-directive--default
|
|
154
154
|
[Data URL]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import uniqueId from 'lodash/uniqueId';
|
|
2
3
|
import { GlTooltipDirective } from '../../../directives/tooltip/tooltip';
|
|
3
4
|
import GlButton from '../button/button.vue';
|
|
4
5
|
import GlButtonGroup from '../button_group/button_group.vue';
|
|
@@ -94,7 +95,15 @@ export default {
|
|
|
94
95
|
default: false,
|
|
95
96
|
},
|
|
96
97
|
},
|
|
98
|
+
data() {
|
|
99
|
+
return {
|
|
100
|
+
sortingListboxId: uniqueId('sorting-listbox-'),
|
|
101
|
+
};
|
|
102
|
+
},
|
|
97
103
|
computed: {
|
|
104
|
+
sortingListboxLabel() {
|
|
105
|
+
return translate('GlSorting.sortByLabel', 'Sort by:');
|
|
106
|
+
},
|
|
98
107
|
localSortDirection() {
|
|
99
108
|
return this.isAscending ? 'sort-lowest' : 'sort-highest';
|
|
100
109
|
},
|
|
@@ -146,8 +155,10 @@ export default {
|
|
|
146
155
|
:class="dropdownClass"
|
|
147
156
|
placement="bottom-end"
|
|
148
157
|
:block="block"
|
|
158
|
+
:toggle-aria-labelled-by="sortingListboxId"
|
|
149
159
|
@select="onSortByChanged"
|
|
150
160
|
/>
|
|
161
|
+
<span :id="sortingListboxId" class="gl-sr-only">{{ sortingListboxLabel }}</span>
|
|
151
162
|
<gl-button
|
|
152
163
|
v-gl-tooltip
|
|
153
164
|
:title="sortDirectionText"
|
|
@@ -45,4 +45,4 @@ export const tableFullProps = [
|
|
|
45
45
|
];
|
|
46
46
|
|
|
47
47
|
export const glTableLiteWarning =
|
|
48
|
-
'This GlTable could be a GlTableLite component, please consider using GlTableLite instead of GlTable to reduce the page bundlesize more about this here: https://
|
|
48
|
+
'This GlTable could be a GlTableLite component, please consider using GlTableLite instead of GlTable to reduce the page bundlesize more about this here: https://design.gitlab.com/storybook?path=/docs/base-table-table-lite--default';
|
|
@@ -79,7 +79,7 @@ function showToast(message, options = {}) {
|
|
|
79
79
|
* Note: This is not a typical Vue component and needs to be registered before instantiating a Vue app.
|
|
80
80
|
* Once registered, the toast will be globally available throughout your app.
|
|
81
81
|
*
|
|
82
|
-
* See https://
|
|
82
|
+
* See https://design.gitlab.com/storybook for detailed documentation.
|
|
83
83
|
*/
|
|
84
84
|
export default {
|
|
85
85
|
install(Vue) {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
**Note** This component uses `<gl-legend>`, which should allow a user to click on any data point(s)
|
|
4
4
|
in the legend and make the corresponding data point(s) on the chart rendered disappear.
|
|
5
|
-
_See [area chart](https://
|
|
5
|
+
_See [area chart](https://design.gitlab.com/storybook?path=/story/charts-area-chart--default)
|
|
6
6
|
for an example_ For this particular chart, there is a [known issue](https://gitlab.com/gitlab-org/gitlab-ui/issues/352)
|
|
7
7
|
with the functionality of the legend, where clicking on it does nothing.
|
package/translations.js
CHANGED
|
@@ -31,6 +31,7 @@ export default {
|
|
|
31
31
|
'GlProgressBar.ariaLabel': 'Progress bar',
|
|
32
32
|
'GlSearchBoxByType.clearButtonTitle': 'Clear',
|
|
33
33
|
'GlSearchBoxByType.input.placeholder': 'Search',
|
|
34
|
+
'GlSorting.sortByLabel': 'Sort by:',
|
|
34
35
|
'GlSorting.sortAscending': 'Sort direction: ascending',
|
|
35
36
|
'GlSorting.sortDescending': 'Sort direction: descending',
|
|
36
37
|
'GlToken.closeButtonTitle': 'Remove',
|