@gitlab/ui 68.0.0 → 68.1.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 +12 -0
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +4 -1
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +4 -3
- 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 +1 -1
- package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +4 -1
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.spec.js +40 -3
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +7 -2
- package/src/scss/utilities.scss +10 -0
- package/src/scss/utility-mixins/spacing.scss +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# [68.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v68.0.0...v68.1.0) (2023-11-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **GlDisclosureDropdown:** nested dropdown click closes a parent one ([896ca20](https://gitlab.com/gitlab-org/gitlab-ui/commit/896ca202424d1f5adcca352101c8cd56d007a4df))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **css:** Add gl-sm-pr-4 utility ([a763496](https://gitlab.com/gitlab-org/gitlab-ui/commit/a7634968fe7a2771796df73d74dd1a9f8ece0012))
|
|
12
|
+
|
|
1
13
|
# [68.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v67.5.2...v68.0.0) (2023-11-07)
|
|
2
14
|
|
|
3
15
|
|
|
@@ -9,8 +9,10 @@ import { OutsideDirective } from '../../../../directives/outside/outside';
|
|
|
9
9
|
import { DEFAULT_OFFSET, FIXED_WIDTH_CLASS } from './constants';
|
|
10
10
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
11
11
|
|
|
12
|
+
const BASE_DROPDOWN_CLASS = 'gl-new-dropdown';
|
|
12
13
|
var script = {
|
|
13
14
|
name: 'BaseDropdown',
|
|
15
|
+
BASE_DROPDOWN_CLASS,
|
|
14
16
|
components: {
|
|
15
17
|
GlButton,
|
|
16
18
|
GlIcon
|
|
@@ -406,7 +408,7 @@ var script = {
|
|
|
406
408
|
const __vue_script__ = script;
|
|
407
409
|
|
|
408
410
|
/* template */
|
|
409
|
-
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"}],
|
|
411
|
+
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)};
|
|
410
412
|
var __vue_staticRenderFns__ = [];
|
|
411
413
|
|
|
412
414
|
/* style */
|
|
@@ -439,3 +441,4 @@ var __vue_staticRenderFns__ = [];
|
|
|
439
441
|
);
|
|
440
442
|
|
|
441
443
|
export default __vue_component__;
|
|
444
|
+
export { BASE_DROPDOWN_CLASS };
|
|
@@ -3,13 +3,14 @@ import uniqueId from 'lodash/uniqueId';
|
|
|
3
3
|
import { stopEvent, filterVisible } from '../../../../utils/utils';
|
|
4
4
|
import { GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, GL_DROPDOWN_BEFORE_CLOSE, GL_DROPDOWN_FOCUS_CONTENT, POSITION_ABSOLUTE, POSITION_FIXED, HOME, END, ARROW_UP, ARROW_DOWN, ENTER, SPACE, GL_DROPDOWN_CONTENTS_CLASS } from '../constants';
|
|
5
5
|
import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions, dropdownPlacements } from '../../../../utils/constants';
|
|
6
|
-
import GlBaseDropdown from '../base_dropdown/base_dropdown';
|
|
6
|
+
import GlBaseDropdown, { BASE_DROPDOWN_CLASS } from '../base_dropdown/base_dropdown';
|
|
7
7
|
import GlDisclosureDropdownItem, { ITEM_CLASS } from './disclosure_dropdown_item';
|
|
8
8
|
import GlDisclosureDropdownGroup from './disclosure_dropdown_group';
|
|
9
9
|
import { itemsValidator, hasOnlyListItems, isItem } from './utils';
|
|
10
10
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
11
11
|
|
|
12
12
|
//
|
|
13
|
+
const DROPDOWN_SELECTOR = `.${BASE_DROPDOWN_CLASS}`;
|
|
13
14
|
const ITEM_SELECTOR = `.${ITEM_CLASS}`;
|
|
14
15
|
var script = {
|
|
15
16
|
name: 'GlDisclosureDropdown',
|
|
@@ -317,7 +318,7 @@ var script = {
|
|
|
317
318
|
this.$emit('action', action);
|
|
318
319
|
},
|
|
319
320
|
handleAutoClose(e) {
|
|
320
|
-
if (this.autoClose && e.target.closest(ITEM_SELECTOR)) {
|
|
321
|
+
if (this.autoClose && e.target.closest(ITEM_SELECTOR) && e.target.closest(DROPDOWN_SELECTOR) === this.$refs.baseDropdown.$el) {
|
|
321
322
|
this.closeAndFocus();
|
|
322
323
|
}
|
|
323
324
|
},
|
|
@@ -366,4 +367,4 @@ var __vue_staticRenderFns__ = [];
|
|
|
366
367
|
);
|
|
367
368
|
|
|
368
369
|
export default __vue_component__;
|
|
369
|
-
export { ITEM_SELECTOR };
|
|
370
|
+
export { DROPDOWN_SELECTOR, ITEM_SELECTOR };
|
package/dist/tokens/js/tokens.js
CHANGED