@gitlab/ui 101.16.0 → 102.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 (36) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_details_modal/duo_chat_context_item_details_modal.js +3 -0
  3. package/dist/vendor/bootstrap-vue/src/components/button/button.js +0 -4
  4. package/dist/vendor/bootstrap-vue/src/components/nav/nav.js +6 -9
  5. package/dist/vendor/bootstrap-vue/src/components/tabs/tabs.js +6 -30
  6. package/dist/vendor/bootstrap-vue/src/index.js +1 -11
  7. package/dist/vendor/bootstrap-vue/src/mixins/form-radio-check-group.js +2 -16
  8. package/dist/vendor/bootstrap-vue/src/mixins/form-radio-check.js +14 -104
  9. package/package.json +1 -2
  10. package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_details_modal/duo_chat_context_item_details_modal.vue +3 -0
  11. package/src/vendor/bootstrap-vue/src/components/button/MODIFICATIONS.md +16 -0
  12. package/src/vendor/bootstrap-vue/src/components/button/README.md +0 -39
  13. package/src/vendor/bootstrap-vue/src/components/button/button.js +0 -4
  14. package/src/vendor/bootstrap-vue/src/components/button/button.spec.js +0 -36
  15. package/src/vendor/bootstrap-vue/src/components/form-checkbox/README.md +3 -174
  16. package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox-group.spec.js +0 -117
  17. package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox.spec.js +0 -409
  18. package/src/vendor/bootstrap-vue/src/components/form-radio/README.md +0 -129
  19. package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio-group.spec.js +0 -112
  20. package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio.spec.js +0 -365
  21. package/src/vendor/bootstrap-vue/src/components/nav/README.md +0 -20
  22. package/src/vendor/bootstrap-vue/src/components/nav/nav.js +7 -9
  23. package/src/vendor/bootstrap-vue/src/components/nav/nav.spec.js +0 -67
  24. package/src/vendor/bootstrap-vue/src/components/tabs/README.md +45 -187
  25. package/src/vendor/bootstrap-vue/src/components/tabs/tabs.js +6 -29
  26. package/src/vendor/bootstrap-vue/src/components/tabs/tabs.spec.js +0 -58
  27. package/src/vendor/bootstrap-vue/src/index.js +0 -17
  28. package/src/vendor/bootstrap-vue/src/mixins/form-radio-check-group.js +3 -20
  29. package/src/vendor/bootstrap-vue/src/mixins/form-radio-check.js +19 -114
  30. package/src/vendor/bootstrap-vue/src/utils/config.spec.js +0 -18
  31. package/dist/index.css +0 -7
  32. package/dist/index.css.map +0 -1
  33. package/dist/index.js +0 -115
  34. package/dist/vendor/bootstrap-vue/src/components/index.js +0 -11
  35. package/src/index.js +0 -130
  36. package/src/vendor/bootstrap-vue/src/components/index.js +0 -11
@@ -38,10 +38,6 @@ export const props = makePropsConfigurable(
38
38
  ...formCustomProps,
39
39
  ariaLabel: makeProp(PROP_TYPE_STRING),
40
40
  ariaLabelledby: makeProp(PROP_TYPE_STRING),
41
- // Only applicable in standalone mode (non group)
42
- button: makeProp(PROP_TYPE_BOOLEAN, false),
43
- // Only applicable when rendered with button style
44
- buttonVariant: makeProp(PROP_TYPE_STRING),
45
41
  inline: makeProp(PROP_TYPE_BOOLEAN, false),
46
42
  value: makeProp(PROP_TYPE_ANY)
47
43
  }),
@@ -66,8 +62,7 @@ export const formRadioCheckMixin = extend({
66
62
  props,
67
63
  data() {
68
64
  return {
69
- localChecked: this.isGroup ? this.bvGroup[MODEL_PROP_NAME] : this[MODEL_PROP_NAME],
70
- hasFocus: false
65
+ localChecked: this.isGroup ? this.bvGroup[MODEL_PROP_NAME] : this[MODEL_PROP_NAME]
71
66
  }
72
67
  },
73
68
  computed: {
@@ -93,23 +88,9 @@ export const formRadioCheckMixin = extend({
93
88
  // Is this check/radio a child of check-group or radio-group?
94
89
  return !!this.bvGroup
95
90
  },
96
- isBtnMode() {
97
- // Support button style in single input mode
98
- return this.isGroup ? this.bvGroup.buttons : this.button
99
- },
100
- isPlain() {
101
- return this.isBtnMode ? false : this.isGroup ? this.bvGroup.plain : this.plain
102
- },
103
- isCustom() {
104
- return this.isBtnMode ? false : !this.isPlain
105
- },
106
91
  isSwitch() {
107
92
  // Custom switch styling (checkboxes only)
108
- return this.isBtnMode || this.isRadio || this.isPlain
109
- ? false
110
- : this.isGroup
111
- ? this.bvGroup.switches
112
- : this.switch
93
+ return this.isRadio ? false : this.isGroup ? this.bvGroup.switches : this.switch
113
94
  },
114
95
  isInline() {
115
96
  return this.isGroup ? this.bvGroup.inline : this.inline
@@ -137,33 +118,6 @@ export const formRadioCheckMixin = extend({
137
118
  computedState() {
138
119
  return this.isGroup ? this.bvGroup.computedState : isBoolean(this.state) ? this.state : null
139
120
  },
140
- computedButtonVariant() {
141
- // Local variant preferred over group variant
142
- const { buttonVariant } = this
143
- if (buttonVariant) {
144
- return buttonVariant
145
- }
146
- if (this.isGroup && this.bvGroup.buttonVariant) {
147
- return this.bvGroup.buttonVariant
148
- }
149
- return 'secondary'
150
- },
151
- buttonClasses() {
152
- const { computedSize } = this
153
- return [
154
- 'btn',
155
- `btn-${this.computedButtonVariant}`,
156
- {
157
- [`btn-${computedSize}`]: computedSize,
158
- // 'disabled' class makes "button" look disabled
159
- disabled: this.isDisabled,
160
- // 'active' class makes "button" look pressed
161
- active: this.isChecked,
162
- // Focus class makes button look focused
163
- focus: this.hasFocus
164
- }
165
- ]
166
- },
167
121
  computedAttrs() {
168
122
  const { isDisabled: disabled, isRequired: required } = this
169
123
 
@@ -218,17 +172,6 @@ export const formRadioCheckMixin = extend({
218
172
  }
219
173
  })
220
174
  },
221
- handleFocus(event) {
222
- // When in buttons mode, we need to add 'focus' class to label when input focused
223
- // As it is the hidden input which has actual focus
224
- if (event.target) {
225
- if (event.type === 'focus') {
226
- this.hasFocus = true
227
- } else if (event.type === 'blur') {
228
- this.hasFocus = false
229
- }
230
- }
231
- },
232
175
 
233
176
  // Convenience methods for focusing the input
234
177
  focus() {
@@ -236,6 +179,7 @@ export const formRadioCheckMixin = extend({
236
179
  attemptFocus(this.$refs.input)
237
180
  }
238
181
  },
182
+
239
183
  blur() {
240
184
  if (!this.isDisabled) {
241
185
  attemptBlur(this.$refs.input)
@@ -243,28 +187,11 @@ export const formRadioCheckMixin = extend({
243
187
  }
244
188
  },
245
189
  render(h) {
246
- const {
247
- isRadio,
248
- isBtnMode,
249
- isPlain,
250
- isCustom,
251
- isInline,
252
- isSwitch,
253
- computedSize,
254
- bvAttrs
255
- } = this
190
+ const { isRadio, isInline, isSwitch, computedSize, bvAttrs } = this
256
191
  const $content = this.normalizeSlot()
257
192
 
258
193
  const $input = h('input', {
259
- class: [
260
- {
261
- 'form-check-input': isPlain,
262
- 'custom-control-input': isCustom,
263
- // https://github.com/bootstrap-vue/bootstrap-vue/issues/2911
264
- 'position-static': isPlain && !$content
265
- },
266
- isBtnMode ? '' : this.stateClass
267
- ],
194
+ class: ['custom-control-input', this.stateClass],
268
195
  directives: [{ name: 'model', value: this.computedLocalChecked }],
269
196
  attrs: this.computedAttrs,
270
197
  domProps: {
@@ -272,56 +199,34 @@ export const formRadioCheckMixin = extend({
272
199
  checked: this.isChecked
273
200
  },
274
201
  on: {
275
- change: this.handleChange,
276
- ...(isBtnMode ? { focus: this.handleFocus, blur: this.handleFocus } : {})
202
+ change: this.handleChange
277
203
  },
278
204
  key: 'input',
279
205
  ref: 'input'
280
206
  })
281
207
 
282
- if (isBtnMode) {
283
- let $button = h('label', { class: this.buttonClasses }, [$input, $content])
284
- if (!this.isGroup) {
285
- // Standalone button mode, so wrap in 'btn-group-toggle'
286
- // and flag it as inline-block to mimic regular buttons
287
- $button = h('div', { class: ['btn-group-toggle', 'd-inline-block'] }, [$button])
288
- }
289
-
290
- return $button
291
- }
292
-
293
- // If no label content in plain mode we dont render the label
294
- // See: https://github.com/bootstrap-vue/bootstrap-vue/issues/2911
295
- let $label = h()
296
- if (!(isPlain && !$content)) {
297
- $label = h(
298
- 'label',
299
- {
300
- class: {
301
- 'form-check-label': isPlain,
302
- 'custom-control-label': isCustom
303
- },
304
- attrs: { for: this.safeId() }
305
- },
306
- $content
307
- )
308
- }
208
+ const $label = h(
209
+ 'label',
210
+ {
211
+ class: 'custom-control-label',
212
+ attrs: { for: this.safeId() }
213
+ },
214
+ $content
215
+ )
309
216
 
310
217
  return h(
311
218
  'div',
312
219
  {
313
220
  class: [
314
221
  {
315
- 'form-check': isPlain,
316
- 'form-check-inline': isPlain && isInline,
317
- 'custom-control': isCustom,
318
- 'custom-control-inline': isCustom && isInline,
319
- 'custom-checkbox': isCustom && !isRadio && !isSwitch,
222
+ 'custom-control-inline': isInline,
223
+ 'custom-checkbox': !isRadio && !isSwitch,
320
224
  'custom-switch': isSwitch,
321
- 'custom-radio': isCustom && isRadio,
225
+ 'custom-radio': isRadio,
322
226
  // Temporary until Bootstrap v4 supports sizing (most likely in V5)
323
- [`b-custom-control-${computedSize}`]: computedSize && !isBtnMode
227
+ [`b-custom-control-${computedSize}`]: computedSize
324
228
  },
229
+ 'custom-control',
325
230
  bvAttrs.class
326
231
  ],
327
232
  style: bvAttrs.style
@@ -1,6 +1,5 @@
1
1
  import { createLocalVue } from '@vue/test-utils'
2
2
  import { isVue3 } from '../../src/vue'
3
- import { BootstrapVue } from '../../src'
4
3
  import { ToastPlugin } from '../../src/components/toast'
5
4
  import { BVConfigPlugin } from '../../src/bv-config'
6
5
  import { setConfig, resetConfig } from './config-set'
@@ -73,23 +72,6 @@ describe('utils/config', () => {
73
72
  })
74
73
 
75
74
  if (!isVue3) {
76
- // We do not have complete localVue support, so resetting config does not work in proper way
77
- it('config via Vue.use(BootstrapVue) works', async () => {
78
- const localVue = createLocalVue()
79
- const config = {
80
- BButton: { variant: 'foobar' }
81
- }
82
-
83
- expect(getConfig()).toEqual({})
84
-
85
- localVue.use(BootstrapVue, config)
86
- expect(getConfig()).toEqual(config)
87
-
88
- // Reset the configuration
89
- resetConfig()
90
- expect(getConfig()).toEqual({})
91
- })
92
-
93
75
  it('config via Vue.use(ComponentPlugin) works', async () => {
94
76
  const localVue = createLocalVue()
95
77
  const config = {