no-frills-ui 0.0.14-alpha.4 → 0.0.14-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2841 -2786
- package/dist/index.js.map +1 -1
- package/lib-esm/components/Accordion/Accordion.d.ts +0 -1
- package/lib-esm/components/Accordion/Accordion.js +26 -26
- package/lib-esm/components/Accordion/AccordionStep.d.ts +0 -1
- package/lib-esm/components/Accordion/AccordionStep.js +98 -114
- package/lib-esm/components/Accordion/index.d.ts +0 -1
- package/lib-esm/components/Badge/Badge.d.ts +0 -1
- package/lib-esm/components/Badge/Badge.js +37 -43
- package/lib-esm/components/Badge/index.d.ts +0 -1
- package/lib-esm/components/Button/ActionButton.d.ts +0 -1
- package/lib-esm/components/Button/ActionButton.js +6 -38
- package/lib-esm/components/Button/Button.d.ts +0 -1
- package/lib-esm/components/Button/Button.js +8 -43
- package/lib-esm/components/Button/IconButton.d.ts +0 -1
- package/lib-esm/components/Button/IconButton.js +6 -42
- package/lib-esm/components/Button/LinkButton.d.ts +0 -1
- package/lib-esm/components/Button/LinkButton.js +6 -33
- package/lib-esm/components/Button/RaisedButton.d.ts +0 -1
- package/lib-esm/components/Button/RaisedButton.js +6 -46
- package/lib-esm/components/Button/index.d.ts +0 -1
- package/lib-esm/components/Card/Card.d.ts +0 -1
- package/lib-esm/components/Card/Card.js +8 -13
- package/lib-esm/components/Card/index.d.ts +0 -1
- package/lib-esm/components/Chip/Chip.d.ts +0 -1
- package/lib-esm/components/Chip/Chip.js +35 -43
- package/lib-esm/components/Chip/index.d.ts +0 -1
- package/lib-esm/components/ChipInput/ChipInput.d.ts +0 -1
- package/lib-esm/components/ChipInput/ChipInput.js +107 -167
- package/lib-esm/components/ChipInput/index.d.ts +0 -1
- package/lib-esm/components/Dialog/AlertDialog.d.ts +0 -1
- package/lib-esm/components/Dialog/AlertDialog.js +47 -25
- package/lib-esm/components/Dialog/ConfirmDialog.d.ts +0 -1
- package/lib-esm/components/Dialog/ConfirmDialog.js +49 -31
- package/lib-esm/components/Dialog/Dialog.d.ts +27 -2
- package/lib-esm/components/Dialog/Dialog.js +120 -67
- package/lib-esm/components/Dialog/PromptDialog.d.ts +0 -1
- package/lib-esm/components/Dialog/PromptDialog.js +82 -44
- package/lib-esm/components/Dialog/index.d.ts +0 -1
- package/lib-esm/components/DragAndDrop/DragAndDrop.d.ts +0 -1
- package/lib-esm/components/DragAndDrop/DragAndDrop.js +66 -71
- package/lib-esm/components/DragAndDrop/DragItem.d.ts +0 -1
- package/lib-esm/components/DragAndDrop/DragItem.js +106 -118
- package/lib-esm/components/DragAndDrop/index.d.ts +0 -1
- package/lib-esm/components/DragAndDrop/types.d.ts +0 -1
- package/lib-esm/components/DragAndDrop/types.js +7 -5
- package/lib-esm/components/Drawer/Drawer.d.ts +76 -2
- package/lib-esm/components/Drawer/Drawer.js +176 -96
- package/lib-esm/components/Drawer/index.d.ts +0 -1
- package/lib-esm/components/Groups/Group.d.ts +0 -1
- package/lib-esm/components/Groups/Group.js +32 -88
- package/lib-esm/components/Groups/GroupLabel.d.ts +0 -1
- package/lib-esm/components/Groups/GroupLabel.js +7 -17
- package/lib-esm/components/Groups/index.d.ts +0 -1
- package/lib-esm/components/Input/Checkbox.d.ts +0 -1
- package/lib-esm/components/Input/Checkbox.js +39 -110
- package/lib-esm/components/Input/Dropdown.d.ts +8 -1
- package/lib-esm/components/Input/Dropdown.js +109 -49
- package/lib-esm/components/Input/Input.d.ts +0 -1
- package/lib-esm/components/Input/Input.js +61 -113
- package/lib-esm/components/Input/Radio.d.ts +0 -1
- package/lib-esm/components/Input/Radio.js +31 -76
- package/lib-esm/components/Input/RadioButton.d.ts +0 -1
- package/lib-esm/components/Input/RadioButton.js +30 -67
- package/lib-esm/components/Input/Select.d.ts +0 -1
- package/lib-esm/components/Input/Select.js +74 -126
- package/lib-esm/components/Input/TextArea.d.ts +0 -1
- package/lib-esm/components/Input/TextArea.js +60 -111
- package/lib-esm/components/Input/Toggle.d.ts +0 -1
- package/lib-esm/components/Input/Toggle.js +29 -77
- package/lib-esm/components/Input/index.d.ts +0 -1
- package/lib-esm/components/Menu/Menu.d.ts +13 -2
- package/lib-esm/components/Menu/Menu.js +107 -27
- package/lib-esm/components/Menu/MenuContext.d.ts +0 -1
- package/lib-esm/components/Menu/MenuContext.js +4 -2
- package/lib-esm/components/Menu/MenuItem.d.ts +6 -4
- package/lib-esm/components/Menu/MenuItem.js +36 -51
- package/lib-esm/components/Menu/index.d.ts +0 -1
- package/lib-esm/components/Modal/Modal.d.ts +70 -2
- package/lib-esm/components/Modal/Modal.js +149 -52
- package/lib-esm/components/Modal/index.d.ts +0 -1
- package/lib-esm/components/Notification/Notification.d.ts +3 -2
- package/lib-esm/components/Notification/Notification.js +54 -64
- package/lib-esm/components/Notification/NotificationManager.d.ts +15 -2
- package/lib-esm/components/Notification/NotificationManager.js +169 -77
- package/lib-esm/components/Notification/index.d.ts +0 -1
- package/lib-esm/components/Notification/style.d.ts +4 -1
- package/lib-esm/components/Notification/style.js +63 -142
- package/lib-esm/components/Notification/types.d.ts +2 -1
- package/lib-esm/components/Notification/types.js +8 -9
- package/lib-esm/components/Popover/Popover.d.ts +0 -1
- package/lib-esm/components/Popover/Popover.js +146 -111
- package/lib-esm/components/Popover/index.d.ts +0 -1
- package/lib-esm/components/Spinner/Spinner.d.ts +3 -1
- package/lib-esm/components/Spinner/Spinner.js +19 -24
- package/lib-esm/components/Spinner/index.d.ts +0 -1
- package/lib-esm/components/Stepper/Step.d.ts +0 -1
- package/lib-esm/components/Stepper/Step.js +15 -22
- package/lib-esm/components/Stepper/Stepper.d.ts +0 -1
- package/lib-esm/components/Stepper/Stepper.js +100 -102
- package/lib-esm/components/Stepper/index.d.ts +0 -1
- package/lib-esm/components/Tabs/Tab.d.ts +0 -1
- package/lib-esm/components/Tabs/Tab.js +11 -10
- package/lib-esm/components/Tabs/Tabs.d.ts +0 -1
- package/lib-esm/components/Tabs/Tabs.js +88 -50
- package/lib-esm/components/Tabs/index.d.ts +0 -1
- package/lib-esm/components/Toast/Toast.d.ts +30 -5
- package/lib-esm/components/Toast/Toast.js +196 -108
- package/lib-esm/components/Toast/ToastStory.d.ts +0 -1
- package/lib-esm/components/Toast/index.d.ts +0 -1
- package/lib-esm/components/Tooltip/Tooltip.d.ts +0 -1
- package/lib-esm/components/Tooltip/Tooltip.js +60 -61
- package/lib-esm/components/Tooltip/index.d.ts +0 -1
- package/lib-esm/components/index.d.ts +0 -1
- package/lib-esm/components/index.js +42 -21
- package/lib-esm/icons/CheckCircle.d.ts +0 -1
- package/lib-esm/icons/CheckCircle.js +21 -4
- package/lib-esm/icons/Close.d.ts +0 -1
- package/lib-esm/icons/Close.js +21 -4
- package/lib-esm/icons/DragIndicator.d.ts +0 -1
- package/lib-esm/icons/DragIndicator.js +21 -4
- package/lib-esm/icons/ErrorOutline.d.ts +0 -1
- package/lib-esm/icons/ErrorOutline.js +15 -4
- package/lib-esm/icons/ExpandMore.d.ts +0 -1
- package/lib-esm/icons/ExpandMore.js +21 -4
- package/lib-esm/icons/FiberManualRecord.d.ts +0 -1
- package/lib-esm/icons/FiberManualRecord.js +23 -4
- package/lib-esm/icons/Info.d.ts +0 -1
- package/lib-esm/icons/Info.js +21 -4
- package/lib-esm/icons/ReportProblem.d.ts +0 -1
- package/lib-esm/icons/ReportProblem.js +21 -4
- package/lib-esm/icons/index.d.ts +0 -1
- package/lib-esm/index.d.ts +0 -1
- package/lib-esm/shared/LayerManager.d.ts +3 -1
- package/lib-esm/shared/LayerManager.js +158 -87
- package/lib-esm/shared/constants.d.ts +58 -28
- package/lib-esm/shared/constants.js +61 -26
- package/lib-esm/shared/styles.d.ts +1 -2
- package/lib-esm/shared/styles.js +20 -24
- package/package.json +15 -5
- package/lib-esm/components/Accordion/Accordion.d.ts.map +0 -1
- package/lib-esm/components/Accordion/Accordion.js.map +0 -1
- package/lib-esm/components/Accordion/AccordionStep.d.ts.map +0 -1
- package/lib-esm/components/Accordion/AccordionStep.js.map +0 -1
- package/lib-esm/components/Accordion/index.d.ts.map +0 -1
- package/lib-esm/components/Accordion/index.js +0 -3
- package/lib-esm/components/Accordion/index.js.map +0 -1
- package/lib-esm/components/Badge/Badge.d.ts.map +0 -1
- package/lib-esm/components/Badge/Badge.js.map +0 -1
- package/lib-esm/components/Badge/index.d.ts.map +0 -1
- package/lib-esm/components/Badge/index.js +0 -2
- package/lib-esm/components/Badge/index.js.map +0 -1
- package/lib-esm/components/Button/ActionButton.d.ts.map +0 -1
- package/lib-esm/components/Button/ActionButton.js.map +0 -1
- package/lib-esm/components/Button/Button.d.ts.map +0 -1
- package/lib-esm/components/Button/Button.js.map +0 -1
- package/lib-esm/components/Button/IconButton.d.ts.map +0 -1
- package/lib-esm/components/Button/IconButton.js.map +0 -1
- package/lib-esm/components/Button/LinkButton.d.ts.map +0 -1
- package/lib-esm/components/Button/LinkButton.js.map +0 -1
- package/lib-esm/components/Button/RaisedButton.d.ts.map +0 -1
- package/lib-esm/components/Button/RaisedButton.js.map +0 -1
- package/lib-esm/components/Button/index.d.ts.map +0 -1
- package/lib-esm/components/Button/index.js +0 -6
- package/lib-esm/components/Button/index.js.map +0 -1
- package/lib-esm/components/Card/Card.d.ts.map +0 -1
- package/lib-esm/components/Card/Card.js.map +0 -1
- package/lib-esm/components/Card/index.d.ts.map +0 -1
- package/lib-esm/components/Card/index.js +0 -3
- package/lib-esm/components/Card/index.js.map +0 -1
- package/lib-esm/components/Chip/Chip.d.ts.map +0 -1
- package/lib-esm/components/Chip/Chip.js.map +0 -1
- package/lib-esm/components/Chip/index.d.ts.map +0 -1
- package/lib-esm/components/Chip/index.js +0 -2
- package/lib-esm/components/Chip/index.js.map +0 -1
- package/lib-esm/components/ChipInput/ChipInput.d.ts.map +0 -1
- package/lib-esm/components/ChipInput/ChipInput.js.map +0 -1
- package/lib-esm/components/ChipInput/index.d.ts.map +0 -1
- package/lib-esm/components/ChipInput/index.js +0 -2
- package/lib-esm/components/ChipInput/index.js.map +0 -1
- package/lib-esm/components/Dialog/AlertDialog.d.ts.map +0 -1
- package/lib-esm/components/Dialog/AlertDialog.js.map +0 -1
- package/lib-esm/components/Dialog/ConfirmDialog.d.ts.map +0 -1
- package/lib-esm/components/Dialog/ConfirmDialog.js.map +0 -1
- package/lib-esm/components/Dialog/Dialog.d.ts.map +0 -1
- package/lib-esm/components/Dialog/Dialog.js.map +0 -1
- package/lib-esm/components/Dialog/PromptDialog.d.ts.map +0 -1
- package/lib-esm/components/Dialog/PromptDialog.js.map +0 -1
- package/lib-esm/components/Dialog/index.d.ts.map +0 -1
- package/lib-esm/components/Dialog/index.js +0 -5
- package/lib-esm/components/Dialog/index.js.map +0 -1
- package/lib-esm/components/DragAndDrop/DragAndDrop.d.ts.map +0 -1
- package/lib-esm/components/DragAndDrop/DragAndDrop.js.map +0 -1
- package/lib-esm/components/DragAndDrop/DragItem.d.ts.map +0 -1
- package/lib-esm/components/DragAndDrop/DragItem.js.map +0 -1
- package/lib-esm/components/DragAndDrop/index.d.ts.map +0 -1
- package/lib-esm/components/DragAndDrop/index.js +0 -3
- package/lib-esm/components/DragAndDrop/index.js.map +0 -1
- package/lib-esm/components/DragAndDrop/types.d.ts.map +0 -1
- package/lib-esm/components/DragAndDrop/types.js.map +0 -1
- package/lib-esm/components/Drawer/Drawer.d.ts.map +0 -1
- package/lib-esm/components/Drawer/Drawer.js.map +0 -1
- package/lib-esm/components/Drawer/index.d.ts.map +0 -1
- package/lib-esm/components/Drawer/index.js +0 -2
- package/lib-esm/components/Drawer/index.js.map +0 -1
- package/lib-esm/components/Groups/Group.d.ts.map +0 -1
- package/lib-esm/components/Groups/Group.js.map +0 -1
- package/lib-esm/components/Groups/GroupLabel.d.ts.map +0 -1
- package/lib-esm/components/Groups/GroupLabel.js.map +0 -1
- package/lib-esm/components/Groups/index.d.ts.map +0 -1
- package/lib-esm/components/Groups/index.js +0 -3
- package/lib-esm/components/Groups/index.js.map +0 -1
- package/lib-esm/components/Input/Checkbox.d.ts.map +0 -1
- package/lib-esm/components/Input/Checkbox.js.map +0 -1
- package/lib-esm/components/Input/Dropdown.d.ts.map +0 -1
- package/lib-esm/components/Input/Dropdown.js.map +0 -1
- package/lib-esm/components/Input/Input.d.ts.map +0 -1
- package/lib-esm/components/Input/Input.js.map +0 -1
- package/lib-esm/components/Input/Radio.d.ts.map +0 -1
- package/lib-esm/components/Input/Radio.js.map +0 -1
- package/lib-esm/components/Input/RadioButton.d.ts.map +0 -1
- package/lib-esm/components/Input/RadioButton.js.map +0 -1
- package/lib-esm/components/Input/Select.d.ts.map +0 -1
- package/lib-esm/components/Input/Select.js.map +0 -1
- package/lib-esm/components/Input/TextArea.d.ts.map +0 -1
- package/lib-esm/components/Input/TextArea.js.map +0 -1
- package/lib-esm/components/Input/Toggle.d.ts.map +0 -1
- package/lib-esm/components/Input/Toggle.js.map +0 -1
- package/lib-esm/components/Input/index.d.ts.map +0 -1
- package/lib-esm/components/Input/index.js +0 -9
- package/lib-esm/components/Input/index.js.map +0 -1
- package/lib-esm/components/Menu/Menu.d.ts.map +0 -1
- package/lib-esm/components/Menu/Menu.js.map +0 -1
- package/lib-esm/components/Menu/MenuContext.d.ts.map +0 -1
- package/lib-esm/components/Menu/MenuContext.js.map +0 -1
- package/lib-esm/components/Menu/MenuItem.d.ts.map +0 -1
- package/lib-esm/components/Menu/MenuItem.js.map +0 -1
- package/lib-esm/components/Menu/index.d.ts.map +0 -1
- package/lib-esm/components/Menu/index.js +0 -3
- package/lib-esm/components/Menu/index.js.map +0 -1
- package/lib-esm/components/Modal/Modal.d.ts.map +0 -1
- package/lib-esm/components/Modal/Modal.js.map +0 -1
- package/lib-esm/components/Modal/index.d.ts.map +0 -1
- package/lib-esm/components/Modal/index.js +0 -2
- package/lib-esm/components/Modal/index.js.map +0 -1
- package/lib-esm/components/Notification/Notification.d.ts.map +0 -1
- package/lib-esm/components/Notification/Notification.js.map +0 -1
- package/lib-esm/components/Notification/NotificationManager.d.ts.map +0 -1
- package/lib-esm/components/Notification/NotificationManager.js.map +0 -1
- package/lib-esm/components/Notification/index.d.ts.map +0 -1
- package/lib-esm/components/Notification/index.js +0 -3
- package/lib-esm/components/Notification/index.js.map +0 -1
- package/lib-esm/components/Notification/style.d.ts.map +0 -1
- package/lib-esm/components/Notification/style.js.map +0 -1
- package/lib-esm/components/Notification/types.d.ts.map +0 -1
- package/lib-esm/components/Notification/types.js.map +0 -1
- package/lib-esm/components/Popover/Popover.d.ts.map +0 -1
- package/lib-esm/components/Popover/Popover.js.map +0 -1
- package/lib-esm/components/Popover/index.d.ts.map +0 -1
- package/lib-esm/components/Popover/index.js +0 -2
- package/lib-esm/components/Popover/index.js.map +0 -1
- package/lib-esm/components/Spinner/Spinner.d.ts.map +0 -1
- package/lib-esm/components/Spinner/Spinner.js.map +0 -1
- package/lib-esm/components/Spinner/index.d.ts.map +0 -1
- package/lib-esm/components/Spinner/index.js +0 -2
- package/lib-esm/components/Spinner/index.js.map +0 -1
- package/lib-esm/components/Stepper/Step.d.ts.map +0 -1
- package/lib-esm/components/Stepper/Step.js.map +0 -1
- package/lib-esm/components/Stepper/Stepper.d.ts.map +0 -1
- package/lib-esm/components/Stepper/Stepper.js.map +0 -1
- package/lib-esm/components/Stepper/index.d.ts.map +0 -1
- package/lib-esm/components/Stepper/index.js +0 -4
- package/lib-esm/components/Stepper/index.js.map +0 -1
- package/lib-esm/components/Tabs/Tab.d.ts.map +0 -1
- package/lib-esm/components/Tabs/Tab.js.map +0 -1
- package/lib-esm/components/Tabs/Tabs.d.ts.map +0 -1
- package/lib-esm/components/Tabs/Tabs.js.map +0 -1
- package/lib-esm/components/Tabs/index.d.ts.map +0 -1
- package/lib-esm/components/Tabs/index.js +0 -3
- package/lib-esm/components/Tabs/index.js.map +0 -1
- package/lib-esm/components/Toast/Toast.d.ts.map +0 -1
- package/lib-esm/components/Toast/Toast.js.map +0 -1
- package/lib-esm/components/Toast/ToastStory.d.ts.map +0 -1
- package/lib-esm/components/Toast/ToastStory.js +0 -35
- package/lib-esm/components/Toast/ToastStory.js.map +0 -1
- package/lib-esm/components/Toast/index.d.ts.map +0 -1
- package/lib-esm/components/Toast/index.js +0 -2
- package/lib-esm/components/Toast/index.js.map +0 -1
- package/lib-esm/components/Tooltip/Tooltip.d.ts.map +0 -1
- package/lib-esm/components/Tooltip/Tooltip.js.map +0 -1
- package/lib-esm/components/Tooltip/index.d.ts.map +0 -1
- package/lib-esm/components/Tooltip/index.js +0 -2
- package/lib-esm/components/Tooltip/index.js.map +0 -1
- package/lib-esm/components/index.d.ts.map +0 -1
- package/lib-esm/components/index.js.map +0 -1
- package/lib-esm/icons/CheckCircle.d.ts.map +0 -1
- package/lib-esm/icons/CheckCircle.js.map +0 -1
- package/lib-esm/icons/Close.d.ts.map +0 -1
- package/lib-esm/icons/Close.js.map +0 -1
- package/lib-esm/icons/DragIndicator.d.ts.map +0 -1
- package/lib-esm/icons/DragIndicator.js.map +0 -1
- package/lib-esm/icons/ErrorOutline.d.ts.map +0 -1
- package/lib-esm/icons/ErrorOutline.js.map +0 -1
- package/lib-esm/icons/ExpandMore.d.ts.map +0 -1
- package/lib-esm/icons/ExpandMore.js.map +0 -1
- package/lib-esm/icons/FiberManualRecord.d.ts.map +0 -1
- package/lib-esm/icons/FiberManualRecord.js.map +0 -1
- package/lib-esm/icons/Info.d.ts.map +0 -1
- package/lib-esm/icons/Info.js.map +0 -1
- package/lib-esm/icons/ReportProblem.d.ts.map +0 -1
- package/lib-esm/icons/ReportProblem.js.map +0 -1
- package/lib-esm/icons/index.d.ts.map +0 -1
- package/lib-esm/icons/index.js +0 -9
- package/lib-esm/icons/index.js.map +0 -1
- package/lib-esm/index.d.ts.map +0 -1
- package/lib-esm/index.js +0 -2
- package/lib-esm/index.js.map +0 -1
- package/lib-esm/shared/LayerManager.d.ts.map +0 -1
- package/lib-esm/shared/LayerManager.js.map +0 -1
- package/lib-esm/shared/constants.d.ts.map +0 -1
- package/lib-esm/shared/constants.js.map +0 -1
- package/lib-esm/shared/styles.d.ts.map +0 -1
- package/lib-esm/shared/styles.js.map +0 -1
|
@@ -1,48 +1,66 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import React, { createRef } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import Dialog from './Dialog.js';
|
|
5
|
+
import { Header, Body, Footer } from '../../shared/styles.js';
|
|
6
|
+
import StyledButton from '../Button/Button.js';
|
|
7
|
+
import ActionButton from '../Button/ActionButton.js';
|
|
8
|
+
|
|
6
9
|
class ConfirmDialog extends React.Component {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
render() {
|
|
11
|
+
const { header, body, yesText, noText, dialogProps } = this.props;
|
|
12
|
+
return /*#__PURE__*/ jsxs(Dialog, {
|
|
13
|
+
...dialogProps,
|
|
14
|
+
ref: this.dialog,
|
|
15
|
+
closeOnEsc: false,
|
|
16
|
+
closeOnOverlayClick: false,
|
|
17
|
+
children: [
|
|
18
|
+
header && /*#__PURE__*/ jsx(Header, {
|
|
19
|
+
children: header
|
|
20
|
+
}),
|
|
21
|
+
/*#__PURE__*/ jsx(Body, {
|
|
22
|
+
children: body
|
|
23
|
+
}),
|
|
24
|
+
/*#__PURE__*/ jsxs(Footer, {
|
|
25
|
+
children: [
|
|
26
|
+
/*#__PURE__*/ jsx(StyledButton, {
|
|
27
|
+
onClick: this.cancel,
|
|
28
|
+
children: noText
|
|
29
|
+
}),
|
|
30
|
+
/*#__PURE__*/ jsx(ActionButton, {
|
|
31
|
+
onClick: this.confirm,
|
|
32
|
+
children: yesText
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
constructor(...args){
|
|
40
|
+
super(...args), this.dialog = /*#__PURE__*/ createRef(), this.show = ()=>{
|
|
41
|
+
return new Promise((resolve, reject)=>{
|
|
42
|
+
const onClose = (resp)=>{
|
|
13
43
|
if (resp) {
|
|
14
44
|
resolve(null);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
45
|
+
} else {
|
|
17
46
|
reject();
|
|
18
47
|
}
|
|
19
48
|
};
|
|
20
49
|
this.dialog.current.open(onClose);
|
|
21
50
|
});
|
|
22
|
-
};
|
|
23
|
-
this.cancel = () => this.dialog.current.close(false);
|
|
24
|
-
this.confirm = () => this.dialog.current.close(true);
|
|
25
|
-
}
|
|
26
|
-
render() {
|
|
27
|
-
const { header, body, yesText, noText, dialogProps } = this.props;
|
|
28
|
-
return (_jsxs(Dialog, Object.assign({}, dialogProps, { ref: this.dialog, closeOnEsc: false, closeOnOverlayClick: false, children: [header && _jsx(DialogHeader, { children: header }), _jsx(DialogBody, { children: body }), _jsxs(DialogFooter, { children: [_jsx(Button, { onClick: this.cancel, children: noText }), _jsx(ActionButton, { onClick: this.confirm, children: yesText })] })] })));
|
|
51
|
+
}, this.cancel = ()=>this.dialog.current.close(false), this.confirm = ()=>this.dialog.current.close(true);
|
|
29
52
|
}
|
|
30
53
|
}
|
|
31
54
|
ConfirmDialog.propTypes = {
|
|
32
|
-
/** Shown as header of the dialog */
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
yesText: PropTypes.string,
|
|
38
|
-
/** Reject button text */
|
|
39
|
-
noText: PropTypes.string,
|
|
40
|
-
/** Props for the dialog */
|
|
41
|
-
dialogProps: PropTypes.object,
|
|
55
|
+
/** Shown as header of the dialog */ header: PropTypes.string,
|
|
56
|
+
/** Rendered as body of the dialog */ body: PropTypes.string.isRequired,
|
|
57
|
+
/** Accept button text */ yesText: PropTypes.string,
|
|
58
|
+
/** Reject button text */ noText: PropTypes.string,
|
|
59
|
+
/** Props for the dialog */ dialogProps: PropTypes.object
|
|
42
60
|
};
|
|
43
61
|
ConfirmDialog.defaultProps = {
|
|
44
62
|
yesText: 'Yes',
|
|
45
|
-
noText: 'No'
|
|
63
|
+
noText: 'No'
|
|
46
64
|
};
|
|
47
|
-
|
|
48
|
-
|
|
65
|
+
|
|
66
|
+
export { ConfirmDialog as default };
|
|
@@ -17,7 +17,7 @@ interface DialogState {
|
|
|
17
17
|
show: boolean;
|
|
18
18
|
LayerComponent?: () => React.ReactPortal | null;
|
|
19
19
|
}
|
|
20
|
-
declare class Dialog extends React.Component<React.PropsWithChildren<DialogOptions>, DialogState> {
|
|
20
|
+
declare class Dialog extends React.Component<React.PropsWithChildren<DialogOptions> & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'ref'>, DialogState> {
|
|
21
21
|
static propTypes: {
|
|
22
22
|
/** Flag to close dialog on `esc` click. Default value is true. */
|
|
23
23
|
closeOnEsc: PropTypes.Requireable<boolean>;
|
|
@@ -30,12 +30,37 @@ declare class Dialog extends React.Component<React.PropsWithChildren<DialogOptio
|
|
|
30
30
|
};
|
|
31
31
|
private closeDialog;
|
|
32
32
|
private onCloseFn;
|
|
33
|
+
private lastFocusedElement;
|
|
34
|
+
private dialogRef;
|
|
33
35
|
state: DialogState;
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves all focusable elements within the dialog.
|
|
38
|
+
*/
|
|
39
|
+
private getFocusableElements;
|
|
40
|
+
/**
|
|
41
|
+
* Handles keydown events to implement the focus trap.
|
|
42
|
+
* Traps Tab and Shift+Tab within the dialog.
|
|
43
|
+
*/
|
|
44
|
+
private handleKeyDown;
|
|
45
|
+
/**
|
|
46
|
+
* Restores focus to the element that was focused before the dialog opened.
|
|
47
|
+
*/
|
|
48
|
+
private restoreFocus;
|
|
49
|
+
/**
|
|
50
|
+
* Callback ref to capture the Dialog DOM element.
|
|
51
|
+
* Triggers initial focus setting when the element mounts.
|
|
52
|
+
*/
|
|
53
|
+
private setDialogRef;
|
|
54
|
+
/**
|
|
55
|
+
* Sets initial focus within the dialog.
|
|
56
|
+
* Tries to focus the header first, then the first interactive element, or falls back to the container.
|
|
57
|
+
*/
|
|
58
|
+
private setInitialFocus;
|
|
34
59
|
shouldComponentUpdate(nextProps: DialogOptions, nextState: DialogState): boolean;
|
|
60
|
+
componentWillUnmount(): void;
|
|
35
61
|
open: (closeCallback?: (resp: unknown) => void) => void;
|
|
36
62
|
close: (resp?: unknown) => void;
|
|
37
63
|
private closeCallback;
|
|
38
64
|
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
39
65
|
}
|
|
40
66
|
export default Dialog;
|
|
41
|
-
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -1,47 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
13
2
|
import React from 'react';
|
|
14
3
|
import PropTypes from 'prop-types';
|
|
15
4
|
import styled from '@emotion/styled';
|
|
16
|
-
import LayerManager, { LAYER_POSITION } from '../../shared/LayerManager';
|
|
17
|
-
import
|
|
18
|
-
export const DialogContainer = styled(Card) `
|
|
19
|
-
max-width: 768px;
|
|
20
|
-
max-height: 80vh;
|
|
21
|
-
transform: scale(0);
|
|
22
|
-
opacity: 0;
|
|
23
|
-
transition: all 0.3s ease;
|
|
5
|
+
import LayerManager, { LAYER_POSITION } from '../../shared/LayerManager.js';
|
|
6
|
+
import Card from '../Card/Card.js';
|
|
24
7
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
const DialogContainer = /*#__PURE__*/ styled(Card, {
|
|
9
|
+
target: "ej4fpry0",
|
|
10
|
+
label: "DialogContainer"
|
|
11
|
+
})("max-width:768px;max-height:80vh;transform:scale(0);opacity:0;transition:all 0.3s ease;.nf-layer-enter &{opacity:1;transform:scale(1);}.nf-layer-exit &{opacity:0;transform:scale(0);}", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiL2hvbWUvcnVubmVyL3dvcmsvbm8tZnJpbGxzLXVpL25vLWZyaWxscy11aS9zcmMvY29tcG9uZW50cy9EaWFsb2cvRGlhbG9nLnRzeCIsInNvdXJjZXMiOlsiL2hvbWUvcnVubmVyL3dvcmsvbm8tZnJpbGxzLXVpL25vLWZyaWxscy11aS9zcmMvY29tcG9uZW50cy9EaWFsb2cvRGlhbG9nLnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCBMYXllck1hbmFnZXIsIHsgTEFZRVJfUE9TSVRJT04gfSBmcm9tICcuLi8uLi9zaGFyZWQvTGF5ZXJNYW5hZ2VyJztcbmltcG9ydCB7IENhcmQgfSBmcm9tICcuLi9DYXJkJztcblxuZXhwb3J0IGNvbnN0IERpYWxvZ0NvbnRhaW5lciA9IHN0eWxlZChDYXJkKWBcbiAgICBtYXgtd2lkdGg6IDc2OHB4O1xuICAgIG1heC1oZWlnaHQ6IDgwdmg7XG4gICAgdHJhbnNmb3JtOiBzY2FsZSgwKTtcbiAgICBvcGFjaXR5OiAwO1xuICAgIHRyYW5zaXRpb246IGFsbCAwLjNzIGVhc2U7XG5cbiAgICAubmYtbGF5ZXItZW50ZXI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GVtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgIGxhc3RFbGVtZW50LmZvY3VzKCk7XG4gICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChkb2N1bWVudC5hY3RpdmVFbGVtZW50ID09PSBsYXN0RWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICBmaXJzdEVsZW1lbnQuZm9jdXMoKTtcbiAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG5cbiAgICAvKipcbiAgICAgKiBSZXN0b3JlcyBmb2N1cyB0byB0aGUgZWxlbWVudCB0aGF0IHdhcyBmb2N1c2VkIGJlZm9yZSB0aGUgZGlhbG9nIG9wZW5lZC5cbiAgICAgKi9cbiAgICBwcml2YXRlIHJlc3RvcmVGb2N1cyA9ICgpID0+IHtcbiAgICAgICAgaWYgKHRoaXMubGFzdEZvY3VzZWRFbGVtZW50KSB7XG4gICAgICAgICAgICBjb25zdCBlbGVtZW50VG9CZUZvY3VzZWQgPSB0aGlzLmxhc3RGb2N1c2VkRWxlbWVudDtcbiAgICAgICAgICAgIHRoaXMubGFzdEZvY3VzZWRFbGVtZW50ID0gbnVsbDtcbiAgICAgICAgICAgIHNldFRpbWVvdXQoKCkgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChkb2N1bWVudC5ib2R5LmNvbnRhaW5zKGVsZW1lbnRUb0JlRm9jdXNlZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgZWxlbWVudFRvQmVGb2N1c2VkLmZvY3VzKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSwgMTAwKTtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICAvKipcbiAgICAgKiBDYWxsYmFjayByZWYgd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CB9ID0gdGhpcy5wcm9wcztcblxuICAgICAgICAvLyBTYXZlIGN1cnJlbnQgZm9jdXNcbiAgICAgICAgdGhpcy5sYXN0Rm9jdXNlZEVsZW1lbnQgPSBkb2N1bWVudC5hY3RpdmVFbGVtZW50IGFzIEhUTUxFbGVtZW50O1xuXG4gICAgICAgIGNvbnN0IFtDb21wb25lbnQsIGNsb3NlRm5dID0gTGF5ZXJNYW5hZ2VyLnJlbmRlckxheWVyKHtcbiAgICAgICAgICAgIGV4aXREZWxheTogMzAwLFxuICAgICAgICAgICAgb3ZlcmxheTogdHJ1ZSxcbiAgICAgICAgICAgIGNsb3NlT25Fc2MsXG4gICAgICAgICAgICBjbG9zZUNhbGxiYWNrOiB0aGlzLmNsb3NlQ2FsbGJhY2ssXG4gICAgICAgICAgICBjbG9zZU9uT3ZlcmxheUNsaWNrLFxuICAgICAgICAgICAgcG9zaXRpb246IExBWUVSX1BPU0lUSU9OLkRJQUxPRyxcbiAgICAgICAgICAgIGNvbXBvbmVudDogKFxuICAgICAgICAgICAgICAgIDxEaWFsb2dDb250YWluZXJcbiAgICAgICAgICAgICAgICAgICAgey4uLnJlc3R9XG4gICAgICAgICAgICAgICAgICAgIHJlZj17dGhpcy5zZXREaWFsb2dSZWZ9XG4gICAgICAgICAgICAgICAgICAgIHJvbGU9XCJkaWFsb2dcIlxuICAgICAgICAgICAgICAgICAgICBhcmlhLW1vZGFsPVwidHJ1ZVwiXG4gICAgICAgICAgICAgICAgICAgIHRhYkluZGV4PXstMX1cbiAgICAgICAgICAgICAgICAgICAgb25LZXlEb3duPXt0aGlzLmhhbmRsZUtleURvd259XG4gICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s9eyhlKSA9PiBlLnN0b3BQcm9wYWdhdGlvbigpfVxuICAgICAgICAgICAgICAgICAgICBlbGV2YXRlZFxuICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAge2NoaWxkcmVufVxuICAgICAgICAgICAgICAgIDwvRGlhbG9nQ29udGFpbmVyPlxuICAgICAgICAgICAgKSxcbiAgICAgICAgfSk7XG5cbiAgICAgICAgdGhpcy5jbG9zZURpYWxvZyA9IGNsb3NlRm47XG5cbiAgICAgICAgdGhpcy5zZXRTdGF0ZSh7XG4gICAgICAgICAgICBzaG93OiB0cnVlLFxuICAgICAgICAgICAgTGF5ZXJDb21wb25lbnQ6IENvbXBvbmVudCxcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMub25DbG9zZUZuID0gY2xvc2VDYWxsYmFjaztcbiAgICB9O1xuXG4gICAgcHVibGljIGNsb3NlID0gKHJlc3A/OiB1bmtub3duKSA9PiB7XG4gICAgICAgIHRoaXMuY2xvc2VEaWFsb2c/LihyZXNwKTtcbiAgICB9O1xuXG4gICAgcHJpdmF0ZSBjbG9zZUNhbGxiYWNrID0gKHJlc3A/OiB1bmtub3duKSA9PiB7XG4gICAgICAgIHRoaXMucmVzdG9yZUZvY3VzKCk7XG4gICAgICAgIHRoaXMuc2V0U3RhdGUoe1xuICAgICAgICAgICAgc2hvdzogZmFsc2UsXG4gICAgICAgICAgICBMYXllckNvbXBvbmVudDogdW5kZWZpbmVkLFxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5vbkNsb3NlRm4/LihyZXNwKTtcbiAgICB9O1xuXG4gICAgcmVuZGVyKCkge1xuICAgICAgICBjb25zdCB7IExheWVyQ29tcG9uZW50IH0gPSB0aGlzLnN0YXRlO1xuXG4gICAgICAgIGlmICh0aGlzLnN0YXRlLnNob3cgJiYgTGF5ZXJDb21wb25lbnQpIHtcbiAgICAgICAgICAgIHJldHVybiA8TGF5ZXJDb21wb25lbnQgLz47XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuICAgIH1cbn1cblxuZXhwb3J0IGRlZmF1bHQgRGlhbG9nO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU0rQiJ9 */");
|
|
12
|
+
class Dialog extends React.Component {
|
|
13
|
+
shouldComponentUpdate(nextProps, nextState) {
|
|
14
|
+
return this.state.show !== nextState.show;
|
|
28
15
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
componentWillUnmount() {
|
|
17
|
+
// Clean up if component unmounts while dialog is open
|
|
18
|
+
if (this.state.show && this.closeDialog) {
|
|
19
|
+
this.closeDialog();
|
|
20
|
+
}
|
|
21
|
+
this.restoreFocus();
|
|
22
|
+
this.closeDialog = null;
|
|
23
|
+
this.onCloseFn = null;
|
|
33
24
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
render() {
|
|
26
|
+
const { LayerComponent } = this.state;
|
|
27
|
+
if (this.state.show && LayerComponent) {
|
|
28
|
+
return /*#__PURE__*/ jsx(LayerComponent, {});
|
|
29
|
+
} else {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
constructor(...args){
|
|
34
|
+
super(...args), this.lastFocusedElement = null, this.dialogRef = /*#__PURE__*/ React.createRef(), this.state = {
|
|
40
35
|
show: false,
|
|
41
|
-
LayerComponent: undefined
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
LayerComponent: undefined
|
|
37
|
+
}, /**
|
|
38
|
+
* Retrieves all focusable elements within the dialog.
|
|
39
|
+
*/ this.getFocusableElements = ()=>{
|
|
40
|
+
if (!this.dialogRef.current) return [];
|
|
41
|
+
return Array.from(this.dialogRef.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));
|
|
42
|
+
}, /**
|
|
43
|
+
* Handles keydown events to implement the focus trap.
|
|
44
|
+
* Traps Tab and Shift+Tab within the dialog.
|
|
45
|
+
*/ this.handleKeyDown = (e)=>{
|
|
46
|
+
if (e.key === 'Tab') {
|
|
47
|
+
const focusableElements = this.getFocusableElements();
|
|
48
|
+
if (focusableElements.length === 0) return;
|
|
49
|
+
const firstElement = focusableElements[0];
|
|
50
|
+
const lastElement = focusableElements[focusableElements.length - 1];
|
|
51
|
+
if (e.shiftKey) {
|
|
52
|
+
if (document.activeElement === firstElement) {
|
|
53
|
+
lastElement.focus();
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
if (document.activeElement === lastElement) {
|
|
58
|
+
firstElement.focus();
|
|
59
|
+
e.preventDefault();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, /**
|
|
64
|
+
* Restores focus to the element that was focused before the dialog opened.
|
|
65
|
+
*/ this.restoreFocus = ()=>{
|
|
66
|
+
if (this.lastFocusedElement) {
|
|
67
|
+
const elementToBeFocused = this.lastFocusedElement;
|
|
68
|
+
this.lastFocusedElement = null;
|
|
69
|
+
setTimeout(()=>{
|
|
70
|
+
if (document.body.contains(elementToBeFocused)) {
|
|
71
|
+
elementToBeFocused.focus();
|
|
72
|
+
}
|
|
73
|
+
}, 100);
|
|
74
|
+
}
|
|
75
|
+
}, /**
|
|
76
|
+
* Callback ref to capture the Dialog DOM element.
|
|
77
|
+
* Triggers initial focus setting when the element mounts.
|
|
78
|
+
*/ this.setDialogRef = (node)=>{
|
|
79
|
+
this.dialogRef.current = node;
|
|
80
|
+
if (node) {
|
|
81
|
+
this.setInitialFocus(node);
|
|
82
|
+
}
|
|
83
|
+
}, /**
|
|
84
|
+
* Sets initial focus within the dialog.
|
|
85
|
+
* Tries to focus the header first, then the first interactive element, or falls back to the container.
|
|
86
|
+
*/ this.setInitialFocus = (root)=>{
|
|
87
|
+
const firstChild = root.firstElementChild;
|
|
88
|
+
if (firstChild) {
|
|
89
|
+
if (firstChild.getAttribute('tabindex') === null) {
|
|
90
|
+
firstChild.setAttribute('tabindex', '-1');
|
|
91
|
+
}
|
|
92
|
+
firstChild.focus();
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const focusableElements = this.getFocusableElements();
|
|
96
|
+
if (focusableElements.length > 0) {
|
|
97
|
+
focusableElements[0].focus();
|
|
98
|
+
} else {
|
|
99
|
+
root.focus();
|
|
100
|
+
}
|
|
101
|
+
}, this.open = (closeCallback)=>{
|
|
102
|
+
const { closeOnEsc, closeOnOverlayClick, children, ...rest } = this.props;
|
|
103
|
+
// Save current focus
|
|
104
|
+
this.lastFocusedElement = document.activeElement;
|
|
45
105
|
const [Component, closeFn] = LayerManager.renderLayer({
|
|
46
106
|
exitDelay: 300,
|
|
47
107
|
overlay: true,
|
|
@@ -49,50 +109,43 @@ class Dialog extends React.Component {
|
|
|
49
109
|
closeCallback: this.closeCallback,
|
|
50
110
|
closeOnOverlayClick,
|
|
51
111
|
position: LAYER_POSITION.DIALOG,
|
|
52
|
-
component: (
|
|
112
|
+
component: /*#__PURE__*/ jsx(DialogContainer, {
|
|
113
|
+
...rest,
|
|
114
|
+
ref: this.setDialogRef,
|
|
115
|
+
role: "dialog",
|
|
116
|
+
"aria-modal": "true",
|
|
117
|
+
tabIndex: -1,
|
|
118
|
+
onKeyDown: this.handleKeyDown,
|
|
119
|
+
onClick: (e)=>e.stopPropagation(),
|
|
120
|
+
elevated: true,
|
|
121
|
+
children: children
|
|
122
|
+
})
|
|
53
123
|
});
|
|
54
124
|
this.closeDialog = closeFn;
|
|
55
125
|
this.setState({
|
|
56
126
|
show: true,
|
|
57
|
-
LayerComponent: Component
|
|
127
|
+
LayerComponent: Component
|
|
58
128
|
});
|
|
59
129
|
this.onCloseFn = closeCallback;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
};
|
|
65
|
-
this.closeCallback = (resp) => {
|
|
66
|
-
var _a;
|
|
130
|
+
}, this.close = (resp)=>{
|
|
131
|
+
this.closeDialog?.(resp);
|
|
132
|
+
}, this.closeCallback = (resp)=>{
|
|
133
|
+
this.restoreFocus();
|
|
67
134
|
this.setState({
|
|
68
135
|
show: false,
|
|
69
|
-
LayerComponent: undefined
|
|
136
|
+
LayerComponent: undefined
|
|
70
137
|
});
|
|
71
|
-
|
|
138
|
+
this.onCloseFn?.(resp);
|
|
72
139
|
};
|
|
73
140
|
}
|
|
74
|
-
shouldComponentUpdate(nextProps, nextState) {
|
|
75
|
-
return this.state.show !== nextState.show;
|
|
76
|
-
}
|
|
77
|
-
render() {
|
|
78
|
-
const { LayerComponent } = this.state;
|
|
79
|
-
if (this.state.show && LayerComponent) {
|
|
80
|
-
return _jsx(LayerComponent, {});
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
141
|
}
|
|
87
142
|
Dialog.propTypes = {
|
|
88
|
-
/** Flag to close dialog on `esc` click. Default value is true. */
|
|
89
|
-
|
|
90
|
-
/** Close layer overlay is clicked. Default value is true. */
|
|
91
|
-
closeOnOverlayClick: PropTypes.bool,
|
|
143
|
+
/** Flag to close dialog on `esc` click. Default value is true. */ closeOnEsc: PropTypes.bool,
|
|
144
|
+
/** Close layer overlay is clicked. Default value is true. */ closeOnOverlayClick: PropTypes.bool
|
|
92
145
|
};
|
|
93
146
|
Dialog.defaultProps = {
|
|
94
147
|
closeOnEsc: true,
|
|
95
|
-
closeOnOverlayClick: true
|
|
148
|
+
closeOnOverlayClick: true
|
|
96
149
|
};
|
|
97
|
-
|
|
98
|
-
|
|
150
|
+
|
|
151
|
+
export { DialogContainer, Dialog as default };
|
|
@@ -1,72 +1,110 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import React, { createRef } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import styled from '@emotion/styled';
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import Dialog from './Dialog.js';
|
|
6
|
+
import { Header, Body, Footer } from '../../shared/styles.js';
|
|
7
|
+
import StyledButton from '../Button/Button.js';
|
|
8
|
+
import ActionButton from '../Button/ActionButton.js';
|
|
9
|
+
import Input from '../Input/Input.js';
|
|
10
|
+
|
|
11
|
+
const BodyText = /*#__PURE__*/ styled("p", {
|
|
12
|
+
target: "ecd5j070",
|
|
13
|
+
label: "BodyText"
|
|
14
|
+
})("margin-top:0;", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiL2hvbWUvcnVubmVyL3dvcmsvbm8tZnJpbGxzLXVpL25vLWZyaWxscy11aS9zcmMvY29tcG9uZW50cy9EaWFsb2cvUHJvbXB0RGlhbG9nLnRzeCIsInNvdXJjZXMiOlsiL2hvbWUvcnVubmVyL3dvcmsvbm8tZnJpbGxzLXVpL25vLWZyaWxscy11aS9zcmMvY29tcG9uZW50cy9EaWFsb2cvUHJvbXB0RGlhbG9nLnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgY3JlYXRlUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IEJ1dHRvbiwgQWN0aW9uQnV0dG9uIH0gZnJvbSAnLi4vQnV0dG9uJztcbmltcG9ydCB7IElucHV0IH0gZnJvbSAnLi4vSW5wdXQnO1xuaW1wb3J0IERpYWxvZywgeyBEaWFsb2dIZWFkZXIsIERpYWxvZ0JvZHksIERpYWxvZ0Zvb3RlciB9IGZyb20gJy4vRGlhbG9nJztcblxudHlwZSBQcm9tcHRPcHRpb24gPSBQcm9wVHlwZXMuSW5mZXJQcm9wczx0eXBlb2YgUHJvbXB0RGlhbG9nLnByb3BUeXBlcz47XG5cbmNvbnN0IEJvZHlUZXh0ID0gc3R5bGVkLnBgXG4gICAgbWFyZ2luLXRvcDogMDtcbmA7XG5cbmNvbnN0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oKTtcblxuICAgIHByaXZhdGUgc3VibWl0ID0gKGU6IFJlYWN0LkZvcm1FdmVudCkgPT4ge1xuICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIHRoaXMuZGlhbG9nLmN1cnJlbnQuY2xvc2UodGhpcy5zdGF0ZS52YWx1ZSk7XG4gICAgfTtcblxuICAgIHB1YmxpYyBzaG93ID0gKCkgPT4ge1xuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICAgICAgY29uc3Qgb25DbG9zZSA9ICh2YWx1ZTogc3RyaW5nKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc29sdmUodmFsdWUpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLnNldFN0YXRlKHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHRoaXMucHJvcHMuZGVmYXVsdFZhbHVlLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHRoaXMuZGlhbG9nLmN1cnJlbnQub3BlbihvbkNsb3NlKTtcbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIHJlbmRlcigpIHtcbiAgICAgICAgY29uc3QgeyBoZWFkZXIsIGJvZHksIGlucHV0UHJvcHMsIHN1Ym1pdFRleHQsIGNhbmNlbFRleHQsIGRpYWxvZ1Byb3BzIH0gPSB0aGlzLnByb3BzO1xuXG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICA8RGlhbG9nXG4gICAgICAgICAgICAgICAgey4uLmRpYWxvZ1Byb3BzfVxuICAgICAgICAgICAgICAgIHJlZj17dGhpcy5kaWFsb2d9XG4gICAgICAgICAgICAgICAgY2xvc2VPbkVzYz17ZmFsc2V9XG4gICAgICAgICAgICAgICAgY2xvc2VPbk92ZXJsYXlDbGljaz17ZmFsc2V9XG4gICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgPGZvcm0gb25TdWJtaXQ9e3RoaXMuc3VibWl0fT5cbiAgICAgICAgICAgICAgICAgICAge2hlYWRlciAmJiA8RGlhbG9nSGVhZGVyPntoZWFkZXJ9PC9EaWFsb2dIZWFkZXI+fVxuICAgICAgICAgICAgICAgICAgICA8RGlhbG9nQm9keT5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxCb2R5VGV4dD57Ym9keX08L0JvZHlUZXh0PlxuICAgICAgICAgICAgICAgICAgICAgICAgPElucHV0Q29udGFpbmVyPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxTdHlsZWRJbnB1dFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZT17dGhpcy5zdGF0ZS52YWx1ZX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U9e3RoaXMudmFsdWVDaGFuZ2V9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsuLi5pbnB1dFByb3BzfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L0lucHV0Q29udGFpbmVyPlxuICAgICAgICAgICAgICAgICAgICA8L0RpYWxvZ0JvZHk+XG4gICAgICAgICAgICAgICAgICAgIDxEaWFsb2dGb290ZXI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8QnV0dG9uIHR5cGU9XCJidXR0b25cIiBvbkNsaWNrPXt0aGlzLmNhbmNlbH0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge2NhbmNlbFRleHR9XG4gICAgICAgICAgICAgICAgICAgICAgICA8L0J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxBY3Rpb25CdXR0b24+e3N1Ym1pdFRleHR9PC9BY3Rpb25CdXR0b24+XG4gICAgICAgICAgICAgICAgICAgIDwvRGlhbG9nRm9vdGVyPlxuICAgICAgICAgICAgICAgIDwvZm9ybT5cbiAgICAgICAgICAgIDwvRGlhbG9nPlxuICAgICAgICApO1xuICAgIH1cbn1cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFTaUIifQ== */");
|
|
15
|
+
const InputContainer = /*#__PURE__*/ styled("div", {
|
|
16
|
+
target: "ecd5j071",
|
|
17
|
+
label: "InputContainer"
|
|
18
|
+
})("display:flex;flex:1;margin-top:10px;& > label{flex:1;width:100%;padding:0;& > input{width:100%;padding:0 8px;box-sizing:border-box;}}", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiL2hvbWUvcnVubmVyL3dvcmsvbm8tZnJpbGxzLXVpL25vLWZyaWxscy11aS9zcmMvY29tcG9uZW50cy9EaWFsb2cvUHJvbXB0RGlhbG9nLnRzeCIsInNvdXJjZXMiOlsiL2hvbWUvcnVubmVyL3dvcmsvbm8tZnJpbGxzLXVpL25vLWZyaWxscy11aS9zcmMvY29tcG9uZW50cy9EaWFsb2cvUHJvbXB0RGlhbG9nLnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgY3JlYXRlUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IEJ1dHRvbiwgQWN0aW9uQnV0dG9uIH0gZnJvbSAnLi4vQnV0dG9uJztcbmltcG9ydCB7IElucHV0IH0gZnJvbSAnLi4vSW5wdXQnO1xuaW1wb3J0IERpYWxvZywgeyBEaWFsb2dIZWFkZXIsIERpYWxvZ0JvZHksIERpYWxvZ0Zvb3RlciB9IGZyb20gJy4vRGlhbG9nJztcblxudHlwZSBQcm9tcHRPcHRpb24gPSBQ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dGF0ZSh7XG4gICAgICAgICAgICB2YWx1ZTogZS50YXJnZXQudmFsdWUsXG4gICAgICAgIH0pO1xuICAgIH07XG5cbiAgICBwcml2YXRlIGNhbmNlbCA9ICgpID0+IHRoaXMuZGlhbG9nLmN1cnJlbnQuY2xvc2UoKTtcblxuICAgIHByaXZhdGUgc3VibWl0ID0gKGU6IFJlYWN0LkZvcm1FdmVudCkgPT4ge1xuICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIHRoaXMuZGlhbG9nLmN1cnJlbnQuY2xvc2UodGhpcy5zdGF0ZS52YWx1ZSk7XG4gICAgfTtcblxuICAgIHB1YmxpYyBzaG93ID0gKCkgPT4ge1xuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICAgICAgY29uc3Qgb25DbG9zZSA9ICh2YWx1ZTogc3RyaW5nKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc29sdmUodmFsdWUpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLnNldFN0YXRlKHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHRoaXMucHJvcHMuZGVmYXVsdFZhbHVlLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHRoaXMuZGlhbG9nLmN1cnJlbnQub3BlbihvbkNsb3NlKTtcbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIHJlbmRlcigpIHtcbiAgICAgICAgY29uc3QgeyBoZWFkZXIsIGJvZHksIGlucHV0UHJvcHMsIHN1Ym1pdFRleHQsIGNhbmNlbFRleHQsIGRpYWxvZ1Byb3BzIH0gPSB0aGlzLnByb3BzO1xuXG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICA8RGlhbG9nXG4gICAgICAgICAgICAgICAgey4uLmRpYWxvZ1Byb3BzfVxuICAgICAgICAgICAgICAgIHJlZj17dGhpcy5kaWFsb2d9XG4gICAgICAgICAgICAgICAgY2xvc2VPbkVzYz17ZmFsc2V9XG4gICAgICAgICAgICAgICAgY2xvc2VPbk92ZXJsYXlDbGljaz17ZmFsc2V9XG4gICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgPGZvcm0gb25TdWJtaXQ9e3RoaXMuc3VibWl0fT5cbiAgICAgICAgICAgICAgICAgICAge2hlYWRlciAmJiA8RGlhbG9nSGVhZGVyPntoZWFkZXJ9PC9EaWFsb2dIZWFkZXI+fVxuICAgICAgICAgICAgICAgICAgICA8RGlhbG9nQm9keT5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxCb2R5VGV4dD57Ym9keX08L0JvZHlUZXh0PlxuICAgICAgICAgICAgICAgICAgICAgICAgPElucHV0Q29udGFpbmVyPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxTdHlsZWRJbnB1dFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZT17dGhpcy5zdGF0ZS52YWx1ZX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U9e3RoaXMudmFsdWVDaGFuZ2V9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsuLi5pbnB1dFByb3BzfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L0lucHV0Q29udGFpbmVyPlxuICAgICAgICAgICAgICAgICAgICA8L0RpYWxvZ0JvZHk+XG4gICAgICAgICAgICAgICAgICAgIDxEaWFsb2dGb290ZXI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8QnV0dG9uIHR5cGU9XCJidXR0b25cIiBvbkNsaWNrPXt0aGlzLmNhbmNlbH0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge2NhbmNlbFRleHR9XG4gICAgICAgICAgICAgICAgICAgICAgICA8L0J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxBY3Rpb25CdXR0b24+e3N1Ym1pdFRleHR9PC9BY3Rpb25CdXR0b24+XG4gICAgICAgICAgICAgICAgICAgIDwvRGlhbG9nRm9vdGVyPlxuICAgICAgICAgICAgICAgIDwvZm9ybT5cbiAgICAgICAgICAgIDwvRGlhbG9nPlxuICAgICAgICApO1xuICAgIH1cbn1cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFhdUIifQ== */");
|
|
19
|
+
const StyledInput = /*#__PURE__*/ styled(Input, {
|
|
20
|
+
target: "ecd5j072",
|
|
21
|
+
label: "StyledInput"
|
|
22
|
+
})("flex:1;padding:0;", "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiL2hvbWUvcnVubmVyL3dvcmsvbm8tZnJpbGxzLXVpL25vLWZyaWxscy11aS9zcmMvY29tcG9uZW50cy9EaWFsb2cvUHJvbXB0RGlhbG9nLnRzeCIsInNvdXJjZXMiOlsiL2hvbWUvcnVubmVyL3dvcmsvbm8tZnJpbGxzLXVpL25vLWZyaWxscy11aS9zcmMvY29tcG9uZW50cy9EaWFsb2cvUHJvbXB0RGlhbG9nLnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgY3JlYXRlUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IEJ1dHRvbiwgQWN0aW9uQnV0dG9uIH0gZnJvbSAnLi4vQnV0dG9uJztcbmltcG9ydCB7IElucHV0IH0gZnJvbSAnLi4vSW5wdXQnO1xuaW1wb3J0IERpYWxvZywgeyBEaWFsb2dIZW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aGFuZ2UgPSAoZTogUmVhY3QuQ2hhbmdlRXZlbnQ8SFRNTElucHV0RWxlbWVudD4pID0+IHtcbiAgICAgICAgdGhpcy5zZXRTdGF0ZSh7XG4gICAgICAgICAgICB2YWx1ZTogZS50YXJnZXQudmFsdWUsXG4gICAgICAgIH0pO1xuICAgIH07XG5cbiAgICBwcml2YXRlIGNhbmNlbCA9ICgpID0+IHRoaXMuZGlhbG9nLmN1cnJlbnQuY2xvc2UoKTtcblxuICAgIHByaXZhdGUgc3VibWl0ID0gKGU6IFJlYWN0LkZvcm1FdmVudCkgPT4ge1xuICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIHRoaXMuZGlhbG9nLmN1cnJlbnQuY2xvc2UodGhpcy5zdGF0ZS52YWx1ZSk7XG4gICAgfTtcblxuICAgIHB1YmxpYyBzaG93ID0gKCkgPT4ge1xuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICAgICAgY29uc3Qgb25DbG9zZSA9ICh2YWx1ZTogc3RyaW5nKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc29sdmUodmFsdWUpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLnNldFN0YXRlKHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHRoaXMucHJvcHMuZGVmYXVsdFZhbHVlLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHRoaXMuZGlhbG9nLmN1cnJlbnQub3BlbihvbkNsb3NlKTtcbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIHJlbmRlcigpIHtcbiAgICAgICAgY29uc3QgeyBoZWFkZXIsIGJvZHksIGlucHV0UHJvcHMsIHN1Ym1pdFRleHQsIGNhbmNlbFRleHQsIGRpYWxvZ1Byb3BzIH0gPSB0aGlzLnByb3BzO1xuXG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICA8RGlhbG9nXG4gICAgICAgICAgICAgICAgey4uLmRpYWxvZ1Byb3BzfVxuICAgICAgICAgICAgICAgIHJlZj17dGhpcy5kaWFsb2d9XG4gICAgICAgICAgICAgICAgY2xvc2VPbkVzYz17ZmFsc2V9XG4gICAgICAgICAgICAgICAgY2xvc2VPbk92ZXJsYXlDbGljaz17ZmFsc2V9XG4gICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgPGZvcm0gb25TdWJtaXQ9e3RoaXMuc3VibWl0fT5cbiAgICAgICAgICAgICAgICAgICAge2hlYWRlciAmJiA8RGlhbG9nSGVhZGVyPntoZWFkZXJ9PC9EaWFsb2dIZWFkZXI+fVxuICAgICAgICAgICAgICAgICAgICA8RGlhbG9nQm9keT5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxCb2R5VGV4dD57Ym9keX08L0JvZHlUZXh0PlxuICAgICAgICAgICAgICAgICAgICAgICAgPElucHV0Q29udGFpbmVyPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxTdHlsZWRJbnB1dFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZT17dGhpcy5zdGF0ZS52YWx1ZX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U9e3RoaXMudmFsdWVDaGFuZ2V9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsuLi5pbnB1dFByb3BzfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L0lucHV0Q29udGFpbmVyPlxuICAgICAgICAgICAgICAgICAgICA8L0RpYWxvZ0JvZHk+XG4gICAgICAgICAgICAgICAgICAgIDxEaWFsb2dGb290ZXI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8QnV0dG9uIHR5cGU9XCJidXR0b25cIiBvbkNsaWNrPXt0aGlzLmNhbmNlbH0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge2NhbmNlbFRleHR9XG4gICAgICAgICAgICAgICAgICAgICAgICA8L0J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxBY3Rpb25CdXR0b24+e3N1Ym1pdFRleHR9PC9BY3Rpb25CdXR0b24+XG4gICAgICAgICAgICAgICAgICAgIDwvRGlhbG9nRm9vdGVyPlxuICAgICAgICAgICAgICAgIDwvZm9ybT5cbiAgICAgICAgICAgIDwvRGlhbG9nPlxuICAgICAgICApO1xuICAgIH1cbn1cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUErQm9CIn0= */");
|
|
11
23
|
class PromptDialog extends React.Component {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
24
|
+
render() {
|
|
25
|
+
const { header, body, inputProps, submitText, cancelText, dialogProps } = this.props;
|
|
26
|
+
return /*#__PURE__*/ jsx(Dialog, {
|
|
27
|
+
...dialogProps,
|
|
28
|
+
ref: this.dialog,
|
|
29
|
+
closeOnEsc: false,
|
|
30
|
+
closeOnOverlayClick: false,
|
|
31
|
+
children: /*#__PURE__*/ jsxs("form", {
|
|
32
|
+
onSubmit: this.submit,
|
|
33
|
+
children: [
|
|
34
|
+
header && /*#__PURE__*/ jsx(Header, {
|
|
35
|
+
children: header
|
|
36
|
+
}),
|
|
37
|
+
/*#__PURE__*/ jsxs(Body, {
|
|
38
|
+
children: [
|
|
39
|
+
/*#__PURE__*/ jsx(BodyText, {
|
|
40
|
+
children: body
|
|
41
|
+
}),
|
|
42
|
+
/*#__PURE__*/ jsx(InputContainer, {
|
|
43
|
+
children: /*#__PURE__*/ jsx(StyledInput, {
|
|
44
|
+
value: this.state.value,
|
|
45
|
+
onChange: this.valueChange,
|
|
46
|
+
...inputProps
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
}),
|
|
51
|
+
/*#__PURE__*/ jsxs(Footer, {
|
|
52
|
+
children: [
|
|
53
|
+
/*#__PURE__*/ jsx(StyledButton, {
|
|
54
|
+
type: "button",
|
|
55
|
+
onClick: this.cancel,
|
|
56
|
+
children: cancelText
|
|
57
|
+
}),
|
|
58
|
+
/*#__PURE__*/ jsx(ActionButton, {
|
|
59
|
+
children: submitText
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
constructor(props){
|
|
68
|
+
super(props), this.dialog = /*#__PURE__*/ createRef(), this.valueChange = (e)=>{
|
|
16
69
|
this.setState({
|
|
17
|
-
value: e.target.value
|
|
70
|
+
value: e.target.value
|
|
18
71
|
});
|
|
19
|
-
}
|
|
20
|
-
this.cancel = () => this.dialog.current.close();
|
|
21
|
-
this.submit = (e) => {
|
|
72
|
+
}, this.cancel = ()=>this.dialog.current.close(), this.submit = (e)=>{
|
|
22
73
|
e.preventDefault();
|
|
23
74
|
this.dialog.current.close(this.state.value);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const onClose = (value) => {
|
|
75
|
+
}, this.show = ()=>{
|
|
76
|
+
return new Promise((resolve, reject)=>{
|
|
77
|
+
const onClose = (value)=>{
|
|
28
78
|
if (value) {
|
|
29
79
|
resolve(value);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
80
|
+
} else {
|
|
32
81
|
reject();
|
|
33
82
|
}
|
|
34
83
|
this.setState({
|
|
35
|
-
value: this.props.defaultValue
|
|
84
|
+
value: this.props.defaultValue
|
|
36
85
|
});
|
|
37
86
|
};
|
|
38
87
|
this.dialog.current.open(onClose);
|
|
39
88
|
});
|
|
40
89
|
};
|
|
41
90
|
this.state = {
|
|
42
|
-
value: props.defaultValue
|
|
91
|
+
value: props.defaultValue
|
|
43
92
|
};
|
|
44
93
|
}
|
|
45
|
-
render() {
|
|
46
|
-
const { header, body, inputProps, submitText, cancelText, dialogProps } = this.props;
|
|
47
|
-
return (_jsx(Dialog, Object.assign({}, dialogProps, { ref: this.dialog, closeOnEsc: false, closeOnOverlayClick: false, children: _jsxs("form", { onSubmit: this.submit, children: [header && _jsx(DialogHeader, { children: header }), _jsxs(DialogBody, { children: [_jsx(BodyText, { children: body }), _jsx("div", { style: { display: 'flex' }, children: _jsx(Input, Object.assign({ style: { width: 'auto', flex: '1' }, value: this.state.value, onChange: this.valueChange }, inputProps)) })] }), _jsxs(DialogFooter, { children: [_jsx(Button, { type: "button", onClick: this.cancel, children: cancelText }), _jsx(ActionButton, { children: submitText })] })] }) })));
|
|
48
|
-
}
|
|
49
94
|
}
|
|
50
95
|
PromptDialog.propTypes = {
|
|
51
|
-
/** Shown as header of the dialog */
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
/** Default value
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
submitText: PropTypes.string,
|
|
59
|
-
/** Cancel button text. Default value is 'Cancel' */
|
|
60
|
-
cancelText: PropTypes.string,
|
|
61
|
-
/** Props for the input. */
|
|
62
|
-
inputProps: PropTypes.object,
|
|
63
|
-
/** Additional props for the dialog. */
|
|
64
|
-
dialogProps: PropTypes.object,
|
|
96
|
+
/** Shown as header of the dialog */ header: PropTypes.string,
|
|
97
|
+
/** Rendered as the body of the dialog */ body: PropTypes.string,
|
|
98
|
+
/** Default value for the input. */ defaultValue: PropTypes.string,
|
|
99
|
+
/** Submit button text. Default value is 'Submit' */ submitText: PropTypes.string,
|
|
100
|
+
/** Cancel button text. Default value is 'Cancel' */ cancelText: PropTypes.string,
|
|
101
|
+
/** Props for the input. */ inputProps: PropTypes.object,
|
|
102
|
+
/** Additional props for the dialog. */ dialogProps: PropTypes.object
|
|
65
103
|
};
|
|
66
104
|
PromptDialog.defaultProps = {
|
|
67
105
|
cancelText: 'Cancel',
|
|
68
106
|
submitText: 'Submit',
|
|
69
|
-
defaultValue: ''
|
|
107
|
+
defaultValue: ''
|
|
70
108
|
};
|
|
71
|
-
|
|
72
|
-
|
|
109
|
+
|
|
110
|
+
export { PromptDialog as default };
|
|
@@ -2,4 +2,3 @@ export { default as Dialog, DialogBody, DialogFooter, DialogHeader } from './Dia
|
|
|
2
2
|
export { default as AlertDialog } from './AlertDialog';
|
|
3
3
|
export { default as ConfirmDialog } from './ConfirmDialog';
|
|
4
4
|
export { default as PromptDialog } from './PromptDialog';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|