@gitlab/ui 127.1.0 → 128.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.
Files changed (33) hide show
  1. package/dist/components/base/filtered_search/filtered_search.js +9 -7
  2. package/dist/components/base/filtered_search/filtered_search_suggestion_list.js +2 -2
  3. package/dist/components/base/filtered_search/filtered_search_token_segment.js +10 -2
  4. package/dist/components/base/filtered_search/filtered_search_utils.js +2 -1
  5. package/dist/components/base/form/form_group/form_group.js +3 -0
  6. package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +95 -20
  7. package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +1 -1
  8. package/dist/components/base/new_dropdowns/listbox/listbox.js +47 -10
  9. package/dist/components/base/toast/toast.js +2 -1
  10. package/dist/index.css +1 -1
  11. package/dist/index.css.map +1 -1
  12. package/package.json +1 -1
  13. package/src/components/base/filtered_search/filtered_search.vue +8 -7
  14. package/src/components/base/filtered_search/filtered_search_suggestion_list.vue +2 -2
  15. package/src/components/base/filtered_search/filtered_search_token_segment.vue +15 -2
  16. package/src/components/base/filtered_search/filtered_search_utils.js +2 -0
  17. package/src/components/base/form/form_checkbox/form_checkbox.vue +0 -3
  18. package/src/components/base/form/form_checkbox/form_checkbox_group.vue +148 -21
  19. package/src/components/base/form/form_group/form_group.vue +3 -0
  20. package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +101 -22
  21. package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +3 -2
  22. package/src/components/base/new_dropdowns/listbox/listbox.vue +52 -9
  23. package/src/components/base/toast/toast.js +1 -0
  24. package/src/components/base/toast/toast.scss +18 -2
  25. package/src/scss/bootstrap_vue.scss +0 -1
  26. package/src/vendor/bootstrap-vue/src/constants/components.js +0 -2
  27. package/src/vendor/bootstrap-vue/src/mixins/form-radio-check-group.js +1 -2
  28. package/src/vendor/bootstrap-vue/src/components/form-checkbox/_form-checkbox-group.scss +0 -1
  29. package/src/vendor/bootstrap-vue/src/components/form-checkbox/_form-checkbox.scss +0 -125
  30. package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox-group.js +0 -42
  31. package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox.js +0 -132
  32. package/src/vendor/bootstrap-vue/src/components/form-checkbox/index.js +0 -4
  33. package/src/vendor/bootstrap-vue/src/components/form-checkbox/index.scss +0 -2
@@ -7,13 +7,20 @@
7
7
  .b-toaster-slot {
8
8
  @apply gl-w-auto;
9
9
  @apply gl-flex;
10
+ @apply gl-flex-col;
11
+ @apply gl-gap-4;
10
12
  bottom: $gl-spacing-scale-6;
11
13
  left: $gl-spacing-scale-6;
12
14
  right: auto;
13
- flex-direction: column-reverse;
14
- gap: $gl-spacing-scale-4;
15
15
  view-transition-name: gl-toast;
16
16
 
17
+ // Fallback for Firefox
18
+ // Fixes a bug where the view transition
19
+ // doesn’t work properly
20
+ @supports (-moz-appearance:none) {
21
+ view-transition-name: unset;
22
+ }
23
+
17
24
  @include media-breakpoint-down(xs) {
18
25
  @apply gl-w-full;
19
26
  left: 0;
@@ -22,6 +29,15 @@
22
29
  }
23
30
  }
24
31
 
32
+ .b-toast {
33
+ // Fallback for Firefox
34
+ // Fixes a bug where the view transition
35
+ // doesn’t work properly
36
+ @supports (-moz-appearance:none) {
37
+ transition: all $gl-transition-duration-medium $gl-easing-out-cubic;
38
+ }
39
+ }
40
+
25
41
  .gl-toast {
26
42
  @apply gl-text-base;
27
43
  @apply gl-py-5;
@@ -7,7 +7,6 @@ $bv-enable-popover-variants: false;
7
7
  @import '../vendor/bootstrap-vue/src/utilities.scss';
8
8
 
9
9
  @import '../vendor/bootstrap-vue/src/components/dropdown/index.scss';
10
- @import '../vendor/bootstrap-vue/src/components/form-checkbox/index.scss';
11
10
  @import '../vendor/bootstrap-vue/src/components/form-input/index.scss';
12
11
  @import '../vendor/bootstrap-vue/src/components/form-radio/index.scss';
13
12
  @import '../vendor/bootstrap-vue/src/components/modal/index.scss';
@@ -11,8 +11,6 @@ export const NAME_DROPDOWN_ITEM = 'BDropdownItem'
11
11
  export const NAME_DROPDOWN_ITEM_BUTTON = 'BDropdownItemButton'
12
12
  export const NAME_DROPDOWN_TEXT = 'BDropdownText'
13
13
  export const NAME_FORM = 'BForm'
14
- export const NAME_FORM_CHECKBOX = 'BFormCheckbox'
15
- export const NAME_FORM_CHECKBOX_GROUP = 'BFormCheckboxGroup'
16
14
  export const NAME_FORM_GROUP = 'BFormGroup'
17
15
  export const NAME_FORM_INVALID_FEEDBACK = 'BFormInvalidFeedback'
18
16
  export const NAME_FORM_RADIO = 'BFormRadio'
@@ -6,7 +6,6 @@ import { looseEqual } from '../utils/loose-equal'
6
6
  import { makeModelMixin } from '../utils/model'
7
7
  import { omit, pick, sortKeys } from '../utils/object'
8
8
  import { makeProp, makePropsConfigurable } from '../utils/props'
9
- import { BFormCheckbox } from '../components/form-checkbox/form-checkbox'
10
9
  import { BFormRadio } from '../components/form-radio/form-radio'
11
10
  import { formControlMixin, props as formControlProps } from './form-control'
12
11
  import { formCustomMixin, props as formCustomProps } from './form-custom'
@@ -99,7 +98,7 @@ export const formRadioCheckGroupMixin = extend({
99
98
  render(h) {
100
99
  const { isRadioGroup } = this
101
100
  const attrs = pick(this.$attrs, PASS_DOWN_ATTRS)
102
- const optionComponent = isRadioGroup ? BFormRadio : BFormCheckbox
101
+ const optionComponent = BFormRadio
103
102
 
104
103
  const $inputs = this.formOptions.map((option, index) => {
105
104
  const key = `BV_option_${index}`
@@ -1,125 +0,0 @@
1
- // Adds control sizing to Bootstrap custom checkbox/switch inputs
2
-
3
- .custom-checkbox.b-custom-control-lg,
4
- .input-group-lg .custom-checkbox {
5
- font-size: $font-size-lg;
6
- line-height: $line-height-lg;
7
- padding-left: $b-custom-control-gutter-lg + $b-custom-control-indicator-size-lg;
8
-
9
- .custom-control-label::before {
10
- top: ($font-size-lg * $line-height-lg - $b-custom-control-indicator-size-lg) * 0.5;
11
- left: -($b-custom-control-gutter-lg + $b-custom-control-indicator-size-lg);
12
- width: $b-custom-control-indicator-size-lg;
13
- height: $b-custom-control-indicator-size-lg;
14
- @include border-radius($b-custom-checkbox-indicator-border-radius-lg);
15
- }
16
-
17
- .custom-control-label::after {
18
- top: ($font-size-lg * $line-height-lg - $b-custom-control-indicator-size-lg) * 0.5;
19
- left: -($b-custom-control-gutter-lg + $b-custom-control-indicator-size-lg);
20
- width: $b-custom-control-indicator-size-lg;
21
- height: $b-custom-control-indicator-size-lg;
22
- background-size: $b-custom-control-indicator-bg-size-lg;
23
- }
24
- }
25
-
26
- .custom-checkbox.b-custom-control-sm,
27
- .input-group-sm .custom-checkbox {
28
- font-size: $font-size-sm;
29
- line-height: $line-height-sm;
30
- padding-left: $b-custom-control-gutter-sm + $b-custom-control-indicator-size-sm;
31
-
32
- .custom-control-label::before {
33
- top: ($font-size-sm * $line-height-sm - $b-custom-control-indicator-size-sm) * 0.5;
34
- left: -($b-custom-control-gutter-sm + $b-custom-control-indicator-size-sm);
35
- width: $b-custom-control-indicator-size-sm;
36
- height: $b-custom-control-indicator-size-sm;
37
- @include border-radius($b-custom-checkbox-indicator-border-radius-sm);
38
- }
39
-
40
- .custom-control-label::after {
41
- top: ($font-size-sm * $line-height-sm - $b-custom-control-indicator-size-sm) * 0.5;
42
- left: -($b-custom-control-gutter-sm + $b-custom-control-indicator-size-sm);
43
- width: $b-custom-control-indicator-size-sm;
44
- height: $b-custom-control-indicator-size-sm;
45
- background-size: $b-custom-control-indicator-bg-size-sm;
46
- }
47
- }
48
-
49
- .custom-switch.b-custom-control-lg,
50
- .input-group-lg .custom-switch {
51
- padding-left: $b-custom-switch-width-lg + $b-custom-control-gutter-lg;
52
-
53
- .custom-control-label {
54
- font-size: $font-size-lg;
55
- line-height: $line-height-lg;
56
-
57
- &::before {
58
- top: ($font-size-lg * $line-height-lg - $b-custom-control-indicator-size-lg) * 0.5;
59
- height: $b-custom-control-indicator-size-lg;
60
- left: -($b-custom-switch-width-lg + $b-custom-control-gutter-lg);
61
- width: $b-custom-switch-width-lg;
62
- border-radius: $b-custom-switch-indicator-border-radius-lg;
63
- }
64
-
65
- &::after {
66
- top: calc(
67
- #{(($font-size-lg * $line-height-lg - $b-custom-control-indicator-size-lg) * 0.5)} + #{$custom-control-indicator-border-width *
68
- 2}
69
- );
70
- left: calc(
71
- #{- ($b-custom-switch-width-lg + $b-custom-control-gutter-lg)} + #{$custom-control-indicator-border-width *
72
- 2}
73
- );
74
- width: $b-custom-switch-indicator-size-lg;
75
- height: $b-custom-switch-indicator-size-lg;
76
- border-radius: $b-custom-switch-indicator-border-radius-lg;
77
- background-size: $b-custom-control-indicator-bg-size-lg;
78
- }
79
- }
80
-
81
- .custom-control-input:checked ~ .custom-control-label {
82
- &::after {
83
- transform: translateX($b-custom-switch-width-lg - $b-custom-control-indicator-size-lg);
84
- }
85
- }
86
- }
87
-
88
- .custom-switch.b-custom-control-sm,
89
- .input-group-sm .custom-switch {
90
- padding-left: $b-custom-switch-width-sm + $b-custom-control-gutter-sm;
91
-
92
- .custom-control-label {
93
- font-size: $font-size-sm;
94
- line-height: $line-height-sm;
95
-
96
- &::before {
97
- top: ($font-size-sm * $line-height-sm - $b-custom-control-indicator-size-sm) * 0.5;
98
- left: -($b-custom-switch-width-sm + $b-custom-control-gutter-sm);
99
- width: $b-custom-switch-width-sm;
100
- height: $b-custom-control-indicator-size-sm;
101
- border-radius: $b-custom-switch-indicator-border-radius-sm;
102
- }
103
-
104
- &::after {
105
- top: calc(
106
- #{(($font-size-sm * $line-height-sm - $b-custom-control-indicator-size-sm) * 0.5)} + #{$custom-control-indicator-border-width *
107
- 2}
108
- );
109
- left: calc(
110
- #{- ($b-custom-switch-width-sm + $b-custom-control-gutter-sm)} + #{$custom-control-indicator-border-width *
111
- 2}
112
- );
113
- width: $b-custom-switch-indicator-size-sm;
114
- height: $b-custom-switch-indicator-size-sm;
115
- border-radius: $b-custom-switch-indicator-border-radius-sm;
116
- background-size: $b-custom-control-indicator-bg-size-sm;
117
- }
118
- }
119
-
120
- .custom-control-input:checked ~ .custom-control-label {
121
- &::after {
122
- transform: translateX($b-custom-switch-width-sm - $b-custom-control-indicator-size-sm);
123
- }
124
- }
125
- }
@@ -1,42 +0,0 @@
1
- import { extend } from '../../vue'
2
- import { NAME_FORM_CHECKBOX_GROUP } from '../../constants/components'
3
- import { PROP_TYPE_ARRAY, PROP_TYPE_BOOLEAN } from '../../constants/props'
4
- import { sortKeys } from '../../utils/object'
5
- import { makeProp, makePropsConfigurable } from '../../utils/props'
6
- import {
7
- MODEL_PROP_NAME,
8
- formRadioCheckGroupMixin,
9
- props as formRadioCheckGroupProps
10
- } from '../../mixins/form-radio-check-group'
11
-
12
- // --- Props ---
13
-
14
- export const props = makePropsConfigurable(
15
- sortKeys({
16
- ...formRadioCheckGroupProps,
17
- [MODEL_PROP_NAME]: makeProp(PROP_TYPE_ARRAY, []),
18
- // Custom switch styling
19
- switches: makeProp(PROP_TYPE_BOOLEAN, false)
20
- }),
21
- NAME_FORM_CHECKBOX_GROUP
22
- )
23
-
24
- // --- Main component ---
25
-
26
- // @vue/component
27
- export const BFormCheckboxGroup = /*#__PURE__*/ extend({
28
- name: NAME_FORM_CHECKBOX_GROUP,
29
- // Includes render function
30
- mixins: [formRadioCheckGroupMixin],
31
- provide() {
32
- return {
33
- getBvCheckGroup: () => this
34
- }
35
- },
36
- props,
37
- computed: {
38
- isRadioGroup() {
39
- return false
40
- }
41
- }
42
- })
@@ -1,132 +0,0 @@
1
- import { extend } from '../../vue'
2
- import { NAME_FORM_CHECKBOX } from '../../constants/components'
3
- import { EVENT_NAME_CHANGE, MODEL_EVENT_NAME_PREFIX } from '../../constants/events'
4
- import { PROP_TYPE_ANY, PROP_TYPE_BOOLEAN } from '../../constants/props'
5
- import { isArray } from '../../utils/inspect'
6
- import { looseEqual } from '../../utils/loose-equal'
7
- import { looseIndexOf } from '../../utils/loose-index-of'
8
- import { sortKeys } from '../../utils/object'
9
- import { makeProp, makePropsConfigurable } from '../../utils/props'
10
- import {
11
- MODEL_EVENT_NAME,
12
- formRadioCheckMixin,
13
- props as formRadioCheckProps
14
- } from '../../mixins/form-radio-check'
15
-
16
- // --- Constants ---
17
-
18
- const MODEL_PROP_NAME_INDETERMINATE = 'indeterminate'
19
- const MODEL_EVENT_NAME_INDETERMINATE = MODEL_EVENT_NAME_PREFIX + MODEL_PROP_NAME_INDETERMINATE
20
-
21
- // --- Props ---
22
-
23
- export const props = makePropsConfigurable(
24
- sortKeys({
25
- ...formRadioCheckProps,
26
- // Not applicable in multi-check mode
27
- [MODEL_PROP_NAME_INDETERMINATE]: makeProp(PROP_TYPE_BOOLEAN, false),
28
- // Custom switch styling
29
- switch: makeProp(PROP_TYPE_BOOLEAN, false),
30
- // Not applicable in multi-check mode
31
- uncheckedValue: makeProp(PROP_TYPE_ANY, false),
32
- value: makeProp(PROP_TYPE_ANY, true)
33
- }),
34
- NAME_FORM_CHECKBOX
35
- )
36
-
37
- // --- Main component ---
38
-
39
- // @vue/component
40
- export const BFormCheckbox = /*#__PURE__*/ extend({
41
- name: NAME_FORM_CHECKBOX,
42
- mixins: [formRadioCheckMixin],
43
- inject: {
44
- getBvGroup: {
45
- from: 'getBvCheckGroup',
46
- default: () => () => null
47
- }
48
- },
49
- props,
50
- computed: {
51
- bvGroup() {
52
- return this.getBvGroup()
53
- },
54
- isChecked() {
55
- const { value, computedLocalChecked: checked } = this
56
- return isArray(checked) ? looseIndexOf(checked, value) > -1 : looseEqual(checked, value)
57
- },
58
- isRadio() {
59
- return false
60
- }
61
- },
62
- watch: {
63
- [MODEL_PROP_NAME_INDETERMINATE](newValue, oldValue) {
64
- if (!looseEqual(newValue, oldValue)) {
65
- this.setIndeterminate(newValue)
66
- }
67
- }
68
- },
69
- mounted() {
70
- // Set initial indeterminate state
71
- this.setIndeterminate(this[MODEL_PROP_NAME_INDETERMINATE])
72
- },
73
- methods: {
74
- computedLocalCheckedWatcher(newValue, oldValue) {
75
- if (!looseEqual(newValue, oldValue)) {
76
- this.$emit(MODEL_EVENT_NAME, newValue)
77
-
78
- const $input = this.$refs.input
79
- if ($input) {
80
- this.$emit(MODEL_EVENT_NAME_INDETERMINATE, $input.indeterminate)
81
- }
82
- }
83
- },
84
-
85
- handleChange({ target: { checked, indeterminate } }) {
86
- const { value, uncheckedValue } = this
87
-
88
- // Update `computedLocalChecked`
89
- let localChecked = this.computedLocalChecked
90
- if (isArray(localChecked)) {
91
- const index = looseIndexOf(localChecked, value)
92
- if (checked && index < 0) {
93
- // Add value to array
94
- localChecked = localChecked.concat(value)
95
- } else if (!checked && index > -1) {
96
- // Remove value from array
97
- localChecked = localChecked.slice(0, index).concat(localChecked.slice(index + 1))
98
- }
99
- } else {
100
- localChecked = checked ? value : uncheckedValue
101
- }
102
- this.computedLocalChecked = localChecked
103
-
104
- // Fire events in a `$nextTick()` to ensure the `v-model` is updated
105
- this.$nextTick(() => {
106
- // Change is only emitted on user interaction
107
- this.$emit(EVENT_NAME_CHANGE, localChecked)
108
-
109
- // If this is a child of a group, we emit a change event on it as well
110
- if (this.isGroup) {
111
- this.bvGroup.$emit(EVENT_NAME_CHANGE, localChecked)
112
- }
113
-
114
- this.$emit(MODEL_EVENT_NAME_INDETERMINATE, indeterminate)
115
- })
116
- },
117
-
118
- setIndeterminate(state) {
119
- // Indeterminate only supported in single checkbox mode
120
- if (isArray(this.computedLocalChecked)) {
121
- state = false
122
- }
123
-
124
- const $input = this.$refs.input
125
- if ($input) {
126
- $input.indeterminate = state
127
- // Emit update event to prop
128
- this.$emit(MODEL_EVENT_NAME_INDETERMINATE, state)
129
- }
130
- }
131
- }
132
- })
@@ -1,4 +0,0 @@
1
- import { BFormCheckbox } from './form-checkbox'
2
- import { BFormCheckboxGroup } from './form-checkbox-group'
3
-
4
- export { BFormCheckbox, BFormCheckboxGroup }
@@ -1,2 +0,0 @@
1
- @import "form-checkbox";
2
- @import "form-checkbox-group";