@alfalab/core-components-base-modal 5.9.0 → 6.0.0-snapshot-1393ffa
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/Component.js +17 -18
- package/Component.js.map +1 -0
- package/cssm/Component.js +17 -16
- package/cssm/Component.js.map +1 -0
- package/cssm/helpers/lockScroll.js +1 -0
- package/cssm/helpers/lockScroll.js.map +1 -0
- package/cssm/index.js +6 -5
- package/cssm/index.js.map +1 -0
- package/cssm/index.module.css +3 -23
- package/cssm/matches-polyfill.js +1 -0
- package/cssm/matches-polyfill.js.map +1 -0
- package/{Component.d.ts → cssm/src/Component.d.ts} +8 -11
- package/cssm/src/helpers/lockScroll.d.ts +8 -0
- package/cssm/src/index.d.ts +3 -0
- package/cssm/src/utils.d.ts +5 -0
- package/cssm/utils.js +6 -5
- package/cssm/utils.js.map +1 -0
- package/esm/Component.js +3 -4
- package/esm/Component.js.map +1 -0
- package/esm/helpers/lockScroll.js +1 -0
- package/esm/helpers/lockScroll.js.map +1 -0
- package/esm/index.css +17 -38
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -0
- package/esm/index.module.css.js +6 -0
- package/esm/index.module.css.js.map +1 -0
- package/esm/matches-polyfill.js +1 -0
- package/esm/matches-polyfill.js.map +1 -0
- package/{cssm → esm/src}/Component.d.ts +8 -11
- package/esm/src/helpers/lockScroll.d.ts +8 -0
- package/esm/src/index.d.ts +3 -0
- package/esm/src/utils.d.ts +5 -0
- package/esm/utils.js +1 -0
- package/esm/utils.js.map +1 -0
- package/helpers/lockScroll.js +1 -0
- package/helpers/lockScroll.js.map +1 -0
- package/index.css +17 -38
- package/index.js +6 -5
- package/index.js.map +1 -0
- package/index.module.css.js +8 -0
- package/index.module.css.js.map +1 -0
- package/matches-polyfill.js +1 -0
- package/matches-polyfill.js.map +1 -0
- package/modern/Component.js +3 -4
- package/modern/Component.js.map +1 -0
- package/modern/helpers/lockScroll.js +1 -0
- package/modern/helpers/lockScroll.js.map +1 -0
- package/modern/index.css +17 -38
- package/modern/index.js +1 -0
- package/modern/index.js.map +1 -0
- package/modern/index.module.css.js +6 -0
- package/modern/index.module.css.js.map +1 -0
- package/modern/matches-polyfill.js +1 -0
- package/modern/matches-polyfill.js.map +1 -0
- package/{esm → modern/src}/Component.d.ts +8 -11
- package/modern/src/helpers/lockScroll.d.ts +8 -0
- package/modern/src/index.d.ts +3 -0
- package/modern/src/utils.d.ts +5 -0
- package/modern/utils.js +1 -0
- package/modern/utils.js.map +1 -0
- package/moderncssm/Component.js +2 -1
- package/moderncssm/Component.js.map +1 -0
- package/moderncssm/helpers/lockScroll.js +1 -0
- package/moderncssm/helpers/lockScroll.js.map +1 -0
- package/moderncssm/index.js +1 -0
- package/moderncssm/index.js.map +1 -0
- package/moderncssm/index.module.css +1 -3
- package/moderncssm/matches-polyfill.js +1 -0
- package/moderncssm/matches-polyfill.js.map +1 -0
- package/{modern → moderncssm/src}/Component.d.ts +8 -11
- package/moderncssm/src/helpers/lockScroll.d.ts +8 -0
- package/moderncssm/src/index.d.ts +3 -0
- package/moderncssm/src/utils.d.ts +5 -0
- package/moderncssm/utils.js +1 -0
- package/moderncssm/utils.js.map +1 -0
- package/package.json +10 -11
- package/src/Component.d.ts +164 -0
- package/src/Component.tsx +1 -1
- package/src/helpers/lockScroll.d.ts +8 -0
- package/src/index.d.ts +3 -0
- package/src/utils.d.ts +5 -0
- package/utils.js +1 -0
- package/utils.js.map +1 -0
- package/cssm/helpers/lockScroll.d.ts +0 -5
- package/cssm/index.d.ts +0 -3
- package/cssm/matches-polyfill.d.ts +0 -1
- package/cssm/utils.d.ts +0 -6
- package/esm/helpers/lockScroll.d.ts +0 -5
- package/esm/index.d.ts +0 -3
- package/esm/matches-polyfill.d.ts +0 -1
- package/esm/utils.d.ts +0 -6
- package/helpers/lockScroll.d.ts +0 -5
- package/index.d.ts +0 -3
- package/matches-polyfill.d.ts +0 -1
- package/modern/helpers/lockScroll.d.ts +0 -5
- package/modern/index.d.ts +0 -3
- package/modern/matches-polyfill.d.ts +0 -1
- package/modern/utils.d.ts +0 -6
- package/moderncssm/Component.d.ts +0 -167
- package/moderncssm/helpers/lockScroll.d.ts +0 -5
- package/moderncssm/index.d.ts +0 -3
- package/moderncssm/matches-polyfill.d.ts +0 -1
- package/moderncssm/utils.d.ts +0 -6
- package/utils.d.ts +0 -6
package/cssm/utils.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var cssm = require('@alfalab/core-components-global-store/cssm');
|
|
6
|
+
var cssm$1 = require('@alfalab/core-components-shared/cssm');
|
|
7
7
|
|
|
8
8
|
function isScrolledToTop(target) {
|
|
9
9
|
return target.scrollTop <= 0;
|
|
@@ -24,7 +24,7 @@ var getPaddingRight = function (node) {
|
|
|
24
24
|
return parseInt(window.getComputedStyle(node).paddingRight, 10) || 0;
|
|
25
25
|
};
|
|
26
26
|
var restoreContainerStyles = function (container) {
|
|
27
|
-
var modalRestoreStyles =
|
|
27
|
+
var modalRestoreStyles = cssm.getModalStore().getRestoreStyles();
|
|
28
28
|
var index = modalRestoreStyles.findIndex(function (s) { return s.container === container; });
|
|
29
29
|
var existingStyles = modalRestoreStyles[index];
|
|
30
30
|
if (!existingStyles)
|
|
@@ -47,7 +47,7 @@ var handleContainer = function (container, shouldIOSLock) {
|
|
|
47
47
|
if (shouldIOSLock === void 0) { shouldIOSLock = false; }
|
|
48
48
|
if (!container)
|
|
49
49
|
return;
|
|
50
|
-
var modalRestoreStyles =
|
|
50
|
+
var modalRestoreStyles = cssm.getModalStore().getRestoreStyles();
|
|
51
51
|
var existingStyles = modalRestoreStyles.find(function (s) { return s.container === container; });
|
|
52
52
|
if (existingStyles) {
|
|
53
53
|
existingStyles.modals += 1;
|
|
@@ -56,7 +56,7 @@ var handleContainer = function (container, shouldIOSLock) {
|
|
|
56
56
|
var containerStyles = [];
|
|
57
57
|
if (isOverflowing(container)) {
|
|
58
58
|
// Вычисляет размер до применения `overflow hidden` для избежания скачков
|
|
59
|
-
var scrollbarSize =
|
|
59
|
+
var scrollbarSize = cssm$1.browser.getScrollbarSize();
|
|
60
60
|
containerStyles.push({
|
|
61
61
|
value: container.style.paddingRight,
|
|
62
62
|
key: 'padding-right',
|
|
@@ -97,3 +97,4 @@ exports.hasScrollbar = hasScrollbar;
|
|
|
97
97
|
exports.isScrolledToBottom = isScrolledToBottom;
|
|
98
98
|
exports.isScrolledToTop = isScrolledToTop;
|
|
99
99
|
exports.restoreContainerStyles = restoreContainerStyles;
|
|
100
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/utils.ts"],"sourcesContent":["import { getModalStore, SavedStyle } from '@alfalab/core-components-global-store';\nimport { browser } from '@alfalab/core-components-shared';\n\nexport function isScrolledToTop(target: HTMLElement) {\n return target.scrollTop <= 0;\n}\n\nexport function isScrolledToBottom(target: HTMLElement) {\n return target.scrollHeight - target.offsetHeight <= target.scrollTop;\n}\n\nexport function hasScrollbar(target: HTMLElement) {\n return target.scrollHeight > target.clientHeight;\n}\n\nconst isOverflowing = (container: Element) => {\n if (document.body === container) {\n return window.innerWidth > document.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n};\n\nconst getPaddingRight = (node: Element) =>\n parseInt(window.getComputedStyle(node).paddingRight, 10) || 0;\n\nexport const restoreContainerStyles = (container: HTMLElement) => {\n const modalRestoreStyles = getModalStore().getRestoreStyles();\n\n const index = modalRestoreStyles.findIndex((s) => s.container === container);\n const existingStyles = modalRestoreStyles[index];\n\n if (!existingStyles) return;\n\n existingStyles.modals -= 1;\n\n if (existingStyles.modals <= 0) {\n modalRestoreStyles.splice(index, 1);\n\n existingStyles.styles.forEach(({ value, el, key }) => {\n if (value) {\n el.style.setProperty(key, value);\n } else {\n el.style.removeProperty(key);\n }\n });\n }\n};\n\nexport const handleContainer = (container?: HTMLElement, shouldIOSLock = false) => {\n if (!container) return;\n\n const modalRestoreStyles = getModalStore().getRestoreStyles();\n\n const existingStyles = modalRestoreStyles.find((s) => s.container === container);\n\n if (existingStyles) {\n existingStyles.modals += 1;\n\n return;\n }\n\n const containerStyles: SavedStyle[] = [];\n\n if (isOverflowing(container)) {\n // Вычисляет размер до применения `overflow hidden` для избежания скачков\n const scrollbarSize = browser.getScrollbarSize();\n\n containerStyles.push({\n value: container.style.paddingRight,\n key: 'padding-right',\n el: container,\n });\n // Вычисляем стили, чтобы получить реальный `padding` c шириной сколлбара\n // eslint-disable-next-line no-param-reassign\n container.style.paddingRight = `${getPaddingRight(container) + scrollbarSize}px`;\n }\n\n const parent = container.parentElement;\n const scrollContainer =\n // TODO: заменить на optional chaining\n parent &&\n parent.nodeName === 'HTML' &&\n window.getComputedStyle(parent).overflowY === 'scroll'\n ? parent\n : container;\n\n // Блокируем скролл даже если отсутствует скроллбар\n if (scrollContainer.style.overflow !== 'hidden') {\n containerStyles.push({\n value: scrollContainer.style.overflow,\n key: 'overflow',\n el: scrollContainer,\n });\n }\n\n if (!shouldIOSLock) {\n scrollContainer.style.overflow = 'hidden';\n }\n\n modalRestoreStyles.push({\n container,\n modals: 1,\n styles: containerStyles,\n });\n};\n"],"names":["getModalStore","browser"],"mappings":";;;;;;;AAGM,SAAU,eAAe,CAAC,MAAmB,EAAA;AAC/C,IAAA,OAAO,MAAM,CAAC,SAAS,IAAI,CAAC;AAChC;AAEM,SAAU,kBAAkB,CAAC,MAAmB,EAAA;IAClD,OAAO,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,SAAS;AACxE;AAEM,SAAU,YAAY,CAAC,MAAmB,EAAA;AAC5C,IAAA,OAAO,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY;AACpD;AAEA,IAAM,aAAa,GAAG,UAAC,SAAkB,EAAA;AACrC,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AAK,EAAE,eAAe,CAAC,KAAK,CAAC,QAAQ;AACrC,YAAA,GAAG,EAAE,UAAU;AACf,YAAA,EAAE,EAAE,eAAe;AACtB,SAAA,CAAC;AACL;IAED,IAAI,CAAC,aAAa,EAAE;AAChB,QAAA,eAAe,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ;AAC5C;IAED,kBAAkB,CAAC,IAAI,CAAC;AACpB,QAAA,SAAS,EAAA,SAAA;AACT,QAAA,MAAM,EAAE,CAAC;AACT,QAAA,MAAM,EAAE,eAAe;AAC1B,KAAA,CAAC;AACN;;;;;;;;"}
|
package/esm/Component.js
CHANGED
|
@@ -9,14 +9,12 @@ import { Backdrop } from '@alfalab/core-components-backdrop/esm';
|
|
|
9
9
|
import { Portal } from '@alfalab/core-components-portal/esm';
|
|
10
10
|
import { os, browser } from '@alfalab/core-components-shared/esm';
|
|
11
11
|
import { Stack } from '@alfalab/core-components-stack/esm';
|
|
12
|
-
import { stackingOrder } from '@alfalab/stack-context';
|
|
12
|
+
import { stackingOrder } from '@alfalab/core-components-stack-context/esm';
|
|
13
13
|
import { unlockScroll, syncHeight, lockScroll } from './helpers/lockScroll.js';
|
|
14
14
|
import { isScrolledToTop, isScrolledToBottom, handleContainer, restoreContainerStyles, hasScrollbar } from './utils.js';
|
|
15
|
+
import styles from './index.module.css.js';
|
|
15
16
|
import './matches-polyfill.js';
|
|
16
17
|
|
|
17
|
-
var styles = {"component":"base-modal__component_14ddh","wrapper":"base-modal__wrapper_14ddh","content":"base-modal__content_14ddh","hasFooter":"base-modal__hasFooter_14ddh","hasHeader":"base-modal__hasHeader_14ddh","hidden":"base-modal__hidden_14ddh","backdrop":"base-modal__backdrop_14ddh","appear":"base-modal__appear_14ddh","enter":"base-modal__enter_14ddh","appearActive":"base-modal__appearActive_14ddh","enterActive":"base-modal__enterActive_14ddh","exit":"base-modal__exit_14ddh","exitActive":"base-modal__exitActive_14ddh","exitDone":"base-modal__exitDone_14ddh"};
|
|
18
|
-
require('./index.css')
|
|
19
|
-
|
|
20
18
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
21
19
|
var BaseModalContext = React.createContext({
|
|
22
20
|
parentRef: { current: null },
|
|
@@ -276,3 +274,4 @@ BaseModal.displayName = 'BaseModal';
|
|
|
276
274
|
BaseModalContext.displayName = 'BaseModalContext';
|
|
277
275
|
|
|
278
276
|
export { BaseModal, BaseModalContext };
|
|
277
|
+
//# sourceMappingURL=Component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../src/Component.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\nimport React, {\n ComponentType,\n forwardRef,\n KeyboardEvent,\n MouseEvent,\n MutableRefObject,\n ReactNode,\n Ref,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n WheelEvent,\n} from 'react';\nimport FocusLock from 'react-focus-lock';\nimport mergeRefs from 'react-merge-refs';\nimport { CSSTransition } from 'react-transition-group';\nimport { TransitionProps } from 'react-transition-group/Transition';\nimport { ResizeObserver as ResizeObserverPolyfill } from '@juggle/resize-observer';\nimport cn from 'classnames';\n\nimport { Backdrop as DefaultBackdrop, BackdropProps } from '@alfalab/core-components-backdrop';\nimport { Portal, PortalProps } from '@alfalab/core-components-portal';\nimport { browser, os } from '@alfalab/core-components-shared';\nimport { Stack } from '@alfalab/core-components-stack';\nimport { stackingOrder } from '@alfalab/core-components-stack-context';\n\nimport { lockScroll, syncHeight, unlockScroll } from './helpers/lockScroll';\nimport {\n handleContainer,\n hasScrollbar,\n isScrolledToBottom,\n isScrolledToTop,\n restoreContainerStyles,\n} from './utils';\n\nimport styles from './index.module.css';\n\n// TODO Без полифила крашится FocusLock в IE11. Выпилить в будущем!!!.\nimport './matches-polyfill';\n\nexport type BaseModalProps = {\n /**\n * Контент\n */\n children?: ReactNode;\n\n /**\n * Компонент бэкдропа\n */\n Backdrop?: ComponentType<BackdropProps>;\n\n /**\n * Свойства для Бэкдропа\n */\n backdropProps?: Partial<BackdropProps> & Record<string, unknown>;\n\n /**\n * Нода, компонент или функция возвращающая их\n *\n * Контейнер к которому будут добавляться порталы\n */\n container?: PortalProps['getPortalContainer'];\n\n /**\n * Отключает автоматический перевод фокуса на модалку при открытии\n * @default false\n */\n disableAutoFocus?: boolean;\n\n /**\n * Отключает ловушку фокуса\n * @default false\n */\n disableFocusLock?: boolean;\n\n /**\n * Отключает восстановление фокуса на предыдущем элементе после закрытия модалки\n * @default false\n */\n disableRestoreFocus?: boolean;\n\n /**\n * Отключает вызов `callback` при нажатии Escape\n * @default false\n */\n disableEscapeKeyDown?: boolean;\n\n /**\n * Отключает вызов `callback` при клике на бэкдроп\n * @default false\n */\n disableBackdropClick?: boolean;\n\n /**\n * Отключает блокировку скролла при открытии модального окна\n * @default false\n */\n disableBlockingScroll?: boolean;\n\n /**\n * Содержимое модалки всегда в DOM\n * @default false\n */\n keepMounted?: boolean;\n\n /**\n * Управление видимостью модалки\n */\n open: boolean;\n\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Дополнительный класс\n */\n contentClassName?: string;\n\n /**\n * Дополнительные пропсы на dialog wrapper\n */\n wrapperProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n\n /**\n * Дополнительные пропсы на обертку контента\n */\n contentProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n\n /**\n * Дополнительные пропсы на компонентную обертку контента\n */\n componentDivProps?: React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n >;\n\n /**\n * Дополнительный класс для обертки (Modal)\n */\n wrapperClassName?: string;\n\n /**\n * Обработчик скролла контента\n */\n scrollHandler?: 'wrapper' | 'content' | MutableRefObject<HTMLDivElement | null>;\n\n /**\n * Пропсы для анимации (CSSTransition)\n */\n transitionProps?: Partial<TransitionProps>;\n\n /**\n * Рендерить ли в контейнер через портал.\n * @default true\n */\n usePortal?: boolean;\n\n /**\n * Обработчик события нажатия на бэкдроп\n */\n onBackdropClick?: (event: MouseEvent) => void;\n\n /**\n * Обработчик события нажатия на Escape\n *\n * Если `disableEscapeKeyDown` - false и модальное окно в фокусе\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void;\n\n /**\n * Обработчик закрытия\n */\n onClose?: (\n event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>,\n reason?: 'backdropClick' | 'escapeKeyDown' | 'closerClick',\n ) => void;\n\n /**\n * Обработчик события onEntered компонента Transition\n */\n onMount?: () => void;\n\n /**\n * Обработчик события onExited компонента Transition\n */\n onUnmount?: () => void;\n\n /**\n * Идентификатор для систем автоматизированного тестирования\n */\n dataTestId?: string;\n\n /**\n * z-index компонента\n */\n zIndex?: number;\n\n /**\n * Реф, который должен быть установлен компонентной области\n */\n componentRef?: MutableRefObject<HTMLDivElement | null>;\n\n /**\n * Реф контентной области\n */\n contentElementRef?: MutableRefObject<HTMLDivElement | null>;\n\n /**\n * Блокирует скролл когда модальное окно открыто. Работает только на iOS.\n */\n iOSLock?: boolean;\n\n /**\n * Хэндлер события прокрутки колесиком\n */\n onWheel?: (e: WheelEvent<HTMLElement>) => void;\n};\n\nexport type BaseModalContext = {\n parentRef: React.RefObject<HTMLDivElement>;\n componentRef: React.RefObject<HTMLDivElement>;\n hasFooter?: boolean;\n hasHeader?: boolean;\n hasScroll?: boolean;\n headerHighlighted?: boolean;\n footerHighlighted?: boolean;\n headerOffset?: number;\n setHeaderOffset: (offset: number) => void;\n contentRef: Ref<HTMLElement>;\n setHasHeader: (exists: boolean) => void;\n setHasFooter: (exists: boolean) => void;\n onClose: Required<BaseModalProps>['onClose'];\n};\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const BaseModalContext = React.createContext<BaseModalContext>({\n parentRef: { current: null },\n componentRef: { current: null },\n hasFooter: false,\n hasHeader: false,\n hasScroll: false,\n headerHighlighted: false,\n footerHighlighted: false,\n headerOffset: 0,\n setHeaderOffset: () => null,\n contentRef: () => null,\n setHasHeader: () => null,\n setHasFooter: () => null,\n onClose: () => null,\n});\n\nexport const BaseModal = forwardRef<HTMLDivElement, BaseModalProps>(\n (\n {\n open,\n container,\n children,\n scrollHandler = 'wrapper',\n Backdrop = DefaultBackdrop,\n backdropProps = {},\n transitionProps = {},\n disableBackdropClick,\n disableAutoFocus = false,\n disableFocusLock = false,\n disableEscapeKeyDown = false,\n disableRestoreFocus = false,\n disableBlockingScroll = false,\n keepMounted = false,\n className,\n contentClassName,\n wrapperProps,\n contentProps,\n componentDivProps,\n wrapperClassName,\n onBackdropClick,\n onClose,\n onEscapeKeyDown,\n onMount,\n onUnmount,\n dataTestId,\n zIndex = stackingOrder.MODAL,\n componentRef = null,\n contentElementRef = null,\n usePortal = true,\n iOSLock = false,\n onWheel,\n },\n ref,\n ) => {\n const [exited, setExited] = useState<boolean | null>(null);\n const [hasScroll, setHasScroll] = useState(false);\n const [hasHeader, setHasHeader] = useState(false);\n const [hasFooter, setHasFooter] = useState(false);\n const [headerHighlighted, setHeaderHighlighted] = useState(false);\n const [footerHighlighted, setFooterHighlighted] = useState(false);\n const [headerOffset, setHeaderOffset] = useState(0);\n\n const componentNodeRef = useRef<HTMLDivElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const scrollableNodeRef = useRef<HTMLDivElement | null>(null);\n const contentNodeRef = useRef<HTMLDivElement | null>(null);\n const restoreContainerStylesRef = useRef<null | (() => void)>(null);\n const mouseDownTarget = useRef<HTMLElement>();\n const resizeObserverRef = useRef<ResizeObserver>();\n\n const checkToHasScrollBar = () => {\n if (scrollableNodeRef.current) {\n const scrollExists = hasScrollbar(scrollableNodeRef.current);\n\n setFooterHighlighted(scrollExists);\n setHasScroll(scrollExists);\n }\n };\n\n const isExited = exited || exited === null;\n const shouldRender = keepMounted || open || !isExited;\n\n const getContainer = useCallback(\n () => (container ? container() : document.body) as HTMLElement,\n [container],\n );\n\n const addResizeHandle = useCallback(() => {\n if (!resizeObserverRef.current) return;\n\n if (scrollableNodeRef.current) {\n resizeObserverRef.current.observe(scrollableNodeRef.current);\n }\n if (contentNodeRef.current) {\n resizeObserverRef.current.observe(contentNodeRef.current);\n }\n }, []);\n\n const removeResizeHandle = useCallback(() => resizeObserverRef.current?.disconnect(), []);\n\n const contentRef = useCallback((node: HTMLDivElement) => {\n if (node !== null) {\n contentNodeRef.current = node;\n if (resizeObserverRef.current) {\n resizeObserverRef.current.observe(node);\n }\n checkToHasScrollBar();\n }\n }, []);\n\n const handleScroll = useCallback(() => {\n if (!scrollableNodeRef.current || !componentNodeRef.current) return;\n\n if (hasHeader) {\n setHeaderHighlighted(\n !isScrolledToTop(scrollableNodeRef.current) &&\n componentNodeRef.current.getBoundingClientRect().top - headerOffset <= 1,\n );\n }\n\n if (hasFooter) {\n setFooterHighlighted(\n !isScrolledToBottom(scrollableNodeRef.current) &&\n componentNodeRef.current.getBoundingClientRect().bottom >=\n window.innerHeight - 1,\n );\n }\n }, [hasFooter, hasHeader, headerOffset]);\n\n const handleClose = useCallback<Required<BaseModalProps>['onClose']>(\n (event, reason) => {\n if (iOSLock && os.isIOS()) {\n unlockScroll();\n }\n\n if (onClose) {\n onClose(event, reason);\n }\n\n if (reason === 'backdropClick' && onBackdropClick) {\n onBackdropClick(event as MouseEvent);\n }\n\n if (reason === 'escapeKeyDown' && onEscapeKeyDown) {\n onEscapeKeyDown(event as KeyboardEvent);\n }\n\n return null;\n },\n [onBackdropClick, onClose, onEscapeKeyDown, iOSLock],\n );\n\n const handleBackdropMouseDown = (event: MouseEvent<HTMLElement>) => {\n let clickedOnScrollbar = false;\n const clientWidth = (event.target as HTMLElement)?.clientWidth;\n\n if (event.clientX && clientWidth) {\n // Устанавливаем смещение для абсолютно спозиционированного скроллбара в OSX в 17px.\n const offset = browser.getScrollbarSize() === 0 ? 17 : 0;\n\n clickedOnScrollbar = event.clientX + offset > clientWidth;\n }\n\n if (!disableBackdropClick && !clickedOnScrollbar) {\n mouseDownTarget.current = event.target as HTMLElement;\n }\n };\n\n const handleBackdropMouseUp = (event: MouseEvent<HTMLElement>) => {\n if (\n !disableBackdropClick &&\n event.target === wrapperRef.current &&\n mouseDownTarget.current === wrapperRef.current\n ) {\n handleClose(event, 'backdropClick');\n }\n\n mouseDownTarget.current = undefined;\n };\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n /*\n * Чтобы сохранить дефолтное поведение элементов и событий форм,\n * обработчик не устанавливает event.preventDefault()\n */\n if (event.key !== 'Escape') {\n return;\n }\n\n // Если есть обработчик escape на body\n event.stopPropagation();\n\n if (!disableEscapeKeyDown && handleClose) {\n handleClose(event, 'escapeKeyDown');\n }\n },\n [disableEscapeKeyDown, handleClose],\n );\n\n const getScrollHandler = useCallback(() => {\n if (scrollHandler === 'wrapper') return wrapperRef.current;\n if (scrollHandler === 'content') return componentNodeRef.current;\n\n return scrollHandler.current || wrapperRef.current;\n }, [scrollHandler]);\n\n const handleEntered: Required<TransitionProps>['onEntered'] = useCallback(\n (node, isAppearing) => {\n scrollableNodeRef.current = getScrollHandler();\n\n addResizeHandle();\n\n if (scrollableNodeRef.current) {\n scrollableNodeRef.current.addEventListener('scroll', handleScroll);\n handleScroll();\n }\n\n if (transitionProps.onEntered) {\n transitionProps.onEntered(node, isAppearing);\n }\n\n if (onMount) onMount();\n },\n [addResizeHandle, getScrollHandler, handleScroll, onMount, transitionProps],\n );\n\n const handleExited: Required<TransitionProps>['onExited'] = useCallback(\n (node) => {\n removeResizeHandle();\n\n setExited(true);\n\n if (scrollableNodeRef.current) {\n scrollableNodeRef.current.removeEventListener('scroll', handleScroll);\n }\n\n if (transitionProps.onExited) {\n transitionProps.onExited(node);\n }\n\n if (onUnmount) onUnmount();\n\n if (restoreContainerStylesRef.current) {\n restoreContainerStylesRef.current();\n }\n },\n [handleScroll, onUnmount, removeResizeHandle, transitionProps],\n );\n\n useEffect(() => {\n if (open && isExited) {\n if (!disableBlockingScroll) {\n const el = getContainer();\n\n const shouldIOSLock = iOSLock && os.isIOS();\n\n handleContainer(el, shouldIOSLock);\n if (shouldIOSLock) {\n syncHeight();\n lockScroll();\n }\n\n restoreContainerStylesRef.current = () => {\n restoreContainerStylesRef.current = null;\n restoreContainerStyles(el);\n };\n }\n\n setExited(false);\n }\n\n if (!open) {\n unlockScroll();\n }\n }, [getContainer, open, disableBlockingScroll, isExited, iOSLock]);\n\n useEffect(() => {\n const ResizeObserver = window.ResizeObserver || ResizeObserverPolyfill;\n\n resizeObserverRef.current = new ResizeObserver(checkToHasScrollBar);\n\n return () => {\n if (restoreContainerStylesRef.current) {\n restoreContainerStylesRef.current();\n }\n\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n }\n };\n }, []);\n\n useEffect(() => {\n if (disableAutoFocus || !open) return;\n\n wrapperRef.current?.focus();\n }, [open, disableAutoFocus]);\n\n const contextValue = useMemo<BaseModalContext>(\n () => ({\n parentRef: wrapperRef,\n componentRef: componentNodeRef,\n hasHeader,\n hasFooter,\n hasScroll,\n headerHighlighted,\n footerHighlighted,\n headerOffset,\n setHeaderOffset,\n contentRef,\n setHasHeader,\n setHasFooter,\n onClose: handleClose,\n }),\n [\n contentRef,\n hasHeader,\n hasFooter,\n hasScroll,\n headerHighlighted,\n footerHighlighted,\n headerOffset,\n setHeaderOffset,\n handleClose,\n ],\n );\n\n const renderContent = () => (\n <Stack value={zIndex}>\n {(computedZIndex) => (\n <BaseModalContext.Provider value={contextValue}>\n <FocusLock\n disabled={disableFocusLock || !open}\n returnFocus={!disableRestoreFocus}\n >\n {Backdrop && (\n <Backdrop\n {...backdropProps}\n className={cn(backdropProps.className, styles.backdrop)}\n open={open}\n style={{\n zIndex: computedZIndex,\n }}\n />\n )}\n <div\n {...wrapperProps}\n role='dialog'\n className={cn(\n styles.wrapper,\n wrapperClassName,\n wrapperProps?.className,\n {\n [styles.hidden]: !open && isExited,\n },\n )}\n ref={mergeRefs([\n ref,\n wrapperRef,\n wrapperProps?.ref as Ref<HTMLDivElement>,\n ])}\n onKeyDown={handleKeyDown}\n onMouseDown={handleBackdropMouseDown}\n onMouseUp={handleBackdropMouseUp}\n onWheel={onWheel}\n tabIndex={-1}\n data-test-id={dataTestId}\n style={{\n zIndex: computedZIndex,\n }}\n >\n <CSSTransition\n appear={true}\n timeout={200}\n classNames={styles}\n nodeRef={componentNodeRef}\n {...transitionProps}\n in={open}\n onEntered={handleEntered}\n onExited={handleExited}\n >\n <div\n {...componentDivProps}\n className={cn(\n styles.component,\n className,\n componentDivProps?.className,\n )}\n ref={mergeRefs([\n componentRef,\n componentNodeRef,\n componentDivProps?.ref || null,\n ])}\n >\n <div\n {...contentProps}\n className={cn(\n styles.content,\n contentClassName,\n contentProps?.className,\n {\n [styles.hasFooter]: hasFooter,\n [styles.hasHeader]: hasHeader,\n },\n )}\n ref={contentElementRef}\n >\n {children}\n </div>\n </div>\n </CSSTransition>\n </div>\n </FocusLock>\n </BaseModalContext.Provider>\n )}\n </Stack>\n );\n\n if (!shouldRender) return null;\n\n return usePortal ? (\n <Portal getPortalContainer={container} immediateMount={true}>\n {renderContent()}\n </Portal>\n ) : (\n renderContent()\n );\n },\n);\n\nBaseModal.displayName = 'BaseModal';\nBaseModalContext.displayName = 'BaseModalContext';\n"],"names":["Backdrop","DefaultBackdrop","ResizeObserver","ResizeObserverPolyfill"],"mappings":";;;;;;;;;;;;;;;;;AA+OA;AACa,IAAA,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAmB;AAClE,IAAA,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;AAC5B,IAAA,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;AAC/B,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,iBAAiB,EAAE,KAAK;AACxB,IAAA,iBAAiB,EAAE,KAAK;AACxB,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,eAAe,EAAE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AAS,EAChB,SAAS,EACT,iBAAiB,KAAjB,IAAA,IAAA,iBAAiB,KAAjB,MAAA,GAAA,MAAA,GAAA,iBAAiB,CAAE,SAAS,CAC/B,EACD,GAAG,EAAE,SAAS,CAAC;gCACX,YAAY;gCACZ,gBAAgB;gCAChB,CAAA,iBAAiB,aAAjB,iBAAiB,KAAA,MAAA,GAAA,MAAA,GAAjB,iBAAiB,CAAE,GAAG,KAAI,IAAI;6BACjC,CAAC,EAAA,CAAA;AAEF,4BAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,QAAA,CAAA,EAAA,EACQ,YAAY,EAChB,EAAA,SAAS,EAAE,EAAE,CACT,MAAM,CAAC,OAAO,EACd,gBAAgB,EAChB,YAAY,KAAA,IAAA,IAAZ,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,SAAS,GAAA,EAAA,GAAA,EAAA;AAEnB,oCAAA,EAAA,CAAC,MAAM,CAAC,SAAS,CAAA,GAAG,SAAS;AAC7B,oCAAA,EAAA,CAAC,MAAM,CAAC,SAAS,CAAA,GAAG,SAAS;wCAEpC,EACD,GAAG,EAAE,iBAAiB,EAErB,CAAA,EAAA,QAAQ,CACP,CACJ,CACM,CACd,CACE,CACY;AApFX,KAqFpB,CACG,EAxFgB,EAyF3B;AAED,IAAA,IAAI,CAAC,YAAY;AAAE,QAAA,OAAO,IAAI;IAE9B,OAAO,SAAS,IACZ,KAAC,CAAA,aAAA,CAAA,MAAM,EAAC,EAAA,kBAAkB,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EACtD,EAAA,aAAa,EAAE,CACX,KAET,aAAa,EAAE,CAClB;AACL,CAAC;AAGL,SAAS,CAAC,WAAW,GAAG,WAAW;AACnC,gBAAgB,CAAC,WAAW,GAAG,kBAAkB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lockScroll.js","sources":["../../../src/helpers/lockScroll.ts"],"sourcesContent":["/**\n * Хелпер для блокирования скроллинга в iOS\n * В проекте используется overflow: hidden для блокировки, но в некоторых случаях этого недостаточно. Данный хелпер призван решать эту проблему\n */\n\nlet scrollY: number;\n\nexport const isScrollLocked = () => document.body.classList.contains('is-locked');\n\nexport const lockScroll = () => {\n scrollY = window.scrollY;\n document.body.classList.add('is-locked');\n};\n\nexport const unlockScroll = () => {\n if (!isScrollLocked()) return;\n\n document.body.classList.remove('is-locked');\n window.scrollTo(0, scrollY);\n};\n\nexport const syncHeight = () => {\n document.body.style.setProperty('--window-inner-scrollY', `${window.scrollY}px`);\n};\n"],"names":[],"mappings":"AAAA;;;AAGG;AAEH,IAAI,OAAe;AAEN,IAAA,cAAc,GAAG,YAAM,EAAA,OAAA,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;AAEpE,IAAA,UAAU,GAAG,YAAA;AACtB,IAAA,OAAO,GAAG,MAAM,CAAC,OAAO;IACxB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC;AAC5C;AAEa,IAAA,YAAY,GAAG,YAAA;IACxB,IAAI,CAAC,cAAc,EAAE;QAAE;IAEvB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC;AAC3C,IAAA,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;AAC/B;AAEa,IAAA,UAAU,GAAG,YAAA;AACtB,IAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,wBAAwB,EAAE,UAAG,MAAM,CAAC,OAAO,EAAA,IAAA,CAAI,CAAC;AACpF;;;;"}
|
package/esm/index.css
CHANGED
|
@@ -1,41 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
:
|
|
3
|
-
} /* deprecated */ :root {
|
|
4
|
-
--color-light-modal-bg-primary: #fff; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
5
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
6
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
1
|
+
:root {
|
|
2
|
+
--color-light-modal-bg-primary: #fff;
|
|
7
3
|
} :root {
|
|
8
|
-
|
|
9
|
-
/* Hard */
|
|
10
|
-
|
|
11
|
-
/* Up */
|
|
12
|
-
|
|
13
|
-
/* Hard up */
|
|
14
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
15
|
-
|
|
16
|
-
/* новые значения, используйте их */
|
|
17
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
18
|
-
|
|
19
|
-
/* новые значения, используйте их */
|
|
20
|
-
|
|
21
|
-
/* no-unit может приводить к проблемам в calc (#1559) */
|
|
22
|
-
/* stylelint-disable-next-line length-zero-no-unit */
|
|
23
4
|
--gap-0: 0px;
|
|
24
5
|
} :root {
|
|
25
|
-
|
|
26
|
-
} /* сбрасывает синюю подсветку при нажатии */ :root {
|
|
27
|
-
--window-inner-scrollY: 10px; /* fallback value to prevent ci error */
|
|
6
|
+
--window-inner-scrollY: 10px;
|
|
28
7
|
} body.is-locked {
|
|
29
8
|
margin-top: calc(var(--window-inner-scrollY) * -1);
|
|
30
9
|
position: fixed;
|
|
31
10
|
overflow: hidden;
|
|
32
|
-
} .base-
|
|
11
|
+
} .base-modal__component_1000t {
|
|
33
12
|
position: relative;
|
|
34
13
|
box-sizing: border-box;
|
|
35
14
|
background: var(--color-light-modal-bg-primary);
|
|
36
15
|
margin: auto;
|
|
37
16
|
flex-shrink: 0;
|
|
38
|
-
} .base-
|
|
17
|
+
} .base-modal__wrapper_1000t {
|
|
39
18
|
position: fixed;
|
|
40
19
|
top: var(--gap-0);
|
|
41
20
|
left: var(--gap-0);
|
|
@@ -48,33 +27,33 @@
|
|
|
48
27
|
align-items: center;
|
|
49
28
|
outline: 0;
|
|
50
29
|
overscroll-behavior: none;
|
|
51
|
-
} .base-
|
|
30
|
+
} .base-modal__content_1000t {
|
|
52
31
|
width: 100%;
|
|
53
32
|
height: 100%;
|
|
54
33
|
display: flex;
|
|
55
34
|
flex-direction: column;
|
|
56
35
|
flex: 1
|
|
57
|
-
} @media (display-mode: standalone) { .base-
|
|
36
|
+
} @media (display-mode: standalone) { .base-modal__content_1000t.base-modal__hasFooter_1000t {
|
|
58
37
|
padding-bottom: unset
|
|
59
38
|
}
|
|
60
|
-
} @media (display-mode: standalone) { .base-
|
|
39
|
+
} @media (display-mode: standalone) { .base-modal__content_1000t.base-modal__hasHeader_1000t {
|
|
61
40
|
padding-top: unset
|
|
62
41
|
}
|
|
63
|
-
} .base-
|
|
42
|
+
} .base-modal__hidden_1000t {
|
|
64
43
|
display: none;
|
|
65
|
-
} .base-
|
|
44
|
+
} .base-modal__backdrop_1000t {
|
|
66
45
|
z-index: 0;
|
|
67
|
-
} .base-
|
|
68
|
-
.base-
|
|
46
|
+
} .base-modal__appear_1000t,
|
|
47
|
+
.base-modal__enter_1000t {
|
|
69
48
|
opacity: 0;
|
|
70
|
-
} .base-
|
|
71
|
-
.base-
|
|
49
|
+
} .base-modal__appearActive_1000t,
|
|
50
|
+
.base-modal__enterActive_1000t {
|
|
72
51
|
opacity: 1;
|
|
73
52
|
transition: opacity 200ms ease-in;
|
|
74
|
-
} .base-
|
|
53
|
+
} .base-modal__exit_1000t {
|
|
75
54
|
opacity: 1;
|
|
76
|
-
} .base-
|
|
77
|
-
.base-
|
|
55
|
+
} .base-modal__exitActive_1000t,
|
|
56
|
+
.base-modal__exitDone_1000t {
|
|
78
57
|
opacity: 0;
|
|
79
58
|
transition: opacity 200ms ease-out;
|
|
80
59
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { BaseModal, BaseModalContext } from './Component.js';
|
|
2
2
|
export { handleContainer, hasScrollbar, isScrolledToBottom, isScrolledToTop, restoreContainerStyles } from './utils.js';
|
|
3
3
|
export { isScrollLocked, lockScroll, syncHeight, unlockScroll } from './helpers/lockScroll.js';
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
|
|
3
|
+
var styles = {"component":"base-modal__component_1000t","wrapper":"base-modal__wrapper_1000t","content":"base-modal__content_1000t","hasFooter":"base-modal__hasFooter_1000t","hasHeader":"base-modal__hasHeader_1000t","hidden":"base-modal__hidden_1000t","backdrop":"base-modal__backdrop_1000t","appear":"base-modal__appear_1000t","enter":"base-modal__enter_1000t","appearActive":"base-modal__appearActive_1000t","enterActive":"base-modal__enterActive_1000t","exit":"base-modal__exit_1000t","exitActive":"base-modal__exitActive_1000t","exitDone":"base-modal__exitDone_1000t"};
|
|
4
|
+
|
|
5
|
+
export { styles as default };
|
|
6
|
+
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '../../vars/src/index.css';\n\n:root {\n --window-inner-scrollY: 10px; /* fallback value to prevent ci error */\n}\n\nbody:global(.is-locked) {\n margin-top: calc(var(--window-inner-scrollY) * -1);\n position: fixed;\n overflow: hidden;\n}\n\n.component {\n position: relative;\n box-sizing: border-box;\n background: var(--color-light-modal-bg-primary);\n margin: auto;\n flex-shrink: 0;\n}\n\n.wrapper {\n position: fixed;\n top: var(--gap-0);\n left: var(--gap-0);\n right: var(--gap-0);\n bottom: var(--gap-0);\n\n overflow: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n outline: 0;\n overscroll-behavior: none;\n}\n\n.content {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n flex: 1;\n\n &.hasFooter {\n @media (display-mode: standalone) {\n padding-bottom: unset;\n }\n }\n\n &.hasHeader {\n @media (display-mode: standalone) {\n padding-top: unset;\n }\n }\n}\n\n.hidden {\n display: none;\n}\n\n.backdrop {\n z-index: 0;\n}\n\n.appear,\n.enter {\n opacity: 0;\n}\n\n.appearActive,\n.enterActive {\n opacity: 1;\n transition: opacity 200ms ease-in;\n}\n\n.exit {\n opacity: 1;\n}\n\n.exitActive,\n.exitDone {\n opacity: 0;\n transition: opacity 200ms ease-out;\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,WAAW,CAAC,6BAA6B,CAAC,SAAS,CAAC,2BAA2B,CAAC,SAAS,CAAC,2BAA2B,CAAC,WAAW,CAAC,6BAA6B,CAAC,WAAW,CAAC,6BAA6B,CAAC,QAAQ,CAAC,0BAA0B,CAAC,UAAU,CAAC,4BAA4B,CAAC,QAAQ,CAAC,0BAA0B,CAAC,OAAO,CAAC,yBAAyB,CAAC,cAAc,CAAC,gCAAgC,CAAC,aAAa,CAAC,+BAA+B,CAAC,MAAM,CAAC,wBAAwB,CAAC,YAAY,CAAC,8BAA8B,CAAC,UAAU,CAAC,4BAA4B,CAAC;;;;"}
|
package/esm/matches-polyfill.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matches-polyfill.js","sources":["../../src/matches-polyfill.ts"],"sourcesContent":["/* eslint-disable */\n// @ts-nocheck\n\nif (typeof window !== 'undefined') {\n if (Element && !Element.prototype.matches) {\n Element.prototype.matches =\n Element.prototype.matchesSelector ||\n Element.prototype.mozMatchesSelector ||\n Element.prototype.msMatchesSelector ||\n Element.prototype.oMatchesSelector ||\n Element.prototype.webkitMatchesSelector ||\n function (s) {\n const matches = (this.document || this.ownerDocument).querySelectorAll(s);\n let i = matches.length;\n while (--i >= 0 && matches.item(i) !== this) {}\n return i > -1;\n };\n }\n}\n"],"names":[],"mappings":"AAAA;AACA;AAEA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAC/B,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE;QACvC,OAAO,CAAC,SAAS,CAAC,OAAO;YACrB,OAAO,CAAC,SAAS,CAAC,eAAe;gBACjC,OAAO,CAAC,SAAS,CAAC,kBAAkB;gBACpC,OAAO,CAAC,SAAS,CAAC,iBAAiB;gBACnC,OAAO,CAAC,SAAS,CAAC,gBAAgB;gBAClC,OAAO,CAAC,SAAS,CAAC,qBAAqB;AACvC,gBAAA,UAAU,CAAC,EAAA;AACP,oBAAA,IAAM,OAAO,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC,CAAC;AACzE,oBAAA,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM;AACtB,oBAAA,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;AAC7C,oBAAA,OAAO,CAAC,GAAG,EAAE;AACjB,iBAAC;AACR;AACJ"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="react-transition-group" />
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { ComponentType, KeyboardEvent, MouseEvent, MutableRefObject, ReactNode, Ref, WheelEvent } from "react";
|
|
1
|
+
import React, { ComponentType, KeyboardEvent, MouseEvent, MutableRefObject, ReactNode, Ref, WheelEvent } from 'react';
|
|
5
2
|
import { TransitionProps } from 'react-transition-group/Transition';
|
|
6
|
-
import { BackdropProps } from
|
|
7
|
-
import { PortalProps } from
|
|
8
|
-
|
|
3
|
+
import { BackdropProps } from '@alfalab/core-components-backdrop';
|
|
4
|
+
import { PortalProps } from '@alfalab/core-components-portal';
|
|
5
|
+
import './matches-polyfill';
|
|
6
|
+
export declare type BaseModalProps = {
|
|
9
7
|
/**
|
|
10
8
|
* Контент
|
|
11
9
|
*/
|
|
@@ -147,7 +145,7 @@ type BaseModalProps = {
|
|
|
147
145
|
*/
|
|
148
146
|
onWheel?: (e: WheelEvent<HTMLElement>) => void;
|
|
149
147
|
};
|
|
150
|
-
type BaseModalContext = {
|
|
148
|
+
export declare type BaseModalContext = {
|
|
151
149
|
parentRef: React.RefObject<HTMLDivElement>;
|
|
152
150
|
componentRef: React.RefObject<HTMLDivElement>;
|
|
153
151
|
hasFooter?: boolean;
|
|
@@ -162,6 +160,5 @@ type BaseModalContext = {
|
|
|
162
160
|
setHasFooter: (exists: boolean) => void;
|
|
163
161
|
onClose: Required<BaseModalProps>['onClose'];
|
|
164
162
|
};
|
|
165
|
-
declare const BaseModalContext: React.Context<BaseModalContext>;
|
|
166
|
-
declare const BaseModal: React.ForwardRefExoticComponent<BaseModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
167
|
-
export { BaseModalProps, BaseModalContext, BaseModal };
|
|
163
|
+
export declare const BaseModalContext: React.Context<BaseModalContext>;
|
|
164
|
+
export declare const BaseModal: React.ForwardRefExoticComponent<BaseModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Хелпер для блокирования скроллинга в iOS
|
|
3
|
+
* В проекте используется overflow: hidden для блокировки, но в некоторых случаях этого недостаточно. Данный хелпер призван решать эту проблему
|
|
4
|
+
*/
|
|
5
|
+
export declare const isScrollLocked: () => boolean;
|
|
6
|
+
export declare const lockScroll: () => void;
|
|
7
|
+
export declare const unlockScroll: () => void;
|
|
8
|
+
export declare const syncHeight: () => void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function isScrolledToTop(target: HTMLElement): boolean;
|
|
2
|
+
export declare function isScrolledToBottom(target: HTMLElement): boolean;
|
|
3
|
+
export declare function hasScrollbar(target: HTMLElement): boolean;
|
|
4
|
+
export declare const restoreContainerStyles: (container: HTMLElement) => void;
|
|
5
|
+
export declare const handleContainer: (container?: HTMLElement, shouldIOSLock?: boolean) => void;
|
package/esm/utils.js
CHANGED
package/esm/utils.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/utils.ts"],"sourcesContent":["import { getModalStore, SavedStyle } from '@alfalab/core-components-global-store';\nimport { browser } from '@alfalab/core-components-shared';\n\nexport function isScrolledToTop(target: HTMLElement) {\n return target.scrollTop <= 0;\n}\n\nexport function isScrolledToBottom(target: HTMLElement) {\n return target.scrollHeight - target.offsetHeight <= target.scrollTop;\n}\n\nexport function hasScrollbar(target: HTMLElement) {\n return target.scrollHeight > target.clientHeight;\n}\n\nconst isOverflowing = (container: Element) => {\n if (document.body === container) {\n return window.innerWidth > document.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n};\n\nconst getPaddingRight = (node: Element) =>\n parseInt(window.getComputedStyle(node).paddingRight, 10) || 0;\n\nexport const restoreContainerStyles = (container: HTMLElement) => {\n const modalRestoreStyles = getModalStore().getRestoreStyles();\n\n const index = modalRestoreStyles.findIndex((s) => s.container === container);\n const existingStyles = modalRestoreStyles[index];\n\n if (!existingStyles) return;\n\n existingStyles.modals -= 1;\n\n if (existingStyles.modals <= 0) {\n modalRestoreStyles.splice(index, 1);\n\n existingStyles.styles.forEach(({ value, el, key }) => {\n if (value) {\n el.style.setProperty(key, value);\n } else {\n el.style.removeProperty(key);\n }\n });\n }\n};\n\nexport const handleContainer = (container?: HTMLElement, shouldIOSLock = false) => {\n if (!container) return;\n\n const modalRestoreStyles = getModalStore().getRestoreStyles();\n\n const existingStyles = modalRestoreStyles.find((s) => s.container === container);\n\n if (existingStyles) {\n existingStyles.modals += 1;\n\n return;\n }\n\n const containerStyles: SavedStyle[] = [];\n\n if (isOverflowing(container)) {\n // Вычисляет размер до применения `overflow hidden` для избежания скачков\n const scrollbarSize = browser.getScrollbarSize();\n\n containerStyles.push({\n value: container.style.paddingRight,\n key: 'padding-right',\n el: container,\n });\n // Вычисляем стили, чтобы получить реальный `padding` c шириной сколлбара\n // eslint-disable-next-line no-param-reassign\n container.style.paddingRight = `${getPaddingRight(container) + scrollbarSize}px`;\n }\n\n const parent = container.parentElement;\n const scrollContainer =\n // TODO: заменить на optional chaining\n parent &&\n parent.nodeName === 'HTML' &&\n window.getComputedStyle(parent).overflowY === 'scroll'\n ? parent\n : container;\n\n // Блокируем скролл даже если отсутствует скроллбар\n if (scrollContainer.style.overflow !== 'hidden') {\n containerStyles.push({\n value: scrollContainer.style.overflow,\n key: 'overflow',\n el: scrollContainer,\n });\n }\n\n if (!shouldIOSLock) {\n scrollContainer.style.overflow = 'hidden';\n }\n\n modalRestoreStyles.push({\n container,\n modals: 1,\n styles: containerStyles,\n });\n};\n"],"names":[],"mappings":";;;AAGM,SAAU,eAAe,CAAC,MAAmB,EAAA;AAC/C,IAAA,OAAO,MAAM,CAAC,SAAS,IAAI,CAAC;AAChC;AAEM,SAAU,kBAAkB,CAAC,MAAmB,EAAA;IAClD,OAAO,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,SAAS;AACxE;AAEM,SAAU,YAAY,CAAC,MAAmB,EAAA;AAC5C,IAAA,OAAO,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY;AACpD;AAEA,IAAM,aAAa,GAAG,UAAC,SAAkB,EAAA;AACrC,IAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE;QAC7B,OAAO,MAAM,CAAC,UAAU,GAAG,QAAQ,CAAC,eAAe,CAAC,WAAW;AAClE;AAED,IAAA,OAAO,SAAS,CAAC,YAAY,GAAG,SAAS,CAAC,YAAY;AAC1D,CAAC;AAED,IAAM,eAAe,GAAG,UAAC,IAAa,EAAA;AAClC,IAAA,OAAA,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,C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ACT,QAAA,MAAM,EAAE,eAAe;AAC1B,KAAA,CAAC;AACN;;;;"}
|
package/helpers/lockScroll.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lockScroll.js","sources":["../../src/helpers/lockScroll.ts"],"sourcesContent":["/**\n * Хелпер для блокирования скроллинга в iOS\n * В проекте используется overflow: hidden для блокировки, но в некоторых случаях этого недостаточно. Данный хелпер призван решать эту проблему\n */\n\nlet scrollY: number;\n\nexport const isScrollLocked = () => document.body.classList.contains('is-locked');\n\nexport const lockScroll = () => {\n scrollY = window.scrollY;\n document.body.classList.add('is-locked');\n};\n\nexport const unlockScroll = () => {\n if (!isScrollLocked()) return;\n\n document.body.classList.remove('is-locked');\n window.scrollTo(0, scrollY);\n};\n\nexport const syncHeight = () => {\n document.body.style.setProperty('--window-inner-scrollY', `${window.scrollY}px`);\n};\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;AAEH,IAAI,OAAe;AAEN,IAAA,cAAc,GAAG,YAAM,EAAA,OAAA,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;AAEpE,IAAA,UAAU,GAAG,YAAA;AACtB,IAAA,OAAO,GAAG,MAAM,CAAC,OAAO;IACxB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC;AAC5C;AAEa,IAAA,YAAY,GAAG,YAAA;IACxB,IAAI,CAAC,cAAc,EAAE;QAAE;IAEvB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC;AAC3C,IAAA,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;AAC/B;AAEa,IAAA,UAAU,GAAG,YAAA;AACtB,IAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,wBAAwB,EAAE,UAAG,MAAM,CAAC,OAAO,EAAA,IAAA,CAAI,CAAC;AACpF;;;;;;;"}
|
package/index.css
CHANGED
|
@@ -1,41 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
:
|
|
3
|
-
} /* deprecated */ :root {
|
|
4
|
-
--color-light-modal-bg-primary: #fff; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
5
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
6
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
1
|
+
:root {
|
|
2
|
+
--color-light-modal-bg-primary: #fff;
|
|
7
3
|
} :root {
|
|
8
|
-
|
|
9
|
-
/* Hard */
|
|
10
|
-
|
|
11
|
-
/* Up */
|
|
12
|
-
|
|
13
|
-
/* Hard up */
|
|
14
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
15
|
-
|
|
16
|
-
/* новые значения, используйте их */
|
|
17
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
18
|
-
|
|
19
|
-
/* новые значения, используйте их */
|
|
20
|
-
|
|
21
|
-
/* no-unit может приводить к проблемам в calc (#1559) */
|
|
22
|
-
/* stylelint-disable-next-line length-zero-no-unit */
|
|
23
4
|
--gap-0: 0px;
|
|
24
5
|
} :root {
|
|
25
|
-
|
|
26
|
-
} /* сбрасывает синюю подсветку при нажатии */ :root {
|
|
27
|
-
--window-inner-scrollY: 10px; /* fallback value to prevent ci error */
|
|
6
|
+
--window-inner-scrollY: 10px;
|
|
28
7
|
} body.is-locked {
|
|
29
8
|
margin-top: calc(var(--window-inner-scrollY) * -1);
|
|
30
9
|
position: fixed;
|
|
31
10
|
overflow: hidden;
|
|
32
|
-
} .base-
|
|
11
|
+
} .base-modal__component_1000t {
|
|
33
12
|
position: relative;
|
|
34
13
|
box-sizing: border-box;
|
|
35
14
|
background: var(--color-light-modal-bg-primary);
|
|
36
15
|
margin: auto;
|
|
37
16
|
flex-shrink: 0;
|
|
38
|
-
} .base-
|
|
17
|
+
} .base-modal__wrapper_1000t {
|
|
39
18
|
position: fixed;
|
|
40
19
|
top: var(--gap-0);
|
|
41
20
|
left: var(--gap-0);
|
|
@@ -48,33 +27,33 @@
|
|
|
48
27
|
align-items: center;
|
|
49
28
|
outline: 0;
|
|
50
29
|
overscroll-behavior: none;
|
|
51
|
-
} .base-
|
|
30
|
+
} .base-modal__content_1000t {
|
|
52
31
|
width: 100%;
|
|
53
32
|
height: 100%;
|
|
54
33
|
display: flex;
|
|
55
34
|
flex-direction: column;
|
|
56
35
|
flex: 1
|
|
57
|
-
} @media (display-mode: standalone) { .base-
|
|
36
|
+
} @media (display-mode: standalone) { .base-modal__content_1000t.base-modal__hasFooter_1000t {
|
|
58
37
|
padding-bottom: unset
|
|
59
38
|
}
|
|
60
|
-
} @media (display-mode: standalone) { .base-
|
|
39
|
+
} @media (display-mode: standalone) { .base-modal__content_1000t.base-modal__hasHeader_1000t {
|
|
61
40
|
padding-top: unset
|
|
62
41
|
}
|
|
63
|
-
} .base-
|
|
42
|
+
} .base-modal__hidden_1000t {
|
|
64
43
|
display: none;
|
|
65
|
-
} .base-
|
|
44
|
+
} .base-modal__backdrop_1000t {
|
|
66
45
|
z-index: 0;
|
|
67
|
-
} .base-
|
|
68
|
-
.base-
|
|
46
|
+
} .base-modal__appear_1000t,
|
|
47
|
+
.base-modal__enter_1000t {
|
|
69
48
|
opacity: 0;
|
|
70
|
-
} .base-
|
|
71
|
-
.base-
|
|
49
|
+
} .base-modal__appearActive_1000t,
|
|
50
|
+
.base-modal__enterActive_1000t {
|
|
72
51
|
opacity: 1;
|
|
73
52
|
transition: opacity 200ms ease-in;
|
|
74
|
-
} .base-
|
|
53
|
+
} .base-modal__exit_1000t {
|
|
75
54
|
opacity: 1;
|
|
76
|
-
} .base-
|
|
77
|
-
.base-
|
|
55
|
+
} .base-modal__exitActive_1000t,
|
|
56
|
+
.base-modal__exitDone_1000t {
|
|
78
57
|
opacity: 0;
|
|
79
58
|
transition: opacity 200ms ease-out;
|
|
80
59
|
}
|
package/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var Component = require('./Component.js');
|
|
6
6
|
var utils = require('./utils.js');
|
|
7
|
-
var
|
|
7
|
+
var lockScroll = require('./helpers/lockScroll.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -15,7 +15,8 @@ exports.hasScrollbar = utils.hasScrollbar;
|
|
|
15
15
|
exports.isScrolledToBottom = utils.isScrolledToBottom;
|
|
16
16
|
exports.isScrolledToTop = utils.isScrolledToTop;
|
|
17
17
|
exports.restoreContainerStyles = utils.restoreContainerStyles;
|
|
18
|
-
exports.isScrollLocked =
|
|
19
|
-
exports.lockScroll =
|
|
20
|
-
exports.syncHeight =
|
|
21
|
-
exports.unlockScroll =
|
|
18
|
+
exports.isScrollLocked = lockScroll.isScrollLocked;
|
|
19
|
+
exports.lockScroll = lockScroll.lockScroll;
|
|
20
|
+
exports.syncHeight = lockScroll.syncHeight;
|
|
21
|
+
exports.unlockScroll = lockScroll.unlockScroll;
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|