@gitlab/ui 129.2.0 → 129.3.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.
|
@@ -67,8 +67,14 @@ var script = {
|
|
|
67
67
|
var _this$config$panels;
|
|
68
68
|
return ((_this$config$panels = this.config.panels) === null || _this$config$panels === void 0 ? void 0 : _this$config$panels.length) > 0;
|
|
69
69
|
},
|
|
70
|
+
dashboardHasTitle() {
|
|
71
|
+
return this.$scopedSlots.title || Boolean(this.config.title);
|
|
72
|
+
},
|
|
70
73
|
dashboardHasDescription() {
|
|
71
74
|
return this.$scopedSlots.description || Boolean(this.config.description);
|
|
75
|
+
},
|
|
76
|
+
dashboardHasHeader() {
|
|
77
|
+
return this.$scopedSlots.header || this.$scopedSlots.actions || this.dashboardHasTitle || this.dashboardHasDescription;
|
|
72
78
|
}
|
|
73
79
|
},
|
|
74
80
|
methods: {
|
|
@@ -82,7 +88,7 @@ var script = {
|
|
|
82
88
|
const __vue_script__ = script;
|
|
83
89
|
|
|
84
90
|
/* template */
|
|
85
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('section',{staticClass:"gl-my-4 gl-flex gl-items-center"},[_vm._t("header",function(){return [_c('div',{staticClass:"gl-flex gl-w-full gl-flex-col"},[_c('div',{staticClass:"gl-flex gl-items-center"},[_vm._t("title",function(){return [_c('h2',{staticClass:"gl-my-0",attrs:{"data-testid":"title"}},[_vm._v(_vm._s(_vm.config.title))])]})],2),_vm._v(" "),(_vm.dashboardHasDescription)?_c('div',{staticClass:"gl-mt-3 gl-flex"},[_vm._t("description",function(){return [_c('p',{staticClass:"gl-mb-0",attrs:{"data-testid":"description"}},[_vm._v("\n "+_vm._s(_vm.config.description)+"\n ")])]})],2):_vm._e()])]}),_vm._v(" "),(_vm.$scopedSlots.actions)?_c('div',{attrs:{"data-testid":"actions-container"}},[_vm._t("actions")],2):_vm._e()],2),_vm._v(" "),_c('div',{staticClass:"gl-flex"},[_c('div',{staticClass:"gl-flex gl-min-w-0 gl-grow gl-flex-col"},[_vm._t("alert"),_vm._v(" "),(_vm.$scopedSlots.filters)?_c('section',{staticClass:"gl-flex gl-flex-row gl-flex-wrap gl-gap-5 gl-pb-3 gl-pt-4",attrs:{"data-testid":"filters-container"}},[_vm._t("filters")],2):_vm._e(),_vm._v(" "),(_vm.dashboardHasPanels)?_c('grid-layout',{staticClass:"-gl-mx-3",attrs:{"value":_vm.config,"is-static-grid":_vm.isStaticGrid,"cell-height":_vm.cellHeight,"min-cell-height":_vm.minCellHeight},on:{"input":_vm.emitChanges},scopedSlots:_vm._u([{key:"panel",fn:function(ref){
|
|
91
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.dashboardHasHeader)?_c('section',{staticClass:"gl-my-4 gl-flex gl-items-center",attrs:{"data-testid":"header-container"}},[_vm._t("header",function(){return [_c('div',{staticClass:"gl-flex gl-w-full gl-flex-col"},[(_vm.dashboardHasTitle)?_c('div',{staticClass:"gl-flex gl-items-center"},[_vm._t("title",function(){return [_c('h2',{staticClass:"gl-my-0",attrs:{"data-testid":"title"}},[_vm._v(_vm._s(_vm.config.title))])]})],2):_vm._e(),_vm._v(" "),(_vm.dashboardHasDescription)?_c('div',{staticClass:"gl-mt-3 gl-flex"},[_vm._t("description",function(){return [_c('p',{staticClass:"gl-mb-0",attrs:{"data-testid":"description"}},[_vm._v("\n "+_vm._s(_vm.config.description)+"\n ")])]})],2):_vm._e()])]}),_vm._v(" "),(_vm.$scopedSlots.actions)?_c('div',{attrs:{"data-testid":"actions-container"}},[_vm._t("actions")],2):_vm._e()],2):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-flex"},[_c('div',{staticClass:"gl-flex gl-min-w-0 gl-grow gl-flex-col"},[_vm._t("alert"),_vm._v(" "),(_vm.$scopedSlots.filters)?_c('section',{staticClass:"gl-flex gl-flex-row gl-flex-wrap gl-gap-5 gl-pb-3 gl-pt-4",attrs:{"data-testid":"filters-container"}},[_vm._t("filters")],2):_vm._e(),_vm._v(" "),(_vm.dashboardHasPanels)?_c('grid-layout',{staticClass:"-gl-mx-3",attrs:{"value":_vm.config,"is-static-grid":_vm.isStaticGrid,"cell-height":_vm.cellHeight,"min-cell-height":_vm.minCellHeight},on:{"input":_vm.emitChanges},scopedSlots:_vm._u([{key:"panel",fn:function(ref){
|
|
86
92
|
var panel = ref.panel;
|
|
87
93
|
return [_vm._t("panel",null,null,{ panel: panel })]}}],null,true)}):_vm._t("empty-state")],2)]),_vm._v(" "),_vm._t("footer")],2)};
|
|
88
94
|
var __vue_staticRenderFns__ = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "129.
|
|
3
|
+
"version": "129.3.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"@cypress/grep": "^4.1.1",
|
|
102
102
|
"@gitlab/fonts": "^1.3.1",
|
|
103
103
|
"@gitlab/svgs": "*",
|
|
104
|
-
"@jest/test-sequencer": "30.
|
|
104
|
+
"@jest/test-sequencer": "30.3.0",
|
|
105
105
|
"@rollup/plugin-commonjs": "^28.0.9",
|
|
106
106
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
107
107
|
"@rollup/plugin-replace": "^6.0.3",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"autoprefixer": "10.4.27",
|
|
133
133
|
"axe-playwright": "^2.2.2",
|
|
134
134
|
"babel-loader": "^9.2.1",
|
|
135
|
-
"cypress": "15.
|
|
135
|
+
"cypress": "15.12.0",
|
|
136
136
|
"cypress-real-events": "^1.15.0",
|
|
137
137
|
"dompurify": "^3.1.2",
|
|
138
138
|
"emoji-regex": "^10.6.0",
|
|
@@ -67,9 +67,20 @@ export default {
|
|
|
67
67
|
dashboardHasPanels() {
|
|
68
68
|
return this.config.panels?.length > 0;
|
|
69
69
|
},
|
|
70
|
+
dashboardHasTitle() {
|
|
71
|
+
return this.$scopedSlots.title || Boolean(this.config.title);
|
|
72
|
+
},
|
|
70
73
|
dashboardHasDescription() {
|
|
71
74
|
return this.$scopedSlots.description || Boolean(this.config.description);
|
|
72
75
|
},
|
|
76
|
+
dashboardHasHeader() {
|
|
77
|
+
return (
|
|
78
|
+
this.$scopedSlots.header ||
|
|
79
|
+
this.$scopedSlots.actions ||
|
|
80
|
+
this.dashboardHasTitle ||
|
|
81
|
+
this.dashboardHasDescription
|
|
82
|
+
);
|
|
83
|
+
},
|
|
73
84
|
},
|
|
74
85
|
methods: {
|
|
75
86
|
emitChanges(newConfig) {
|
|
@@ -80,12 +91,16 @@ export default {
|
|
|
80
91
|
</script>
|
|
81
92
|
<template>
|
|
82
93
|
<div>
|
|
83
|
-
<section
|
|
94
|
+
<section
|
|
95
|
+
v-if="dashboardHasHeader"
|
|
96
|
+
data-testid="header-container"
|
|
97
|
+
class="gl-my-4 gl-flex gl-items-center"
|
|
98
|
+
>
|
|
84
99
|
<!-- @slot Used to render custom dashboard header state. Replaces the default rendering. -->
|
|
85
100
|
<slot name="header">
|
|
86
101
|
<div class="gl-flex gl-w-full gl-flex-col">
|
|
87
102
|
<!-- Dashboard title -->
|
|
88
|
-
<div class="gl-flex gl-items-center">
|
|
103
|
+
<div v-if="dashboardHasTitle" class="gl-flex gl-items-center">
|
|
89
104
|
<!-- @slot Used to render custom dashboard titles. Replaces the default rendering. -->
|
|
90
105
|
<slot name="title">
|
|
91
106
|
<h2 data-testid="title" class="gl-my-0">{{ config.title }}</h2>
|