versacall-core-library-react 2.0.68 → 2.0.70
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/package.json +1 -1
- package/dist/components/CoreAlert/CoreAlert.js +0 -86
- package/dist/components/CoreAlert/index.js +0 -13
- package/dist/components/CoreAlert/readme.md +0 -21
- package/dist/components/CoreAppBar/CoreAppBar.js +0 -365
- package/dist/components/CoreAppBar/CoreAppBarDrawer.js +0 -135
- package/dist/components/CoreAppBar/README.md +0 -27
- package/dist/components/CoreAppBar/index.js +0 -13
- package/dist/components/CoreAppBar/screenshot.png +0 -0
- package/dist/components/CoreAppSelector/AppLink.js +0 -101
- package/dist/components/CoreAppSelector/CoreAppSelector.js +0 -156
- package/dist/components/CoreAppSelector/index.js +0 -13
- package/dist/components/CoreDialogueToolBar/CoreDialogueToolBar.js +0 -123
- package/dist/components/CoreDialogueToolBar/index.js +0 -13
- package/dist/components/CoreDrawer/CoreDrawer.js +0 -237
- package/dist/components/CoreDrawer/README.md +0 -36
- package/dist/components/CoreDrawer/index.js +0 -13
- package/dist/components/CoreDrawer/screenshot_collapsed.png +0 -0
- package/dist/components/CoreDrawer/screenshot_expanded.png +0 -0
- package/dist/components/CoreDropDownTextfield/CoreDropDownTextfield.js +0 -86
- package/dist/components/CoreDropDownTextfield/index.js +0 -13
- package/dist/components/CoreElapsedTime/CoreElapsedTime.js +0 -58
- package/dist/components/CoreElapsedTime/index.js +0 -13
- package/dist/components/CoreFrame/CoreFrame.js +0 -64
- package/dist/components/CoreFrame/index.js +0 -13
- package/dist/components/CoreImportDialog/CoreImportDialog.js +0 -351
- package/dist/components/CoreImportDialog/index.js +0 -13
- package/dist/components/CoreImportResultsDialog/CoreImportResultsDialog.js +0 -103
- package/dist/components/CoreImportResultsDialog/index.js +0 -13
- package/dist/components/CoreImporting/CoreImporting.js +0 -60
- package/dist/components/CoreImporting/index.js +0 -13
- package/dist/components/CorePlugin/CorePlugin.js +0 -135
- package/dist/components/CorePlugin/OldCorePlugin.js +0 -125
- package/dist/components/CorePlugin/index.js +0 -13
- package/dist/components/CoreSaveChangesDialog/CoreSaveChangesDialog.js +0 -62
- package/dist/components/CoreSaveChangesDialog/index.js +0 -13
- package/dist/components/CoreShiftTagFilter/CoreShiftTagFilter.js +0 -351
- package/dist/components/CoreShiftTagFilter/OldCoreShiftTagFilter.js +0 -209
- package/dist/components/CoreShiftTagFilter/index.js +0 -13
- package/dist/components/CoreSideBar/CoreSideBar.js +0 -738
- package/dist/components/CoreSideBar/CoreSideBarDrawer.js +0 -173
- package/dist/components/CoreSideBar/index.js +0 -13
- package/dist/components/CoreSnackBar/CoreSnackBar.js +0 -117
- package/dist/components/CoreSnackBar/index.js +0 -13
- package/dist/components/CoreSnackBar/readme.md +0 -23
- package/dist/components/CoreTable/CoreTable.js +0 -316
- package/dist/components/CoreTable/CoreTableChips.js +0 -50
- package/dist/components/CoreTable/CoreTableHead.js +0 -176
- package/dist/components/CoreTable/CoreTableToolbar.js +0 -108
- package/dist/components/CoreTable/index.js +0 -13
- package/dist/components/CoreTable/readMe.md +0 -79
- package/dist/components/CoreTagFilter/CoreTagFilter.js +0 -276
- package/dist/components/CoreTagFilter/OldCoreTagFilter.js +0 -342
- package/dist/components/CoreTagFilter/OldTagChip.js +0 -44
- package/dist/components/CoreTagFilter/OldTagFilterSelector.js +0 -106
- package/dist/components/CoreTagFilter/OldTagOption.js +0 -53
- package/dist/components/CoreTagFilter/TagFilterBuilder.js +0 -488
- package/dist/components/CoreTagFilter/index.js +0 -13
- package/dist/components/CoreTextField/CoreTextField.js +0 -110
- package/dist/components/CoreTextField/index.js +0 -13
- package/dist/components/CoreTheme/CoreTheme.css +0 -9
- package/dist/components/CoreTheme/CoreTheme.js +0 -51
- package/dist/components/CoreTheme/README.md +0 -3
- package/dist/components/CoreTheme/index.js +0 -13
- package/dist/components/CoreTile/CoreTile.js +0 -62
- package/dist/components/CoreTile/CoreTileToolbar.js +0 -62
- package/dist/components/CoreTile/index.js +0 -13
- package/dist/components/CoreTimerInput/CoreTimerInput.js +0 -203
- package/dist/components/CoreTimerInput/CoreTimerInputOld.js +0 -146
- package/dist/components/CoreTimerInput/index.js +0 -13
- package/dist/components/CoreToolbar/CoreToolbar.js +0 -206
- package/dist/components/CoreToolbar/index.js +0 -13
- package/dist/components/CoreTracker/CoreTracker.js +0 -53
- package/dist/components/CoreTracker/index.js +0 -13
- package/dist/components/CoreTranslate/CoreTranslate.js +0 -62
- package/dist/components/CoreTranslate/README.md +0 -5
- package/dist/components/CoreTranslate/index.js +0 -13
- package/dist/components/CoreTranslate/translations/en.json +0 -451
- package/dist/components/CoreTranslate/translations/es.json +0 -433
- package/dist/components/CoreTranslateWrapper/CoreTranslateWrapper.js +0 -36
- package/dist/components/CoreTranslateWrapper/index.js +0 -13
- package/dist/components/CoreWidget/CoreWidget.js +0 -121
- package/dist/components/CoreWidget/index.js +0 -13
- package/dist/components/CoreWrapper/CoreWrapper.js +0 -51
- package/dist/components/CoreWrapper/README.md +0 -41
- package/dist/components/CoreWrapper/index.js +0 -13
- package/dist/components/index.js +0 -202
- package/dist/constants/index.js +0 -20
- package/dist/constants/testOrganization.js +0 -31
- package/dist/constants/testToken.js +0 -33
- package/dist/context/Authentication/AuthenticationContext.js +0 -10
- package/dist/context/Authentication/AuthenticationProvider.js +0 -226
- package/dist/context/Authentication/README.md +0 -47
- package/dist/context/Authentication/index.js +0 -27
- package/dist/context/Authentication/withAuthentication.js +0 -15
- package/dist/context/Channels/ChannelsConsumer.js +0 -43
- package/dist/context/Channels/ChannelsContext.js +0 -10
- package/dist/context/Channels/ChannelsProvider.js +0 -259
- package/dist/context/Channels/DataChannel.js +0 -68
- package/dist/context/Channels/EntityChannel.js +0 -69
- package/dist/context/Channels/EveryoneChannel.js +0 -55
- package/dist/context/Channels/OrganizationChannel.js +0 -69
- package/dist/context/Channels/README.md +0 -52
- package/dist/context/Channels/UserChannel.js +0 -60
- package/dist/context/Channels/index.js +0 -69
- package/dist/context/Channels/withChannels.js +0 -15
- package/dist/context/Core/CoreContext.js +0 -10
- package/dist/context/Core/CoreProvider.js +0 -108
- package/dist/context/Core/README.md +0 -43
- package/dist/context/Core/index.js +0 -27
- package/dist/context/Core/withCore.js +0 -15
- package/dist/context/Organization/OrganizationContext.js +0 -10
- package/dist/context/Organization/OrganizationProvider.js +0 -80
- package/dist/context/Organization/README.md +0 -82
- package/dist/context/Organization/index.js +0 -27
- package/dist/context/Organization/withOrganization.js +0 -15
- package/dist/context/Plugin/PluginContext.js +0 -10
- package/dist/context/Plugin/PluginProvider.js +0 -79
- package/dist/context/Plugin/index.js +0 -27
- package/dist/context/Plugin/withPlugin.js +0 -15
- package/dist/context/index.js +0 -60
- package/dist/css/index.js +0 -20
- package/dist/css/junk.module.css +0 -3
- package/dist/css/scrollbar.css +0 -35
- package/dist/css/scrollbar.module.css +0 -37
- package/dist/functions/TagEvaluator.js +0 -165
- package/dist/functions/compareObjects.js +0 -27
- package/dist/functions/formatElapsedTime.js +0 -18
- package/dist/functions/formatNameFileSafe.js +0 -16
- package/dist/functions/getIconUrl.js +0 -15
- package/dist/functions/getParameterByName.js +0 -34
- package/dist/functions/getProperty.js +0 -17
- package/dist/functions/getUrl.js +0 -15
- package/dist/functions/index.js +0 -62
- package/dist/icons/CopyIcon.js +0 -42
- package/dist/icons/DeleteIcon.js +0 -42
- package/dist/icons/DuplicateIcon.js +0 -42
- package/dist/icons/EditIcon.js +0 -42
- package/dist/icons/FabAddIcon.js +0 -78
- package/dist/icons/PasteIcon.js +0 -42
- package/dist/icons/index.js +0 -48
- package/dist/index.js +0 -71
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
10
|
-
var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
|
|
11
|
-
var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogActions"));
|
|
12
|
-
var _DialogContent = _interopRequireDefault(require("@material-ui/core/DialogContent"));
|
|
13
|
-
var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle"));
|
|
14
|
-
var _Slide = _interopRequireDefault(require("@material-ui/core/Slide"));
|
|
15
|
-
var _styles = require("@material-ui/core/styles");
|
|
16
|
-
var _reactIntl = require("react-intl");
|
|
17
|
-
var _CoreTable = _interopRequireDefault(require("../CoreTable"));
|
|
18
|
-
var _css = require("../../css");
|
|
19
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } // import DialogContentText from '@material-ui/core/DialogContentText';
|
|
21
|
-
function Transition(props) {
|
|
22
|
-
return /*#__PURE__*/_react.default.createElement(_Slide.default, _extends({
|
|
23
|
-
direction: "up"
|
|
24
|
-
}, props));
|
|
25
|
-
}
|
|
26
|
-
const styles = () => ({
|
|
27
|
-
scrollViewer: {
|
|
28
|
-
maxHeight: 'calc(100vh - 100px)'
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
function CoreImportResultsDialog(props) {
|
|
32
|
-
const {
|
|
33
|
-
classes,
|
|
34
|
-
intl,
|
|
35
|
-
results
|
|
36
|
-
} = props;
|
|
37
|
-
const customCellStatus = _ref => {
|
|
38
|
-
let {
|
|
39
|
-
row
|
|
40
|
-
} = _ref;
|
|
41
|
-
switch (row.statusCode) {
|
|
42
|
-
case 'added':
|
|
43
|
-
return /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, {
|
|
44
|
-
id: "__added"
|
|
45
|
-
});
|
|
46
|
-
case 'updated':
|
|
47
|
-
return /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, {
|
|
48
|
-
id: "__updated"
|
|
49
|
-
});
|
|
50
|
-
default:
|
|
51
|
-
return /*#__PURE__*/_react.default.createElement("span", {
|
|
52
|
-
style: {
|
|
53
|
-
color: '#ff0000'
|
|
54
|
-
}
|
|
55
|
-
}, row.statusCode);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
const columns = [{
|
|
59
|
-
id: 'id',
|
|
60
|
-
label: 'Id'
|
|
61
|
-
}, {
|
|
62
|
-
id: 'name',
|
|
63
|
-
label: intl.formatMessage({
|
|
64
|
-
id: '__name'
|
|
65
|
-
})
|
|
66
|
-
}, {
|
|
67
|
-
id: 'statusCode',
|
|
68
|
-
label: intl.formatMessage({
|
|
69
|
-
id: '__status'
|
|
70
|
-
}),
|
|
71
|
-
customCell: cc => customCellStatus(cc)
|
|
72
|
-
}];
|
|
73
|
-
return /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
74
|
-
open: true,
|
|
75
|
-
TransitionComponent: Transition,
|
|
76
|
-
keepMounted: true,
|
|
77
|
-
onClose: props.onClose
|
|
78
|
-
}, /*#__PURE__*/_react.default.createElement(_DialogTitle.default, null, "".concat(intl.formatMessage({
|
|
79
|
-
id: '__import_results'
|
|
80
|
-
}), " (").concat(results.length, ")")), /*#__PURE__*/_react.default.createElement(_DialogContent.default, {
|
|
81
|
-
className: "".concat(classes.scrollViewer, " ").concat(_css.ScrollbarStyles.scroll)
|
|
82
|
-
}, /*#__PURE__*/_react.default.createElement(_CoreTable.default, {
|
|
83
|
-
id: "id",
|
|
84
|
-
columns: columns,
|
|
85
|
-
data: results,
|
|
86
|
-
hover: false
|
|
87
|
-
})), /*#__PURE__*/_react.default.createElement(_DialogActions.default, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
88
|
-
color: "primary",
|
|
89
|
-
onClick: props.onClose
|
|
90
|
-
}, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, {
|
|
91
|
-
id: "__close"
|
|
92
|
-
}))));
|
|
93
|
-
}
|
|
94
|
-
CoreImportResultsDialog.propTypes = {
|
|
95
|
-
classes: _propTypes.default.shape().isRequired,
|
|
96
|
-
intl: _propTypes.default.shape().isRequired,
|
|
97
|
-
results: _propTypes.default.arrayOf(_propTypes.default.shape()),
|
|
98
|
-
onClose: _propTypes.default.func.isRequired
|
|
99
|
-
};
|
|
100
|
-
CoreImportResultsDialog.defaultProps = {
|
|
101
|
-
results: []
|
|
102
|
-
};
|
|
103
|
-
var _default = exports.default = (0, _reactIntl.injectIntl)((0, _styles.withStyles)(styles)(CoreImportResultsDialog));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _CoreImportResultsDialog.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _CoreImportResultsDialog = _interopRequireDefault(require("./CoreImportResultsDialog"));
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _LinearProgress = _interopRequireDefault(require("@material-ui/core/LinearProgress"));
|
|
10
|
-
var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
|
|
11
|
-
var _DialogContent = _interopRequireDefault(require("@material-ui/core/DialogContent"));
|
|
12
|
-
var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle"));
|
|
13
|
-
var _Slide = _interopRequireDefault(require("@material-ui/core/Slide"));
|
|
14
|
-
var _FiberManualRecord = _interopRequireDefault(require("@material-ui/icons/FiberManualRecord"));
|
|
15
|
-
var _FiberManualRecordOutlined = _interopRequireDefault(require("@material-ui/icons/FiberManualRecordOutlined"));
|
|
16
|
-
var _reactIntl = require("react-intl");
|
|
17
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
19
|
-
function Transition(props) {
|
|
20
|
-
return /*#__PURE__*/_react.default.createElement(_Slide.default, _extends({
|
|
21
|
-
direction: "up"
|
|
22
|
-
}, props));
|
|
23
|
-
}
|
|
24
|
-
function Importing(props) {
|
|
25
|
-
const {
|
|
26
|
-
plan,
|
|
27
|
-
waiting
|
|
28
|
-
} = props;
|
|
29
|
-
return /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
30
|
-
open: true,
|
|
31
|
-
keepMounted: true,
|
|
32
|
-
TransitionComponent: Transition
|
|
33
|
-
}, /*#__PURE__*/_react.default.createElement(_DialogTitle.default, null, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, {
|
|
34
|
-
id: "__importing"
|
|
35
|
-
}), /*#__PURE__*/_react.default.createElement(_LinearProgress.default, null)), /*#__PURE__*/_react.default.createElement(_DialogContent.default, null, plan.map(item => /*#__PURE__*/_react.default.createElement("div", {
|
|
36
|
-
key: item.id,
|
|
37
|
-
style: {
|
|
38
|
-
display: 'flex',
|
|
39
|
-
alignItems: 'center',
|
|
40
|
-
marginBottom: 10
|
|
41
|
-
}
|
|
42
|
-
}, waiting.includes(item.id) ? /*#__PURE__*/_react.default.createElement(_FiberManualRecordOutlined.default, {
|
|
43
|
-
style: {
|
|
44
|
-
marginRight: 10
|
|
45
|
-
}
|
|
46
|
-
}) : /*#__PURE__*/_react.default.createElement(_FiberManualRecord.default, {
|
|
47
|
-
style: {
|
|
48
|
-
marginRight: 10
|
|
49
|
-
}
|
|
50
|
-
}), "".concat(item.name, " (").concat(item.quantity, ")")))));
|
|
51
|
-
}
|
|
52
|
-
Importing.propTypes = {
|
|
53
|
-
plan: _propTypes.default.arrayOf(_propTypes.default.shape()),
|
|
54
|
-
waiting: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
55
|
-
};
|
|
56
|
-
Importing.defaultProps = {
|
|
57
|
-
plan: [],
|
|
58
|
-
waiting: []
|
|
59
|
-
};
|
|
60
|
-
var _default = exports.default = Importing;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _CoreImporting.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _CoreImporting = _interopRequireDefault(require("./CoreImporting"));
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _context = require("../../context");
|
|
10
|
-
var _functions = require("../../functions");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
17
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
|
-
class CorePlugin extends _react.Component {
|
|
20
|
-
constructor() {
|
|
21
|
-
super();
|
|
22
|
-
this.state = {
|
|
23
|
-
versaCallPluginId: Math.floor(Math.random() * 10000 + 9999)
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
componentDidMount() {
|
|
27
|
-
// this.onReceiveMessageBinded = this.onReceiveMessage.bind(this);
|
|
28
|
-
window.addEventListener('message', e => this.onReceiveMessage(e));
|
|
29
|
-
}
|
|
30
|
-
componentDidUpdate(prevProps) {
|
|
31
|
-
if (this.props.withAuthentication && this.props.authentication.didChange(prevProps.authentication)) {
|
|
32
|
-
this.updateAuthentication();
|
|
33
|
-
}
|
|
34
|
-
if (this.props.withOrganization && this.props.organization.didChange(prevProps.organization)) {
|
|
35
|
-
this.updateOrganization();
|
|
36
|
-
}
|
|
37
|
-
if (JSON.stringify(this.props.controller) !== JSON.stringify(prevProps.controller)) {
|
|
38
|
-
this.postMessage({
|
|
39
|
-
controller: this.props.controller
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
componentWillUnmount() {
|
|
44
|
-
window.removeEventListener('message', e => this.onReceiveMessage(e), false);
|
|
45
|
-
}
|
|
46
|
-
onReceiveMessage(event) {
|
|
47
|
-
if (this.props.onChange && typeof event.data === 'object' && event.data.versaCallPluginId && event.data.versaCallPluginId === this.state.versaCallPluginId) {
|
|
48
|
-
this.props.onChange(event.data.controller);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
postMessage(message) {
|
|
52
|
-
this.ifr.contentWindow.postMessage(_objectSpread({
|
|
53
|
-
versaCallPluginId: this.state.versaCallPluginId
|
|
54
|
-
}, message), '*');
|
|
55
|
-
}
|
|
56
|
-
updateAuthentication() {
|
|
57
|
-
if (this.props.withAuthentication) {
|
|
58
|
-
this.postMessage({
|
|
59
|
-
authentication: JSON.parse(JSON.stringify(this.props.authentication))
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
updateOrganization() {
|
|
64
|
-
if (this.props.withOrganization) {
|
|
65
|
-
this.postMessage({
|
|
66
|
-
organization: JSON.parse(JSON.stringify(this.props.organization))
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
handleLoad() {
|
|
71
|
-
this.postMessage({
|
|
72
|
-
// id: this.state.id,
|
|
73
|
-
authentication: this.props.withAuthentication ? JSON.parse(JSON.stringify(this.props.authentication)) : null,
|
|
74
|
-
organization: this.props.withOrganization ? JSON.parse(JSON.stringify(this.props.organization)) : null,
|
|
75
|
-
controller: this.props.controller
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
render() {
|
|
79
|
-
const {
|
|
80
|
-
core,
|
|
81
|
-
plugin,
|
|
82
|
-
sandbox
|
|
83
|
-
} = this.props;
|
|
84
|
-
const {
|
|
85
|
-
versaCallPluginId
|
|
86
|
-
} = this.state;
|
|
87
|
-
return versaCallPluginId !== '' ? /*#__PURE__*/_react.default.createElement("iframe", {
|
|
88
|
-
frameBorder: "0",
|
|
89
|
-
title: "CorePluginFrame",
|
|
90
|
-
sandbox: sandbox,
|
|
91
|
-
onLoad: () => this.handleLoad(),
|
|
92
|
-
ref: f => {
|
|
93
|
-
this.ifr = f;
|
|
94
|
-
return this.ifr;
|
|
95
|
-
},
|
|
96
|
-
style: {
|
|
97
|
-
width: plugin.metadata.width,
|
|
98
|
-
height: plugin.metadata.height
|
|
99
|
-
},
|
|
100
|
-
src: "".concat(core.formatUrl((0, _functions.getUrl)(plugin.metadata)), "?version=").concat(encodeURI(plugin.version))
|
|
101
|
-
}) : /*#__PURE__*/_react.default.createElement("div", null);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
CorePlugin.propTypes = {
|
|
105
|
-
plugin: _propTypes.default.shape({
|
|
106
|
-
componentID: _propTypes.default.string,
|
|
107
|
-
componentType: _propTypes.default.string,
|
|
108
|
-
name: _propTypes.default.string,
|
|
109
|
-
description: _propTypes.default.string,
|
|
110
|
-
version: _propTypes.default.string,
|
|
111
|
-
translation: _propTypes.default.array,
|
|
112
|
-
metadata: _propTypes.default.shape({
|
|
113
|
-
url: _propTypes.default.string,
|
|
114
|
-
iconUrl: _propTypes.default.string,
|
|
115
|
-
width: _propTypes.default.string,
|
|
116
|
-
height: _propTypes.default.string
|
|
117
|
-
})
|
|
118
|
-
}).isRequired,
|
|
119
|
-
sandbox: _propTypes.default.string,
|
|
120
|
-
controller: _propTypes.default.shape(),
|
|
121
|
-
onChange: _propTypes.default.func,
|
|
122
|
-
core: _propTypes.default.shape().isRequired,
|
|
123
|
-
authentication: _propTypes.default.shape().isRequired,
|
|
124
|
-
organization: _propTypes.default.shape().isRequired,
|
|
125
|
-
withAuthentication: _propTypes.default.bool,
|
|
126
|
-
withOrganization: _propTypes.default.bool
|
|
127
|
-
};
|
|
128
|
-
CorePlugin.defaultProps = {
|
|
129
|
-
sandbox: null,
|
|
130
|
-
controller: {},
|
|
131
|
-
onChange: null,
|
|
132
|
-
withAuthentication: false,
|
|
133
|
-
withOrganization: false
|
|
134
|
-
};
|
|
135
|
-
var _default = exports.default = (0, _context.withCore)((0, _context.withAuthentication)((0, _context.withOrganization)(CorePlugin)));
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _context = require("../../context");
|
|
10
|
-
var _functions = require("../../functions");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
-
class CorePlugin extends _react.Component {
|
|
15
|
-
constructor() {
|
|
16
|
-
super();
|
|
17
|
-
this.state = {
|
|
18
|
-
id: Math.floor(Math.random() * 10000 + 9999)
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
componentDidMount() {
|
|
22
|
-
window.addEventListener('message', e => this.onReceiveMessage(e));
|
|
23
|
-
}
|
|
24
|
-
componentDidUpdate(prevProps) {
|
|
25
|
-
if (this.props.withAuthentication && this.props.authentication !== prevProps.authentication) {
|
|
26
|
-
this.updateAuthentication();
|
|
27
|
-
}
|
|
28
|
-
if (this.props.withOrganization && this.props.organization !== prevProps.organization) {
|
|
29
|
-
this.updateOrganization();
|
|
30
|
-
}
|
|
31
|
-
if (this.props.controller !== prevProps.controller) {
|
|
32
|
-
this.postMessage(this.props.controller);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
componentWillUnmount() {
|
|
36
|
-
window.removeEventListener('message', e => this.onReceiveMessage(e), false);
|
|
37
|
-
}
|
|
38
|
-
onReceiveMessage(event) {
|
|
39
|
-
if (this.props.onChange && this.state.id === event.data.id) {
|
|
40
|
-
this.props.onChange(event);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
postMessage(message) {
|
|
44
|
-
this.ifr.contentWindow.postMessage(message, '*');
|
|
45
|
-
}
|
|
46
|
-
updateAuthentication() {
|
|
47
|
-
if (this.props.withAuthentication) {
|
|
48
|
-
this.postMessage({
|
|
49
|
-
authentication: JSON.parse(JSON.stringify(this.props.authentication))
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
updateOrganization() {
|
|
54
|
-
if (this.props.withOrganization) {
|
|
55
|
-
this.postMessage({
|
|
56
|
-
organization: JSON.parse(JSON.stringify(this.props.organization))
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
handleLoad() {
|
|
61
|
-
this.postMessage({
|
|
62
|
-
id: this.state.id,
|
|
63
|
-
authentication: this.props.withAuthentication ? JSON.parse(JSON.stringify(this.props.authentication)) : {},
|
|
64
|
-
organization: this.props.withOrganization ? JSON.parse(JSON.stringify(this.props.organization)) : {},
|
|
65
|
-
controller: this.props.controller
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
render() {
|
|
69
|
-
const {
|
|
70
|
-
core,
|
|
71
|
-
plugin,
|
|
72
|
-
sandbox
|
|
73
|
-
} = this.props;
|
|
74
|
-
const {
|
|
75
|
-
id
|
|
76
|
-
} = this.state;
|
|
77
|
-
return id !== '' ? /*#__PURE__*/_react.default.createElement("iframe", {
|
|
78
|
-
frameBorder: "0",
|
|
79
|
-
title: "CorePluginFrame",
|
|
80
|
-
sandbox: sandbox,
|
|
81
|
-
onLoad: () => this.handleLoad(),
|
|
82
|
-
ref: f => {
|
|
83
|
-
this.ifr = f;
|
|
84
|
-
return this.ifr;
|
|
85
|
-
},
|
|
86
|
-
style: {
|
|
87
|
-
width: plugin.metadata.width,
|
|
88
|
-
height: plugin.metadata.height
|
|
89
|
-
},
|
|
90
|
-
src: "".concat(core.formatUrl((0, _functions.getUrl)(plugin.metadata)), "?version=").concat(encodeURI(plugin.version))
|
|
91
|
-
}) : /*#__PURE__*/_react.default.createElement("div", null);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
CorePlugin.propTypes = {
|
|
95
|
-
plugin: _propTypes.default.shape({
|
|
96
|
-
componentID: _propTypes.default.string,
|
|
97
|
-
componentType: _propTypes.default.string,
|
|
98
|
-
name: _propTypes.default.string,
|
|
99
|
-
description: _propTypes.default.string,
|
|
100
|
-
version: _propTypes.default.string,
|
|
101
|
-
translation: _propTypes.default.array,
|
|
102
|
-
metadata: _propTypes.default.shape({
|
|
103
|
-
url: _propTypes.default.string,
|
|
104
|
-
iconUrl: _propTypes.default.string,
|
|
105
|
-
width: _propTypes.default.string,
|
|
106
|
-
height: _propTypes.default.string
|
|
107
|
-
})
|
|
108
|
-
}).isRequired,
|
|
109
|
-
sandbox: _propTypes.default.string,
|
|
110
|
-
controller: _propTypes.default.shape(),
|
|
111
|
-
onChange: _propTypes.default.func,
|
|
112
|
-
core: _propTypes.default.shape().isRequired,
|
|
113
|
-
authentication: _propTypes.default.shape().isRequired,
|
|
114
|
-
organization: _propTypes.default.shape().isRequired,
|
|
115
|
-
withAuthentication: _propTypes.default.bool,
|
|
116
|
-
withOrganization: _propTypes.default.bool
|
|
117
|
-
};
|
|
118
|
-
CorePlugin.defaultProps = {
|
|
119
|
-
sandbox: null,
|
|
120
|
-
controller: {},
|
|
121
|
-
onChange: null,
|
|
122
|
-
withAuthentication: false,
|
|
123
|
-
withOrganization: false
|
|
124
|
-
};
|
|
125
|
-
var _default = exports.default = (0, _context.withCore)((0, _context.withAuthentication)((0, _context.withOrganization)(CorePlugin)));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _CorePlugin.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _CorePlugin = _interopRequireDefault(require("./CorePlugin"));
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _DialogContentText = _interopRequireDefault(require("@material-ui/core/DialogContentText"));
|
|
9
|
-
var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogActions"));
|
|
10
|
-
var _DialogContent = _interopRequireDefault(require("@material-ui/core/DialogContent"));
|
|
11
|
-
var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle"));
|
|
12
|
-
var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
|
|
13
|
-
var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
14
|
-
var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
|
|
15
|
-
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
16
|
-
var _reactIntl = require("react-intl");
|
|
17
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
-
const styles = {
|
|
20
|
-
closeButton: {
|
|
21
|
-
position: 'absolute',
|
|
22
|
-
color: 'gray',
|
|
23
|
-
right: 10,
|
|
24
|
-
top: 10
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
function CoreSaveChangesDialog(props) {
|
|
28
|
-
const {
|
|
29
|
-
intl,
|
|
30
|
-
open
|
|
31
|
-
} = props;
|
|
32
|
-
return /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
33
|
-
open: open
|
|
34
|
-
}, /*#__PURE__*/_react.default.createElement(_DialogTitle.default, null, intl.formatMessage({
|
|
35
|
-
id: '__unsaved_title'
|
|
36
|
-
}), /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
37
|
-
style: styles.closeButton,
|
|
38
|
-
onClick: () => props.close()
|
|
39
|
-
}, /*#__PURE__*/_react.default.createElement(_Close.default, null))), /*#__PURE__*/_react.default.createElement(_DialogContent.default, null, /*#__PURE__*/_react.default.createElement(_DialogContentText.default, null, intl.formatMessage({
|
|
40
|
-
id: '__unsaved_message'
|
|
41
|
-
}))), /*#__PURE__*/_react.default.createElement(_DialogActions.default, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
42
|
-
variant: "contained",
|
|
43
|
-
onClick: () => props.keep(),
|
|
44
|
-
color: "primary",
|
|
45
|
-
autoFocus: true
|
|
46
|
-
}, intl.formatMessage({
|
|
47
|
-
id: '__yes'
|
|
48
|
-
})), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
49
|
-
onClick: () => props.discard(),
|
|
50
|
-
color: "primary"
|
|
51
|
-
}, intl.formatMessage({
|
|
52
|
-
id: '__no'
|
|
53
|
-
}))));
|
|
54
|
-
}
|
|
55
|
-
CoreSaveChangesDialog.propTypes = {
|
|
56
|
-
intl: _propTypes.default.shape().isRequired,
|
|
57
|
-
discard: _propTypes.default.func.isRequired,
|
|
58
|
-
close: _propTypes.default.func.isRequired,
|
|
59
|
-
keep: _propTypes.default.func.isRequired,
|
|
60
|
-
open: _propTypes.default.bool.isRequired
|
|
61
|
-
};
|
|
62
|
-
var _default = exports.default = (0, _reactIntl.injectIntl)(CoreSaveChangesDialog);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _CoreSaveChangesDialog.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _CoreSaveChangesDialog = _interopRequireDefault(require("./CoreSaveChangesDialog"));
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|