@gitlab/ui 67.4.0 → 67.5.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/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/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js +1 -2
- package/dist/index.css.map +1 -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 +2 -2
- package/scss_to_js/scss_variables.js +146 -146
- package/scss_to_js/scss_variables.json +1278 -1278
- 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/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue +1 -2
- package/src/scss/storybook.scss +1 -1
- package/src/scss/storybook_dark_mode.scss +0 -1
- package/src/scss/tokens.scss +2 -0
- package/src/scss/utilities.scss +8 -0
- package/src/scss/utility-mixins/z-index.scss +1 -1
- package/src/scss/variables.scss +1 -185
- package/translations.json +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [67.5.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v67.5.0...v67.5.1) (2023-11-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **GlDuoChatMessage:** Use nextTick from component instance ([4e39ab6](https://gitlab.com/gitlab-org/gitlab-ui/commit/4e39ab6ec0a9c9e162f4342030b67b257c2b09e4))
|
|
7
|
+
|
|
8
|
+
# [67.5.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v67.4.0...v67.5.0) (2023-11-02)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **css:** Add focus variant for gl-z-index-1 ([8c08f01](https://gitlab.com/gitlab-org/gitlab-ui/commit/8c08f01a7877dd2836fb1eb024a9bfc8ad37cc44))
|
|
14
|
+
* **GlSorting:** Add opt-in for new dropdown design ([b4eb476](https://gitlab.com/gitlab-org/gitlab-ui/commit/b4eb476976ca488b89641404acd19c2029a5d27d))
|
|
15
|
+
* **GlSorting:** Make strings translatable ([2964d55](https://gitlab.com/gitlab-org/gitlab-ui/commit/2964d55864b17022d62c294ebf6c7babab611407))
|
|
16
|
+
|
|
1
17
|
# [67.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v67.3.3...v67.4.0) (2023-11-02)
|
|
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
|
package/dist/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { nextTick } from 'vue';
|
|
2
1
|
import GlDuoUserFeedback from '../../../user_feedback/user_feedback';
|
|
3
2
|
import { SafeHtmlDirective } from '../../../../../../directives/safe_html/safe_html';
|
|
4
3
|
import { MESSAGE_MODEL_ROLES } from '../../constants';
|
|
@@ -76,7 +75,7 @@ var script = {
|
|
|
76
75
|
},
|
|
77
76
|
methods: {
|
|
78
77
|
async hydrateContentWithGFM() {
|
|
79
|
-
await nextTick();
|
|
78
|
+
await this.$nextTick();
|
|
80
79
|
this.renderGFM(this.$refs.content);
|
|
81
80
|
},
|
|
82
81
|
async messageUpdateHandler() {
|