@gitlab/ui 67.3.3 → 67.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/components/base/sorting/sorting.js +47 -5
- package/dist/components/base/sorting/sorting_item.js +3 -0
- package/dist/components/charts/column/column.js +3 -1
- package/dist/tokens/css/tokens.css +1 -1
- package/dist/tokens/css/tokens.dark.css +1 -1
- package/dist/tokens/js/tokens.dark.js +1 -1
- package/dist/tokens/js/tokens.js +1 -1
- package/dist/tokens/scss/_tokens.dark.scss +1 -1
- package/dist/tokens/scss/_tokens.scss +1 -1
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/package.json +15 -15
- package/src/components/base/sorting/sorting.md +82 -2
- package/src/components/base/sorting/sorting.spec.js +138 -14
- package/src/components/base/sorting/sorting.stories.js +69 -2
- package/src/components/base/sorting/sorting.vue +68 -7
- package/src/components/base/sorting/sorting_item.md +1 -1
- package/src/components/base/sorting/sorting_item.vue +3 -0
- package/src/components/charts/column/column.vue +2 -2
- package/src/components/charts/column/column_chart.spec.js +19 -0
- package/src/scss/utilities.scss +8 -0
- package/src/scss/utility-mixins/z-index.scss +1 -1
- package/translations.json +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
# [67.5.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v67.4.0...v67.5.0) (2023-11-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **css:** Add focus variant for gl-z-index-1 ([8c08f01](https://gitlab.com/gitlab-org/gitlab-ui/commit/8c08f01a7877dd2836fb1eb024a9bfc8ad37cc44))
|
|
7
|
+
* **GlSorting:** Add opt-in for new dropdown design ([b4eb476](https://gitlab.com/gitlab-org/gitlab-ui/commit/b4eb476976ca488b89641404acd19c2029a5d27d))
|
|
8
|
+
* **GlSorting:** Make strings translatable ([2964d55](https://gitlab.com/gitlab-org/gitlab-ui/commit/2964d55864b17022d62c294ebf6c7babab611407))
|
|
9
|
+
|
|
10
|
+
# [67.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v67.3.3...v67.4.0) (2023-11-02)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **GlColumnChart:** allow setting `stack` series property ([1ec54d9](https://gitlab.com/gitlab-org/gitlab-ui/commit/1ec54d9285bdda447575f31689ccc417389a6a96))
|
|
16
|
+
|
|
1
17
|
## [67.3.3](https://gitlab.com/gitlab-org/gitlab-ui/compare/v67.3.2...v67.3.3) (2023-11-01)
|
|
2
18
|
|
|
3
19
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { GlTooltipDirective } from '../../../directives/tooltip';
|
|
2
2
|
import GlButton from '../button/button';
|
|
3
3
|
import GlButtonGroup from '../button_group/button_group';
|
|
4
|
+
import GlCollapsibleListbox from '../new_dropdowns/listbox/listbox';
|
|
5
|
+
import { isOption } from '../new_dropdowns/listbox/utils';
|
|
4
6
|
import GlDropdown from '../dropdown/dropdown';
|
|
7
|
+
import { translate } from '../../../utils/i18n';
|
|
5
8
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
6
9
|
|
|
7
10
|
var script = {
|
|
@@ -9,6 +12,7 @@ var script = {
|
|
|
9
12
|
components: {
|
|
10
13
|
GlButton,
|
|
11
14
|
GlButtonGroup,
|
|
15
|
+
GlCollapsibleListbox,
|
|
12
16
|
GlDropdown
|
|
13
17
|
},
|
|
14
18
|
directives: {
|
|
@@ -23,6 +27,24 @@ var script = {
|
|
|
23
27
|
required: false,
|
|
24
28
|
default: ''
|
|
25
29
|
},
|
|
30
|
+
/**
|
|
31
|
+
* Sort options to display in the dropdown
|
|
32
|
+
*/
|
|
33
|
+
sortOptions: {
|
|
34
|
+
type: Array,
|
|
35
|
+
required: false,
|
|
36
|
+
default: null,
|
|
37
|
+
validator: sortOptions => sortOptions.every(isOption)
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* The value of the item currently selected in the dropdown.
|
|
41
|
+
* Only to be used with the `sortOptions` prop.
|
|
42
|
+
*/
|
|
43
|
+
sortBy: {
|
|
44
|
+
type: [String, Number],
|
|
45
|
+
required: false,
|
|
46
|
+
default: null
|
|
47
|
+
},
|
|
26
48
|
/**
|
|
27
49
|
* Determines the current sort order icon displayed.
|
|
28
50
|
*/
|
|
@@ -32,12 +54,13 @@ var script = {
|
|
|
32
54
|
default: false
|
|
33
55
|
},
|
|
34
56
|
/**
|
|
35
|
-
* The text
|
|
57
|
+
* The text for the tooltip and aria-label of the sort direction toggle
|
|
58
|
+
* button instead of the defaults for ascending/descending.
|
|
36
59
|
*/
|
|
37
60
|
sortDirectionToolTip: {
|
|
38
61
|
type: String,
|
|
39
62
|
required: false,
|
|
40
|
-
default:
|
|
63
|
+
default: null
|
|
41
64
|
},
|
|
42
65
|
/**
|
|
43
66
|
* Additional class(es) to apply to the root element of the GlDropdown.
|
|
@@ -68,8 +91,15 @@ var script = {
|
|
|
68
91
|
localSortDirection() {
|
|
69
92
|
return this.isAscending ? 'sort-lowest' : 'sort-highest';
|
|
70
93
|
},
|
|
71
|
-
|
|
72
|
-
|
|
94
|
+
sortDirectionText() {
|
|
95
|
+
if (this.sortDirectionToolTip) return this.sortDirectionToolTip;
|
|
96
|
+
return this.isAscending ? translate('GlSorting.sortAscending', 'Sort direction: ascending') : translate('GlSorting.sortDescending', 'Sort direction: descending');
|
|
97
|
+
},
|
|
98
|
+
useListbox() {
|
|
99
|
+
return Boolean(this.sortOptions);
|
|
100
|
+
},
|
|
101
|
+
listboxToggleClass() {
|
|
102
|
+
return [this.dropdownToggleClass, 'gl-rounded-top-right-none!', 'gl-rounded-bottom-right-none!', 'gl-focus-z-index-1'];
|
|
73
103
|
}
|
|
74
104
|
},
|
|
75
105
|
methods: {
|
|
@@ -85,6 +115,18 @@ var script = {
|
|
|
85
115
|
* @property {boolean} isAscending
|
|
86
116
|
*/
|
|
87
117
|
this.$emit('sortDirectionChange', newDirection);
|
|
118
|
+
},
|
|
119
|
+
onSortByChanged(event) {
|
|
120
|
+
/**
|
|
121
|
+
* Emitted when the sort field is changed.
|
|
122
|
+
*
|
|
123
|
+
* The event's payload is the value of the selected sort field.
|
|
124
|
+
*
|
|
125
|
+
* Only emitted when using the `sortOptions` prop.
|
|
126
|
+
*
|
|
127
|
+
* @property {string|number} value
|
|
128
|
+
*/
|
|
129
|
+
this.$emit('sortByChange', event);
|
|
88
130
|
}
|
|
89
131
|
}
|
|
90
132
|
};
|
|
@@ -93,7 +135,7 @@ var script = {
|
|
|
93
135
|
const __vue_script__ = script;
|
|
94
136
|
|
|
95
137
|
/* template */
|
|
96
|
-
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-dropdown',_vm._b({class:_vm.dropdownClass,attrs:{"text":_vm.text,"category":"secondary","toggle-class":_vm.dropdownToggleClass,"right":""}},'gl-dropdown',_vm.$props,false),[_vm._t("default")],2),_vm._v(" "),_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip"}],class:['sorting-direction-button', _vm.sortDirectionToggleClass],attrs:{"title":_vm.
|
|
138
|
+
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"},[(_vm.useListbox)?_c('gl-collapsible-listbox',{class:_vm.dropdownClass,attrs:{"toggle-text":_vm.text,"items":_vm.sortOptions,"selected":_vm.sortBy,"toggle-class":_vm.listboxToggleClass,"placement":"right"},on:{"select":_vm.onSortByChanged}}):_c('gl-dropdown',_vm._b({class:_vm.dropdownClass,attrs:{"text":_vm.text,"category":"secondary","toggle-class":_vm.dropdownToggleClass,"right":""}},'gl-dropdown',_vm.$props,false),[_vm._t("default")],2),_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)};
|
|
97
139
|
var __vue_staticRenderFns__ = [];
|
|
98
140
|
|
|
99
141
|
/* style */
|
|
@@ -5,6 +5,9 @@ import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* Sorting Item
|
|
7
7
|
*
|
|
8
|
+
* NOTE: This component is deprecated. Instead, use the `sortOptions` prop of
|
|
9
|
+
* `GlSorting`.
|
|
10
|
+
*
|
|
8
11
|
* This is written as a functional component because it is a simple wrapper over
|
|
9
12
|
* the GlDropdownItem component and does not use internal state. Functional
|
|
10
13
|
* components are cheaper to render and often used as wrappers like this. We're
|
|
@@ -94,12 +94,14 @@ var script = {
|
|
|
94
94
|
return this.bars.map((_ref, index) => {
|
|
95
95
|
let {
|
|
96
96
|
name,
|
|
97
|
-
data
|
|
97
|
+
data,
|
|
98
|
+
stack
|
|
98
99
|
} = _ref;
|
|
99
100
|
const color = colorFromDefaultPalette(index);
|
|
100
101
|
return generateBarSeries({
|
|
101
102
|
name,
|
|
102
103
|
data,
|
|
104
|
+
stack,
|
|
103
105
|
color
|
|
104
106
|
});
|
|
105
107
|
});
|
package/dist/tokens/js/tokens.js
CHANGED