@gitlab/ui 128.7.0 → 128.8.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/dist/components/base/attribute_list/attribute_list.js +93 -0
- package/dist/components/base/path/path.js +4 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/package.json +7 -7
- package/src/components/base/attribute_list/attribute_list.scss +50 -0
- package/src/components/base/attribute_list/attribute_list.vue +94 -0
- package/src/components/base/path/path.vue +4 -0
- package/src/scss/components.scss +1 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import GlIcon from '../icon/icon';
|
|
2
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
3
|
+
|
|
4
|
+
var script = {
|
|
5
|
+
name: 'GlAttributeList',
|
|
6
|
+
components: {
|
|
7
|
+
GlIcon
|
|
8
|
+
},
|
|
9
|
+
props: {
|
|
10
|
+
/**
|
|
11
|
+
* Array of items to display. Each item should have `label`, `text`, and optionally `icon` properties.
|
|
12
|
+
*/
|
|
13
|
+
items: {
|
|
14
|
+
type: Array,
|
|
15
|
+
required: false,
|
|
16
|
+
default: () => [],
|
|
17
|
+
validator: items => {
|
|
18
|
+
return items.every(item => item && typeof item.label === 'string' && typeof item.text === 'string');
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* CSS classes on attribute list item label contents
|
|
23
|
+
*/
|
|
24
|
+
labelClass: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: false,
|
|
27
|
+
default: ''
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* CSS classes on attribute list item description contents
|
|
31
|
+
*/
|
|
32
|
+
descriptionClass: {
|
|
33
|
+
type: String,
|
|
34
|
+
required: false,
|
|
35
|
+
default: ''
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* Layout of label and text: 'horizontal' for inline/flex or 'vertical' for block.
|
|
39
|
+
*/
|
|
40
|
+
layout: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: 'horizontal',
|
|
43
|
+
required: false,
|
|
44
|
+
validator: value => ['horizontal', 'vertical'].includes(value)
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
computed: {
|
|
48
|
+
layoutClass() {
|
|
49
|
+
return {
|
|
50
|
+
'gl-attribute-list-horizontal-items': this.layout === 'horizontal',
|
|
51
|
+
'gl-attribute-list-vertical-items': this.layout === 'vertical'
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/* script */
|
|
58
|
+
const __vue_script__ = script;
|
|
59
|
+
|
|
60
|
+
/* template */
|
|
61
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('dl',{staticClass:"gl-attribute-list",class:_vm.layoutClass,attrs:{"data-testid":"gl-attribute-list"}},_vm._l((_vm.items),function(item,index){return _c('div',{key:index,staticClass:"gl-attribute-list-item",attrs:{"data-testid":"gl-attribute-list-item"}},[_c('dt',{staticClass:"gl-attribute-list-item-label",class:_vm.labelClass,attrs:{"data-testid":"gl-attribute-list-item-label"}},[_vm._t("label",function(){return [(item.icon)?_c('gl-icon',{staticClass:"gl-attribute-list-item-label-icon",attrs:{"name":item.icon,"variant":"strong"}}):_vm._e(),_vm._v(" "),_c('span',[_vm._v(_vm._s(item.label))])]},{"item":item,"index":index})],2),_vm._v(" "),_c('dd',{staticClass:"gl-attribute-list-item-description",class:_vm.descriptionClass,attrs:{"data-testid":"gl-attribute-list-item-description"}},[_vm._t("description",function(){return [_vm._v("\n "+_vm._s(item.text)+"\n ")]},{"item":item,"index":index})],2)])}),0)};
|
|
62
|
+
var __vue_staticRenderFns__ = [];
|
|
63
|
+
|
|
64
|
+
/* style */
|
|
65
|
+
const __vue_inject_styles__ = undefined;
|
|
66
|
+
/* scoped */
|
|
67
|
+
const __vue_scope_id__ = undefined;
|
|
68
|
+
/* module identifier */
|
|
69
|
+
const __vue_module_identifier__ = undefined;
|
|
70
|
+
/* functional template */
|
|
71
|
+
const __vue_is_functional_template__ = false;
|
|
72
|
+
/* style inject */
|
|
73
|
+
|
|
74
|
+
/* style inject SSR */
|
|
75
|
+
|
|
76
|
+
/* style inject shadow dom */
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
const __vue_component__ = /*#__PURE__*/__vue_normalize__(
|
|
81
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
82
|
+
__vue_inject_styles__,
|
|
83
|
+
__vue_script__,
|
|
84
|
+
__vue_scope_id__,
|
|
85
|
+
__vue_is_functional_template__,
|
|
86
|
+
__vue_module_identifier__,
|
|
87
|
+
false,
|
|
88
|
+
undefined,
|
|
89
|
+
undefined,
|
|
90
|
+
undefined
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
export { __vue_component__ as default };
|
|
@@ -132,6 +132,9 @@ var script = {
|
|
|
132
132
|
},
|
|
133
133
|
pathId(index) {
|
|
134
134
|
return `${this.pathUuid}-item-${index}`;
|
|
135
|
+
},
|
|
136
|
+
getAriaCurrentAttr(index) {
|
|
137
|
+
return index === this.selectedIndex;
|
|
135
138
|
}
|
|
136
139
|
}
|
|
137
140
|
};
|
|
@@ -140,7 +143,7 @@ var script = {
|
|
|
140
143
|
const __vue_script__ = script;
|
|
141
144
|
|
|
142
145
|
/* template */
|
|
143
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"gl-resize-observer-directive",rawName:"v-gl-resize-observer-directive",value:(_vm.handleResize),expression:"handleResize"}],staticClass:"gl-path-nav",style:({ '--path-bg-color': _vm.backgroundColor }),attrs:{"data-testid":"gl-path-nav"}},[_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollLeft),expression:"displayScrollLeft"}],staticClass:"gl-path-fade gl-path-fade-left"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll left"},on:{"click":_vm.scrollPathLeft}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-left"}})],1)]),_vm._v(" "),_c('ul',{ref:"pathNavList",staticClass:"gl-path-nav-list"},_vm._l((_vm.items),function(item,index){return _c('li',{key:index,ref:"pathListItems",refInFor:true,staticClass:"gl-path-nav-list-item"},[_c('button',{class:_vm.pathItemClass(index),attrs:{"id":_vm.pathId(index),"category":item.disabled ? 'tertiary' : undefined,"disabled":item.disabled},on:{"click":function($event){return _vm.onItemClicked(index)}}},[(_vm.shouldDisplayIcon(item.icon))?_c('gl-icon',{staticClass:"gl-mr-2",attrs:{"name":item.icon,"data-testid":"gl-path-item-icon"}}):_vm._e(),_vm._v(_vm._s(item.title)),(item.metric)?_c('span',{staticClass:"gl-pl-2 gl-font-normal"},[_vm._v(_vm._s(item.metric))]):_vm._e()],1),_vm._v(" "),_vm._t("default",null,{"pathItem":item,"pathId":_vm.pathId(index)})],2)}),0),_vm._v(" "),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollRight),expression:"displayScrollRight"}],staticClass:"gl-path-fade gl-path-fade-right"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll right"},on:{"click":_vm.scrollPathRight}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-right"}})],1)])])};
|
|
146
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"gl-resize-observer-directive",rawName:"v-gl-resize-observer-directive",value:(_vm.handleResize),expression:"handleResize"}],staticClass:"gl-path-nav",style:({ '--path-bg-color': _vm.backgroundColor }),attrs:{"data-testid":"gl-path-nav"}},[_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollLeft),expression:"displayScrollLeft"}],staticClass:"gl-path-fade gl-path-fade-left"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll left"},on:{"click":_vm.scrollPathLeft}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-left"}})],1)]),_vm._v(" "),_c('ul',{ref:"pathNavList",staticClass:"gl-path-nav-list"},_vm._l((_vm.items),function(item,index){return _c('li',{key:index,ref:"pathListItems",refInFor:true,staticClass:"gl-path-nav-list-item"},[_c('button',{class:_vm.pathItemClass(index),attrs:{"id":_vm.pathId(index),"aria-current":_vm.getAriaCurrentAttr(index),"category":item.disabled ? 'tertiary' : undefined,"disabled":item.disabled},on:{"click":function($event){return _vm.onItemClicked(index)}}},[(_vm.shouldDisplayIcon(item.icon))?_c('gl-icon',{staticClass:"gl-mr-2",attrs:{"name":item.icon,"data-testid":"gl-path-item-icon"}}):_vm._e(),_vm._v(_vm._s(item.title)),(item.metric)?_c('span',{staticClass:"gl-pl-2 gl-font-normal"},[_vm._v(_vm._s(item.metric))]):_vm._e()],1),_vm._v(" "),_vm._t("default",null,{"pathItem":item,"pathId":_vm.pathId(index)})],2)}),0),_vm._v(" "),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollRight),expression:"displayScrollRight"}],staticClass:"gl-path-fade gl-path-fade-right"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll right"},on:{"click":_vm.scrollPathRight}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-right"}})],1)])])};
|
|
144
147
|
var __vue_staticRenderFns__ = [];
|
|
145
148
|
|
|
146
149
|
/* style */
|