@corva/ui 3.75.0-18 → 3.75.0-19

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.
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),i=require("@babel/runtime/helpers/inherits"),r=require("@babel/runtime/helpers/possibleConstructorReturn"),a=require("@babel/runtime/helpers/getPrototypeOf"),o=require("react"),n=require("prop-types"),s=require("@material-ui/core/styles"),l=require("@material-ui/core/Typography"),c=require("@material-ui/core/TextField"),u=require("@material-ui/core/DialogTitle"),f=require("@material-ui/core/DialogContent"),d=require("@material-ui/core/DialogContentText"),p=require("@material-ui/core/DialogActions"),h=require("@material-ui/core/Button"),m=require("@material-ui/core/Dialog"),x=require("react/jsx-runtime");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=b(e),q=b(t),y=b(i),C=b(r),v=b(a),T=b(n),k=b(l),j=b(c),O=b(u),R=b(f),B=b(d),D=b(p),F=b(h),N=b(m);function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=v.default(e);if(t){var a=v.default(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return C.default(this,i)}}var w="confirmationDialog",P=function(e){y.default(i,e);var t=S(i);function i(e){var r;return g.default(this,i),(r=t.call(this,e)).state={confirmationTextField:""},r}return q.default(i,[{key:"actions",get:function(){return x.jsxs(x.Fragment,{children:[this.props.isShowCancel&&x.jsx(F.default,{variant:"text","data-testid":"".concat(w,"_cancelButton"),className:this.props.classes.actionButton,onClick:this.props.handleClose,color:"primary",children:"Cancel"}),x.jsx(F.default,{variant:"contained","data-testid":"".concat(w,"_confirmButton"),className:this.props.classes.actionButton,onClick:this.props.handleOk,disabled:this.props.disableOk||this.props.confirmationText&&this.props.confirmation!==this.state.confirmationTextField,color:"primary",children:this.props.okText})]})}},{key:"render",value:function(){var e=this;return x.jsxs(N.default,{open:this.props.open,onClose:this.props.handleClose,"aria-labelledby":"confirmation-dialog-title",classes:{paper:this.props.classes.paper},children:[x.jsx(O.default,{id:"confirmation-dialog-title",children:this.props.title}),x.jsx(R.default,{children:x.jsxs(B.default,{children:[x.jsx(k.default,{variant:"body2",className:this.props.classes.content,children:this.props.text}),this.props.confirmationText&&x.jsx(j.default,{fullWidth:!0,"data-testid":"".concat(w,"_input"),label:this.props.confirmationText,value:this.state.confirmationTextField,onChange:function(t){return e.setState({confirmationTextField:t.target.value})},className:this.props.classes.confirmation})]})}),x.jsx(D.default,{className:this.props.classes.actions,children:this.actions})]})}}]),i}(o.Component);P.propTypes={open:T.default.bool.isRequired,title:T.default.string,text:T.default.string.isRequired,confirmationText:T.default.string,confirmation:T.default.string,handleClose:T.default.func,handleOk:T.default.func,okText:T.default.string,disableOk:T.default.bool,isShowCancel:T.default.bool,classes:T.default.shape({}).isRequired},P.defaultProps={title:void 0,confirmationText:null,confirmation:"",okText:"Ok",handleOk:function(){},handleClose:function(){},disableOk:!1,isShowCancel:!0};var _=s.withStyles({actionButton:{marginLeft:15},confirmation:{marginTop:10}})(P);module.exports=_;
1
+ "use strict";var e=require("@babel/runtime/helpers/slicedToArray"),t=require("react"),i=require("prop-types"),a=require("@material-ui/core/styles"),r=require("@material-ui/core/Typography"),l=require("@material-ui/core/TextField"),o=require("@material-ui/core/DialogTitle"),n=require("@material-ui/core/DialogContent"),u=require("@material-ui/core/DialogContentText"),c=require("@material-ui/core/DialogActions"),d=require("@material-ui/core/Button"),s=require("@material-ui/core/Dialog"),f=require("react/jsx-runtime");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=m(e),h=m(i),x=m(r),g=m(l),v=m(o),q=m(n),b=m(u),j=m(c),y=m(d),C=m(s),T="confirmationDialog",k=function(){};function B(e){var i=e.open,a=e.title,r=void 0===a?void 0:a,l=e.text,o=e.confirmationText,n=void 0===o?null:o,u=e.confirmation,c=void 0===u?"":u,d=e.handleClose,s=void 0===d?k:d,m=e.handleOk,h=void 0===m?k:m,B=e.okText,D=void 0===B?"Ok":B,N=e.disableOk,O=void 0!==N&&N,S=e.isShowCancel,w=void 0===S||S,R=e.classes,_=t.useState(""),A=p.default(_,2),F=A[0],L=A[1],W=f.jsxs(f.Fragment,{children:[w&&f.jsx(y.default,{variant:"text","data-testid":"".concat(T,"_cancelButton"),className:R.actionButton,onClick:s,color:"primary",children:"Cancel"}),f.jsx(y.default,{variant:"contained","data-testid":"".concat(T,"_confirmButton"),className:R.actionButton,onClick:h,disabled:O||n&&c!==F,color:"primary",children:D})]});return f.jsxs(C.default,{open:i,onClose:s,"aria-labelledby":"confirmation-dialog-title",classes:{paper:R.paper},children:[f.jsx(v.default,{id:"confirmation-dialog-title",children:r}),f.jsx(q.default,{children:f.jsxs(b.default,{children:[f.jsx(x.default,{variant:"body2",className:R.content,children:l}),n&&f.jsx(g.default,{fullWidth:!0,"data-testid":"".concat(T,"_input"),label:n,value:F,onChange:function(e){return L(e.target.value)},className:R.confirmation})]})}),f.jsx(j.default,{className:R.actions,children:W})]})}B.propTypes={open:h.default.bool.isRequired,title:h.default.string,text:h.default.string.isRequired,confirmationText:h.default.string,confirmation:h.default.string,handleClose:h.default.func,handleOk:h.default.func,okText:h.default.string,disableOk:h.default.bool,isShowCancel:h.default.bool,classes:h.default.shape({}).isRequired};var D=a.withStyles({actionButton:{marginLeft:15},confirmation:{marginTop:10}})(B);module.exports=D;
2
2
  //# sourceMappingURL=ConfirmationDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmationDialog.js","sources":["../../../src/components/ConfirmationDialog.js"],"sourcesContent":["import { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport TextField from '@material-ui/core/TextField';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\n\nconst PAGE_NAME = 'confirmationDialog';\n\nconst muiStyles = {\n actionButton: { marginLeft: 15 },\n confirmation: { marginTop: 10 },\n};\n\nclass ConfirmationDialog extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n confirmationTextField: '',\n };\n }\n\n get actions() {\n return (\n <>\n {this.props.isShowCancel && (\n <Button\n variant=\"text\"\n data-testid={`${PAGE_NAME}_cancelButton`}\n className={this.props.classes.actionButton}\n onClick={this.props.handleClose}\n color=\"primary\"\n >\n Cancel\n </Button>\n )}\n <Button\n variant=\"contained\"\n data-testid={`${PAGE_NAME}_confirmButton`}\n className={this.props.classes.actionButton}\n onClick={this.props.handleOk}\n disabled={\n this.props.disableOk ||\n (this.props.confirmationText &&\n this.props.confirmation !== this.state.confirmationTextField)\n }\n color=\"primary\"\n >\n {this.props.okText}\n </Button>\n </>\n );\n }\n\n render() {\n return (\n <Dialog\n open={this.props.open}\n onClose={this.props.handleClose}\n aria-labelledby=\"confirmation-dialog-title\"\n classes={{ paper: this.props.classes.paper }}\n >\n <DialogTitle id=\"confirmation-dialog-title\">{this.props.title}</DialogTitle>\n\n <DialogContent>\n <DialogContentText>\n <Typography variant=\"body2\" className={this.props.classes.content}>\n {this.props.text}\n </Typography>\n {this.props.confirmationText && (\n <TextField\n fullWidth\n data-testid={`${PAGE_NAME}_input`}\n label={this.props.confirmationText}\n value={this.state.confirmationTextField}\n onChange={e => this.setState({ confirmationTextField: e.target.value })}\n className={this.props.classes.confirmation}\n />\n )}\n </DialogContentText>\n </DialogContent>\n <DialogActions className={this.props.classes.actions}>{this.actions}</DialogActions>\n </Dialog>\n );\n }\n}\n\nConfirmationDialog.propTypes = {\n open: PropTypes.bool.isRequired,\n title: PropTypes.string,\n text: PropTypes.string.isRequired,\n confirmationText: PropTypes.string,\n confirmation: PropTypes.string,\n handleClose: PropTypes.func,\n handleOk: PropTypes.func,\n okText: PropTypes.string,\n disableOk: PropTypes.bool,\n isShowCancel: PropTypes.bool,\n\n classes: PropTypes.shape({}).isRequired,\n};\n\nConfirmationDialog.defaultProps = {\n title: undefined,\n confirmationText: null,\n confirmation: '',\n okText: 'Ok',\n handleOk: () => undefined,\n handleClose: () => undefined,\n disableOk: false,\n isShowCancel: true,\n};\n\nexport default withStyles(muiStyles)(ConfirmationDialog);\n"],"names":["PAGE_NAME","ConfirmationDialog","_Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","this","call","state","confirmationTextField","_createClass","key","get","_jsxs","_Fragment","children","isShowCancel","_jsx","Button","variant","concat","className","classes","actionButton","onClick","handleClose","color","handleOk","disabled","disableOk","confirmationText","confirmation","okText","value","_this2","Dialog","open","onClose","paper","DialogTitle","id","title","DialogContent","DialogContentText","Typography","content","text","TextField","fullWidth","label","onChange","e","setState","target","DialogActions","actions","Component","propTypes","PropTypes","bool","isRequired","string","func","shape","defaultProps","undefined","ConfirmationDialogJs","withStyles","marginLeft","marginTop"],"mappings":"o0CAYA,IAAMA,EAAY,qBAOZC,EAAkB,SAAAC,GAAAC,UAAAF,EAAAC,GAAA,IAAAE,EAAAC,EAAAJ,GACtB,SAAAA,EAAYK,GAAO,IAAAC,EAKf,OALeC,UAAAC,KAAAR,IACjBM,EAAAH,EAAAM,KAAAD,KAAMH,IAEDK,MAAQ,CACXC,sBAAuB,IACvBL,CACJ,CAgEC,OAhEAM,EAAA,QAAAZ,EAAA,CAAA,CAAAa,IAAA,UAAAC,IAED,WACE,OACEC,EAAAA,KAAAC,EAAAA,SAAA,CAAAC,SAAA,CACGT,KAAKH,MAAMa,cACVC,EAAAA,IAACC,EAAAA,QAAM,CACLC,QAAQ,OACR,cAAA,GAAAC,OAAgBvB,EAAyB,iBACzCwB,UAAWf,KAAKH,MAAMmB,QAAQC,aAC9BC,QAASlB,KAAKH,MAAMsB,YACpBC,MAAM,UAASX,SAAA,WAKnBE,MAACC,UAAM,CACLC,QAAQ,YACR,cAAA,GAAAC,OAAgBvB,EAA0B,kBAC1CwB,UAAWf,KAAKH,MAAMmB,QAAQC,aAC9BC,QAASlB,KAAKH,MAAMwB,SACpBC,SACEtB,KAAKH,MAAM0B,WACVvB,KAAKH,MAAM2B,kBACVxB,KAAKH,MAAM4B,eAAiBzB,KAAKE,MAAMC,sBAE3CiB,MAAM,UAASX,SAEdT,KAAKH,MAAM6B,WAIpB,GAAC,CAAArB,IAAA,SAAAsB,MAED,WAAS,IAAAC,EAAA5B,KACP,OACEO,EAAAA,KAACsB,EAAAA,QAAM,CACLC,KAAM9B,KAAKH,MAAMiC,KACjBC,QAAS/B,KAAKH,MAAMsB,YACpB,kBAAgB,4BAChBH,QAAS,CAAEgB,MAAOhC,KAAKH,MAAMmB,QAAQgB,OAAQvB,SAAA,CAE7CE,MAACsB,UAAW,CAACC,GAAG,4BAA2BzB,SAAET,KAAKH,MAAMsC,QAExDxB,MAACyB,UAAa,CAAA3B,SACZF,OAAC8B,UAAiB,CAAA5B,SAAA,CAChBE,MAAC2B,UAAU,CAACzB,QAAQ,QAAQE,UAAWf,KAAKH,MAAMmB,QAAQuB,QAAQ9B,SAC/DT,KAAKH,MAAM2C,OAEbxC,KAAKH,MAAM2B,kBACVb,EAAAA,IAAC8B,EAAAA,QAAS,CACRC,WAAS,EACT,cAAA,GAAA5B,OAAgBvB,EAAkB,UAClCoD,MAAO3C,KAAKH,MAAM2B,iBAClBG,MAAO3B,KAAKE,MAAMC,sBAClByC,SAAU,SAAAC,GAAC,OAAIjB,EAAKkB,SAAS,CAAE3C,sBAAuB0C,EAAEE,OAAOpB,OAAS,EACxEZ,UAAWf,KAAKH,MAAMmB,QAAQS,oBAKtCd,MAACqC,UAAa,CAACjC,UAAWf,KAAKH,MAAMmB,QAAQiC,QAAQxC,SAAET,KAAKiD,YAGlE,KAACzD,CAAA,CAvEqB,CAAS0D,EAASA,WA0E1C1D,EAAmB2D,UAAY,CAC7BrB,KAAMsB,EAAAA,QAAUC,KAAKC,WACrBnB,MAAOiB,EAAS,QAACG,OACjBf,KAAMY,EAAAA,QAAUG,OAAOD,WACvB9B,iBAAkB4B,EAAS,QAACG,OAC5B9B,aAAc2B,EAAS,QAACG,OACxBpC,YAAaiC,EAAS,QAACI,KACvBnC,SAAU+B,EAAS,QAACI,KACpB9B,OAAQ0B,EAAS,QAACG,OAClBhC,UAAW6B,EAAS,QAACC,KACrB3C,aAAc0C,EAAS,QAACC,KAExBrC,QAASoC,EAAS,QAACK,MAAM,CAAA,GAAIH,YAG/B9D,EAAmBkE,aAAe,CAChCvB,WAAOwB,EACPnC,iBAAkB,KAClBC,aAAc,GACdC,OAAQ,KACRL,SAAU,WAAe,EACzBF,YAAa,WAAe,EAC5BI,WAAW,EACXb,cAAc,GAGhB,IAAAkD,EAAeC,aAzGG,CAChB5C,aAAc,CAAE6C,WAAY,IAC5BrC,aAAc,CAAEsC,UAAW,KAuGdF,CAAsBrE"}
1
+ {"version":3,"file":"ConfirmationDialog.js","sources":["../../../src/components/ConfirmationDialog.js"],"sourcesContent":["import { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport TextField from '@material-ui/core/TextField';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\n\nconst PAGE_NAME = 'confirmationDialog';\n\nconst muiStyles = {\n actionButton: { marginLeft: 15 },\n confirmation: { marginTop: 10 },\n};\n\nconst noop = () => undefined;\n\n/** @param {PropTypes.InferProps<typeof ConfirmationDialog.propTypes>} props */\nfunction ConfirmationDialog({\n open,\n title = undefined,\n text,\n confirmationText = null,\n confirmation = '',\n handleClose = noop,\n handleOk = noop,\n okText = 'Ok',\n disableOk = false,\n isShowCancel = true,\n classes,\n}) {\n const [confirmationTextField, setConfirmationTextField] = useState('');\n\n const actions = (\n <>\n {isShowCancel && (\n <Button\n variant=\"text\"\n data-testid={`${PAGE_NAME}_cancelButton`}\n className={classes.actionButton}\n onClick={handleClose}\n color=\"primary\"\n >\n Cancel\n </Button>\n )}\n <Button\n variant=\"contained\"\n data-testid={`${PAGE_NAME}_confirmButton`}\n className={classes.actionButton}\n onClick={handleOk}\n disabled={disableOk || (confirmationText && confirmation !== confirmationTextField)}\n color=\"primary\"\n >\n {okText}\n </Button>\n </>\n );\n return (\n <Dialog\n open={open}\n onClose={handleClose}\n aria-labelledby=\"confirmation-dialog-title\"\n classes={{ paper: classes.paper }}\n >\n <DialogTitle id=\"confirmation-dialog-title\">{title}</DialogTitle>\n\n <DialogContent>\n <DialogContentText>\n <Typography variant=\"body2\" className={classes.content}>\n {text}\n </Typography>\n {confirmationText && (\n <TextField\n fullWidth\n data-testid={`${PAGE_NAME}_input`}\n label={confirmationText}\n value={confirmationTextField}\n onChange={e => setConfirmationTextField(e.target.value)}\n className={classes.confirmation}\n />\n )}\n </DialogContentText>\n </DialogContent>\n <DialogActions className={classes.actions}>{actions}</DialogActions>\n </Dialog>\n );\n}\n\nConfirmationDialog.propTypes = {\n open: PropTypes.bool.isRequired,\n title: PropTypes.string,\n text: PropTypes.string.isRequired,\n confirmationText: PropTypes.string,\n confirmation: PropTypes.string,\n handleClose: PropTypes.func,\n handleOk: PropTypes.func,\n okText: PropTypes.string,\n disableOk: PropTypes.bool,\n isShowCancel: PropTypes.bool,\n\n classes: PropTypes.shape({}).isRequired,\n};\n\nexport default withStyles(muiStyles)(ConfirmationDialog);\n"],"names":["PAGE_NAME","noop","ConfirmationDialog","_ref","open","_ref$title","title","undefined","text","_ref$confirmationText","confirmationText","_ref$confirmation","confirmation","_ref$handleClose","handleClose","_ref$handleOk","handleOk","_ref$okText","okText","_ref$disableOk","disableOk","_ref$isShowCancel","isShowCancel","classes","useState","_useState2","_slicedToArray","_useState","confirmationTextField","setConfirmationTextField","actions","_jsxs","jsxs","_Fragment","children","_jsx","jsx","Button","variant","concat","className","actionButton","onClick","color","disabled","Dialog","onClose","paper","DialogTitle","id","DialogContent","DialogContentText","Typography","content","TextField","fullWidth","label","value","onChange","e","target","DialogActions","propTypes","PropTypes","bool","isRequired","string","func","shape","ConfirmationDialogJs","withStyles","marginLeft","marginTop"],"mappings":"0pBAYMA,EAAY,qBAOZC,EAAO,WAAe,EAG5B,SAASC,EAYNC,GAAA,IAXDC,IAAAA,KAAIC,EAAAF,EACJG,MAAAA,kBAAQC,EAASF,EACjBG,IAAAA,KAAIC,EAAAN,EACJO,iBAAAA,aAAmB,KAAID,EAAAE,EAAAR,EACvBS,aAAAA,aAAe,GAAED,EAAAE,EAAAV,EACjBW,YAAAA,aAAcb,EAAIY,EAAAE,EAAAZ,EAClBa,SAAAA,aAAWf,EAAIc,EAAAE,EAAAd,EACfe,OAAAA,aAAS,KAAID,EAAAE,EAAAhB,EACbiB,UAAAA,cAAiBD,EAAAE,EAAAlB,EACjBmB,aAAAA,cAAmBD,EACnBE,IAAAA,QAE0DC,EAAAA,EAAQA,SAAC,IAAGC,EAAAC,EAAAA,QAAAC,EAAA,GAA/DC,EAAqBH,EAAA,GAAEI,EAAwBJ,EAAA,GAEhDK,EACJC,EAAAC,KAAAC,WAAA,CAAAC,SACGZ,CAAAA,GACCa,EAAAC,IAACC,UAAM,CACLC,QAAQ,OACR,cAAA,GAAAC,OAAgBvC,EAAyB,iBACzCwC,UAAWjB,EAAQkB,aACnBC,QAAS5B,EACT6B,MAAM,UAAST,SAAA,WAKnBC,MAACE,UAAM,CACLC,QAAQ,YACR,cAAA,GAAAC,OAAgBvC,EAA0B,kBAC1CwC,UAAWjB,EAAQkB,aACnBC,QAAS1B,EACT4B,SAAUxB,GAAcV,GAAoBE,IAAiBgB,EAC7De,MAAM,UAAST,SAEdhB,OAIP,OACEa,EAAAA,KAACc,EAAAA,QAAM,CACLzC,KAAMA,EACN0C,QAAShC,EACT,kBAAgB,4BAChBS,QAAS,CAAEwB,MAAOxB,EAAQwB,OAAQb,SAAA,CAElCC,MAACa,UAAW,CAACC,GAAG,4BAA2Bf,SAAE5B,IAE7C6B,MAACe,UAAa,CAAAhB,SACZH,OAACoB,UAAiB,CAAAjB,SAAA,CAChBC,MAACiB,UAAU,CAACd,QAAQ,QAAQE,UAAWjB,EAAQ8B,QAAQnB,SACpD1B,IAEFE,GACCyB,EAAAC,IAACkB,UAAS,CACRC,WAAS,EACT,cAAA,GAAAhB,OAAgBvC,EAAkB,UAClCwD,MAAO9C,EACP+C,MAAO7B,EACP8B,SAAU,SAAAC,GAAC,OAAI9B,EAAyB8B,EAAEC,OAAOH,MAAO,EACxDjB,UAAWjB,EAAQX,oBAK3BuB,MAAC0B,UAAa,CAACrB,UAAWjB,EAAQO,QAAQI,SAAEJ,MAGlD,CAEA5B,EAAmB4D,UAAY,CAC7B1D,KAAM2D,EAAAA,QAAUC,KAAKC,WACrB3D,MAAOyD,EAAS,QAACG,OACjB1D,KAAMuD,EAAAA,QAAUG,OAAOD,WACvBvD,iBAAkBqD,EAAS,QAACG,OAC5BtD,aAAcmD,EAAS,QAACG,OACxBpD,YAAaiD,EAAS,QAACI,KACvBnD,SAAU+C,EAAS,QAACI,KACpBjD,OAAQ6C,EAAS,QAACG,OAClB9C,UAAW2C,EAAS,QAACC,KACrB1C,aAAcyC,EAAS,QAACC,KAExBzC,QAASwC,EAAS,QAACK,MAAM,CAAA,GAAIH,YAG/B,IAAAI,EAAeC,aA9FG,CAChB7B,aAAc,CAAE8B,WAAY,IAC5B3D,aAAc,CAAE4D,UAAW,KA4FdF,CAAsBpE"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/assertThisInitialized"),i=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),l=require("@babel/runtime/helpers/defineProperty"),a=require("react"),s=require("emoji-mart"),u=require("prop-types"),c=require("@material-ui/core/Popover"),p=require("./IconButton/index.js"),f=require("./Icons/EmojiIcon.js"),d=require("react/jsx-runtime");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=h(e),b=h(t),j=h(r),v=h(i),P=h(o),q=h(n),E=h(l),y=h(u),R=h(c);function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=q.default(e);if(t){var o=q.default(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return P.default(this,r)}}var k=function(e){v.default(r,e);var t=S(r);function r(e){var i;return m.default(this,r),i=t.call(this,e),E.default(j.default(i),"onSelect",(function(e){var t=i.props,r=t.handleSelectEmoji,o=t.closeOnSelect;r(e),o&&i.setState({openEmojiPicker:!1})})),i.state={openEmojiPicker:!1},i}return b.default(r,[{key:"render",value:function(){var e=this;return d.jsxs(d.Fragment,{children:[d.jsx(p,{"data-testid":this.props["data-testid"],buttonRef:function(t){e.anchorEl=t},"aria-label":"Emoji",onClick:function(){return e.setState({openEmojiPicker:!0})},disableRipple:this.props.disableRipple,className:this.props.emojiIconClassName,tooltipProps:this.props.tooltipProps,children:this.props.icon||d.jsx(f,{})}),d.jsx(R.default,{open:this.state.openEmojiPicker,anchorEl:this.anchorEl,onClose:function(){return e.setState({openEmojiPicker:!1})},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:d.jsx(s.Picker,{onSelect:this.onSelect,theme:"dark"})})]})}}]),r}(a.PureComponent);k.propTypes={handleSelectEmoji:y.default.func.isRequired,emojiIconClassName:y.default.string,disableRipple:y.default.bool,closeOnSelect:y.default.bool,"data-testid":y.default.string,tooltipProps:y.default.shape({}),icon:y.default.node},k.defaultProps={emojiIconClassName:void 0,disableRipple:!1,closeOnSelect:!0,"data-testid":"generic_emojiButton",tooltipProps:{title:"Add Emoji"},icon:void 0},module.exports=k;
1
+ "use strict";var e=require("@babel/runtime/helpers/slicedToArray"),t=require("react"),i=require("emoji-mart"),o=require("prop-types"),r=require("@material-ui/core/Popover"),n=require("./IconButton/index.js"),l=require("./Icons/EmojiIcon.js"),a=require("react/jsx-runtime");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=u(e),d=u(o),c=u(r),p={title:"Add Emoji"};function m(e){var o=e.handleSelectEmoji,r=e.emojiIconClassName,u=void 0===r?void 0:r,d=e.disableRipple,m=void 0!==d&&d,f=e.closeOnSelect,j=void 0===f||f,v=e["data-testid"],h=void 0===v?"generic_emojiButton":v,b=e.tooltipProps,q=void 0===b?p:b,g=e.icon,x=void 0===g?void 0:g,E=t.useState(!1),R=s.default(E,2),S=R[0],I=R[1],P=t.useRef(null);return a.jsxs(a.Fragment,{children:[a.jsx(n,{"data-testid":h,buttonRef:function(e){P.current=e},"aria-label":"Emoji",onClick:function(){return I(!0)},disableRipple:m,className:u,tooltipProps:q,children:x||a.jsx(l,{})}),a.jsx(c.default,{open:S,anchorEl:P.current,onClose:function(){return I(!1)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:a.jsx(i.Picker,{onSelect:function(e){o(e),j&&I(!1)},theme:"dark"})})]})}m.propTypes={handleSelectEmoji:d.default.func.isRequired,emojiIconClassName:d.default.string,disableRipple:d.default.bool,closeOnSelect:d.default.bool,"data-testid":d.default.string,tooltipProps:d.default.shape({}),icon:d.default.node};var f=t.memo(m);module.exports=f;
2
2
  //# sourceMappingURL=EmojiIconButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmojiIconButton.js","sources":["../../../src/components/EmojiIconButton.js"],"sourcesContent":["import { PureComponent } from 'react';\nimport { Picker } from 'emoji-mart';\nimport PropTypes from 'prop-types';\nimport Popover from '@material-ui/core/Popover';\n\nimport IconButton from '~components/IconButton';\nimport EmojiIcon from '~components/Icons/EmojiIcon';\n\n/** @extends {PureComponent<any, any, any>} */\nclass EmojiIconButton extends PureComponent {\n constructor(props) {\n super(props);\n\n this.state = {\n openEmojiPicker: false,\n };\n }\n\n onSelect = emoji => {\n const { handleSelectEmoji, closeOnSelect } = this.props;\n handleSelectEmoji(emoji);\n if (closeOnSelect) {\n this.setState({ openEmojiPicker: false });\n }\n };\n\n render() {\n return (\n <>\n <IconButton\n data-testid={this.props['data-testid']}\n buttonRef={node => {\n this.anchorEl = node;\n }}\n aria-label=\"Emoji\"\n onClick={() => this.setState({ openEmojiPicker: true })}\n disableRipple={this.props.disableRipple}\n className={this.props.emojiIconClassName}\n tooltipProps={this.props.tooltipProps}\n >\n {this.props.icon || <EmojiIcon />}\n </IconButton>\n\n <Popover\n open={this.state.openEmojiPicker}\n anchorEl={this.anchorEl}\n onClose={() => this.setState({ openEmojiPicker: false })}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'right',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'right',\n }}\n >\n <Picker onSelect={this.onSelect} theme=\"dark\" />\n </Popover>\n </>\n );\n }\n}\n\nEmojiIconButton.propTypes = {\n handleSelectEmoji: PropTypes.func.isRequired,\n emojiIconClassName: PropTypes.string,\n disableRipple: PropTypes.bool,\n closeOnSelect: PropTypes.bool,\n 'data-testid': PropTypes.string,\n tooltipProps: PropTypes.shape({}),\n icon: PropTypes.node,\n};\n\nEmojiIconButton.defaultProps = {\n emojiIconClassName: undefined,\n disableRipple: false,\n closeOnSelect: true,\n 'data-testid': 'generic_emojiButton',\n tooltipProps: { title: 'Add Emoji' },\n icon: undefined,\n};\n\nexport default EmojiIconButton;\n"],"names":["EmojiIconButton","_PureComponent","_inherits","_super","_createSuper","props","_this","_classCallCheck","this","call","_defineProperty","_assertThisInitialized","emoji","_this$props","handleSelectEmoji","closeOnSelect","setState","openEmojiPicker","state","_createClass","key","value","_this2","_jsxs","_Fragment","children","_jsx","IconButton","buttonRef","node","anchorEl","onClick","disableRipple","className","emojiIconClassName","tooltipProps","icon","EmojiIcon","Popover","open","onClose","anchorOrigin","vertical","horizontal","transformOrigin","Picker","onSelect","theme","PureComponent","propTypes","PropTypes","func","isRequired","string","bool","shape","defaultProps","undefined","title"],"mappings":"upCAQA,IACMA,EAAe,SAAAC,GAAAC,UAAAF,EAAAC,GAAA,IAAAE,EAAAC,EAAAJ,GACnB,SAAAA,EAAYK,GAAO,IAAAC,EAKf,OALeC,UAAAC,KAAAR,GACjBM,EAAAH,EAAAM,KAAAD,KAAMH,GAAOK,EAAAA,QAOJC,EAAAA,QAAAL,GAAA,YAAA,SAAAM,GACT,IAAAC,EAA6CP,EAAKD,MAA1CS,IAAAA,kBAAmBC,IAAAA,cAC3BD,EAAkBF,GACdG,GACFT,EAAKU,SAAS,CAAEC,iBAAiB,OATnCX,EAAKY,MAAQ,CACXD,iBAAiB,GACjBX,CACJ,CA4CC,OA5CAa,EAAA,QAAAnB,EAAA,CAAA,CAAAoB,IAAA,SAAAC,MAUD,WAAS,IAAAC,EAAAd,KACP,OACEe,EAAAA,KAAAC,EAAAA,SAAA,CAAAC,SAAA,CACEC,MAACC,EAAU,CACT,cAAanB,KAAKH,MAAM,eACxBuB,UAAW,SAAAC,GACTP,EAAKQ,SAAWD,CAChB,EACF,aAAW,QACXE,QAAS,WAAA,OAAMT,EAAKN,SAAS,CAAEC,iBAAiB,GAAQ,EACxDe,cAAexB,KAAKH,MAAM2B,cAC1BC,UAAWzB,KAAKH,MAAM6B,mBACtBC,aAAc3B,KAAKH,MAAM8B,aAAaV,SAErCjB,KAAKH,MAAM+B,MAAQV,MAACW,EAAS,MAGhCX,MAACY,UAAO,CACNC,KAAM/B,KAAKU,MAAMD,gBACjBa,SAAUtB,KAAKsB,SACfU,QAAS,WAAA,OAAMlB,EAAKN,SAAS,CAAEC,iBAAiB,GAAS,EACzDwB,aAAc,CACZC,SAAU,SACVC,WAAY,SAEdC,gBAAiB,CACfF,SAAU,MACVC,WAAY,SACZlB,SAEFC,MAACmB,SAAM,CAACC,SAAUtC,KAAKsC,SAAUC,MAAM,aAI/C,KAAC/C,CAAA,CAnDkB,CAASgD,iBAsD9BhD,EAAgBiD,UAAY,CAC1BnC,kBAAmBoC,EAAAA,QAAUC,KAAKC,WAClClB,mBAAoBgB,EAAS,QAACG,OAC9BrB,cAAekB,EAAS,QAACI,KACzBvC,cAAemC,EAAS,QAACI,KACzB,cAAeJ,EAAS,QAACG,OACzBlB,aAAce,EAAAA,QAAUK,MAAM,IAC9BnB,KAAMc,EAAS,QAACrB,MAGlB7B,EAAgBwD,aAAe,CAC7BtB,wBAAoBuB,EACpBzB,eAAe,EACfjB,eAAe,EACf,cAAe,sBACfoB,aAAc,CAAEuB,MAAO,aACvBtB,UAAMqB"}
1
+ {"version":3,"file":"EmojiIconButton.js","sources":["../../../src/components/EmojiIconButton.js"],"sourcesContent":["import { memo, useRef, useState } from 'react';\nimport { Picker } from 'emoji-mart';\nimport PropTypes from 'prop-types';\nimport Popover from '@material-ui/core/Popover';\n\nimport IconButton from '~components/IconButton';\nimport EmojiIcon from '~components/Icons/EmojiIcon';\n\nconst defaultTooltipProps = { title: 'Add Emoji' };\n\n/** @param {any} props Preserve the legacy component's permissive public prop type. */\nfunction EmojiIconButton({\n handleSelectEmoji,\n emojiIconClassName = undefined,\n disableRipple = false,\n closeOnSelect = true,\n 'data-testid': testId = 'generic_emojiButton',\n tooltipProps = defaultTooltipProps,\n icon = undefined,\n}) {\n const [openEmojiPicker, setOpenEmojiPicker] = useState(false);\n const anchorEl = useRef(null);\n\n const onSelect = emoji => {\n handleSelectEmoji(emoji);\n if (closeOnSelect) {\n setOpenEmojiPicker(false);\n }\n };\n\n return (\n <>\n <IconButton\n data-testid={testId}\n buttonRef={node => {\n anchorEl.current = node;\n }}\n aria-label=\"Emoji\"\n onClick={() => setOpenEmojiPicker(true)}\n disableRipple={disableRipple}\n className={emojiIconClassName}\n tooltipProps={tooltipProps}\n >\n {icon || <EmojiIcon />}\n </IconButton>\n\n <Popover\n open={openEmojiPicker}\n anchorEl={anchorEl.current}\n onClose={() => setOpenEmojiPicker(false)}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'right',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'right',\n }}\n >\n <Picker onSelect={onSelect} theme=\"dark\" />\n </Popover>\n </>\n );\n}\n\nEmojiIconButton.propTypes = {\n handleSelectEmoji: PropTypes.func.isRequired,\n emojiIconClassName: PropTypes.string,\n disableRipple: PropTypes.bool,\n closeOnSelect: PropTypes.bool,\n 'data-testid': PropTypes.string,\n tooltipProps: PropTypes.shape({}),\n icon: PropTypes.node,\n};\n\nexport default memo(EmojiIconButton);\n"],"names":["defaultTooltipProps","title","EmojiIconButton","_ref","handleSelectEmoji","_ref$emojiIconClassNa","emojiIconClassName","undefined","_ref$disableRipple","disableRipple","_ref$closeOnSelect","closeOnSelect","_ref$dataTestid","testId","_ref$tooltipProps","tooltipProps","_ref$icon","icon","useState","_useState2","_slicedToArray","_useState","openEmojiPicker","setOpenEmojiPicker","anchorEl","useRef","_jsxs","_Fragment","children","_jsx","IconButton","buttonRef","node","current","onClick","className","EmojiIcon","Popover","open","onClose","anchorOrigin","vertical","horizontal","transformOrigin","Picker","onSelect","emoji","theme","propTypes","PropTypes","func","isRequired","string","bool","shape","memo"],"mappings":"kXAQMA,EAAsB,CAAEC,MAAO,aAGrC,SAASC,EAQNC,GAAA,IAPDC,IAAAA,kBAAiBC,EAAAF,EACjBG,mBAAAA,kBAAqBC,EAASF,EAAAG,EAAAL,EAC9BM,cAAAA,cAAqBD,EAAAE,EAAAP,EACrBQ,cAAAA,cAAoBD,EAAAE,EAAAT,EACpB,eAAeU,aAAS,sBAAqBD,EAAAE,EAAAX,EAC7CY,aAAAA,aAAef,EAAmBc,EAAAE,EAAAb,EAClCc,KAAAA,kBAAOV,EAASS,EAE8BE,EAAAA,EAAQA,UAAC,GAAMC,EAAAC,EAAAA,QAAAC,EAAA,GAAtDC,EAAeH,EAAA,GAAEI,EAAkBJ,EAAA,GACpCK,EAAWC,SAAO,MASxB,OACEC,EAAAA,KAAAC,EAAAA,SAAA,CAAAC,SAAA,CACEC,MAACC,EAAU,CACT,cAAajB,EACbkB,UAAW,SAAAC,GACTR,EAASS,QAAUD,CACnB,EACF,aAAW,QACXE,QAAS,WAAA,OAAMX,GAAmB,EAAM,EACxCd,cAAeA,EACf0B,UAAW7B,EACXS,aAAcA,EAAaa,SAE1BX,GAAQY,MAACO,EAAS,CAAA,KAGrBP,MAACQ,UAAO,CACNC,KAAMhB,EACNE,SAAUA,EAASS,QACnBM,QAAS,WAAA,OAAMhB,GAAmB,EAAO,EACzCiB,aAAc,CACZC,SAAU,SACVC,WAAY,SAEdC,gBAAiB,CACfF,SAAU,MACVC,WAAY,SACZd,SAEFC,MAACe,SAAM,CAACC,SApCG,SAAAC,GACf1C,EAAkB0C,GACdnC,GACFY,GAAmB,IAiCWwB,MAAM,aAI1C,CAEA7C,EAAgB8C,UAAY,CAC1B5C,kBAAmB6C,EAAAA,QAAUC,KAAKC,WAClC7C,mBAAoB2C,EAAS,QAACG,OAC9B3C,cAAewC,EAAS,QAACI,KACzB1C,cAAesC,EAAS,QAACI,KACzB,cAAeJ,EAAS,QAACG,OACzBrC,aAAckC,EAAAA,QAAUK,MAAM,IAC9BrC,KAAMgC,EAAS,QAACjB,MAGlB,IAAeuB,EAAAA,EAAAA,KAAKrD"}
@@ -1,5 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
- declare const _default: import("react").ComponentType<Pick<Pick<PropTypes.InferProps<{
2
+ declare const _default: import("react").ComponentType<Pick<Pick<PropTypes.InferPropsInner<Pick<{
3
3
  open: PropTypes.Validator<boolean>;
4
4
  title: PropTypes.Requireable<string>;
5
5
  text: PropTypes.Validator<string>;
@@ -11,7 +11,7 @@ declare const _default: import("react").ComponentType<Pick<Pick<PropTypes.InferP
11
11
  disableOk: PropTypes.Requireable<boolean>;
12
12
  isShowCancel: PropTypes.Requireable<boolean>;
13
13
  classes: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
14
- }>, PropTypes.RequiredKeys<{
14
+ }, PropTypes.RequiredKeys<{
15
15
  open: PropTypes.Validator<boolean>;
16
16
  title: PropTypes.Requireable<string>;
17
17
  text: PropTypes.Validator<string>;
@@ -23,15 +23,78 @@ declare const _default: import("react").ComponentType<Pick<Pick<PropTypes.InferP
23
23
  disableOk: PropTypes.Requireable<boolean>;
24
24
  isShowCancel: PropTypes.Requireable<boolean>;
25
25
  classes: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
26
- }>> & {
27
- title?: string | null | undefined;
28
- confirmationText?: string | null | undefined;
29
- confirmation?: string | null | undefined;
30
- handleClose?: ((...args: any[]) => any) | null | undefined;
31
- handleOk?: ((...args: any[]) => any) | null | undefined;
32
- okText?: string | null | undefined;
33
- disableOk?: boolean | null | undefined;
34
- isShowCancel?: boolean | null | undefined;
35
- } & {}, "confirmation" | "confirmationText" | "disableOk" | "handleClose" | "handleOk" | "isShowCancel" | "okText" | "open" | "text" | "title"> & import("@material-ui/styles").StyledComponentProps<"actionButton" | "confirmation">>;
26
+ }>>> & Partial<PropTypes.InferPropsInner<Pick<{
27
+ open: PropTypes.Validator<boolean>;
28
+ title: PropTypes.Requireable<string>;
29
+ text: PropTypes.Validator<string>;
30
+ confirmationText: PropTypes.Requireable<string>;
31
+ confirmation: PropTypes.Requireable<string>;
32
+ handleClose: PropTypes.Requireable<(...args: any[]) => any>;
33
+ handleOk: PropTypes.Requireable<(...args: any[]) => any>;
34
+ okText: PropTypes.Requireable<string>;
35
+ disableOk: PropTypes.Requireable<boolean>;
36
+ isShowCancel: PropTypes.Requireable<boolean>;
37
+ classes: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
38
+ }, "confirmation" | "confirmationText" | "disableOk" | "handleClose" | "handleOk" | "isShowCancel" | "okText" | "title">>>, "confirmation" | "confirmationText" | "disableOk" | "handleClose" | "handleOk" | "isShowCancel" | "okText" | "title" | PropTypes.RequiredKeys<{
39
+ open: PropTypes.Validator<boolean>;
40
+ title: PropTypes.Requireable<string>;
41
+ text: PropTypes.Validator<string>;
42
+ confirmationText: PropTypes.Requireable<string>;
43
+ confirmation: PropTypes.Requireable<string>;
44
+ handleClose: PropTypes.Requireable<(...args: any[]) => any>;
45
+ handleOk: PropTypes.Requireable<(...args: any[]) => any>;
46
+ okText: PropTypes.Requireable<string>;
47
+ disableOk: PropTypes.Requireable<boolean>;
48
+ isShowCancel: PropTypes.Requireable<boolean>;
49
+ classes: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
50
+ }>> & Pick<PropTypes.InferProps<{
51
+ open: PropTypes.Validator<boolean>;
52
+ title: PropTypes.Requireable<string>;
53
+ text: PropTypes.Validator<string>;
54
+ confirmationText: PropTypes.Requireable<string>;
55
+ confirmation: PropTypes.Requireable<string>;
56
+ handleClose: PropTypes.Requireable<(...args: any[]) => any>;
57
+ handleOk: PropTypes.Requireable<(...args: any[]) => any>;
58
+ okText: PropTypes.Requireable<string>;
59
+ disableOk: PropTypes.Requireable<boolean>;
60
+ isShowCancel: PropTypes.Requireable<boolean>;
61
+ classes: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
62
+ }>, never> & Pick<PropTypes.InferPropsInner<Pick<{
63
+ open: PropTypes.Validator<boolean>;
64
+ title: PropTypes.Requireable<string>;
65
+ text: PropTypes.Validator<string>;
66
+ confirmationText: PropTypes.Requireable<string>;
67
+ confirmation: PropTypes.Requireable<string>;
68
+ handleClose: PropTypes.Requireable<(...args: any[]) => any>;
69
+ handleOk: PropTypes.Requireable<(...args: any[]) => any>;
70
+ okText: PropTypes.Requireable<string>;
71
+ disableOk: PropTypes.Requireable<boolean>;
72
+ isShowCancel: PropTypes.Requireable<boolean>;
73
+ classes: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
74
+ }, PropTypes.RequiredKeys<{
75
+ open: PropTypes.Validator<boolean>;
76
+ title: PropTypes.Requireable<string>;
77
+ text: PropTypes.Validator<string>;
78
+ confirmationText: PropTypes.Requireable<string>;
79
+ confirmation: PropTypes.Requireable<string>;
80
+ handleClose: PropTypes.Requireable<(...args: any[]) => any>;
81
+ handleOk: PropTypes.Requireable<(...args: any[]) => any>;
82
+ okText: PropTypes.Requireable<string>;
83
+ disableOk: PropTypes.Requireable<boolean>;
84
+ isShowCancel: PropTypes.Requireable<boolean>;
85
+ classes: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
86
+ }>>> & Partial<PropTypes.InferPropsInner<Pick<{
87
+ open: PropTypes.Validator<boolean>;
88
+ title: PropTypes.Requireable<string>;
89
+ text: PropTypes.Validator<string>;
90
+ confirmationText: PropTypes.Requireable<string>;
91
+ confirmation: PropTypes.Requireable<string>;
92
+ handleClose: PropTypes.Requireable<(...args: any[]) => any>;
93
+ handleOk: PropTypes.Requireable<(...args: any[]) => any>;
94
+ okText: PropTypes.Requireable<string>;
95
+ disableOk: PropTypes.Requireable<boolean>;
96
+ isShowCancel: PropTypes.Requireable<boolean>;
97
+ classes: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
98
+ }, "confirmation" | "confirmationText" | "disableOk" | "handleClose" | "handleOk" | "isShowCancel" | "okText" | "title">>>, never>, "confirmation" | "confirmationText" | "disableOk" | "handleClose" | "handleOk" | "isShowCancel" | "okText" | "open" | "text" | "title"> & import("@material-ui/styles").StyledComponentProps<"actionButton" | "confirmation">>;
36
99
  export default _default;
37
100
  //# sourceMappingURL=ConfirmationDialog.d.ts.map
@@ -1,2 +1,2 @@
1
- import t from"@babel/runtime/helpers/classCallCheck";import e from"@babel/runtime/helpers/createClass";import i from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import r from"@babel/runtime/helpers/getPrototypeOf";import{Component as n}from"react";import a from"prop-types";import{withStyles as s}from"@material-ui/core/styles";import l from"@material-ui/core/Typography";import c from"@material-ui/core/TextField";import p from"@material-ui/core/DialogTitle";import m from"@material-ui/core/DialogContent";import f from"@material-ui/core/DialogContentText";import u from"@material-ui/core/DialogActions";import h from"@material-ui/core/Button";import d from"@material-ui/core/Dialog";import{jsxs as b,Fragment as g,jsx as x}from"react/jsx-runtime";function y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=r(t);if(e){var a=r(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return o(this,i)}}var C="confirmationDialog",T=function(o){i(a,n);var r=y(a);function a(e){var i;return t(this,a),(i=r.call(this,e)).state={confirmationTextField:""},i}return e(a,[{key:"actions",get:function(){return b(g,{children:[this.props.isShowCancel&&x(h,{variant:"text","data-testid":"".concat(C,"_cancelButton"),className:this.props.classes.actionButton,onClick:this.props.handleClose,color:"primary",children:"Cancel"}),x(h,{variant:"contained","data-testid":"".concat(C,"_confirmButton"),className:this.props.classes.actionButton,onClick:this.props.handleOk,disabled:this.props.disableOk||this.props.confirmationText&&this.props.confirmation!==this.state.confirmationTextField,color:"primary",children:this.props.okText})]})}},{key:"render",value:function(){var t=this;return b(d,{open:this.props.open,onClose:this.props.handleClose,"aria-labelledby":"confirmation-dialog-title",classes:{paper:this.props.classes.paper},children:[x(p,{id:"confirmation-dialog-title",children:this.props.title}),x(m,{children:b(f,{children:[x(l,{variant:"body2",className:this.props.classes.content,children:this.props.text}),this.props.confirmationText&&x(c,{fullWidth:!0,"data-testid":"".concat(C,"_input"),label:this.props.confirmationText,value:this.state.confirmationTextField,onChange:function(e){return t.setState({confirmationTextField:e.target.value})},className:this.props.classes.confirmation})]})}),x(u,{className:this.props.classes.actions,children:this.actions})]})}}]),a}();T.propTypes={open:a.bool.isRequired,title:a.string,text:a.string.isRequired,confirmationText:a.string,confirmation:a.string,handleClose:a.func,handleOk:a.func,okText:a.string,disableOk:a.bool,isShowCancel:a.bool,classes:a.shape({}).isRequired},T.defaultProps={title:void 0,confirmationText:null,confirmation:"",okText:"Ok",handleOk:function(){},handleClose:function(){},disableOk:!1,isShowCancel:!0};var v=s({actionButton:{marginLeft:15},confirmation:{marginTop:10}})(T);export{v as default};
1
+ import i from"@babel/runtime/helpers/slicedToArray";import{useState as o}from"react";import t from"prop-types";import{withStyles as e}from"@material-ui/core/styles";import a from"@material-ui/core/Typography";import r from"@material-ui/core/TextField";import n from"@material-ui/core/DialogTitle";import l from"@material-ui/core/DialogContent";import c from"@material-ui/core/DialogContentText";import m from"@material-ui/core/DialogActions";import s from"@material-ui/core/Button";import d from"@material-ui/core/Dialog";import{jsxs as p,Fragment as u,jsx as f}from"react/jsx-runtime";var h="confirmationDialog",g=function(){};function v(t){var e=t.open,v=t.title,b=void 0===v?void 0:v,x=t.text,C=t.confirmationText,T=void 0===C?null:C,y=t.confirmation,k=void 0===y?"":y,B=t.handleClose,D=void 0===B?g:B,N=t.handleOk,O=void 0===N?g:N,q=t.okText,R=void 0===q?"Ok":q,_=t.disableOk,w=void 0!==_&&_,A=t.isShowCancel,S=void 0===A||A,j=t.classes,F=o(""),L=i(F,2),W=L[0],z=L[1],E=p(u,{children:[S&&f(s,{variant:"text","data-testid":"".concat(h,"_cancelButton"),className:j.actionButton,onClick:D,color:"primary",children:"Cancel"}),f(s,{variant:"contained","data-testid":"".concat(h,"_confirmButton"),className:j.actionButton,onClick:O,disabled:w||T&&k!==W,color:"primary",children:R})]});return p(d,{open:e,onClose:D,"aria-labelledby":"confirmation-dialog-title",classes:{paper:j.paper},children:[f(n,{id:"confirmation-dialog-title",children:b}),f(l,{children:p(c,{children:[f(a,{variant:"body2",className:j.content,children:x}),T&&f(r,{fullWidth:!0,"data-testid":"".concat(h,"_input"),label:T,value:W,onChange:function(i){return z(i.target.value)},className:j.confirmation})]})}),f(m,{className:j.actions,children:E})]})}v.propTypes={open:t.bool.isRequired,title:t.string,text:t.string.isRequired,confirmationText:t.string,confirmation:t.string,handleClose:t.func,handleOk:t.func,okText:t.string,disableOk:t.bool,isShowCancel:t.bool,classes:t.shape({}).isRequired};var b=e({actionButton:{marginLeft:15},confirmation:{marginTop:10}})(v);export{b as default};
2
2
  //# sourceMappingURL=ConfirmationDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmationDialog.js","sources":["../../src/components/ConfirmationDialog.js"],"sourcesContent":["import { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport TextField from '@material-ui/core/TextField';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\n\nconst PAGE_NAME = 'confirmationDialog';\n\nconst muiStyles = {\n actionButton: { marginLeft: 15 },\n confirmation: { marginTop: 10 },\n};\n\nclass ConfirmationDialog extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n confirmationTextField: '',\n };\n }\n\n get actions() {\n return (\n <>\n {this.props.isShowCancel && (\n <Button\n variant=\"text\"\n data-testid={`${PAGE_NAME}_cancelButton`}\n className={this.props.classes.actionButton}\n onClick={this.props.handleClose}\n color=\"primary\"\n >\n Cancel\n </Button>\n )}\n <Button\n variant=\"contained\"\n data-testid={`${PAGE_NAME}_confirmButton`}\n className={this.props.classes.actionButton}\n onClick={this.props.handleOk}\n disabled={\n this.props.disableOk ||\n (this.props.confirmationText &&\n this.props.confirmation !== this.state.confirmationTextField)\n }\n color=\"primary\"\n >\n {this.props.okText}\n </Button>\n </>\n );\n }\n\n render() {\n return (\n <Dialog\n open={this.props.open}\n onClose={this.props.handleClose}\n aria-labelledby=\"confirmation-dialog-title\"\n classes={{ paper: this.props.classes.paper }}\n >\n <DialogTitle id=\"confirmation-dialog-title\">{this.props.title}</DialogTitle>\n\n <DialogContent>\n <DialogContentText>\n <Typography variant=\"body2\" className={this.props.classes.content}>\n {this.props.text}\n </Typography>\n {this.props.confirmationText && (\n <TextField\n fullWidth\n data-testid={`${PAGE_NAME}_input`}\n label={this.props.confirmationText}\n value={this.state.confirmationTextField}\n onChange={e => this.setState({ confirmationTextField: e.target.value })}\n className={this.props.classes.confirmation}\n />\n )}\n </DialogContentText>\n </DialogContent>\n <DialogActions className={this.props.classes.actions}>{this.actions}</DialogActions>\n </Dialog>\n );\n }\n}\n\nConfirmationDialog.propTypes = {\n open: PropTypes.bool.isRequired,\n title: PropTypes.string,\n text: PropTypes.string.isRequired,\n confirmationText: PropTypes.string,\n confirmation: PropTypes.string,\n handleClose: PropTypes.func,\n handleOk: PropTypes.func,\n okText: PropTypes.string,\n disableOk: PropTypes.bool,\n isShowCancel: PropTypes.bool,\n\n classes: PropTypes.shape({}).isRequired,\n};\n\nConfirmationDialog.defaultProps = {\n title: undefined,\n confirmationText: null,\n confirmation: '',\n okText: 'Ok',\n handleOk: () => undefined,\n handleClose: () => undefined,\n disableOk: false,\n isShowCancel: true,\n};\n\nexport default withStyles(muiStyles)(ConfirmationDialog);\n"],"names":["PAGE_NAME","ConfirmationDialog","_Component","_inherits","Component","_super","_createSuper","props","_this","_classCallCheck","this","call","state","confirmationTextField","_createClass","key","get","_jsxs","_Fragment","children","isShowCancel","_jsx","Button","variant","concat","className","classes","actionButton","onClick","handleClose","color","handleOk","disabled","disableOk","confirmationText","confirmation","okText","value","_this2","Dialog","open","onClose","paper","DialogTitle","id","title","DialogContent","DialogContentText","Typography","content","text","TextField","fullWidth","label","onChange","e","setState","target","DialogActions","actions","propTypes","PropTypes","bool","isRequired","string","func","shape","defaultProps","undefined","ConfirmationDialogJs","withStyles","marginLeft","marginTop"],"mappings":"ysCAYA,IAAMA,EAAY,qBAOZC,EAAkB,SAAAC,GAAAC,EAAAF,EAASG,GAAT,IAAAC,EAAAC,EAAAL,GACtB,SAAAA,EAAYM,GAAO,IAAAC,EAKf,OALeC,EAAAC,KAAAT,IACjBO,EAAAH,EAAAM,KAAAD,KAAMH,IAEDK,MAAQ,CACXC,sBAAuB,IACvBL,CACJ,CAgEC,OAhEAM,EAAAb,EAAA,CAAA,CAAAc,IAAA,UAAAC,IAED,WACE,OACEC,EAAAC,EAAA,CAAAC,SAAA,CACGT,KAAKH,MAAMa,cACVC,EAACC,EAAM,CACLC,QAAQ,OACR,cAAA,GAAAC,OAAgBxB,EAAyB,iBACzCyB,UAAWf,KAAKH,MAAMmB,QAAQC,aAC9BC,QAASlB,KAAKH,MAAMsB,YACpBC,MAAM,UAASX,SAAA,WAKnBE,EAACC,EAAM,CACLC,QAAQ,YACR,cAAA,GAAAC,OAAgBxB,EAA0B,kBAC1CyB,UAAWf,KAAKH,MAAMmB,QAAQC,aAC9BC,QAASlB,KAAKH,MAAMwB,SACpBC,SACEtB,KAAKH,MAAM0B,WACVvB,KAAKH,MAAM2B,kBACVxB,KAAKH,MAAM4B,eAAiBzB,KAAKE,MAAMC,sBAE3CiB,MAAM,UAASX,SAEdT,KAAKH,MAAM6B,WAIpB,GAAC,CAAArB,IAAA,SAAAsB,MAED,WAAS,IAAAC,EAAA5B,KACP,OACEO,EAACsB,EAAM,CACLC,KAAM9B,KAAKH,MAAMiC,KACjBC,QAAS/B,KAAKH,MAAMsB,YACpB,kBAAgB,4BAChBH,QAAS,CAAEgB,MAAOhC,KAAKH,MAAMmB,QAAQgB,OAAQvB,SAAA,CAE7CE,EAACsB,EAAW,CAACC,GAAG,4BAA2BzB,SAAET,KAAKH,MAAMsC,QAExDxB,EAACyB,EAAa,CAAA3B,SACZF,EAAC8B,EAAiB,CAAA5B,SAAA,CAChBE,EAAC2B,EAAU,CAACzB,QAAQ,QAAQE,UAAWf,KAAKH,MAAMmB,QAAQuB,QAAQ9B,SAC/DT,KAAKH,MAAM2C,OAEbxC,KAAKH,MAAM2B,kBACVb,EAAC8B,EAAS,CACRC,WAAS,EACT,cAAA,GAAA5B,OAAgBxB,EAAkB,UAClCqD,MAAO3C,KAAKH,MAAM2B,iBAClBG,MAAO3B,KAAKE,MAAMC,sBAClByC,SAAU,SAAAC,GAAC,OAAIjB,EAAKkB,SAAS,CAAE3C,sBAAuB0C,EAAEE,OAAOpB,OAAS,EACxEZ,UAAWf,KAAKH,MAAMmB,QAAQS,oBAKtCd,EAACqC,EAAa,CAACjC,UAAWf,KAAKH,MAAMmB,QAAQiC,QAAQxC,SAAET,KAAKiD,YAGlE,KAAC1D,CAAA,CAvEqB,GA0ExBA,EAAmB2D,UAAY,CAC7BpB,KAAMqB,EAAUC,KAAKC,WACrBlB,MAAOgB,EAAUG,OACjBd,KAAMW,EAAUG,OAAOD,WACvB7B,iBAAkB2B,EAAUG,OAC5B7B,aAAc0B,EAAUG,OACxBnC,YAAagC,EAAUI,KACvBlC,SAAU8B,EAAUI,KACpB7B,OAAQyB,EAAUG,OAClB/B,UAAW4B,EAAUC,KACrB1C,aAAcyC,EAAUC,KAExBpC,QAASmC,EAAUK,MAAM,CAAA,GAAIH,YAG/B9D,EAAmBkE,aAAe,CAChCtB,WAAOuB,EACPlC,iBAAkB,KAClBC,aAAc,GACdC,OAAQ,KACRL,SAAU,WAAe,EACzBF,YAAa,WAAe,EAC5BI,WAAW,EACXb,cAAc,GAGhB,IAAAiD,EAAeC,EAzGG,CAChB3C,aAAc,CAAE4C,WAAY,IAC5BpC,aAAc,CAAEqC,UAAW,KAuGdF,CAAsBrE"}
1
+ {"version":3,"file":"ConfirmationDialog.js","sources":["../../src/components/ConfirmationDialog.js"],"sourcesContent":["import { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport TextField from '@material-ui/core/TextField';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\n\nconst PAGE_NAME = 'confirmationDialog';\n\nconst muiStyles = {\n actionButton: { marginLeft: 15 },\n confirmation: { marginTop: 10 },\n};\n\nconst noop = () => undefined;\n\n/** @param {PropTypes.InferProps<typeof ConfirmationDialog.propTypes>} props */\nfunction ConfirmationDialog({\n open,\n title = undefined,\n text,\n confirmationText = null,\n confirmation = '',\n handleClose = noop,\n handleOk = noop,\n okText = 'Ok',\n disableOk = false,\n isShowCancel = true,\n classes,\n}) {\n const [confirmationTextField, setConfirmationTextField] = useState('');\n\n const actions = (\n <>\n {isShowCancel && (\n <Button\n variant=\"text\"\n data-testid={`${PAGE_NAME}_cancelButton`}\n className={classes.actionButton}\n onClick={handleClose}\n color=\"primary\"\n >\n Cancel\n </Button>\n )}\n <Button\n variant=\"contained\"\n data-testid={`${PAGE_NAME}_confirmButton`}\n className={classes.actionButton}\n onClick={handleOk}\n disabled={disableOk || (confirmationText && confirmation !== confirmationTextField)}\n color=\"primary\"\n >\n {okText}\n </Button>\n </>\n );\n return (\n <Dialog\n open={open}\n onClose={handleClose}\n aria-labelledby=\"confirmation-dialog-title\"\n classes={{ paper: classes.paper }}\n >\n <DialogTitle id=\"confirmation-dialog-title\">{title}</DialogTitle>\n\n <DialogContent>\n <DialogContentText>\n <Typography variant=\"body2\" className={classes.content}>\n {text}\n </Typography>\n {confirmationText && (\n <TextField\n fullWidth\n data-testid={`${PAGE_NAME}_input`}\n label={confirmationText}\n value={confirmationTextField}\n onChange={e => setConfirmationTextField(e.target.value)}\n className={classes.confirmation}\n />\n )}\n </DialogContentText>\n </DialogContent>\n <DialogActions className={classes.actions}>{actions}</DialogActions>\n </Dialog>\n );\n}\n\nConfirmationDialog.propTypes = {\n open: PropTypes.bool.isRequired,\n title: PropTypes.string,\n text: PropTypes.string.isRequired,\n confirmationText: PropTypes.string,\n confirmation: PropTypes.string,\n handleClose: PropTypes.func,\n handleOk: PropTypes.func,\n okText: PropTypes.string,\n disableOk: PropTypes.bool,\n isShowCancel: PropTypes.bool,\n\n classes: PropTypes.shape({}).isRequired,\n};\n\nexport default withStyles(muiStyles)(ConfirmationDialog);\n"],"names":["PAGE_NAME","noop","ConfirmationDialog","_ref","open","_ref$title","title","undefined","text","_ref$confirmationText","confirmationText","_ref$confirmation","confirmation","_ref$handleClose","handleClose","_ref$handleOk","handleOk","_ref$okText","okText","_ref$disableOk","disableOk","_ref$isShowCancel","isShowCancel","classes","useState","_useState2","_slicedToArray","_useState","confirmationTextField","setConfirmationTextField","actions","_jsxs","_Fragment","children","_jsx","Button","variant","concat","className","actionButton","onClick","color","disabled","Dialog","onClose","paper","DialogTitle","id","DialogContent","DialogContentText","Typography","content","TextField","fullWidth","label","value","onChange","e","target","DialogActions","propTypes","PropTypes","bool","isRequired","string","func","shape","ConfirmationDialogJs","withStyles","marginLeft","marginTop"],"mappings":"0kBAYA,IAAMA,EAAY,qBAOZC,EAAO,WAAe,EAG5B,SAASC,EAYNC,GAAA,IAXDC,IAAAA,KAAIC,EAAAF,EACJG,MAAAA,kBAAQC,EAASF,EACjBG,IAAAA,KAAIC,EAAAN,EACJO,iBAAAA,aAAmB,KAAID,EAAAE,EAAAR,EACvBS,aAAAA,aAAe,GAAED,EAAAE,EAAAV,EACjBW,YAAAA,aAAcb,EAAIY,EAAAE,EAAAZ,EAClBa,SAAAA,aAAWf,EAAIc,EAAAE,EAAAd,EACfe,OAAAA,aAAS,KAAID,EAAAE,EAAAhB,EACbiB,UAAAA,cAAiBD,EAAAE,EAAAlB,EACjBmB,aAAAA,cAAmBD,EACnBE,IAAAA,QAE0DC,EAAAA,EAAS,IAAGC,EAAAC,EAAAC,EAAA,GAA/DC,EAAqBH,EAAA,GAAEI,EAAwBJ,EAAA,GAEhDK,EACJC,EAAAC,EAAA,CAAAC,SACGX,CAAAA,GACCY,EAACC,EAAM,CACLC,QAAQ,OACR,cAAA,GAAAC,OAAgBrC,EAAyB,iBACzCsC,UAAWf,EAAQgB,aACnBC,QAAS1B,EACT2B,MAAM,UAASR,SAAA,WAKnBC,EAACC,EAAM,CACLC,QAAQ,YACR,cAAA,GAAAC,OAAgBrC,EAA0B,kBAC1CsC,UAAWf,EAAQgB,aACnBC,QAASxB,EACT0B,SAAUtB,GAAcV,GAAoBE,IAAiBgB,EAC7Da,MAAM,UAASR,SAEdf,OAIP,OACEa,EAACY,EAAM,CACLvC,KAAMA,EACNwC,QAAS9B,EACT,kBAAgB,4BAChBS,QAAS,CAAEsB,MAAOtB,EAAQsB,OAAQZ,SAAA,CAElCC,EAACY,EAAW,CAACC,GAAG,4BAA2Bd,SAAE3B,IAE7C4B,EAACc,EAAa,CAAAf,SACZF,EAACkB,EAAiB,CAAAhB,SAAA,CAChBC,EAACgB,EAAU,CAACd,QAAQ,QAAQE,UAAWf,EAAQ4B,QAAQlB,SACpDzB,IAEFE,GACCwB,EAACkB,EAAS,CACRC,WAAS,EACT,cAAA,GAAAhB,OAAgBrC,EAAkB,UAClCsD,MAAO5C,EACP6C,MAAO3B,EACP4B,SAAU,SAAAC,GAAC,OAAI5B,EAAyB4B,EAAEC,OAAOH,MAAO,EACxDjB,UAAWf,EAAQX,oBAK3BsB,EAACyB,EAAa,CAACrB,UAAWf,EAAQO,QAAQG,SAAEH,MAGlD,CAEA5B,EAAmB0D,UAAY,CAC7BxD,KAAMyD,EAAUC,KAAKC,WACrBzD,MAAOuD,EAAUG,OACjBxD,KAAMqD,EAAUG,OAAOD,WACvBrD,iBAAkBmD,EAAUG,OAC5BpD,aAAciD,EAAUG,OACxBlD,YAAa+C,EAAUI,KACvBjD,SAAU6C,EAAUI,KACpB/C,OAAQ2C,EAAUG,OAClB5C,UAAWyC,EAAUC,KACrBxC,aAAcuC,EAAUC,KAExBvC,QAASsC,EAAUK,MAAM,CAAA,GAAIH,YAG/B,IAAAI,EAAeC,EA9FG,CAChB7B,aAAc,CAAE8B,WAAY,IAC5BzD,aAAc,CAAE0D,UAAW,KA4FdF,CAAsBlE"}
@@ -1,35 +1,5 @@
1
- import { PureComponent } from 'react';
2
- import PropTypes from 'prop-types';
3
- /** @extends {PureComponent<any, any, any>} */
4
- declare class EmojiIconButton extends PureComponent<any, any, any> {
5
- state: {
6
- openEmojiPicker: boolean;
7
- };
8
- anchorEl: any;
9
- constructor(props: any);
10
- onSelect: (emoji: any) => void;
11
- render(): import("react").JSX.Element;
12
- }
13
- declare namespace EmojiIconButton {
14
- var propTypes: {
15
- handleSelectEmoji: PropTypes.Validator<(...args: any[]) => any>;
16
- emojiIconClassName: PropTypes.Requireable<string>;
17
- disableRipple: PropTypes.Requireable<boolean>;
18
- closeOnSelect: PropTypes.Requireable<boolean>;
19
- 'data-testid': PropTypes.Requireable<string>;
20
- tooltipProps: PropTypes.Requireable<PropTypes.InferProps<{}>>;
21
- icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
22
- };
23
- var defaultProps: {
24
- emojiIconClassName: undefined;
25
- disableRipple: boolean;
26
- closeOnSelect: boolean;
27
- 'data-testid': string;
28
- tooltipProps: {
29
- title: string;
30
- };
31
- icon: undefined;
32
- };
33
- }
34
- export default EmojiIconButton;
1
+ /** @param {any} props Preserve the legacy component's permissive public prop type. */
2
+ declare function EmojiIconButton({ handleSelectEmoji, emojiIconClassName, disableRipple, closeOnSelect, 'data-testid': testId, tooltipProps, icon, }: any): import("react").JSX.Element;
3
+ declare const _default: import("react").MemoExoticComponent<typeof EmojiIconButton>;
4
+ export default _default;
35
5
  //# sourceMappingURL=EmojiIconButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmojiIconButton.d.ts","sourceRoot":"","sources":["../../src/components/EmojiIconButton.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,SAAS,MAAM,YAAY,CAAC;AAMnC,8CAA8C;AAC9C,cAAM,eAAgB,SAAQ,aAAa,CADf,GAAG,EAAE,GAAG,EAAE,GAAG,CACE;IAIlC,KAAK;;;IAmBG,QAAQ;IAtBvB,YAAY,KAAK,KAAA,EAMhB;IAED,QAAQ,uBAMN;IAEF,MAAM,gCAkCL;CACF;kBApDK,eAAe;;;;;;;;;;;;;;;;YAqEH,KAAK;;;;;eAIR,eAAe"}
1
+ {"version":3,"file":"EmojiIconButton.d.ts","sourceRoot":"","sources":["../../src/components/EmojiIconButton.js"],"names":[],"mappings":"AAUA,sFAAsF;AACtF,iBAAS,eAAe,CAAC,EACvB,iBAAiB,EACjB,kBAA8B,EAC9B,aAAqB,EACrB,aAAoB,EACpB,aAAa,EAAE,MAA8B,EAC7C,YAAkC,EAClC,IAAgB,GACjB,EATW,GASX,+BA4CA"}
@@ -1,2 +1,2 @@
1
- import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import o from"@babel/runtime/helpers/assertThisInitialized";import r from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import n from"@babel/runtime/helpers/getPrototypeOf";import s from"@babel/runtime/helpers/defineProperty";import{PureComponent as l}from"react";import{Picker as a}from"emoji-mart";import c from"prop-types";import p from"@material-ui/core/Popover";import m from"./IconButton/index.js";import u from"./Icons/EmojiIcon.js";import{jsxs as f,Fragment as h,jsx as d}from"react/jsx-runtime";function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,r=n(e);if(t){var s=n(this).constructor;o=Reflect.construct(r,arguments,s)}else o=r.apply(this,arguments);return i(this,o)}}var j=function(i){r(c,l);var n=b(c);function c(t){var r;return e(this,c),r=n.call(this,t),s(o(r),"onSelect",(function(e){var t=r.props,o=t.handleSelectEmoji,i=t.closeOnSelect;o(e),i&&r.setState({openEmojiPicker:!1})})),r.state={openEmojiPicker:!1},r}return t(c,[{key:"render",value:function(){var e=this;return f(h,{children:[d(m,{"data-testid":this.props["data-testid"],buttonRef:function(t){e.anchorEl=t},"aria-label":"Emoji",onClick:function(){return e.setState({openEmojiPicker:!0})},disableRipple:this.props.disableRipple,className:this.props.emojiIconClassName,tooltipProps:this.props.tooltipProps,children:this.props.icon||d(u,{})}),d(p,{open:this.state.openEmojiPicker,anchorEl:this.anchorEl,onClose:function(){return e.setState({openEmojiPicker:!1})},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:d(a,{onSelect:this.onSelect,theme:"dark"})})]})}}]),c}();j.propTypes={handleSelectEmoji:c.func.isRequired,emojiIconClassName:c.string,disableRipple:c.bool,closeOnSelect:c.bool,"data-testid":c.string,tooltipProps:c.shape({}),icon:c.node},j.defaultProps={emojiIconClassName:void 0,disableRipple:!1,closeOnSelect:!0,"data-testid":"generic_emojiButton",tooltipProps:{title:"Add Emoji"},icon:void 0};export{j as default};
1
+ import o from"@babel/runtime/helpers/slicedToArray";import{memo as i,useState as e,useRef as t}from"react";import{Picker as r}from"emoji-mart";import n from"prop-types";import l from"@material-ui/core/Popover";import a from"./IconButton/index.js";import c from"./Icons/EmojiIcon.js";import{jsxs as m,Fragment as p,jsx as s}from"react/jsx-runtime";var d={title:"Add Emoji"};function u(i){var n=i.handleSelectEmoji,u=i.emojiIconClassName,f=void 0===u?void 0:u,h=i.disableRipple,v=void 0!==h&&h,j=i.closeOnSelect,b=void 0===j||j,g=i["data-testid"],E=void 0===g?"generic_emojiButton":g,I=i.tooltipProps,R=void 0===I?d:I,S=i.icon,C=void 0===S?void 0:S,O=e(!1),P=o(O,2),x=P[0],y=P[1],N=t(null);return m(p,{children:[s(a,{"data-testid":E,buttonRef:function(o){N.current=o},"aria-label":"Emoji",onClick:function(){return y(!0)},disableRipple:v,className:f,tooltipProps:R,children:C||s(c,{})}),s(l,{open:x,anchorEl:N.current,onClose:function(){return y(!1)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:s(r,{onSelect:function(o){n(o),b&&y(!1)},theme:"dark"})})]})}u.propTypes={handleSelectEmoji:n.func.isRequired,emojiIconClassName:n.string,disableRipple:n.bool,closeOnSelect:n.bool,"data-testid":n.string,tooltipProps:n.shape({}),icon:n.node};var f=i(u);export{f as default};
2
2
  //# sourceMappingURL=EmojiIconButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmojiIconButton.js","sources":["../../src/components/EmojiIconButton.js"],"sourcesContent":["import { PureComponent } from 'react';\nimport { Picker } from 'emoji-mart';\nimport PropTypes from 'prop-types';\nimport Popover from '@material-ui/core/Popover';\n\nimport IconButton from '~components/IconButton';\nimport EmojiIcon from '~components/Icons/EmojiIcon';\n\n/** @extends {PureComponent<any, any, any>} */\nclass EmojiIconButton extends PureComponent {\n constructor(props) {\n super(props);\n\n this.state = {\n openEmojiPicker: false,\n };\n }\n\n onSelect = emoji => {\n const { handleSelectEmoji, closeOnSelect } = this.props;\n handleSelectEmoji(emoji);\n if (closeOnSelect) {\n this.setState({ openEmojiPicker: false });\n }\n };\n\n render() {\n return (\n <>\n <IconButton\n data-testid={this.props['data-testid']}\n buttonRef={node => {\n this.anchorEl = node;\n }}\n aria-label=\"Emoji\"\n onClick={() => this.setState({ openEmojiPicker: true })}\n disableRipple={this.props.disableRipple}\n className={this.props.emojiIconClassName}\n tooltipProps={this.props.tooltipProps}\n >\n {this.props.icon || <EmojiIcon />}\n </IconButton>\n\n <Popover\n open={this.state.openEmojiPicker}\n anchorEl={this.anchorEl}\n onClose={() => this.setState({ openEmojiPicker: false })}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'right',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'right',\n }}\n >\n <Picker onSelect={this.onSelect} theme=\"dark\" />\n </Popover>\n </>\n );\n }\n}\n\nEmojiIconButton.propTypes = {\n handleSelectEmoji: PropTypes.func.isRequired,\n emojiIconClassName: PropTypes.string,\n disableRipple: PropTypes.bool,\n closeOnSelect: PropTypes.bool,\n 'data-testid': PropTypes.string,\n tooltipProps: PropTypes.shape({}),\n icon: PropTypes.node,\n};\n\nEmojiIconButton.defaultProps = {\n emojiIconClassName: undefined,\n disableRipple: false,\n closeOnSelect: true,\n 'data-testid': 'generic_emojiButton',\n tooltipProps: { title: 'Add Emoji' },\n icon: undefined,\n};\n\nexport default EmojiIconButton;\n"],"names":["EmojiIconButton","_PureComponent","_inherits","PureComponent","_super","_createSuper","props","_this","_classCallCheck","this","call","_defineProperty","_assertThisInitialized","emoji","_this$props","handleSelectEmoji","closeOnSelect","setState","openEmojiPicker","state","_createClass","key","value","_this2","_jsxs","_Fragment","children","_jsx","IconButton","buttonRef","node","anchorEl","onClick","disableRipple","className","emojiIconClassName","tooltipProps","icon","EmojiIcon","Popover","open","onClose","anchorOrigin","vertical","horizontal","transformOrigin","Picker","onSelect","theme","propTypes","PropTypes","func","isRequired","string","bool","shape","defaultProps","undefined","title"],"mappings":"yjCAQA,IACMA,EAAe,SAAAC,GAAAC,EAAAF,EAASG,GAAT,IAAAC,EAAAC,EAAAL,GACnB,SAAAA,EAAYM,GAAO,IAAAC,EAKf,OALeC,EAAAC,KAAAT,GACjBO,EAAAH,EAAAM,KAAAD,KAAMH,GAAOK,EAOJC,EAAAL,GAAA,YAAA,SAAAM,GACT,IAAAC,EAA6CP,EAAKD,MAA1CS,IAAAA,kBAAmBC,IAAAA,cAC3BD,EAAkBF,GACdG,GACFT,EAAKU,SAAS,CAAEC,iBAAiB,OATnCX,EAAKY,MAAQ,CACXD,iBAAiB,GACjBX,CACJ,CA4CC,OA5CAa,EAAApB,EAAA,CAAA,CAAAqB,IAAA,SAAAC,MAUD,WAAS,IAAAC,EAAAd,KACP,OACEe,EAAAC,EAAA,CAAAC,SAAA,CACEC,EAACC,EAAU,CACT,cAAanB,KAAKH,MAAM,eACxBuB,UAAW,SAAAC,GACTP,EAAKQ,SAAWD,CAChB,EACF,aAAW,QACXE,QAAS,WAAA,OAAMT,EAAKN,SAAS,CAAEC,iBAAiB,GAAQ,EACxDe,cAAexB,KAAKH,MAAM2B,cAC1BC,UAAWzB,KAAKH,MAAM6B,mBACtBC,aAAc3B,KAAKH,MAAM8B,aAAaV,SAErCjB,KAAKH,MAAM+B,MAAQV,EAACW,EAAS,MAGhCX,EAACY,EAAO,CACNC,KAAM/B,KAAKU,MAAMD,gBACjBa,SAAUtB,KAAKsB,SACfU,QAAS,WAAA,OAAMlB,EAAKN,SAAS,CAAEC,iBAAiB,GAAS,EACzDwB,aAAc,CACZC,SAAU,SACVC,WAAY,SAEdC,gBAAiB,CACfF,SAAU,MACVC,WAAY,SACZlB,SAEFC,EAACmB,EAAM,CAACC,SAAUtC,KAAKsC,SAAUC,MAAM,aAI/C,KAAChD,CAAA,CAnDkB,GAsDrBA,EAAgBiD,UAAY,CAC1BlC,kBAAmBmC,EAAUC,KAAKC,WAClCjB,mBAAoBe,EAAUG,OAC9BpB,cAAeiB,EAAUI,KACzBtC,cAAekC,EAAUI,KACzB,cAAeJ,EAAUG,OACzBjB,aAAcc,EAAUK,MAAM,IAC9BlB,KAAMa,EAAUpB,MAGlB9B,EAAgBwD,aAAe,CAC7BrB,wBAAoBsB,EACpBxB,eAAe,EACfjB,eAAe,EACf,cAAe,sBACfoB,aAAc,CAAEsB,MAAO,aACvBrB,UAAMoB"}
1
+ {"version":3,"file":"EmojiIconButton.js","sources":["../../src/components/EmojiIconButton.js"],"sourcesContent":["import { memo, useRef, useState } from 'react';\nimport { Picker } from 'emoji-mart';\nimport PropTypes from 'prop-types';\nimport Popover from '@material-ui/core/Popover';\n\nimport IconButton from '~components/IconButton';\nimport EmojiIcon from '~components/Icons/EmojiIcon';\n\nconst defaultTooltipProps = { title: 'Add Emoji' };\n\n/** @param {any} props Preserve the legacy component's permissive public prop type. */\nfunction EmojiIconButton({\n handleSelectEmoji,\n emojiIconClassName = undefined,\n disableRipple = false,\n closeOnSelect = true,\n 'data-testid': testId = 'generic_emojiButton',\n tooltipProps = defaultTooltipProps,\n icon = undefined,\n}) {\n const [openEmojiPicker, setOpenEmojiPicker] = useState(false);\n const anchorEl = useRef(null);\n\n const onSelect = emoji => {\n handleSelectEmoji(emoji);\n if (closeOnSelect) {\n setOpenEmojiPicker(false);\n }\n };\n\n return (\n <>\n <IconButton\n data-testid={testId}\n buttonRef={node => {\n anchorEl.current = node;\n }}\n aria-label=\"Emoji\"\n onClick={() => setOpenEmojiPicker(true)}\n disableRipple={disableRipple}\n className={emojiIconClassName}\n tooltipProps={tooltipProps}\n >\n {icon || <EmojiIcon />}\n </IconButton>\n\n <Popover\n open={openEmojiPicker}\n anchorEl={anchorEl.current}\n onClose={() => setOpenEmojiPicker(false)}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'right',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'right',\n }}\n >\n <Picker onSelect={onSelect} theme=\"dark\" />\n </Popover>\n </>\n );\n}\n\nEmojiIconButton.propTypes = {\n handleSelectEmoji: PropTypes.func.isRequired,\n emojiIconClassName: PropTypes.string,\n disableRipple: PropTypes.bool,\n closeOnSelect: PropTypes.bool,\n 'data-testid': PropTypes.string,\n tooltipProps: PropTypes.shape({}),\n icon: PropTypes.node,\n};\n\nexport default memo(EmojiIconButton);\n"],"names":["defaultTooltipProps","title","EmojiIconButton","_ref","handleSelectEmoji","_ref$emojiIconClassNa","emojiIconClassName","undefined","_ref$disableRipple","disableRipple","_ref$closeOnSelect","closeOnSelect","_ref$dataTestid","testId","_ref$tooltipProps","tooltipProps","_ref$icon","icon","useState","_useState2","_slicedToArray","_useState","openEmojiPicker","setOpenEmojiPicker","anchorEl","useRef","_jsxs","_Fragment","children","_jsx","IconButton","buttonRef","node","current","onClick","className","EmojiIcon","Popover","open","onClose","anchorOrigin","vertical","horizontal","transformOrigin","Picker","onSelect","emoji","theme","propTypes","PropTypes","func","isRequired","string","bool","shape","memo"],"mappings":"2VAQA,IAAMA,EAAsB,CAAEC,MAAO,aAGrC,SAASC,EAQNC,GAAA,IAPDC,IAAAA,kBAAiBC,EAAAF,EACjBG,mBAAAA,kBAAqBC,EAASF,EAAAG,EAAAL,EAC9BM,cAAAA,cAAqBD,EAAAE,EAAAP,EACrBQ,cAAAA,cAAoBD,EAAAE,EAAAT,EACpB,eAAeU,aAAS,sBAAqBD,EAAAE,EAAAX,EAC7CY,aAAAA,aAAef,EAAmBc,EAAAE,EAAAb,EAClCc,KAAAA,kBAAOV,EAASS,EAE8BE,EAAAA,GAAS,GAAMC,EAAAC,EAAAC,EAAA,GAAtDC,EAAeH,EAAA,GAAEI,EAAkBJ,EAAA,GACpCK,EAAWC,EAAO,MASxB,OACEC,EAAAC,EAAA,CAAAC,SAAA,CACEC,EAACC,EAAU,CACT,cAAajB,EACbkB,UAAW,SAAAC,GACTR,EAASS,QAAUD,CACnB,EACF,aAAW,QACXE,QAAS,WAAA,OAAMX,GAAmB,EAAM,EACxCd,cAAeA,EACf0B,UAAW7B,EACXS,aAAcA,EAAaa,SAE1BX,GAAQY,EAACO,EAAS,CAAA,KAGrBP,EAACQ,EAAO,CACNC,KAAMhB,EACNE,SAAUA,EAASS,QACnBM,QAAS,WAAA,OAAMhB,GAAmB,EAAO,EACzCiB,aAAc,CACZC,SAAU,SACVC,WAAY,SAEdC,gBAAiB,CACfF,SAAU,MACVC,WAAY,SACZd,SAEFC,EAACe,EAAM,CAACC,SApCG,SAAAC,GACf1C,EAAkB0C,GACdnC,GACFY,GAAmB,IAiCWwB,MAAM,aAI1C,CAEA7C,EAAgB8C,UAAY,CAC1B5C,kBAAmB6C,EAAUC,KAAKC,WAClC7C,mBAAoB2C,EAAUG,OAC9B3C,cAAewC,EAAUI,KACzB1C,cAAesC,EAAUI,KACzB,cAAeJ,EAAUG,OACzBrC,aAAckC,EAAUK,MAAM,IAC9BrC,KAAMgC,EAAUjB,MAGlB,IAAeuB,EAAAA,EAAKrD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ConfirmationDialog.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfirmationDialog.test.d.ts","sourceRoot":"","sources":["../../../src/components/__tests__/ConfirmationDialog.test.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EmojiIconButton.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmojiIconButton.test.d.ts","sourceRoot":"","sources":["../../../src/components/__tests__/EmojiIconButton.test.js"],"names":[],"mappings":""}
@@ -248,7 +248,7 @@ const validateDsn = dsn => {
248
248
 
249
249
  const MCP_SERVER_VERSION = '1.5.0';
250
250
 
251
- var version = "3.75.0-18";
251
+ var version = "3.75.0-19";
252
252
 
253
253
  const CORVA_UI_VERSION = version;
254
254
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "3.75.0-18",
3
+ "version": "3.75.0-19",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Shared components/utils for Corva ui projects",
6
6
  "repository": {