PluginProbe
Elementor Website Builder – more than just a page builder / 3.8.0-beta1
Elementor Website Builder – more than just a page builder v3.8.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 All 457 releases
elementor / app / assets / js / ui / dialog / dialog.js

dialog.js in Elementor Website Builder – more than just a page builder 3.8.0-beta1, at app/assets/js/ui/dialog/dialog.js

70 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import DialogWrapper from './dialog-wrapper';
2 import DialogContent from './dialog-content';
3 import DialogTitle from './dialog-title';
4 import DialogText from './dialog-text';
5 import DialogActions from './dialog-actions';
6 import DialogButton from './dialog-button';
7
8 import './dialog.scss';
9
10 export default function Dialog( props ) {
11 return (
12 <DialogWrapper onSubmit={ props.onSubmit } onClose={ props.onClose }>
13 <DialogContent>
14 { props.title && <DialogTitle>{ props.title }</DialogTitle> }
15 { props.text && <DialogText>{ props.text }</DialogText> }
16 { props.children }
17 </DialogContent>
18 <DialogActions>
19 <DialogButton
20 key="dismiss"
21 text={ props.dismissButtonText }
22 onClick={ props.dismissButtonOnClick }
23 url={ props.dismissButtonUrl }
24 target={ props.dismissButtonTarget }
25 // eslint-disable-next-line jsx-a11y/tabindex-no-positive
26 tabIndex="2"
27 />
28 <DialogButton
29 key="approve"
30 text={ props.approveButtonText }
31 onClick={ props.approveButtonOnClick }
32 url={ props.approveButtonUrl }
33 target={ props.approveButtonTarget }
34 color={ props.approveButtonColor }
35 elRef={ props.approveButtonRef }
36 // eslint-disable-next-line jsx-a11y/tabindex-no-positive
37 tabIndex="1"
38 />
39 </DialogActions>
40 </DialogWrapper>
41 );
42 }
43
44 Dialog.propTypes = {
45 title: PropTypes.any,
46 text: PropTypes.any,
47 children: PropTypes.any,
48 onSubmit: PropTypes.func,
49 onClose: PropTypes.func,
50 dismissButtonText: PropTypes.string.isRequired,
51 dismissButtonOnClick: PropTypes.func,
52 dismissButtonUrl: PropTypes.string,
53 dismissButtonTarget: PropTypes.string,
54 approveButtonText: PropTypes.string.isRequired,
55 approveButtonOnClick: PropTypes.func,
56 approveButtonUrl: PropTypes.string,
57 approveButtonColor: PropTypes.string,
58 approveButtonTarget: PropTypes.string,
59 approveButtonRef: PropTypes.object,
60 };
61
62 Dialog.defaultProps = {};
63
64 Dialog.Wrapper = DialogWrapper;
65 Dialog.Content = DialogContent;
66 Dialog.Title = DialogTitle;
67 Dialog.Text = DialogText;
68 Dialog.Actions = DialogActions;
69 Dialog.Button = DialogButton;
70