x25 17.1.7 → 17.1.10
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/Inputs/CaptchaBox.js +4 -37
- package/Inputs/CaptchaBox.js.map +1 -1
- package/Inputs/index.d.ts +0 -1
- package/Inputs/index.js +0 -1
- package/Inputs/index.js.map +1 -1
- package/Modal/ConfirmationModal.d.ts +7 -0
- package/Modal/ConfirmationModal.js +77 -0
- package/Modal/ConfirmationModal.js.map +1 -0
- package/Modal/ModalWindow.d.ts +4 -0
- package/Modal/ModalWindow.js +106 -0
- package/Modal/ModalWindow.js.map +1 -0
- package/Modal/Root.js +2 -2
- package/Modal/Root.js.map +1 -1
- package/Modal/getComponent.js +3 -2
- package/Modal/getComponent.js.map +1 -1
- package/Modal/index.d.ts +3 -3
- package/Modal/index.js +5 -5
- package/Modal/index.js.map +1 -1
- package/Modal/types.d.ts +34 -0
- package/package.json +2 -2
- package/Inputs/Tooltip.d.ts +0 -18
- package/Inputs/Tooltip.js +0 -52
- package/Inputs/Tooltip.js.map +0 -1
- package/Modal/Delete.d.ts +0 -42
- package/Modal/Delete.js +0 -156
- package/Modal/Delete.js.map +0 -1
- package/Modal/SimpleModal.d.ts +0 -11
- package/Modal/SimpleModal.js +0 -32
- package/Modal/SimpleModal.js.map +0 -1
package/Inputs/CaptchaBox.js
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __assign = (this && this.__assign) || function () {
|
|
18
3
|
__assign = Object.assign || function(t) {
|
|
19
4
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -31,30 +16,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
31
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
17
|
exports.CaptchaBox = void 0;
|
|
33
18
|
var react_1 = __importDefault(require("react"));
|
|
34
|
-
var reactstrap_1 = require("reactstrap");
|
|
35
19
|
var classnames_1 = __importDefault(require("classnames"));
|
|
20
|
+
var react_simple_tooltip_1 = __importDefault(require("react-simple-tooltip"));
|
|
36
21
|
var utility_1 = require("../utility");
|
|
37
|
-
var InfoIcon =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var _this = _super.call(this, props) || this;
|
|
41
|
-
_this.state = {
|
|
42
|
-
showTooltip: false,
|
|
43
|
-
};
|
|
44
|
-
_this.toggle = function () {
|
|
45
|
-
_this.setState(function (prevState) { return ({
|
|
46
|
-
showTooltip: !prevState.showTooltip,
|
|
47
|
-
}); });
|
|
48
|
-
};
|
|
49
|
-
return _this;
|
|
50
|
-
}
|
|
51
|
-
InfoIcon.prototype.render = function () {
|
|
52
|
-
return (react_1.default.createElement("div", { className: "d-inline float-right" },
|
|
53
|
-
react_1.default.createElement("i", { className: "fa fa-info-circle fa-2x text-info pull-right", id: "TooltipExample" }),
|
|
54
|
-
react_1.default.createElement(reactstrap_1.Tooltip, { isOpen: this.state.showTooltip, placement: "right", target: "TooltipExample", toggle: this.toggle }, utility_1.words.CaptchaDescription)));
|
|
55
|
-
};
|
|
56
|
-
return InfoIcon;
|
|
57
|
-
}(react_1.default.Component));
|
|
22
|
+
var InfoIcon = function () { return (react_1.default.createElement("div", { className: "d-inline float-right" },
|
|
23
|
+
react_1.default.createElement(react_simple_tooltip_1.default, { content: utility_1.words.CaptchaDescription },
|
|
24
|
+
react_1.default.createElement("i", { className: "fa fa-info-circle fa-2x text-info pull-right", id: "TooltipExample" })))); };
|
|
58
25
|
var CaptchaBox = function (props) {
|
|
59
26
|
var autoFocus = props.autoFocus, id = props.id, input = props.input, tabIndex = props.tabIndex, label = props.label, left = props.left, right = props.right, meta = props.meta;
|
|
60
27
|
if (typeof id === "undefined" || id === "") {
|
package/Inputs/CaptchaBox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaptchaBox.js","sourceRoot":"","sources":["../../src/Inputs/CaptchaBox.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaptchaBox.js","sourceRoot":"","sources":["../../src/Inputs/CaptchaBox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAgBA,gDAA0B;AAC1B,0DAAoC;AACpC,8EAA2C;AAC3C,sCAAmC;AAEnC,IAAM,QAAQ,GAAG,cAAM,OAAA,CACrB,uCAAK,SAAS,EAAC,sBAAsB;IACnC,8BAAC,8BAAO,IAAC,OAAO,EAAE,eAAK,CAAC,kBAAkB;QACxC,qCAAG,SAAS,EAAC,8CAA8C,EAAC,EAAE,EAAC,gBAAgB,GAAG,CAC1E,CACN,CACP,EANsB,CAMtB,CAAC;AAEK,IAAM,UAAU,GAAG,UAAC,KAAuB;IACxC,IAAA,SAAS,GAAoD,KAAK,UAAzD,EAAE,EAAE,GAAgD,KAAK,GAArD,EAAE,KAAK,GAAyC,KAAK,MAA9C,EAAE,QAAQ,GAA+B,KAAK,SAApC,EAAE,KAAK,GAAwB,KAAK,MAA7B,EAAE,IAAI,GAAkB,KAAK,KAAvB,EAAE,KAAK,GAAW,KAAK,MAAhB,EAAE,IAAI,GAAK,KAAK,KAAV,CAAW;IAE3E,IAAI,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,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CACP,CACR,CAAC,CAAC,CAAC,IAAI,CACJ,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AA3CW,QAAA,UAAU,cA2CrB"}
|
package/Inputs/index.d.ts
CHANGED
package/Inputs/index.js
CHANGED
|
@@ -22,7 +22,6 @@ __exportStar(require("./TextareaTemplate"), exports);
|
|
|
22
22
|
__exportStar(require("./SimpleTextarea"), exports);
|
|
23
23
|
__exportStar(require("./CaptchaBox"), exports);
|
|
24
24
|
__exportStar(require("./LabelTemplate"), exports);
|
|
25
|
-
__exportStar(require("./Tooltip"), exports);
|
|
26
25
|
__exportStar(require("./Selects"), exports);
|
|
27
26
|
__exportStar(require("./Business"), exports);
|
|
28
27
|
//# sourceMappingURL=index.js.map
|
package/Inputs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Inputs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA8B;AAC9B,qDAAmC;AACnC,kDAAgC;AAChC,kDAAgC;AAChC,iDAA+B;AAC/B,8CAA4B;AAC5B,iDAA+B;AAC/B,oDAAkC;AAClC,qDAAmC;AACnC,mDAAiC;AACjC,+CAA6B;AAC7B,kDAAgC;AAChC,4CAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Inputs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA8B;AAC9B,qDAAmC;AACnC,kDAAgC;AAChC,kDAAgC;AAChC,iDAA+B;AAC/B,8CAA4B;AAC5B,iDAA+B;AAC/B,oDAAkC;AAClC,qDAAmC;AACnC,mDAAiC;AACjC,+CAA6B;AAC7B,kDAAgC;AAChC,4CAA0B;AAC1B,6CAA2B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FooterProps, ModalWindowProps } from "./types";
|
|
3
|
+
declare type ConfirmationModalProps = ModalWindowProps & {
|
|
4
|
+
footerProps: FooterProps;
|
|
5
|
+
};
|
|
6
|
+
declare const ConfirmationModal: (props: ConfirmationModalProps) => JSX.Element;
|
|
7
|
+
export default ConfirmationModal;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
var react_1 = __importStar(require("react"));
|
|
34
|
+
var react_redux_1 = require("react-redux");
|
|
35
|
+
var actions_1 = require("../actions");
|
|
36
|
+
var utility_1 = require("../utility");
|
|
37
|
+
var _1 = require(".");
|
|
38
|
+
var ModalFooter = function (props) {
|
|
39
|
+
var languageMessage = utility_1.words.message, label = utility_1.words.label, _a = props.cancelButtonLabel, cancelButtonLabel = _a === void 0 ? label.cancel : _a, _b = props.errMessage, errMessage = _b === void 0 ? languageMessage.failPerform : _b, _c = props.confirmButtonLabel, confirmButtonLabel = _c === void 0 ? label.remove : _c, _d = props.isResponseValid, isResponseValid = _d === void 0 ? function (response) { return ({
|
|
40
|
+
valid: response === "",
|
|
41
|
+
error: response,
|
|
42
|
+
}); } : _d, _e = props.confirmButtonColor, confirmButtonColor = _e === void 0 ? "danger" : _e, _f = (0, react_1.useState)(false), isPerforming = _f[0], setIsPerforming = _f[1], dispatch = (0, react_redux_1.useDispatch)(), showError = function (msg) {
|
|
43
|
+
dispatch((0, actions_1.notifyError)(msg));
|
|
44
|
+
}, endPerforming = function (cb) {
|
|
45
|
+
setIsPerforming(false);
|
|
46
|
+
if (typeof cb === "function") {
|
|
47
|
+
cb();
|
|
48
|
+
}
|
|
49
|
+
}, handleConfirmation = function () {
|
|
50
|
+
var request = props.request, onSuccess = props.onSuccess, tryToClose = props.tryToClose;
|
|
51
|
+
setIsPerforming(true);
|
|
52
|
+
request().
|
|
53
|
+
then(function (response) {
|
|
54
|
+
var _a = isResponseValid(response), valid = _a.valid, error = _a.error;
|
|
55
|
+
if (valid) {
|
|
56
|
+
tryToClose();
|
|
57
|
+
onSuccess(response);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
endPerforming();
|
|
61
|
+
showError(error);
|
|
62
|
+
}
|
|
63
|
+
}).
|
|
64
|
+
catch(function (exception) {
|
|
65
|
+
endPerforming();
|
|
66
|
+
showError(errMessage);
|
|
67
|
+
// eslint-disable-next-line no-console
|
|
68
|
+
console.log("exception", exception);
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
return (react_1.default.createElement("div", { className: "modal-footer" },
|
|
72
|
+
react_1.default.createElement("button", { className: "btn btn-secondary me-1", onClick: props.tryToClose, type: "button" }, cancelButtonLabel),
|
|
73
|
+
react_1.default.createElement("button", { className: "btn ".concat(confirmButtonColor ? "btn-".concat(confirmButtonColor) : ""), disabled: isPerforming, onClick: handleConfirmation, type: "button" }, isPerforming ? (react_1.default.createElement("span", null,
|
|
74
|
+
react_1.default.createElement("i", { className: "fa fa-refresh fa-spin fa-fw" }), " ".concat(utility_1.words.PleaseWait))) : confirmButtonLabel)));
|
|
75
|
+
}, ConfirmationModal = function (props) { return (react_1.default.createElement(_1.ModalWindow, __assign({}, props, { Footer: ModalFooter }), props.children)); };
|
|
76
|
+
exports.default = ConfirmationModal;
|
|
77
|
+
//# sourceMappingURL=ConfirmationModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmationModal.js","sourceRoot":"","sources":["../../src/Modal/ConfirmationModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAAwC;AACxC,2CAA0C;AAC1C,sCAAyC;AACzC,sCAAmC;AAEnC,sBAAgC;AAMhC,IAAM,WAAW,GAAG,UAAC,KAAmB;IAEhC,IAAS,eAAe,GAAY,eAAK,QAAjB,EAAE,KAAK,GAAK,eAAK,MAAV,EAE/B,KAUE,KAAK,kBAVyB,EAAhC,iBAAiB,mBAAG,KAAK,CAAC,MAAM,KAAA,EAChC,KASE,KAAK,WATiC,EAAxC,UAAU,mBAAG,eAAe,CAAC,WAAW,KAAA,EACxC,KAQE,KAAK,mBAR0B,EAAjC,kBAAkB,mBAAG,KAAK,CAAC,MAAM,KAAA,EAEjC,KAME,KAAK,gBAHL,EAHF,eAAe,mBAAG,UAAC,QAAa,IAAK,OAAA,CAAC;QACpC,KAAK,EAAG,QAAQ,KAAK,EAAE;QACvB,KAAK,EAAG,QAAQ;KACjB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EAAC,OAAO,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,EAAC,QAAQ,IAChF,iBAAiB,CACX;QACT,0CACE,SAAS,EAAE,cAAO,kBAAkB,CAAC,CAAC,CAAC,cAAO,kBAAkB,CAAE,CAAC,CAAC,CAAC,EAAE,CAAE,EACzE,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAC,QAAQ,IAEX,YAAY,CAAC,CAAC,CAAC,CACb;YACE,qCAAG,SAAS,EAAC,6BAA6B,GAAG,EAC5C,WAAI,eAAK,CAAC,UAAU,CAAE,CAClB,CACR,CAAC,CAAC,CAAC,kBAAkB,CAEjB,CACL,CACP,CAAC;AACJ,CAAC,EACD,iBAAiB,GAAG,UAAC,KAA8B,IAAK,OAAA,CACtD,8BAAC,cAAW,eACN,KAAK,IACT,MAAM,EAAE,WAAW,KAClB,KAAK,CAAC,QAAQ,CACH,CACf,EANuD,CAMvD,CAAC;AAEJ,kBAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
var react_1 = __importStar(require("react"));
|
|
34
|
+
var react_redux_1 = require("react-redux");
|
|
35
|
+
var actions_1 = require("./actions");
|
|
36
|
+
var ModalWindow = function (props) {
|
|
37
|
+
var delay = 150, _a = props.size, size = _a === void 0 ? "" : _a, Footer = props.Footer, _b = (0, react_1.useState)(false), show = _b[0], setShow = _b[1], _c = (0, react_1.useState)(false), waitingToClose = _c[0], setWaitingToClose = _c[1], _d = (0, react_1.useState)(0), enterTimeout = _d[0], setEnterTimeout = _d[1], _e = (0, react_1.useState)(0), exitTimeout = _e[0], setExitTimeout = _e[1], bodyRef = (0, react_1.useRef)(null), dialogRef = (0, react_1.useRef)(null), dispatch = (0, react_redux_1.useDispatch)(), tryToClose = function () {
|
|
38
|
+
var closeModal = function () {
|
|
39
|
+
dispatch((0, actions_1.hideModal)());
|
|
40
|
+
if (typeof props.onClose === "function") {
|
|
41
|
+
props.onClose();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
clearTimeout(enterTimeout);
|
|
45
|
+
clearTimeout(exitTimeout);
|
|
46
|
+
setWaitingToClose(true);
|
|
47
|
+
setShow(false);
|
|
48
|
+
var theExit = setTimeout(function () {
|
|
49
|
+
closeModal();
|
|
50
|
+
}, delay);
|
|
51
|
+
setExitTimeout(theExit);
|
|
52
|
+
};
|
|
53
|
+
(0, react_1.useEffect)(function () {
|
|
54
|
+
var handleClickOutside = function (event) {
|
|
55
|
+
var isClickOutsideButNotOnButton = (bodyRef.current && bodyRef.current.contains(event.target) &&
|
|
56
|
+
!dialogRef.current.contains(event.target));
|
|
57
|
+
if (isClickOutsideButNotOnButton) {
|
|
58
|
+
tryToClose();
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
62
|
+
return function () {
|
|
63
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
64
|
+
};
|
|
65
|
+
}, [bodyRef]);
|
|
66
|
+
(0, react_1.useEffect)(function () {
|
|
67
|
+
var keyPressed = function (event) {
|
|
68
|
+
if (event.key === "Escape" && props.closeByEscape) {
|
|
69
|
+
tryToClose();
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
if (props.closeByEscape) {
|
|
73
|
+
document.addEventListener("keydown", keyPressed, false);
|
|
74
|
+
}
|
|
75
|
+
return function () {
|
|
76
|
+
if (props.closeByEscape) {
|
|
77
|
+
document.removeEventListener("keydown", keyPressed, false);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}, [props.closeByEscape]);
|
|
81
|
+
(0, react_1.useEffect)(function () {
|
|
82
|
+
if (!show && !waitingToClose) {
|
|
83
|
+
var theEnter = setTimeout(function () {
|
|
84
|
+
setShow(true);
|
|
85
|
+
}, delay);
|
|
86
|
+
setEnterTimeout(theEnter);
|
|
87
|
+
}
|
|
88
|
+
}, [show, waitingToClose]);
|
|
89
|
+
(0, react_1.useEffect)(function () { return function () {
|
|
90
|
+
clearTimeout(enterTimeout);
|
|
91
|
+
clearTimeout(exitTimeout);
|
|
92
|
+
}; });
|
|
93
|
+
return (react_1.default.createElement("div", { className: "modal fade d-block ".concat(show ? "show" : ""), ref: bodyRef, style: {
|
|
94
|
+
background: "rgb(0 0 0 / 45%)",
|
|
95
|
+
} },
|
|
96
|
+
react_1.default.createElement("div", { className: "modal-dialog modal-".concat(size), ref: dialogRef, role: "document" },
|
|
97
|
+
react_1.default.createElement("div", { className: "modal-content" },
|
|
98
|
+
react_1.default.createElement("div", { className: "modal-header" },
|
|
99
|
+
react_1.default.createElement("h5", { className: "modal-title" }, props.title),
|
|
100
|
+
react_1.default.createElement("button", { "aria-label": "Close", className: "btn btn-link", "data-dismiss": "modal", onClick: tryToClose, type: "button" },
|
|
101
|
+
react_1.default.createElement("i", { className: "fa fa-times" }))),
|
|
102
|
+
react_1.default.createElement("div", { className: "modal-body" }, props.children),
|
|
103
|
+
Footer ? (react_1.default.createElement(Footer, __assign({}, props.footerProps, { tryToClose: tryToClose }))) : null))));
|
|
104
|
+
};
|
|
105
|
+
exports.default = ModalWindow;
|
|
106
|
+
//# sourceMappingURL=ModalWindow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalWindow.js","sourceRoot":"","sources":["../../src/Modal/ModalWindow.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2D;AAC3D,2CAA0C;AAC1C,qCAAsC;AAGtC,IAAM,WAAW,GAAG,UAAC,KAAwB;IAC3C,IACE,KAAK,GAAG,GAAG,EACT,KAAsB,KAAK,KAAlB,EAAT,IAAI,mBAAG,EAAE,KAAA,EAAE,MAAM,GAAK,KAAK,OAAV,EAEnB,KAAkB,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAhC,IAAI,QAAA,EAAE,OAAO,QAAA,EACd,KAAsC,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAApD,cAAc,QAAA,EAAE,iBAAiB,QAAA,EAElC,KAAkC,IAAA,gBAAQ,EAAC,CAAC,CAAC,EAA5C,YAAY,QAAA,EAAE,eAAe,QAAA,EAC9B,KAAgC,IAAA,gBAAQ,EAAC,CAAC,CAAC,EAA1C,WAAW,QAAA,EAAE,cAAc,QAAA,EAE5B,OAAO,GAAS,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AC3B,sCAAI,SAAS,EAAC,aAAa,IACxB,KAAK,CAAC,KAAK,CACT;oBACL,wDACa,OAAO,EAClB,SAAS,EAAC,cAAc,kBACX,OAAO,EACpB,OAAO,EAAE,UAAU,EACnB,IAAI,EAAC,QAAQ;wBACb,qCAAG,SAAS,EAAC,aAAa,GAAG,CACtB,CACL;gBACN,uCAAK,SAAS,EAAC,YAAY,IACxB,KAAK,CAAC,QAAQ,CACX;gBAEJ,MAAM,CAAC,CAAC,CAAC,CACP,8BAAC,MAAM,eAAK,KAAK,CAAC,WAAW,IAAE,UAAU,EAAE,UAAU,IAAI,CAC1D,CAAC,CAAC,CAAC,IAAI,CAEN,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAGF,kBAAe,WAAW,CAAC"}
|
package/Modal/Root.js
CHANGED
|
@@ -50,11 +50,11 @@ var ModalRoot = /** @class */ (function (_super) {
|
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
52
|
return list.map(function (current, index) {
|
|
53
|
-
var modalType = current.get("type"), Component = (0, getComponent_1.default)(modalType);
|
|
53
|
+
var modalType = current.get("type"), Component = (0, getComponent_1.default)(modalType), isTheLastOne = current === list.size - 1;
|
|
54
54
|
if (typeof Component === "undefined") {
|
|
55
55
|
return (react_1.default.createElement("div", null, "No MODAL component for the type [".concat(modalType, "] in Modal/components.jsx")));
|
|
56
56
|
}
|
|
57
|
-
return react_1.default.createElement(Component, __assign({ key: index }, current.get("props").toJS()));
|
|
57
|
+
return (react_1.default.createElement(Component, __assign({ key: index }, current.get("props").toJS(), { closeByEscape: isTheLastOne })));
|
|
58
58
|
});
|
|
59
59
|
};
|
|
60
60
|
return ModalRoot;
|
package/Modal/Root.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Root.js","sourceRoot":"","sources":["../../src/Modal/Root.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,2CAAsC;AACtC,gDAA0B;AAC1B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O,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,IAC/B,aAAa,EAAE,YAAY,IAC3B,CACH,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAEH,gBAAC;AAAD,CAAC,AAvCD,CAAwB,eAAK,CAAC,SAAS,GAuCtC;AAED,kBAAe,IAAA,qBAAO,EAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC"}
|
package/Modal/getComponent.js
CHANGED
|
@@ -3,11 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
6
7
|
var react_1 = __importDefault(require("react"));
|
|
7
8
|
var Messages_1 = require("../Messages");
|
|
8
9
|
var util_1 = require("./util");
|
|
9
|
-
var
|
|
10
|
-
var NothingSelected = function () { return (react_1.default.createElement(
|
|
10
|
+
var ModalWindow_1 = __importDefault(require("./ModalWindow"));
|
|
11
|
+
var NothingSelected = function () { return (react_1.default.createElement(ModalWindow_1.default, { onClose: function () { }, title: "Not registered" },
|
|
11
12
|
react_1.default.createElement(Messages_1.ErrorMessage, { message: "Please define a modal component in Modal/components.jsx" }))); },
|
|
12
13
|
/* eslint-disable complexity */
|
|
13
14
|
getComponent = function (type) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getComponent.js","sourceRoot":"","sources":["../../src/Modal/getComponent.tsx"],"names":[],"mappings":";;;;;AAAA,gDAA0B;AAC1B,wCAA2C;AAC3C,+BAAkC;AAClC,8DAAwC;AAExC,IAAM,eAAe,GAAG,cAAM,OAAA,CAC1B,8BAAC,qBAAW,IAAC,KAAK,EAAC,gBAAgB;
|
|
1
|
+
{"version":3,"file":"getComponent.js","sourceRoot":"","sources":["../../src/Modal/getComponent.tsx"],"names":[],"mappings":";;;;;AAAA,yDAAyD;AACzD,gDAA0B;AAC1B,wCAA2C;AAC3C,+BAAkC;AAClC,8DAAwC;AAExC,IAAM,eAAe,GAAG,cAAM,OAAA,CAC1B,8BAAC,qBAAW,IAAC,OAAO,EAAE,cAAO,CAAC,EAAE,KAAK,EAAC,gBAAgB;IACpD,8BAAC,uBAAY,IAAC,OAAO,EAAC,yDAAyD,GAAG,CACtE,CACf,EAJ2B,CAI3B;AAED,+BAA+B;AAC/B,YAAY,GAAG,UAAC,IAAS;IACvB,IAAM,SAAS,GAAG,IAAA,eAAQ,EAAC,IAAI,CAAC,CAAC;IAEjC,IAAI,SAAS,KAAK,IAAI,EAAE;QACtB,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,eAAe,CAAC;AACzB,CAAC,CAAC;AAEJ,kBAAe,YAAY,CAAC"}
|
package/Modal/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import ConfirmationModal from "./ConfirmationModal";
|
|
2
|
+
import ModalWindow from "./ModalWindow";
|
|
3
3
|
import { injectModals } from "./util";
|
|
4
|
-
export { injectModals,
|
|
4
|
+
export { injectModals, ConfirmationModal, ModalWindow };
|
package/Modal/index.js
CHANGED
|
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
8
|
-
exports.
|
|
9
|
-
var
|
|
10
|
-
exports.
|
|
6
|
+
exports.ModalWindow = exports.ConfirmationModal = exports.injectModals = void 0;
|
|
7
|
+
var ConfirmationModal_1 = __importDefault(require("./ConfirmationModal"));
|
|
8
|
+
exports.ConfirmationModal = ConfirmationModal_1.default;
|
|
9
|
+
var ModalWindow_1 = __importDefault(require("./ModalWindow"));
|
|
10
|
+
exports.ModalWindow = ModalWindow_1.default;
|
|
11
11
|
var util_1 = require("./util");
|
|
12
12
|
Object.defineProperty(exports, "injectModals", { enumerable: true, get: function () { return util_1.injectModals; } });
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
package/Modal/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Modal/index.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Modal/index.ts"],"names":[],"mappings":";;;;;;AAAA,0EAAoD;AAI7B,4BAJhB,2BAAiB,CAIgB;AAHxC,8DAAwC;AAGE,sBAHnC,qBAAW,CAGmC;AAFrD,+BAAsC;AAE7B,6FAFA,mBAAY,OAEA"}
|
package/Modal/types.d.ts
CHANGED
|
@@ -1,2 +1,36 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
export declare type ModalsTypes = Record<string, React.ReactNode>;
|
|
3
|
+
export declare type ModalWindowProps = {
|
|
4
|
+
onClose: () => any;
|
|
5
|
+
closeByEscape?: boolean;
|
|
6
|
+
children: JSX.Element;
|
|
7
|
+
title: string;
|
|
8
|
+
Footer?: any;
|
|
9
|
+
footerProps?: FooterProps;
|
|
10
|
+
size?: "lg" | "sm" | "xl" | "";
|
|
11
|
+
};
|
|
12
|
+
declare type onConfirmMethodsTypes = {
|
|
13
|
+
startPerforming: () => void;
|
|
14
|
+
endPerforming: (cb: any) => void;
|
|
15
|
+
closeModal: () => void;
|
|
16
|
+
};
|
|
17
|
+
export declare type FooterProps = {
|
|
18
|
+
cancelButtonLabel: string;
|
|
19
|
+
title: string;
|
|
20
|
+
errMessage: string;
|
|
21
|
+
confirmButtonLabel: string;
|
|
22
|
+
tryToClose: () => any;
|
|
23
|
+
readonly confirmButtonColor?: string;
|
|
24
|
+
readonly message: any;
|
|
25
|
+
readonly focusButton: boolean;
|
|
26
|
+
readonly onConfirm: (methods: onConfirmMethodsTypes) => () => void;
|
|
27
|
+
readonly closeModal: () => void;
|
|
28
|
+
readonly showError: (message?: string) => void;
|
|
29
|
+
readonly request: () => Promise<any>;
|
|
30
|
+
readonly onSuccess: (response: any) => void;
|
|
31
|
+
readonly isResponseValid: (response: any) => {
|
|
32
|
+
valid: boolean;
|
|
33
|
+
error: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "17.1.
|
|
2
|
+
"version": "17.1.10",
|
|
3
3
|
"name": "x25",
|
|
4
4
|
"description": "x25",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"react-final-form": "^6.5.9",
|
|
115
115
|
"react-notification-system-redux2": "^3.0.4",
|
|
116
116
|
"react-redux": "^8.0.1",
|
|
117
|
-
"
|
|
117
|
+
"react-simple-tooltip": "^2.6.3",
|
|
118
118
|
"redux": "^4.2.0",
|
|
119
119
|
"redux-injector": "^0.1.0",
|
|
120
120
|
"reselect": "^4.1.5",
|
package/Inputs/Tooltip.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare type TooltipPropTypes = {
|
|
2
|
-
readonly long: any;
|
|
3
|
-
readonly short: any;
|
|
4
|
-
readonly target: string;
|
|
5
|
-
readonly placement: any;
|
|
6
|
-
};
|
|
7
|
-
declare type TooltipStateTypes = {
|
|
8
|
-
tooltipOpen: boolean;
|
|
9
|
-
};
|
|
10
|
-
import React from "react";
|
|
11
|
-
export declare class Tooltip extends React.Component<TooltipPropTypes, TooltipStateTypes> {
|
|
12
|
-
state: TooltipStateTypes;
|
|
13
|
-
toggle: () => void;
|
|
14
|
-
constructor(props: TooltipPropTypes);
|
|
15
|
-
shouldComponentUpdate(nextProps: TooltipPropTypes, nextState: TooltipStateTypes): boolean;
|
|
16
|
-
render(): JSX.Element;
|
|
17
|
-
}
|
|
18
|
-
export {};
|
package/Inputs/Tooltip.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.Tooltip = void 0;
|
|
22
|
-
var react_1 = __importDefault(require("react"));
|
|
23
|
-
var reactstrap_1 = require("reactstrap");
|
|
24
|
-
var Tooltip = /** @class */ (function (_super) {
|
|
25
|
-
__extends(Tooltip, _super);
|
|
26
|
-
function Tooltip(props) {
|
|
27
|
-
var _this = _super.call(this, props) || this;
|
|
28
|
-
_this.state = {
|
|
29
|
-
tooltipOpen: false,
|
|
30
|
-
};
|
|
31
|
-
_this.toggle = function () { return _this.setState(function (prevState) { return ({
|
|
32
|
-
tooltipOpen: !prevState.tooltipOpen,
|
|
33
|
-
}); }); };
|
|
34
|
-
return _this;
|
|
35
|
-
}
|
|
36
|
-
Tooltip.prototype.shouldComponentUpdate = function (nextProps, nextState) {
|
|
37
|
-
return (this.props.long !== nextProps.long ||
|
|
38
|
-
this.props.short !== nextProps.short ||
|
|
39
|
-
this.props.placement !== nextProps.placement ||
|
|
40
|
-
this.props.target !== nextProps.target ||
|
|
41
|
-
this.state.tooltipOpen !== nextState.tooltipOpen);
|
|
42
|
-
};
|
|
43
|
-
Tooltip.prototype.render = function () {
|
|
44
|
-
var _a = this.props, target = _a.target, short = _a.short, placement = _a.placement;
|
|
45
|
-
return (react_1.default.createElement("span", null,
|
|
46
|
-
react_1.default.createElement("span", { id: "".concat(target, "-tooltip") }, short),
|
|
47
|
-
react_1.default.createElement(reactstrap_1.Tooltip, { isOpen: this.state.tooltipOpen, placement: placement, target: "".concat(target, "-tooltip"), toggle: this.toggle }, this.props.long)));
|
|
48
|
-
};
|
|
49
|
-
return Tooltip;
|
|
50
|
-
}(react_1.default.Component));
|
|
51
|
-
exports.Tooltip = Tooltip;
|
|
52
|
-
//# sourceMappingURL=Tooltip.js.map
|
package/Inputs/Tooltip.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../src/Inputs/Tooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AASA,gDAA0B;AAC1B,yCAA0D;AAE1D;IAA6B,2BAAoD;IAI/E,iBAAa,KAAuB;QAApC,YACE,kBAAM,KAAK,CAAC,SAQb;QAPC,KAAI,CAAC,KAAK,GAAG;YACX,WAAW,EAAE,KAAK;SACnB,CAAC;QAEF,KAAI,CAAC,MAAM,GAAG,cAAM,OAAA,KAAI,CAAC,QAAQ,CAAC,UAAC,SAAS,IAAK,OAAA,CAAC;YAChD,WAAW,EAAE,CAAC,SAAS,CAAC,WAAW;SACpC,CAAC,EAF+C,CAE/C,CAAC,EAFiB,CAEjB,CAAC;;IACN,CAAC;IAED,uCAAqB,GAArB,UAAuB,SAA2B,EAAE,SAA4B;QAC9E,OAAO,CACL,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI;YAClC,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,KAAK;YACpC,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,SAAS;YAC5C,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM;YACrC,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,SAAS,CAAC,WAAW,CAClD,CAAC;IACJ,CAAC;IAED,wBAAM,GAAN;QACQ,IAAA,KAIF,IAAI,CAAC,KAAK,EAHZ,MAAM,YAAA,EACN,KAAK,WAAA,EACL,SAAS,eACG,CAAC;QAEf,OAAO,CACL;YACE,wCAAM,EAAE,EAAE,UAAG,MAAM,aAAU,IAAG,KAAK,CAAQ;YAC7C,8BAAC,oBAAiB,IAChB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EAC9B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,UAAG,MAAM,aAAU,EAC3B,MAAM,EAAE,IAAI,CAAC,MAAM,IAClB,IAAI,CAAC,KAAK,CAAC,IAAI,CACE,CACf,CACR,CAAC;IACJ,CAAC;IAEH,cAAC;AAAD,CAAC,AA9CD,CAA6B,eAAK,CAAC,SAAS,GA8C3C;AA9CY,0BAAO"}
|
package/Modal/Delete.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
declare type onConfirmMethodsTypes = {
|
|
2
|
-
startPerforming: () => void;
|
|
3
|
-
endPerforming: (cb: any) => void;
|
|
4
|
-
closeModal: () => void;
|
|
5
|
-
};
|
|
6
|
-
declare type ConfirmStateTypes = {
|
|
7
|
-
isPerforming: boolean;
|
|
8
|
-
};
|
|
9
|
-
import React, { MouseEventHandler } from "react";
|
|
10
|
-
declare type ConfirmPropTypes = {
|
|
11
|
-
readonly errMessage?: string;
|
|
12
|
-
readonly title?: string;
|
|
13
|
-
readonly confirmButtonColor?: string;
|
|
14
|
-
readonly cancelButtonLabel: string | null | undefined;
|
|
15
|
-
readonly confirmButtonLabel: string | null | undefined;
|
|
16
|
-
readonly message: any;
|
|
17
|
-
readonly focusButton: boolean;
|
|
18
|
-
readonly onConfirm: (methods: onConfirmMethodsTypes) => () => void;
|
|
19
|
-
readonly closeModal: () => void;
|
|
20
|
-
readonly showError: (message?: string) => void;
|
|
21
|
-
readonly request: () => Promise<any>;
|
|
22
|
-
readonly onSuccess: (response: any) => void;
|
|
23
|
-
readonly isResponseValid: (response: any) => {
|
|
24
|
-
valid: boolean;
|
|
25
|
-
error: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
declare class Confirm extends React.Component<ConfirmPropTypes, ConfirmStateTypes> {
|
|
29
|
-
state: ConfirmStateTypes;
|
|
30
|
-
field: any;
|
|
31
|
-
endPerforming: (cb?: any) => void;
|
|
32
|
-
handleConfirmation: MouseEventHandler<HTMLButtonElement>;
|
|
33
|
-
handleConfirmButton: (node: any) => void;
|
|
34
|
-
startPerforming: (cb?: any) => void;
|
|
35
|
-
focusConfirmButton: () => any;
|
|
36
|
-
constructor(props: ConfirmPropTypes);
|
|
37
|
-
componentDidMount(): void;
|
|
38
|
-
shouldComponentUpdate(nextProps: ConfirmPropTypes, nextState: ConfirmStateTypes): boolean;
|
|
39
|
-
render(): JSX.Element;
|
|
40
|
-
}
|
|
41
|
-
declare const _default: import("react-redux").ConnectedComponent<typeof Confirm, Omit<React.ClassAttributes<Confirm> & ConfirmPropTypes, "title" | "errMessage" | "confirmButtonColor" | "cancelButtonLabel" | "confirmButtonLabel" | "focusButton" | "isResponseValid"> & import("react-redux").ConnectProps>;
|
|
42
|
-
export default _default;
|
package/Modal/Delete.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
var react_1 = __importDefault(require("react"));
|
|
41
|
-
var react_redux_1 = require("react-redux");
|
|
42
|
-
var reactstrap_1 = require("reactstrap");
|
|
43
|
-
var utility_1 = require("../utility");
|
|
44
|
-
var languageMessage = utility_1.words.message, label = utility_1.words.label;
|
|
45
|
-
var x25Actions = __importStar(require("../actions"));
|
|
46
|
-
var actions = __importStar(require("./actions"));
|
|
47
|
-
var mapProps = function () { return ({
|
|
48
|
-
errMessage: languageMessage.failPerform,
|
|
49
|
-
title: label.confirmation,
|
|
50
|
-
cancelButtonLabel: label.cancel,
|
|
51
|
-
confirmButtonColor: "danger",
|
|
52
|
-
confirmButtonLabel: label.remove,
|
|
53
|
-
focusButton: true,
|
|
54
|
-
isResponseValid: function (response) { return ({
|
|
55
|
-
valid: response === "",
|
|
56
|
-
error: response,
|
|
57
|
-
}); },
|
|
58
|
-
}); }, mapDispatchToProps = function (dispatch) { return ({
|
|
59
|
-
closeModal: function () {
|
|
60
|
-
dispatch(actions.hideModal());
|
|
61
|
-
},
|
|
62
|
-
showError: function (errMessage) {
|
|
63
|
-
dispatch(x25Actions.notifyError(errMessage));
|
|
64
|
-
},
|
|
65
|
-
}); };
|
|
66
|
-
var Confirm = /** @class */ (function (_super) {
|
|
67
|
-
__extends(Confirm, _super);
|
|
68
|
-
function Confirm(props) {
|
|
69
|
-
var _this = _super.call(this, props) || this;
|
|
70
|
-
var that = _this;
|
|
71
|
-
_this.state = {
|
|
72
|
-
isPerforming: false,
|
|
73
|
-
};
|
|
74
|
-
_this.handleConfirmButton = function (node) {
|
|
75
|
-
_this.field = node;
|
|
76
|
-
};
|
|
77
|
-
_this.focusConfirmButton = function () { return setTimeout(function () {
|
|
78
|
-
var focusButton = _this.props.focusButton;
|
|
79
|
-
if (focusButton) {
|
|
80
|
-
setTimeout(function () {
|
|
81
|
-
var field = _this.field;
|
|
82
|
-
if (field && field !== null) {
|
|
83
|
-
field.focus();
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}); };
|
|
88
|
-
_this.startPerforming = function (cb) {
|
|
89
|
-
_this.setState({
|
|
90
|
-
isPerforming: true,
|
|
91
|
-
}, cb);
|
|
92
|
-
};
|
|
93
|
-
_this.endPerforming = function (cb) { return _this.setState({
|
|
94
|
-
isPerforming: false,
|
|
95
|
-
}, function () {
|
|
96
|
-
/* eslint-disable callback-return */
|
|
97
|
-
that.focusConfirmButton();
|
|
98
|
-
if (typeof cb === "function") {
|
|
99
|
-
cb();
|
|
100
|
-
}
|
|
101
|
-
}); };
|
|
102
|
-
var _a = _this, startPerforming = _a.startPerforming, endPerforming = _a.endPerforming;
|
|
103
|
-
_this.handleConfirmation = function () {
|
|
104
|
-
var _a = _this.props, request = _a.request, onSuccess = _a.onSuccess, closeModal = _a.closeModal, errMessage = _a.errMessage, showError = _a.showError, isResponseValid = _a.isResponseValid;
|
|
105
|
-
startPerforming(function () {
|
|
106
|
-
request().then(function (response) {
|
|
107
|
-
var _a = isResponseValid(response), valid = _a.valid, error = _a.error;
|
|
108
|
-
if (valid) {
|
|
109
|
-
closeModal();
|
|
110
|
-
onSuccess(response);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
endPerforming();
|
|
114
|
-
showError(error);
|
|
115
|
-
}
|
|
116
|
-
}).
|
|
117
|
-
catch(function (exception) {
|
|
118
|
-
endPerforming();
|
|
119
|
-
showError(errMessage);
|
|
120
|
-
// eslint-disable
|
|
121
|
-
console.log("exception", exception);
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
};
|
|
125
|
-
return _this;
|
|
126
|
-
}
|
|
127
|
-
Confirm.prototype.componentDidMount = function () {
|
|
128
|
-
this.focusConfirmButton();
|
|
129
|
-
};
|
|
130
|
-
Confirm.prototype.shouldComponentUpdate = function (nextProps, nextState) {
|
|
131
|
-
return (this.props.cancelButtonLabel !== nextProps.cancelButtonLabel ||
|
|
132
|
-
this.props.confirmButtonLabel !== nextProps.confirmButtonLabel ||
|
|
133
|
-
this.props.focusButton !== nextProps.focusButton ||
|
|
134
|
-
this.props.title !== nextProps.title ||
|
|
135
|
-
this.props.confirmButtonColor !== nextProps.confirmButtonColor ||
|
|
136
|
-
this.state.isPerforming !== nextState.isPerforming);
|
|
137
|
-
};
|
|
138
|
-
Confirm.prototype.render = function () {
|
|
139
|
-
var isPerforming = this.state.isPerforming, _a = this.props, cancelButtonLabel = _a.cancelButtonLabel, confirmButtonLabel = _a.confirmButtonLabel, message = _a.message, title = _a.title, confirmButtonColor = _a.confirmButtonColor, closeModal = _a.closeModal, getConfirmButtonText = function () {
|
|
140
|
-
if (isPerforming) {
|
|
141
|
-
return (react_1.default.createElement("span", null,
|
|
142
|
-
react_1.default.createElement("i", { className: "fa fa-refresh fa-spin fa-fw" }), " ".concat(utility_1.words.PleaseWait)));
|
|
143
|
-
}
|
|
144
|
-
return confirmButtonLabel;
|
|
145
|
-
};
|
|
146
|
-
return (react_1.default.createElement(reactstrap_1.Modal, { autoFocus: !this.props.focusButton, isOpen: true, toggle: closeModal, zIndex: "1061" },
|
|
147
|
-
react_1.default.createElement(reactstrap_1.ModalHeader, { toggle: closeModal }, title),
|
|
148
|
-
react_1.default.createElement(reactstrap_1.ModalBody, null, message),
|
|
149
|
-
react_1.default.createElement(reactstrap_1.ModalFooter, null,
|
|
150
|
-
react_1.default.createElement(reactstrap_1.Button, { className: "me-1", color: "secondary", onClick: closeModal }, cancelButtonLabel),
|
|
151
|
-
react_1.default.createElement("button", { className: "btn ".concat(confirmButtonColor ? "btn-".concat(confirmButtonColor) : ""), disabled: isPerforming, onClick: this.handleConfirmation, ref: this.handleConfirmButton, type: "button" }, getConfirmButtonText()))));
|
|
152
|
-
};
|
|
153
|
-
return Confirm;
|
|
154
|
-
}(react_1.default.Component));
|
|
155
|
-
exports.default = (0, react_redux_1.connect)(null, mapDispatchToProps, mapProps)(Confirm);
|
|
156
|
-
//# sourceMappingURL=Delete.js.map
|
package/Modal/Delete.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Delete.js","sourceRoot":"","sources":["../../src/Modal/Delete.tsx"],"names":[],"mappings":";;;;;;;;;;;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kBAAkB,CAAC;QAC5B,CAAC,CAAC;QAEJ,OAAO,CACL,8BAAC,kBAAK,IAAC,SAAS,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,MAAM,QAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAC,MAAM;YACjF,8BAAC,wBAAW,IAAC,MAAM,EAAE,UAAU,IAC5B,KAAK,CACM;YACd,8BAAC,sBAAS,QACP,OAAO,CACE;YACZ,8BAAC,wBAAW;gBACV,8BAAC,mBAAM,IAAC,SAAS,EAAC,MAAM,EAAC,KAAK,EAAC,WAAW,EAAC,OAAO,EAAE,UAAU,IAC3D,iBAAiB,CACX;gBACT,0CACE,SAAS,EAAE,cAAO,kBAAkB,CAAC,CAAC,CAAC,cAAO,kBAAkB,CAAE,CAAC,CAAC,CAAC,EAAE,CAAE,EACzE,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAChC,GAAG,EAAE,IAAI,CAAC,mBAAmB,EAC7B,IAAI,EAAC,QAAQ,IACZ,oBAAoB,EAAE,CAChB,CACG,CACR,CACT,CAAC;IACJ,CAAC;IAEH,cAAC;AAAD,CAAC,AAlKD,CAAsB,eAAK,CAAC,SAAS,GAkKpC;AAED,kBAAe,IAAA,qBAAO,EAAC,IAAI,EAAE,kBAAkB,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC"}
|
package/Modal/SimpleModal.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare type SimpleModalPropTypes = {
|
|
3
|
-
readonly size?: string;
|
|
4
|
-
readonly title: string;
|
|
5
|
-
readonly children: any;
|
|
6
|
-
readonly hideModal?: () => void;
|
|
7
|
-
};
|
|
8
|
-
declare const _default: import("react-redux").ConnectedComponent<({ hideModal, children, size, title, }: SimpleModalPropTypes) => JSX.Element, Omit<SimpleModalPropTypes, "hideModal"> & {
|
|
9
|
-
cbHideModal?: (() => void) | undefined;
|
|
10
|
-
} & import("react-redux").ConnectProps>;
|
|
11
|
-
export default _default;
|
package/Modal/SimpleModal.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var react_redux_1 = require("react-redux");
|
|
7
|
-
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var reactstrap_1 = require("reactstrap");
|
|
9
|
-
var utility_1 = require("../utility");
|
|
10
|
-
var actions_1 = require("./actions");
|
|
11
|
-
var mapDispatchToProps = function (dispatch, _a) {
|
|
12
|
-
var cbHideModal = _a.cbHideModal;
|
|
13
|
-
return ({
|
|
14
|
-
hideModal: function () {
|
|
15
|
-
(0, utility_1.delay)().then(function () {
|
|
16
|
-
dispatch((0, actions_1.hideModal)());
|
|
17
|
-
}).
|
|
18
|
-
then(function () {
|
|
19
|
-
if (typeof cbHideModal === "function") {
|
|
20
|
-
cbHideModal();
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
}, SimpleModal = function (_a) {
|
|
26
|
-
var hideModal = _a.hideModal, children = _a.children, size = _a.size, title = _a.title;
|
|
27
|
-
return (react_1.default.createElement(reactstrap_1.Modal, { autoFocus: true, isOpen: true, size: size, toggle: hideModal, zIndex: "1061" },
|
|
28
|
-
react_1.default.createElement(reactstrap_1.ModalHeader, { toggle: hideModal }, title),
|
|
29
|
-
react_1.default.createElement(reactstrap_1.ModalBody, null, children)));
|
|
30
|
-
};
|
|
31
|
-
exports.default = (0, react_redux_1.connect)(null, mapDispatchToProps)(SimpleModal);
|
|
32
|
-
//# sourceMappingURL=SimpleModal.js.map
|
package/Modal/SimpleModal.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleModal.js","sourceRoot":"","sources":["../../src/Modal/SimpleModal.tsx"],"names":[],"mappings":";;;;;AAQA,2CAAsC;AACtC,gDAA0B;AAC1B,yCAA2D;AAC3D,sCAAmC;AACnC,qCAAyD;AAEzD,IAAM,kBAAkB,GAAG,UAAC,QAAkB,EAAE,EAI7C;QAHC,WAAW,iBAAA;IAGP,OAAA,CAAC;QACL,SAAS;YACP,IAAA,eAAK,GAAE,CAAC,IAAI,CAAC;gBACX,QAAQ,CAAC,IAAA,mBAAe,GAAE,CAAC,CAAC;YAC9B,CAAC,CAAC;gBACA,IAAI,CAAC;gBACH,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;oBACrC,WAAW,EAAE,CAAC;iBACf;YACH,CAAC,CAAC,CAAC;QACP,CAAC;KAEF,CAAC;AAZI,CAYJ,EAEF,WAAW,GAAG,UAAC,EAKQ;QAJrB,SAAS,eAAA,EACT,QAAQ,cAAA,EACR,IAAI,UAAA,EACJ,KAAK,WAAA;IACqB,OAAA,CAC1B,8BAAC,kBAAK,IAAC,SAAS,QAAC,MAAM,QAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAC,MAAM;QAClE,8BAAC,wBAAW,IAAC,MAAM,EAAE,SAAS,IAC3B,KAAK,CACM;QACd,8BAAC,sBAAS,QACP,QAAQ,CACC,CACN,CACT;AAT2B,CAS3B,CAAC;AAEJ,kBAAe,IAAA,qBAAO,EAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,WAAW,CAAC,CAAC"}
|