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
|
@@ -4,22 +4,16 @@ 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 _InputBase = _interopRequireDefault(require("@material-ui/core/InputBase"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
|
|
22
|
-
var muiStyle = {
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
15
|
+
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); } /* eslint-disable react/jsx-no-duplicate-props */ // !! had to disable duplicate props because InputProps (capital I) vs inputProps(lowercase) target different sub components
|
|
16
|
+
const muiStyle = {
|
|
23
17
|
styleBox: {
|
|
24
18
|
position: 'relative',
|
|
25
19
|
borderStyle: 'solid',
|
|
@@ -28,8 +22,8 @@ var muiStyle = {
|
|
|
28
22
|
borderRadius: 4,
|
|
29
23
|
paddingTop: 11,
|
|
30
24
|
paddingBottom: 11,
|
|
31
|
-
paddingLeft: 10
|
|
32
|
-
|
|
25
|
+
paddingLeft: 10
|
|
26
|
+
// padding: 10,
|
|
33
27
|
},
|
|
34
28
|
label: {
|
|
35
29
|
fontSize: '1rem',
|
|
@@ -52,27 +46,28 @@ var muiStyle = {
|
|
|
52
46
|
fontSize: 'smaller'
|
|
53
47
|
}
|
|
54
48
|
};
|
|
55
|
-
|
|
56
49
|
function CoreTimerInput(props) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
50
|
+
const {
|
|
51
|
+
label,
|
|
52
|
+
time,
|
|
53
|
+
handleUpdateTime,
|
|
54
|
+
showSeconds,
|
|
55
|
+
showMinutes,
|
|
56
|
+
showHours,
|
|
57
|
+
margin,
|
|
58
|
+
style,
|
|
59
|
+
disabled
|
|
60
|
+
} = props;
|
|
61
|
+
let hours = 0;
|
|
62
|
+
let min = 0;
|
|
63
|
+
let sec = time;
|
|
64
|
+
const getTime = () => {
|
|
71
65
|
hours = Math.floor(sec / 3600);
|
|
72
66
|
sec -= hours * 3600;
|
|
73
67
|
min = Math.floor(sec / 60);
|
|
74
68
|
sec -= min * 60;
|
|
75
|
-
};
|
|
69
|
+
};
|
|
70
|
+
// 1000
|
|
76
71
|
// divde by 360 get 2.777
|
|
77
72
|
// math.floor(2.7) = hours
|
|
78
73
|
// 1000 - hours * 360
|
|
@@ -80,40 +75,30 @@ function CoreTimerInput(props) {
|
|
|
80
75
|
// math.floor(4.6) = min
|
|
81
76
|
// 280 - min * 60 = seconds
|
|
82
77
|
|
|
83
|
-
|
|
84
78
|
getTime();
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var newTime = time;
|
|
88
|
-
|
|
79
|
+
const handleChange = (value, type) => {
|
|
80
|
+
let newTime = time;
|
|
89
81
|
if (type === 'hours' && value < 24) {
|
|
90
82
|
newTime -= hours * 3600;
|
|
91
83
|
newTime += 3600 * value;
|
|
92
84
|
}
|
|
93
|
-
|
|
94
85
|
if (type === 'min' && value < 60) {
|
|
95
86
|
newTime -= min * 60;
|
|
96
87
|
newTime += 60 * value;
|
|
97
88
|
}
|
|
98
|
-
|
|
99
89
|
if (type === 'sec' && value < 60) {
|
|
100
90
|
newTime -= sec;
|
|
101
91
|
newTime += 1 * value; // added the 1 to convert value to int
|
|
102
92
|
}
|
|
103
|
-
|
|
104
93
|
return handleUpdateTime(Math.abs(newTime));
|
|
105
94
|
};
|
|
106
|
-
|
|
107
95
|
function formatValue(value) {
|
|
108
|
-
|
|
109
|
-
|
|
96
|
+
const str = value.toString();
|
|
110
97
|
if (str.length === 1) {
|
|
111
98
|
return "0".concat(str);
|
|
112
99
|
}
|
|
113
|
-
|
|
114
100
|
return str;
|
|
115
101
|
}
|
|
116
|
-
|
|
117
102
|
function getMarginStyle() {
|
|
118
103
|
if (margin === 'normal') {
|
|
119
104
|
return {
|
|
@@ -121,7 +106,6 @@ function CoreTimerInput(props) {
|
|
|
121
106
|
marginBottom: 8
|
|
122
107
|
};
|
|
123
108
|
}
|
|
124
|
-
|
|
125
109
|
if (margin === 'dense') {
|
|
126
110
|
return {
|
|
127
111
|
paddingTop: 3,
|
|
@@ -130,10 +114,8 @@ function CoreTimerInput(props) {
|
|
|
130
114
|
marginBottom: 4
|
|
131
115
|
};
|
|
132
116
|
}
|
|
133
|
-
|
|
134
117
|
return {};
|
|
135
118
|
}
|
|
136
|
-
|
|
137
119
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
138
120
|
style: _objectSpread(_objectSpread(_objectSpread({}, muiStyle.styleBox), getMarginStyle()), style)
|
|
139
121
|
}, label && /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -153,9 +135,7 @@ function CoreTimerInput(props) {
|
|
|
153
135
|
}, /*#__PURE__*/_react.default.createElement(_InputBase.default, {
|
|
154
136
|
id: "hoursInput",
|
|
155
137
|
value: formatValue(hours),
|
|
156
|
-
onChange:
|
|
157
|
-
return handleChange(event.target.value, 'hours');
|
|
158
|
-
},
|
|
138
|
+
onChange: event => handleChange(event.target.value, 'hours'),
|
|
159
139
|
type: "number",
|
|
160
140
|
inputProps: {
|
|
161
141
|
min: '0'
|
|
@@ -171,9 +151,7 @@ function CoreTimerInput(props) {
|
|
|
171
151
|
}, /*#__PURE__*/_react.default.createElement(_InputBase.default, {
|
|
172
152
|
id: "minutesInput",
|
|
173
153
|
value: formatValue(min),
|
|
174
|
-
onChange:
|
|
175
|
-
return handleChange(event.target.value, 'min');
|
|
176
|
-
},
|
|
154
|
+
onChange: event => handleChange(event.target.value, 'min'),
|
|
177
155
|
type: "number",
|
|
178
156
|
inputProps: {
|
|
179
157
|
min: '0'
|
|
@@ -189,20 +167,19 @@ function CoreTimerInput(props) {
|
|
|
189
167
|
}, /*#__PURE__*/_react.default.createElement(_InputBase.default, {
|
|
190
168
|
id: "secondsInput",
|
|
191
169
|
value: formatValue(sec),
|
|
192
|
-
onChange:
|
|
193
|
-
return handleChange(event.target.value, 'sec');
|
|
194
|
-
},
|
|
170
|
+
onChange: event => handleChange(event.target.value, 'sec'),
|
|
195
171
|
type: "number",
|
|
196
172
|
inputProps: {
|
|
197
173
|
min: '0'
|
|
198
174
|
},
|
|
199
175
|
disabled: disabled
|
|
200
|
-
})))));
|
|
176
|
+
})))));
|
|
177
|
+
|
|
178
|
+
// should take prop for time in seconds
|
|
201
179
|
// should take a handleChange function
|
|
202
180
|
// pull the event target value and then update the time with that * seconds
|
|
203
181
|
// might wanna move this coreLibrary after
|
|
204
182
|
}
|
|
205
|
-
|
|
206
183
|
CoreTimerInput.propTypes = {
|
|
207
184
|
label: _propTypes.default.string,
|
|
208
185
|
time: _propTypes.default.number.isRequired,
|
|
@@ -223,5 +200,4 @@ CoreTimerInput.defaultProps = {
|
|
|
223
200
|
style: {},
|
|
224
201
|
disabled: false
|
|
225
202
|
};
|
|
226
|
-
var _default = CoreTimerInput;
|
|
227
|
-
exports.default = _default;
|
|
203
|
+
var _default = exports.default = CoreTimerInput;
|
|
@@ -4,39 +4,34 @@ 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 _InputAdornment = _interopRequireDefault(require("@material-ui/core/InputAdornment"));
|
|
11
|
-
|
|
12
9
|
var _TextField = _interopRequireDefault(require("@material-ui/core/TextField"));
|
|
13
|
-
|
|
14
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var getTime = function getTime() {
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
16
|
+
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); } /* eslint-disable react/jsx-no-duplicate-props */ // !! had to disable duplicate props because InputProps (capital I) vs inputProps(lowercase) target different sub components
|
|
17
|
+
const CoreTimerInputOld = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
time,
|
|
20
|
+
handleUpdateTime,
|
|
21
|
+
showSeconds,
|
|
22
|
+
showHours,
|
|
23
|
+
style
|
|
24
|
+
} = _ref;
|
|
25
|
+
let hours = 0;
|
|
26
|
+
let min = 0;
|
|
27
|
+
let sec = time;
|
|
28
|
+
const getTime = () => {
|
|
35
29
|
hours = Math.floor(sec / 3600);
|
|
36
30
|
sec -= hours * 3600;
|
|
37
31
|
min = Math.floor(sec / 60);
|
|
38
32
|
sec -= min * 60;
|
|
39
|
-
};
|
|
33
|
+
};
|
|
34
|
+
// 1000
|
|
40
35
|
// divde by 360 get 2.777
|
|
41
36
|
// math.floor(2.7) = hours
|
|
42
37
|
// 1000 - hours * 360
|
|
@@ -44,30 +39,23 @@ var CoreTimerInputOld = function CoreTimerInputOld(_ref) {
|
|
|
44
39
|
// math.floor(4.6) = min
|
|
45
40
|
// 280 - min * 60 = seconds
|
|
46
41
|
|
|
47
|
-
|
|
48
42
|
getTime();
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var newTime = time;
|
|
52
|
-
|
|
43
|
+
const handleChange = (value, type) => {
|
|
44
|
+
let newTime = time;
|
|
53
45
|
if (type === 'hours' && value < 24) {
|
|
54
46
|
newTime -= hours * 3600;
|
|
55
47
|
newTime += 3600 * value;
|
|
56
48
|
}
|
|
57
|
-
|
|
58
49
|
if (type === 'min' && value < 60) {
|
|
59
50
|
newTime -= min * 60;
|
|
60
51
|
newTime += 60 * value;
|
|
61
52
|
}
|
|
62
|
-
|
|
63
53
|
if (type === 'sec' && value < 60) {
|
|
64
54
|
newTime -= sec;
|
|
65
55
|
newTime += 1 * value; // added the 1 to convert value to int
|
|
66
56
|
}
|
|
67
|
-
|
|
68
57
|
return handleUpdateTime(Math.abs(newTime));
|
|
69
58
|
};
|
|
70
|
-
|
|
71
59
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
72
60
|
style: _objectSpread({
|
|
73
61
|
display: 'flex',
|
|
@@ -76,9 +64,7 @@ var CoreTimerInputOld = function CoreTimerInputOld(_ref) {
|
|
|
76
64
|
}, showHours && /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
77
65
|
id: "hoursInput",
|
|
78
66
|
value: hours,
|
|
79
|
-
onChange:
|
|
80
|
-
return handleChange(event.target.value, 'hours');
|
|
81
|
-
},
|
|
67
|
+
onChange: event => handleChange(event.target.value, 'hours'),
|
|
82
68
|
type: "number",
|
|
83
69
|
style: {
|
|
84
70
|
width: '32%'
|
|
@@ -99,9 +85,7 @@ var CoreTimerInputOld = function CoreTimerInputOld(_ref) {
|
|
|
99
85
|
}), /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
100
86
|
id: "minutesInput",
|
|
101
87
|
value: min,
|
|
102
|
-
onChange:
|
|
103
|
-
return handleChange(event.target.value, 'min');
|
|
104
|
-
},
|
|
88
|
+
onChange: event => handleChange(event.target.value, 'min'),
|
|
105
89
|
type: "number",
|
|
106
90
|
style: {
|
|
107
91
|
width: '32%'
|
|
@@ -122,9 +106,7 @@ var CoreTimerInputOld = function CoreTimerInputOld(_ref) {
|
|
|
122
106
|
}), showSeconds && /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
123
107
|
id: "secondsInput",
|
|
124
108
|
value: sec,
|
|
125
|
-
onChange:
|
|
126
|
-
return handleChange(event.target.value, 'sec');
|
|
127
|
-
},
|
|
109
|
+
onChange: event => handleChange(event.target.value, 'sec'),
|
|
128
110
|
type: "number",
|
|
129
111
|
style: {
|
|
130
112
|
width: '32%'
|
|
@@ -142,12 +124,13 @@ var CoreTimerInputOld = function CoreTimerInputOld(_ref) {
|
|
|
142
124
|
},
|
|
143
125
|
margin: "normal",
|
|
144
126
|
variant: "outlined"
|
|
145
|
-
}));
|
|
127
|
+
}));
|
|
128
|
+
|
|
129
|
+
// should take prop for time in seconds
|
|
146
130
|
// should take a handleChange function
|
|
147
131
|
// pull the event target value and then update the time with that * seconds
|
|
148
132
|
// might wanna move this coreLibrary after
|
|
149
133
|
};
|
|
150
|
-
|
|
151
134
|
CoreTimerInputOld.propTypes = {
|
|
152
135
|
time: _propTypes.default.number.isRequired,
|
|
153
136
|
handleUpdateTime: _propTypes.default.func.isRequired,
|
|
@@ -160,5 +143,4 @@ CoreTimerInputOld.defaultProps = {
|
|
|
160
143
|
showHours: true,
|
|
161
144
|
style: {}
|
|
162
145
|
};
|
|
163
|
-
var _default = CoreTimerInputOld;
|
|
164
|
-
exports.default = _default;
|
|
146
|
+
var _default = exports.default = CoreTimerInputOld;
|
|
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _CoreTimerInput.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
12
|
var _CoreTimerInput = _interopRequireDefault(require("./CoreTimerInput"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -1,111 +1,92 @@
|
|
|
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 _styles = require("@material-ui/core/styles");
|
|
13
|
-
|
|
14
9
|
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
15
|
-
|
|
16
10
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
17
|
-
|
|
18
11
|
var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
|
|
19
|
-
|
|
20
12
|
var _Print = _interopRequireDefault(require("@material-ui/icons/Print"));
|
|
21
|
-
|
|
22
13
|
var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
23
|
-
|
|
24
14
|
var _Toolbar = _interopRequireDefault(require("@material-ui/core/Toolbar"));
|
|
25
|
-
|
|
26
15
|
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
|
|
27
|
-
|
|
28
16
|
var _Save = _interopRequireDefault(require("@material-ui/icons/Save"));
|
|
29
|
-
|
|
30
17
|
var _Badge = _interopRequireDefault(require("@material-ui/core/Badge"));
|
|
31
|
-
|
|
32
18
|
var _reactIntl = require("react-intl");
|
|
33
|
-
|
|
34
19
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
padding: theme.spacing.unit * 2,
|
|
77
|
-
textAlign: 'center',
|
|
78
|
-
color: theme.palette.text.secondary
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
|
+
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); }
|
|
22
|
+
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; }
|
|
23
|
+
const styles = theme => ({
|
|
24
|
+
fab: {
|
|
25
|
+
margin: 0,
|
|
26
|
+
top: 'auto',
|
|
27
|
+
right: 20,
|
|
28
|
+
bottom: 20,
|
|
29
|
+
left: 'auto',
|
|
30
|
+
position: 'fixed'
|
|
31
|
+
},
|
|
32
|
+
appBar: {
|
|
33
|
+
position: 'relative'
|
|
34
|
+
},
|
|
35
|
+
iconStyle: {
|
|
36
|
+
marginRight: 10
|
|
37
|
+
},
|
|
38
|
+
closeIconStyle: {
|
|
39
|
+
marginLeft: 10
|
|
40
|
+
},
|
|
41
|
+
flex: {
|
|
42
|
+
flex: 1
|
|
43
|
+
},
|
|
44
|
+
root: {
|
|
45
|
+
flexGrow: 1
|
|
46
|
+
},
|
|
47
|
+
separator: {
|
|
48
|
+
display: 'inline',
|
|
49
|
+
width: 2,
|
|
50
|
+
height: 36,
|
|
51
|
+
background: '#496b78',
|
|
52
|
+
margin: 7
|
|
53
|
+
},
|
|
54
|
+
paper: {
|
|
55
|
+
margin: '10px 10px 10px 10px',
|
|
56
|
+
padding: theme.spacing.unit * 2,
|
|
57
|
+
textAlign: 'center',
|
|
58
|
+
color: theme.palette.text.secondary
|
|
59
|
+
}
|
|
60
|
+
});
|
|
83
61
|
function CoreToolbar(props) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
62
|
+
const {
|
|
63
|
+
title,
|
|
64
|
+
warning,
|
|
65
|
+
intl,
|
|
66
|
+
classes,
|
|
67
|
+
showSeperator,
|
|
68
|
+
disableHotkeys,
|
|
69
|
+
saveDisabled,
|
|
70
|
+
handleSave
|
|
71
|
+
} = props;
|
|
72
|
+
|
|
92
73
|
/* const propsRef = useRef(props);
|
|
93
74
|
useLayoutEffect(() => {
|
|
94
75
|
propsRef.current = props;
|
|
95
76
|
}); */
|
|
96
77
|
|
|
97
|
-
|
|
78
|
+
const handleKeyDown = (0, _react.useCallback)(e => {
|
|
98
79
|
// NOTE: In theory it would be good to have a hotkey for the close button.
|
|
99
80
|
if (!disableHotkeys) {
|
|
100
81
|
// Look for CTRL+S or META+S
|
|
101
82
|
if ((window.navigator.platform.match('Mac') ? e.metaKey : e.ctrlKey) && e.keyCode === 83) {
|
|
102
83
|
// CTRL+S or META+S (Mac)
|
|
103
84
|
e.preventDefault();
|
|
104
|
-
|
|
105
85
|
if (!saveDisabled) {
|
|
106
86
|
// console.log('calling save');
|
|
107
87
|
handleSave();
|
|
108
|
-
} else {
|
|
88
|
+
} else {
|
|
89
|
+
// console.log('save disabled');
|
|
109
90
|
}
|
|
110
91
|
/* } else if (e.altKey && e.keyCode === 115) {
|
|
111
92
|
// ALT+F4
|
|
@@ -119,20 +100,19 @@ function CoreToolbar(props) {
|
|
|
119
100
|
if (!props.closeDisabled) {
|
|
120
101
|
props.handleClose();
|
|
121
102
|
} */
|
|
122
|
-
|
|
123
103
|
}
|
|
124
|
-
} else {
|
|
104
|
+
} else {
|
|
105
|
+
// console.log('hotkeys disabled');
|
|
125
106
|
}
|
|
126
107
|
}, [disableHotkeys, saveDisabled, handleSave]);
|
|
108
|
+
_react.default.useEffect(() => {
|
|
109
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
127
110
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return function () {
|
|
111
|
+
// cleanup
|
|
112
|
+
return () => {
|
|
132
113
|
document.removeEventListener('keydown', handleKeyDown);
|
|
133
114
|
};
|
|
134
115
|
}, [handleKeyDown, disableHotkeys, saveDisabled, handleSave]);
|
|
135
|
-
|
|
136
116
|
return /*#__PURE__*/_react.default.createElement(_Toolbar.default, null, props.icon, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
137
117
|
variant: "h6",
|
|
138
118
|
color: "inherit",
|
|
@@ -143,9 +123,7 @@ function CoreToolbar(props) {
|
|
|
143
123
|
style: {
|
|
144
124
|
whitespace: 'nowrap'
|
|
145
125
|
},
|
|
146
|
-
onClick:
|
|
147
|
-
return props.handlePrint();
|
|
148
|
-
},
|
|
126
|
+
onClick: () => props.handlePrint(),
|
|
149
127
|
"aria-label": intl.formatMessage({
|
|
150
128
|
id: '__print'
|
|
151
129
|
}),
|
|
@@ -171,9 +149,7 @@ function CoreToolbar(props) {
|
|
|
171
149
|
style: {
|
|
172
150
|
whitespace: 'nowrap'
|
|
173
151
|
},
|
|
174
|
-
onClick:
|
|
175
|
-
return props.handleSave();
|
|
176
|
-
},
|
|
152
|
+
onClick: () => props.handleSave(),
|
|
177
153
|
"aria-label": intl.formatMessage({
|
|
178
154
|
id: '__save'
|
|
179
155
|
}),
|
|
@@ -194,12 +170,9 @@ function CoreToolbar(props) {
|
|
|
194
170
|
id: '__close'
|
|
195
171
|
}),
|
|
196
172
|
disabled: props.closeDisabled,
|
|
197
|
-
onClick:
|
|
198
|
-
return props.handleClose();
|
|
199
|
-
}
|
|
173
|
+
onClick: () => props.handleClose()
|
|
200
174
|
}, /*#__PURE__*/_react.default.createElement(_Close.default, null))));
|
|
201
175
|
}
|
|
202
|
-
|
|
203
176
|
CoreToolbar.propTypes = {
|
|
204
177
|
icon: _propTypes.default.node,
|
|
205
178
|
title: _propTypes.default.string,
|
|
@@ -230,7 +203,4 @@ CoreToolbar.defaultProps = {
|
|
|
230
203
|
disableHotkeys: false,
|
|
231
204
|
children: null
|
|
232
205
|
};
|
|
233
|
-
|
|
234
|
-
var _default = (0, _reactIntl.injectIntl)((0, _styles.withStyles)(styles)(CoreToolbar));
|
|
235
|
-
|
|
236
|
-
exports.default = _default;
|
|
206
|
+
var _default = exports.default = (0, _reactIntl.injectIntl)((0, _styles.withStyles)(styles)(CoreToolbar));
|
|
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _CoreToolbar.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
12
|
var _CoreToolbar = _interopRequireDefault(require("./CoreToolbar"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|