@@ -20,7 +20,7 @@ export default (options: Options): Rule => async (host: Tree, context: Schematic
20
20
const CARD_ACTIONS = [ 'igx-card-actions' ] ;
21
21
const prop = [ 'igxButton' ] ;
22
22
const changes = new Map < string , FileChange [ ] > ( ) ;
23
-
23
+
24
24
const applyChanges = ( ) => {
25
25
for ( const [ path , change ] of changes . entries ( ) ) {
26
26
let buffer = host . read ( path ) . toString ( ) ;
@@ -57,25 +57,34 @@ export default (options: Options): Rule => async (host: Tree, context: Schematic
57
57
const icons : any [ ] = [ ] ;
58
58
getChildren ( card_action_elem , buttons , icons ) ;
59
59
60
- icons . map ( node => getSourceOffset ( node as Element ) )
60
+ icons . map ( node => getSourceOffset ( node as Element ) )
61
61
. 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
+ }
64
68
} )
65
-
69
+
66
70
buttons . map ( node => getSourceOffset ( node as Element ) )
67
71
. forEach ( offset => {
68
72
const { startTag, file, node } = offset ;
69
73
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' ) {
73
78
addChange ( file . url , new FileChange ( startTag . end - 1 , ' igxStart' ) ) ;
74
79
}
80
+
81
+ if ( ! end && value === 'icon' ) {
82
+ addChange ( file . url , new FileChange ( startTag . end - 1 , ' igxEnd' ) ) ;
83
+ }
75
84
} ) ;
76
85
} ) ;
77
86
}
78
-
87
+
79
88
update . shouldInvokeLS = options [ 'shouldInvokeLS' ] ;
80
89
update . addValueTransform ( 'roundShape_is_deprecated' , ( args : BoundPropertyObject ) : void => {
81
90
args . bindingType = InputPropertyType . STRING ;
0 commit comments