@expressms/smartapp-ui 2.1.4 → 2.1.5
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/build/main/assets/icons/attachment-loader.svg +3 -0
- package/build/main/assets/icons/delete-chip.svg +2 -9
- package/build/main/helpers/index.d.ts +1 -1
- package/build/main/helpers/index.js +1 -1
- package/build/main/helpers/index.js.map +1 -1
- package/build/main/styles/styles.scss +1 -1
- package/build/main//321/201omponents/ActionModal/ActionModal.d.ts +1 -1
- package/build/main//321/201omponents/ActionModal/ActionModal.js +5 -5
- package/build/main//321/201omponents/ActionModal/ActionModal.js.map +1 -1
- package/build/main//321/201omponents/ActionModal/types.d.ts +1 -1
- package/build/main//321/201omponents/AttachedFile/AttachedFile.d.ts +5 -1
- package/build/main//321/201omponents/AttachedFile/AttachedFile.js +41 -6
- package/build/main//321/201omponents/AttachedFile/AttachedFile.js.map +1 -1
- package/build/main//321/201omponents/AttachedFile/types.d.ts +10 -5
- package/build/main//321/201omponents/Button/Button.d.ts +1 -1
- package/build/main//321/201omponents/Button/Button.js +2 -2
- package/build/main//321/201omponents/Button/Button.js.map +1 -1
- package/build/main//321/201omponents/Button/types.d.ts +2 -0
- package/build/main//321/201omponents/Button/types.js.map +1 -1
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.d.ts +1 -1
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js +5 -5
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js.map +1 -1
- package/build/main//321/201omponents/ConfirmationModal/types.d.ts +1 -1
- package/build/main//321/201omponents/Modal/Modal.d.ts +1 -1
- package/build/main//321/201omponents/Modal/Modal.js +5 -5
- package/build/main//321/201omponents/Modal/Modal.js.map +1 -1
- package/build/main//321/201omponents/Modal/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IActionModalProps } from './types';
|
|
2
2
|
import '../../styles/styles.scss';
|
|
3
|
-
declare const ActionModal: ({ isModalOpen, isFullScreen,
|
|
3
|
+
declare const ActionModal: ({ isModalOpen, isFullScreen, isClosableOutside, title, buttonName, confirmButtonFunction, cancelButtonFunction, theme, platform, placeholder, defaultValue, isButtonDisabled, titleStyles, iconColor, buttonWidth, backgroundColor, }: IActionModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export default ActionModal;
|
|
@@ -15,11 +15,11 @@ import Popup from 'reactjs-popup';
|
|
|
15
15
|
import { ReactComponent as CloseIcon } from '../../assets/icons/cancel-cross.svg';
|
|
16
16
|
import Button from '../Button';
|
|
17
17
|
import Input from '../Input';
|
|
18
|
-
import { getClassNames, getColor,
|
|
18
|
+
import { getClassNames, getColor, getDefaultGrayColorForIcon, isMobilePlatform } from '../../helpers';
|
|
19
19
|
import { COLORS, FULL_SCREEN_CLASS_NAME, PLATFORM, THEME } from '../../constants';
|
|
20
20
|
import '../../styles/styles.scss';
|
|
21
21
|
var ActionModal = function (_a) {
|
|
22
|
-
var isModalOpen = _a.isModalOpen, _b = _a.isFullScreen, isFullScreen = _b === void 0 ? false : _b, _c = _a.
|
|
22
|
+
var isModalOpen = _a.isModalOpen, _b = _a.isFullScreen, isFullScreen = _b === void 0 ? false : _b, _c = _a.isClosableOutside, isClosableOutside = _c === void 0 ? true : _c, title = _a.title, buttonName = _a.buttonName, confirmButtonFunction = _a.confirmButtonFunction, cancelButtonFunction = _a.cancelButtonFunction, _d = _a.theme, theme = _d === void 0 ? THEME.default : _d, _e = _a.platform, platform = _e === void 0 ? PLATFORM.web : _e, placeholder = _a.placeholder, _f = _a.defaultValue, defaultValue = _f === void 0 ? '' : _f, isButtonDisabled = _a.isButtonDisabled, titleStyles = _a.titleStyles, iconColor = _a.iconColor, _g = _a.buttonWidth, buttonWidth = _g === void 0 ? 100 : _g, backgroundColor = _a.backgroundColor;
|
|
23
23
|
var additionalClassName = isFullScreen ? [theme, platform, FULL_SCREEN_CLASS_NAME] : [theme, platform];
|
|
24
24
|
var ref = useRef(null);
|
|
25
25
|
var _h = useState(defaultValue), value = _h[0], setValue = _h[1];
|
|
@@ -36,7 +36,7 @@ var ActionModal = function (_a) {
|
|
|
36
36
|
}, [backgroundColor]);
|
|
37
37
|
useEffect(function () {
|
|
38
38
|
var checkIfClickedOutside = function (e) {
|
|
39
|
-
if (isModalOpen && ref.current && !ref.current.contains(e.target)) {
|
|
39
|
+
if (isModalOpen && isClosableOutside && ref.current && !ref.current.contains(e.target)) {
|
|
40
40
|
onCloseModal();
|
|
41
41
|
}
|
|
42
42
|
};
|
|
@@ -45,11 +45,11 @@ var ActionModal = function (_a) {
|
|
|
45
45
|
document === null || document === void 0 ? void 0 : document.removeEventListener('click', checkIfClickedOutside, true);
|
|
46
46
|
};
|
|
47
47
|
// eslint-disable-next-line
|
|
48
|
-
}, [isModalOpen, cancelButtonFunction]);
|
|
48
|
+
}, [isModalOpen, isClosableOutside, cancelButtonFunction]);
|
|
49
49
|
var onChange = function (value) {
|
|
50
50
|
setValue(value);
|
|
51
51
|
};
|
|
52
|
-
return (_jsx(Popup, __assign({ className: getClassNames('action-modal', '-', platform), closeOnDocumentClick:
|
|
52
|
+
return (_jsx(Popup, __assign({ className: getClassNames('action-modal', '-', platform), closeOnDocumentClick: isClosableOutside, modal: true, open: isModalOpen }, { children: _jsx("div", __assign({ ref: ref, className: getClassNames('smartapp-action-modal', '__', additionalClassName) }, { children: _jsxs("div", __assign({ className: getClassNames('smartapp-action-modal__content', '--', platform) }, { children: [_jsx("p", __assign({ className: getClassNames('smartapp-action-modal__content--title', '__', platform), style: titleStyles }, { children: title })), isClosableOutside && (_jsx("div", __assign({ onClick: onCloseModal, className: "smartapp-action-modal__content--cancel-cross" }, { children: _jsx(CloseIcon, { style: { color: getColor(iconColor, getDefaultGrayColorForIcon(theme)) } }) }))), _jsx("div", __assign({ className: "smartapp-action-modal__content--input" }, { children: _jsx(Input, { theme: theme, defaultValue: value, placeholder: placeholder, onChange: onChange }) })), isMobilePlatform(platform) && _jsx("div", { className: "smartapp-action-modal__content--delimiter" }), _jsx("div", __assign({ className: "smartapp-action-modal__content--buttons" }, { children: _jsx(Button, { width: buttonWidth, isDisabled: isButtonDisabled, title: buttonName, onClick: onConfirmClick }) }))] })) })) })));
|
|
53
53
|
};
|
|
54
54
|
export default ActionModal;
|
|
55
55
|
//# sourceMappingURL=ActionModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionModal.js","sourceRoot":"","sources":["../../../../src/сomponents/ActionModal/ActionModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC1D,OAAO,KAAK,MAAM,eAAe,CAAA;AACjC,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,MAAM,qCAAqC,CAAA;AACjF,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,MAAM,UAAU,CAAA;AAE5B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"ActionModal.js","sourceRoot":"","sources":["../../../../src/сomponents/ActionModal/ActionModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC1D,OAAO,KAAK,MAAM,eAAe,CAAA;AACjC,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,MAAM,qCAAqC,CAAA;AACjF,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,MAAM,UAAU,CAAA;AAE5B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACrG,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACjF,OAAO,0BAA0B,CAAA;AAEjC,IAAM,W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AS,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,SAAS,EAAE,0BAA0B,CAAC,KAAK,CAAC,CAAC,EAAE,GAAI,IACnF,CACP,EACD,uBAAK,SAAS,EAAC,uCAAuC,gBACpD,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,GAAI,IACtF,EACL,gBAAgB,CAAC,QAAQ,CAAC,IAAI,cAAK,SAAS,EAAC,2CAA2C,GAAG,EAC5F,uBAAK,SAAS,EAAC,yCAAyC,gBACtD,KAAC,MAAM,IAAC,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,GAAI,IACpG,KACF,IACF,IACA,CACT,CAAA;AACH,CAAC,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -3,7 +3,7 @@ import { ICommonProps, TStyles } from '../../constants';
|
|
|
3
3
|
export interface IActionModalProps extends ICommonProps {
|
|
4
4
|
isModalOpen: boolean;
|
|
5
5
|
isFullScreen?: boolean;
|
|
6
|
-
|
|
6
|
+
isClosableOutside?: boolean;
|
|
7
7
|
title: string;
|
|
8
8
|
buttonName: string;
|
|
9
9
|
confirmButtonFunction: (str: string) => void;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { IAttachedFileProps } from './types';
|
|
2
2
|
import '../../styles/styles.scss';
|
|
3
|
-
declare
|
|
3
|
+
export declare enum DISPLAY_SIZE {
|
|
4
|
+
small = "small",
|
|
5
|
+
normal = "normal"
|
|
6
|
+
}
|
|
7
|
+
declare const AttachedFile: ({ theme, fileName, weight, weightType, isIconEnclosedWithinBorders, isSpaceBetween, isRemovable, isDownloadable, isDisabled, isLoading, width, displaySize, fileColor, downloadColor, removeColor, fileIcon, onClick, onRemove, onDownload, }: IAttachedFileProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
8
|
export default AttachedFile;
|
|
@@ -14,14 +14,49 @@ import classNames from 'classnames';
|
|
|
14
14
|
import { ReactComponent as FileIcon } from '../../assets/icons/file.svg';
|
|
15
15
|
import { ReactComponent as RemoveIcon } from '../../assets/icons/close.svg';
|
|
16
16
|
import { ReactComponent as DownloadIcon } from '../../assets/icons/download.svg';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { ReactComponent as LoaderIcon } from '../../assets/icons/attachment-loader.svg';
|
|
18
|
+
import { getColor, getDefaultGrayColorForIcon } from '../../helpers';
|
|
19
|
+
import { COLORS, THEME } from '../../constants';
|
|
19
20
|
import '../../styles/styles.scss';
|
|
21
|
+
export var DISPLAY_SIZE;
|
|
22
|
+
(function (DISPLAY_SIZE) {
|
|
23
|
+
DISPLAY_SIZE["small"] = "small";
|
|
24
|
+
DISPLAY_SIZE["normal"] = "normal";
|
|
25
|
+
})(DISPLAY_SIZE || (DISPLAY_SIZE = {}));
|
|
20
26
|
var AttachedFile = function (_a) {
|
|
21
|
-
var fileName = _a.fileName, weight = _a.weight, weightType = _a.weightType,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
var _b = _a.theme, theme = _b === void 0 ? THEME.default : _b, fileName = _a.fileName, weight = _a.weight, weightType = _a.weightType, _c = _a.isIconEnclosedWithinBorders, isIconEnclosedWithinBorders = _c === void 0 ? false : _c, _d = _a.isSpaceBetween, isSpaceBetween = _d === void 0 ? false : _d, _e = _a.isRemovable, isRemovable = _e === void 0 ? false : _e, _f = _a.isDownloadable, isDownloadable = _f === void 0 ? false : _f, _g = _a.isDisabled, isDisabled = _g === void 0 ? false : _g, _h = _a.isLoading, isLoading = _h === void 0 ? false : _h, _j = _a.width, width = _j === void 0 ? 100 : _j, _k = _a.displaySize, displaySize = _k === void 0 ? DISPLAY_SIZE.normal : _k, fileColor = _a.fileColor, downloadColor = _a.downloadColor, removeColor = _a.removeColor, fileIcon = _a.fileIcon, onClick = _a.onClick, onRemove = _a.onRemove, onDownload = _a.onDownload;
|
|
28
|
+
var handleAttachmentClick = function () { return !isLoading && !isDisabled && onClick && onClick(fileName); };
|
|
29
|
+
var handleAttachmentRemove = function (event) {
|
|
30
|
+
if (!isLoading && onRemove) {
|
|
31
|
+
event.stopPropagation();
|
|
32
|
+
onRemove(fileName);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var handleAttachmentDownload = function (event) {
|
|
36
|
+
if (!isLoading && !isDisabled && onDownload) {
|
|
37
|
+
event.stopPropagation();
|
|
38
|
+
onDownload(fileName);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return (_jsxs("div", __assign({ style: { width: "".concat(width, "%") }, className: classNames('smartapp-attached-file', "smartapp-attached-file__".concat(theme), {
|
|
42
|
+
'smartapp-attached-file__clickable': onClick,
|
|
43
|
+
'smartapp-attached-file__disabled': isDisabled,
|
|
44
|
+
'smartapp-attached-file__loading': isLoading,
|
|
45
|
+
}), onClick: handleAttachmentClick }, { children: [_jsxs("div", __assign({ className: classNames('smartapp-attached-file__icon', "smartapp-attached-file__icon--".concat(displaySize), {
|
|
46
|
+
'smartapp-attached-file__icon--bordered': isIconEnclosedWithinBorders,
|
|
47
|
+
'smartapp-attached-file__icon--disabled': isDisabled,
|
|
48
|
+
'smartapp-attached-file__icon--loading': isLoading && !isIconEnclosedWithinBorders,
|
|
49
|
+
}) }, { children: [fileIcon || _jsx(FileIcon, { style: { color: getColor(fileColor, getDefaultGrayColorForIcon(theme)) } }), isLoading && (_jsx("div", __assign({ className: classNames('smartapp-attached-file__icon--loader', "smartapp-attached-file__icon--loader__".concat(displaySize)) }, { children: _jsx(LoaderIcon, {}) })))] })), _jsxs("div", __assign({ className: classNames('smartapp-attached-file__value', { 'justify-space-between': isSpaceBetween }) }, { children: [_jsxs("div", __assign({ className: classNames('smartapp-attached-file__value--info', {
|
|
50
|
+
'smartapp-attached-file__value--info__paddings': isIconEnclosedWithinBorders && displaySize === DISPLAY_SIZE.normal,
|
|
51
|
+
}) }, { children: [_jsx("p", __assign({ className: classNames('smartapp-attached-file__value--info__name', "smartapp-attached-file__value--info__name--".concat(displaySize), {
|
|
52
|
+
'smartapp-attached-file__value--info__name--disabled': isDisabled,
|
|
53
|
+
'smartapp-attached-file__value--info__name--loading': isLoading,
|
|
54
|
+
}) }, { children: fileName })), _jsx("p", __assign({ className: "smartapp-attached-file__value--info__weight" }, { children: "".concat(weight, " ").concat(weightType) }))] })), _jsxs("div", __assign({ className: "smartapp-attached-file__value--icons" }, { children: [isRemovable && (_jsx("div", __assign({ onClick: handleAttachmentRemove, className: classNames('smartapp-attached-file__value--icons__close', {
|
|
55
|
+
'smartapp-attached-file__value--icons__close--loading': isLoading,
|
|
56
|
+
}) }, { children: _jsx(RemoveIcon, { style: { color: getColor(removeColor, getDefaultGrayColorForIcon(theme)) } }) }))), isDownloadable && (_jsx("div", __assign({ onClick: handleAttachmentDownload, className: classNames('smartapp-attached-file__value--icons__download', {
|
|
57
|
+
'smartapp-attached-file__value--icons__download--disabled': isDisabled,
|
|
58
|
+
'smartapp-attached-file__value--icons__download--loading': isLoading,
|
|
59
|
+
}) }, { children: _jsx(DownloadIcon, { style: { color: getColor(downloadColor, COLORS.blue) } }) })))] }))] }))] }), weight));
|
|
25
60
|
};
|
|
26
61
|
export default AttachedFile;
|
|
27
62
|
//# sourceMappingURL=AttachedFile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachedFile.js","sourceRoot":"","sources":["../../../../src/сomponents/AttachedFile/AttachedFile.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,cAAc,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAC3E,OAAO,EAAE,cAAc,IAAI,YAAY,EAAE,MAAM,iCAAiC,CAAA;
|
|
1
|
+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ACH,CAAC,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { IntRange } from '../types';
|
|
3
|
-
|
|
3
|
+
import { IThemeProps } from '../../constants';
|
|
4
|
+
export interface IAttachedFileProps extends IThemeProps {
|
|
4
5
|
fileName: string;
|
|
5
6
|
weight: number;
|
|
6
7
|
weightType: string;
|
|
7
8
|
isIconEnclosedWithinBorders?: boolean;
|
|
8
9
|
isSpaceBetween?: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
isRemovable?: boolean;
|
|
11
|
+
isDownloadable?: boolean;
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
isLoading?: boolean;
|
|
13
14
|
width?: IntRange<1, 101>;
|
|
15
|
+
displaySize?: 'small' | 'normal';
|
|
14
16
|
fileColor?: string;
|
|
15
17
|
downloadColor?: string;
|
|
16
18
|
removeColor?: string;
|
|
17
19
|
fileIcon?: ReactElement;
|
|
20
|
+
onClick?: (file: any) => void;
|
|
21
|
+
onRemove?: (file: any) => void;
|
|
22
|
+
onDownload?: (file: any) => void;
|
|
18
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IButtonProps } from './types';
|
|
2
2
|
import '../../styles/styles.scss';
|
|
3
|
-
declare const Button: ({ title, isDisabled, isDisabledClickable, isWaitingResponse, type, appearance, icon, width, onClick, }: IButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const Button: ({ title, isDisabled, isDisabledClickable, isWaitingResponse, type, appearance, icon, width, styles, onClick, }: IButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export default Button;
|
|
@@ -17,7 +17,7 @@ import { ReactComponent as LoaderIcon } from '../../assets/icons/button-loader.s
|
|
|
17
17
|
import { TButtonType, TButtonAppearance } from './types';
|
|
18
18
|
import '../../styles/styles.scss';
|
|
19
19
|
var Button = function (_a) {
|
|
20
|
-
var title = _a.title, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = _a.isDisabledClickable, isDisabledClickable = _c === void 0 ? false : _c, _d = _a.isWaitingResponse, isWaitingResponse = _d === void 0 ? false : _d, _e = _a.type, type = _e === void 0 ? TButtonType.primary : _e, _f = _a.appearance, appearance = _f === void 0 ? TButtonAppearance.accent : _f, icon = _a.icon, _g = _a.width, width = _g === void 0 ? 100 : _g, onClick = _a.onClick;
|
|
20
|
+
var title = _a.title, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = _a.isDisabledClickable, isDisabledClickable = _c === void 0 ? false : _c, _d = _a.isWaitingResponse, isWaitingResponse = _d === void 0 ? false : _d, _e = _a.type, type = _e === void 0 ? TButtonType.primary : _e, _f = _a.appearance, appearance = _f === void 0 ? TButtonAppearance.accent : _f, icon = _a.icon, _g = _a.width, width = _g === void 0 ? 100 : _g, styles = _a.styles, onClick = _a.onClick;
|
|
21
21
|
var buttonRef = useRef(null);
|
|
22
22
|
var buttonRefCurrent = buttonRef.current;
|
|
23
23
|
var changeTransitionDelay = function (transitionDelay) { return buttonRefCurrent && (buttonRefCurrent.style.transitionDelay = "".concat(transitionDelay, "ms")); };
|
|
@@ -36,7 +36,7 @@ var Button = function (_a) {
|
|
|
36
36
|
return (_jsxs("div", __assign({ className: classNames('smartapp-button', "smartapp-button__".concat(appearance)), style: { width: "".concat(width, "%") } }, { children: [_jsxs("button", __assign({ ref: buttonRef, className: classNames("smartapp-button__".concat(type), "smartapp-button__".concat(type, "--").concat(appearance), {
|
|
37
37
|
'smartapp-button__disabled': isDisabled,
|
|
38
38
|
'smartapp-button__with-icon': !isNil(icon),
|
|
39
|
-
}), onClick: handleButtonClick }, { children: [icon && _jsx("div", { children: icon }), title] })), _jsx("div", __assign({ className: classNames('smartapp-button__loader', { 'smartapp-button__loader--hidden': !isWaitingResponse }) }, { children: _jsx(LoaderIcon, {}) }))] })));
|
|
39
|
+
}), style: styles, onClick: handleButtonClick }, { children: [icon && _jsx("div", { children: icon }), title] })), _jsx("div", __assign({ className: classNames('smartapp-button__loader', { 'smartapp-button__loader--hidden': !isWaitingResponse }) }, { children: _jsx(LoaderIcon, {}) }))] })));
|
|
40
40
|
};
|
|
41
41
|
export default Button;
|
|
42
42
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/сomponents/Button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,EAAE,cAAc,IAAI,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACnF,OAAO,EAAgB,WAAW,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AACtE,OAAO,0BAA0B,CAAA;AAEjC,IAAM,MAAM,GAAG,UAAC,
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/сomponents/Button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,EAAE,cAAc,IAAI,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACnF,OAAO,EAAgB,WAAW,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AACtE,OAAO,0BAA0B,CAAA;AAEjC,IAAM,MAAM,GAAG,UAAC,EAWD;QAVb,KAAK,WAAA,EACL,kBAAkB,EAAlB,UAAU,mBAAG,KAAK,KAAA,EAClB,2BAA2B,EAA3B,mBAAmB,mBAAG,KAAK,KAAA,EAC3B,yBAAyB,EAAzB,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,iBAAiB,EAAE,2BAAoB,UAAU,CAAE,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,UAAG,KAAK,MAAG,EAAE,iBAC5G,2BACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,UAAU,CAAC,2BAAoB,IAAI,CAAE,EAAE,2BAAoB,IAAI,eAAK,UAAU,CAAE,EAAE;oBAC3F,2BAA2B,EAAE,UAAU;oBACvC,4BAA4B,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;iBAC3C,CAAC,EACF,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,iBAAiB,iBAEzB,IAAI,IAAI,wBAAM,IAAI,GAAO,EACzB,KAAK,KACC,EACT,uBAAK,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE,EAAE,iCAAiC,EAAE,CAAC,iBAAiB,EAAE,CAAC,gBAC9G,KAAC,UAAU,KAAG,IACV,KACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
2
|
import { IntRange } from '../types';
|
|
3
|
+
import { TStyles } from '../../constants';
|
|
3
4
|
export declare enum TButtonType {
|
|
4
5
|
primary = "primary",
|
|
5
6
|
secondary = "secondary"
|
|
@@ -17,5 +18,6 @@ export interface IButtonProps {
|
|
|
17
18
|
appearance?: 'accent' | 'negative';
|
|
18
19
|
icon?: ReactElement;
|
|
19
20
|
width?: IntRange<1, 101>;
|
|
21
|
+
styles?: TStyles;
|
|
20
22
|
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
21
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/сomponents/Button/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/сomponents/Button/types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;AACzB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAED,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;AACvB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IConfirmationModalProps } from './types';
|
|
2
2
|
import '../../styles/styles.scss';
|
|
3
|
-
declare const ConfirmationModal: ({ isModalOpen, isFullScreen,
|
|
3
|
+
declare const ConfirmationModal: ({ isModalOpen, isFullScreen, isClosableOutside, title, text, cancelButtonName, confirmButtonName, cancelButtonFunction, confirmButtonFunction, theme, platform, titleStyles, iconColor, backgroundColor, }: IConfirmationModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export default ConfirmationModal;
|
|
@@ -16,10 +16,10 @@ import { ReactComponent as CloseIcon } from '../../assets/icons/cancel-cross.svg
|
|
|
16
16
|
import Button from '../Button';
|
|
17
17
|
import { TButtonType } from '../Button/types';
|
|
18
18
|
import { COLORS, FULL_SCREEN_CLASS_NAME, PLATFORM, THEME } from '../../constants';
|
|
19
|
-
import { getClassNames, getColor,
|
|
19
|
+
import { getClassNames, getColor, getDefaultGrayColorForIcon, isMobilePlatform } from '../../helpers';
|
|
20
20
|
import '../../styles/styles.scss';
|
|
21
21
|
var ConfirmationModal = function (_a) {
|
|
22
|
-
var isModalOpen = _a.isModalOpen, _b = _a.isFullScreen, isFullScreen = _b === void 0 ? false : _b, _c = _a.
|
|
22
|
+
var isModalOpen = _a.isModalOpen, _b = _a.isFullScreen, isFullScreen = _b === void 0 ? false : _b, _c = _a.isClosableOutside, isClosableOutside = _c === void 0 ? false : _c, title = _a.title, text = _a.text, cancelButtonName = _a.cancelButtonName, confirmButtonName = _a.confirmButtonName, cancelButtonFunction = _a.cancelButtonFunction, confirmButtonFunction = _a.confirmButtonFunction, _d = _a.theme, theme = _d === void 0 ? THEME.default : _d, _e = _a.platform, platform = _e === void 0 ? PLATFORM.web : _e, titleStyles = _a.titleStyles, iconColor = _a.iconColor, backgroundColor = _a.backgroundColor;
|
|
23
23
|
var additionalClassName = isFullScreen ? [theme, platform, FULL_SCREEN_CLASS_NAME] : [theme, platform];
|
|
24
24
|
var confirmButtonWidth = cancelButtonName ? 50 : 100;
|
|
25
25
|
var ref = useRef(null);
|
|
@@ -28,7 +28,7 @@ var ConfirmationModal = function (_a) {
|
|
|
28
28
|
}, [backgroundColor]);
|
|
29
29
|
useEffect(function () {
|
|
30
30
|
var checkIfClickedOutside = function (e) {
|
|
31
|
-
if (isModalOpen && ref.current && !ref.current.contains(e.target)) {
|
|
31
|
+
if (isModalOpen && isClosableOutside && ref.current && !ref.current.contains(e.target)) {
|
|
32
32
|
cancelButtonFunction();
|
|
33
33
|
}
|
|
34
34
|
};
|
|
@@ -36,8 +36,8 @@ var ConfirmationModal = function (_a) {
|
|
|
36
36
|
return function () {
|
|
37
37
|
document === null || document === void 0 ? void 0 : document.removeEventListener('mousedown', checkIfClickedOutside, true);
|
|
38
38
|
};
|
|
39
|
-
}, [isModalOpen, cancelButtonFunction]);
|
|
40
|
-
return (_jsx(Popup, __assign({ className: getClassNames('confirmation-modal', '-', platform), closeOnDocumentClick:
|
|
39
|
+
}, [isModalOpen, isClosableOutside, cancelButtonFunction]);
|
|
40
|
+
return (_jsx(Popup, __assign({ className: getClassNames('confirmation-modal', '-', platform), closeOnDocumentClick: isClosableOutside, modal: true, open: isModalOpen }, { children: _jsx("div", __assign({ ref: ref, className: getClassNames('smartapp-confirmation-modal', '__', additionalClassName) }, { children: _jsxs("div", __assign({ className: getClassNames('smartapp-confirmation-modal__content', '--', platform) }, { children: [title && (_jsx("p", __assign({ className: "smartapp-confirmation-modal__content--title", style: titleStyles }, { children: title }))), isClosableOutside && (_jsx("div", __assign({ onClick: cancelButtonFunction, className: "smartapp-confirmation-modal__content--close-icon" }, { children: _jsx(CloseIcon, { style: { color: getColor(iconColor, getDefaultGrayColorForIcon(theme)) } }) }))), _jsx("p", __assign({ className: "smartapp-confirmation-modal__content--text" }, { children: text })), isMobilePlatform(platform) && _jsx("div", { className: "smartapp-confirmation-modal__content--delimiter" }), _jsxs("div", __assign({ className: "smartapp-confirmation-modal__content--buttons" }, { children: [cancelButtonName && _jsx(Button, { width: 50, title: cancelButtonName, type: TButtonType.secondary, onClick: cancelButtonFunction }), _jsx(Button, { width: confirmButtonWidth, title: confirmButtonName, onClick: confirmButtonFunction })] }))] })) })) })));
|
|
41
41
|
};
|
|
42
42
|
export default ConfirmationModal;
|
|
43
43
|
//# sourceMappingURL=ConfirmationModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationModal.js","sourceRoot":"","sources":["../../../../src/сomponents/ConfirmationModal/ConfirmationModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,KAAK,MAAM,eAAe,CAAA;AACjC,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,MAAM,qCAAqC,CAAA;AACjF,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE7C,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACjF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"ConfirmationModal.js","sourceRoot":"","sources":["../../../../src/сomponents/ConfirmationModal/ConfirmationModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,KAAK,MAAM,eAAe,CAAA;AACjC,OAAO,EAAE,cAAc,IAAI,SAA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AAC,EAAE,GAAI,IACnF,CACP,EACD,qBAAG,SAAS,EAAC,4CAA4C,gBAAE,IAAI,IAAK,EACnE,gBAAgB,CAAC,QAAQ,CAAC,IAAI,cAAK,SAAS,EAAC,iDAAiD,GAAG,EAClG,wBAAK,SAAS,EAAC,+CAA+C,iBAC3D,gBAAgB,IAAI,KAAC,MAAM,IAAC,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,CAAC,SAAS,EAAE,OAAO,EAAE,oBAAoB,GAAI,EAC/H,KAAC,MAAM,IAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,qBAAqB,GAAI,KAC3F,KACF,IACF,IACA,CACT,CAAA;AACH,CAAC,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { ICommonProps, TStyles } from '../../constants';
|
|
|
2
2
|
export interface IConfirmationModalProps extends ICommonProps {
|
|
3
3
|
isModalOpen: boolean;
|
|
4
4
|
isFullScreen?: boolean;
|
|
5
|
-
|
|
5
|
+
isClosableOutside?: boolean;
|
|
6
6
|
title?: string;
|
|
7
7
|
text: string;
|
|
8
8
|
cancelButtonName?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IModalProps } from './types';
|
|
2
2
|
import '../../styles/styles.scss';
|
|
3
|
-
declare const Modal: ({ isModalOpen, isFullScreen,
|
|
3
|
+
declare const Modal: ({ isModalOpen, isFullScreen, isClosableOutside, content, handleCloseModal, title, theme, platform, titleStyles, iconColor, backgroundColor, }: IModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export default Modal;
|
|
@@ -14,10 +14,10 @@ import { useEffect, useRef } from 'react';
|
|
|
14
14
|
import Popup from 'reactjs-popup';
|
|
15
15
|
import { ReactComponent as CloseIcon } from '../../assets/icons/cancel-cross.svg';
|
|
16
16
|
import { COLORS, FULL_SCREEN_CLASS_NAME, PLATFORM, THEME } from '../../constants';
|
|
17
|
-
import { getClassNames, getColor,
|
|
17
|
+
import { getClassNames, getColor, getDefaultGrayColorForIcon } from '../../helpers';
|
|
18
18
|
import '../../styles/styles.scss';
|
|
19
19
|
var Modal = function (_a) {
|
|
20
|
-
var isModalOpen = _a.isModalOpen, _b = _a.isFullScreen, isFullScreen = _b === void 0 ? false : _b, _c = _a.
|
|
20
|
+
var isModalOpen = _a.isModalOpen, _b = _a.isFullScreen, isFullScreen = _b === void 0 ? false : _b, _c = _a.isClosableOutside, isClosableOutside = _c === void 0 ? true : _c, content = _a.content, handleCloseModal = _a.handleCloseModal, title = _a.title, _d = _a.theme, theme = _d === void 0 ? THEME.default : _d, _e = _a.platform, platform = _e === void 0 ? PLATFORM.web : _e, titleStyles = _a.titleStyles, iconColor = _a.iconColor, backgroundColor = _a.backgroundColor;
|
|
21
21
|
var additionalClassName = isFullScreen ? [theme, platform, FULL_SCREEN_CLASS_NAME] : [theme, platform];
|
|
22
22
|
var ref = useRef(null);
|
|
23
23
|
useEffect(function () {
|
|
@@ -25,7 +25,7 @@ var Modal = function (_a) {
|
|
|
25
25
|
}, [backgroundColor]);
|
|
26
26
|
useEffect(function () {
|
|
27
27
|
var checkIfClickedOutside = function (e) {
|
|
28
|
-
if (isModalOpen && ref.current && !ref.current.contains(e.target)) {
|
|
28
|
+
if (isModalOpen && isClosableOutside && ref.current && !ref.current.contains(e.target)) {
|
|
29
29
|
handleCloseModal();
|
|
30
30
|
}
|
|
31
31
|
};
|
|
@@ -33,8 +33,8 @@ var Modal = function (_a) {
|
|
|
33
33
|
return function () {
|
|
34
34
|
document === null || document === void 0 ? void 0 : document.removeEventListener('mousedown', checkIfClickedOutside, true);
|
|
35
35
|
};
|
|
36
|
-
}, [isModalOpen, handleCloseModal]);
|
|
37
|
-
return (_jsx(Popup, __assign({ className: getClassNames('modal', '-', platform), closeOnDocumentClick:
|
|
36
|
+
}, [isModalOpen, isClosableOutside, handleCloseModal]);
|
|
37
|
+
return (_jsx(Popup, __assign({ className: getClassNames('modal', '-', platform), closeOnDocumentClick: isClosableOutside, modal: true, open: isModalOpen }, { children: _jsx("div", __assign({ ref: ref, className: getClassNames('smartapp-modal', '__', additionalClassName) }, { children: _jsxs("div", __assign({ className: getClassNames('smartapp-modal__content', '--', platform) }, { children: [title && (_jsx("p", __assign({ className: "smartapp-modal__content--title", style: titleStyles }, { children: title }))), isClosableOutside && (_jsx("div", __assign({ onClick: handleCloseModal, className: "smartapp-modal__content--close-icon" }, { children: _jsx(CloseIcon, { style: { color: getColor(iconColor, getDefaultGrayColorForIcon(theme)) } }) }))), content] })) })) })));
|
|
38
38
|
};
|
|
39
39
|
export default Modal;
|
|
40
40
|
//# sourceMappingURL=Modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../../src/сomponents/Modal/Modal.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,KAAK,MAAM,eAAe,CAAA;AACjC,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,MAAM,qCAAqC,CAAA;AACjF,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACjF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../../src/сomponents/Modal/Modal.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,KAAK,MAAM,eAAe,CAAA;AACjC,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,MAAM,qCAAqC,CAAA;AACjF,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACjF,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EpE,OAAO;YACL,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,mBAAmB,CAAC,WAAW,EAAE,qBAAqB,EAAE,IAAI,CAAC,CAAA;QACzE,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAAC,CAAA;IAEtD,OAAO,CACL,KAAC,KAAK,aAAC,SAAS,EAAE,aAAa,CAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,KAAK,QAAC,IAAI,EAAE,WAAW,gBACvH,uBAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,aAAa,CAAC,gBAAgB,EAAE,IAAI,EAAE,mBAAmB,CAAC,gBAClF,wBAAK,SAAS,EAAE,aAAa,CAAC,yBAAyB,EAAE,IAAI,EAAE,QAAQ,CAAC,iBACrE,KAAK,IAAI,CACR,qBAAG,SAAS,EAAC,gCAAgC,EAAC,KAAK,EAAE,WAAW,gBAC7D,KAAK,IACJ,CACL,EACA,iBAAiB,IAAI,CACpB,uBAAK,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAC,qCAAqC,gBAC7E,KAAC,SAAS,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,SAAS,EAAE,0BAA0B,CAAC,KAAK,CAAC,CAAC,EAAE,GAAI,IACnF,CACP,EACA,OAAO,KACJ,IACF,IACA,CACT,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -3,7 +3,7 @@ import { ICommonProps, TStyles } from '../../constants';
|
|
|
3
3
|
export interface IModalProps extends ICommonProps {
|
|
4
4
|
isModalOpen: boolean;
|
|
5
5
|
isFullScreen?: boolean;
|
|
6
|
-
|
|
6
|
+
isClosableOutside?: boolean;
|
|
7
7
|
content: ReactElement;
|
|
8
8
|
handleCloseModal: () => void;
|
|
9
9
|
title?: string;
|