@gitlab/ui 101.4.0 → 101.6.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/segmented_control/segmented_control.js +23 -59
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +1 -1
- package/src/components/base/drawer/drawer.scss +1 -1
- package/src/components/base/segmented_control/segmented_control.md +26 -1
- package/src/components/base/segmented_control/segmented_control.vue +37 -59
- package/src/components/base/table/table.scss +1 -2
- package/src/scss/components.scss +0 -1
- package/src/scss/mixins.scss +1 -0
- package/src/components/base/segmented_control/segmented_control.scss +0 -189
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [101.6.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v101.5.0...v101.6.0) (2024-10-31)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **Typography:** Update gl-heading to use design token color ([539409e](https://gitlab.com/gitlab-org/gitlab-ui/commit/539409e3747d0f59e282256b89b455d5db6448ff))
|
|
7
|
+
|
|
8
|
+
# [101.5.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v101.4.0...v101.5.0) (2024-10-31)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **GlSegmentedControl:** Reactivate deprecated component ([317673e](https://gitlab.com/gitlab-org/gitlab-ui/commit/317673e74e1bd694fdd30ed575f51038b399d43d))
|
|
14
|
+
|
|
1
15
|
# [101.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v101.3.1...v101.4.0) (2024-10-31)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -1,71 +1,35 @@
|
|
|
1
|
-
import
|
|
1
|
+
import GlButtonGroup from '../button_group/button_group';
|
|
2
|
+
import GlButton from '../button/button';
|
|
2
3
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
3
4
|
|
|
4
|
-
const
|
|
5
|
+
const validateOptionsProp = options => {
|
|
6
|
+
const requiredOptionPropType = {
|
|
7
|
+
value: ['string', 'number', 'boolean'],
|
|
8
|
+
disabled: ['boolean', 'undefined']
|
|
9
|
+
};
|
|
10
|
+
const optionProps = Object.keys(requiredOptionPropType);
|
|
11
|
+
return options.every(option => {
|
|
12
|
+
if (!option) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
return optionProps.every(name => requiredOptionPropType[name].includes(typeof option[name]));
|
|
16
|
+
});
|
|
17
|
+
};
|
|
5
18
|
var script = {
|
|
6
19
|
name: 'GlSegmentedControl',
|
|
7
20
|
components: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
inheritAttrs: false,
|
|
11
|
-
model: {
|
|
12
|
-
prop: 'checked',
|
|
13
|
-
event: 'input'
|
|
21
|
+
GlButtonGroup,
|
|
22
|
+
GlButton
|
|
14
23
|
},
|
|
15
24
|
props: {
|
|
16
|
-
checked: {
|
|
17
|
-
required: true,
|
|
18
|
-
validator: () => true
|
|
19
|
-
},
|
|
20
25
|
options: {
|
|
21
26
|
type: Array,
|
|
22
|
-
required: true
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
computed: {
|
|
26
|
-
enabledOptions() {
|
|
27
|
-
return this.options.filter(option => !option.disabled);
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
watch: {
|
|
31
|
-
checked: {
|
|
32
|
-
handler(newValue, oldValue) {
|
|
33
|
-
this.checkValue(newValue, oldValue);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
options: {
|
|
37
|
-
handler() {
|
|
38
|
-
this.checkValue(this.checked);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
created() {
|
|
43
|
-
this.checkValue(this.checked);
|
|
44
|
-
},
|
|
45
|
-
methods: {
|
|
46
|
-
checkValue(newValue) {
|
|
47
|
-
let oldValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
48
|
-
if (!this.isValidValue(newValue)) {
|
|
49
|
-
// eslint-disable-next-line no-console
|
|
50
|
-
console.warn(genericErrorMessage);
|
|
51
|
-
if (this.enabledOptions.length) {
|
|
52
|
-
const suggestion = oldValue && this.isValidValue(oldValue) ? oldValue : this.enabledOptions[0].value;
|
|
53
|
-
/**
|
|
54
|
-
* Emitted when the selection changes
|
|
55
|
-
* @event input
|
|
56
|
-
* @argument checked The selected option
|
|
57
|
-
*/
|
|
58
|
-
this.$emit('input', suggestion);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
27
|
+
required: true,
|
|
28
|
+
validator: validateOptionsProp
|
|
61
29
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
value
|
|
66
|
-
} = _ref;
|
|
67
|
-
return value === val;
|
|
68
|
-
});
|
|
30
|
+
value: {
|
|
31
|
+
type: [String, Number, Boolean],
|
|
32
|
+
required: true
|
|
69
33
|
}
|
|
70
34
|
}
|
|
71
35
|
};
|
|
@@ -74,7 +38,7 @@ var script = {
|
|
|
74
38
|
const __vue_script__ = script;
|
|
75
39
|
|
|
76
40
|
/* template */
|
|
77
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('
|
|
41
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-button-group',_vm._l((_vm.options),function(option){return _c('gl-button',_vm._b({key:option.value,attrs:{"disabled":!!option.disabled,"selected":_vm.value === option.value},on:{"click":function($event){return _vm.$emit('input', option.value)}}},'gl-button',option.props,false),[_vm._t("button-content",function(){return [_vm._v("\n "+_vm._s(option.text)+"\n ")]},null,option)],2)}),1)};
|
|
78
42
|
var __vue_staticRenderFns__ = [];
|
|
79
43
|
|
|
80
44
|
/* style */
|