All Downloads are FREE. Search and download functionalities are using the official Maven repository.

theme.keycloak.v2.account.resources.widgets.ContinueCancelModal.js.map Maven / Gradle / Ivy

There is a newer version: 26.0.5
Show newest version
{"version":3,"file":"ContinueCancelModal.js","names":["React","Modal","ModalVariant","Button","Msg","ContinueCancelModal","Component","constructor","props","_defineProperty","setState","isModalOpen","onClose","handleModalToggle","onContinue","state","render","createElement","Fragment","id","buttonId","variant","buttonVariant","onClick","isDisabled","msgKey","buttonTitle","_extends","small","title","localize","modalTitle","isOpen","actions","key","handleContinue","modalContinueButtonLabel","modalCancelButtonLabel","modalMessage","children"],"sources":["../../src/app/widgets/ContinueCancelModal.tsx"],"sourcesContent":["/*\n * Copyright 2019 Red Hat, Inc. and/or its affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as React from 'react';\nimport { Modal, ModalVariant, Button, ButtonProps } from '@patternfly/react-core';\nimport {Msg} from './Msg';\n\n/**\n * For any of these properties that are strings, you can\n * pass in a localization key instead of a static string.\n */\ninterface ContinueCancelModalProps {\n    buttonTitle?: string;\n    buttonVariant?: ButtonProps['variant'];\n    buttonId?: string;\n    render?(toggle: () => void): React.ReactNode;\n    modalTitle: string;\n    modalMessage?: string;\n    modalContinueButtonLabel?: string;\n    modalCancelButtonLabel?: string;\n    onContinue: () => void;\n    onClose?: () => void;\n    isDisabled?: boolean;\n}\n\ninterface ContinueCancelModalState {\n    isModalOpen: boolean;\n}\n\n/**\n * This class renders a button that provides a continue/cancel modal dialog when clicked.  If the user selects 'Continue'\n * then the onContinue function is executed.\n *\n * @author Stan Silvert [email protected] (C) 2019 Red Hat Inc.\n */\nexport class ContinueCancelModal extends React.Component {\n    protected static defaultProps = {\n        buttonVariant: 'primary',\n        modalContinueButtonLabel: 'continue',\n        modalCancelButtonLabel: 'doCancel',\n        isDisabled: false\n    };\n\n    public constructor(props: ContinueCancelModalProps) {\n        super(props);\n        this.state = {\n            isModalOpen: false\n        };\n    }\n\n    private handleModalToggle = () => {\n        this.setState(({ isModalOpen }) => ({\n            isModalOpen: !isModalOpen\n        }));\n        if (this.props.onClose) this.props.onClose();\n    };\n\n    private handleContinue = () => {\n        this.handleModalToggle();\n        this.props.onContinue();\n    }\n\n    public render(): React.ReactNode {\n        const { isModalOpen } = this.state;\n\n        return (\n            \n                {!this.props.render &&\n                }\n                {this.props.render && this.props.render(this.handleModalToggle)}\n                \n                            \n                        ,\n                        \n                    ]}\n                >\n                    { !this.props.modalMessage && this.props.children}\n                    { this.props.modalMessage && }\n                \n            \n        );\n    }\n};\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,KAAK;AACjB,SAASC,KAAK,EAAEC,YAAY,EAAEC,MAAM;AACpC,SAAQC,GAAG;;AAEX;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,SAASL,KAAK,CAACM,SAAS,CAAqD;EAQlGC,WAAWA,CAACC,KAA+B,EAAE;IAChD,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,4BAMW,MAAM;MAC9B,IAAI,CAACC,QAAQ,CAAC,CAAC;QAAEC;MAAY,CAAC,MAAM;QAChCA,WAAW,EAAE,CAACA;MAClB,CAAC,CAAC,CAAC;MACH,IAAI,IAAI,CAACH,KAAK,CAACI,OAAO,EAAE,IAAI,CAACJ,KAAK,CAACI,OAAO,CAAC,CAAC;IAChD,CAAC;IAAAH,eAAA,yBAEwB,MAAM;MAC3B,IAAI,CAACI,iBAAiB,CAAC,CAAC;MACxB,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