This repository was archived by the owner on Aug 2, 2024. It is now read-only.
File tree 10 files changed +9
-54
lines changed
10 files changed +9
-54
lines changed Original file line number Diff line number Diff line change 1
1
import Component from '@ember/component' ;
2
2
import { action , computed } from '@ember/object' ;
3
- import { invokeAction } from 'ember-invoke-action' ;
4
3
import { tagName , layout } from '@ember-decorators/component' ;
5
4
import template from '../../templates/components/polaris-action-list/section' ;
6
5
@@ -40,11 +39,11 @@ export default class PolarisActionListSection extends Component {
40
39
}
41
40
42
41
@action
43
- onItemAction ( item , event ) {
42
+ handleAction ( item , event ) {
44
43
event . preventDefault ( ) ;
45
44
event . stopPropagation ( ) ;
46
45
47
- invokeAction ( item , ' onAction' ) ;
48
- invokeAction ( this , ' onActionAnyItem' ) ;
46
+ item . onAction ?. ( ) ;
47
+ this . onActionAnyItem ?. ( ) ;
49
48
}
50
49
}
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import { guidFor } from '@ember/object/internals';
6
6
import { capitalize } from '@ember/string' ;
7
7
import { deprecate } from '@ember/application/deprecations' ;
8
8
import { tagName , layout } from '@ember-decorators/component' ;
9
- import { invokeAction } from 'ember-invoke-action' ;
10
9
import template from '../templates/components/polaris-banner' ;
11
10
import { handleMouseUpByBlurring } from '../utils/focus' ;
12
11
import deprecateClassArgument from '../utils/deprecate-class-argument' ;
@@ -210,7 +209,7 @@ export default class PolarisBanner extends Component {
210
209
event . stopPropagation ( ) ;
211
210
}
212
211
213
- return invokeAction ( this , actionObj . onAction ) ;
212
+ return this . actionObj ? .onAction ( ) ;
214
213
}
215
214
216
215
@action
Original file line number Diff line number Diff line change 1
1
import Component from '@ember/component' ;
2
- import { action , computed } from '@ember/object' ;
2
+ import { computed } from '@ember/object' ;
3
3
import { isArray } from '@ember/array' ;
4
4
import { tagName , layout as templateLayout } from '@ember-decorators/component' ;
5
- import { invokeAction } from 'ember-invoke-action' ;
6
5
import layout from '../templates/components/polaris-page-actions' ;
7
6
import deprecateClassArgument from '../utils/deprecate-class-argument' ;
8
7
@@ -36,9 +35,4 @@ export default class PolarisPageActions extends Component {
36
35
get showSecondaryActions ( ) {
37
36
return isArray ( this . secondaryActions ) ;
38
37
}
39
-
40
- @action
41
- fireAction ( act ) {
42
- invokeAction ( act , 'onAction' ) ;
43
- }
44
38
}
Original file line number Diff line number Diff line change 1
1
import Component from '@ember/component' ;
2
- import { action } from '@ember/object' ;
3
2
import { or } from '@ember/object/computed' ;
4
3
import { deprecate } from '@ember/application/deprecations' ;
5
4
import { tagName , layout as templateLayout } from '@ember-decorators/component' ;
6
- import { invokeAction } from 'ember-invoke-action' ;
7
5
import layout from '../templates/components/polaris-setting-toggle' ;
8
6
9
7
/**
@@ -58,9 +56,4 @@ export default class PolarisSettingToggle extends Component {
58
56
}
59
57
) ;
60
58
}
61
-
62
- @action
63
- fireAction ( primaryAction ) {
64
- invokeAction ( primaryAction , 'onAction' ) ;
65
- }
66
59
}
Original file line number Diff line number Diff line change 26
26
@active ={{ item.active }}
27
27
@role ={{ @actionRole }}
28
28
@badge ={{ item.badge }}
29
- @onAction ={{ fn this.onItemAction item }}
29
+ @onAction ={{ fn this.handleAction item }}
30
30
/>
31
31
{{ /each }}
32
32
</ul >
Original file line number Diff line number Diff line change 12
12
@loading ={{ secondaryAction.loading }}
13
13
@destructive ={{ secondaryAction.destructive }}
14
14
@icon ={{ secondaryAction.icon }}
15
- @onClick ={{ fn this.fireAction secondaryAction }}
15
+ @onClick ={{ secondaryAction.onAction }}
16
16
/>
17
17
{{ /each }}
18
18
</PolarisButtonGroup >
24
24
@disabled ={{ @primaryAction.disabled }}
25
25
@loading ={{ @primaryAction.loading }}
26
26
@text ={{ @primaryAction.text }}
27
- @onClick ={{ fn this.fireAction @primaryAction }}
27
+ @onClick ={{ @primaryAction.onAction }}
28
28
/>
29
29
{{ /if }}
30
30
</PolarisStack >
Original file line number Diff line number Diff line change 15
15
@disabled ={{ this.mainAction.disabled }}
16
16
@loading ={{ this.mainAction.loading }}
17
17
@primary ={{ @enabled }}
18
- @onClick ={{ fn this.fireAction this. mainAction}}
18
+ @onClick ={{ this.mainAction.onAction }}
19
19
/>
20
20
{{ /if }}
21
21
</div >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 65
65
"ember-decorators" : " ^6.1.1" ,
66
66
"ember-element-helper" : " ^0.3.1" ,
67
67
"ember-event-helpers" : " ^0.1.0" ,
68
- "ember-invoke-action" : " ^1.5.1" ,
69
68
"ember-keyboard" : " ^6.0.1" ,
70
69
"ember-lifeline" : " ^4.1.5" ,
71
70
"ember-render-detector" : " ^1.0.0" ,
Original file line number Diff line number Diff line change 6644
6644
resolved "https://registry.yarnpkg.com/ember-export-application-global/-/ember-export-application-global-2.0.1.tgz#b120a70e322ab208defc9e2daebe8d0dfc2dcd46"
6645
6645
integrity sha512-B7wiurPgsxsSGzJuPFkpBWnaeuCu2PGpG2BjyrfA1VcL7//o+5RSnZqiCEY326y7qmxb2GoCgo0ft03KBU0rRw==
6646
6646
6647
- ember-invoke-action@^1.5.1:
6648
- version "1.5.1"
6649
- resolved "https://registry.yarnpkg.com/ember-invoke-action/-/ember-invoke-action-1.5.1.tgz#b6cad51ee729fc227cdbdba83b2b5486f0fa5834"
6650
- integrity sha512-co6Yg9r5qtK4LvZTZHk+u02YLPbnM2c5ZkXvundxEj3V7qdZg7RULfjU09LmohD+rxW5ADZlwgBi/32XIEWTlw==
6651
- dependencies:
6652
- ember-cli-babel "^6.6.0"
6653
-
6654
6647
ember-keyboard@^6.0.1:
6655
6648
version "6.0.1"
6656
6649
resolved "https://registry.yarnpkg.com/ember-keyboard/-/ember-keyboard-6.0.1.tgz#2e806c92f36ec9a8a85064ca246e23eb11245dae"
You can’t perform that action at this time.
0 commit comments