@gitlab/ui 38.8.1 → 38.8.2
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [38.8.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v38.8.1...v38.8.2) (2022-04-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **Label:** Move tooltip to anchor instead of span ([67d0e79](https://gitlab.com/gitlab-org/gitlab-ui/commit/67d0e79bb57409d63e32fd3efffc95dc534c3421))
|
|
7
|
+
|
|
1
8
|
## [38.8.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v38.8.0...v38.8.1) (2022-04-08)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -130,7 +130,7 @@ var script = {
|
|
|
130
130
|
const __vue_script__ = script;
|
|
131
131
|
|
|
132
132
|
/* template */
|
|
133
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',_vm._b({
|
|
133
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',_vm._b({staticClass:"gl-label",class:_vm.cssClasses,style:(_vm.cssVariables),on:{"click":_vm.onClick}},'span',_vm.$attrs,false),[_c('gl-link',{ref:"labelTitle",staticClass:"gl-label-link",attrs:{"href":_vm.target}},[_c('span',{staticClass:"gl-label-text"},[_vm._v("\n "+_vm._s(_vm.scopedKey)+"\n ")]),_vm._v(" "),(_vm.scoped && _vm.scopedValue)?_c('span',{staticClass:"gl-label-text-scoped"},[_vm._v("\n "+_vm._s(_vm.scopedValue)+"\n ")]):_vm._e()]),_vm._v(" "),(_vm.showCloseButton)?_c('close-button',{staticClass:"gl-label-close gl-p-0!",attrs:{"label":"Remove label","variant":"reset","disabled":_vm.disabled},on:{"click":_vm.onClose}}):_vm._e(),_vm._v(" "),(_vm.description)?_c('gl-tooltip',{attrs:{"target":function () { return _vm.$refs.labelTitle.$el; },"placement":_vm.tooltipPlacement,"boundary":"viewport"}},[(_vm.scoped)?_c('span',{staticClass:"gl-label-tooltip-title"},[_vm._v("Scoped label")]):_vm._e(),_vm._v("\n "+_vm._s(_vm.description)+"\n ")]):_vm._e()],1)};
|
|
134
134
|
var __vue_staticRenderFns__ = [];
|
|
135
135
|
|
|
136
136
|
/* style */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "38.8.
|
|
3
|
+
"version": "38.8.2",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -146,7 +146,6 @@
|
|
|
146
146
|
"sass-loader": "^10.2.0",
|
|
147
147
|
"sass-true": "^5.0.0",
|
|
148
148
|
"start-server-and-test": "^1.10.6",
|
|
149
|
-
"storybook-readme": "5.0.9",
|
|
150
149
|
"stylelint": "14.3.0",
|
|
151
150
|
"stylelint-config-prettier": "9.0.3",
|
|
152
151
|
"stylelint-prettier": "2.0.0",
|
|
@@ -120,15 +120,8 @@ export default {
|
|
|
120
120
|
</script>
|
|
121
121
|
|
|
122
122
|
<template>
|
|
123
|
-
<span
|
|
124
|
-
ref="labelTitle"
|
|
125
|
-
class="gl-label"
|
|
126
|
-
:class="cssClasses"
|
|
127
|
-
:style="cssVariables"
|
|
128
|
-
v-bind="$attrs"
|
|
129
|
-
@click="onClick"
|
|
130
|
-
>
|
|
131
|
-
<gl-link :href="target" class="gl-label-link">
|
|
123
|
+
<span class="gl-label" :class="cssClasses" :style="cssVariables" v-bind="$attrs" @click="onClick">
|
|
124
|
+
<gl-link ref="labelTitle" :href="target" class="gl-label-link">
|
|
132
125
|
<span class="gl-label-text">
|
|
133
126
|
{{ scopedKey }}
|
|
134
127
|
</span>
|
|
@@ -146,7 +139,7 @@ export default {
|
|
|
146
139
|
/>
|
|
147
140
|
<gl-tooltip
|
|
148
141
|
v-if="description"
|
|
149
|
-
:target="() => $refs.labelTitle"
|
|
142
|
+
:target="() => $refs.labelTitle.$el"
|
|
150
143
|
:placement="tooltipPlacement"
|
|
151
144
|
boundary="viewport"
|
|
152
145
|
>
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { storiesOf } from '@storybook/vue';
|
|
2
|
-
import camelCase from 'lodash/camelCase';
|
|
3
|
-
import upperFirst from 'lodash/upperFirst';
|
|
4
|
-
import { configureReadme } from 'storybook-readme';
|
|
5
|
-
|
|
6
|
-
import 'url-search-params-polyfill';
|
|
7
|
-
|
|
8
|
-
import { componentValidator as isValidComponent } from './all_components';
|
|
9
|
-
import GlComponentDocumentation from './components/component_documentation_generator.vue';
|
|
10
|
-
import GlExampleExplorer from './components/example_explorer.vue';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This functions returns the component's name from the current window location's search
|
|
14
|
-
*
|
|
15
|
-
* Assume you have this Structure:
|
|
16
|
-
* - Base
|
|
17
|
-
* - Form
|
|
18
|
-
* - Form-Group
|
|
19
|
-
* - Default
|
|
20
|
-
* - With Validations
|
|
21
|
-
*
|
|
22
|
-
* The URI would look like this: `iframe.html?id=base-form-form-group--with-validations`
|
|
23
|
-
*
|
|
24
|
-
* The actual component name we are looking for is `GlFormGroup`.
|
|
25
|
-
* We know that we can remove the last part.
|
|
26
|
-
* But unfortunately from `base-form-form-group` we cannot guess which of the following is the component name:
|
|
27
|
-
* - GlBaseFormFormGroup
|
|
28
|
-
* - GlFormFormGroup
|
|
29
|
-
* - GlFormGroup
|
|
30
|
-
* - GlGroup
|
|
31
|
-
*
|
|
32
|
-
* So we are going to through loop all of these and return the first valid component (`GlFormGroup`)
|
|
33
|
-
*
|
|
34
|
-
* @returns {string}
|
|
35
|
-
*/
|
|
36
|
-
function getComponentName() {
|
|
37
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
38
|
-
|
|
39
|
-
const storySlug = urlParams.get('id').split('--')[0];
|
|
40
|
-
const splitSlug = storySlug.split('-');
|
|
41
|
-
|
|
42
|
-
let componentName;
|
|
43
|
-
|
|
44
|
-
do {
|
|
45
|
-
splitSlug.shift();
|
|
46
|
-
componentName = `Gl${upperFirst(camelCase(splitSlug.join('-')))}`;
|
|
47
|
-
} while (splitSlug.length > 0 && !isValidComponent(componentName));
|
|
48
|
-
|
|
49
|
-
if (!isValidComponent(componentName)) {
|
|
50
|
-
throw new Error('Could not find a matching component');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return componentName;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export const setupStorybookReadme = () =>
|
|
57
|
-
configureReadme({
|
|
58
|
-
StoryPreview: {
|
|
59
|
-
disableForComponents: [
|
|
60
|
-
'GlTableLite',
|
|
61
|
-
'GlAlert',
|
|
62
|
-
'GlSparklineChart',
|
|
63
|
-
'GlAvatarsInline',
|
|
64
|
-
'GlSprintf',
|
|
65
|
-
'GlLink',
|
|
66
|
-
'GlChart',
|
|
67
|
-
'GlDropdown',
|
|
68
|
-
'GlDropdownItem',
|
|
69
|
-
'GlBadge',
|
|
70
|
-
'GlButtonGroup',
|
|
71
|
-
'GlOutsideDirective',
|
|
72
|
-
'GlBanner',
|
|
73
|
-
'GlBreadcrumb',
|
|
74
|
-
'GlBroadcastMessage',
|
|
75
|
-
'GlCollapse',
|
|
76
|
-
'GlToken',
|
|
77
|
-
'GlButton',
|
|
78
|
-
'GlEmptyState',
|
|
79
|
-
'GlSorting',
|
|
80
|
-
'GlSortingItem',
|
|
81
|
-
'GlIcon',
|
|
82
|
-
'GlDatepicker',
|
|
83
|
-
'GlSafeLinkDirective',
|
|
84
|
-
'GlDashboardSkeleton',
|
|
85
|
-
'GlToggle',
|
|
86
|
-
'GlNavbar',
|
|
87
|
-
'GlFormCheckboxTree',
|
|
88
|
-
'GlProgressBar',
|
|
89
|
-
'GlPath',
|
|
90
|
-
'GlFriendlyWrap',
|
|
91
|
-
'GlLoadingIcon',
|
|
92
|
-
'GlDeprecatedSkeletonLoading',
|
|
93
|
-
'GlCard',
|
|
94
|
-
'GlFormCheckbox',
|
|
95
|
-
'GlAccordion',
|
|
96
|
-
'GlAccordionItem',
|
|
97
|
-
'GlFilteredSearch',
|
|
98
|
-
'GlFilteredSearchSuggestion',
|
|
99
|
-
'GlFilteredSearchSuggestionList',
|
|
100
|
-
'GlFilteredSearchTerm',
|
|
101
|
-
'GlFilteredSearchToken',
|
|
102
|
-
'GlFilteredSearchTokenSegment',
|
|
103
|
-
'GlIntersperse',
|
|
104
|
-
'GlFormSelect',
|
|
105
|
-
'GlDaterangePicker',
|
|
106
|
-
'GlFormGroup',
|
|
107
|
-
'GlAvatarLabeled',
|
|
108
|
-
'GlBarChart',
|
|
109
|
-
'GlCarousel',
|
|
110
|
-
'GlMarkdown',
|
|
111
|
-
'GlTokenSelector',
|
|
112
|
-
'GlTooltip',
|
|
113
|
-
'GlFormTextarea',
|
|
114
|
-
'GlFormInput',
|
|
115
|
-
'GlSegmentedControl',
|
|
116
|
-
'GlAvatar',
|
|
117
|
-
'GlChartLegend',
|
|
118
|
-
'GlAvatarLink',
|
|
119
|
-
'GlPagination',
|
|
120
|
-
'GlSkeletonLoader',
|
|
121
|
-
'GlLabel',
|
|
122
|
-
'GlHoverLoadDirective',
|
|
123
|
-
'GlStackedColumnChart',
|
|
124
|
-
'GlDiscreteScatterChart',
|
|
125
|
-
'GlResizeObserverDirective',
|
|
126
|
-
'GlFormCombobox',
|
|
127
|
-
'GlChartTooltip',
|
|
128
|
-
'GlInputGroupText',
|
|
129
|
-
'GlGaugeChart',
|
|
130
|
-
'GlSafeHtmlDirective',
|
|
131
|
-
'GlFormRadio',
|
|
132
|
-
'GlModal',
|
|
133
|
-
'GlKeysetPagination',
|
|
134
|
-
'GlForm',
|
|
135
|
-
'GlTable',
|
|
136
|
-
'GlTab',
|
|
137
|
-
'GlTabs',
|
|
138
|
-
'GlToast',
|
|
139
|
-
'GlPaginatedList',
|
|
140
|
-
'GlIntersectionObserver',
|
|
141
|
-
'GlInfiniteScroll',
|
|
142
|
-
'GlColumnChart',
|
|
143
|
-
'GlTruncate',
|
|
144
|
-
'GlNav',
|
|
145
|
-
'GlSearchBoxByType',
|
|
146
|
-
'GlNavItem',
|
|
147
|
-
'GlNavItemDropdown',
|
|
148
|
-
'GlPopover',
|
|
149
|
-
'GlSingleStat',
|
|
150
|
-
'GlDrawer',
|
|
151
|
-
'GlHeatmap',
|
|
152
|
-
'GlFormRadioGroup',
|
|
153
|
-
'GlChartSeriesLabel',
|
|
154
|
-
'GlAreaChart',
|
|
155
|
-
'GlLineChart',
|
|
156
|
-
'GlFormInputGroup',
|
|
157
|
-
'GlSearchBoxByClick',
|
|
158
|
-
],
|
|
159
|
-
components: {
|
|
160
|
-
GlComponentDocumentation,
|
|
161
|
-
GlExampleExplorer,
|
|
162
|
-
},
|
|
163
|
-
data() {
|
|
164
|
-
return {
|
|
165
|
-
componentName: null,
|
|
166
|
-
error: '',
|
|
167
|
-
// Style the preview component container
|
|
168
|
-
// Default container forcefully centers the preview element
|
|
169
|
-
styles: {
|
|
170
|
-
padding: '50px 35px',
|
|
171
|
-
margin: '16px 0',
|
|
172
|
-
border: '1px dashed rgb(229, 229, 229)',
|
|
173
|
-
},
|
|
174
|
-
};
|
|
175
|
-
},
|
|
176
|
-
// We infer the component's name from the URL so that we can load related examples and docs.
|
|
177
|
-
// This needs to be done in the created hook to make sure that componentName is always set
|
|
178
|
-
// to a valid value once the story loads.
|
|
179
|
-
created() {
|
|
180
|
-
try {
|
|
181
|
-
this.componentName = getComponentName();
|
|
182
|
-
this.error = '';
|
|
183
|
-
} catch (error) {
|
|
184
|
-
this.componentName = false;
|
|
185
|
-
this.error = error.message;
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
template: `
|
|
189
|
-
<div>
|
|
190
|
-
<div class="story-container" v-if="!componentName || $options.disableForComponents.includes(componentName)">
|
|
191
|
-
<slot></slot>
|
|
192
|
-
</div>
|
|
193
|
-
<template v-else>
|
|
194
|
-
<div class="story-container" v-bind:style="styles"><slot></slot></div>
|
|
195
|
-
{{ error }}
|
|
196
|
-
<template v-if="componentName">
|
|
197
|
-
<gl-example-explorer :componentName="componentName" />
|
|
198
|
-
<gl-component-documentation :componentName="componentName" />
|
|
199
|
-
</template>
|
|
200
|
-
</template>
|
|
201
|
-
</div>`,
|
|
202
|
-
},
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
export const documentedStoriesOf = (name, readme) => {
|
|
206
|
-
const story = storiesOf(name, module);
|
|
207
|
-
if (process.env.NODE_ENV !== 'test') {
|
|
208
|
-
story.addParameters({
|
|
209
|
-
readme: {
|
|
210
|
-
content: readme,
|
|
211
|
-
},
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
return story;
|
|
215
|
-
};
|