@gitlab/ui 40.6.6 → 41.0.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/CHANGELOG.md +31 -0
- package/dist/components/base/modal/modal.js +1 -15
- package/dist/components/base/toggle/toggle.js +2 -2
- package/dist/components/charts/single_stat/single_stat.js +2 -2
- package/package.json +9 -9
- package/src/components/base/modal/modal.md +1 -5
- package/src/components/base/modal/modal.vue +2 -24
- package/src/components/base/toggle/toggle.stories.js +9 -0
- package/src/components/base/toggle/toggle.vue +3 -2
- package/src/components/charts/single_stat/single_stat.vue +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
# [41.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v40.7.1...v41.0.0) (2022-05-31)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **GlModal:** Remove deprecated slots modal-ok and modal-cancel ([7e116ec](https://gitlab.com/gitlab-org/gitlab-ui/commit/7e116ec5295d21a2afefc157c57312a733459bbd))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* **GlModal:** This removes the modal-ok and modal-cancel slots from
|
|
12
|
+
the modal component. These slots have been deprecated and are now no
|
|
13
|
+
longer supported.
|
|
14
|
+
|
|
15
|
+
Use the props `action-primary`, `action-secondary` and `action-cancel`
|
|
16
|
+
instead.
|
|
17
|
+
|
|
18
|
+
## [40.7.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v40.7.0...v40.7.1) (2022-05-31)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* **GlToggle:** Fix overflow of long help text ([8947400](https://gitlab.com/gitlab-org/gitlab-ui/commit/89474002e1f9333675ac6ed626277a18595d9d89))
|
|
24
|
+
|
|
25
|
+
# [40.7.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v40.6.6...v40.7.0) (2022-05-31)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* **GlSingleStat:** support string and number for value prop ([9217ee4](https://gitlab.com/gitlab-org/gitlab-ui/commit/9217ee42c9b54e04a8c98c56c50f9018896bc32d))
|
|
31
|
+
|
|
1
32
|
## [40.6.6](https://gitlab.com/gitlab-org/gitlab-ui/compare/v40.6.5...v40.6.6) (2022-05-30)
|
|
2
33
|
|
|
3
34
|
|
|
@@ -82,20 +82,6 @@ var script = {
|
|
|
82
82
|
default: ''
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
-
computed: {
|
|
86
|
-
shouldRenderModalOk() {
|
|
87
|
-
return Boolean(this.$slots['modal-ok']);
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
shouldRenderModalCancel() {
|
|
91
|
-
return Boolean(this.$slots['modal-cancel']);
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
shouldRenderModalFooter() {
|
|
95
|
-
return Boolean(this.actionCancel || this.actionSecondary || this.actionPrimary || this.$slots['modal-footer']);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
},
|
|
99
85
|
|
|
100
86
|
mounted() {
|
|
101
87
|
if (!this.ariaLabel && !this.title) {
|
|
@@ -179,7 +165,7 @@ var script = {
|
|
|
179
165
|
const __vue_script__ = script;
|
|
180
166
|
|
|
181
167
|
/* template */
|
|
182
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-modal',_vm._g(_vm._b({ref:"modal",attrs:{"id":_vm.modalId,"title-tag":_vm.titleTag,"size":_vm.size,"visible":_vm.visible,"aria-label":_vm.ariaLabel || _vm.title,"lazy":"","modal-class":['gl-modal', _vm.modalClass]},on:{"shown":_vm.setFocus,"ok":_vm.primary,"cancel":_vm.canceled,"change":function($event){return _vm.$emit('change', $event)}},scopedSlots:_vm._u([{key:"default",fn:function(){return [_vm._t("default")]},proxy:true},{key:"modal-header",fn:function(){return [_vm._t("modal-header",[_c('h4',{staticClass:"modal-title"},[_vm._t("modal-title",[_vm._v(_vm._s(_vm.title))])],2)]),_vm._v(" "),_c('close-button',{ref:"close-button",attrs:{"label":_vm.dismissLabel},on:{"click":_vm.close}})]},proxy:true},
|
|
168
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-modal',_vm._g(_vm._b({ref:"modal",attrs:{"id":_vm.modalId,"title-tag":_vm.titleTag,"size":_vm.size,"visible":_vm.visible,"aria-label":_vm.ariaLabel || _vm.title,"lazy":"","modal-class":['gl-modal', _vm.modalClass]},on:{"shown":_vm.setFocus,"ok":_vm.primary,"cancel":_vm.canceled,"change":function($event){return _vm.$emit('change', $event)}},scopedSlots:_vm._u([{key:"default",fn:function(){return [_vm._t("default")]},proxy:true},{key:"modal-header",fn:function(){return [_vm._t("modal-header",[_c('h4',{staticClass:"modal-title"},[_vm._t("modal-title",[_vm._v(_vm._s(_vm.title))])],2)]),_vm._v(" "),_c('close-button',{ref:"close-button",attrs:{"label":_vm.dismissLabel},on:{"click":_vm.close}})]},proxy:true},{key:"modal-footer",fn:function(){return [_vm._t("modal-footer",[(_vm.actionCancel)?_c('gl-button',_vm._b({staticClass:"js-modal-action-cancel",on:{"click":_vm.cancel}},'gl-button',_vm.buttonBinding(_vm.actionCancel, 'actionCancel'),false),[_vm._v("\n "+_vm._s(_vm.actionCancel.text)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.actionSecondary)?_c('gl-button',_vm._b({staticClass:"js-modal-action-secondary",on:{"click":_vm.secondary}},'gl-button',_vm.buttonBinding(_vm.actionSecondary, 'actionSecondary'),false),[_vm._v("\n "+_vm._s(_vm.actionSecondary.text)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.actionPrimary)?_c('gl-button',_vm._b({staticClass:"js-modal-action-primary",on:{"click":_vm.ok}},'gl-button',_vm.buttonBinding(_vm.actionPrimary, 'actionPrimary'),false),[_vm._v("\n "+_vm._s(_vm.actionPrimary.text)+"\n ")]):_vm._e()])]},proxy:true}],null,true)},'b-modal',_vm.$attrs,false),_vm.$listeners))};
|
|
183
169
|
var __vue_staticRenderFns__ = [];
|
|
184
170
|
|
|
185
171
|
/* style */
|
|
@@ -131,11 +131,11 @@ var script = {
|
|
|
131
131
|
const __vue_script__ = script;
|
|
132
132
|
|
|
133
133
|
/* template */
|
|
134
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-toggle-wrapper gl-display-flex gl-mb-0
|
|
134
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-toggle-wrapper gl-display-flex gl-mb-0",class:{
|
|
135
135
|
'gl-flex-direction-column': _vm.labelPosition === 'top' || _vm.labelPosition === 'hidden',
|
|
136
136
|
'gl-toggle-label-inline': _vm.labelPosition === 'left',
|
|
137
137
|
'is-disabled': _vm.disabled,
|
|
138
|
-
},attrs:{"data-testid":"toggle-wrapper"}},[_c('span',{staticClass:"gl-toggle-label",class:{ 'gl-sr-only': _vm.labelPosition === 'hidden' },attrs:{"id":_vm.labelId,"data-testid":"toggle-label"}},[_vm._t("label",[_vm._v(_vm._s(_vm.label))])],2),_vm._v(" "),(_vm.name)?_c('input',{attrs:{"name":_vm.name,"type":"hidden"},domProps:{"value":_vm.value}}):_vm._e(),_vm._v(" "),_c('button',{class:{
|
|
138
|
+
},attrs:{"data-testid":"toggle-wrapper"}},[_c('span',{staticClass:"gl-toggle-label gl-flex-shrink-0",class:{ 'gl-sr-only': _vm.labelPosition === 'hidden' },attrs:{"id":_vm.labelId,"data-testid":"toggle-label"}},[_vm._t("label",[_vm._v(_vm._s(_vm.label))])],2),_vm._v(" "),(_vm.name)?_c('input',{attrs:{"name":_vm.name,"type":"hidden"},domProps:{"value":_vm.value}}):_vm._e(),_vm._v(" "),_c('button',{staticClass:"gl-flex-shrink-0",class:{
|
|
139
139
|
'gl-toggle': true,
|
|
140
140
|
'is-checked': _vm.value,
|
|
141
141
|
'is-disabled': _vm.disabled,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "41.0.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -87,15 +87,15 @@
|
|
|
87
87
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
88
88
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
89
89
|
"@rollup/plugin-replace": "^2.3.2",
|
|
90
|
-
"@storybook/addon-a11y": "6.5.
|
|
91
|
-
"@storybook/addon-docs": "6.5.
|
|
92
|
-
"@storybook/addon-essentials": "6.5.
|
|
90
|
+
"@storybook/addon-a11y": "6.5.6",
|
|
91
|
+
"@storybook/addon-docs": "6.5.6",
|
|
92
|
+
"@storybook/addon-essentials": "6.5.6",
|
|
93
93
|
"@storybook/addon-knobs": "6.4.0",
|
|
94
|
-
"@storybook/addon-storyshots": "6.5.
|
|
95
|
-
"@storybook/addon-storyshots-puppeteer": "6.5.
|
|
96
|
-
"@storybook/addon-viewport": "6.5.
|
|
97
|
-
"@storybook/theming": "6.5.
|
|
98
|
-
"@storybook/vue": "6.5.
|
|
94
|
+
"@storybook/addon-storyshots": "6.5.6",
|
|
95
|
+
"@storybook/addon-storyshots-puppeteer": "6.5.6",
|
|
96
|
+
"@storybook/addon-viewport": "6.5.6",
|
|
97
|
+
"@storybook/theming": "6.5.6",
|
|
98
|
+
"@storybook/vue": "6.5.6",
|
|
99
99
|
"@vue/test-utils": "1.3.0",
|
|
100
100
|
"autoprefixer": "^9.7.6",
|
|
101
101
|
"babel-jest": "^26.6.3",
|
|
@@ -7,11 +7,7 @@ should serve a single purpose dedicated to completing the user’s task.
|
|
|
7
7
|
You can use the `v-model` directive to control the modal’s visibility. The `v-model`
|
|
8
8
|
directive interfaces with the `visible` property and the `@change` event.
|
|
9
9
|
|
|
10
|
-
##
|
|
11
|
-
|
|
12
|
-
We are deprecating the `modal-ok` and `modal-cancel` slots. We are also changing the way the
|
|
13
|
-
`modal-footer` slot content is populated. This is in order to align this component with the design
|
|
14
|
-
system.
|
|
10
|
+
## Modal footer
|
|
15
11
|
|
|
16
12
|
The `modal-footer` slot should only be populated via props: `action-primary`, `action-secondary` and
|
|
17
13
|
`action-cancel`. These props allow you to handle how a primary, secondary and cancel button will
|
|
@@ -86,22 +86,6 @@ export default {
|
|
|
86
86
|
default: '',
|
|
87
87
|
},
|
|
88
88
|
},
|
|
89
|
-
computed: {
|
|
90
|
-
shouldRenderModalOk() {
|
|
91
|
-
return Boolean(this.$slots['modal-ok']);
|
|
92
|
-
},
|
|
93
|
-
shouldRenderModalCancel() {
|
|
94
|
-
return Boolean(this.$slots['modal-cancel']);
|
|
95
|
-
},
|
|
96
|
-
shouldRenderModalFooter() {
|
|
97
|
-
return Boolean(
|
|
98
|
-
this.actionCancel ||
|
|
99
|
-
this.actionSecondary ||
|
|
100
|
-
this.actionPrimary ||
|
|
101
|
-
this.$slots['modal-footer']
|
|
102
|
-
);
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
89
|
mounted() {
|
|
106
90
|
if (!this.ariaLabel && !this.title) {
|
|
107
91
|
logWarning(
|
|
@@ -168,7 +152,7 @@ export default {
|
|
|
168
152
|
</script>
|
|
169
153
|
|
|
170
154
|
<template>
|
|
171
|
-
<!--
|
|
155
|
+
<!--
|
|
172
156
|
Emitted when the modal visibility changes
|
|
173
157
|
@event change
|
|
174
158
|
-->
|
|
@@ -202,14 +186,8 @@ export default {
|
|
|
202
186
|
<!-- @slot Content of Modal header close button. If modal-header slot is used, this slot will not be shown. -->
|
|
203
187
|
<close-button ref="close-button" :label="dismissLabel" @click="close" />
|
|
204
188
|
</template>
|
|
205
|
-
<template v-if="shouldRenderModalOk" #modal-ok>
|
|
206
|
-
<slot name="modal-ok"></slot>
|
|
207
|
-
</template>
|
|
208
|
-
<template v-if="shouldRenderModalCancel" #modal-cancel>
|
|
209
|
-
<slot name="modal-cancel"></slot>
|
|
210
|
-
</template>
|
|
211
189
|
<!-- @slot Populated via props: modal-action-primary, modal-action-cancel and modal-action-secondary. -->
|
|
212
|
-
<template
|
|
190
|
+
<template #modal-footer>
|
|
213
191
|
<slot name="modal-footer">
|
|
214
192
|
<!--
|
|
215
193
|
Emitted when clicked on modal-action-cancel
|
|
@@ -5,6 +5,10 @@ import readme from './toggle.md';
|
|
|
5
5
|
|
|
6
6
|
const defaultValue = (prop) => GlToggle.props[prop].default;
|
|
7
7
|
|
|
8
|
+
const longHelp = `This is a toggle component with a long help message.
|
|
9
|
+
You can notice how the text wraps when the width of the container
|
|
10
|
+
is not enough to fix the entire text.`;
|
|
11
|
+
|
|
8
12
|
const generateProps = ({
|
|
9
13
|
value = true,
|
|
10
14
|
disabled = defaultValue('disabled'),
|
|
@@ -43,6 +47,11 @@ const Template = (args, { argTypes }) => ({
|
|
|
43
47
|
export const Default = Template.bind({});
|
|
44
48
|
Default.args = generateProps();
|
|
45
49
|
|
|
50
|
+
export const WithLongHelp = Template.bind({});
|
|
51
|
+
WithLongHelp.args = generateProps({
|
|
52
|
+
help: longHelp,
|
|
53
|
+
});
|
|
54
|
+
|
|
46
55
|
export default {
|
|
47
56
|
title: 'base/toggle',
|
|
48
57
|
component: GlToggle,
|
|
@@ -118,7 +118,7 @@ export default {
|
|
|
118
118
|
|
|
119
119
|
<template>
|
|
120
120
|
<div
|
|
121
|
-
class="gl-toggle-wrapper gl-display-flex gl-mb-0
|
|
121
|
+
class="gl-toggle-wrapper gl-display-flex gl-mb-0"
|
|
122
122
|
:class="{
|
|
123
123
|
'gl-flex-direction-column': labelPosition === 'top' || labelPosition === 'hidden',
|
|
124
124
|
'gl-toggle-label-inline': labelPosition === 'left',
|
|
@@ -129,7 +129,7 @@ export default {
|
|
|
129
129
|
<span
|
|
130
130
|
:id="labelId"
|
|
131
131
|
:class="{ 'gl-sr-only': labelPosition === 'hidden' }"
|
|
132
|
-
class="gl-toggle-label"
|
|
132
|
+
class="gl-toggle-label gl-flex-shrink-0"
|
|
133
133
|
data-testid="toggle-label"
|
|
134
134
|
>
|
|
135
135
|
<!-- @slot The toggle's label. -->
|
|
@@ -146,6 +146,7 @@ export default {
|
|
|
146
146
|
'is-checked': value,
|
|
147
147
|
'is-disabled': disabled,
|
|
148
148
|
}"
|
|
149
|
+
class="gl-flex-shrink-0"
|
|
149
150
|
type="button"
|
|
150
151
|
@click.prevent="toggleFeature"
|
|
151
152
|
>
|