@gitlab/ui 78.2.1 → 78.2.3

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 CHANGED
@@ -1,3 +1,18 @@
1
+ ## [78.2.3](https://gitlab.com/gitlab-org/gitlab-ui/compare/v78.2.2...v78.2.3) (2024-03-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **GlBaseDropdown:** Check focused element before closing the dropdown ([54948dd](https://gitlab.com/gitlab-org/gitlab-ui/commit/54948dd3d8848f5ac0fc8d3cb225745401fbe7ea))
7
+ * **GlBaseDropdown:** Close menu with escape key on toggle ([990f65d](https://gitlab.com/gitlab-org/gitlab-ui/commit/990f65d07b831a784ddb8ec1c494e4e055d54c5c))
8
+
9
+ ## [78.2.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v78.2.1...v78.2.2) (2024-03-20)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * Show sort icon on hover in table header ([ab36e49](https://gitlab.com/gitlab-org/gitlab-ui/commit/ab36e4913769ac4fab2f96c667bd884f968f6893))
15
+
1
16
  ## [78.2.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v78.2.0...v78.2.1) (2024-03-19)
2
17
 
3
18
 
package/README.md CHANGED
@@ -46,6 +46,11 @@ GitLab UI provides component styles, a utility-class library, and SCSS utilities
46
46
 
47
47
  ## Quick start - development
48
48
 
49
+ **Note:** GitLab UI isn't designed to be built on Windows natively. Either
50
+ [WSL](https://learn.microsoft.com/en-us/windows/wsl/) or
51
+ [GitPod](https://www.gitpod.io/docs/configure/authentication/gitlab) can be used to set up a
52
+ UNIX-like environment in which to build it.
53
+
49
54
  Make sure you have [Node](https://nodejs.org/en/) 16.x (LTS) and [Yarn](https://yarnpkg.com/) 1.22
50
55
  or newer.
51
56
 
@@ -376,8 +376,9 @@ var script = {
376
376
  if (!this.visible) {
377
377
  return;
378
378
  }
379
+ const hadFocusWithin = this.$el.contains(document.activeElement);
379
380
  const hasToggled = await this.toggle(event);
380
- if (!this.$el.contains(document.activeElement)) {
381
+ if (!hadFocusWithin) {
381
382
  return;
382
383
  }
383
384
  if (hasToggled) {
@@ -424,7 +425,7 @@ var script = {
424
425
  const __vue_script__ = script;
425
426
 
426
427
  /* template */
427
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"outside",rawName:"v-outside",value:(_vm.close),expression:"close"}],class:[_vm.$options.BASE_DROPDOWN_CLASS, { 'gl-display-block!': _vm.block }]},[_c(_vm.toggleComponent,_vm._g(_vm._b({ref:"toggle",tag:"component",attrs:{"id":_vm.toggleId,"data-testid":"base-dropdown-toggle"}},'component',_vm.toggleAttributes,false),_vm.toggleListeners),[_vm._t("toggle",function(){return [_c('span',{staticClass:"gl-new-dropdown-button-text",class:{ 'gl-sr-only': _vm.textSrOnly }},[_vm._v("\n "+_vm._s(_vm.toggleText)+"\n ")]),_vm._v(" "),(!_vm.noCaret)?_c('gl-icon',{staticClass:"gl-button-icon gl-new-dropdown-chevron",attrs:{"name":"chevron-down"}}):_vm._e()]})],2),_vm._v(" "),_c('div',{ref:"content",staticClass:"gl-new-dropdown-panel",class:_vm.panelClasses,attrs:{"id":_vm.baseDropdownId,"data-testid":"base-dropdown-menu"},on:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }$event.stopPropagation();$event.preventDefault();return _vm.closeAndFocus.apply(null, arguments)}}},[_c('div',{staticClass:"gl-new-dropdown-inner"},[_vm._t("default")],2)])],1)};
428
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"outside",rawName:"v-outside",value:(_vm.close),expression:"close"}],class:[_vm.$options.BASE_DROPDOWN_CLASS, { 'gl-display-block!': _vm.block }]},[_c(_vm.toggleComponent,_vm._g(_vm._b({ref:"toggle",tag:"component",attrs:{"id":_vm.toggleId,"data-testid":"base-dropdown-toggle"},on:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }$event.stopPropagation();$event.preventDefault();return _vm.close.apply(null, arguments)}}},'component',_vm.toggleAttributes,false),_vm.toggleListeners),[_vm._t("toggle",function(){return [_c('span',{staticClass:"gl-new-dropdown-button-text",class:{ 'gl-sr-only': _vm.textSrOnly }},[_vm._v("\n "+_vm._s(_vm.toggleText)+"\n ")]),_vm._v(" "),(!_vm.noCaret)?_c('gl-icon',{staticClass:"gl-button-icon gl-new-dropdown-chevron",attrs:{"name":"chevron-down"}}):_vm._e()]})],2),_vm._v(" "),_c('div',{ref:"content",staticClass:"gl-new-dropdown-panel",class:_vm.panelClasses,attrs:{"id":_vm.baseDropdownId,"data-testid":"base-dropdown-menu"},on:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }$event.stopPropagation();$event.preventDefault();return _vm.closeAndFocus.apply(null, arguments)}}},[_c('div',{staticClass:"gl-new-dropdown-inner"},[_vm._t("default")],2)])],1)};
428
429
  var __vue_staticRenderFns__ = [];
429
430
 
430
431
  /* style */
@@ -74,14 +74,28 @@ var script = {
74
74
  } = _ref2;
75
75
  return field === null || field === void 0 ? void 0 : field.sortable;
76
76
  },
77
- getSortingIcon(_ref3) {
77
+ activeSortingColumn(_ref3) {
78
78
  let {
79
79
  field
80
80
  } = _ref3;
81
- if (this.localSortBy !== (field === null || field === void 0 ? void 0 : field.key)) {
82
- return null;
81
+ return this.localSortBy === (field === null || field === void 0 ? void 0 : field.key);
82
+ },
83
+ getSortingIcon(_ref4) {
84
+ let {
85
+ field
86
+ } = _ref4;
87
+ if (this.activeSortingColumn({
88
+ field
89
+ })) {
90
+ if (this.localSortDesc) {
91
+ return '↓';
92
+ }
93
+ return '↑';
94
+ }
95
+ if (this.$attrs['sort-direction'] === 'desc') {
96
+ return '↓';
83
97
  }
84
- return this.localSortDesc ? 'arrow-down' : 'arrow-up';
98
+ return '';
85
99
  }
86
100
  }
87
101
  };
@@ -90,7 +104,7 @@ var script = {
90
104
  const __vue_script__ = script;
91
105
 
92
106
  /* template */
93
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-table',_vm._g(_vm._b({attrs:{"table-class":_vm.localTableClass,"fields":_vm.fields,"sort-by":_vm.localSortBy,"sort-desc":_vm.localSortDesc},on:{"update:sortBy":function($event){_vm.localSortBy=$event;},"update:sort-by":function($event){_vm.localSortBy=$event;},"update:sortDesc":function($event){_vm.localSortDesc=$event;},"update:sort-desc":function($event){_vm.localSortDesc=$event;}},scopedSlots:_vm._u([_vm._l((Object.keys(_vm.$scopedSlots)),function(slotName){return {key:slotName,fn:function(scope){return [_vm._t(slotName,null,null,scope)]}}}),_vm._l((_vm.headSlots),function(headSlotName){return {key:headSlotName,fn:function(scope){return [_c('span',{key:headSlotName},[_vm._t(headSlotName,function(){return [_c('span',[_vm._v(_vm._s(scope.label))])]},null,scope),(_vm.isSortable(scope))?[(_vm.getSortingIcon(scope) && _vm.getSortingIcon(scope) === 'arrow-up')?_c('span',{staticClass:"gl-ml-3 gl-min-w-5 gl-text-gray-900 gl-text-center",attrs:{"name":"sort-icon"}},[_vm._v("\n ↑\n ")]):(_vm.getSortingIcon(scope) && _vm.getSortingIcon(scope) === 'arrow-down')?_c('span',{staticClass:"gl-ml-3 gl-min-w-5 gl-text-gray-900 gl-text-center",attrs:{"name":"sort-icon"}},[_vm._v("\n ↓\n ")]):_c('span',{staticClass:"gl-display-inline-block gl-w-5 gl-h-3 gl-ml-3"})]:_vm._e()],2)]}}})],null,true)},'b-table',_vm.$attrs,false),_vm.$listeners))};
107
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-table',_vm._g(_vm._b({attrs:{"table-class":_vm.localTableClass,"fields":_vm.fields,"sort-by":_vm.localSortBy,"sort-desc":_vm.localSortDesc},on:{"update:sortBy":function($event){_vm.localSortBy=$event;},"update:sort-by":function($event){_vm.localSortBy=$event;},"update:sortDesc":function($event){_vm.localSortDesc=$event;},"update:sort-desc":function($event){_vm.localSortDesc=$event;}},scopedSlots:_vm._u([_vm._l((Object.keys(_vm.$scopedSlots)),function(slotName){return {key:slotName,fn:function(scope){return [_vm._t(slotName,null,null,scope)]}}}),_vm._l((_vm.headSlots),function(headSlotName){return {key:headSlotName,fn:function(scope){return [_c('div',{key:headSlotName,staticClass:"gl-display-flex"},[_vm._t(headSlotName,function(){return [_c('span',[_vm._v(_vm._s(scope.label))])]},null,scope),(_vm.isSortable(scope))?[_c('div',{staticClass:"gl-ml-2 gl-w-5 gl-text-gray-900 gl-display-flex gl-justify-content-center"},[_c('span',{class:{ 'gl-display-none': !_vm.activeSortingColumn(scope) },attrs:{"name":"sort-icon","data-testid":"sort-icon"}},[_vm._v("\n "+_vm._s(_vm.getSortingIcon(scope))+"\n ")])])]:_vm._e()],2)]}}})],null,true)},'b-table',_vm.$attrs,false),_vm.$listeners))};
94
108
  var __vue_staticRenderFns__ = [];
95
109
 
96
110
  /* style */