@gitlab/ui 80.0.0 → 80.1.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 +14 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +3 -1
- package/dist/components/base/new_dropdowns/disclosure/utils.js +22 -9
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tokens/css/tokens.css +1 -1
- package/dist/tokens/css/tokens.dark.css +1 -1
- package/dist/tokens/js/tokens.dark.js +1 -1
- package/dist/tokens/js/tokens.js +1 -1
- package/dist/tokens/scss/_tokens.dark.scss +1 -1
- package/dist/tokens/scss/_tokens.scss +1 -1
- package/package.json +7 -7
- package/src/components/base/drawer/drawer.scss +1 -0
- package/src/components/base/drawer/drawer.stories.js +1 -1
- package/src/components/base/form/form_select/form_select.stories.js +26 -16
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.stories.js +1 -1
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +5 -1
- package/src/components/base/new_dropdowns/disclosure/utils.js +30 -6
- package/src/components/base/table/table.md +3 -3
- package/src/components/base/table/table.stories.js +3 -3
- package/src/components/base/table_lite/table_lite.md +3 -3
- package/src/components/base/table_lite/table_lite.stories.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [80.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v80.0.1...v80.1.0) (2024-05-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **GlDrawer:** Fix alignment of close button ([8bd418a](https://gitlab.com/gitlab-org/gitlab-ui/commit/8bd418ad69b7ca9588d8eeb0fe21ca290a730a7f))
|
|
7
|
+
|
|
8
|
+
## [80.0.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v80.0.0...v80.0.1) (2024-05-02)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **Dropdown:** Fix disclosure dropdown a11y issues ([34d2c4d](https://gitlab.com/gitlab-org/gitlab-ui/commit/34d2c4d496f66c2c9e9129793e6a0c4189d77ec9))
|
|
14
|
+
|
|
1
15
|
# [80.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v79.4.1...v80.0.0) (2024-05-01)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -218,7 +218,9 @@ var script = {
|
|
|
218
218
|
computed: {
|
|
219
219
|
disclosureTag() {
|
|
220
220
|
var _this$items;
|
|
221
|
-
if ((_this$items = this.items) !== null && _this$items !== void 0 && _this$items.length ||
|
|
221
|
+
if ((_this$items = this.items) !== null && _this$items !== void 0 && _this$items.length ||
|
|
222
|
+
// eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
|
|
223
|
+
hasOnlyListItems(this.$scopedSlots.default || this.$slots.default)) {
|
|
222
224
|
return 'ul';
|
|
223
225
|
}
|
|
224
226
|
return 'div';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
1
2
|
import isFunction from 'lodash/isFunction';
|
|
3
|
+
import isString from 'lodash/isString';
|
|
2
4
|
import { DISCLOSURE_DROPDOWN_ITEM_NAME, DISCLOSURE_DROPDOWN_GROUP_NAME } from './constants';
|
|
3
5
|
|
|
4
6
|
const itemValidator = item => {
|
|
@@ -17,23 +19,34 @@ const isValidSlotTagVue2 = vNode => {
|
|
|
17
19
|
var _vNode$componentOptio;
|
|
18
20
|
return Boolean(vNode) && isListItem(((_vNode$componentOptio = vNode.componentOptions) === null || _vNode$componentOptio === void 0 ? void 0 : _vNode$componentOptio.tag) || vNode.tag);
|
|
19
21
|
};
|
|
20
|
-
const
|
|
22
|
+
const isValidSlotTagVue3 = vNode => {
|
|
21
23
|
var _vNode$type;
|
|
22
24
|
return [DISCLOSURE_DROPDOWN_ITEM_NAME, DISCLOSURE_DROPDOWN_GROUP_NAME].includes((_vNode$type = vNode.type) === null || _vNode$type === void 0 ? void 0 : _vNode$type.name) || vNode.type === 'li';
|
|
23
25
|
};
|
|
24
|
-
const
|
|
25
|
-
let {
|
|
26
|
-
default: defaultSlot
|
|
27
|
-
} = _ref;
|
|
28
|
-
if (!isFunction(defaultSlot)) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
26
|
+
const hasOnlyListItemsVue2 = defaultSlot => {
|
|
31
27
|
const nodes = defaultSlot();
|
|
32
28
|
if (!Array.isArray(nodes)) {
|
|
33
29
|
return false;
|
|
34
30
|
}
|
|
35
31
|
const tags = nodes.filter(vNode => vNode.tag);
|
|
36
|
-
return tags.length && tags.every(tag =>
|
|
32
|
+
return tags.length && tags.every(tag => isValidSlotTagVue2(tag));
|
|
33
|
+
};
|
|
34
|
+
const hasOnlyListItemsVue3 = defaultSlot => {
|
|
35
|
+
const nodes = defaultSlot();
|
|
36
|
+
const fragment = nodes.find(node => Array.isArray(node.children) && node.children.length);
|
|
37
|
+
const targetNodes = fragment ? fragment.children : nodes;
|
|
38
|
+
return targetNodes
|
|
39
|
+
// Remove empty text vNodes
|
|
40
|
+
.filter(vNode => !isString(vNode.text) || vNode.text.trim().length > 0).every(vNode => isValidSlotTagVue3(vNode));
|
|
41
|
+
};
|
|
42
|
+
const hasOnlyListItems = defaultSlot => {
|
|
43
|
+
if (!isFunction(defaultSlot)) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
if (Vue.version.startsWith('3')) {
|
|
47
|
+
return hasOnlyListItemsVue3(defaultSlot);
|
|
48
|
+
}
|
|
49
|
+
return hasOnlyListItemsVue2(defaultSlot);
|
|
37
50
|
};
|
|
38
51
|
|
|
39
52
|
export { hasOnlyListItems, isGroup, isItem, itemsValidator };
|