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.
- package/dist/components/CoreAlert/CoreAlert.js +43 -107
- package/dist/components/CoreAlert/index.js +2 -4
- package/dist/components/CoreAppBar/CoreAppBar.js +275 -418
- package/dist/components/CoreAppBar/CoreAppBarDrawer.js +88 -171
- package/dist/components/CoreAppBar/index.js +2 -4
- package/dist/components/CoreAppSelector/AppLink.js +36 -60
- package/dist/components/CoreAppSelector/CoreAppSelector.js +109 -200
- package/dist/components/CoreAppSelector/index.js +2 -4
- package/dist/components/CoreDialogueToolBar/CoreDialogueToolBar.js +43 -69
- package/dist/components/CoreDialogueToolBar/index.js +2 -4
- package/dist/components/CoreDrawer/CoreDrawer.js +168 -286
- package/dist/components/CoreDrawer/index.js +2 -4
- package/dist/components/CoreDropDownTextfield/CoreDropDownTextfield.js +57 -121
- package/dist/components/CoreDropDownTextfield/index.js +2 -4
- package/dist/components/CoreElapsedTime/CoreElapsedTime.js +38 -97
- package/dist/components/CoreElapsedTime/index.js +2 -4
- package/dist/components/CoreFrame/CoreFrame.js +17 -28
- package/dist/components/CoreFrame/index.js +2 -4
- package/dist/components/CoreImportDialog/CoreImportDialog.js +87 -189
- package/dist/components/CoreImportDialog/index.js +2 -4
- package/dist/components/CoreImportResultsDialog/CoreImportResultsDialog.js +19 -45
- package/dist/components/CoreImportResultsDialog/index.js +2 -4
- package/dist/components/CoreImporting/CoreImporting.js +23 -39
- package/dist/components/CoreImporting/index.js +2 -4
- package/dist/components/CorePlugin/CorePlugin.js +83 -160
- package/dist/components/CorePlugin/OldCorePlugin.js +73 -149
- package/dist/components/CorePlugin/index.js +2 -4
- package/dist/components/CoreSaveChangesDialog/CoreSaveChangesDialog.js +10 -32
- package/dist/components/CoreSaveChangesDialog/index.js +2 -4
- package/dist/components/CoreShiftTagFilter/CoreShiftTagFilter.js +288 -408
- package/dist/components/CoreShiftTagFilter/OldCoreShiftTagFilter.js +161 -257
- package/dist/components/CoreShiftTagFilter/index.js +2 -4
- package/dist/components/CoreSideBar/CoreSideBar.js +578 -737
- package/dist/components/CoreSideBar/CoreSideBarDrawer.js +122 -212
- package/dist/components/CoreSideBar/index.js +2 -4
- package/dist/components/CoreSnackBar/CoreSnackBar.js +76 -143
- package/dist/components/CoreSnackBar/index.js +2 -4
- package/dist/components/CoreTable/CoreTable.js +219 -337
- package/dist/components/CoreTable/CoreTableChips.js +11 -19
- package/dist/components/CoreTable/CoreTableHead.js +125 -205
- package/dist/components/CoreTable/CoreTableToolbar.js +34 -56
- package/dist/components/CoreTable/index.js +2 -4
- package/dist/components/CoreTagFilter/CoreTagFilter.js +212 -319
- package/dist/components/CoreTagFilter/OldCoreTagFilter.js +270 -402
- package/dist/components/CoreTagFilter/OldTagChip.js +10 -20
- package/dist/components/CoreTagFilter/OldTagFilterSelector.js +77 -148
- package/dist/components/CoreTagFilter/OldTagOption.js +21 -47
- package/dist/components/CoreTagFilter/TagFilterBuilder.js +114 -274
- package/dist/components/CoreTagFilter/index.js +2 -4
- package/dist/components/CoreTextField/CoreTextField.js +69 -132
- package/dist/components/CoreTextField/index.js +2 -4
- package/dist/components/CoreTheme/CoreTheme.js +13 -27
- package/dist/components/CoreTheme/index.js +2 -4
- package/dist/components/CoreTile/CoreTile.js +21 -34
- package/dist/components/CoreTile/CoreTileToolbar.js +21 -36
- package/dist/components/CoreTile/index.js +2 -4
- package/dist/components/CoreTimerInput/CoreTimerInput.js +36 -60
- package/dist/components/CoreTimerInput/CoreTimerInputOld.js +29 -47
- package/dist/components/CoreTimerInput/index.js +2 -4
- package/dist/components/CoreToolbar/CoreToolbar.js +65 -95
- package/dist/components/CoreToolbar/index.js +2 -4
- package/dist/components/CoreTracker/CoreTracker.js +32 -91
- package/dist/components/CoreTracker/index.js +2 -4
- package/dist/components/CoreTranslate/CoreTranslate.js +17 -48
- package/dist/components/CoreTranslate/index.js +2 -4
- package/dist/components/CoreTranslateWrapper/CoreTranslateWrapper.js +7 -15
- package/dist/components/CoreTranslateWrapper/index.js +2 -4
- package/dist/components/CoreWidget/CoreWidget.js +81 -149
- package/dist/components/CoreWidget/index.js +2 -4
- package/dist/components/CoreWrapper/CoreWrapper.js +8 -16
- package/dist/components/CoreWrapper/index.js +2 -4
- package/dist/components/index.js +29 -58
- package/dist/constants/index.js +3 -6
- package/dist/constants/testOrganization.js +2 -3
- package/dist/constants/testToken.js +2 -3
- package/dist/context/Authentication/AuthenticationContext.js +3 -8
- package/dist/context/Authentication/AuthenticationProvider.js +156 -257
- package/dist/context/Authentication/index.js +4 -8
- package/dist/context/Authentication/withAuthentication.js +5 -14
- package/dist/context/Channels/ChannelsConsumer.js +14 -70
- package/dist/context/Channels/ChannelsContext.js +3 -8
- package/dist/context/Channels/ChannelsProvider.js +132 -278
- package/dist/context/Channels/DataChannel.js +39 -103
- package/dist/context/Channels/EntityChannel.js +40 -104
- package/dist/context/Channels/EveryoneChannel.js +32 -92
- package/dist/context/Channels/OrganizationChannel.js +40 -104
- package/dist/context/Channels/UserChannel.js +37 -99
- package/dist/context/Channels/index.js +10 -20
- package/dist/context/Channels/withChannels.js +5 -14
- package/dist/context/Core/CoreContext.js +3 -8
- package/dist/context/Core/CoreProvider.js +68 -132
- package/dist/context/Core/index.js +4 -8
- package/dist/context/Core/withCore.js +5 -14
- package/dist/context/Organization/OrganizationContext.js +3 -8
- package/dist/context/Organization/OrganizationProvider.js +48 -120
- package/dist/context/Organization/index.js +4 -8
- package/dist/context/Organization/withOrganization.js +5 -14
- package/dist/context/Plugin/PluginContext.js +3 -8
- package/dist/context/Plugin/PluginProvider.js +55 -112
- package/dist/context/Plugin/index.js +4 -8
- package/dist/context/Plugin/withPlugin.js +5 -14
- package/dist/context/index.js +5 -15
- package/dist/css/index.js +3 -6
- package/dist/functions/TagEvaluator.js +107 -156
- package/dist/functions/compareObjects.js +0 -7
- package/dist/functions/formatElapsedTime.js +5 -6
- package/dist/functions/formatNameFileSafe.js +3 -4
- package/dist/functions/getIconUrl.js +0 -3
- package/dist/functions/getParameterByName.js +9 -12
- package/dist/functions/getProperty.js +4 -8
- package/dist/functions/getUrl.js +0 -3
- package/dist/functions/index.js +9 -18
- package/dist/icons/CopyIcon.js +11 -22
- package/dist/icons/DeleteIcon.js +11 -22
- package/dist/icons/DuplicateIcon.js +11 -22
- package/dist/icons/EditIcon.js +11 -22
- package/dist/icons/FabAddIcon.js +19 -35
- package/dist/icons/PasteIcon.js +11 -22
- package/dist/icons/index.js +7 -14
- package/dist/index.js +6 -18
- package/package.json +89 -79
|
@@ -1,112 +1,53 @@
|
|
|
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 = require("react");
|
|
11
|
-
|
|
12
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
9
|
var _withAuthentication = _interopRequireDefault(require("../Authentication/withAuthentication"));
|
|
15
|
-
|
|
16
10
|
var _withChannels = _interopRequireDefault(require("./withChannels"));
|
|
17
|
-
|
|
18
11
|
var _withCore = _interopRequireDefault(require("../Core/withCore"));
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
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); }
|
|
29
|
-
|
|
30
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
31
|
-
|
|
32
|
-
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); }; }
|
|
33
|
-
|
|
34
|
-
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); }
|
|
35
|
-
|
|
36
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
37
|
-
|
|
38
|
-
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; } }
|
|
39
|
-
|
|
40
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
41
|
-
|
|
42
|
-
var namespace = 'UserChannel';
|
|
43
|
-
var channelId = 'user';
|
|
44
|
-
|
|
45
|
-
var UserChannel = /*#__PURE__*/function (_Component) {
|
|
46
|
-
_inherits(UserChannel, _Component);
|
|
47
|
-
|
|
48
|
-
var _super = _createSuper(UserChannel);
|
|
49
|
-
|
|
50
|
-
function UserChannel() {
|
|
51
|
-
_classCallCheck(this, UserChannel);
|
|
52
|
-
|
|
53
|
-
return _super.apply(this, arguments);
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const namespace = 'UserChannel';
|
|
14
|
+
const channelId = 'user';
|
|
15
|
+
class UserChannel extends _react.Component {
|
|
16
|
+
componentDidMount() {
|
|
17
|
+
if (!this.props.channels.isChannelRegistered(channelId)) {
|
|
18
|
+
this.props.channels.registerChannel(channelId, data => this.channelFunction(data));
|
|
19
|
+
this.props.channels.updateChannel(channelId, null);
|
|
20
|
+
}
|
|
54
21
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
value: function componentDidMount() {
|
|
59
|
-
var _this = this;
|
|
60
|
-
|
|
61
|
-
if (!this.props.channels.isChannelRegistered(channelId)) {
|
|
62
|
-
this.props.channels.registerChannel(channelId, function (data) {
|
|
63
|
-
return _this.channelFunction(data);
|
|
64
|
-
});
|
|
65
|
-
this.props.channels.updateChannel(channelId, null);
|
|
66
|
-
}
|
|
22
|
+
componentDidUpdate(prevProps) {
|
|
23
|
+
if (this.props.authentication.didChange(prevProps.authentication)) {
|
|
24
|
+
this.props.channels.updateChannel(channelId, null);
|
|
67
25
|
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
26
|
+
}
|
|
27
|
+
channelFunction() {
|
|
28
|
+
const methodName = 'channelFunction()';
|
|
29
|
+
return new Promise((resolve, reject) => {
|
|
30
|
+
if (this.props.authentication.authenticated) {
|
|
31
|
+
this.props.authentication.http({
|
|
32
|
+
method: 'get',
|
|
33
|
+
url: "".concat(this.props.core.baseUrl, "/api/administration/users/subscribe")
|
|
34
|
+
}).then(results => {
|
|
35
|
+
resolve(results.data);
|
|
36
|
+
}).catch(error => {
|
|
37
|
+
this.props.core.log('error', namespace, methodName, error);
|
|
38
|
+
reject(error);
|
|
39
|
+
});
|
|
40
|
+
} else {
|
|
41
|
+
reject(new Error({
|
|
42
|
+
message: 'Not Authenticated'
|
|
43
|
+
}));
|
|
73
44
|
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
var methodName = 'channelFunction()';
|
|
81
|
-
return new Promise(function (resolve, reject) {
|
|
82
|
-
if (_this2.props.authentication.authenticated) {
|
|
83
|
-
_this2.props.authentication.http({
|
|
84
|
-
method: 'get',
|
|
85
|
-
url: "".concat(_this2.props.core.baseUrl, "/api/administration/users/subscribe")
|
|
86
|
-
}).then(function (results) {
|
|
87
|
-
resolve(results.data);
|
|
88
|
-
}).catch(function (error) {
|
|
89
|
-
_this2.props.core.log('error', namespace, methodName, error);
|
|
90
|
-
|
|
91
|
-
reject(error);
|
|
92
|
-
});
|
|
93
|
-
} else {
|
|
94
|
-
reject(new Error({
|
|
95
|
-
message: 'Not Authenticated'
|
|
96
|
-
}));
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
key: "render",
|
|
102
|
-
value: function render() {
|
|
103
|
-
return '';
|
|
104
|
-
}
|
|
105
|
-
}]);
|
|
106
|
-
|
|
107
|
-
return UserChannel;
|
|
108
|
-
}(_react.Component);
|
|
109
|
-
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
render() {
|
|
48
|
+
return '';
|
|
49
|
+
}
|
|
50
|
+
}
|
|
110
51
|
UserChannel.propTypes = {
|
|
111
52
|
core: _propTypes.default.shape().isRequired,
|
|
112
53
|
authentication: _propTypes.default.shape().isRequired,
|
|
@@ -116,7 +57,4 @@ UserChannel.propTypes = {
|
|
|
116
57
|
isChannelRegistered: _propTypes.default.func
|
|
117
58
|
}).isRequired
|
|
118
59
|
};
|
|
119
|
-
|
|
120
|
-
var _default = (0, _withChannels.default)((0, _withCore.default)((0, _withAuthentication.default)(UserChannel)));
|
|
121
|
-
|
|
122
|
-
exports.default = _default;
|
|
60
|
+
var _default = exports.default = (0, _withChannels.default)((0, _withCore.default)((0, _withAuthentication.default)(UserChannel)));
|
|
@@ -5,75 +5,65 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "ChannelsConsumer", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _ChannelsConsumer.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "ChannelsContext", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _ChannelsContext.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "ChannelsProvider", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function
|
|
20
|
+
get: function () {
|
|
21
21
|
return _ChannelsProvider.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "DataChannel", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function
|
|
26
|
+
get: function () {
|
|
27
27
|
return _DataChannel.default;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "EntityChannel", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function
|
|
32
|
+
get: function () {
|
|
33
33
|
return _EntityChannel.default;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "EveryoneChannel", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function
|
|
38
|
+
get: function () {
|
|
39
39
|
return _EveryoneChannel.default;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "OrganizationChannel", {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function
|
|
44
|
+
get: function () {
|
|
45
45
|
return _OrganizationChannel.default;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "UserChannel", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function
|
|
50
|
+
get: function () {
|
|
51
51
|
return _UserChannel.default;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "withChannels", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function
|
|
56
|
+
get: function () {
|
|
57
57
|
return _withChannels.default;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
|
|
61
60
|
var _ChannelsConsumer = _interopRequireDefault(require("./ChannelsConsumer"));
|
|
62
|
-
|
|
63
61
|
var _ChannelsContext = _interopRequireDefault(require("./ChannelsContext"));
|
|
64
|
-
|
|
65
62
|
var _ChannelsProvider = _interopRequireDefault(require("./ChannelsProvider"));
|
|
66
|
-
|
|
67
63
|
var _DataChannel = _interopRequireDefault(require("./DataChannel"));
|
|
68
|
-
|
|
69
64
|
var _EntityChannel = _interopRequireDefault(require("./EntityChannel"));
|
|
70
|
-
|
|
71
65
|
var _EveryoneChannel = _interopRequireDefault(require("./EveryoneChannel"));
|
|
72
|
-
|
|
73
66
|
var _OrganizationChannel = _interopRequireDefault(require("./OrganizationChannel"));
|
|
74
|
-
|
|
75
67
|
var _UserChannel = _interopRequireDefault(require("./UserChannel"));
|
|
76
|
-
|
|
77
68
|
var _withChannels = _interopRequireDefault(require("./withChannels"));
|
|
78
|
-
|
|
79
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
69
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -4,21 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = withChannels;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _ChannelsContext = _interopRequireDefault(require("./ChannelsContext"));
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
-
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
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); }
|
|
16
11
|
function withChannels(Component) {
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
channels: channels
|
|
21
|
-
}));
|
|
22
|
-
});
|
|
23
|
-
};
|
|
12
|
+
return props => /*#__PURE__*/_react.default.createElement(_ChannelsContext.default.Consumer, null, channels => /*#__PURE__*/_react.default.createElement(Component, _extends({}, props, {
|
|
13
|
+
channels: channels
|
|
14
|
+
})));
|
|
24
15
|
}
|
|
@@ -4,12 +4,7 @@ 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
|
-
|
|
11
|
-
|
|
12
|
-
var CoreContext = /*#__PURE__*/_react.default.createContext();
|
|
13
|
-
|
|
14
|
-
var _default = CoreContext;
|
|
15
|
-
exports.default = _default;
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const CoreContext = /*#__PURE__*/_react.default.createContext();
|
|
10
|
+
var _default = exports.default = CoreContext;
|
|
@@ -1,64 +1,25 @@
|
|
|
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 _functions = require("../../functions");
|
|
15
|
-
|
|
16
10
|
var _CoreContext = _interopRequireDefault(require("./CoreContext"));
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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 = 'CoreProvider';
|
|
45
|
-
|
|
46
|
-
var CoreProvider = /*#__PURE__*/function (_Component) {
|
|
47
|
-
_inherits(CoreProvider, _Component);
|
|
48
|
-
|
|
49
|
-
var _super = _createSuper(CoreProvider);
|
|
50
|
-
|
|
51
|
-
function CoreProvider(props) {
|
|
52
|
-
var _this;
|
|
53
|
-
|
|
54
|
-
_classCallCheck(this, CoreProvider);
|
|
55
|
-
|
|
56
|
-
_this = _super.call(this, props);
|
|
57
|
-
var baseUrl = '';
|
|
58
|
-
|
|
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
|
+
/* eslint no-console: "off" */
|
|
15
|
+
|
|
16
|
+
const namespace = 'CoreProvider';
|
|
17
|
+
class CoreProvider extends _react.Component {
|
|
18
|
+
constructor(props) {
|
|
19
|
+
super(props);
|
|
20
|
+
let baseUrl = '';
|
|
59
21
|
if (props.baseUrl === '') {
|
|
60
|
-
|
|
61
|
-
|
|
22
|
+
const param = (0, _functions.getParameterByName)('baseUrl');
|
|
62
23
|
if (param !== null && param !== undefined && param.length > 0) {
|
|
63
24
|
baseUrl = param.replace(/%22/g, '"').replace(/%20/g, ' ');
|
|
64
25
|
} else {
|
|
@@ -67,98 +28,74 @@ var CoreProvider = /*#__PURE__*/function (_Component) {
|
|
|
67
28
|
} else {
|
|
68
29
|
baseUrl = props.baseUrl;
|
|
69
30
|
}
|
|
70
|
-
|
|
71
|
-
_this.state = {
|
|
31
|
+
this.state = {
|
|
72
32
|
baseUrl: baseUrl,
|
|
73
33
|
url: window.location.origin,
|
|
74
34
|
urlServer: process.env.NODE_ENV === 'production' ? window.location.origin : 'http://10.2.0.4'
|
|
75
35
|
};
|
|
76
|
-
return _this;
|
|
77
36
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
var methodName = 'formatUrl';
|
|
83
|
-
|
|
84
|
-
if (original === undefined || original === null) {
|
|
85
|
-
this.log('warning', namespace, methodName, 'url is null or undefined');
|
|
86
|
-
return original;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (original.startsWith('/')) {
|
|
90
|
-
return this.state.baseUrl + original;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (original.startsWith(':')) {
|
|
94
|
-
var url = this.state.baseUrl;
|
|
95
|
-
|
|
96
|
-
if (url.endsWith('/')) {
|
|
97
|
-
url = url.slice(0, -1);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return url + original;
|
|
101
|
-
}
|
|
102
|
-
|
|
37
|
+
formatUrl(original) {
|
|
38
|
+
const methodName = 'formatUrl';
|
|
39
|
+
if (original === undefined || original === null) {
|
|
40
|
+
this.log('warning', namespace, methodName, 'url is null or undefined');
|
|
103
41
|
return original;
|
|
104
42
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
3 - error/warning/system/debug
|
|
113
|
-
4 - error/warning/system/debug/verbose
|
|
114
|
-
*/
|
|
115
|
-
if (this.props.logLevel <= 0) {
|
|
116
|
-
return;
|
|
43
|
+
if (original.startsWith('/')) {
|
|
44
|
+
return this.state.baseUrl + original;
|
|
45
|
+
}
|
|
46
|
+
if (original.startsWith(':')) {
|
|
47
|
+
let url = this.state.baseUrl;
|
|
48
|
+
if (url.endsWith('/')) {
|
|
49
|
+
url = url.slice(0, -1);
|
|
117
50
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
51
|
+
return url + original;
|
|
52
|
+
}
|
|
53
|
+
return original;
|
|
54
|
+
}
|
|
55
|
+
log(level, nameSpace, method, args) {
|
|
56
|
+
/* Log Levels
|
|
57
|
+
0 - Don't log anything
|
|
58
|
+
1 - error
|
|
59
|
+
2 - error/warning/system
|
|
60
|
+
3 - error/warning/system/debug
|
|
61
|
+
4 - error/warning/system/debug/verbose
|
|
62
|
+
*/
|
|
63
|
+
if (this.props.logLevel <= 0) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (this.props.logLevel >= 1 && level === 'error' || this.props.logLevel >= 2 && level === 'warning' || this.props.logLevel >= 2 && level === 'system' || this.props.logLevel >= 3 && level === 'debug' || this.props.logLevel >= 4 && level === 'verbose') {
|
|
67
|
+
const setup = "[".concat(level, "] ").concat(nameSpace, ".").concat(method, ":");
|
|
68
|
+
if (args.length > 0) {
|
|
69
|
+
const consoleArgs = [setup].concat(args);
|
|
70
|
+
console.log.apply(null, consoleArgs);
|
|
71
|
+
} else {
|
|
72
|
+
console.log(setup);
|
|
128
73
|
}
|
|
129
74
|
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
log: function log(level, nameSpace, method) {
|
|
148
|
-
for (var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
|
149
|
-
args[_key - 3] = arguments[_key];
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return _this2.log(level, nameSpace, method, args);
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
var _this = this;
|
|
78
|
+
const {
|
|
79
|
+
baseUrl,
|
|
80
|
+
url,
|
|
81
|
+
urlServer
|
|
82
|
+
} = this.state;
|
|
83
|
+
return /*#__PURE__*/_react.default.createElement(_CoreContext.default.Provider, {
|
|
84
|
+
value: {
|
|
85
|
+
baseUrl: baseUrl,
|
|
86
|
+
url: url,
|
|
87
|
+
urlServer: urlServer,
|
|
88
|
+
formatUrl: original => this.formatUrl(original),
|
|
89
|
+
log: function (level, nameSpace, method) {
|
|
90
|
+
for (var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
|
91
|
+
args[_key - 3] = arguments[_key];
|
|
153
92
|
}
|
|
93
|
+
return _this.log(level, nameSpace, method, args);
|
|
154
94
|
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return CoreProvider;
|
|
160
|
-
}(_react.Component);
|
|
161
|
-
|
|
95
|
+
}
|
|
96
|
+
}, this.props.children);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
162
99
|
CoreProvider.propTypes = {
|
|
163
100
|
baseUrl: _propTypes.default.string,
|
|
164
101
|
logLevel: _propTypes.default.number,
|
|
@@ -168,5 +105,4 @@ CoreProvider.defaultProps = {
|
|
|
168
105
|
baseUrl: '',
|
|
169
106
|
logLevel: 0
|
|
170
107
|
};
|
|
171
|
-
var _default = CoreProvider;
|
|
172
|
-
exports.default = _default;
|
|
108
|
+
var _default = exports.default = CoreProvider;
|
|
@@ -5,27 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "CoreContext", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _CoreContext.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "CoreProvider", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _CoreProvider.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "withCore", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function
|
|
20
|
+
get: function () {
|
|
21
21
|
return _withCore.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
|
|
25
24
|
var _CoreProvider = _interopRequireDefault(require("./CoreProvider"));
|
|
26
|
-
|
|
27
25
|
var _CoreContext = _interopRequireDefault(require("./CoreContext"));
|
|
28
|
-
|
|
29
26
|
var _withCore = _interopRequireDefault(require("./withCore"));
|
|
30
|
-
|
|
31
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -4,21 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = withCore;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _CoreContext = _interopRequireDefault(require("./CoreContext"));
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
-
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
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); }
|
|
16
11
|
function withCore(Component) {
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
core: core
|
|
21
|
-
}));
|
|
22
|
-
});
|
|
23
|
-
};
|
|
12
|
+
return props => /*#__PURE__*/_react.default.createElement(_CoreContext.default.Consumer, null, core => /*#__PURE__*/_react.default.createElement(Component, _extends({}, props, {
|
|
13
|
+
core: core
|
|
14
|
+
})));
|
|
24
15
|
}
|
|
@@ -4,12 +4,7 @@ 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
|
-
|
|
11
|
-
|
|
12
|
-
var OrganizationContext = /*#__PURE__*/_react.default.createContext();
|
|
13
|
-
|
|
14
|
-
var _default = OrganizationContext;
|
|
15
|
-
exports.default = _default;
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const OrganizationContext = /*#__PURE__*/_react.default.createContext();
|
|
10
|
+
var _default = exports.default = OrganizationContext;
|