@expressms/smartapp-ui 2.9.26 → 2.9.27
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/constants/constants.d.ts +5 -2
- package/build/main/constants/constants.js +3 -0
- package/build/main/constants/constants.js.map +1 -1
- package/build/main/hooks/useModal.d.ts +12 -8
- package/build/main/hooks/useModal.js +79 -15
- package/build/main/hooks/useModal.js.map +1 -1
- package/build/main/styles/styles.scss +1 -1
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.d.ts +1 -1
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js +6 -4
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js.map +1 -1
- package/build/main//321/201omponents/ConfirmationModal/types.d.ts +8 -5
- package/build/main//321/201omponents/Modal/Modal.d.ts +1 -1
- package/build/main//321/201omponents/Modal/Modal.js +18 -9
- package/build/main//321/201omponents/Modal/Modal.js.map +1 -1
- package/build/main//321/201omponents/Modal/types.d.ts +18 -2
- package/package.json +5 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IConfirmationModalProps } from './types';
|
|
2
2
|
import '../../styles/styles.scss';
|
|
3
|
-
declare const ConfirmationModal: ({ isModalOpen, isClosableOutside, isConfirmLoading, isCancelLoading, isCloseIconHidden, title, text, cancelButtonName, confirmButtonName,
|
|
3
|
+
declare const ConfirmationModal: ({ isModalOpen, isClosableOutside, isConfirmLoading, isCancelLoading, isCloseIconHidden, title, text, cancelButtonName, confirmButtonName, platform, popupClassName, className, popupStyles, styles, titleStyles, iconColor, backgroundColor, buttonsDirection, isBottomSheet, isDisabledBottomSheet, bottomSheetProps, bottomSheetDetent, bottomSheetStyles, cancelButtonFunction, confirmButtonFunction, handleCloseModal, }: IConfirmationModalProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
4
4
|
export default ConfirmationModal;
|
|
@@ -12,16 +12,16 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useEffect, useRef } from 'react';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
|
+
import { useModal } from '../../hooks/useModal';
|
|
15
16
|
import Button from '../Button';
|
|
17
|
+
import { checkIfContentIsCentered, generateBottomSheetClassName, generateClassNames, generateColor, generateIsCloseIconHidden } from '../../helpers';
|
|
18
|
+
import { COLORS, MODAL_BUTTONS_DIRECTION, PLATFORM, ROW } from '../../constants';
|
|
16
19
|
import { TButtonVariant } from '../Button/types';
|
|
17
|
-
import { PLATFORM, MODAL_BUTTONS_DIRECTION, ROW } from '../../constants';
|
|
18
|
-
import { checkIfContentIsCentered, generateClassNames, generateColor, generateIsCloseIconHidden, generateBottomSheetClassName } from '../../helpers';
|
|
19
20
|
import { ReactComponent as CloseIcon } from '../../assets/icons/cancel-cross.svg';
|
|
20
|
-
import { useModal } from '../../hooks/useModal';
|
|
21
21
|
import '../../styles/styles.scss';
|
|
22
22
|
var COLUMN_REVERSE = 'column-reverse';
|
|
23
23
|
var ConfirmationModal = function (_a) {
|
|
24
|
-
var isModalOpen = _a.isModalOpen, _b = _a.isClosableOutside, isClosableOutside = _b === void 0 ? true : _b, _c = _a.isConfirmLoading, isConfirmLoading = _c === void 0 ? false : _c, _d = _a.isCancelLoading, isCancelLoading = _d === void 0 ? false : _d, isCloseIconHidden = _a.isCloseIconHidden, title = _a.title, text = _a.text, cancelButtonName = _a.cancelButtonName, confirmButtonName = _a.confirmButtonName,
|
|
24
|
+
var isModalOpen = _a.isModalOpen, _b = _a.isClosableOutside, isClosableOutside = _b === void 0 ? true : _b, _c = _a.isConfirmLoading, isConfirmLoading = _c === void 0 ? false : _c, _d = _a.isCancelLoading, isCancelLoading = _d === void 0 ? false : _d, isCloseIconHidden = _a.isCloseIconHidden, title = _a.title, text = _a.text, cancelButtonName = _a.cancelButtonName, confirmButtonName = _a.confirmButtonName, _e = _a.platform, platform = _e === void 0 ? PLATFORM.web : _e, popupClassName = _a.popupClassName, className = _a.className, popupStyles = _a.popupStyles, styles = _a.styles, titleStyles = _a.titleStyles, iconColor = _a.iconColor, backgroundColor = _a.backgroundColor, _f = _a.buttonsDirection, buttonsDirection = _f === void 0 ? MODAL_BUTTONS_DIRECTION.row : _f, _g = _a.isBottomSheet, isBottomSheet = _g === void 0 ? false : _g, _h = _a.isDisabledBottomSheet, isDisabledBottomSheet = _h === void 0 ? false : _h, bottomSheetProps = _a.bottomSheetProps, bottomSheetDetent = _a.bottomSheetDetent, bottomSheetStyles = _a.bottomSheetStyles, cancelButtonFunction = _a.cancelButtonFunction, confirmButtonFunction = _a.confirmButtonFunction, handleCloseModal = _a.handleCloseModal;
|
|
25
25
|
var ref = useRef(null);
|
|
26
26
|
var titleRef = useRef(null);
|
|
27
27
|
var textRef = useRef(null);
|
|
@@ -39,6 +39,8 @@ var ConfirmationModal = function (_a) {
|
|
|
39
39
|
popupClassName: classNames('confirmation-modal', popupClassName),
|
|
40
40
|
popupStyles: popupStyles,
|
|
41
41
|
bottomSheetProps: bottomSheetProps,
|
|
42
|
+
bottomSheetStyles: __assign(__assign({}, bottomSheetStyles), { sheetBackdropStyles: __assign({ background: generateColor(backgroundColor, COLORS.colorBgBlackoutTransparent) }, bottomSheetStyles === null || bottomSheetStyles === void 0 ? void 0 : bottomSheetStyles.sheetBackdropStyles) }),
|
|
43
|
+
bottomSheetDetent: bottomSheetDetent,
|
|
42
44
|
}), shouldUseBottomSheet = _j.shouldUseBottomSheet, renderModal = _j.renderModal;
|
|
43
45
|
var additionalClassName = generateBottomSheetClassName(platform, shouldUseBottomSheet);
|
|
44
46
|
useEffect(function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationModal.js","sourceRoot":"","sources":["../../../../src/сomponents/ConfirmationModal/ConfirmationModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAa,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC3D,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,YAAY,CAAC,CAAA;AAClC,CAAC,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SheetDetent } from 'react-modal-sheet';
|
|
3
3
|
import { ICommonProps, TStyles } from '../../constants';
|
|
4
|
+
import { TBottomSheetProps, TBottomSheetStyles } from '../Modal/types';
|
|
4
5
|
export interface IConfirmationModalProps extends ICommonProps {
|
|
5
6
|
isModalOpen: boolean;
|
|
6
7
|
isClosableOutside?: boolean;
|
|
@@ -11,9 +12,6 @@ export interface IConfirmationModalProps extends ICommonProps {
|
|
|
11
12
|
text: ReactNode;
|
|
12
13
|
cancelButtonName?: string;
|
|
13
14
|
confirmButtonName: string;
|
|
14
|
-
cancelButtonFunction: () => void;
|
|
15
|
-
confirmButtonFunction: (option?: any) => void;
|
|
16
|
-
handleCloseModal?: () => void;
|
|
17
15
|
popupClassName?: string;
|
|
18
16
|
className?: string;
|
|
19
17
|
popupStyles?: TStyles;
|
|
@@ -24,5 +22,10 @@ export interface IConfirmationModalProps extends ICommonProps {
|
|
|
24
22
|
buttonsDirection?: 'row' | 'column';
|
|
25
23
|
isBottomSheet?: boolean;
|
|
26
24
|
isDisabledBottomSheet?: boolean;
|
|
27
|
-
bottomSheetProps?:
|
|
25
|
+
bottomSheetProps?: TBottomSheetProps;
|
|
26
|
+
bottomSheetStyles?: TBottomSheetStyles;
|
|
27
|
+
bottomSheetDetent?: SheetDetent;
|
|
28
|
+
cancelButtonFunction: () => void;
|
|
29
|
+
confirmButtonFunction: (option?: any) => void;
|
|
30
|
+
handleCloseModal?: () => void;
|
|
28
31
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IModalProps } from './types';
|
|
2
2
|
import '../../styles/styles.scss';
|
|
3
|
-
declare const Modal: ({ isModalOpen, isClosableOutside, isCloseIconHidden, isPopup, isBottomSheet, isDisabledBottomSheet, isCloseButtonDisabled, isResetPaddingBottom, modalId, content, topContent, bottomContent, title, titleIcon, platform, popupClassName, className, popupStyles, styles, titleStyles, contentStyles, iconColor, backgroundColor, modalMaxHeight, bottomSheetProps, externalBottomSheetScrollContainer, contextMenuProps, handleCloseModal, titleClassName, }: IModalProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
declare const Modal: ({ isModalOpen, isClosableOutside, isCloseIconHidden, isPopup, isBottomSheet, isDisabledBottomSheet, isCloseButtonDisabled, isResetPaddingBottom, modalId, content, topContent, bottomContent, title, titleIcon, platform, popupClassName, className, popupStyles, styles, titleStyles, contentStyles, iconColor, backgroundColor, modalMaxHeight, bottomSheetProps, bottomSheetStyles, bottomSheetDetent, externalBottomSheetScrollContainer, extraPaddingFocusedElementBottomSheet, contextMenuProps, handleCloseModal, titleClassName, }: IModalProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
4
4
|
export default Modal;
|
|
@@ -37,7 +37,7 @@ import ContextMenu from '../ContextMenu';
|
|
|
37
37
|
import ScrollBar from '../ScrollBar';
|
|
38
38
|
import { DEFAULT_SCROLL_BAR_SIZE } from '../ScrollBar/ScrollBar';
|
|
39
39
|
import { checkIfContentIsCentered, generateBottomSheetClassName, generateClassNames, generateColor, generateIsCloseIconHidden, isMobilePlatform, } from '../../helpers';
|
|
40
|
-
import { EVENT_LISTENER_TYPES, PLATFORM } from '../../constants';
|
|
40
|
+
import { COLORS, EVENT_LISTENER_TYPES, PLATFORM } from '../../constants';
|
|
41
41
|
import { ReactComponent as CloseIcon } from '../../assets/icons/cancel-cross.svg';
|
|
42
42
|
import { ReactComponent as MoreIcon } from '../../assets/icons/more.svg';
|
|
43
43
|
import '../../styles/styles.scss';
|
|
@@ -50,17 +50,18 @@ var POPUP_CLASS_NAME = 'popup';
|
|
|
50
50
|
var MIN_SCROLL_TOP = 5;
|
|
51
51
|
var CONTAINER_EDGE_MARGIN = 4;
|
|
52
52
|
var Modal = function (_a) {
|
|
53
|
-
var isModalOpen = _a.isModalOpen, _b = _a.isClosableOutside, isClosableOutside = _b === void 0 ? true : _b, isCloseIconHidden = _a.isCloseIconHidden, isPopup = _a.isPopup, _c = _a.isBottomSheet, isBottomSheet = _c === void 0 ? false : _c, _d = _a.isDisabledBottomSheet, isDisabledBottomSheet = _d === void 0 ? false : _d, _e = _a.isCloseButtonDisabled, isCloseButtonDisabled = _e === void 0 ? false : _e, _f = _a.isResetPaddingBottom, isResetPaddingBottom = _f === void 0 ? false : _f, modalId = _a.modalId, content = _a.content, topContent = _a.topContent, bottomContent = _a.bottomContent, title = _a.title, titleIcon = _a.titleIcon, _g = _a.platform, platform = _g === void 0 ? PLATFORM.web : _g, popupClassName = _a.popupClassName, className = _a.className, popupStyles = _a.popupStyles, styles = _a.styles, titleStyles = _a.titleStyles, contentStyles = _a.contentStyles, iconColor = _a.iconColor, backgroundColor = _a.backgroundColor, modalMaxHeight = _a.modalMaxHeight, bottomSheetProps = _a.bottomSheetProps, externalBottomSheetScrollContainer = _a.externalBottomSheetScrollContainer, contextMenuProps = _a.contextMenuProps, handleCloseModal = _a.handleCloseModal, titleClassName = _a.titleClassName;
|
|
53
|
+
var isModalOpen = _a.isModalOpen, _b = _a.isClosableOutside, isClosableOutside = _b === void 0 ? true : _b, isCloseIconHidden = _a.isCloseIconHidden, isPopup = _a.isPopup, _c = _a.isBottomSheet, isBottomSheet = _c === void 0 ? false : _c, _d = _a.isDisabledBottomSheet, isDisabledBottomSheet = _d === void 0 ? false : _d, _e = _a.isCloseButtonDisabled, isCloseButtonDisabled = _e === void 0 ? false : _e, _f = _a.isResetPaddingBottom, isResetPaddingBottom = _f === void 0 ? false : _f, modalId = _a.modalId, content = _a.content, topContent = _a.topContent, bottomContent = _a.bottomContent, title = _a.title, titleIcon = _a.titleIcon, _g = _a.platform, platform = _g === void 0 ? PLATFORM.web : _g, popupClassName = _a.popupClassName, className = _a.className, popupStyles = _a.popupStyles, styles = _a.styles, titleStyles = _a.titleStyles, contentStyles = _a.contentStyles, iconColor = _a.iconColor, backgroundColor = _a.backgroundColor, modalMaxHeight = _a.modalMaxHeight, bottomSheetProps = _a.bottomSheetProps, bottomSheetStyles = _a.bottomSheetStyles, bottomSheetDetent = _a.bottomSheetDetent, externalBottomSheetScrollContainer = _a.externalBottomSheetScrollContainer, _h = _a.extraPaddingFocusedElementBottomSheet, extraPaddingFocusedElementBottomSheet = _h === void 0 ? 0 : _h, contextMenuProps = _a.contextMenuProps, handleCloseModal = _a.handleCloseModal, titleClassName = _a.titleClassName;
|
|
54
54
|
var ref = useRef(null);
|
|
55
55
|
var titleRef = useRef(null);
|
|
56
|
+
var scrollbarRef = useRef(null);
|
|
56
57
|
var scrollableContentRef = useRef(null);
|
|
57
58
|
var contentRef = useRef(null);
|
|
58
59
|
var scrollerRef = useRef(null);
|
|
59
60
|
var topContentRef = useRef(null);
|
|
60
61
|
var bottomContentRef = useRef(null);
|
|
61
|
-
var
|
|
62
|
-
var
|
|
63
|
-
var
|
|
62
|
+
var _j = useState(''), containerHeight = _j[0], setContainerHeight = _j[1];
|
|
63
|
+
var _k = useState(false), isShadowVisible = _k[0], setIsShadowVisible = _k[1];
|
|
64
|
+
var _l = useModal({
|
|
64
65
|
isModalOpen: isModalOpen,
|
|
65
66
|
platform: platform,
|
|
66
67
|
isDisabledBottomSheet: isDisabledBottomSheet,
|
|
@@ -71,8 +72,10 @@ var Modal = function (_a) {
|
|
|
71
72
|
popupClassName: classNames('modal', popupClassName),
|
|
72
73
|
popupStyles: popupStyles,
|
|
73
74
|
bottomSheetProps: bottomSheetProps,
|
|
75
|
+
bottomSheetStyles: __assign(__assign({}, bottomSheetStyles), { sheetBackdropStyles: __assign({ background: generateColor(backgroundColor, COLORS.colorBgBlackoutTransparent) }, bottomSheetStyles === null || bottomSheetStyles === void 0 ? void 0 : bottomSheetStyles.sheetBackdropStyles) }),
|
|
76
|
+
bottomSheetDetent: bottomSheetDetent,
|
|
74
77
|
scrollRef: externalBottomSheetScrollContainer || scrollerRef,
|
|
75
|
-
}), shouldUseBottomSheet =
|
|
78
|
+
}), shouldUseBottomSheet = _l.shouldUseBottomSheet, renderModal = _l.renderModal, offsetScrollY = _l.offsetScrollY;
|
|
76
79
|
var generateAdditionalClassName = function () {
|
|
77
80
|
var bottomSheetClassName = generateBottomSheetClassName(platform, shouldUseBottomSheet);
|
|
78
81
|
return isPopup ? __spreadArray(__spreadArray([], bottomSheetClassName, true), [POPUP_CLASS_NAME], false) : bottomSheetClassName;
|
|
@@ -96,7 +99,8 @@ var Modal = function (_a) {
|
|
|
96
99
|
};
|
|
97
100
|
var handleSetContainerHeightWeb = function (contentRef) { return handleSetContainerHeight(contentRef, MAX_MODAL_HEIGHT_WEB); };
|
|
98
101
|
var handleSetContainerHeightMobile = useCallback(function (elementRef) {
|
|
99
|
-
var
|
|
102
|
+
var visualViewport = window.visualViewport, innerHeight = window.innerHeight;
|
|
103
|
+
var MAX_MODAL_HEIGHT_MOBILE = modalMaxHeight || (visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.height) || innerHeight - modalMargins;
|
|
100
104
|
contentRef.current = elementRef;
|
|
101
105
|
handleSetContainerHeight(elementRef, MAX_MODAL_HEIGHT_MOBILE);
|
|
102
106
|
}, [modalMargins, modalMaxHeight]);
|
|
@@ -120,6 +124,11 @@ var Modal = function (_a) {
|
|
|
120
124
|
document === null || document === void 0 ? void 0 : document.removeEventListener(EVENT_LISTENER_TYPES.click, checkIfClickedOutside, true);
|
|
121
125
|
};
|
|
122
126
|
}, [isModalOpen, isClosableOutside, handleCloseModal, isPopup]);
|
|
127
|
+
useEffect(function () {
|
|
128
|
+
var scrollbarRefCurrent = scrollbarRef.current;
|
|
129
|
+
if (scrollbarRefCurrent && offsetScrollY)
|
|
130
|
+
scrollbarRefCurrent.scrollTop += offsetScrollY + extraPaddingFocusedElementBottomSheet;
|
|
131
|
+
}, [offsetScrollY, extraPaddingFocusedElementBottomSheet]);
|
|
123
132
|
var renderTitle = function () {
|
|
124
133
|
return title && (_jsxs("div", __assign({ className: classNames({ 'smartapp-modal__content--title__shadow': isShadowVisible && isPopup }) }, { children: [!isCloseIconInvisible && renderCloseIconSpace({ elementRef: titleRef, isLarge: true }), _jsx("p", __assign({ ref: titleRef, className: classNames("smartapp-modal__content--title ".concat(titleClassName), {
|
|
125
134
|
'smartapp-modal__content--title__ellipsis': isShadowVisible && isPopup,
|
|
@@ -153,9 +162,9 @@ var Modal = function (_a) {
|
|
|
153
162
|
var renderBottomContent = function () {
|
|
154
163
|
return bottomContent && (_jsx("div", __assign({ ref: bottomContentRef, className: classNames('smartapp-modal__content--bottom', 'smartapp-modal__content--pr', 'smartapp-modal__content--pb') }, { children: bottomContent })));
|
|
155
164
|
};
|
|
156
|
-
var modalContent = (_jsx("div", __assign({ ref: ref, className: classNames('smartapp-modal', { 'smartapp-modal__bottom-sheet': shouldUseBottomSheet }, className), style: styles, onMouseDown: handleMouseDown }, { children: _jsxs("div", __assign({ className: generateClassNames({ className: 'smartapp-modal__content', delimiter: '--', additionalClassName: generateAdditionalClassName() }), style: contentStyles }, { children: [renderTitle(), _jsxs("div", __assign({ className: "smartapp-modal__content--icons" }, { children: [renderTitleIcon(), renderContextMenuIcon(), renderCloseIcon()] })), renderTopContent(), _jsx(ScrollBar, { contentId: modalId, containerEdgeMargin: CONTAINER_EDGE_MARGIN, scrollerProps: { elementRef: function (el) { return (scrollerRef.current = el); } }, content: _jsxs("div", __assign({ ref: isMobilePlatform(platform) ? handleSetContainerHeightMobile : handleSetContainerHeightWeb, className: classNames('smartapp-modal__content--scrollable', 'smartapp-modal__content--pr', {
|
|
165
|
+
var modalContent = (_jsx("div", __assign({ ref: ref, className: classNames('smartapp-modal', { 'smartapp-modal__bottom-sheet': shouldUseBottomSheet }, className), style: styles, onMouseDown: handleMouseDown }, { children: _jsxs("div", __assign({ className: generateClassNames({ className: 'smartapp-modal__content', delimiter: '--', additionalClassName: generateAdditionalClassName() }), style: contentStyles }, { children: [renderTitle(), _jsxs("div", __assign({ className: "smartapp-modal__content--icons" }, { children: [renderTitleIcon(), renderContextMenuIcon(), renderCloseIcon()] })), renderTopContent(), _jsx(ScrollBar, { scrollbarRef: scrollbarRef, contentId: modalId, containerEdgeMargin: CONTAINER_EDGE_MARGIN, scrollerProps: { elementRef: function (el) { return (scrollerRef.current = el); } }, content: _jsxs("div", __assign({ ref: isMobilePlatform(platform) ? handleSetContainerHeightMobile : handleSetContainerHeightWeb, className: classNames('smartapp-modal__content--scrollable', 'smartapp-modal__content--pr', {
|
|
157
166
|
'smartapp-modal__content--pb': !bottomContent && !isResetPaddingBottom,
|
|
158
|
-
}) }, { children: [!title && !isCloseIconInvisible && renderCloseIconSpace({ elementRef: scrollableContentRef, isContent: true }), _jsx("div", __assign({ ref: scrollableContentRef }, { children: content }))] })), containerHeight: containerHeight, trackYHeight: bottomContent ? DEFAULT_SCROLL_BAR_SIZE : SCROLL_BAR_HEIGHT_WITH_PADDING, handleScroll: handleScroll }), renderBottomContent()] })) })));
|
|
167
|
+
}) }, { children: [!title && !isCloseIconInvisible && renderCloseIconSpace({ elementRef: scrollableContentRef, isContent: true }), _jsx("div", __assign({ ref: scrollableContentRef, style: { paddingBottom: offsetScrollY + extraPaddingFocusedElementBottomSheet } }, { children: content }))] })), containerHeight: containerHeight, trackYHeight: bottomContent ? DEFAULT_SCROLL_BAR_SIZE : SCROLL_BAR_HEIGHT_WITH_PADDING, handleScroll: handleScroll }), renderBottomContent()] })) })));
|
|
159
168
|
return isPopup ? modalContent : renderModal(modalContent);
|
|
160
169
|
};
|
|
161
170
|
export default Modal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../../src/сomponents/Modal/Modal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAc,EAAa,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClF,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO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C,EAAE,IAAK,OAAA,CAAC,WAAW,CAAC,OAAO,GAAG,EAAE,CAAC,EAA1B,CAA0B,EAAE,EACjE,OAAO,EACL,wBACE,GAAG,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,2BAA2B,EAC9F,SAAS,EAAE,UAAU,CAAC,qCAAqC,EAAE,6BAA6B,EAAE;4BAC1F,6BAA6B,EAAE,CAAC,aAAa,IAAI,CAAC,oBAAoB;yBACvE,CAAC,iBAED,CAAC,KAAK,IAAI,CAAC,oBAAoB,IAAI,oBAAoB,CAAC,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAC/G,uBAAK,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,aAAa,GAAG,qCAAqC,EAAE,gBAC5G,OAAO,IACJ,KACF,EAER,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,8BAA8B,EACtF,YAAY,EAAE,YAAY,GAC1B,EACD,mBAAmB,EAAE,KAClB,IACF,CACP,CAAA;IAED,OAAO,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,CAAA;AAC3D,CAAC,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import React, { ReactElement, RefObject } from 'react';
|
|
2
|
+
import { SheetBackdropProps, SheetContainerProps, SheetContentProps, SheetDetent, SheetProps } from 'react-modal-sheet';
|
|
2
3
|
import { BottomSheetProps } from 'alex.chus-react-spring-bottom-sheet';
|
|
3
4
|
import { ICommonProps, TStyles } from '../../constants';
|
|
4
5
|
import { IContextMenuProps } from '../ContextMenu/types';
|
|
6
|
+
export type TBottomSheetProps = Partial<Omit<BottomSheetProps, 'externalScrollContainer'>> | {
|
|
7
|
+
sheetProps?: Omit<SheetProps, 'isOpen' | 'onClose' | 'children'>;
|
|
8
|
+
sheetContainerProps?: SheetContainerProps;
|
|
9
|
+
sheetContentProps?: SheetContentProps;
|
|
10
|
+
sheetBackdropProps?: SheetBackdropProps;
|
|
11
|
+
};
|
|
12
|
+
export type TBottomSheetStyles = {
|
|
13
|
+
sheetStyles?: TStyles;
|
|
14
|
+
sheetContainerStyles?: TStyles;
|
|
15
|
+
sheetContentStyles?: TStyles;
|
|
16
|
+
sheetBackdropStyles?: TStyles;
|
|
17
|
+
};
|
|
5
18
|
export interface IModalProps extends ICommonProps {
|
|
6
19
|
isModalOpen: boolean;
|
|
7
20
|
isClosableOutside?: boolean;
|
|
@@ -19,6 +32,7 @@ export interface IModalProps extends ICommonProps {
|
|
|
19
32
|
titleIcon?: ReactElement;
|
|
20
33
|
popupClassName?: string;
|
|
21
34
|
className?: string;
|
|
35
|
+
titleClassName?: string;
|
|
22
36
|
popupStyles?: TStyles;
|
|
23
37
|
styles?: TStyles;
|
|
24
38
|
titleStyles?: TStyles;
|
|
@@ -26,11 +40,13 @@ export interface IModalProps extends ICommonProps {
|
|
|
26
40
|
iconColor?: string;
|
|
27
41
|
backgroundColor?: string;
|
|
28
42
|
modalMaxHeight?: number;
|
|
29
|
-
bottomSheetProps?:
|
|
43
|
+
bottomSheetProps?: TBottomSheetProps;
|
|
44
|
+
bottomSheetStyles?: TBottomSheetStyles;
|
|
45
|
+
bottomSheetDetent?: SheetDetent;
|
|
30
46
|
externalBottomSheetScrollContainer?: RefObject<HTMLDivElement | null>;
|
|
47
|
+
extraPaddingFocusedElementBottomSheet?: number;
|
|
31
48
|
contextMenuProps?: IContextMenuProps & {
|
|
32
49
|
openMenu: (event?: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
33
50
|
};
|
|
34
51
|
handleCloseModal: () => void;
|
|
35
|
-
titleClassName?: string;
|
|
36
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expressms/smartapp-ui",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.27",
|
|
4
4
|
"description": "SmartApp UI library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "build/main/index.js",
|
|
@@ -23,11 +23,13 @@
|
|
|
23
23
|
"echarts": "^5.5.0",
|
|
24
24
|
"echarts-for-react": "^3.0.2",
|
|
25
25
|
"juice": "^10.0.0",
|
|
26
|
+
"motion": "^12.30.0",
|
|
26
27
|
"react-beautiful-dnd": "^13.1.1",
|
|
27
28
|
"react-datepicker": "^4.8.0",
|
|
28
29
|
"react-draggable": "^4.4.6",
|
|
29
30
|
"react-hook-form": "^7.60.0",
|
|
30
31
|
"react-insta-stories": "^2.6.2",
|
|
32
|
+
"react-modal-sheet": "^5.2.1",
|
|
31
33
|
"react-router-dom": "^6.7.0",
|
|
32
34
|
"react-scrollbars-custom": "^4.1.1",
|
|
33
35
|
"react-select": "^5.8.0",
|
|
@@ -38,7 +40,8 @@
|
|
|
38
40
|
"react-window": "^1.8.10",
|
|
39
41
|
"reactjs-popup": "^2.0.5",
|
|
40
42
|
"styled-components": "^6.1.11",
|
|
41
|
-
"transliteration": "~2.3.5"
|
|
43
|
+
"transliteration": "~2.3.5",
|
|
44
|
+
"use-detect-keyboard-open": "^0.4.0"
|
|
42
45
|
},
|
|
43
46
|
"resolutions": {
|
|
44
47
|
"@typescript-eslint/utils": "6.21.0",
|