@gitlab/ui 64.5.0 → 64.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/CHANGELOG.md +7 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +9 -1
- package/package.json +1 -1
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.spec.js +14 -0
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.stories.js +2 -0
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [64.6.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v64.5.0...v64.6.0) (2023-06-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **GlDisclosureDropdown:** add `block` prop ([39f3a3d](https://gitlab.com/gitlab-org/gitlab-ui/commit/39f3a3db2892fe10bcc91819727ef2da59bcdd45))
|
|
7
|
+
|
|
1
8
|
# [64.5.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v64.4.0...v64.5.0) (2023-06-07)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -153,6 +153,14 @@ var script = {
|
|
|
153
153
|
required: false,
|
|
154
154
|
default: null
|
|
155
155
|
},
|
|
156
|
+
/**
|
|
157
|
+
* Render the toggle button as a block element
|
|
158
|
+
*/
|
|
159
|
+
block: {
|
|
160
|
+
type: Boolean,
|
|
161
|
+
required: false,
|
|
162
|
+
default: false
|
|
163
|
+
},
|
|
156
164
|
/**
|
|
157
165
|
* Custom offset to be applied to Floating UI's offset middleware.
|
|
158
166
|
* https://floating-ui.com/docs/offset
|
|
@@ -303,7 +311,7 @@ var script = {
|
|
|
303
311
|
const __vue_script__ = script;
|
|
304
312
|
|
|
305
313
|
/* template */
|
|
306
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-base-dropdown',{ref:"baseDropdown",staticClass:"gl-disclosure-dropdown",attrs:{"aria-labelledby":_vm.toggleAriaLabelledBy,"toggle-id":_vm.toggleId,"toggle-text":_vm.toggleText,"toggle-class":_vm.toggleClass,"text-sr-only":_vm.textSrOnly,"category":_vm.category,"variant":_vm.variant,"size":_vm.size,"icon":_vm.icon,"disabled":_vm.disabled,"loading":_vm.loading,"no-caret":_vm.noCaret,"placement":_vm.placement,"offset":_vm.dropdownOffset,"fluid-width":_vm.fluidWidth,"positioning-strategy":_vm.positioningStrategy},on:_vm._d({},[_vm.$options.events.GL_DROPDOWN_SHOWN,_vm.onShow,_vm.$options.events.GL_DROPDOWN_HIDDEN,_vm.onHide,_vm.$options.events.GL_DROPDOWN_FOCUS_CONTENT,_vm.onKeydown]),scopedSlots:_vm._u([(_vm.hasCustomToggle)?{key:"toggle",fn:function(){return [_vm._t("toggle")]},proxy:true}:null],null,true)},[_vm._v(" "),_vm._t("header"),_vm._v(" "),_c(_vm.disclosureTag,{ref:"content",tag:"component",class:_vm.$options.GL_DROPDOWN_CONTENTS_CLASS,attrs:{"id":_vm.disclosureId,"aria-labelledby":_vm.listAriaLabelledBy || _vm.toggleId,"data-testid":"disclosure-content","tabindex":"-1"},on:{"keydown":_vm.onKeydown,"click":_vm.handleAutoClose}},[_vm._t("default",function(){return [_vm._l((_vm.items),function(item,index){return [(_vm.isItem(item))?[_c('gl-disclosure-dropdown-item',{key:_vm.uniqueItemId(),attrs:{"item":item},on:{"action":_vm.handleAction},scopedSlots:_vm._u([{key:"list-item",fn:function(){return [_vm._t("list-item",null,{"item":item})]},proxy:true}],null,true)})]:[_c('gl-disclosure-dropdown-group',{key:item.name,attrs:{"bordered":index !== 0,"group":item},on:{"action":_vm.handleAction},scopedSlots:_vm._u([(_vm.$scopedSlots['group-label'])?{key:"group-label",fn:function(){return [_vm._t("group-label",null,{"group":item})]},proxy:true}:null],null,true)},[_vm._v(" "),(_vm.$scopedSlots['list-item'])?_vm._l((item.items),function(groupItem){return _c('gl-disclosure-dropdown-item',{key:_vm.uniqueItemId(),attrs:{"item":groupItem},on:{"action":_vm.handleAction},scopedSlots:_vm._u([{key:"list-item",fn:function(){return [_vm._t("list-item",null,{"item":groupItem})]},proxy:true}],null,true)})}):_vm._e()],2)]]})]})],2),_vm._v(" "),_vm._t("footer")],2)};
|
|
314
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-base-dropdown',{ref:"baseDropdown",staticClass:"gl-disclosure-dropdown",attrs:{"aria-labelledby":_vm.toggleAriaLabelledBy,"toggle-id":_vm.toggleId,"toggle-text":_vm.toggleText,"toggle-class":_vm.toggleClass,"text-sr-only":_vm.textSrOnly,"category":_vm.category,"variant":_vm.variant,"size":_vm.size,"icon":_vm.icon,"disabled":_vm.disabled,"loading":_vm.loading,"no-caret":_vm.noCaret,"placement":_vm.placement,"block":_vm.block,"offset":_vm.dropdownOffset,"fluid-width":_vm.fluidWidth,"positioning-strategy":_vm.positioningStrategy},on:_vm._d({},[_vm.$options.events.GL_DROPDOWN_SHOWN,_vm.onShow,_vm.$options.events.GL_DROPDOWN_HIDDEN,_vm.onHide,_vm.$options.events.GL_DROPDOWN_FOCUS_CONTENT,_vm.onKeydown]),scopedSlots:_vm._u([(_vm.hasCustomToggle)?{key:"toggle",fn:function(){return [_vm._t("toggle")]},proxy:true}:null],null,true)},[_vm._v(" "),_vm._t("header"),_vm._v(" "),_c(_vm.disclosureTag,{ref:"content",tag:"component",class:_vm.$options.GL_DROPDOWN_CONTENTS_CLASS,attrs:{"id":_vm.disclosureId,"aria-labelledby":_vm.listAriaLabelledBy || _vm.toggleId,"data-testid":"disclosure-content","tabindex":"-1"},on:{"keydown":_vm.onKeydown,"click":_vm.handleAutoClose}},[_vm._t("default",function(){return [_vm._l((_vm.items),function(item,index){return [(_vm.isItem(item))?[_c('gl-disclosure-dropdown-item',{key:_vm.uniqueItemId(),attrs:{"item":item},on:{"action":_vm.handleAction},scopedSlots:_vm._u([{key:"list-item",fn:function(){return [_vm._t("list-item",null,{"item":item})]},proxy:true}],null,true)})]:[_c('gl-disclosure-dropdown-group',{key:item.name,attrs:{"bordered":index !== 0,"group":item},on:{"action":_vm.handleAction},scopedSlots:_vm._u([(_vm.$scopedSlots['group-label'])?{key:"group-label",fn:function(){return [_vm._t("group-label",null,{"group":item})]},proxy:true}:null],null,true)},[_vm._v(" "),(_vm.$scopedSlots['list-item'])?_vm._l((item.items),function(groupItem){return _c('gl-disclosure-dropdown-item',{key:_vm.uniqueItemId(),attrs:{"item":groupItem},on:{"action":_vm.handleAction},scopedSlots:_vm._u([{key:"list-item",fn:function(){return [_vm._t("list-item",null,{"item":groupItem})]},proxy:true}],null,true)})}):_vm._e()],2)]]})]})],2),_vm._v(" "),_vm._t("footer")],2)};
|
|
307
315
|
var __vue_staticRenderFns__ = [];
|
|
308
316
|
|
|
309
317
|
/* style */
|
package/package.json
CHANGED
|
@@ -318,6 +318,20 @@ describe('GlDisclosureDropdown', () => {
|
|
|
318
318
|
});
|
|
319
319
|
});
|
|
320
320
|
|
|
321
|
+
describe('block prop', () => {
|
|
322
|
+
it('is disabled by default', () => {
|
|
323
|
+
buildWrapper();
|
|
324
|
+
|
|
325
|
+
expect(findBaseDropdown().props('block')).toBe(false);
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
it('is enabled when `block` is `true`', () => {
|
|
329
|
+
buildWrapper({ block: true });
|
|
330
|
+
|
|
331
|
+
expect(findBaseDropdown().props('block')).toBe(true);
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
|
|
321
335
|
describe('fluid width', () => {
|
|
322
336
|
it('is disabled by default', () => {
|
|
323
337
|
buildWrapper();
|
|
@@ -39,6 +39,7 @@ const makeBindings = (overrides = {}) =>
|
|
|
39
39
|
':icon': 'icon',
|
|
40
40
|
':toggle-aria-labelled-by': 'toggleAriaLabelledBy',
|
|
41
41
|
':list-aria-labelled-by': 'listAriaLabelledBy',
|
|
42
|
+
':block': 'block',
|
|
42
43
|
':fluid-width': 'fluidWidth',
|
|
43
44
|
':auto-close': 'autoClose',
|
|
44
45
|
':positioning-strategy': 'positioningStrategy',
|
|
@@ -203,6 +204,7 @@ export const CustomGroupsAndItems = (args, { argTypes }) => ({
|
|
|
203
204
|
CustomGroupsAndItems.args = {
|
|
204
205
|
items: mockGroupsCustomItem,
|
|
205
206
|
toggleText: 'Merge requests',
|
|
207
|
+
block: true,
|
|
206
208
|
};
|
|
207
209
|
CustomGroupsAndItems.decorators = [makeContainer({ height: '200px' })];
|
|
208
210
|
|
|
@@ -172,6 +172,14 @@ export default {
|
|
|
172
172
|
required: false,
|
|
173
173
|
default: null,
|
|
174
174
|
},
|
|
175
|
+
/**
|
|
176
|
+
* Render the toggle button as a block element
|
|
177
|
+
*/
|
|
178
|
+
block: {
|
|
179
|
+
type: Boolean,
|
|
180
|
+
required: false,
|
|
181
|
+
default: false,
|
|
182
|
+
},
|
|
175
183
|
/**
|
|
176
184
|
* Custom offset to be applied to Floating UI's offset middleware.
|
|
177
185
|
* https://floating-ui.com/docs/offset
|
|
@@ -334,6 +342,7 @@ export default {
|
|
|
334
342
|
:loading="loading"
|
|
335
343
|
:no-caret="noCaret"
|
|
336
344
|
:placement="placement"
|
|
345
|
+
:block="block"
|
|
337
346
|
:offset="dropdownOffset"
|
|
338
347
|
:fluid-width="fluidWidth"
|
|
339
348
|
:positioning-strategy="positioningStrategy"
|