@gitlab/ui 128.6.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/components/extended/multi_step_form_template/multi_step_form_template.js +87 -0
- package/dist/components/index.js +1 -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/dist/utils/i18n.js +14 -12
- 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/extended/multi_step_form_template/multi_step_form_template.vue +84 -0
- package/src/components/index.js +4 -0
- package/src/scss/components.scss +1 -0
- package/src/utils/i18n.js +13 -9
- package/translations.js +2 -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 };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { translate } from '../../../utils/i18n';
|
|
2
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
3
|
+
|
|
4
|
+
var script = {
|
|
5
|
+
name: 'GlMultiStepFormTemplate',
|
|
6
|
+
props: {
|
|
7
|
+
/**
|
|
8
|
+
* The tile of the form. Should not be specific to the current step.
|
|
9
|
+
*/
|
|
10
|
+
title: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
/**
|
|
15
|
+
* The number of the current step. If a non-zero number is passed, then the current step number will be shown at the top of the form.
|
|
16
|
+
*/
|
|
17
|
+
currentStep: {
|
|
18
|
+
type: Number,
|
|
19
|
+
required: false,
|
|
20
|
+
default: null
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* The total number of steps. If a non-zero number is passed to this prop and a non-zero number is passed to the `currentStep` prop, then they will be formatted together at the top of the form. In English, this will appear as `Step n of x` where n is the current step and x is the step total.
|
|
24
|
+
*/
|
|
25
|
+
stepsTotal: {
|
|
26
|
+
type: Number,
|
|
27
|
+
required: false,
|
|
28
|
+
default: null
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* Optional override to the semantic element used for the form title's heading tag. Defaults to `h1` but should be adjusted in usage to prevent unexpected heading level changes in the DOM.
|
|
32
|
+
*/
|
|
33
|
+
headingTag: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: false,
|
|
36
|
+
default: 'h1'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
computed: {
|
|
40
|
+
stepMessage() {
|
|
41
|
+
return this.stepsTotal ? translate('GlMultiStepFormTemplate.stepXofY', 'Step %{currentStep} of %{stepsTotal}', {
|
|
42
|
+
currentStep: this.currentStep,
|
|
43
|
+
stepsTotal: this.stepsTotal
|
|
44
|
+
}) : translate('GlMultiStepFormTemplate.stepX', 'Step %{currentStep}', {
|
|
45
|
+
currentStep: this.currentStep
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/* script */
|
|
52
|
+
const __vue_script__ = script;
|
|
53
|
+
|
|
54
|
+
/* template */
|
|
55
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-mx-auto gl-max-w-80 gl-pt-8"},[_c(_vm.headingTag,{tag:"component",staticClass:"gl-heading-1 gl-mb-3 gl-mt-0 gl-text-center",attrs:{"data-testid":"multi-step-form-title"}},[_vm._v("\n "+_vm._s(_vm.title)+"\n ")]),_vm._v(" "),(_vm.currentStep)?_c('p',{staticClass:"gl-m-0 gl-text-center",attrs:{"data-testid":"multi-step-form-steps"}},[_vm._v("\n "+_vm._s(_vm.stepMessage)+"\n ")]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-mt-7",attrs:{"data-testid":"multi-step-form-content"}},[_vm._t("default")],2),_vm._v(" "),(_vm.$scopedSlots.back || _vm.$scopedSlots.next)?_c('div',{staticClass:"gl-mt-6 gl-flex gl-justify-center gl-gap-3",attrs:{"data-testid":"multi-step-form-action"}},[_vm._t("back"),_vm._v(" "),_vm._t("next")],2):_vm._e(),_vm._v(" "),(_vm.$scopedSlots.footer)?_c('div',{staticClass:"gl-mt-7",attrs:{"data-testid":"multi-step-form-footer"}},[_vm._t("footer")],2):_vm._e()],1)};
|
|
56
|
+
var __vue_staticRenderFns__ = [];
|
|
57
|
+
|
|
58
|
+
/* style */
|
|
59
|
+
const __vue_inject_styles__ = undefined;
|
|
60
|
+
/* scoped */
|
|
61
|
+
const __vue_scope_id__ = undefined;
|
|
62
|
+
/* module identifier */
|
|
63
|
+
const __vue_module_identifier__ = undefined;
|
|
64
|
+
/* functional template */
|
|
65
|
+
const __vue_is_functional_template__ = false;
|
|
66
|
+
/* style inject */
|
|
67
|
+
|
|
68
|
+
/* style inject SSR */
|
|
69
|
+
|
|
70
|
+
/* style inject shadow dom */
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
const __vue_component__ = /*#__PURE__*/__vue_normalize__(
|
|
75
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
76
|
+
__vue_inject_styles__,
|
|
77
|
+
__vue_script__,
|
|
78
|
+
__vue_scope_id__,
|
|
79
|
+
__vue_is_functional_template__,
|
|
80
|
+
__vue_module_identifier__,
|
|
81
|
+
false,
|
|
82
|
+
undefined,
|
|
83
|
+
undefined,
|
|
84
|
+
undefined
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
export { __vue_component__ as default };
|
package/dist/components/index.js
CHANGED
|
@@ -103,3 +103,4 @@ export { default as GlIntersperse } from './utilities/intersperse/intersperse';
|
|
|
103
103
|
export { default as GlSprintf } from './utilities/sprintf/sprintf';
|
|
104
104
|
export { default as GlTruncate } from './utilities/truncate/truncate';
|
|
105
105
|
export { default as GlTruncateText } from './utilities/truncate_text/truncate_text';
|
|
106
|
+
export { default as GlMultiStepFormTemplate } from './extended/multi_step_form_template/multi_step_form_template';
|