@iobroker/adapter-react-v5 4.0.22 → 4.0.24
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/Components/404.js +4 -1
- package/Components/404.js.map +1 -1
- package/Components/ColorPicker.js +15 -1
- package/Components/ColorPicker.js.map +1 -1
- package/Components/FileBrowser.d.ts +1 -1
- package/Components/FileBrowser.js +151 -135
- package/Components/FileBrowser.js.map +1 -1
- package/Components/FileViewer.js +3 -1
- package/Components/FileViewer.js.map +1 -1
- package/Components/JsonConfigComponent/ChipInput.js +4 -1
- package/Components/JsonConfigComponent/ChipInput.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCertCollection.js +14 -28
- package/Components/JsonConfigComponent/ConfigCertCollection.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCertificates.js +15 -24
- package/Components/JsonConfigComponent/ConfigCertificates.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFileSelector.js +20 -7
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigGeneric.js +7 -8
- package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigIP.js +16 -11
- package/Components/JsonConfigComponent/ConfigIP.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +0 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js +2 -2
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPanel.js +12 -8
- package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPort.js +1 -1
- package/Components/JsonConfigComponent/ConfigPort.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.js +3 -0
- package/Components/JsonConfigComponent/ConfigStaticImage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticText.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js +43 -4
- package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigUser.js +13 -9
- package/Components/JsonConfigComponent/ConfigUser.js.map +1 -1
- package/Components/Loader.js +6 -1
- package/Components/Loader.js.map +1 -1
- package/Components/Loaders/PT.js +6 -1
- package/Components/Loaders/PT.js.map +1 -1
- package/Components/Loaders/Vendor.js +6 -1
- package/Components/Loaders/Vendor.js.map +1 -1
- package/Components/Logo.js +1 -1
- package/Components/Logo.js.map +1 -1
- package/Components/ObjectBrowser.js +10 -1
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/Router.js +1 -1
- package/Components/Router.js.map +1 -1
- package/Components/SaveCloseButtons.js +1 -1
- package/Components/SaveCloseButtons.js.map +1 -1
- package/Components/TabContainer.js +1 -1
- package/Components/TabContainer.js.map +1 -1
- package/Components/TabContent.js +1 -1
- package/Components/TabContent.js.map +1 -1
- package/Components/TabHeader.js +1 -1
- package/Components/TabHeader.js.map +1 -1
- package/Components/TableResize.js +6 -1
- package/Components/TableResize.js.map +1 -1
- package/Dialogs/Confirm.js +6 -1
- package/Dialogs/Confirm.js.map +1 -1
- package/Dialogs/Error.js +6 -1
- package/Dialogs/Error.js.map +1 -1
- package/Dialogs/Message.js +6 -1
- package/Dialogs/Message.js.map +1 -1
- package/Dialogs/SelectFile.d.ts +0 -1
- package/Dialogs/SelectFile.js +9 -5
- package/Dialogs/SelectFile.js.map +1 -1
- package/Dialogs/SelectID.js +6 -1
- package/Dialogs/SelectID.js.map +1 -1
- package/GenericApp.js +6 -1
- package/GenericApp.js.map +1 -1
- package/LegacyConnection.js +6 -1
- package/LegacyConnection.js.map +1 -1
- package/README.md +6 -0
- package/i18n/de.json +9 -5
- package/i18n/en.json +5 -1
- package/i18n/es.json +5 -1
- package/i18n/fr.json +5 -1
- package/i18n/it.json +5 -1
- package/i18n/nl.json +5 -1
- package/i18n/pl.json +5 -1
- package/i18n/pt.json +5 -1
- package/i18n/ru.json +8 -4
- package/i18n/uk.json +5 -1
- package/i18n/zh-cn.json +5 -1
- package/i18n.js +12 -15
- package/i18n.js.map +1 -1
- package/package.json +6 -6
package/Components/Router.js
CHANGED
|
@@ -13,7 +13,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
16
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
16
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } // please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
17
17
|
/**
|
|
18
18
|
* @template P Type of the properties object.
|
|
19
19
|
* @template S Type of the internal state object.
|
package/Components/Router.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Router.js","names":["_react","_interopRequireDefault","require","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","Router","_React$Component","_inherits2","_super","props","_this","_classCallCheck2","onHashChangedBound","onHashChanged","bind","_assertThisInitialized2","_createClass2","key","value","componentDidMount","window","addEventListener","componentWillUnmount","removeEventListener","getLocation","hash","location","replace","parts","split","map","item","decodeURIComponent","console","error","tab","dialog","id","arg","doNavigate","undefined","React","Component","_default","exports"],"sources":["Router.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\n\n/**\n * @template P Type of the properties object.\n * @template S Type of the internal state object.\n * @extends {React.Component<P, S>}\n */\nclass Router extends React.Component {\n /**\n * @param {P} props The React properties of this component.\n */\n constructor(props) {\n super(props);\n this.onHashChangedBound = this.onHashChanged.bind(this);\n }\n\n componentDidMount() {\n window.addEventListener('hashchange', this.onHashChangedBound);\n }\n\n componentWillUnmount() {\n window.removeEventListener('hashchange', this.onHashChangedBound);\n }\n\n onHashChanged() {\n // override this function\n }\n\n /**\n * Gets the location object.\n * @returns {{ tab: string; dialog: string; id: string; arg: string; }}\n */\n static getLocation() {\n let hash = window.location.hash;\n hash = hash.replace(/^#/, '');\n const parts = hash.split('/').map(item => {\n try {\n return item ? decodeURIComponent(item) : ''\n } catch (e) {\n console.error('Router: Cannot decode ' + item);\n return item || '';\n }\n });\n // #tabName/dialogName/deviceId\n return {\n tab: parts[0] || '',\n dialog: parts[1] || '',\n id: parts[2] || '',\n arg: parts[3] || ''\n };\n }\n\n /**\n * Navigate to a new location. Any parameters that are not set will be taken from the current location.\n * @param {string | undefined} [tab]\n * @param {string | undefined} [dialog]\n * @param {string | undefined} [id]\n * @param {string | undefined} [arg]\n */\n static doNavigate(tab, dialog, id, arg) {\n let hash = '';\n const location = Router.getLocation();\n if (arg !== undefined && !id) {\n id = location.id;\n }\n if (id && !dialog) {\n dialog = location.dialog;\n }\n if (dialog && !tab) {\n tab = location.tab;\n } else\n if (tab === null) {\n tab = location.tab;\n }\n\n if (tab) {\n hash = '#' + tab;\n if (dialog) {\n hash += '/' + dialog;\n\n if (id) {\n hash += '/' + id;\n if (arg !== undefined) {\n hash += '/' + arg;\n }\n }\n }\n }\n if (window.location.hash !== hash) {\n window.location.hash = hash;\n }\n }\n}\n\nexport default Router;"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAC,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAF,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,mBAAAP,MAAA;AAAA,SAAAJ,0BAAA,eAAAO,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,OAAA,CAAAC,SAAA,CAAAM,OAAA,8CAAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"Router.js","names":["_react","_interopRequireDefault","require","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","Router","_React$Component","_inherits2","_super","props","_this","_classCallCheck2","onHashChangedBound","onHashChanged","bind","_assertThisInitialized2","_createClass2","key","value","componentDidMount","window","addEventListener","componentWillUnmount","removeEventListener","getLocation","hash","location","replace","parts","split","map","item","decodeURIComponent","console","error","tab","dialog","id","arg","doNavigate","undefined","React","Component","_default","exports"],"sources":["Router.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\n\n/**\n * @template P Type of the properties object.\n * @template S Type of the internal state object.\n * @extends {React.Component<P, S>}\n */\nclass Router extends React.Component {\n /**\n * @param {P} props The React properties of this component.\n */\n constructor(props) {\n super(props);\n this.onHashChangedBound = this.onHashChanged.bind(this);\n }\n\n componentDidMount() {\n window.addEventListener('hashchange', this.onHashChangedBound);\n }\n\n componentWillUnmount() {\n window.removeEventListener('hashchange', this.onHashChangedBound);\n }\n\n onHashChanged() {\n // override this function\n }\n\n /**\n * Gets the location object.\n * @returns {{ tab: string; dialog: string; id: string; arg: string; }}\n */\n static getLocation() {\n let hash = window.location.hash;\n hash = hash.replace(/^#/, '');\n const parts = hash.split('/').map(item => {\n try {\n return item ? decodeURIComponent(item) : ''\n } catch (e) {\n console.error('Router: Cannot decode ' + item);\n return item || '';\n }\n });\n // #tabName/dialogName/deviceId\n return {\n tab: parts[0] || '',\n dialog: parts[1] || '',\n id: parts[2] || '',\n arg: parts[3] || ''\n };\n }\n\n /**\n * Navigate to a new location. Any parameters that are not set will be taken from the current location.\n * @param {string | undefined} [tab]\n * @param {string | undefined} [dialog]\n * @param {string | undefined} [id]\n * @param {string | undefined} [arg]\n */\n static doNavigate(tab, dialog, id, arg) {\n let hash = '';\n const location = Router.getLocation();\n if (arg !== undefined && !id) {\n id = location.id;\n }\n if (id && !dialog) {\n dialog = location.dialog;\n }\n if (dialog && !tab) {\n tab = location.tab;\n } else\n if (tab === null) {\n tab = location.tab;\n }\n\n if (tab) {\n hash = '#' + tab;\n if (dialog) {\n hash += '/' + dialog;\n\n if (id) {\n hash += '/' + id;\n if (arg !== undefined) {\n hash += '/' + arg;\n }\n }\n }\n }\n if (window.location.hash !== hash) {\n window.location.hash = hash;\n }\n }\n}\n\nexport default Router;"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAA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AAE,EAAE;QAC1BA,EAAE,GAAGX,QAAQ,CAACW,EAAE;MACpB;MACA,IAAIA,EAAE,IAAI,CAACD,MAAM,EAAE;QACfA,MAAM,GAAGV,QAAQ,CAACU,MAAM;MAC5B;MACA,IAAIA,MAAM,IAAI,CAACD,GAAG,EAAE;QAChBA,GAAG,GAAGT,QAAQ,CAACS,GAAG;MACtB,CAAC,MACD,IAAIA,GAAG,KAAK,IAAI,EAAE;QACdA,GAAG,GAAGT,QAAQ,CAACS,GAAG;MACtB;MAEA,IAAIA,GAAG,EAAE;QACLV,IAAI,GAAG,GAAG,GAAGU,GAAG;QAChB,IAAIC,MAAM,EAAE;UACRX,IAAI,IAAI,GAAG,GAAGW,MAAM;UAEpB,IAAIC,EAAE,EAAE;YACJZ,IAAI,IAAI,GAAG,GAAGY,EAAE;YAChB,IAAIC,GAAG,KAAKE,SAAS,EAAE;cACnBf,IAAI,IAAI,GAAG,GAAGa,GAAG;YACrB;UACJ;QACJ;MACJ;MACA,IAAIlB,MAAM,CAACM,QAAQ,CAACD,IAAI,KAAKA,IAAI,EAAE;QAC/BL,MAAM,CAACM,QAAQ,CAACD,IAAI,GAAGA,IAAI;MAC/B;IACJ;EAAC;EAAA,OAAApB,MAAA;AAAA,EApFgBoC,iBAAK,CAACC,SAAS;AAAA,IAAAC,QAAA,GAuFrBtC,MAAM;AAAAuC,OAAA,cAAAD,QAAA"}
|
|
@@ -19,7 +19,7 @@ var _i18n = _interopRequireDefault(require("../i18n"));
|
|
|
19
19
|
var _Save = _interopRequireDefault(require("@mui/icons-material/Save"));
|
|
20
20
|
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
21
21
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
22
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
22
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } // please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
23
23
|
var styles = function styles(theme) {
|
|
24
24
|
return {
|
|
25
25
|
buttonIcon: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveCloseButtons.js","names":["_react","_interopRequireDefault","require","_withStyles","_Fab","_propTypes","_Toolbar","_i18n","_Save","_Close","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","theme","buttonIcon","marginRight","SaveCloseButtons","_React$Component","_inherits2","_super","props","_this","_classCallCheck2","newReact","undefined","isIFrame","window","self","top","_createClass2","key","value","render","_this2","noTextOnButtons","buttonStyle","borderRadius","saveToolbar","button","height","style","bottom","left","paddingLeft","right","position","background","dense","minHeight","error","border","createElement","variant","disabled","changed","onClick","onSave","className","classes","I18n","t","Object","assign","marginLeft","flexGrow","onClose","React","Component","propTypes","PropTypes","bool","number","object","isRequired","func","_export","withStyles","_default","exports"],"sources":["SaveCloseButtons.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport withStyles from '@mui/styles/withStyles';\nimport Fab from '@mui/material/Fab';\nimport PropTypes from 'prop-types';\n\nimport Toolbar from '@mui/material/Toolbar';\n\nimport I18n from '../i18n';\n\nimport IconSave from '@mui/icons-material/Save';\nimport IconClose from '@mui/icons-material/Close';\n\nconst styles = theme => ({\n buttonIcon: {\n marginRight: 8\n },\n});\n\n/**\n * @typedef {object} SaveCloseButtonsProps\n * @property {boolean} noTextOnButtons Are the buttons without text\n * @property {any} theme Theme object (from this.state.theme)\n * @property {boolean} isIFrame bottom position 0 or 38 for iFrame\n * @property {boolean} newReact is used in new react\n * @property {function} onSave on Save handler\n * @property {function} onClose on Close handler\n *\n * @extends {React.Component<SaveCloseButtonsProps>}\n */\nclass SaveCloseButtons extends React.Component {\n /**\n * @param {SaveCloseButtonsProps} props\n */\n constructor(props) {\n super(props);\n const newReact = props.newReact === undefined ? true : props.newReact;\n\n try {\n this.isIFrame = !newReact && window.self !== window.top;\n } catch (e) {\n this.isIFrame = !newReact;\n }\n }\n\n render() {\n const noTextOnButtons = this.props.noTextOnButtons;\n const buttonStyle = {\n borderRadius: this.props.theme.saveToolbar.button.borderRadius || 3,\n height: this.props.theme.saveToolbar.button.height || 32,\n };\n\n const style = {\n bottom: this.isIFrame ? 38 : 0,\n left: this.props.paddingLeft || 0,\n right: 0,\n position: 'absolute',\n background: this.props.theme.saveToolbar.background\n };\n if (this.props.dense) {\n style.minHeight = 48;\n }\n\n if (this.props.error) {\n buttonStyle.border = '1px solid red';\n }\n\n return <Toolbar position=\"absolute\" style={style}>\n <Fab\n variant=\"extended\"\n aria-label=\"Save\"\n disabled={!this.props.changed || this.props.error}\n onClick={() => this.props.onSave(false)}\n style={buttonStyle}\n >\n <IconSave className={!noTextOnButtons ? this.props.classes.buttonIcon : ''}/>{!noTextOnButtons && I18n.t('ra_Save')}\n </Fab>\n <Fab\n variant=\"extended\"\n aria-label=\"Save and close\"\n disabled={!this.props.changed || this.props.error}\n onClick={() => this.props.onSave(true)}\n style={Object.assign({}, buttonStyle, {marginLeft: 10})}>\n <IconSave className={!noTextOnButtons ? this.props.classes.buttonIcon : ''}/>\n {!noTextOnButtons ? I18n.t('ra_Save and close') : '+'}\n {noTextOnButtons && <IconClose/>}\n </Fab>\n <div style={{flexGrow: 1}}/>\n <Fab variant=\"extended\" aria-label=\"Close\" onClick={() => this.props.onClose()} style={buttonStyle}>\n <IconClose className={!noTextOnButtons ? this.props.classes.buttonIcon : ''}/>{!noTextOnButtons && I18n.t('ra_Close')}\n </Fab>\n </Toolbar>;\n }\n}\n\nSaveCloseButtons.propTypes = {\n dense: PropTypes.bool,\n paddingLeft: PropTypes.number,\n noTextOnButtons: PropTypes.bool,\n theme: PropTypes.object,\n isIFrame: PropTypes.bool,\n changed: PropTypes.bool.isRequired,\n error: PropTypes.bool,\n onSave: PropTypes.func.isRequired,\n onClose: PropTypes.func.isRequired,\n newReact: PropTypes.bool,\n};\n\n/** @type {typeof SaveCloseButtons} */\nconst _export = withStyles(styles)(SaveCloseButtons);\nexport default _export;"],"mappings":";;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,IAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,UAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAR,sBAAA,CAAAC,OAAA;AAAkD,SAAAQ,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAF,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,mBAAAP,MAAA;AAAA,SAAAJ,0BAAA,eAAAO,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,OAAA,CAAAC,SAAA,CAAAM,OAAA,8CAAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"SaveCloseButtons.js","names":["_react","_interopRequireDefault","require","_withStyles","_Fab","_propTypes","_Toolbar","_i18n","_Save","_Close","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","theme","buttonIcon","marginRight","SaveCloseButtons","_React$Component","_inherits2","_super","props","_this","_classCallCheck2","newReact","undefined","isIFrame","window","self","top","_createClass2","key","value","render","_this2","noTextOnButtons","buttonStyle","borderRadius","saveToolbar","button","height","style","bottom","left","paddingLeft","right","position","background","dense","minHeight","error","border","createElement","variant","disabled","changed","onClick","onSave","className","classes","I18n","t","Object","assign","marginLeft","flexGrow","onClose","React","Component","propTypes","PropTypes","bool","number","object","isRequired","func","_export","withStyles","_default","exports"],"sources":["SaveCloseButtons.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport withStyles from '@mui/styles/withStyles';\nimport Fab from '@mui/material/Fab';\nimport PropTypes from 'prop-types';\n\nimport Toolbar from '@mui/material/Toolbar';\n\nimport I18n from '../i18n';\n\nimport IconSave from '@mui/icons-material/Save';\nimport IconClose from '@mui/icons-material/Close';\n\nconst styles = theme => ({\n buttonIcon: {\n marginRight: 8\n },\n});\n\n/**\n * @typedef {object} SaveCloseButtonsProps\n * @property {boolean} noTextOnButtons Are the buttons without text\n * @property {any} theme Theme object (from this.state.theme)\n * @property {boolean} isIFrame bottom position 0 or 38 for iFrame\n * @property {boolean} newReact is used in new react\n * @property {function} onSave on Save handler\n * @property {function} onClose on Close handler\n *\n * @extends {React.Component<SaveCloseButtonsProps>}\n */\nclass SaveCloseButtons extends React.Component {\n /**\n * @param {SaveCloseButtonsProps} props\n */\n constructor(props) {\n super(props);\n const newReact = props.newReact === undefined ? true : props.newReact;\n\n try {\n this.isIFrame = !newReact && window.self !== window.top;\n } catch (e) {\n this.isIFrame = !newReact;\n }\n }\n\n render() {\n const noTextOnButtons = this.props.noTextOnButtons;\n const buttonStyle = {\n borderRadius: this.props.theme.saveToolbar.button.borderRadius || 3,\n height: this.props.theme.saveToolbar.button.height || 32,\n };\n\n const style = {\n bottom: this.isIFrame ? 38 : 0,\n left: this.props.paddingLeft || 0,\n right: 0,\n position: 'absolute',\n background: this.props.theme.saveToolbar.background\n };\n if (this.props.dense) {\n style.minHeight = 48;\n }\n\n if (this.props.error) {\n buttonStyle.border = '1px solid red';\n }\n\n return <Toolbar position=\"absolute\" style={style}>\n <Fab\n variant=\"extended\"\n aria-label=\"Save\"\n disabled={!this.props.changed || this.props.error}\n onClick={() => this.props.onSave(false)}\n style={buttonStyle}\n >\n <IconSave className={!noTextOnButtons ? this.props.classes.buttonIcon : ''}/>{!noTextOnButtons && I18n.t('ra_Save')}\n </Fab>\n <Fab\n variant=\"extended\"\n aria-label=\"Save and close\"\n disabled={!this.props.changed || this.props.error}\n onClick={() => this.props.onSave(true)}\n style={Object.assign({}, buttonStyle, {marginLeft: 10})}>\n <IconSave className={!noTextOnButtons ? this.props.classes.buttonIcon : ''}/>\n {!noTextOnButtons ? I18n.t('ra_Save and close') : '+'}\n {noTextOnButtons && <IconClose/>}\n </Fab>\n <div style={{flexGrow: 1}}/>\n <Fab variant=\"extended\" aria-label=\"Close\" onClick={() => this.props.onClose()} style={buttonStyle}>\n <IconClose className={!noTextOnButtons ? this.props.classes.buttonIcon : ''}/>{!noTextOnButtons && I18n.t('ra_Close')}\n </Fab>\n </Toolbar>;\n }\n}\n\nSaveCloseButtons.propTypes = {\n dense: PropTypes.bool,\n paddingLeft: PropTypes.number,\n noTextOnButtons: PropTypes.bool,\n theme: PropTypes.object,\n isIFrame: PropTypes.bool,\n changed: PropTypes.bool.isRequired,\n error: PropTypes.bool,\n onSave: PropTypes.func.isRequired,\n onClose: PropTypes.func.isRequired,\n newReact: PropTypes.bool,\n};\n\n/** @type {typeof SaveCloseButtons} */\nconst _export = withStyles(styles)(SaveCloseButtons);\nexport default _export;"],"mappings":";;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,IAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,UAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAR,sBAAA,CAAAC,OAAA;AAAkD,SAAAQ,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAF,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,mBAAAP,MAAA;AAAA,SAAAJ,0BAAA,eAAAO,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CA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;EAAC;EAAA,OAAA5C,gBAAA;AAAA,EA9D0BkD,iBAAK,CAACC,SAAS;AAiE9CnD,gBAAgB,CAACoD,SAAS,GAAG;EACzBrB,KAAK,EAAEsB,qBAAS,CAACC,IAAI;EACrB3B,WAAW,EAAE0B,qBAAS,CAACE,MAAM;EAC7BrC,eAAe,EAAEmC,qBAAS,CAACC,IAAI;EAC/BzD,KAAK,EAAEwD,qBAAS,CAACG,MAAM;EACvB/C,QAAQ,EAAE4C,qBAAS,CAACC,IAAI;EACxBhB,OAAO,EAAEe,qBAAS,CAACC,IAAI,CAACG,UAAU;EAClCxB,KAAK,EAAEoB,qBAAS,CAACC,IAAI;EACrBd,MAAM,EAAEa,qBAAS,CAACK,IAAI,CAACD,UAAU;EACjCR,OAAO,EAAEI,qBAAS,CAACK,IAAI,CAACD,UAAU;EAClClD,QAAQ,EAAE8C,qBAAS,CAACC;AACxB,CAAC;;AAED;AACA,IAAMK,OAAO,GAAG,IAAAC,sBAAU,EAAChE,MAAM,CAAC,CAACI,gBAAgB,CAAC;AAAC,IAAA6D,QAAA,GACtCF,OAAO;AAAAG,OAAA,cAAAD,QAAA"}
|
|
@@ -18,7 +18,7 @@ var _Utils = _interopRequireDefault(require("./Utils"));
|
|
|
18
18
|
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
19
19
|
var _Paper = _interopRequireDefault(require("@mui/material/Paper"));
|
|
20
20
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
21
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
21
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } // please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
22
22
|
var styles = {
|
|
23
23
|
root: {
|
|
24
24
|
width: '100%',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabContainer.js","names":["_react","_interopRequireDefault","require","_withStyles","_propTypes","_Utils","_Grid","_Paper","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","root","width","height","overflowHidden","overflow","container","TabContainer","_React$Component","_inherits2","_super","_classCallCheck2","_createClass2","key","value","render","classes","props","createElement","elevation","isNaN","className","Utils","clsx","_defineProperty2","direction","wrap","children","React","Component","propTypes","PropTypes","number","string","_export","withStyles","_default","exports"],"sources":["TabContainer.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport withStyles from '@mui/styles/withStyles';\n\nimport PropTypes from 'prop-types';\nimport Utils from './Utils';\n\nimport Grid from '@mui/material/Grid';\nimport Paper from '@mui/material/Paper';\n\nconst styles = {\n root: {\n width: '100%',\n height: '100%'\n },\n overflowHidden: {\n overflow: 'hidden'\n },\n container: {\n height: '100%'\n }\n};\n\n/**\n * @typedef {object} TabContainerProps\n * @property {number} [elevation] The elevation of the tab container.\n * @property {string} [overflow] Set to 'visible' show the overflow.\n * @property {{ [key in keyof styles]: string}} classes The styling class names.\n *\n * @extends {React.Component<TabContainerProps>}\n */\nclass TabContainer extends React.Component {\n\n render() {\n const { classes } = this.props;\n\n return <Paper\n elevation={ !isNaN(this.props.elevation) ? this.props.elevation : 1 }\n className={ Utils.clsx(classes.root, {[classes.overflowHidden]: this.props.overflow !== 'visible'}) }\n >\n <Grid\n container\n direction=\"column\"\n wrap=\"nowrap\"\n className={ classes.container }\n >\n { this.props.children }\n </Grid>\n </Paper>;\n }\n}\n\nTabContainer.propTypes = {\n elevation: PropTypes.number,\n overflow: PropTypes.string\n};\n\n/** @type {typeof TabContainer} */\nconst _export = withStyles(styles)(TabContainer);\nexport default _export;"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,MAAA,GAAAN,sBAAA,CAAAC,OAAA;AAAwC,SAAAM,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAF,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,mBAAAP,MAAA;AAAA,SAAAJ,0BAAA,eAAAO,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,OAAA,CAAAC,SAAA,CAAAM,OAAA,8CAAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"TabContainer.js","names":["_react","_interopRequireDefault","require","_withStyles","_propTypes","_Utils","_Grid","_Paper","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","root","width","height","overflowHidden","overflow","container","TabContainer","_React$Component","_inherits2","_super","_classCallCheck2","_createClass2","key","value","render","classes","props","createElement","elevation","isNaN","className","Utils","clsx","_defineProperty2","direction","wrap","children","React","Component","propTypes","PropTypes","number","string","_export","withStyles","_default","exports"],"sources":["TabContainer.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport withStyles from '@mui/styles/withStyles';\n\nimport PropTypes from 'prop-types';\nimport Utils from './Utils';\n\nimport Grid from '@mui/material/Grid';\nimport Paper from '@mui/material/Paper';\n\nconst styles = {\n root: {\n width: '100%',\n height: '100%'\n },\n overflowHidden: {\n overflow: 'hidden'\n },\n container: {\n height: '100%'\n }\n};\n\n/**\n * @typedef {object} TabContainerProps\n * @property {number} [elevation] The elevation of the tab container.\n * @property {string} [overflow] Set to 'visible' show the overflow.\n * @property {{ [key in keyof styles]: string}} classes The styling class names.\n *\n * @extends {React.Component<TabContainerProps>}\n */\nclass TabContainer extends React.Component {\n\n render() {\n const { classes } = this.props;\n\n return <Paper\n elevation={ !isNaN(this.props.elevation) ? this.props.elevation : 1 }\n className={ Utils.clsx(classes.root, {[classes.overflowHidden]: this.props.overflow !== 'visible'}) }\n >\n <Grid\n container\n direction=\"column\"\n wrap=\"nowrap\"\n className={ classes.container }\n >\n { this.props.children }\n </Grid>\n </Paper>;\n }\n}\n\nTabContainer.propTypes = {\n elevation: PropTypes.number,\n overflow: PropTypes.string\n};\n\n/** @type {typeof TabContainer} */\nconst _export = withStyles(styles)(TabContainer);\nexport default _export;"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA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AAA,mBAAAJ,YAAA;IAAA,OAAAG,MAAA,CAAAnB,KAAA,OAAAD,SAAA;EAAA;EAAA,IAAAsB,aAAA,aAAAL,YAAA;IAAAM,GAAA;IAAAC,KAAA,EAEd,SAAAC,OAAA,EAAS;MACL,IAAQC,OAAO,GAAK,IAAI,CAACC,KAAK,CAAtBD,OAAO;MAEf,oBAAO9C,MAAA,YAAAgD,aAAA,CAACzC,MAAA,WAAK;QACT0C,SAAS,EAAG,CAACC,KAAK,CAAC,IAAI,CAACH,KAAK,CAACE,SAAS,CAAC,GAAG,IAAI,CAACF,KAAK,CAACE,SAAS,GAAG,CAAG;QACrEE,SAAS,EAAGC,iBAAK,CAACC,IAAI,CAACP,OAAO,CAACf,IAAI,MAAAuB,gBAAA,iBAAIR,OAAO,CAACZ,cAAc,EAAG,IAAI,CAACa,KAAK,CAACZ,QAAQ,KAAK,SAAS;MAAI,gBAErGnC,MAAA,YAAAgD,aAAA,CAAC1C,KAAA,WAAI;QACD8B,SAAS;QACTmB,SAAS,EAAC,QAAQ;QAClBC,IAAI,EAAC,QAAQ;QACbL,SAAS,EAAGL,OAAO,CAACV;MAAW,GAE7B,IAAI,CAACW,KAAK,CAACU,QAAQ,CAClB,CACH;IACZ;EAAC;EAAA,OAAApB,YAAA;AAAA,EAlBsBqB,iBAAK,CAACC,SAAS;AAqB1CtB,YAAY,CAACuB,SAAS,GAAG;EACrBX,SAAS,EAAEY,qBAAS,CAACC,MAAM;EAC3B3B,QAAQ,EAAE0B,qBAAS,CAACE;AACxB,CAAC;;AAED;AACA,IAAMC,OAAO,GAAG,IAAAC,sBAAU,EAACnC,MAAM,CAAC,CAACO,YAAY,CAAC;AAAC,IAAA6B,QAAA,GAClCF,OAAO;AAAAG,OAAA,cAAAD,QAAA"}
|
package/Components/TabContent.js
CHANGED
|
@@ -17,7 +17,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
17
17
|
var _Utils = _interopRequireDefault(require("./Utils"));
|
|
18
18
|
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
19
19
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
20
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } // please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
21
21
|
var styles = {
|
|
22
22
|
root: {
|
|
23
23
|
height: '100%',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabContent.js","names":["_react","_interopRequireDefault","require","_withStyles","_propTypes","_Utils","_Grid","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","root","height","overflow","overflowAuto","TabContent","_React$Component","_inherits2","_super","_classCallCheck2","_createClass2","key","value","render","classes","props","createElement","item","className","Utils","clsx","_defineProperty2","children","React","Component","propTypes","PropTypes","string","_export","withStyles","_default","exports"],"sources":["TabContent.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport withStyles from '@mui/styles/withStyles';\n\nimport PropTypes from 'prop-types';\nimport Utils from './Utils';\n\nimport Grid from '@mui/material/Grid';\n\nconst styles = {\n root: {\n height: '100%',\n overflow: 'hidden'\n },\n overflowAuto: {\n overflow: 'auto'\n }\n};\n\n/**\n * @typedef {object} TabContentProps\n * @property {string} [overflow]\n * @property {{ [key in keyof styles]: string}} classes The styling class names.\n *\n * @extends {React.Component<TabContentProps>}\n */\nclass TabContent extends React.Component {\n render() {\n const { classes } = this.props;\n\n return <Grid\n item\n className={ Utils.clsx(classes.root, {[classes.overflowAuto]: this.props.overflow === 'auto'}) }\n >\n { this.props.children }\n </Grid>;\n }\n}\n\nTabContent.propTypes = {\n overflow: PropTypes.string\n};\n\n/** @type {typeof TabContent} */\nconst _export = withStyles(styles)(TabContent);\nexport default _export;"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAsC,SAAAK,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAF,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,mBAAAP,MAAA;AAAA,SAAAJ,0BAAA,eAAAO,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,OAAA,CAAAC,SAAA,CAAAM,OAAA,8CAAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"TabContent.js","names":["_react","_interopRequireDefault","require","_withStyles","_propTypes","_Utils","_Grid","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","root","height","overflow","overflowAuto","TabContent","_React$Component","_inherits2","_super","_classCallCheck2","_createClass2","key","value","render","classes","props","createElement","item","className","Utils","clsx","_defineProperty2","children","React","Component","propTypes","PropTypes","string","_export","withStyles","_default","exports"],"sources":["TabContent.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport withStyles from '@mui/styles/withStyles';\n\nimport PropTypes from 'prop-types';\nimport Utils from './Utils';\n\nimport Grid from '@mui/material/Grid';\n\nconst styles = {\n root: {\n height: '100%',\n overflow: 'hidden'\n },\n overflowAuto: {\n overflow: 'auto'\n }\n};\n\n/**\n * @typedef {object} TabContentProps\n * @property {string} [overflow]\n * @property {{ [key in keyof styles]: string}} classes The styling class names.\n *\n * @extends {React.Component<TabContentProps>}\n */\nclass TabContent extends React.Component {\n render() {\n const { classes } = this.props;\n\n return <Grid\n item\n className={ Utils.clsx(classes.root, {[classes.overflowAuto]: this.props.overflow === 'auto'}) }\n >\n { this.props.children }\n </Grid>;\n }\n}\n\nTabContent.propTypes = {\n overflow: PropTypes.string\n};\n\n/** @type {typeof TabContent} */\nconst _export = withStyles(styles)(TabContent);\nexport default _export;"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAJ,sB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YAAA6C,aAAA,CAACvC,KAAA,WAAI;QACRwC,IAAI;QACJC,SAAS,EAAGC,iBAAK,CAACC,IAAI,CAACN,OAAO,CAACb,IAAI,MAAAoB,gBAAA,iBAAIP,OAAO,CAACV,YAAY,EAAG,IAAI,CAACW,KAAK,CAACZ,QAAQ,KAAK,MAAM;MAAI,GAE9F,IAAI,CAACY,KAAK,CAACO,QAAQ,CAClB;IACX;EAAC;EAAA,OAAAjB,UAAA;AAAA,EAVoBkB,iBAAK,CAACC,SAAS;AAaxCnB,UAAU,CAACoB,SAAS,GAAG;EACnBtB,QAAQ,EAAEuB,qBAAS,CAACC;AACxB,CAAC;;AAED;AACA,IAAMC,OAAO,GAAG,IAAAC,sBAAU,EAAC7B,MAAM,CAAC,CAACK,UAAU,CAAC;AAAC,IAAAyB,QAAA,GAChCF,OAAO;AAAAG,OAAA,cAAAD,QAAA"}
|
package/Components/TabHeader.js
CHANGED
|
@@ -13,7 +13,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
15
15
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
16
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
16
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } // please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
17
17
|
/**
|
|
18
18
|
* @typedef {object} TabHeaderProps
|
|
19
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabHeader.js","names":["_react","_interopRequireDefault","require","_Grid","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","TabHeader","_React$Component","_inherits2","_super","_classCallCheck2","_createClass2","key","value","render","createElement","item","container","alignItems","props","children","React","Component","_default","exports"],"sources":["TabHeader.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\n\nimport Grid from '@mui/material/Grid';\n\n/**\n * @typedef {object} TabHeaderProps\n *\n * @extends {React.Component<TabHeaderProps>}\n */\nclass TabHeader extends React.Component {\n render() {\n return <Grid\n item\n container\n alignItems=\"center\"\n >\n { this.props.children }\n </Grid>;\n }\n}\n\nexport default TabHeader;"],"mappings":";;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAsC,SAAAE,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAF,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,mBAAAP,MAAA;AAAA,SAAAJ,0BAAA,eAAAO,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,OAAA,CAAAC,SAAA,CAAAM,OAAA,8CAAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"TabHeader.js","names":["_react","_interopRequireDefault","require","_Grid","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","TabHeader","_React$Component","_inherits2","_super","_classCallCheck2","_createClass2","key","value","render","createElement","item","container","alignItems","props","children","React","Component","_default","exports"],"sources":["TabHeader.js"],"sourcesContent":["// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\n\nimport Grid from '@mui/material/Grid';\n\n/**\n * @typedef {object} TabHeaderProps\n *\n * @extends {React.Component<TabHeaderProps>}\n */\nclass TabHeader extends React.Component {\n render() {\n return <Grid\n item\n container\n alignItems=\"center\"\n >\n { this.props.children }\n </Grid>;\n }\n}\n\nexport default TabHeader;"],"mappings":";;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAsC,SAAAE,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAF,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,mBAAAP,MAAA;AAAA,SAAAJ,0BAAA,eAAAO,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,OAAA,CAAAC,SAAA,CAAAM,OAAA,8CAAAI,CAAA,sBAHtC;AAKA;AACA;AACA;AACA;AACA;AAJA,IAKMC,SAAS,0BAAAC,gBAAA;EAAA,IAAAC,UAAA,aAAAF,SAAA,EAAAC,gBAAA;EAAA,IAAAE,MAAA,GAAAzB,YAAA,CAAAsB,SAAA;EAAA,SAAAA,UAAA;IAAA,IAAAI,gBAAA,mBAAAJ,SAAA;IAAA,OAAAG,MAAA,CAAAZ,KAAA,OAAAD,SAAA;EAAA;EAAA,IAAAe,aAAA,aAAAL,SAAA;IAAAM,GAAA;IAAAC,KAAA,EACX,SAAAC,OAAA,EAAS;MACL,oBAAOlC,MAAA,YAAAmC,aAAA,CAAChC,KAAA,WAAI;QACRiC,IAAI;QACJC,SAAS;QACTC,UAAU,EAAC;MAAQ,GAEjB,IAAI,CAACC,KAAK,CAACC,QAAQ,CAClB;IACX;EAAC;EAAA,OAAAd,SAAA;AAAA,EATmBe,iBAAK,CAACC,SAAS;AAAA,IAAAC,QAAA,GAYxBjB,SAAS;AAAAkB,OAAA,cAAAD,QAAA"}
|
|
@@ -21,7 +21,12 @@ var _Skeleton = _interopRequireDefault(require("@mui/material/Skeleton"));
|
|
|
21
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
23
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
24
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /**
|
|
25
|
+
* Copyright 2022, bluefox <dogafox@gmail.com>
|
|
26
|
+
*
|
|
27
|
+
* MIT License
|
|
28
|
+
*
|
|
29
|
+
**/
|
|
25
30
|
var styles = function styles(theme) {
|
|
26
31
|
return {
|
|
27
32
|
table: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableResize.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_styles","_Table","_Skeleton","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","valueOf","e","styles","theme","table","display","position","userSelect","cursor","width","right","top","bottom","zIndex","borderRight","borderColor","borderRightStyle","TableResize","_Component","_inherits2","_super","props","_this","_classCallCheck2","_defineProperty2","_assertThisInitialized2","c","resizerCurrentWidths","length","initialWidths","window","_localStorage","localStorage","setItem","concat","name","JSON","stringify","resizerApplyWidths","resizerActiveDiv","resizerOldWidth","clientX","resizerPosition","widthNext","resizerOldWidthNext","resizerMin","resizerMinNext","resizerActiveIndex","removeEventListener","resizerMouseMove","resizerMouseUp","undefined","console","log","target","dataset","index","parseInt","minWidths","ths","resizerRefTable","current","querySelectorAll","offsetWidth","addEventListener","React","createRef","_createClass2","value","componentDidMount","resizerInstall","componentWillUnmount","resizerUninstall","_this2","_installed","widthsStored","getItem","widthFilled","parse","tableWidth","storedWidth","w","isFinite","Math","abs","i","push","div","document","createElement","toString","onmousedown","resizerMouseDown","ondblclick","resizerReset","title","dblTitle","className","appendChild","installTimeout","setTimeout","clearTimeout","querySelector","remove","gridTemplateColumns","style","join","render","ready","stickyHeader","size","classes","ref","assign","children","Component","propTypes","PropTypes","string","bool","object","array","_default","withStyles","exports"],"sources":["TableResize.jsx"],"sourcesContent":["/**\n * Copyright 2022, bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles} from '@mui/styles';\n\nimport Table from '@mui/material/Table';\nimport Skeleton from '@mui/material/Skeleton';\n\nconst styles = theme => ({\n table: {\n display: 'grid',\n '& tr': {\n display: 'contents',\n },\n '& thead': {\n display: 'contents',\n },\n '& tbody': {\n display: 'contents',\n },\n '& th': { // resizer\n position: 'sticky',\n userSelect: 'none',\n },\n '& .resize-handle': { // resizer\n display: 'block',\n position: 'absolute',\n cursor: 'col-resize',\n width: 7,\n right: 0,\n top: 2,\n bottom: 2,\n zIndex: 1,\n borderRight: '2px dotted #888',\n '&:hover': {\n borderColor: '#ccc',\n borderRightStyle: 'solid',\n }\n , '&.active': {\n borderColor: '#517ea5',\n borderRightStyle: 'solid',\n }\n }\n },\n});\n\nclass TableResize extends Component {\n constructor(props) {\n super(props);\n this.resizerRefTable = React.createRef();\n this.resizerActiveIndex = null;\n this.resizerActiveDiv = null;\n this.resizerCurrentWidths = [];\n }\n\n componentDidMount() {\n this.resizerInstall();\n }\n\n componentWillUnmount() {\n this.resizerUninstall();\n }\n\n resizerInstall() {\n if (this.resizerRefTable.current && !this.resizerRefTable.current._installed) {\n this.resizerRefTable.current._installed = true;\n const ths = this.resizerRefTable.current.querySelectorAll('th');\n\n const widthsStored = (window._localStorage || window.localStorage).getItem(`App.${this.props.name || 'history'}.table`);\n this.widthFilled = false;\n\n if (widthsStored) {\n try {\n this.resizerCurrentWidths = JSON.parse(widthsStored);\n this.widthFilled = true;\n } catch (e) {\n // ignore\n }\n }\n if (this.widthFilled) {\n if (this.resizerCurrentWidths.length !== ths.length) {\n this.resizerCurrentWidths = [];\n this.widthFilled = false;\n } else {\n const tableWidth = this.resizerRefTable.current.offsetWidth;\n let storedWidth = 0;\n for (let w = 0; w < this.resizerCurrentWidths.length; w++) {\n if (isFinite(this.resizerCurrentWidths[w])) {\n storedWidth += this.resizerCurrentWidths[w];\n } else {\n storedWidth = null;\n break;\n }\n }\n if (storedWidth !== null && Math.abs(storedWidth - tableWidth) > 20) {\n this.resizerCurrentWidths = [];\n this.widthFilled = false;\n }\n }\n }\n\n for (let i = 0; i < ths.length; i++) {\n !this.widthFilled && this.resizerCurrentWidths.push(ths[i].offsetWidth);\n\n // last column does need handle\n if (i < ths.length - 1) {\n const div = window.document.createElement('div');\n div.dataset.index = i.toString();\n div.onmousedown = this.resizerMouseDown;\n div.ondblclick = this.resizerReset;\n div.title = this.props.dblTitle || 'Double click to reset table layout';\n div.className = 'resize-handle';\n ths[i].appendChild(div);\n }\n }\n if (this.widthFilled) {\n this.resizerApplyWidths();\n }\n } else {\n this.installTimeout = setTimeout(() => {\n this.installTimeout = null;\n this.resizerInstall()\n }, 100);\n }\n }\n\n resizerReset = () => {\n for (let c = 0; c < this.resizerCurrentWidths.length; c++) {\n this.resizerCurrentWidths[c] = (this.props.initialWidths || [])[c] || 'auto';\n }\n\n (window._localStorage || window.localStorage).setItem(`App.${this.props.name || 'history'}.table`, JSON.stringify(this.resizerCurrentWidths));\n this.resizerApplyWidths();\n }\n\n resizerUninstall() {\n this.installTimeout && clearTimeout(this.installTimeout);\n\n // resizer\n if (this.resizerRefTable.current && this.resizerRefTable.current._installed) {\n this.resizerRefTable.current._installed = true;\n const ths = this.resizerRefTable.current.querySelectorAll('th');\n for (let i = 0; i < ths.length; i++) {\n const div = ths[i].querySelector('.resize-handle');\n if (div) {\n div.onmousedown = null;\n div.remove();\n }\n }\n }\n }\n\n resizerApplyWidths() {\n const gridTemplateColumns = [];\n if (this.resizerCurrentWidths.length) {\n for (let c = 0; c < this.resizerCurrentWidths.length; c++) {\n if (this.resizerCurrentWidths[c]) {\n gridTemplateColumns.push(this.resizerCurrentWidths[c] !== 'auto' ? this.resizerCurrentWidths[c] + 'px' : 'auto');\n } else if (this.props.initialWidths && this.props.initialWidths[c]) {\n gridTemplateColumns.push(this.props.initialWidths[c] !== 'auto' ? this.props.initialWidths[c] + 'px' : 'auto');\n } else {\n gridTemplateColumns.push('auto');\n }\n }\n } else if (this.props.initialWidths) {\n for (let c = 0; c < this.props.initialWidths.length; c++) {\n if (this.props.initialWidths[c]) {\n gridTemplateColumns.push(this.props.initialWidths[c] !== 'auto' ? this.props.initialWidths[c] + 'px' : 'auto');\n } else {\n gridTemplateColumns.push('auto');\n }\n }\n }\n\n if (this.resizerRefTable.current && gridTemplateColumns.length) {\n this.resizerRefTable.current.style.gridTemplateColumns = gridTemplateColumns.join(' ');\n }\n\n return gridTemplateColumns.length ? gridTemplateColumns.join(' ') : undefined;\n }\n\n resizerMouseMove = e => {\n if (this.resizerActiveDiv) {\n const width = this.resizerOldWidth + e.clientX - this.resizerPosition;\n const widthNext = this.resizerOldWidthNext - e.clientX + this.resizerPosition;\n if ((!this.resizerMin || width > this.resizerMin) &&\n (!this.resizerMinNext || widthNext > this.resizerMinNext)) {\n this.resizerCurrentWidths[this.resizerActiveIndex] = width;\n this.resizerCurrentWidths[this.resizerActiveIndex + 1] = widthNext;\n this.resizerApplyWidths();\n }\n }\n }\n\n resizerMouseUp = () => {\n (window._localStorage || window.localStorage).setItem(`App.${this.props.name || 'history'}.table`, JSON.stringify(this.resizerCurrentWidths));\n\n this.resizerActiveIndex = null;\n this.resizerActiveDiv = null;\n window.removeEventListener('mousemove', this.resizerMouseMove);\n window.removeEventListener('mouseup', this.resizerMouseUp);\n }\n\n resizerMouseDown = e => {\n if (this.resizerActiveIndex === null || this.resizerActiveIndex === undefined) {\n console.log('Mouse down ' + e.target.dataset.index);\n this.resizerActiveIndex = parseInt(e.target.dataset.index, 10);\n this.resizerActiveDiv = e.target;\n this.resizerMin = this.props.minWidths ? this.props.minWidths[this.resizerActiveIndex] : 0;\n this.resizerMinNext = this.props.minWidths ? this.props.minWidths[this.resizerActiveIndex + 1] : 0;\n this.resizerPosition = e.clientX;\n let ths;\n if (this.resizerCurrentWidths[this.resizerActiveIndex] === 'auto') {\n ths = ths || this.resizerRefTable.current.querySelectorAll('th');\n this.resizerCurrentWidths[this.resizerActiveIndex] = ths[this.resizerActiveIndex].offsetWidth;\n }\n if (this.resizerCurrentWidths[this.resizerActiveIndex + 1] === 'auto') {\n ths = ths || this.resizerRefTable.current.querySelectorAll('th');\n this.resizerCurrentWidths[this.resizerActiveIndex + 1] = ths[this.resizerActiveIndex + 1].offsetWidth;\n }\n\n this.resizerOldWidth = this.resizerCurrentWidths[this.resizerActiveIndex];\n this.resizerOldWidthNext = this.resizerCurrentWidths[this.resizerActiveIndex + 1];\n\n window.addEventListener('mousemove', this.resizerMouseMove);\n window.addEventListener('mouseup', this.resizerMouseUp);\n }\n };\n\n render() {\n if (this.props.ready === false) {\n return <Skeleton />;\n }\n\n const style = { gridTemplateColumns: this.resizerApplyWidths() };\n\n return <Table\n stickyHeader={this.props.stickyHeader}\n size={this.props.size || 'small'}\n className={ this.props.classes.table + (this.props.className ? ' ' + this.props.className : '')}\n ref={ this.resizerRefTable }\n style={ Object.assign({}, this.props.style || {}, style) }\n >\n { this.props.children }\n </Table>;\n }\n}\n\nTableResize.propTypes = {\n name: PropTypes.string,\n ready: PropTypes.bool,\n stickyHeader: PropTypes.bool,\n size: PropTypes.string,\n className: PropTypes.string,\n style: PropTypes.object,\n initialWidths: PropTypes.array,\n minWidths: PropTypes.array,\n dblTitle: PropTypes.string,\n};\n\nexport default withStyles(styles)(TableResize);"],"mappings":";;;;;;;;;;;;;;;AAMA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,SAAA,GAAAH,sBAAA,CAAAF,OAAA;AAA8C,SAAAM,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,y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AAG,GAExD,IAAI,CAACpF,KAAK,CAAC6F,QAAQ,CACjB;IACZ;EAAC;EAAA,OAAAjG,WAAA;AAAA,EAvMqBkG,gBAAS;AA0MnClG,WAAW,CAACmG,SAAS,GAAG;EACpBjF,IAAI,EAAEkF,qBAAS,CAACC,MAAM;EACtBV,KAAK,EAAES,qBAAS,CAACE,IAAI;EACrBV,YAAY,EAAEQ,qBAAS,CAACE,IAAI;EAC5BT,IAAI,EAAEO,qBAAS,CAACC,MAAM;EACtBrB,SAAS,EAAEoB,qBAAS,CAACC,MAAM;EAC3Bb,KAAK,EAAEY,qBAAS,CAACG,MAAM;EACvB3F,aAAa,EAAEwF,qBAAS,CAACI,KAAK;EAC9B/D,SAAS,EAAE2D,qBAAS,CAACI,KAAK;EAC1BzB,QAAQ,EAAEqB,qBAAS,CAACC;AACxB,CAAC;AAAC,IAAAI,QAAA,GAEa,IAAAC,kBAAU,EAACzH,MAAM,CAAC,CAACe,WAAW,CAAC;AAAA2G,OAAA,cAAAF,QAAA"}
|
|
1
|
+
{"version":3,"file":"TableResize.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_styles","_Table","_Skeleton","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","valueOf","e","styles","theme","table","display","position","userSelect","cursor","width","right","top","bottom","zIndex","borderRight","borderColor","borderRightStyle","TableResize","_Component","_inherits2","_super","props","_this","_classCallCheck2","_defineProperty2","_assertThisInitialized2","c","resizerCurrentWidths","length","initialWidths","window","_localStorage","localStorage","setItem","concat","name","JSON","stringify","resizerApplyWidths","resizerActiveDiv","resizerOldWidth","clientX","resizerPosition","widthNext","resizerOldWidthNext","resizerMin","resizerMinNext","resizerActiveIndex","removeEventListener","resizerMouseMove","resizerMouseUp","undefined","console","log","target","dataset","index","parseInt","minWidths","ths","resizerRefTable","current","querySelectorAll","offsetWidth","addEventListener","React","createRef","_createClass2","value","componentDidMount","resizerInstall","componentWillUnmount","resizerUninstall","_this2","_installed","widthsStored","getItem","widthFilled","parse","tableWidth","storedWidth","w","isFinite","Math","abs","i","push","div","document","createElement","toString","onmousedown","resizerMouseDown","ondblclick","resizerReset","title","dblTitle","className","appendChild","installTimeout","setTimeout","clearTimeout","querySelector","remove","gridTemplateColumns","style","join","render","ready","stickyHeader","size","classes","ref","assign","children","Component","propTypes","PropTypes","string","bool","object","array","_default","withStyles","exports"],"sources":["TableResize.jsx"],"sourcesContent":["/**\n * Copyright 2022, bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles} from '@mui/styles';\n\nimport Table from '@mui/material/Table';\nimport Skeleton from '@mui/material/Skeleton';\n\nconst styles = theme => ({\n table: {\n display: 'grid',\n '& tr': {\n display: 'contents',\n },\n '& thead': {\n display: 'contents',\n },\n '& tbody': {\n display: 'contents',\n },\n '& th': { // resizer\n position: 'sticky',\n userSelect: 'none',\n },\n '& .resize-handle': { // resizer\n display: 'block',\n position: 'absolute',\n cursor: 'col-resize',\n width: 7,\n right: 0,\n top: 2,\n bottom: 2,\n zIndex: 1,\n borderRight: '2px dotted #888',\n '&:hover': {\n borderColor: '#ccc',\n borderRightStyle: 'solid',\n }\n , '&.active': {\n borderColor: '#517ea5',\n borderRightStyle: 'solid',\n }\n }\n },\n});\n\nclass TableResize extends Component {\n constructor(props) {\n super(props);\n this.resizerRefTable = React.createRef();\n this.resizerActiveIndex = null;\n this.resizerActiveDiv = null;\n this.resizerCurrentWidths = [];\n }\n\n componentDidMount() {\n this.resizerInstall();\n }\n\n componentWillUnmount() {\n this.resizerUninstall();\n }\n\n resizerInstall() {\n if (this.resizerRefTable.current && !this.resizerRefTable.current._installed) {\n this.resizerRefTable.current._installed = true;\n const ths = this.resizerRefTable.current.querySelectorAll('th');\n\n const widthsStored = (window._localStorage || window.localStorage).getItem(`App.${this.props.name || 'history'}.table`);\n this.widthFilled = false;\n\n if (widthsStored) {\n try {\n this.resizerCurrentWidths = JSON.parse(widthsStored);\n this.widthFilled = true;\n } catch (e) {\n // ignore\n }\n }\n if (this.widthFilled) {\n if (this.resizerCurrentWidths.length !== ths.length) {\n this.resizerCurrentWidths = [];\n this.widthFilled = false;\n } else {\n const tableWidth = this.resizerRefTable.current.offsetWidth;\n let storedWidth = 0;\n for (let w = 0; w < this.resizerCurrentWidths.length; w++) {\n if (isFinite(this.resizerCurrentWidths[w])) {\n storedWidth += this.resizerCurrentWidths[w];\n } else {\n storedWidth = null;\n break;\n }\n }\n if (storedWidth !== null && Math.abs(storedWidth - tableWidth) > 20) {\n this.resizerCurrentWidths = [];\n this.widthFilled = false;\n }\n }\n }\n\n for (let i = 0; i < ths.length; i++) {\n !this.widthFilled && this.resizerCurrentWidths.push(ths[i].offsetWidth);\n\n // last column does need handle\n if (i < ths.length - 1) {\n const div = window.document.createElement('div');\n div.dataset.index = i.toString();\n div.onmousedown = this.resizerMouseDown;\n div.ondblclick = this.resizerReset;\n div.title = this.props.dblTitle || 'Double click to reset table layout';\n div.className = 'resize-handle';\n ths[i].appendChild(div);\n }\n }\n if (this.widthFilled) {\n this.resizerApplyWidths();\n }\n } else {\n this.installTimeout = setTimeout(() => {\n this.installTimeout = null;\n this.resizerInstall()\n }, 100);\n }\n }\n\n resizerReset = () => {\n for (let c = 0; c < this.resizerCurrentWidths.length; c++) {\n this.resizerCurrentWidths[c] = (this.props.initialWidths || [])[c] || 'auto';\n }\n\n (window._localStorage || window.localStorage).setItem(`App.${this.props.name || 'history'}.table`, JSON.stringify(this.resizerCurrentWidths));\n this.resizerApplyWidths();\n }\n\n resizerUninstall() {\n this.installTimeout && clearTimeout(this.installTimeout);\n\n // resizer\n if (this.resizerRefTable.current && this.resizerRefTable.current._installed) {\n this.resizerRefTable.current._installed = true;\n const ths = this.resizerRefTable.current.querySelectorAll('th');\n for (let i = 0; i < ths.length; i++) {\n const div = ths[i].querySelector('.resize-handle');\n if (div) {\n div.onmousedown = null;\n div.remove();\n }\n }\n }\n }\n\n resizerApplyWidths() {\n const gridTemplateColumns = [];\n if (this.resizerCurrentWidths.length) {\n for (let c = 0; c < this.resizerCurrentWidths.length; c++) {\n if (this.resizerCurrentWidths[c]) {\n gridTemplateColumns.push(this.resizerCurrentWidths[c] !== 'auto' ? this.resizerCurrentWidths[c] + 'px' : 'auto');\n } else if (this.props.initialWidths && this.props.initialWidths[c]) {\n gridTemplateColumns.push(this.props.initialWidths[c] !== 'auto' ? this.props.initialWidths[c] + 'px' : 'auto');\n } else {\n gridTemplateColumns.push('auto');\n }\n }\n } else if (this.props.initialWidths) {\n for (let c = 0; c < this.props.initialWidths.length; c++) {\n if (this.props.initialWidths[c]) {\n gridTemplateColumns.push(this.props.initialWidths[c] !== 'auto' ? this.props.initialWidths[c] + 'px' : 'auto');\n } else {\n gridTemplateColumns.push('auto');\n }\n }\n }\n\n if (this.resizerRefTable.current && gridTemplateColumns.length) {\n this.resizerRefTable.current.style.gridTemplateColumns = gridTemplateColumns.join(' ');\n }\n\n return gridTemplateColumns.length ? gridTemplateColumns.join(' ') : undefined;\n }\n\n resizerMouseMove = e => {\n if (this.resizerActiveDiv) {\n const width = this.resizerOldWidth + e.clientX - this.resizerPosition;\n const widthNext = this.resizerOldWidthNext - e.clientX + this.resizerPosition;\n if ((!this.resizerMin || width > this.resizerMin) &&\n (!this.resizerMinNext || widthNext > this.resizerMinNext)) {\n this.resizerCurrentWidths[this.resizerActiveIndex] = width;\n this.resizerCurrentWidths[this.resizerActiveIndex + 1] = widthNext;\n this.resizerApplyWidths();\n }\n }\n }\n\n resizerMouseUp = () => {\n (window._localStorage || window.localStorage).setItem(`App.${this.props.name || 'history'}.table`, JSON.stringify(this.resizerCurrentWidths));\n\n this.resizerActiveIndex = null;\n this.resizerActiveDiv = null;\n window.removeEventListener('mousemove', this.resizerMouseMove);\n window.removeEventListener('mouseup', this.resizerMouseUp);\n }\n\n resizerMouseDown = e => {\n if (this.resizerActiveIndex === null || this.resizerActiveIndex === undefined) {\n console.log('Mouse down ' + e.target.dataset.index);\n this.resizerActiveIndex = parseInt(e.target.dataset.index, 10);\n this.resizerActiveDiv = e.target;\n this.resizerMin = this.props.minWidths ? this.props.minWidths[this.resizerActiveIndex] : 0;\n this.resizerMinNext = this.props.minWidths ? this.props.minWidths[this.resizerActiveIndex + 1] : 0;\n this.resizerPosition = e.clientX;\n let ths;\n if (this.resizerCurrentWidths[this.resizerActiveIndex] === 'auto') {\n ths = ths || this.resizerRefTable.current.querySelectorAll('th');\n this.resizerCurrentWidths[this.resizerActiveIndex] = ths[this.resizerActiveIndex].offsetWidth;\n }\n if (this.resizerCurrentWidths[this.resizerActiveIndex + 1] === 'auto') {\n ths = ths || this.resizerRefTable.current.querySelectorAll('th');\n this.resizerCurrentWidths[this.resizerActiveIndex + 1] = ths[this.resizerActiveIndex + 1].offsetWidth;\n }\n\n this.resizerOldWidth = this.resizerCurrentWidths[this.resizerActiveIndex];\n this.resizerOldWidthNext = this.resizerCurrentWidths[this.resizerActiveIndex + 1];\n\n window.addEventListener('mousemove', this.resizerMouseMove);\n window.addEventListener('mouseup', this.resizerMouseUp);\n }\n };\n\n render() {\n if (this.props.ready === false) {\n return <Skeleton />;\n }\n\n const style = { gridTemplateColumns: this.resizerApplyWidths() };\n\n return <Table\n stickyHeader={this.props.stickyHeader}\n size={this.props.size || 'small'}\n className={ this.props.classes.table + (this.props.className ? ' ' + this.props.className : '')}\n ref={ this.resizerRefTable }\n style={ Object.assign({}, this.props.style || {}, style) }\n >\n { this.props.children }\n </Table>;\n }\n}\n\nTableResize.propTypes = {\n name: PropTypes.string,\n ready: PropTypes.bool,\n stickyHeader: PropTypes.bool,\n size: PropTypes.string,\n className: PropTypes.string,\n style: PropTypes.object,\n initialWidths: PropTypes.array,\n minWidths: PropTypes.array,\n dblTitle: PropTypes.string,\n};\n\nexport default withStyles(styles)(TableResize);"],"mappings":";;;;;;;;;;;;;;;AAMA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,SAAA,GAAAH,sBAAA,CAAAF,OAAA;AAA8C,SAAAM,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GA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C1BzB,QAAQ,EAAEqB,qBAAS,CAACC;AACxB,CAAC;AAAC,IAAAI,QAAA,GAEa,IAAAC,kBAAU,EAACzH,MAAM,CAAC,CAACe,WAAW,CAAC;AAAA2G,OAAA,cAAAF,QAAA"}
|
package/Dialogs/Confirm.js
CHANGED
|
@@ -25,7 +25,12 @@ var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
|
|
|
25
25
|
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
26
26
|
var _i18n = _interopRequireDefault(require("../i18n"));
|
|
27
27
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
28
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
28
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /**
|
|
29
|
+
* Copyright 2019-2022 bluefox <dogafox@gmail.com>
|
|
30
|
+
*
|
|
31
|
+
* MIT License
|
|
32
|
+
*
|
|
33
|
+
**/ // please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
29
34
|
var styles = {
|
|
30
35
|
suppress: {
|
|
31
36
|
fontSize: 12
|
package/Dialogs/Confirm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Confirm.js","names":["_react","_interopRequireDefault","require","_propTypes","_withStyles","_Button","_Dialog","_DialogActions","_DialogContent","_DialogContentText","_DialogTitle","_FormControlLabel","_Checkbox","_Check","_Close","_i18n","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","suppress","fontSize","suppressRoot","marginTop","DialogConfirm","_React$Component","_inherits2","_super","props","_this","_classCallCheck2","dialogName","suppressQuestionMinutes","Error","parseInt","window","_localStorage","localStorage","getItem","Date","now","removeItem","state","_createClass2","key","value","handleOk","setItem","onClose","handleCancel","render","_this2","setTimeout","createElement","open","maxWidth","fullWidth","undefined","event","reason","id","title","I18n","t","icon","text","classes","label","root","control","checked","onChange","setState","suppressText","variant","onClick","color","autoFocus","startIcon","ok","cancel","React","Component","propTypes","PropTypes","func","isRequired","bool","string","object","number","_export","withStyles","_default","exports"],"sources":["Confirm.js"],"sourcesContent":["/**\n * Copyright 2019-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Checkbox from '@mui/material/Checkbox';\n\nimport IconCheck from '@mui/icons-material/Check';\nimport IconClose from '@mui/icons-material/Close';\n\nimport I18n from '../i18n';\n\nconst styles = {\n suppress: {\n fontSize: 12,\n },\n suppressRoot: {\n marginTop: 16\n }\n};\n\n/**\n * @typedef {object} DialogConfirmProps\n * @property {string} [title] The dialog title; default: Are you sure? (translated)\n * @property {string} text The dialog text.\n * @property {string} [ok] The ok button text; default: OK (translated)\n * @property {string} [cancel] The cancel button text; default: Cancel (translated)\n * @property {string} [suppressQuestionMinutes] interval in minutes for which the confirm dialog will be suppressed if activated.\n * @property {string} [suppressText] The suppress checkbox text; default: Suppress question for next %s minutes (translated)\n * @property {string} [dialogName] Name of the dialog. Used only with suppressQuestionMinutes to store the user choice\n * @property {(ok: boolean) => void} [onClose] Close handler.\n *\n * @extends {React.Component<DialogConfirmProps>}\n */\nclass DialogConfirm extends React.Component {\n constructor(props) {\n super(props);\n\n if (!this.props.dialogName && this.props.suppressQuestionMinutes) {\n throw new Error('dialogName required if suppressQuestionMinutes used');\n }\n let suppress = false;\n\n if (this.props.suppressQuestionMinutes) {\n suppress = parseInt((window._localStorage || window.localStorage).getItem(this.props.dialogName), 10) || 0;\n\n if (!suppress) {\n suppress = false;\n } else if (Date.now() > suppress) {\n (window._localStorage || window.localStorage).removeItem(this.props.dialogName);\n suppress = false;\n }\n }\n\n this.state = {\n suppress,\n };\n }\n\n handleOk() {\n if (this.state.suppress) {\n (window._localStorage || window.localStorage).setItem(this.props.dialogName, Date.now() + this.props.suppressQuestionMinutes * 60000);\n }\n this.props.onClose && this.props.onClose(true);\n };\n\n handleCancel() {\n this.props.onClose && this.props.onClose(false);\n };\n\n render() {\n if (typeof this.state.suppress === 'number') {\n setTimeout(() => this.props.onClose && this.props.onClose(true), 100);\n return null;\n }\n\n return <Dialog\n open={!0}\n maxWidth=\"md\"\n fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}\n onClose={(event, reason) => {\n if (reason !== 'backdropClick' && reason !== 'escapeKeyDown') {\n this.handleCancel()\n }\n }}\n aria-labelledby=\"confirmation-dialog-title\"\n aria-describedby=\"confirmation-dialog-description\"\n >\n <DialogTitle id=\"confirmation-dialog-title\">{this.props.title || I18n.t('ra_Are you sure?')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"confirmation-dialog-description\">\n {this.props.icon || null}\n {this.props.text}\n {this.props.suppressQuestionMinutes ? <br/> : null}\n {this.props.suppressQuestionMinutes ?\n <FormControlLabel\n classes={{label: this.props.classes.suppress, root: this.props.classes.suppressRoot}}\n control={<Checkbox checked={!!this.state.suppress} onChange={() => this.setState({suppress: !this.state.suppress})} />}\n label={this.props.suppressText || I18n.t('ra_Suppress question for next %s minutes', this.props.suppressQuestionMinutes)}\n /> :\n null}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconCheck />}>{this.props.ok || I18n.t('ra_Ok')}</Button>\n <Button variant=\"contained\" onClick={() => this.handleCancel()} color=\"grey\" startIcon={<IconClose />}>{this.props.cancel || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogConfirm.propTypes = {\n onClose: PropTypes.func.isRequired,\n fullWidth: PropTypes.bool,\n title: PropTypes.string,\n text: PropTypes.string,\n ok: PropTypes.string,\n cancel: PropTypes.string,\n icon: PropTypes.object,\n suppressQuestionMinutes: PropTypes.number,\n suppressText: PropTypes.string,\n dialogName: PropTypes.string,\n};\n\nconst _export = withStyles(styles)(DialogConfirm);\nexport default _export;"],"mappings":";;;;;;;;;;;;AAQA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,cAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,kBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,YAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,iBAAA,GAAAV,sBAAA,CAAA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CAAC,OAAO,CAAC,CAAU,eAC3JlF,MAAA,YAAAwE,aAAA,CAACnE,OAAA,WAAM;QAACwF,OAAO,EAAC,WAAW;QAACC,OAAO,EAAE,SAAAA,QAAA;UAAA,OAAMxB,MAAI,CAACF,YAAY,EAAE;QAAA,CAAC;QAAC2B,KAAK,EAAC,MAAM;QAACE,SAAS,eAAEjG,MAAA,YAAAwE,aAAA,CAAC1D,MAAA,WAAS;MAAI,GAAE,IAAI,CAACiC,KAAK,CAACoD,MAAM,IAAIlB,gBAAI,CAACC,CAAC,CAAC,WAAW,CAAC,CAAU,CAC9I,CACX;IACb;EAAC;EAAA,OAAAvC,aAAA;AAAA,EA1EuByD,iBAAK,CAACC,SAAS;AA6E3C1D,aAAa,CAAC2D,SAAS,GAAG;EACtBnC,OAAO,EAAEoC,qBAAS,CAACC,IAAI,CAACC,UAAU;EAClC9B,SAAS,EAAE4B,qBAAS,CAACG,IAAI;EACzB1B,KAAK,EAAEuB,qBAAS,CAACI,MAAM;EACvBvB,IAAI,EAAEmB,qBAAS,CAACI,MAAM;EACtBT,EAAE,EAAEK,qBAAS,CAACI,MAAM;EACpBR,MAAM,EAAEI,qBAAS,CAACI,MAAM;EACxBxB,IAAI,EAAEoB,qBAAS,CAACK,MAAM;EACtBzD,uBAAuB,EAAEoD,qBAAS,CAACM,MAAM;EACzCjB,YAAY,EAAEW,qBAAS,CAACI,MAAM;EAC9BzD,UAAU,EAAEqD,qBAAS,CAACI;AAC1B,CAAC;AAED,IAAMG,OAAO,GAAG,IAAAC,sBAAU,EAACzE,MAAM,CAAC,CAACK,aAAa,CAAC;AAAC,IAAAqE,QAAA,GACnCF,OAAO;AAAAG,OAAA,cAAAD,QAAA"}
|
|
1
|
+
{"version":3,"file":"Confirm.js","names":["_react","_interopRequireDefault","require","_propTypes","_withStyles","_Button","_Dialog","_DialogActions","_DialogContent","_DialogContentText","_DialogTitle","_FormControlLabel","_Checkbox","_Check","_Close","_i18n","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","suppress","fontSize","suppressRoot","marginTop","DialogConfirm","_React$Component","_inherits2","_super","props","_this","_classCallCheck2","dialogName","suppressQuestionMinutes","Error","parseInt","window","_localStorage","localStorage","getItem","Date","now","removeItem","state","_createClass2","key","value","handleOk","setItem","onClose","handleCancel","render","_this2","setTimeout","createElement","open","maxWidth","fullWidth","undefined","event","reason","id","title","I18n","t","icon","text","classes","label","root","control","checked","onChange","setState","suppressText","variant","onClick","color","autoFocus","startIcon","ok","cancel","React","Component","propTypes","PropTypes","func","isRequired","bool","string","object","number","_export","withStyles","_default","exports"],"sources":["Confirm.js"],"sourcesContent":["/**\n * Copyright 2019-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Checkbox from '@mui/material/Checkbox';\n\nimport IconCheck from '@mui/icons-material/Check';\nimport IconClose from '@mui/icons-material/Close';\n\nimport I18n from '../i18n';\n\nconst styles = {\n suppress: {\n fontSize: 12,\n },\n suppressRoot: {\n marginTop: 16\n }\n};\n\n/**\n * @typedef {object} DialogConfirmProps\n * @property {string} [title] The dialog title; default: Are you sure? (translated)\n * @property {string} text The dialog text.\n * @property {string} [ok] The ok button text; default: OK (translated)\n * @property {string} [cancel] The cancel button text; default: Cancel (translated)\n * @property {string} [suppressQuestionMinutes] interval in minutes for which the confirm dialog will be suppressed if activated.\n * @property {string} [suppressText] The suppress checkbox text; default: Suppress question for next %s minutes (translated)\n * @property {string} [dialogName] Name of the dialog. Used only with suppressQuestionMinutes to store the user choice\n * @property {(ok: boolean) => void} [onClose] Close handler.\n *\n * @extends {React.Component<DialogConfirmProps>}\n */\nclass DialogConfirm extends React.Component {\n constructor(props) {\n super(props);\n\n if (!this.props.dialogName && this.props.suppressQuestionMinutes) {\n throw new Error('dialogName required if suppressQuestionMinutes used');\n }\n let suppress = false;\n\n if (this.props.suppressQuestionMinutes) {\n suppress = parseInt((window._localStorage || window.localStorage).getItem(this.props.dialogName), 10) || 0;\n\n if (!suppress) {\n suppress = false;\n } else if (Date.now() > suppress) {\n (window._localStorage || window.localStorage).removeItem(this.props.dialogName);\n suppress = false;\n }\n }\n\n this.state = {\n suppress,\n };\n }\n\n handleOk() {\n if (this.state.suppress) {\n (window._localStorage || window.localStorage).setItem(this.props.dialogName, Date.now() + this.props.suppressQuestionMinutes * 60000);\n }\n this.props.onClose && this.props.onClose(true);\n };\n\n handleCancel() {\n this.props.onClose && this.props.onClose(false);\n };\n\n render() {\n if (typeof this.state.suppress === 'number') {\n setTimeout(() => this.props.onClose && this.props.onClose(true), 100);\n return null;\n }\n\n return <Dialog\n open={!0}\n maxWidth=\"md\"\n fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}\n onClose={(event, reason) => {\n if (reason !== 'backdropClick' && reason !== 'escapeKeyDown') {\n this.handleCancel()\n }\n }}\n aria-labelledby=\"confirmation-dialog-title\"\n aria-describedby=\"confirmation-dialog-description\"\n >\n <DialogTitle id=\"confirmation-dialog-title\">{this.props.title || I18n.t('ra_Are you sure?')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"confirmation-dialog-description\">\n {this.props.icon || null}\n {this.props.text}\n {this.props.suppressQuestionMinutes ? <br/> : null}\n {this.props.suppressQuestionMinutes ?\n <FormControlLabel\n classes={{label: this.props.classes.suppress, root: this.props.classes.suppressRoot}}\n control={<Checkbox checked={!!this.state.suppress} onChange={() => this.setState({suppress: !this.state.suppress})} />}\n label={this.props.suppressText || I18n.t('ra_Suppress question for next %s minutes', this.props.suppressQuestionMinutes)}\n /> :\n null}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconCheck />}>{this.props.ok || I18n.t('ra_Ok')}</Button>\n <Button variant=\"contained\" onClick={() => this.handleCancel()} color=\"grey\" startIcon={<IconClose />}>{this.props.cancel || I18n.t('ra_Cancel')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogConfirm.propTypes = {\n onClose: PropTypes.func.isRequired,\n fullWidth: PropTypes.bool,\n title: PropTypes.string,\n text: PropTypes.string,\n ok: PropTypes.string,\n cancel: PropTypes.string,\n icon: PropTypes.object,\n suppressQuestionMinutes: PropTypes.number,\n suppressText: PropTypes.string,\n dialogName: PropTypes.string,\n};\n\nconst _export = withStyles(styles)(DialogConfirm);\nexport default _export;"],"mappings":";;;;;;;;;;;;AAQA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,cAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,kBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,YAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,iBAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,SAAA,GAAAX,sBAAA,CAAAC,OAAA;AAEA,IAAAW,MAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,MAAA,GAAAb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OAAO,EAAC,WAAW;QAACC,OAAO,EAAE,SAAAA,QAAA;UAAA,OAAMxB,MAAI,CAACF,YAAY,EAAE;QAAA,CAAC;QAAC2B,KAAK,EAAC,MAAM;QAACE,SAAS,eAAEjG,MAAA,YAAAwE,aAAA,CAAC1D,MAAA,WAAS;MAAI,GAAE,IAAI,CAACiC,KAAK,CAACoD,MAAM,IAAIlB,gBAAI,CAACC,CAAC,CAAC,WAAW,CAAC,CAAU,CAC9I,CACX;IACb;EAAC;EAAA,OAAAvC,aAAA;AAAA,EA1EuByD,iBAAK,CAACC,SAAS;AA6E3C1D,aAAa,CAAC2D,SAAS,GAAG;EACtBnC,OAAO,EAAEoC,qBAAS,CAACC,IAAI,CAACC,UAAU;EAClC9B,SAAS,EAAE4B,qBAAS,CAACG,IAAI;EACzB1B,KAAK,EAAEuB,qBAAS,CAACI,MAAM;EACvBvB,IAAI,EAAEmB,qBAAS,CAACI,MAAM;EACtBT,EAAE,EAAEK,qBAAS,CAACI,MAAM;EACpBR,MAAM,EAAEI,qBAAS,CAACI,MAAM;EACxBxB,IAAI,EAAEoB,qBAAS,CAACK,MAAM;EACtBzD,uBAAuB,EAAEoD,qBAAS,CAACM,MAAM;EACzCjB,YAAY,EAAEW,qBAAS,CAACI,MAAM;EAC9BzD,UAAU,EAAEqD,qBAAS,CAACI;AAC1B,CAAC;AAED,IAAMG,OAAO,GAAG,IAAAC,sBAAU,EAACzE,MAAM,CAAC,CAACK,aAAa,CAAC;AAAC,IAAAqE,QAAA,GACnCF,OAAO;AAAAG,OAAA,cAAAD,QAAA"}
|
package/Dialogs/Error.js
CHANGED
|
@@ -22,7 +22,12 @@ var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
|
22
22
|
var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
|
|
23
23
|
var _i18n = _interopRequireDefault(require("../i18n"));
|
|
24
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
25
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
25
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /**
|
|
26
|
+
* Copyright 2018-2022 bluefox <dogafox@gmail.com>
|
|
27
|
+
*
|
|
28
|
+
* MIT License
|
|
29
|
+
*
|
|
30
|
+
**/ // please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
26
31
|
var styles = function styles(theme) {
|
|
27
32
|
return {
|
|
28
33
|
titleBackground: {},
|
package/Dialogs/Error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Error.js","names":["_react","_interopRequireDefault","require","_propTypes","_withStyles","_Button","_Dialog","_DialogActions","_DialogContent","_DialogContentText","_DialogTitle","_Check","_i18n","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","theme","titleBackground","titleColor","DialogError","_React$Component","_inherits2","_super","_classCallCheck2","_createClass2","key","value","handleOk","props","onClose","render","_this","createElement","open","maxWidth","fullWidth","undefined","className","classes","root","id","title","I18n","t","text","variant","onClick","color","autoFocus","startIcon","React","Component","propTypes","PropTypes","func","isRequired","bool","string","oneOfType","element","icon","object","_export","withStyles","_default","exports"],"sources":["Error.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport IconCheck from '@mui/icons-material/Check';\n\nimport I18n from '../i18n';\n\nconst styles = theme => ({\n titleBackground: {\n\n },\n titleColor: {\n\n }\n});\n\n/**\n * @typedef {object} DialogErrorProps\n * @property {string} [title] The dialog title; default: Error (translated)\n * @property {string | JSX.Element} text The dialog text.\n * @property {() => void} [onClose] Close handler.\n * @property {{titleBackground: string; titleColor: string}} classes The styling class names.\n *\n * @extends {React.Component<DialogErrorProps>}\n */\nclass DialogError extends React.Component {\n handleOk() {\n this.props.onClose && this.props.onClose();\n };\n\n render() {\n return <Dialog\n open={!0}\n maxWidth=\"sm\"\n fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}\n onClose={() => this.handleOk()}\n aria-labelledby=\"alert-dialog-title\"\n aria-describedby=\"alert-dialog-description\"\n >\n <DialogTitle className={this.props.classes.titleBackground}\n classes={{root: this.props.classes.titleColor}}\n id=\"alert-dialog-title\">{this.props.title || I18n.t('ra_Error')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"alert-dialog-description\">\n {this.props.text || I18n.t('ra_Unknown error!')}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconCheck />}>{I18n.t('ra_Ok')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogError.propTypes = {\n onClose: PropTypes.func.isRequired,\n fullWidth: PropTypes.bool,\n title: PropTypes.string,\n text: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.element\n ]),\n icon: PropTypes.object\n};\n\n/** @type {typeof DialogError} */\nconst _export = withStyles(styles)(DialogError);\nexport default _export;\n"],"mappings":";;;;;;;;;;;;AAOA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,cAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,kBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,YAAA,GAAAT,sBAAA,CAAAC,OAAA;AAEA,IAAAS,MAAA,GAAAV,sBAAA,CAAAC,OAAA;AAEA,IAAAU,KAAA,GAAAX,sBAAA,CAAAC,OAAA;AAA2B,SAAAW,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAF,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,mBAAAP,MAAA;AAAA,SAAAJ,0BAAA,eAAAO,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,OAAA,CAAAC,SAAA,CAAAM,OAAA,8CAAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"Error.js","names":["_react","_interopRequireDefault","require","_propTypes","_withStyles","_Button","_Dialog","_DialogActions","_DialogContent","_DialogContentText","_DialogTitle","_Check","_i18n","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","theme","titleBackground","titleColor","DialogError","_React$Component","_inherits2","_super","_classCallCheck2","_createClass2","key","value","handleOk","props","onClose","render","_this","createElement","open","maxWidth","fullWidth","undefined","className","classes","root","id","title","I18n","t","text","variant","onClick","color","autoFocus","startIcon","React","Component","propTypes","PropTypes","func","isRequired","bool","string","oneOfType","element","icon","object","_export","withStyles","_default","exports"],"sources":["Error.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport withStyles from '@mui/styles/withStyles';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport IconCheck from '@mui/icons-material/Check';\n\nimport I18n from '../i18n';\n\nconst styles = theme => ({\n titleBackground: {\n\n },\n titleColor: {\n\n }\n});\n\n/**\n * @typedef {object} DialogErrorProps\n * @property {string} [title] The dialog title; default: Error (translated)\n * @property {string | JSX.Element} text The dialog text.\n * @property {() => void} [onClose] Close handler.\n * @property {{titleBackground: string; titleColor: string}} classes The styling class names.\n *\n * @extends {React.Component<DialogErrorProps>}\n */\nclass DialogError extends React.Component {\n handleOk() {\n this.props.onClose && this.props.onClose();\n };\n\n render() {\n return <Dialog\n open={!0}\n maxWidth=\"sm\"\n fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}\n onClose={() => this.handleOk()}\n aria-labelledby=\"alert-dialog-title\"\n aria-describedby=\"alert-dialog-description\"\n >\n <DialogTitle className={this.props.classes.titleBackground}\n classes={{root: this.props.classes.titleColor}}\n id=\"alert-dialog-title\">{this.props.title || I18n.t('ra_Error')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"alert-dialog-description\">\n {this.props.text || I18n.t('ra_Unknown error!')}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconCheck />}>{I18n.t('ra_Ok')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogError.propTypes = {\n onClose: PropTypes.func.isRequired,\n fullWidth: PropTypes.bool,\n title: PropTypes.string,\n text: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.element\n ]),\n icon: PropTypes.object\n};\n\n/** @type {typeof DialogError} */\nconst _export = withStyles(styles)(DialogError);\nexport default _export;\n"],"mappings":";;;;;;;;;;;;AAOA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,cAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,kBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,YAAA,GAAAT,sBAAA,CAAAC,OAAA;AAEA,IAAAS,MAAA,GAAAV,sBAAA,CAAAC,OAAA;AAEA,IAAAU,KAAA,GAAAX,sBAA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eAAErE,MAAA,YAAAoD,aAAA,CAACzC,MAAA,WAAS;MAAI,GAAEmD,gBAAI,CAACC,CAAC,CAAC,OAAO,CAAC,CAAU,CAC9H,CACX;IACb;EAAC;EAAA,OAAAxB,WAAA;AAAA,EA1BqB+B,iBAAK,CAACC,SAAS;AA6BzChC,WAAW,CAACiC,SAAS,GAAG;EACpBvB,OAAO,EAAEwB,qBAAS,CAACC,IAAI,CAACC,UAAU;EAClCpB,SAAS,EAAEkB,qBAAS,CAACG,IAAI;EACzBf,KAAK,EAAEY,qBAAS,CAACI,MAAM;EACvBb,IAAI,EAAES,qBAAS,CAACK,SAAS,CAAC,CACtBL,qBAAS,CAACI,MAAM,EAChBJ,qBAAS,CAACM,OAAO,CACpB,CAAC;EACFC,IAAI,EAAEP,qBAAS,CAACQ;AACpB,CAAC;;AAED;AACA,IAAMC,OAAO,GAAG,IAAAC,sBAAU,EAAChD,MAAM,CAAC,CAACI,WAAW,CAAC;AAAC,IAAA6C,QAAA,GACjCF,OAAO;AAAAG,OAAA,cAAAD,QAAA"}
|
package/Dialogs/Message.js
CHANGED
|
@@ -21,7 +21,12 @@ var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
|
21
21
|
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
22
22
|
var _i18n = _interopRequireDefault(require("../i18n"));
|
|
23
23
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
24
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /**
|
|
25
|
+
* Copyright 2018-2022 bluefox <dogafox@gmail.com>
|
|
26
|
+
*
|
|
27
|
+
* MIT License
|
|
28
|
+
*
|
|
29
|
+
**/ // please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
25
30
|
/**
|
|
26
31
|
* @typedef {object} DialogMessageProps
|
|
27
32
|
* @property {string} [title] The dialog title; default: Message (translated)
|
package/Dialogs/Message.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.js","names":["_react","_interopRequireDefault","require","_propTypes","_Button","_Dialog","_DialogActions","_DialogContent","_DialogContentText","_DialogTitle","_Close","_i18n","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","DialogMessage","_React$Component","_inherits2","_super","_classCallCheck2","_createClass2","key","value","handleOk","props","onClose","render","_this","createElement","open","maxWidth","fullWidth","undefined","id","title","I18n","t","style","marginRight","icon","text","variant","onClick","color","autoFocus","startIcon","ok","React","Component","propTypes","PropTypes","bool","func","isRequired","string","object","_default","exports"],"sources":["Message.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport IconClose from '@mui/icons-material/Close';\n\nimport I18n from '../i18n';\n\n/**\n * @typedef {object} DialogMessageProps\n * @property {string} [title] The dialog title; default: Message (translated)\n * @property {string} text The dialog text.\n * @property {() => void} [onClose] Close handler.\n *\n * @extends {React.Component<DialogMessageProps>}\n */\nclass DialogMessage extends React.Component {\n handleOk() {\n this.props.onClose && this.props.onClose();\n };\n\n render() {\n return <Dialog\n open={!0}\n maxWidth=\"sm\"\n fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}\n onClose={() => this.handleOk()}\n aria-labelledby=\"message-dialog-title\"\n aria-describedby=\"message-dialog-description\"\n >\n <DialogTitle id=\"message-dialog-title\">{this.props.title || I18n.t('ra_Message')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"message-dialog-description\">\n <span style={{ marginRight: this.props.icon ? 8 : 0 }}>{this.props.icon || null}</span>{this.props.text}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconClose />}>{this.props.ok || I18n.t('ra_Close')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogMessage.propTypes = {\n fullWidth: PropTypes.bool,\n onClose: PropTypes.func.isRequired,\n title: PropTypes.string,\n text: PropTypes.string,\n ok: PropTypes.string,\n icon: PropTypes.object\n};\n\nexport default DialogMessage;\n"],"mappings":";;;;;;;;;;;;AAQA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,cAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,kBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,YAAA,GAAAR,sBAAA,CAAAC,OAAA;AAEA,IAAAQ,MAAA,GAAAT,sBAAA,CAAAC,OAAA;AAEA,IAAAS,KAAA,GAAAV,sBAAA,CAAAC,OAAA;AAA2B,SAAAU,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAF,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,mBAAAP,MAAA;AAAA,SAAAJ,0BAAA,eAAAO,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,OAAA,CAAAC,SAAA,CAAAM,OAAA,8CAAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"Message.js","names":["_react","_interopRequireDefault","require","_propTypes","_Button","_Dialog","_DialogActions","_DialogContent","_DialogContentText","_DialogTitle","_Close","_i18n","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","DialogMessage","_React$Component","_inherits2","_super","_classCallCheck2","_createClass2","key","value","handleOk","props","onClose","render","_this","createElement","open","maxWidth","fullWidth","undefined","id","title","I18n","t","style","marginRight","icon","text","variant","onClick","color","autoFocus","startIcon","ok","React","Component","propTypes","PropTypes","bool","func","isRequired","string","object","_default","exports"],"sources":["Message.js"],"sourcesContent":["/**\n * Copyright 2018-2022 bluefox <dogafox@gmail.com>\n *\n * MIT License\n *\n **/\n\n// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogContentText from '@mui/material/DialogContentText';\nimport DialogTitle from '@mui/material/DialogTitle';\n\nimport IconClose from '@mui/icons-material/Close';\n\nimport I18n from '../i18n';\n\n/**\n * @typedef {object} DialogMessageProps\n * @property {string} [title] The dialog title; default: Message (translated)\n * @property {string} text The dialog text.\n * @property {() => void} [onClose] Close handler.\n *\n * @extends {React.Component<DialogMessageProps>}\n */\nclass DialogMessage extends React.Component {\n handleOk() {\n this.props.onClose && this.props.onClose();\n };\n\n render() {\n return <Dialog\n open={!0}\n maxWidth=\"sm\"\n fullWidth={this.props.fullWidth !== undefined ? this.props.fullWidth : true}\n onClose={() => this.handleOk()}\n aria-labelledby=\"message-dialog-title\"\n aria-describedby=\"message-dialog-description\"\n >\n <DialogTitle id=\"message-dialog-title\">{this.props.title || I18n.t('ra_Message')}</DialogTitle>\n <DialogContent>\n <DialogContentText id=\"message-dialog-description\">\n <span style={{ marginRight: this.props.icon ? 8 : 0 }}>{this.props.icon || null}</span>{this.props.text}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"contained\" onClick={() => this.handleOk()} color=\"primary\" autoFocus startIcon={<IconClose />}>{this.props.ok || I18n.t('ra_Close')}</Button>\n </DialogActions>\n </Dialog>;\n }\n}\n\nDialogMessage.propTypes = {\n fullWidth: PropTypes.bool,\n onClose: PropTypes.func.isRequired,\n title: PropTypes.string,\n text: PropTypes.string,\n ok: PropTypes.string,\n icon: PropTypes.object\n};\n\nexport default DialogMessage;\n"],"mappings":";;;;;;;;;;;;AAQA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF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