11import { Vue , mergeData } from '../vue'
22import { NAME_ICON } from '../constants/components'
3- import { PROP_TYPE_BOOLEAN , PROP_TYPE_STRING } from '../constants/props'
3+ import { PROP_TYPE_STRING } from '../constants/props'
44import { RX_ICON_PREFIX } from '../constants/regex'
55import { omit , sortKeys } from '../utils/object'
6- import { makeProp , makePropsConfigurable } from '../utils/props'
6+ import { makeProp , makePropsConfigurable , pluckProps } from '../utils/props'
77import { pascalCase , trim } from '../utils/string'
88import { BIconBlank } from './icons'
99import { props as BVIconBaseProps } from './helpers/icon-base'
@@ -21,11 +21,12 @@ const findIconComponent = (ctx, iconName) => {
2121
2222// --- Props ---
2323
24+ const iconProps = omit ( BVIconBaseProps , [ 'content' ] )
25+
2426export const props = makePropsConfigurable (
2527 sortKeys ( {
26- ...omit ( BVIconBaseProps , [ 'content' , 'stacked' ] ) ,
27- icon : makeProp ( PROP_TYPE_STRING ) ,
28- stacked : makeProp ( PROP_TYPE_BOOLEAN , false )
28+ ...iconProps ,
29+ icon : makeProp ( PROP_TYPE_STRING )
2930 } ) ,
3031 NAME_ICON
3132)
@@ -47,7 +48,7 @@ export const BIcon = /*#__PURE__*/ Vue.extend({
4748 // If not registered, we render a blank icon
4849 return h (
4950 icon ? findIconComponent ( parent , `BIcon${ icon } ` ) || BIconBlank : BIconBlank ,
50- mergeData ( data , { props : { ... props , icon : null } } )
51+ mergeData ( data , { props : pluckProps ( iconProps , props ) } )
5152 )
5253 }
5354} )
0 commit comments