versacall-core-library-react 2.0.65 → 2.0.67

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.
Files changed (121) hide show
  1. package/dist/components/CoreAlert/CoreAlert.js +43 -107
  2. package/dist/components/CoreAlert/index.js +2 -4
  3. package/dist/components/CoreAppBar/CoreAppBar.js +275 -418
  4. package/dist/components/CoreAppBar/CoreAppBarDrawer.js +88 -171
  5. package/dist/components/CoreAppBar/index.js +2 -4
  6. package/dist/components/CoreAppSelector/AppLink.js +36 -60
  7. package/dist/components/CoreAppSelector/CoreAppSelector.js +109 -200
  8. package/dist/components/CoreAppSelector/index.js +2 -4
  9. package/dist/components/CoreDialogueToolBar/CoreDialogueToolBar.js +43 -69
  10. package/dist/components/CoreDialogueToolBar/index.js +2 -4
  11. package/dist/components/CoreDrawer/CoreDrawer.js +168 -286
  12. package/dist/components/CoreDrawer/index.js +2 -4
  13. package/dist/components/CoreDropDownTextfield/CoreDropDownTextfield.js +57 -121
  14. package/dist/components/CoreDropDownTextfield/index.js +2 -4
  15. package/dist/components/CoreElapsedTime/CoreElapsedTime.js +38 -97
  16. package/dist/components/CoreElapsedTime/index.js +2 -4
  17. package/dist/components/CoreFrame/CoreFrame.js +17 -28
  18. package/dist/components/CoreFrame/index.js +2 -4
  19. package/dist/components/CoreImportDialog/CoreImportDialog.js +87 -189
  20. package/dist/components/CoreImportDialog/index.js +2 -4
  21. package/dist/components/CoreImportResultsDialog/CoreImportResultsDialog.js +19 -45
  22. package/dist/components/CoreImportResultsDialog/index.js +2 -4
  23. package/dist/components/CoreImporting/CoreImporting.js +23 -39
  24. package/dist/components/CoreImporting/index.js +2 -4
  25. package/dist/components/CorePlugin/CorePlugin.js +83 -160
  26. package/dist/components/CorePlugin/OldCorePlugin.js +73 -149
  27. package/dist/components/CorePlugin/index.js +2 -4
  28. package/dist/components/CoreSaveChangesDialog/CoreSaveChangesDialog.js +10 -32
  29. package/dist/components/CoreSaveChangesDialog/index.js +2 -4
  30. package/dist/components/CoreShiftTagFilter/CoreShiftTagFilter.js +288 -408
  31. package/dist/components/CoreShiftTagFilter/OldCoreShiftTagFilter.js +161 -257
  32. package/dist/components/CoreShiftTagFilter/index.js +2 -4
  33. package/dist/components/CoreSideBar/CoreSideBar.js +578 -737
  34. package/dist/components/CoreSideBar/CoreSideBarDrawer.js +122 -212
  35. package/dist/components/CoreSideBar/index.js +2 -4
  36. package/dist/components/CoreSnackBar/CoreSnackBar.js +76 -143
  37. package/dist/components/CoreSnackBar/index.js +2 -4
  38. package/dist/components/CoreTable/CoreTable.js +219 -337
  39. package/dist/components/CoreTable/CoreTableChips.js +11 -19
  40. package/dist/components/CoreTable/CoreTableHead.js +125 -205
  41. package/dist/components/CoreTable/CoreTableToolbar.js +34 -56
  42. package/dist/components/CoreTable/index.js +2 -4
  43. package/dist/components/CoreTagFilter/CoreTagFilter.js +212 -319
  44. package/dist/components/CoreTagFilter/OldCoreTagFilter.js +270 -402
  45. package/dist/components/CoreTagFilter/OldTagChip.js +10 -20
  46. package/dist/components/CoreTagFilter/OldTagFilterSelector.js +77 -148
  47. package/dist/components/CoreTagFilter/OldTagOption.js +21 -47
  48. package/dist/components/CoreTagFilter/TagFilterBuilder.js +114 -274
  49. package/dist/components/CoreTagFilter/index.js +2 -4
  50. package/dist/components/CoreTextField/CoreTextField.js +69 -132
  51. package/dist/components/CoreTextField/index.js +2 -4
  52. package/dist/components/CoreTheme/CoreTheme.js +13 -27
  53. package/dist/components/CoreTheme/index.js +2 -4
  54. package/dist/components/CoreTile/CoreTile.js +21 -34
  55. package/dist/components/CoreTile/CoreTileToolbar.js +21 -36
  56. package/dist/components/CoreTile/index.js +2 -4
  57. package/dist/components/CoreTimerInput/CoreTimerInput.js +36 -60
  58. package/dist/components/CoreTimerInput/CoreTimerInputOld.js +29 -47
  59. package/dist/components/CoreTimerInput/index.js +2 -4
  60. package/dist/components/CoreToolbar/CoreToolbar.js +65 -95
  61. package/dist/components/CoreToolbar/index.js +2 -4
  62. package/dist/components/CoreTracker/CoreTracker.js +32 -91
  63. package/dist/components/CoreTracker/index.js +2 -4
  64. package/dist/components/CoreTranslate/CoreTranslate.js +17 -48
  65. package/dist/components/CoreTranslate/index.js +2 -4
  66. package/dist/components/CoreTranslateWrapper/CoreTranslateWrapper.js +7 -15
  67. package/dist/components/CoreTranslateWrapper/index.js +2 -4
  68. package/dist/components/CoreWidget/CoreWidget.js +81 -149
  69. package/dist/components/CoreWidget/index.js +2 -4
  70. package/dist/components/CoreWrapper/CoreWrapper.js +8 -16
  71. package/dist/components/CoreWrapper/index.js +2 -4
  72. package/dist/components/index.js +29 -58
  73. package/dist/constants/index.js +3 -6
  74. package/dist/constants/testOrganization.js +2 -3
  75. package/dist/constants/testToken.js +2 -3
  76. package/dist/context/Authentication/AuthenticationContext.js +3 -8
  77. package/dist/context/Authentication/AuthenticationProvider.js +156 -257
  78. package/dist/context/Authentication/index.js +4 -8
  79. package/dist/context/Authentication/withAuthentication.js +5 -14
  80. package/dist/context/Channels/ChannelsConsumer.js +14 -70
  81. package/dist/context/Channels/ChannelsContext.js +3 -8
  82. package/dist/context/Channels/ChannelsProvider.js +132 -278
  83. package/dist/context/Channels/DataChannel.js +39 -103
  84. package/dist/context/Channels/EntityChannel.js +40 -104
  85. package/dist/context/Channels/EveryoneChannel.js +32 -92
  86. package/dist/context/Channels/OrganizationChannel.js +40 -104
  87. package/dist/context/Channels/UserChannel.js +37 -99
  88. package/dist/context/Channels/index.js +10 -20
  89. package/dist/context/Channels/withChannels.js +5 -14
  90. package/dist/context/Core/CoreContext.js +3 -8
  91. package/dist/context/Core/CoreProvider.js +68 -132
  92. package/dist/context/Core/index.js +4 -8
  93. package/dist/context/Core/withCore.js +5 -14
  94. package/dist/context/Organization/OrganizationContext.js +3 -8
  95. package/dist/context/Organization/OrganizationProvider.js +48 -120
  96. package/dist/context/Organization/index.js +4 -8
  97. package/dist/context/Organization/withOrganization.js +5 -14
  98. package/dist/context/Plugin/PluginContext.js +3 -8
  99. package/dist/context/Plugin/PluginProvider.js +55 -112
  100. package/dist/context/Plugin/index.js +4 -8
  101. package/dist/context/Plugin/withPlugin.js +5 -14
  102. package/dist/context/index.js +5 -15
  103. package/dist/css/index.js +3 -6
  104. package/dist/functions/TagEvaluator.js +107 -156
  105. package/dist/functions/compareObjects.js +0 -7
  106. package/dist/functions/formatElapsedTime.js +5 -6
  107. package/dist/functions/formatNameFileSafe.js +3 -4
  108. package/dist/functions/getIconUrl.js +0 -3
  109. package/dist/functions/getParameterByName.js +9 -12
  110. package/dist/functions/getProperty.js +4 -8
  111. package/dist/functions/getUrl.js +0 -3
  112. package/dist/functions/index.js +9 -18
  113. package/dist/icons/CopyIcon.js +11 -22
  114. package/dist/icons/DeleteIcon.js +11 -22
  115. package/dist/icons/DuplicateIcon.js +11 -22
  116. package/dist/icons/EditIcon.js +11 -22
  117. package/dist/icons/FabAddIcon.js +19 -35
  118. package/dist/icons/PasteIcon.js +11 -22
  119. package/dist/icons/index.js +7 -14
  120. package/dist/index.js +6 -18
  121. package/package.json +89 -79
@@ -1,104 +1,48 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.default = void 0;
9
-
10
7
  var _react = _interopRequireWildcard(require("react"));
11
-
12
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
9
  var _Authentication = require("../../context/Authentication");
15
-
16
10
  var _Core = require("../../context/Core");
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- 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); }
21
-
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
-
24
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
-
26
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
27
-
28
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
-
30
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
31
-
32
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
-
34
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
35
-
36
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
37
-
38
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
39
-
40
- 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; } }
41
-
42
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
43
-
44
- var namespace = 'CoreTracker';
45
-
46
- var CoreTracker = /*#__PURE__*/function (_Component) {
47
- _inherits(CoreTracker, _Component);
48
-
49
- var _super = _createSuper(CoreTracker);
50
-
51
- function CoreTracker() {
52
- _classCallCheck(this, CoreTracker);
53
-
54
- return _super.apply(this, arguments);
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
+ const namespace = 'CoreTracker';
15
+ class CoreTracker extends _react.Component {
16
+ componentDidMount() {
17
+ setTimeout(() => {
18
+ this.postTrack();
19
+ }, this.props.seconds * 1000);
55
20
  }
56
-
57
- _createClass(CoreTracker, [{
58
- key: "componentDidMount",
59
- value: function componentDidMount() {
60
- var _this = this;
61
-
62
- setTimeout(function () {
63
- _this.postTrack();
64
- }, this.props.seconds * 1000);
65
- }
66
- }, {
67
- key: "postTrack",
68
- value: function postTrack() {
69
- var _this2 = this;
70
-
71
- var methodName = 'postTrack()';
72
-
73
- if (this.props.authentication.authenticated) {
74
- this.props.authentication.http({
75
- method: 'post',
76
- url: "".concat(this.props.core.baseUrl, "/api/user/activity/track"),
77
- params: {
78
- type: this.props.type,
79
- itemId: this.props.id
80
- }
81
- }).then(function (results) {
82
- _this2.props.core.log('system', namespace, methodName, "Type: ".concat(_this2.props.type, " Track: ").concat(_this2.props.id), results);
83
- }).catch(function (error) {
84
- _this2.props.core.log('error', namespace, methodName, error);
85
- });
86
- }
87
- }
88
- }, {
89
- key: "render",
90
- value: function render() {
91
- return /*#__PURE__*/_react.default.createElement("div", {
92
- style: {
93
- display: 'none'
21
+ postTrack() {
22
+ const methodName = 'postTrack()';
23
+ if (this.props.authentication.authenticated) {
24
+ this.props.authentication.http({
25
+ method: 'post',
26
+ url: "".concat(this.props.core.baseUrl, "/api/user/activity/track"),
27
+ params: {
28
+ type: this.props.type,
29
+ itemId: this.props.id
94
30
  }
31
+ }).then(results => {
32
+ this.props.core.log('system', namespace, methodName, "Type: ".concat(this.props.type, " Track: ").concat(this.props.id), results);
33
+ }).catch(error => {
34
+ this.props.core.log('error', namespace, methodName, error);
95
35
  });
96
36
  }
97
- }]);
98
-
99
- return CoreTracker;
100
- }(_react.Component);
101
-
37
+ }
38
+ render() {
39
+ return /*#__PURE__*/_react.default.createElement("div", {
40
+ style: {
41
+ display: 'none'
42
+ }
43
+ });
44
+ }
45
+ }
102
46
  CoreTracker.propTypes = {
103
47
  type: _propTypes.default.string.isRequired,
104
48
  id: _propTypes.default.string.isRequired,
@@ -106,7 +50,4 @@ CoreTracker.propTypes = {
106
50
  core: _propTypes.default.shape().isRequired,
107
51
  authentication: _propTypes.default.shape().isRequired
108
52
  };
109
-
110
- var _default = (0, _Core.withCore)((0, _Authentication.withAuthentication)(CoreTracker));
111
-
112
- exports.default = _default;
53
+ var _default = exports.default = (0, _Core.withCore)((0, _Authentication.withAuthentication)(CoreTracker));
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _CoreTracker.default;
10
10
  }
11
11
  });
12
-
13
12
  var _CoreTracker = _interopRequireDefault(require("./CoreTracker"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -4,74 +4,46 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _reactIntl = require("react-intl");
11
-
12
9
  var _en = _interopRequireDefault(require("react-intl/locale-data/en"));
13
-
14
10
  var _es = _interopRequireDefault(require("react-intl/locale-data/es"));
15
-
16
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
17
-
18
12
  var _deepmerge = _interopRequireDefault(require("deepmerge"));
19
-
20
13
  var _en2 = _interopRequireDefault(require("./translations/en.json"));
21
-
22
14
  var _es2 = _interopRequireDefault(require("./translations/es.json"));
23
-
24
15
  var _context = require("../../context");
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
+ /* eslint camelcase: "off" */
25
18
 
26
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
-
28
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
29
-
30
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
31
-
32
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
33
-
34
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
35
-
36
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
37
-
38
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
39
-
40
- var namespace = 'CoreTranslate';
41
- var defaultMessages = {
19
+ const namespace = 'CoreTranslate';
20
+ const defaultMessages = {
42
21
  en: _en2.default,
43
22
  es: _es2.default
44
23
  };
45
- (0, _reactIntl.addLocaleData)([].concat(_toConsumableArray(_en.default), _toConsumableArray(_es.default)));
46
-
24
+ (0, _reactIntl.addLocaleData)([..._en.default, ..._es.default]);
47
25
  function CoreTranslate(props) {
48
- var methodName = 'CoreTranslate()';
49
- var locale = props.locale,
50
- timeZone = props.timeZone,
51
- messages = props.messages,
52
- core = props.core;
53
- var duplicated = {
54
- en: Object.keys(messages.en).filter(function (key) {
55
- return Object.keys(defaultMessages.en).includes(key);
56
- }),
57
- es: Object.keys(messages.es).filter(function (key) {
58
- return Object.keys(defaultMessages.es).includes(key);
59
- })
26
+ const methodName = 'CoreTranslate()';
27
+ const {
28
+ locale,
29
+ timeZone,
30
+ messages,
31
+ core
32
+ } = props;
33
+ const duplicated = {
34
+ en: Object.keys(messages.en).filter(key => Object.keys(defaultMessages.en).includes(key)),
35
+ es: Object.keys(messages.es).filter(key => Object.keys(defaultMessages.es).includes(key))
60
36
  };
61
-
62
37
  if (duplicated.en.length > 0 || duplicated.es.length > 0) {
63
38
  core.log('warning', namespace, methodName, 'Translation Keys Already in Core Library', duplicated);
64
39
  }
65
-
66
- var combinedMessages = _deepmerge.default.all([defaultMessages, messages]);
67
-
40
+ const combinedMessages = _deepmerge.default.all([defaultMessages, messages]);
68
41
  return /*#__PURE__*/_react.default.createElement(_reactIntl.IntlProvider, {
69
42
  locale: locale,
70
43
  timeZone: timeZone,
71
44
  messages: combinedMessages[locale]
72
45
  }, props.children);
73
46
  }
74
-
75
47
  CoreTranslate.propTypes = {
76
48
  locale: _propTypes.default.string,
77
49
  timeZone: _propTypes.default.string,
@@ -87,7 +59,4 @@ CoreTranslate.defaultProps = {
87
59
  es: {}
88
60
  }
89
61
  };
90
-
91
- var _default = (0, _context.withCore)(CoreTranslate);
92
-
93
- exports.default = _default;
62
+ var _default = exports.default = (0, _context.withCore)(CoreTranslate);
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _CoreTranslate.default;
10
10
  }
11
11
  });
12
-
13
12
  var _CoreTranslate = _interopRequireDefault(require("./CoreTranslate"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -4,28 +4,23 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _context = require("../../context");
13
-
14
10
  var _CoreTranslate = _interopRequireDefault(require("../CoreTranslate"));
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
12
  function CoreTranslateWrapper(props) {
19
- var messages = props.messages,
20
- authentication = props.authentication,
21
- organization = props.organization;
13
+ const {
14
+ messages,
15
+ authentication,
16
+ organization
17
+ } = props;
22
18
  return /*#__PURE__*/_react.default.createElement(_CoreTranslate.default, {
23
19
  locale: authentication.token.language,
24
20
  timeZone: organization.entity ? organization.entity.timeZone.environment.react : '',
25
21
  messages: messages
26
22
  }, props.children);
27
23
  }
28
-
29
24
  CoreTranslateWrapper.propTypes = {
30
25
  messages: _propTypes.default.objectOf(_propTypes.default.object),
31
26
  authentication: _propTypes.default.shape().isRequired,
@@ -38,7 +33,4 @@ CoreTranslateWrapper.defaultProps = {
38
33
  es: {}
39
34
  }
40
35
  };
41
-
42
- var _default = (0, _context.withAuthentication)((0, _context.withOrganization)(CoreTranslateWrapper));
43
-
44
- exports.default = _default;
36
+ var _default = exports.default = (0, _context.withAuthentication)((0, _context.withOrganization)(CoreTranslateWrapper));
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _CoreTranslateWrapper.default;
10
10
  }
11
11
  });
12
-
13
12
  var _CoreTranslateWrapper = _interopRequireDefault(require("./CoreTranslateWrapper"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -4,166 +4,101 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _context = require("../../context");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- 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); }
17
-
18
- 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; }
19
-
20
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
21
-
22
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
23
-
24
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25
-
26
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
27
-
28
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
29
-
30
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
31
-
32
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
33
-
34
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
35
-
36
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
37
-
38
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
39
-
40
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
41
-
42
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
43
-
44
- 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; } }
45
-
46
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
47
-
48
- var CoreWidget = /*#__PURE__*/function (_Component) {
49
- _inherits(CoreWidget, _Component);
50
-
51
- var _super = _createSuper(CoreWidget);
52
-
53
- function CoreWidget(props) {
54
- var _this;
55
-
56
- _classCallCheck(this, CoreWidget);
57
-
58
- _this = _super.call(this, props);
59
- _this.state = {
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ 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); }
12
+ 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; }
13
+ 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; }
14
+ 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; }
15
+ 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; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
17
+ 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); }
18
+ class CoreWidget extends _react.Component {
19
+ constructor(props) {
20
+ super(props);
21
+ this.state = {
60
22
  versaCallPluginId: Math.floor(Math.random() * 10000 + 9999)
61
23
  };
62
- return _this;
63
24
  }
64
-
65
- _createClass(CoreWidget, [{
66
- key: "componentDidMount",
67
- value: function componentDidMount() {
68
- this.onReceiveMessageBinded = this.onReceiveMessage.bind(this);
69
- window.addEventListener('message', this.onReceiveMessageBinded);
70
- }
71
- }, {
72
- key: "componentDidUpdate",
73
- value: function componentDidUpdate(prevProps) {
74
- if (this.props.withAuthentication && JSON.stringify(this.props.authentication) !== JSON.stringify(prevProps.authentication)) {
75
- this.updateAuthentication();
76
- }
77
-
78
- if (this.props.withOrganization && JSON.stringify(this.props.organization) !== JSON.stringify(prevProps.organization)) {
79
- this.updateOrganization();
80
- }
81
-
82
- if (JSON.stringify(this.props.controller) !== JSON.stringify(prevProps.controller)) {
83
- this.postMessage({
84
- controller: this.props.controller
85
- });
86
- }
87
- }
88
- }, {
89
- key: "componentWillUnmount",
90
- value: function componentWillUnmount() {
91
- window.removeEventListener('message', this.onReceiveMessageBinded);
92
- }
93
- }, {
94
- key: "onReceiveMessage",
95
- value: function onReceiveMessage(event) {
96
- if (this.props.onChange && _typeof(event.data) === 'object' && event.data.versaCallPluginId && event.data.versaCallPluginId === this.state.versaCallPluginId) {
97
- this.props.onChange(event.data.controller);
98
- }
99
- }
100
- }, {
101
- key: "updateAuthentication",
102
- value: function updateAuthentication() {
103
- if (this.props.withAuthentication) {
104
- this.postMessage({
105
- authentication: JSON.parse(JSON.stringify(this.props.authentication))
106
- });
107
- }
25
+ componentDidMount() {
26
+ this.onReceiveMessageBinded = this.onReceiveMessage.bind(this);
27
+ window.addEventListener('message', this.onReceiveMessageBinded);
28
+ }
29
+ componentDidUpdate(prevProps) {
30
+ if (this.props.withAuthentication && JSON.stringify(this.props.authentication) !== JSON.stringify(prevProps.authentication)) {
31
+ this.updateAuthentication();
108
32
  }
109
- }, {
110
- key: "updateOrganization",
111
- value: function updateOrganization() {
112
- if (this.props.withOrganization) {
113
- this.postMessage({
114
- organization: JSON.parse(JSON.stringify(this.props.organization))
115
- });
116
- }
33
+ if (this.props.withOrganization && JSON.stringify(this.props.organization) !== JSON.stringify(prevProps.organization)) {
34
+ this.updateOrganization();
117
35
  }
118
- }, {
119
- key: "handleLoad",
120
- value: function handleLoad() {
36
+ if (JSON.stringify(this.props.controller) !== JSON.stringify(prevProps.controller)) {
121
37
  this.postMessage({
122
- authentication: this.props.withAuthentication ? JSON.parse(JSON.stringify(this.props.authentication)) : null,
123
- organization: this.props.withOrganization ? JSON.parse(JSON.stringify(this.props.organization)) : null,
124
38
  controller: this.props.controller
125
39
  });
126
40
  }
127
- }, {
128
- key: "postMessage",
129
- value: function postMessage(message) {
130
- this.ifr.contentWindow.postMessage(_objectSpread({
131
- versaCallPluginId: this.state.versaCallPluginId
132
- }, message), '*');
41
+ }
42
+ componentWillUnmount() {
43
+ window.removeEventListener('message', this.onReceiveMessageBinded);
44
+ }
45
+ onReceiveMessage(event) {
46
+ if (this.props.onChange && typeof event.data === 'object' && event.data.versaCallPluginId && event.data.versaCallPluginId === this.state.versaCallPluginId) {
47
+ this.props.onChange(event.data.controller);
133
48
  }
134
- }, {
135
- key: "render",
136
- value: function render() {
137
- var _this2 = this;
138
-
139
- var _this$props = this.props,
140
- url = _this$props.url,
141
- sandbox = _this$props.sandbox,
142
- core = _this$props.core;
143
- var versaCallPluginId = this.state.versaCallPluginId;
144
- return versaCallPluginId !== '' && /*#__PURE__*/_react.default.createElement("iframe", {
145
- frameBorder: "0",
146
- title: "CoreWidgetFrame",
147
- sandbox: sandbox,
148
- src: "".concat(core.formatUrl(url)),
149
- onLoad: function onLoad() {
150
- return _this2.handleLoad();
151
- },
152
- style: {
153
- width: '100%',
154
- height: '100%'
155
- },
156
- ref: function ref(f) {
157
- _this2.ifr = f;
158
- return _this2.ifr;
159
- }
49
+ }
50
+ updateAuthentication() {
51
+ if (this.props.withAuthentication) {
52
+ this.postMessage({
53
+ authentication: JSON.parse(JSON.stringify(this.props.authentication))
160
54
  });
161
55
  }
162
- }]);
163
-
164
- return CoreWidget;
165
- }(_react.Component);
166
-
56
+ }
57
+ updateOrganization() {
58
+ if (this.props.withOrganization) {
59
+ this.postMessage({
60
+ organization: JSON.parse(JSON.stringify(this.props.organization))
61
+ });
62
+ }
63
+ }
64
+ handleLoad() {
65
+ this.postMessage({
66
+ authentication: this.props.withAuthentication ? JSON.parse(JSON.stringify(this.props.authentication)) : null,
67
+ organization: this.props.withOrganization ? JSON.parse(JSON.stringify(this.props.organization)) : null,
68
+ controller: this.props.controller
69
+ });
70
+ }
71
+ postMessage(message) {
72
+ this.ifr.contentWindow.postMessage(_objectSpread({
73
+ versaCallPluginId: this.state.versaCallPluginId
74
+ }, message), '*');
75
+ }
76
+ render() {
77
+ const {
78
+ url,
79
+ sandbox,
80
+ core
81
+ } = this.props;
82
+ const {
83
+ versaCallPluginId
84
+ } = this.state;
85
+ return versaCallPluginId !== '' && /*#__PURE__*/_react.default.createElement("iframe", {
86
+ frameBorder: "0",
87
+ title: "CoreWidgetFrame",
88
+ sandbox: sandbox,
89
+ src: "".concat(core.formatUrl(url)),
90
+ onLoad: () => this.handleLoad(),
91
+ style: {
92
+ width: '100%',
93
+ height: '100%'
94
+ },
95
+ ref: f => {
96
+ this.ifr = f;
97
+ return this.ifr;
98
+ }
99
+ });
100
+ }
101
+ }
167
102
  CoreWidget.propTypes = {
168
103
  url: _propTypes.default.string,
169
104
  onChange: _propTypes.default.func,
@@ -183,7 +118,4 @@ CoreWidget.defaultProps = {
183
118
  withOrganization: false,
184
119
  withAuthentication: false
185
120
  };
186
-
187
- var _default = (0, _context.withCore)((0, _context.withAuthentication)((0, _context.withOrganization)(CoreWidget)));
188
-
189
- exports.default = _default;
121
+ var _default = exports.default = (0, _context.withCore)((0, _context.withAuthentication)((0, _context.withOrganization)(CoreWidget)));
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _CoreWidget.default;
10
10
  }
11
11
  });
12
-
13
12
  var _CoreWidget = _interopRequireDefault(require("./CoreWidget"));
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }