@@ -20,7 +20,7 @@ export default (options: Options): Rule => async (host: Tree, context: Schematic
2020 const CARD_ACTIONS = [ 'igx-card-actions' ] ;
2121 const prop = [ 'igxButton' ] ;
2222 const changes = new Map < string , FileChange [ ] > ( ) ;
23-
23+
2424 const applyChanges = ( ) => {
2525 for ( const [ path , change ] of changes . entries ( ) ) {
2626 let buffer = host . read ( path ) . toString ( ) ;
@@ -57,25 +57,34 @@ export default (options: Options): Rule => async (host: Tree, context: Schematic
5757 const icons : any [ ] = [ ] ;
5858 getChildren ( card_action_elem , buttons , icons ) ;
5959
60- icons . map ( node => getSourceOffset ( node as Element ) )
60+ icons . map ( node => getSourceOffset ( node as Element ) )
6161 . forEach ( offset => {
62- const { startTag, file } = offset ;
63- addChange ( file . url , new FileChange ( startTag . end - 1 , ' igxEnd' ) ) ;
62+ const { startTag, file, node } = offset ;
63+ const end = getAttribute ( node , 'igxEnd' ) [ 0 ] ;
64+
65+ if ( ! end ) {
66+ addChange ( file . url , new FileChange ( startTag . end - 1 , ' igxEnd' ) ) ;
67+ }
6468 } )
65-
69+
6670 buttons . map ( node => getSourceOffset ( node as Element ) )
6771 . forEach ( offset => {
6872 const { startTag, file, node } = offset ;
6973 const { value } = getAttribute ( node , prop ) [ 0 ] ;
70- if ( value === 'icon' ) {
71- addChange ( file . url , new FileChange ( startTag . end - 1 , ' igxEnd' ) ) ;
72- } else {
74+ const start = getAttribute ( node , 'igxStart' ) [ 0 ] ;
75+ const end = getAttribute ( node , 'igxEnd' ) [ 0 ] ;
76+
77+ if ( ! start && value !== 'icon' ) {
7378 addChange ( file . url , new FileChange ( startTag . end - 1 , ' igxStart' ) ) ;
7479 }
80+
81+ if ( ! end && value === 'icon' ) {
82+ addChange ( file . url , new FileChange ( startTag . end - 1 , ' igxEnd' ) ) ;
83+ }
7584 } ) ;
7685 } ) ;
7786 }
78-
87+
7988 update . shouldInvokeLS = options [ 'shouldInvokeLS' ] ;
8089 update . addValueTransform ( 'roundShape_is_deprecated' , ( args : BoundPropertyObject ) : void => {
8190 args . bindingType = InputPropertyType . STRING ;
0 commit comments