@gitlab/ui 123.1.0 → 123.2.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/popover/popover.js +18 -3
- package/dist/components/dashboards/dashboard_panel/dashboard_panel.js +2 -2
- package/dist/components/experimental/experiment_badge/experiment_badge.js +1 -1
- package/package.json +3 -3
- package/src/components/base/popover/popover.vue +21 -3
- package/src/components/dashboards/dashboard_panel/dashboard_panel.vue +2 -2
- package/src/components/experimental/experiment_badge/experiment_badge.vue +1 -1
|
@@ -17,9 +17,9 @@ var script = {
|
|
|
17
17
|
inheritAttrs: false,
|
|
18
18
|
props: {
|
|
19
19
|
cssClasses: {
|
|
20
|
-
type: Array,
|
|
20
|
+
type: [Array, String, Object],
|
|
21
21
|
required: false,
|
|
22
|
-
default:
|
|
22
|
+
default: ''
|
|
23
23
|
},
|
|
24
24
|
/**
|
|
25
25
|
* Space-separated triggers for the popover.
|
|
@@ -57,13 +57,28 @@ var script = {
|
|
|
57
57
|
return this.$scopedSlots.title || this.title;
|
|
58
58
|
},
|
|
59
59
|
customClass() {
|
|
60
|
-
return ['gl-popover', this.hasTitle && 'has-title', this.showCloseButton && 'has-close-button', ...this.cssClasses].filter(Boolean).join(' ');
|
|
60
|
+
return ['gl-popover', this.hasTitle && 'has-title', this.showCloseButton && 'has-close-button', ...this.normalizedCssClasses(this.cssClasses)].filter(Boolean).join(' ');
|
|
61
61
|
},
|
|
62
62
|
shouldShowTitle() {
|
|
63
63
|
return this.hasTitle || this.showCloseButton;
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
methods: {
|
|
67
|
+
/**
|
|
68
|
+
* `cssClasses can be a string, an array, or an object. This method normalizes it to an array
|
|
69
|
+
*/
|
|
70
|
+
normalizedCssClasses(cssClasses) {
|
|
71
|
+
if (Array.isArray(cssClasses)) {
|
|
72
|
+
return cssClasses;
|
|
73
|
+
}
|
|
74
|
+
if (typeof cssClasses === 'string') {
|
|
75
|
+
return cssClasses.trim() ? cssClasses.trim().split(/\s+/) : [];
|
|
76
|
+
}
|
|
77
|
+
if (cssClasses && typeof cssClasses === 'object') {
|
|
78
|
+
return Object.keys(cssClasses).filter(key => cssClasses[key]);
|
|
79
|
+
}
|
|
80
|
+
return [];
|
|
81
|
+
},
|
|
67
82
|
close(e) {
|
|
68
83
|
this.$refs[popoverRefName].doClose();
|
|
69
84
|
/**
|
|
@@ -90,9 +90,9 @@ var script = {
|
|
|
90
90
|
* CSS classes to apply to the title popover (gets passed to the `css-classes` prop of the `GlPopover` component).
|
|
91
91
|
*/
|
|
92
92
|
titlePopoverClasses: {
|
|
93
|
-
type: Array,
|
|
93
|
+
type: [Array, String, Object],
|
|
94
94
|
required: false,
|
|
95
|
-
default:
|
|
95
|
+
default: ''
|
|
96
96
|
},
|
|
97
97
|
/**
|
|
98
98
|
* Set to `true` to show the loading state.
|
|
@@ -63,7 +63,7 @@ var script = {
|
|
|
63
63
|
const __vue_script__ = script;
|
|
64
64
|
|
|
65
65
|
/* template */
|
|
66
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-badge',{ref:"badge",staticClass:"gl-mx-4 hover:gl-cursor-pointer",attrs:{"id":_vm.triggerId,"href":"#","variant":"neutral"}},[_c('span',[_vm._v(_vm._s(_vm.activeType.BADGE))]),_vm._v(" "),_c('gl-popover',{attrs:{"triggers":"hover focus click","show-close-button":"","placement":_vm.popoverPlacement,"target":_vm.triggerId,"css-classes":
|
|
66
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-badge',{ref:"badge",staticClass:"gl-mx-4 hover:gl-cursor-pointer",attrs:{"id":_vm.triggerId,"href":"#","variant":"neutral"}},[_c('span',[_vm._v(_vm._s(_vm.activeType.BADGE))]),_vm._v(" "),_c('gl-popover',{attrs:{"triggers":"hover focus click","show-close-button":"","placement":_vm.popoverPlacement,"target":_vm.triggerId,"css-classes":"!gl-z-9999","title":_vm.activeType.POPOVER_TITLE}},[_c('gl-sprintf',{attrs:{"message":_vm.activeType.POPOVER_CONTENT},scopedSlots:_vm._u([{key:"link",fn:function(ref){
|
|
67
67
|
var content = ref.content;
|
|
68
68
|
return [_c('gl-link',{staticClass:"!gl-text-sm",attrs:{"href":_vm.activeType.HELP_PAGE_URL,"target":"_blank"}},[_vm._v("\n "+_vm._s(content))])]}},{key:"bullets",fn:function(){return [_c('ul',{staticClass:"gl-mb-0 gl-pl-5"},_vm._l((_vm.activeType.POPOVER_BULLETS),function(item,i){return _c('li',{key:("li-" + i)},[_vm._v("\n "+_vm._s(item)+"\n ")])}),0)]},proxy:true},{key:"line-break",fn:function(ref){
|
|
69
69
|
var content = ref.content;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "123.
|
|
3
|
+
"version": "123.2.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -150,8 +150,8 @@
|
|
|
150
150
|
"mockdate": "^3.0.5",
|
|
151
151
|
"module-alias": "^2.2.3",
|
|
152
152
|
"pikaday": "^1.8.0",
|
|
153
|
-
"playwright": "^1.55.
|
|
154
|
-
"playwright-core": "^1.55.
|
|
153
|
+
"playwright": "^1.55.1",
|
|
154
|
+
"playwright-core": "^1.55.1",
|
|
155
155
|
"postcss": "8.5.6",
|
|
156
156
|
"postcss-loader": "8.2.0",
|
|
157
157
|
"postcss-scss": "4.0.9",
|
|
@@ -17,9 +17,9 @@ export default {
|
|
|
17
17
|
inheritAttrs: false,
|
|
18
18
|
props: {
|
|
19
19
|
cssClasses: {
|
|
20
|
-
type: Array,
|
|
20
|
+
type: [Array, String, Object],
|
|
21
21
|
required: false,
|
|
22
|
-
default:
|
|
22
|
+
default: '',
|
|
23
23
|
},
|
|
24
24
|
/**
|
|
25
25
|
* Space-separated triggers for the popover.
|
|
@@ -61,7 +61,7 @@ export default {
|
|
|
61
61
|
'gl-popover',
|
|
62
62
|
this.hasTitle && 'has-title',
|
|
63
63
|
this.showCloseButton && 'has-close-button',
|
|
64
|
-
...this.cssClasses,
|
|
64
|
+
...this.normalizedCssClasses(this.cssClasses),
|
|
65
65
|
]
|
|
66
66
|
.filter(Boolean)
|
|
67
67
|
.join(' ');
|
|
@@ -71,6 +71,24 @@ export default {
|
|
|
71
71
|
},
|
|
72
72
|
},
|
|
73
73
|
methods: {
|
|
74
|
+
/**
|
|
75
|
+
* `cssClasses can be a string, an array, or an object. This method normalizes it to an array
|
|
76
|
+
*/
|
|
77
|
+
normalizedCssClasses(cssClasses) {
|
|
78
|
+
if (Array.isArray(cssClasses)) {
|
|
79
|
+
return cssClasses;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (typeof cssClasses === 'string') {
|
|
83
|
+
return cssClasses.trim() ? cssClasses.trim().split(/\s+/) : [];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (cssClasses && typeof cssClasses === 'object') {
|
|
87
|
+
return Object.keys(cssClasses).filter((key) => cssClasses[key]);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return [];
|
|
91
|
+
},
|
|
74
92
|
close(e) {
|
|
75
93
|
this.$refs[popoverRefName].doClose();
|
|
76
94
|
/**
|
|
@@ -90,9 +90,9 @@ export default {
|
|
|
90
90
|
* CSS classes to apply to the title popover (gets passed to the `css-classes` prop of the `GlPopover` component).
|
|
91
91
|
*/
|
|
92
92
|
titlePopoverClasses: {
|
|
93
|
-
type: Array,
|
|
93
|
+
type: [Array, String, Object],
|
|
94
94
|
required: false,
|
|
95
|
-
default:
|
|
95
|
+
default: '',
|
|
96
96
|
},
|
|
97
97
|
/**
|
|
98
98
|
* Set to `true` to show the loading state.
|