@gitlab/ui 128.7.0 → 128.8.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/dist/components/base/attribute_list/attribute_list.js +93 -0
- 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/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 };
|