Draft: Copied and adjusted code from Bootstrap Vue components

WIP

This keeps track of code we've copied and adjusted from Bootstrap Vue components when removing the dependency on them in the respective GitLab component. Once we get a better picture of all the places we have common code, it might be worth investigating using composition API or helper functions.

Props

Props are made configurable with makePropsConfigurable and can be combined from different places like imported from other components and mixins. All the props needs to be gathered and put directly into the GitLab component.

From
export const props = makePropsConfigurable(
  {
    autofocus: makeProp(PROP_TYPE_BOOLEAN, false),
    form: makeProp(PROP_TYPE_STRING),
    type: makeProp(PROP_TYPE_STRING, 'text', type => {
      return arrayIncludes(TYPES, type)
    }),
  },
  'formControls'
)

export const BFormInput = /*#__PURE__*/ extend({
  props,
To
export default {
  props: {
    autofocus: {
      type: Boolean,
      required: false,
      default: false,
    },
    form: {
      type: String,
      required: false,
      default: undefined,
    },
    type: {
      type: String,
      required: false,
      default: 'text',
      validator: (value) => TYPES.includes(value),
    }
  }
}

Mixins

See threads below. Replies to existing threads, if a mixin is listed already. Otherwise, add a new thread

Utils

See threads below. Replies to existing threads, if a util is listed already. Otherwise, add a new thread

Edited by Chaoyue Zhao