1
- import 'package:js/js.dart' ;
2
- import 'package:js/js_util.dart' ;
1
+ import 'dart:js_interop' ;
3
2
4
3
import '../../../models/screenset_event.dart' ;
5
4
import '../models/profile.dart' ;
6
5
7
- /// This typedef defines the function signature for the handler of the screenset before submit event.
8
- ///
9
- /// This function should return false if submission should be cancelled.
10
- typedef BeforeSubmitEventHandler = bool Function (ScreensetEvent event);
11
-
12
- /// The static interop class for the before submit event of the `Account.showScreenset` event stream.
6
+ /// The extension type for the before submit event of the `Account.showScreenset` event stream.
13
7
///
14
8
/// See: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/413a5b7170b21014bbc5a10ce4041860.html?locale=en-US#onbeforesubmit-event-data
15
9
@JS ()
16
10
@anonymous
17
11
@staticInterop
18
- class BeforeSubmitEvent {}
19
-
20
- /// This extension defines the static interop definition
21
- /// for the [BeforeSubmitEvent] class.
22
- extension BeforeSubmitEventExtension on BeforeSubmitEvent {
12
+ extension type BeforeSubmitEvent (JSObject _) {
23
13
/// The name of the event.
24
14
external String get eventName;
25
15
26
16
/// The ID of the form.
27
17
external String get form;
28
18
29
19
/// An object containing a copy of the form data that is about to be sent.
30
- external Object ? get formData;
20
+ external JSAny ? get formData;
31
21
32
22
/// The ID of the screen that is about to be loaded.
33
23
external String ? get nextScreen;
@@ -49,7 +39,7 @@ extension BeforeSubmitEventExtension on BeforeSubmitEvent {
49
39
eventName,
50
40
< String , dynamic > {
51
41
'form' : form,
52
- 'formData' : dartify (formData ),
42
+ 'formData' : formData. dartify (),
53
43
'nextScreen' : nextScreen,
54
44
'profile' : profile? .toMap (),
55
45
'screen' : screen,
0 commit comments