@gitlab/ui 37.7.0 → 37.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/CHANGELOG.md +7 -0
- package/dist/components/base/filtered_search/filtered_search.js +11 -0
- package/dist/components/base/modal/modal.documentation.js +1 -1
- package/dist/components/base/tabs/tabs/tabs.documentation.js +1 -1
- package/package.json +1 -1
- package/src/components/base/filtered_search/filtered_search.vue +10 -2
- package/src/components/base/modal/modal.md +5 -5
- package/src/components/base/modal/modal.spec.js +2 -2
- package/src/components/base/tabs/tabs/tabs.md +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [37.8.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.7.0...v37.8.0) (2022-03-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **GlFilteredSearch:** Allow to pass token dynamically ([247ea01](https://gitlab.com/gitlab-org/gitlab-ui/commit/247ea011487a1ab0087d994cdb994c9c553565eb))
|
|
7
|
+
|
|
1
8
|
# [37.7.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.6.0...v37.7.0) (2022-03-14)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _isEqual from 'lodash/isEqual';
|
|
1
2
|
import _cloneDeep from 'lodash/cloneDeep';
|
|
2
3
|
import PortalVue from 'portal-vue';
|
|
3
4
|
import Vue from 'vue';
|
|
@@ -150,6 +151,16 @@ var script = {
|
|
|
150
151
|
this.$emit('input', this.tokens);
|
|
151
152
|
},
|
|
152
153
|
|
|
154
|
+
deep: true,
|
|
155
|
+
immediate: true
|
|
156
|
+
},
|
|
157
|
+
value: {
|
|
158
|
+
handler(newValue, oldValue) {
|
|
159
|
+
if (newValue.length && !_isEqual(newValue, oldValue)) {
|
|
160
|
+
this.applyNewValue(_cloneDeep(newValue));
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
|
|
153
164
|
deep: true,
|
|
154
165
|
immediate: true
|
|
155
166
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var description = "Modals are used to reveal critical information, show information without losing context, or when the\nsystem requires a user response. Modals can also fragment a complex workflow into simpler steps and\nshould serve a single purpose dedicated to completing the user’s task.\n\n## VModel\n\nYou can use the `v-model` directive to control the modal’s visibility. The `v-model`\ndirective interfaces with the `visible` property and the `@change` event.\n\n## Deprecation Warning\n\nWe are deprecating the `modal-ok` and `modal-cancel` slots. We are also changing the way the\n`modal-footer` slot content is populated. This is in order to align this component with the design\nsystem.\n\nThe `modal-footer` slot should only be populated via props: `action-primary`, `action-secondary` and\n`action-cancel`. These props allow you to handle how a primary, secondary and cancel button will\nbehave in the modals footer. The props receive an object as such:\n\n```js\n{\n text: 'Save Changes',\n attributes:
|
|
1
|
+
var description = "Modals are used to reveal critical information, show information without losing context, or when the\nsystem requires a user response. Modals can also fragment a complex workflow into simpler steps and\nshould serve a single purpose dedicated to completing the user’s task.\n\n## VModel\n\nYou can use the `v-model` directive to control the modal’s visibility. The `v-model`\ndirective interfaces with the `visible` property and the `@change` event.\n\n## Deprecation Warning\n\nWe are deprecating the `modal-ok` and `modal-cancel` slots. We are also changing the way the\n`modal-footer` slot content is populated. This is in order to align this component with the design\nsystem.\n\nThe `modal-footer` slot should only be populated via props: `action-primary`, `action-secondary` and\n`action-cancel`. These props allow you to handle how a primary, secondary and cancel button will\nbehave in the modals footer. The props receive an object as such:\n\n```js\n{\n text: 'Save Changes',\n attributes: {\n variant: 'confirm',\n disabled: this.someState,\n class: 'some-class',\n ...\n }\n}\n```\n";
|
|
2
2
|
|
|
3
3
|
var modal_documentation = {
|
|
4
4
|
followsDesignSystem: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var description = "Tabs are used to divide content into meaningful, related sections. Tabs allow users to focus on one\nspecific view at a time while maintaining sight of all the relevant content options available. Each\ntab, when active, will reveal it’s own unique content.\n\n## Using the component Vue\n\n~~~html\n<gl-tabs>\n <gl-tab title=\"Tab 1\">\n Tab panel 1\n </gl-tab>\n <gl-tab title=\"Tab 2\">\n Tab panel 2\n </gl-tab>\n</gl-tabs>\n~~~\n\n## Using the component HTML\n\n~~~html\n<div class=\"tabs gl-tabs\">\n <ul role=\"tablist\" class=\"nav gl-tabs-nav\">\n <li role=\"presentation\" class=\"nav-item\">\n <a\n role=\"tab\"\n target=\"_self\"\n href=\"#\"\n class=\"nav-link gl-tab-nav-item gl-tab-nav-item-active gl-tab-nav-item-active-indigo\"\n >Tab 1</a>\n </li>\n <li role=\"presentation\" class=\"nav-item\">\n <a role=\"tab\" target=\"_self\" href=\"#\" class=\"nav-link gl-tab-nav-item\">Tab 2</a>\n </li>\n </ul>\n <div class=\"tab-content gl-tab-content\">\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content active\">Tab panel 1</div>\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content\">Tab panel 2</div>\n </div>\n</div>\n~~~\n\n## Adding Action Buttons to the Tabs\n\nTabs start and end slot can be populated via props: `action-primary`, `action-secondary` and\n`action-tertiary`. These props allow you to handle how a primary, secondary and tertiary button will\nbehave and look. The props receive an object as such:\n\n~~~js\n{\n text: 'Save Changes',\n attributes:
|
|
1
|
+
var description = "Tabs are used to divide content into meaningful, related sections. Tabs allow users to focus on one\nspecific view at a time while maintaining sight of all the relevant content options available. Each\ntab, when active, will reveal it’s own unique content.\n\n## Using the component Vue\n\n~~~html\n<gl-tabs>\n <gl-tab title=\"Tab 1\">\n Tab panel 1\n </gl-tab>\n <gl-tab title=\"Tab 2\">\n Tab panel 2\n </gl-tab>\n</gl-tabs>\n~~~\n\n## Using the component HTML\n\n~~~html\n<div class=\"tabs gl-tabs\">\n <ul role=\"tablist\" class=\"nav gl-tabs-nav\">\n <li role=\"presentation\" class=\"nav-item\">\n <a\n role=\"tab\"\n target=\"_self\"\n href=\"#\"\n class=\"nav-link gl-tab-nav-item gl-tab-nav-item-active gl-tab-nav-item-active-indigo\"\n >Tab 1</a>\n </li>\n <li role=\"presentation\" class=\"nav-item\">\n <a role=\"tab\" target=\"_self\" href=\"#\" class=\"nav-link gl-tab-nav-item\">Tab 2</a>\n </li>\n </ul>\n <div class=\"tab-content gl-tab-content\">\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content active\">Tab panel 1</div>\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content\">Tab panel 2</div>\n </div>\n</div>\n~~~\n\n## Adding Action Buttons to the Tabs\n\nTabs start and end slot can be populated via props: `action-primary`, `action-secondary` and\n`action-tertiary`. These props allow you to handle how a primary, secondary and tertiary button will\nbehave and look. The props receive an object as such:\n\n~~~js\n{\n text: 'Save Changes',\n attributes: {\n variant: 'info',\n disabled: this.someState,\n class: 'some-class',\n ...\n }\n}\n~~~\n\n## Scrollable tab buttons\n\nBy default, `GlTab` will wrap tab buttons when they overflow the container. To\nenable horizontally scrolling for the tab buttons, use the `GlScrollableTabs`\ncomponent. This is a separate Vue component because of some limitations:\n\n- The action props (e.g., `action-primary`) are not respected in `GlScrollableTabs`. At the\n moment, BootstrapVue does not provide a reliable way for us to achieve this desired combination.\n\n`GlScrollableTabs` composes `GlTabs` and passes through every listener, slot, or prop (with the above\nexceptions).\n\n~~~html\n<gl-scrollable-tabs>\n <gl-tab v-for=\"tab in tabs\" :key=\"tab.key\" :title=\"tab.title\"> {{ tab.content }} </gl-tab>\n</gl-scrollable-tabs>\n~~~\n";
|
|
2
2
|
|
|
3
3
|
var tabs_documentation = {
|
|
4
4
|
description,
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { cloneDeep } from 'lodash';
|
|
2
|
+
import { cloneDeep, isEqual } from 'lodash';
|
|
3
3
|
import PortalVue from 'portal-vue';
|
|
4
4
|
import Vue from 'vue';
|
|
5
5
|
import { GlTooltipDirective } from '../../../directives/tooltip';
|
|
@@ -146,13 +146,21 @@ export default {
|
|
|
146
146
|
deep: true,
|
|
147
147
|
immediate: true,
|
|
148
148
|
},
|
|
149
|
+
value: {
|
|
150
|
+
handler(newValue, oldValue) {
|
|
151
|
+
if (newValue.length && !isEqual(newValue, oldValue)) {
|
|
152
|
+
this.applyNewValue(cloneDeep(newValue));
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
deep: true,
|
|
156
|
+
immediate: true,
|
|
157
|
+
},
|
|
149
158
|
},
|
|
150
159
|
mounted() {
|
|
151
160
|
if (this.value.length) {
|
|
152
161
|
this.applyNewValue(cloneDeep(this.value));
|
|
153
162
|
}
|
|
154
163
|
},
|
|
155
|
-
|
|
156
164
|
methods: {
|
|
157
165
|
applyNewValue(newValue) {
|
|
158
166
|
this.tokens = needDenormalization(newValue) ? denormalizeTokens(newValue) : newValue;
|
|
@@ -20,11 +20,11 @@ behave in the modals footer. The props receive an object as such:
|
|
|
20
20
|
```js
|
|
21
21
|
{
|
|
22
22
|
text: 'Save Changes',
|
|
23
|
-
attributes:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
attributes: {
|
|
24
|
+
variant: 'confirm',
|
|
25
|
+
disabled: this.someState,
|
|
26
|
+
class: 'some-class',
|
|
27
27
|
...
|
|
28
|
-
|
|
28
|
+
}
|
|
29
29
|
}
|
|
30
30
|
```
|
|
@@ -107,14 +107,14 @@ describe('Modal component', () => {
|
|
|
107
107
|
const props = {
|
|
108
108
|
actionPrimary: {
|
|
109
109
|
text: 'Primary',
|
|
110
|
-
attributes:
|
|
110
|
+
attributes: { variant: 'info' },
|
|
111
111
|
},
|
|
112
112
|
actionSecondary: {
|
|
113
113
|
text: 'Secondary',
|
|
114
114
|
},
|
|
115
115
|
actionCancel: {
|
|
116
116
|
text: 'Cancel',
|
|
117
|
-
attributes:
|
|
117
|
+
attributes: { variant: 'danger' },
|
|
118
118
|
},
|
|
119
119
|
};
|
|
120
120
|
|
|
@@ -48,12 +48,12 @@ behave and look. The props receive an object as such:
|
|
|
48
48
|
~~~js
|
|
49
49
|
{
|
|
50
50
|
text: 'Save Changes',
|
|
51
|
-
attributes:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
attributes: {
|
|
52
|
+
variant: 'info',
|
|
53
|
+
disabled: this.someState,
|
|
54
|
+
class: 'some-class',
|
|
55
55
|
...
|
|
56
|
-
|
|
56
|
+
}
|
|
57
57
|
}
|
|
58
58
|
~~~
|
|
59
59
|
|