@foxford/ui 2.92.0 → 2.93.0-beta-6c8d356-20260130
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/components/Dialog/Dialog.js +1 -1
- package/components/Dialog/Dialog.js.map +1 -1
- package/components/Dialog/Dialog.mjs +1 -1
- package/components/Dialog/Dialog.mjs.map +1 -1
- package/dts/index.d.ts +28 -9
- package/hooks/useScrollLock.js +2 -0
- package/hooks/useScrollLock.js.map +1 -0
- package/hooks/useScrollLock.mjs +2 -0
- package/hooks/useScrollLock.mjs.map +1 -0
- package/icon-pack/src/collection.json.js +1 -1
- package/icon-pack/src/collection.json.mjs +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var ReactModal=require('react-modal');var withMergedProps=require('../../hocs/withMergedProps.js');var withTranslation=require('../../hocs/withTranslation.js');var misc=require('../../shared/utils/misc.js');var sizes=require('./sizes.js');var positions=require('./positions.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var DialogComponent=require('../DialogComponent/DialogComponent.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ReactModal__default=_interopDefault(ReactModal);const TranslationDialogComponent=withTranslation.withTranslation(React.forwardRef(((e,o)=>{const{positions:s={},translated:n,...
|
|
1
|
+
'use strict';var React=require('react');var ReactModal=require('react-modal');var withMergedProps=require('../../hocs/withMergedProps.js');var withTranslation=require('../../hocs/withTranslation.js');var misc=require('../../shared/utils/misc.js');var useScrollLock=require('../../hooks/useScrollLock.js');var sizes=require('./sizes.js');var positions=require('./positions.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var DialogComponent=require('../DialogComponent/DialogComponent.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ReactModal__default=_interopDefault(ReactModal);const TranslationDialogComponent=withTranslation.withTranslation(React.forwardRef(((e,o)=>{const{positions:s={},translated:n,...l}=e;const r=n?{}:misc.deepmerge(positions.POSITIONS,s);return jsxRuntime.jsx(style.PositionedDialogComponent,{...l,positions:r,ref:o})})));const Dialog=Object.assign(withMergedProps.withMergedProps((e=>{const{size:o="s",position:s="center",role:n="dialog",open:l,preventScrollAfterClose:r,closeTimeoutMS:a,portalClassName:t,className:i,bodyOpenClassName:c,htmlOpenClassName:u,overlayClassName:p,shouldCloseOnOverlayClick:d,shouldCloseOnEsc:C,shouldReturnFocusAfterClose:m,parentSelector:g,overlayRef:D,contentRef:f,palette:v,overlayBlur:h,overlayDisabled:y,zIndex:M,scrollLock:w,onAfterOpen:N,onAfterClose:R,onRequestClose:j,...k}=e;const O=k.draggable||y;return useScrollLock.useScrollLock(w||{locked:!1}),jsxRuntime.jsx(ReactModal__default.default,{isOpen:l,ariaHideApp:!1,preventScroll:r,closeTimeoutMS:a,portalClassName:t,className:i,bodyOpenClassName:c,htmlOpenClassName:u,overlayClassName:p,shouldCloseOnOverlayClick:d,shouldCloseOnEsc:C,shouldReturnFocusAfterClose:m,parentSelector:g,overlayRef:D,contentRef:f,onAfterOpen:N,onAfterClose:R,onRequestClose:j,contentElement:e=>{const{ref:l,className:r,tabIndex:a,onKeyDown:t,onMouseDown:i,onMouseUp:c,onClick:u}=e;return jsxRuntime.jsx(TranslationDialogComponent,{...k,ref:l,size:o,role:n,className:r,tabIndex:a,position:s,"aria-modal":!k.draggable&&!y,palette:{color:v.color,backgroundColor:v.backgroundColor,shadowColor:v.shadowColor},zIndex:O?M:void 0,onKeyDown:e=>{k.onKeyDown&&k.onKeyDown(e),t&&t(e)},onMouseDown:e=>{k.onMouseDown&&k.onMouseDown(e),i&&i(e)},onMouseUp:e=>{k.onMouseUp&&k.onMouseUp(e),c&&c(e)},onClick:e=>{k.onClick&&k.onClick(e),u&&u(e)}})},overlayElement:(e,o)=>{const{ref:s,className:n,onClick:l,onMouseDown:r}=e;return O?o:jsxRuntime.jsx(style.DialogOverlay,{ref:s,className:n,blur:h,palette:{backgroundColor:v.overlayBackgroundColor},zIndex:M,onClick:l,onMouseDown:r,children:o})}})}),{sizes:e=>e.fancy?sizes.SIZES_FANCY:sizes.SIZES,displayName:"Dialog"}),{Component:DialogComponent.DialogComponent});exports.COMPONENT_NAME="Dialog",exports.Dialog=Dialog;
|
|
2
2
|
//# sourceMappingURL=Dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport ReactModal from 'react-modal'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { withTranslation } from 'hocs/withTranslation'\nimport type { InjectedTranslationProps } from 'hocs/withTranslation'\nimport { DialogComponent } from 'components/DialogComponent'\nimport { deepmerge } from 'shared/utils/misc'\nimport { SIZES, SIZES_FANCY } from './sizes'\nimport { POSITIONS } from './positions'\nimport * as Styled from './style'\nimport type { DialogProps, TranslationDialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'Dialog'\n\nconst TranslationDialogComponent = withTranslation<HTMLDivElement, TranslationDialogComponentProps>(\n forwardRef<HTMLDivElement, InjectedTranslationProps<HTMLDivElement, TranslationDialogComponentProps>>(\n (props, ref) => {\n const { positions = {}, translated, ...restProps } = props\n\n const dialogPositions = translated ? {} : deepmerge(POSITIONS, positions)\n\n return <Styled.PositionedDialogComponent {...restProps} positions={dialogPositions} ref={ref} />\n }\n )\n)\n\n/**\n *\n * Компонент для отображения контента поверх основного интерфейса.\n *\n * Поддерживаются все нативные атрибуты \\<div\\> элемента.\n */\nconst Dialog: React.ForwardRefExoticComponent<DialogProps> & { Component: typeof DialogComponent } = Object.assign(\n withMergedProps<DialogProps, HTMLDivElement>(\n (props) => {\n const {\n size = 's',\n position = 'center',\n role = 'dialog',\n open,\n preventScrollAfterClose,\n closeTimeoutMS,\n portalClassName,\n className,\n bodyOpenClassName,\n htmlOpenClassName,\n overlayClassName,\n shouldCloseOnOverlayClick,\n shouldCloseOnEsc,\n shouldReturnFocusAfterClose,\n parentSelector,\n overlayRef,\n contentRef,\n palette,\n overlayBlur,\n overlayDisabled,\n zIndex,\n onAfterOpen,\n onAfterClose,\n onRequestClose,\n ...dialogProps\n } = props\n\n const overlayElementDisabled = dialogProps.draggable || overlayDisabled\n\n return (\n <ReactModal\n isOpen={open}\n ariaHideApp={false}\n preventScroll={preventScrollAfterClose}\n closeTimeoutMS={closeTimeoutMS}\n portalClassName={portalClassName}\n className={className}\n bodyOpenClassName={bodyOpenClassName}\n htmlOpenClassName={htmlOpenClassName}\n overlayClassName={overlayClassName}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n shouldCloseOnEsc={shouldCloseOnEsc}\n shouldReturnFocusAfterClose={shouldReturnFocusAfterClose}\n parentSelector={parentSelector}\n overlayRef={overlayRef}\n contentRef={contentRef}\n onAfterOpen={onAfterOpen}\n onAfterClose={onAfterClose}\n onRequestClose={onRequestClose}\n contentElement={(contentProps) => {\n const {\n ref,\n className: contentElementClassName,\n tabIndex,\n onKeyDown,\n onMouseDown,\n onMouseUp,\n onClick,\n } = contentProps\n\n return (\n <TranslationDialogComponent\n {...dialogProps}\n ref={ref}\n size={size}\n role={role}\n className={contentElementClassName}\n tabIndex={tabIndex}\n position={position}\n aria-modal={!dialogProps.draggable && !overlayDisabled}\n palette={{\n color: palette.color,\n backgroundColor: palette.backgroundColor,\n shadowColor: palette.shadowColor,\n }}\n zIndex={overlayElementDisabled ? zIndex : undefined}\n onKeyDown={(evt) => {\n if (dialogProps.onKeyDown) dialogProps.onKeyDown(evt)\n if (onKeyDown) onKeyDown(evt)\n }}\n onMouseDown={(evt) => {\n if (dialogProps.onMouseDown) dialogProps.onMouseDown(evt)\n if (onMouseDown) onMouseDown(evt)\n }}\n onMouseUp={(evt) => {\n if (dialogProps.onMouseUp) dialogProps.onMouseUp(evt)\n if (onMouseUp) onMouseUp(evt)\n }}\n onClick={(evt) => {\n if (dialogProps.onClick) dialogProps.onClick(evt)\n if (onClick) onClick(evt)\n }}\n />\n )\n }}\n overlayElement={(overlayProps, contentElement) => {\n const { ref, className: overlayElementClassName, onClick, onMouseDown } = overlayProps\n\n return overlayElementDisabled ? (\n contentElement\n ) : (\n <Styled.DialogOverlay\n ref={ref}\n className={overlayElementClassName}\n blur={overlayBlur}\n palette={{\n backgroundColor: palette.overlayBackgroundColor,\n }}\n zIndex={zIndex}\n onClick={onClick}\n onMouseDown={onMouseDown}\n >\n {contentElement}\n </Styled.DialogOverlay>\n )\n }}\n />\n )\n },\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n ),\n {\n Component: DialogComponent,\n }\n)\n\nexport { Dialog }\n\nexport { COMPONENT_NAME }\n"],"names":["TranslationDialogComponent","withTranslation","forwardRef","props","ref","positions","translated","restProps","dialogPositions","deepmerge","POSITIONS","_jsx","Styled","Dialog","Object","assign","withMergedProps","size","position","role","open","preventScrollAfterClose","closeTimeoutMS","portalClassName","className","bodyOpenClassName","htmlOpenClassName","overlayClassName","shouldCloseOnOverlayClick","shouldCloseOnEsc","shouldReturnFocusAfterClose","parentSelector","overlayRef","contentRef","palette","overlayBlur","overlayDisabled","zIndex","onAfterOpen","onAfterClose","onRequestClose","dialogProps","overlayElementDisabled","draggable","ReactModal","isOpen","ariaHideApp","preventScroll","contentElement","contentProps","contentElementClassName","tabIndex","onKeyDown","onMouseDown","onMouseUp","onClick","color","backgroundColor","shadowColor","undefined","evt","overlayElement","overlayProps","overlayElementClassName","jsx","blur","overlayBackgroundColor","children","sizes","fancy","SIZES_FANCY","SIZES","displayName","Component","DialogComponent"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dialog.js","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport ReactModal from 'react-modal'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { withTranslation } from 'hocs/withTranslation'\nimport type { InjectedTranslationProps } from 'hocs/withTranslation'\nimport { DialogComponent } from 'components/DialogComponent'\nimport { deepmerge } from 'shared/utils/misc'\nimport { useScrollLock } from 'hooks/useScrollLock'\nimport { SIZES, SIZES_FANCY } from './sizes'\nimport { POSITIONS } from './positions'\nimport * as Styled from './style'\nimport type { DialogProps, TranslationDialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'Dialog'\n\nconst TranslationDialogComponent = withTranslation<HTMLDivElement, TranslationDialogComponentProps>(\n forwardRef<HTMLDivElement, InjectedTranslationProps<HTMLDivElement, TranslationDialogComponentProps>>(\n (props, ref) => {\n const { positions = {}, translated, ...restProps } = props\n\n const dialogPositions = translated ? {} : deepmerge(POSITIONS, positions)\n\n return <Styled.PositionedDialogComponent {...restProps} positions={dialogPositions} ref={ref} />\n }\n )\n)\n\n/**\n *\n * Компонент для отображения контента поверх основного интерфейса.\n *\n * Поддерживаются все нативные атрибуты \\<div\\> элемента.\n */\nconst Dialog: React.ForwardRefExoticComponent<DialogProps> & { Component: typeof DialogComponent } = Object.assign(\n withMergedProps<DialogProps, HTMLDivElement>(\n (props) => {\n const {\n size = 's',\n position = 'center',\n role = 'dialog',\n open,\n preventScrollAfterClose,\n closeTimeoutMS,\n portalClassName,\n className,\n bodyOpenClassName,\n htmlOpenClassName,\n overlayClassName,\n shouldCloseOnOverlayClick,\n shouldCloseOnEsc,\n shouldReturnFocusAfterClose,\n parentSelector,\n overlayRef,\n contentRef,\n palette,\n overlayBlur,\n overlayDisabled,\n zIndex,\n scrollLock,\n onAfterOpen,\n onAfterClose,\n onRequestClose,\n ...dialogProps\n } = props\n\n const overlayElementDisabled = dialogProps.draggable || overlayDisabled\n\n useScrollLock(\n scrollLock || {\n locked: false,\n }\n )\n\n return (\n <ReactModal\n isOpen={open}\n ariaHideApp={false}\n preventScroll={preventScrollAfterClose}\n closeTimeoutMS={closeTimeoutMS}\n portalClassName={portalClassName}\n className={className}\n bodyOpenClassName={bodyOpenClassName}\n htmlOpenClassName={htmlOpenClassName}\n overlayClassName={overlayClassName}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n shouldCloseOnEsc={shouldCloseOnEsc}\n shouldReturnFocusAfterClose={shouldReturnFocusAfterClose}\n parentSelector={parentSelector}\n overlayRef={overlayRef}\n contentRef={contentRef}\n onAfterOpen={onAfterOpen}\n onAfterClose={onAfterClose}\n onRequestClose={onRequestClose}\n contentElement={(contentProps) => {\n const {\n ref,\n className: contentElementClassName,\n tabIndex,\n onKeyDown,\n onMouseDown,\n onMouseUp,\n onClick,\n } = contentProps\n\n return (\n <TranslationDialogComponent\n {...dialogProps}\n ref={ref}\n size={size}\n role={role}\n className={contentElementClassName}\n tabIndex={tabIndex}\n position={position}\n aria-modal={!dialogProps.draggable && !overlayDisabled}\n palette={{\n color: palette.color,\n backgroundColor: palette.backgroundColor,\n shadowColor: palette.shadowColor,\n }}\n zIndex={overlayElementDisabled ? zIndex : undefined}\n onKeyDown={(evt) => {\n if (dialogProps.onKeyDown) dialogProps.onKeyDown(evt)\n if (onKeyDown) onKeyDown(evt)\n }}\n onMouseDown={(evt) => {\n if (dialogProps.onMouseDown) dialogProps.onMouseDown(evt)\n if (onMouseDown) onMouseDown(evt)\n }}\n onMouseUp={(evt) => {\n if (dialogProps.onMouseUp) dialogProps.onMouseUp(evt)\n if (onMouseUp) onMouseUp(evt)\n }}\n onClick={(evt) => {\n if (dialogProps.onClick) dialogProps.onClick(evt)\n if (onClick) onClick(evt)\n }}\n />\n )\n }}\n overlayElement={(overlayProps, contentElement) => {\n const { ref, className: overlayElementClassName, onClick, onMouseDown } = overlayProps\n\n return overlayElementDisabled ? (\n contentElement\n ) : (\n <Styled.DialogOverlay\n ref={ref}\n className={overlayElementClassName}\n blur={overlayBlur}\n palette={{\n backgroundColor: palette.overlayBackgroundColor,\n }}\n zIndex={zIndex}\n onClick={onClick}\n onMouseDown={onMouseDown}\n >\n {contentElement}\n </Styled.DialogOverlay>\n )\n }}\n />\n )\n },\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n ),\n {\n Component: DialogComponent,\n }\n)\n\nexport { Dialog }\n\nexport { COMPONENT_NAME }\n"],"names":["TranslationDialogComponent","withTranslation","forwardRef","props","ref","positions","translated","restProps","dialogPositions","deepmerge","POSITIONS","_jsx","Styled","Dialog","Object","assign","withMergedProps","size","position","role","open","preventScrollAfterClose","closeTimeoutMS","portalClassName","className","bodyOpenClassName","htmlOpenClassName","overlayClassName","shouldCloseOnOverlayClick","shouldCloseOnEsc","shouldReturnFocusAfterClose","parentSelector","overlayRef","contentRef","palette","overlayBlur","overlayDisabled","zIndex","scrollLock","onAfterOpen","onAfterClose","onRequestClose","dialogProps","overlayElementDisabled","draggable","useScrollLock","locked","ReactModal","isOpen","ariaHideApp","preventScroll","contentElement","contentProps","contentElementClassName","tabIndex","onKeyDown","onMouseDown","onMouseUp","onClick","color","backgroundColor","shadowColor","undefined","evt","overlayElement","overlayProps","overlayElementClassName","jsx","blur","overlayBackgroundColor","children","sizes","fancy","SIZES_FANCY","SIZES","displayName","Component","DialogComponent"],"mappings":"+nBAeA,MAAMA,2BAA6BC,gBAAAA,gBACjCC,MAAAA,YACE,CAACC,EAAOC,KACN,MAAQC,UAAAA,EAAY,CAAE,EAAAC,WAAEA,KAAeC,GAAcJ,EAErD,MAAMK,EAAkBF,EAAa,CAAA,EAAKG,KAAAA,UAAUC,UAAAA,UAAWL,GAE/D,OAAOM,WAAAA,IAACC,MAAAA,0BAAgC,IAAKL,EAAWF,UAAWG,EAAiBJ,IAAKA,GAAO,KAWhGS,MAAAA,OAA+FC,OAAOC,OAC1GC,gBAAAA,iBACGb,IACC,MAAMc,KACJA,EAAO,IAAGC,SACVA,EAAW,SAAQC,KACnBA,EAAO,SAAQC,KACfA,EAAIC,wBACJA,EAAuBC,eACvBA,EAAcC,gBACdA,EAAeC,UACfA,EAASC,kBACTA,EAAiBC,kBACjBA,EAAiBC,iBACjBA,EAAgBC,0BAChBA,EAAyBC,iBACzBA,EAAgBC,4BA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EAAYgB,SAAShB,EAAYgB,QAAQK,GACzCL,GAASA,EAAQK,EAAI,GAE3B,EAGNC,eAAgBA,CAACC,EAAcd,KAC7B,MAAM/C,IAAEA,EAAKoB,UAAW0C,EAAuBR,QAAEA,EAAOF,YAAEA,GAAgBS,EAE1E,OAAOtB,EACLQ,EAEAxC,WAAAwD,IAACvD,oBAAoB,CACnBR,IAAKA,EACLoB,UAAW0C,EACXE,KAAMjC,EACND,QAAS,CACP0B,gBAAiB1B,EAAQmC,wBAE3BhC,OAAQA,EACRqB,QAASA,EACTF,YAAaA,EAAYc,SAExBnB,GAEJ,GAEH,GAGN,CACEoB,MAAQpE,GAAWA,EAAMqE,MAAQC,MAAWA,YAAGC,MAAMA,MACrDC,YAxJiB,WA2JrB,CACEC,UAAWC,gBAAAA,yCA5JQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef}from'react';import ReactModal from'react-modal';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{withTranslation}from'../../hocs/withTranslation.mjs';import{deepmerge}from'../../shared/utils/misc.mjs';import{SIZES_FANCY,SIZES}from'./sizes.mjs';import{POSITIONS}from'./positions.mjs';import{DialogOverlay,PositionedDialogComponent}from'./style.mjs';import{jsx}from'react/jsx-runtime';import{DialogComponent}from'../DialogComponent/DialogComponent.mjs';const COMPONENT_NAME='Dialog';const TranslationDialogComponent=withTranslation(forwardRef(((o,e)=>{const{positions:
|
|
1
|
+
import{forwardRef}from'react';import ReactModal from'react-modal';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{withTranslation}from'../../hocs/withTranslation.mjs';import{deepmerge}from'../../shared/utils/misc.mjs';import{useScrollLock}from'../../hooks/useScrollLock.mjs';import{SIZES_FANCY,SIZES}from'./sizes.mjs';import{POSITIONS}from'./positions.mjs';import{DialogOverlay,PositionedDialogComponent}from'./style.mjs';import{jsx}from'react/jsx-runtime';import{DialogComponent}from'../DialogComponent/DialogComponent.mjs';const COMPONENT_NAME='Dialog';const TranslationDialogComponent=withTranslation(forwardRef(((o,e)=>{const{positions:s={},translated:n,...l}=o;const r=n?{}:deepmerge(POSITIONS,s);return jsx(PositionedDialogComponent,{...l,positions:r,ref:e})})));const Dialog=Object.assign(withMergedProps((o=>{const{size:e="s",position:s="center",role:n="dialog",open:l,preventScrollAfterClose:r,closeTimeoutMS:a,portalClassName:t,className:i,bodyOpenClassName:m,htmlOpenClassName:c,overlayClassName:p,shouldCloseOnOverlayClick:C,shouldCloseOnEsc:d,shouldReturnFocusAfterClose:u,parentSelector:f,overlayRef:g,contentRef:D,palette:N,overlayBlur:O,overlayDisabled:h,zIndex:y,scrollLock:M,onAfterOpen:S,onAfterClose:w,onRequestClose:k,...j}=o;const v=j.draggable||h;return useScrollLock(M||{locked:!1}),jsx(ReactModal,{isOpen:l,ariaHideApp:!1,preventScroll:r,closeTimeoutMS:a,portalClassName:t,className:i,bodyOpenClassName:m,htmlOpenClassName:c,overlayClassName:p,shouldCloseOnOverlayClick:C,shouldCloseOnEsc:d,shouldReturnFocusAfterClose:u,parentSelector:f,overlayRef:g,contentRef:D,onAfterOpen:S,onAfterClose:w,onRequestClose:k,contentElement:o=>{const{ref:l,className:r,tabIndex:a,onKeyDown:t,onMouseDown:i,onMouseUp:m,onClick:c}=o;return jsx(TranslationDialogComponent,{...j,ref:l,size:e,role:n,className:r,tabIndex:a,position:s,"aria-modal":!j.draggable&&!h,palette:{color:N.color,backgroundColor:N.backgroundColor,shadowColor:N.shadowColor},zIndex:v?y:void 0,onKeyDown:o=>{j.onKeyDown&&j.onKeyDown(o),t&&t(o)},onMouseDown:o=>{j.onMouseDown&&j.onMouseDown(o),i&&i(o)},onMouseUp:o=>{j.onMouseUp&&j.onMouseUp(o),m&&m(o)},onClick:o=>{j.onClick&&j.onClick(o),c&&c(o)}})},overlayElement:(o,e)=>{const{ref:s,className:n,onClick:l,onMouseDown:r}=o;return v?e:jsx(DialogOverlay,{ref:s,className:n,blur:O,palette:{backgroundColor:N.overlayBackgroundColor},zIndex:y,onClick:l,onMouseDown:r,children:e})}})}),{sizes:o=>o.fancy?SIZES_FANCY:SIZES,displayName:"Dialog"}),{Component:DialogComponent});export{COMPONENT_NAME,Dialog};
|
|
2
2
|
//# sourceMappingURL=Dialog.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.mjs","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport ReactModal from 'react-modal'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { withTranslation } from 'hocs/withTranslation'\nimport type { InjectedTranslationProps } from 'hocs/withTranslation'\nimport { DialogComponent } from 'components/DialogComponent'\nimport { deepmerge } from 'shared/utils/misc'\nimport { SIZES, SIZES_FANCY } from './sizes'\nimport { POSITIONS } from './positions'\nimport * as Styled from './style'\nimport type { DialogProps, TranslationDialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'Dialog'\n\nconst TranslationDialogComponent = withTranslation<HTMLDivElement, TranslationDialogComponentProps>(\n forwardRef<HTMLDivElement, InjectedTranslationProps<HTMLDivElement, TranslationDialogComponentProps>>(\n (props, ref) => {\n const { positions = {}, translated, ...restProps } = props\n\n const dialogPositions = translated ? {} : deepmerge(POSITIONS, positions)\n\n return <Styled.PositionedDialogComponent {...restProps} positions={dialogPositions} ref={ref} />\n }\n )\n)\n\n/**\n *\n * Компонент для отображения контента поверх основного интерфейса.\n *\n * Поддерживаются все нативные атрибуты \\<div\\> элемента.\n */\nconst Dialog: React.ForwardRefExoticComponent<DialogProps> & { Component: typeof DialogComponent } = Object.assign(\n withMergedProps<DialogProps, HTMLDivElement>(\n (props) => {\n const {\n size = 's',\n position = 'center',\n role = 'dialog',\n open,\n preventScrollAfterClose,\n closeTimeoutMS,\n portalClassName,\n className,\n bodyOpenClassName,\n htmlOpenClassName,\n overlayClassName,\n shouldCloseOnOverlayClick,\n shouldCloseOnEsc,\n shouldReturnFocusAfterClose,\n parentSelector,\n overlayRef,\n contentRef,\n palette,\n overlayBlur,\n overlayDisabled,\n zIndex,\n onAfterOpen,\n onAfterClose,\n onRequestClose,\n ...dialogProps\n } = props\n\n const overlayElementDisabled = dialogProps.draggable || overlayDisabled\n\n return (\n <ReactModal\n isOpen={open}\n ariaHideApp={false}\n preventScroll={preventScrollAfterClose}\n closeTimeoutMS={closeTimeoutMS}\n portalClassName={portalClassName}\n className={className}\n bodyOpenClassName={bodyOpenClassName}\n htmlOpenClassName={htmlOpenClassName}\n overlayClassName={overlayClassName}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n shouldCloseOnEsc={shouldCloseOnEsc}\n shouldReturnFocusAfterClose={shouldReturnFocusAfterClose}\n parentSelector={parentSelector}\n overlayRef={overlayRef}\n contentRef={contentRef}\n onAfterOpen={onAfterOpen}\n onAfterClose={onAfterClose}\n onRequestClose={onRequestClose}\n contentElement={(contentProps) => {\n const {\n ref,\n className: contentElementClassName,\n tabIndex,\n onKeyDown,\n onMouseDown,\n onMouseUp,\n onClick,\n } = contentProps\n\n return (\n <TranslationDialogComponent\n {...dialogProps}\n ref={ref}\n size={size}\n role={role}\n className={contentElementClassName}\n tabIndex={tabIndex}\n position={position}\n aria-modal={!dialogProps.draggable && !overlayDisabled}\n palette={{\n color: palette.color,\n backgroundColor: palette.backgroundColor,\n shadowColor: palette.shadowColor,\n }}\n zIndex={overlayElementDisabled ? zIndex : undefined}\n onKeyDown={(evt) => {\n if (dialogProps.onKeyDown) dialogProps.onKeyDown(evt)\n if (onKeyDown) onKeyDown(evt)\n }}\n onMouseDown={(evt) => {\n if (dialogProps.onMouseDown) dialogProps.onMouseDown(evt)\n if (onMouseDown) onMouseDown(evt)\n }}\n onMouseUp={(evt) => {\n if (dialogProps.onMouseUp) dialogProps.onMouseUp(evt)\n if (onMouseUp) onMouseUp(evt)\n }}\n onClick={(evt) => {\n if (dialogProps.onClick) dialogProps.onClick(evt)\n if (onClick) onClick(evt)\n }}\n />\n )\n }}\n overlayElement={(overlayProps, contentElement) => {\n const { ref, className: overlayElementClassName, onClick, onMouseDown } = overlayProps\n\n return overlayElementDisabled ? (\n contentElement\n ) : (\n <Styled.DialogOverlay\n ref={ref}\n className={overlayElementClassName}\n blur={overlayBlur}\n palette={{\n backgroundColor: palette.overlayBackgroundColor,\n }}\n zIndex={zIndex}\n onClick={onClick}\n onMouseDown={onMouseDown}\n >\n {contentElement}\n </Styled.DialogOverlay>\n )\n }}\n />\n )\n },\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n ),\n {\n Component: DialogComponent,\n }\n)\n\nexport { Dialog }\n\nexport { COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","TranslationDialogComponent","withTranslation","forwardRef","props","ref","positions","translated","restProps","dialogPositions","deepmerge","POSITIONS","_jsx","Styled","Dialog","Object","assign","withMergedProps","size","position","role","open","preventScrollAfterClose","closeTimeoutMS","portalClassName","className","bodyOpenClassName","htmlOpenClassName","overlayClassName","shouldCloseOnOverlayClick","shouldCloseOnEsc","shouldReturnFocusAfterClose","parentSelector","overlayRef","contentRef","palette","overlayBlur","overlayDisabled","zIndex","onAfterOpen","onAfterClose","onRequestClose","dialogProps","overlayElementDisabled","draggable","ReactModal","isOpen","ariaHideApp","preventScroll","contentElement","contentProps","contentElementClassName","tabIndex","onKeyDown","onMouseDown","onMouseUp","onClick","color","backgroundColor","shadowColor","undefined","evt","overlayElement","overlayProps","overlayElementClassName","blur","overlayBackgroundColor","children","sizes","fancy","SIZES_FANCY","SIZES","displayName","Component","DialogComponent"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dialog.mjs","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport ReactModal from 'react-modal'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { withTranslation } from 'hocs/withTranslation'\nimport type { InjectedTranslationProps } from 'hocs/withTranslation'\nimport { DialogComponent } from 'components/DialogComponent'\nimport { deepmerge } from 'shared/utils/misc'\nimport { useScrollLock } from 'hooks/useScrollLock'\nimport { SIZES, SIZES_FANCY } from './sizes'\nimport { POSITIONS } from './positions'\nimport * as Styled from './style'\nimport type { DialogProps, TranslationDialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'Dialog'\n\nconst TranslationDialogComponent = withTranslation<HTMLDivElement, TranslationDialogComponentProps>(\n forwardRef<HTMLDivElement, InjectedTranslationProps<HTMLDivElement, TranslationDialogComponentProps>>(\n (props, ref) => {\n const { positions = {}, translated, ...restProps } = props\n\n const dialogPositions = translated ? {} : deepmerge(POSITIONS, positions)\n\n return <Styled.PositionedDialogComponent {...restProps} positions={dialogPositions} ref={ref} />\n }\n )\n)\n\n/**\n *\n * Компонент для отображения контента поверх основного интерфейса.\n *\n * Поддерживаются все нативные атрибуты \\<div\\> элемента.\n */\nconst Dialog: React.ForwardRefExoticComponent<DialogProps> & { Component: typeof DialogComponent } = Object.assign(\n withMergedProps<DialogProps, HTMLDivElement>(\n (props) => {\n const {\n size = 's',\n position = 'center',\n role = 'dialog',\n open,\n preventScrollAfterClose,\n closeTimeoutMS,\n portalClassName,\n className,\n bodyOpenClassName,\n htmlOpenClassName,\n overlayClassName,\n shouldCloseOnOverlayClick,\n shouldCloseOnEsc,\n shouldReturnFocusAfterClose,\n parentSelector,\n overlayRef,\n contentRef,\n palette,\n overlayBlur,\n overlayDisabled,\n zIndex,\n scrollLock,\n onAfterOpen,\n onAfterClose,\n onRequestClose,\n ...dialogProps\n } = props\n\n const overlayElementDisabled = dialogProps.draggable || overlayDisabled\n\n useScrollLock(\n scrollLock || {\n locked: false,\n }\n )\n\n return (\n <ReactModal\n isOpen={open}\n ariaHideApp={false}\n preventScroll={preventScrollAfterClose}\n closeTimeoutMS={closeTimeoutMS}\n portalClassName={portalClassName}\n className={className}\n bodyOpenClassName={bodyOpenClassName}\n htmlOpenClassName={htmlOpenClassName}\n overlayClassName={overlayClassName}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n shouldCloseOnEsc={shouldCloseOnEsc}\n shouldReturnFocusAfterClose={shouldReturnFocusAfterClose}\n parentSelector={parentSelector}\n overlayRef={overlayRef}\n contentRef={contentRef}\n onAfterOpen={onAfterOpen}\n onAfterClose={onAfterClose}\n onRequestClose={onRequestClose}\n contentElement={(contentProps) => {\n const {\n ref,\n className: contentElementClassName,\n tabIndex,\n onKeyDown,\n onMouseDown,\n onMouseUp,\n onClick,\n } = contentProps\n\n return (\n <TranslationDialogComponent\n {...dialogProps}\n ref={ref}\n size={size}\n role={role}\n className={contentElementClassName}\n tabIndex={tabIndex}\n position={position}\n aria-modal={!dialogProps.draggable && !overlayDisabled}\n palette={{\n color: palette.color,\n backgroundColor: palette.backgroundColor,\n shadowColor: palette.shadowColor,\n }}\n zIndex={overlayElementDisabled ? zIndex : undefined}\n onKeyDown={(evt) => {\n if (dialogProps.onKeyDown) dialogProps.onKeyDown(evt)\n if (onKeyDown) onKeyDown(evt)\n }}\n onMouseDown={(evt) => {\n if (dialogProps.onMouseDown) dialogProps.onMouseDown(evt)\n if (onMouseDown) onMouseDown(evt)\n }}\n onMouseUp={(evt) => {\n if (dialogProps.onMouseUp) dialogProps.onMouseUp(evt)\n if (onMouseUp) onMouseUp(evt)\n }}\n onClick={(evt) => {\n if (dialogProps.onClick) dialogProps.onClick(evt)\n if (onClick) onClick(evt)\n }}\n />\n )\n }}\n overlayElement={(overlayProps, contentElement) => {\n const { ref, className: overlayElementClassName, onClick, onMouseDown } = overlayProps\n\n return overlayElementDisabled ? (\n contentElement\n ) : (\n <Styled.DialogOverlay\n ref={ref}\n className={overlayElementClassName}\n blur={overlayBlur}\n palette={{\n backgroundColor: palette.overlayBackgroundColor,\n }}\n zIndex={zIndex}\n onClick={onClick}\n onMouseDown={onMouseDown}\n >\n {contentElement}\n </Styled.DialogOverlay>\n )\n }}\n />\n )\n },\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n ),\n {\n Component: DialogComponent,\n }\n)\n\nexport { Dialog }\n\nexport { COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","TranslationDialogComponent","withTranslation","forwardRef","props","ref","positions","translated","restProps","dialogPositions","deepmerge","POSITIONS","_jsx","Styled","Dialog","Object","assign","withMergedProps","size","position","role","open","preventScrollAfterClose","closeTimeoutMS","portalClassName","className","bodyOpenClassName","htmlOpenClassName","overlayClassName","shouldCloseOnOverlayClick","shouldCloseOnEsc","shouldReturnFocusAfterClose","parentSelector","overlayRef","contentRef","palette","overlayBlur","overlayDisabled","zIndex","scrollLock","onAfterOpen","onAfterClose","onRequestClose","dialogProps","overlayElementDisabled","draggable","useScrollLock","locked","ReactModal","isOpen","ariaHideApp","preventScroll","contentElement","contentProps","contentElementClassName","tabIndex","onKeyDown","onMouseDown","onMouseUp","onClick","color","backgroundColor","shadowColor","undefined","evt","overlayElement","overlayProps","overlayElementClassName","blur","overlayBackgroundColor","children","sizes","fancy","SIZES_FANCY","SIZES","displayName","Component","DialogComponent"],"mappings":"giBAaMA,MAAAA,eAAiB,SAEvB,MAAMC,2BAA6BC,gBACjCC,YACE,CAACC,EAAOC,KACN,MAAMC,UAAEA,EAAY,CAAE,EAAAC,WAAEA,KAAeC,GAAcJ,EAErD,MAAMK,EAAkBF,EAAa,CAAA,EAAKG,UAAUC,UAAWL,GAE/D,OAAOM,IAACC,0BAAgC,IAAKL,EAAWF,UAAWG,EAAiBJ,IAAKA,GAAO,KAWhGS,MAAAA,OAA+FC,OAAOC,OAC1GC,iBACGb,IACC,MAAMc,KACJA,EAAO,IAAGC,SACVA,EAAW,SAAQC,KACnBA,EAAO,SAAQC,KACfA,EAAIC,wBACJA,EAAuBC,eACvBA,EAAcC,gBACdA,EAAeC,UACfA,EAASC,kBACTA,EAAiBC,kBACjBA,EAAiBC,iBACjBA,EAAgBC,0BAChBA,EAAyBC,iBACzBA,EAAgBC,4BAChBA,EAA2BC,eAC3BA,EAAcC,WACdA,EAAUC,WACVA,EAAUC,QACVA,EAA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AC7B,MAAM/C,IAAEA,EAAKoB,UAAW0C,EAAuBR,QAAEA,EAAOF,YAAEA,GAAgBS,EAE1E,OAAOtB,EACLQ,EAEAxC,IAACC,cAAoB,CACnBR,IAAKA,EACLoB,UAAW0C,EACXC,KAAMhC,EACND,QAAS,CACP0B,gBAAiB1B,EAAQkC,wBAE3B/B,OAAQA,EACRqB,QAASA,EACTF,YAAaA,EAAYa,SAExBlB,GAEJ,GAEH,GAGN,CACEmB,MAAQnE,GAAWA,EAAMoE,MAAQC,YAAcC,MAC/CC,YAxJiB,WA2JrB,CACEC,UAAWC"}
|
package/dts/index.d.ts
CHANGED
|
@@ -1412,7 +1412,6 @@ type IconName$1 =
|
|
|
1412
1412
|
| 'userFill'
|
|
1413
1413
|
| 'faceSmileFill'
|
|
1414
1414
|
| 'faceFrownFill'
|
|
1415
|
-
| 'stopFill'
|
|
1416
1415
|
| 'pauseThinFill'
|
|
1417
1416
|
| 'pauseFill'
|
|
1418
1417
|
| 'playFill'
|
|
@@ -1496,7 +1495,6 @@ type IconName$1 =
|
|
|
1496
1495
|
| 'plusFill'
|
|
1497
1496
|
| 'editFill'
|
|
1498
1497
|
| 'gridPlusFill'
|
|
1499
|
-
| 'maxSocial'
|
|
1500
1498
|
| 'youtubeAltSocial'
|
|
1501
1499
|
| 'whatsappSocialFill'
|
|
1502
1500
|
| 'whatsappSocial'
|
|
@@ -1507,7 +1505,6 @@ type IconName$1 =
|
|
|
1507
1505
|
| 'youtubeSocial'
|
|
1508
1506
|
| 'facebookSocial'
|
|
1509
1507
|
| 'vkSocial'
|
|
1510
|
-
| 'sbSpasiboBlackFill'
|
|
1511
1508
|
| 'giftAltFill'
|
|
1512
1509
|
| 'giftFill'
|
|
1513
1510
|
| 'messageCircleChatFill'
|
|
@@ -1603,8 +1600,6 @@ type IconName$1 =
|
|
|
1603
1600
|
| 'chevronDownRightFill'
|
|
1604
1601
|
| 'cornerDownRightFill'
|
|
1605
1602
|
| 'foxCoin'
|
|
1606
|
-
| 'sbSpasiboGradientColor'
|
|
1607
|
-
| 'sbSpasiboColor'
|
|
1608
1603
|
| 'youtubeAltSocialColor'
|
|
1609
1604
|
| 'whatsappSocialColor'
|
|
1610
1605
|
| 'telegramSocialColor'
|
|
@@ -1929,8 +1924,6 @@ type IconName$1 =
|
|
|
1929
1924
|
| 'bracketRoundRight'
|
|
1930
1925
|
| 'squareTerminal'
|
|
1931
1926
|
| 'bracketsRound'
|
|
1932
|
-
| 'stepApproach'
|
|
1933
|
-
| 'bug'
|
|
1934
1927
|
| 'terminal'
|
|
1935
1928
|
| 'code'
|
|
1936
1929
|
| 'bracketsCurly'
|
|
@@ -1944,7 +1937,6 @@ type IconName$1 =
|
|
|
1944
1937
|
| 'imageUser'
|
|
1945
1938
|
| 'rss'
|
|
1946
1939
|
| 'airplay'
|
|
1947
|
-
| 'stop'
|
|
1948
1940
|
| 'sliders'
|
|
1949
1941
|
| 'videoImport'
|
|
1950
1942
|
| 'videoExport'
|
|
@@ -6066,6 +6058,21 @@ interface DialogBaseProps extends ResponsiveSizeProps<Size$a>, ResponsiveLayoutP
|
|
|
6066
6058
|
* @general
|
|
6067
6059
|
* @default false */
|
|
6068
6060
|
stickyHeader?: boolean;
|
|
6061
|
+
/**
|
|
6062
|
+
* Параметры блокировки скролла.
|
|
6063
|
+
*
|
|
6064
|
+
* @general
|
|
6065
|
+
* @default undefined */
|
|
6066
|
+
scrollLock?: {
|
|
6067
|
+
/**
|
|
6068
|
+
* Блокировать скролл.
|
|
6069
|
+
*/
|
|
6070
|
+
locked: boolean;
|
|
6071
|
+
/**
|
|
6072
|
+
* Контейнер, в котором разрешена прокрутка на iOS при заблокированном скролле страницы.
|
|
6073
|
+
*/
|
|
6074
|
+
iosAllowedScrollContainer?: HTMLElement;
|
|
6075
|
+
};
|
|
6069
6076
|
/**
|
|
6070
6077
|
* Размер.
|
|
6071
6078
|
*
|
|
@@ -7458,6 +7465,18 @@ declare const useScrollMonitor: ({ target, scrollThrottleMS, scrollEndDebounceMS
|
|
|
7458
7465
|
listenerOptions?: AddEventListenerOptions | boolean;
|
|
7459
7466
|
}) => void;
|
|
7460
7467
|
|
|
7468
|
+
type ScrollLockParams = {
|
|
7469
|
+
/**
|
|
7470
|
+
* Блокировать скролл.
|
|
7471
|
+
*/
|
|
7472
|
+
locked: boolean;
|
|
7473
|
+
/**
|
|
7474
|
+
* Контейнер, в котором разрешена прокрутка на iOS при заблокированном скролле страницы.
|
|
7475
|
+
*/
|
|
7476
|
+
iosAllowedScrollContainer?: HTMLElement;
|
|
7477
|
+
};
|
|
7478
|
+
declare function useScrollLock(params: ScrollLockParams): void;
|
|
7479
|
+
|
|
7461
7480
|
declare const vAlign: (align: "top" | "middle" | "bottom" | "text-top" | "text-bottom" | "baseline") => styled_components.FlattenSimpleInterpolation;
|
|
7462
7481
|
|
|
7463
7482
|
declare function buildMediaQuery(value: number | Size$m | 'auto' | 'initial' | 'inherit' | boolean, property: string | ((_size: number | 'auto' | 'initial' | 'inherit' | boolean, _sizing?: null | string) => FlattenSimpleInterpolation | null), screenQueryFunction: typeof screenXs, sizing: null | string, sizes?: Record<Size$m, number>): ReturnType<typeof css>;
|
|
@@ -10254,4 +10273,4 @@ type AddElementProps = AddElementBaseProps & Omit<React.ComponentPropsWithRef<'b
|
|
|
10254
10273
|
*/
|
|
10255
10274
|
declare const AddElement: React.ForwardRefExoticComponent<AddElementProps>;
|
|
10256
10275
|
|
|
10257
|
-
export { Accordion, type AccordionItemProps, type AccordionProps, ActionBtn, type ActionBtnProps, AddElement, type AddElementProps, Alert, type AlertProps, Amount, type AmountProps, Anchor, Arrow, ArrowBadge, type ArrowBadgeProps, type ArrowProps, AspectRatio, type AspectRatioProps, Avatar, type AvatarProps, Badge, type BadgeProps, type BaseProps, type Breakpoint, Button, type ButtonProps, COUNTRY_DATA, type CSSBorderStyle, type CSSColor, type CSSFontWeight, type CSSGlobalValue, type CSSUnit, type CSSVerticalAlign, CURRENCY_MAP, Checkbox, type CheckboxProps, Chip, type ChipProps, type Color, ColorNames, type ColorPaletteKey, Container, type ContainerProps, ContextMenu, type ContextMenuMultiLevelProps, type ContextMenuProps, CurrencyCodes, DEFAULT_MASK, Dialog, type DialogComponentProps, type DialogProps, type DividerProps, type DomTarget, Dropdown, type DropdownProps, FormLabel, type FormLabelProps, type HEX, INITIAL_MASK, Icon, IconButton, type IconButtonProps, type IconISOCode, type IconName, type IconProps, Indicator, type IndicatorProps, Input, type InputCheckboxProps, type InputMaskOptions, type InputMaskState, type InputPhoneProps, type InputProps, type InputRadioProps, type KeysOfUnion, ListItem, type ListItemProps, Menu, type MenuComponentProps, type MenuContainerProps, type MenuDividerProps, type MenuListProps, type MenuProps, Modal, type ModalProps, Notification, type NotificationProps, type Nullable, Paper, type PaperProps, type PlaygroundToolbar, Popover, type PopoverComponentProps, type PopoverProps, Progress, ProgressCircle$1 as ProgressCircle, type ProgressCircleProps$1 as ProgressCircleProps, ProgressLine, type ProgressLineProps, type ProgressProps, type ProgressSegmentedProps, type RGB, type RGBA, Radio, type RadioProps, type ResponsiveLayoutInterpolationProps, type ResponsiveLayoutProps, type ResponsivePositionProps, type ResponsivePropKey, type ResponsiveProps, type ResponsiveSizeInterpolationProps, type ResponsiveSizeProps, withThemeScrollable as Scrollable, type ScrollableProps, Section, type SectionProps, Select, type SelectProps, Separator, type SeparatorProps, type Size$m as Size, type SizeValue, Skeleton, type SkeletonProps, Spacer, type SpacerProps, Spinner, type SpinnerProps, Switch, type SwitchProps, Switcher, type SwitcherProps, Tab, TabList, type TabListPanelProps, type TabListProps, type TabListTabProps, type TabProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextEllipseProps, type TextHeadingProps, type TextProps, Textarea, type TextareaProps, type Theme, type ThemeMode, type ThemeName, type ThemePreset, ThemeProvider, type ToolbarControl, Tooltip, type TooltipComponentProps, type TooltipProps, type WithThemePreset, adultDarkTheme, adultLightTheme, babyDarkTheme, babyLightTheme, baseInputStyle, buildMediaQuery, color, desktopFirst, hexToRgbA, isHex, mobileFirst, motherDarkTheme, motherLightTheme, property, responsiveNamedProperty, responsiveProperty, screenL, screenM, screenMaxL, screenMaxM, screenMaxS, screenMaxXl, screenMaxXs, screenMaxXxs, screenMinL, screenMinM, screenMinS, screenMinXl, screenMinXs, screenRetina, screenS, screenXl, screenXs, teenDarkTheme, teenLightTheme, defaultTheme as theme, useClickOutside, useScrollMonitor, vAlign };
|
|
10276
|
+
export { Accordion, type AccordionItemProps, type AccordionProps, ActionBtn, type ActionBtnProps, AddElement, type AddElementProps, Alert, type AlertProps, Amount, type AmountProps, Anchor, Arrow, ArrowBadge, type ArrowBadgeProps, type ArrowProps, AspectRatio, type AspectRatioProps, Avatar, type AvatarProps, Badge, type BadgeProps, type BaseProps, type Breakpoint, Button, type ButtonProps, COUNTRY_DATA, type CSSBorderStyle, type CSSColor, type CSSFontWeight, type CSSGlobalValue, type CSSUnit, type CSSVerticalAlign, CURRENCY_MAP, Checkbox, type CheckboxProps, Chip, type ChipProps, type Color, ColorNames, type ColorPaletteKey, Container, type ContainerProps, ContextMenu, type ContextMenuMultiLevelProps, type ContextMenuProps, CurrencyCodes, DEFAULT_MASK, Dialog, type DialogComponentProps, type DialogProps, type DividerProps, type DomTarget, Dropdown, type DropdownProps, FormLabel, type FormLabelProps, type HEX, INITIAL_MASK, Icon, IconButton, type IconButtonProps, type IconISOCode, type IconName, type IconProps, Indicator, type IndicatorProps, Input, type InputCheckboxProps, type InputMaskOptions, type InputMaskState, type InputPhoneProps, type InputProps, type InputRadioProps, type KeysOfUnion, ListItem, type ListItemProps, Menu, type MenuComponentProps, type MenuContainerProps, type MenuDividerProps, type MenuListProps, type MenuProps, Modal, type ModalProps, Notification, type NotificationProps, type Nullable, Paper, type PaperProps, type PlaygroundToolbar, Popover, type PopoverComponentProps, type PopoverProps, Progress, ProgressCircle$1 as ProgressCircle, type ProgressCircleProps$1 as ProgressCircleProps, ProgressLine, type ProgressLineProps, type ProgressProps, type ProgressSegmentedProps, type RGB, type RGBA, Radio, type RadioProps, type ResponsiveLayoutInterpolationProps, type ResponsiveLayoutProps, type ResponsivePositionProps, type ResponsivePropKey, type ResponsiveProps, type ResponsiveSizeInterpolationProps, type ResponsiveSizeProps, withThemeScrollable as Scrollable, type ScrollableProps, Section, type SectionProps, Select, type SelectProps, Separator, type SeparatorProps, type Size$m as Size, type SizeValue, Skeleton, type SkeletonProps, Spacer, type SpacerProps, Spinner, type SpinnerProps, Switch, type SwitchProps, Switcher, type SwitcherProps, Tab, TabList, type TabListPanelProps, type TabListProps, type TabListTabProps, type TabProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextEllipseProps, type TextHeadingProps, type TextProps, Textarea, type TextareaProps, type Theme, type ThemeMode, type ThemeName, type ThemePreset, ThemeProvider, type ToolbarControl, Tooltip, type TooltipComponentProps, type TooltipProps, type WithThemePreset, adultDarkTheme, adultLightTheme, babyDarkTheme, babyLightTheme, baseInputStyle, buildMediaQuery, color, desktopFirst, hexToRgbA, isHex, mobileFirst, motherDarkTheme, motherLightTheme, property, responsiveNamedProperty, responsiveProperty, screenL, screenM, screenMaxL, screenMaxM, screenMaxS, screenMaxXl, screenMaxXs, screenMaxXxs, screenMinL, screenMinM, screenMinS, screenMinXl, screenMinXs, screenRetina, screenS, screenXl, screenXs, teenDarkTheme, teenLightTheme, defaultTheme as theme, useClickOutside, useScrollLock, useScrollMonitor, vAlign };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var React=require('react');const TOUCH_EVENT_OPTIONS={capture:!0,passive:!1};const supportsScrollbarGutter=typeof CSS!='undefined'&&CSS.supports('scrollbar-gutter: stable');const isIosDevice=typeof window!='undefined'&&window.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window.navigator.userAgent.includes('Macintosh')&&window.navigator.maxTouchPoints>1);const iosScrollableBlocks=[];let iosActiveScrollElement=null;let iosTouchStartY=null;let touchStartHandler=null;let touchMoveHandler=null;function getScrollLockCount(){return Number(document.documentElement.dataset.scrollLockCount||0)}function setScrollLockCount(t){document.documentElement.dataset.scrollLockCount=t.toString()}function applyScrollLockStyles(){const t=document.documentElement;if(t.dataset.prevOverflow=t.style.overflow||'',supportsScrollbarGutter&&!isIosDevice)t.style.scrollbarGutter='stable';else{const e=window.innerWidth-document.documentElement.clientWidth;if(t.dataset.prevPaddingRight=t.style.paddingRight||'',e>0){const o=parseInt(window.getComputedStyle(t).paddingRight||'0',10);t.style.paddingRight=`${o+e}px`}}t.style.overflow='hidden'}function resetScrollLockStyles(){const t=document.documentElement;t.style.overflow=t.dataset.prevOverflow||'',t.style.paddingRight=t.dataset.prevPaddingRight||'',delete t.dataset.prevOverflow,delete t.dataset.prevPaddingRight}function isScrollable(t){const e=getComputedStyle(t);return(e.overflowY==='auto'||e.overflowY==='scroll')&&t.scrollHeight>t.clientHeight}function findScrollableParent(t,e){let o=t;for(;o&&o!==e.parentElement;){if(isScrollable(o))return o;o=o.parentElement}return isScrollable(e)?e:null}exports.useScrollLock=t=>{const{locked:e,iosAllowedScrollContainer:o=document.documentElement}=t;React.useEffect((()=>{if(e)return isIosDevice?((t=>{iosScrollableBlocks.push(t);const e=getScrollLockCount();e===0&&(applyScrollLockStyles(),touchMoveHandler||touchStartHandler||(touchStartHandler=t=>{const e=t.target;if(!(e instanceof HTMLElement))return iosActiveScrollElement=null,void(iosTouchStartY=null);iosTouchStartY=t.touches[0]?.clientY??null,iosActiveScrollElement=null;for(const t of iosScrollableBlocks)if(t.contains(e)){const o=findScrollableParent(e,t);if(o){iosActiveScrollElement=o;break}}},touchMoveHandler=t=>{const e=t.touches[0];if(!e||t.touches.length===2||(t=>{if(!(t&&t instanceof HTMLElement))return!1;const e=t.ownerDocument?.defaultView?.getSelection();return!(!e||e.isCollapsed||!e.containsNode(t,!0))||'selectionStart'in t&&'selectionEnd'in t&&Number(t.selectionStart)<Number(t.selectionEnd)&&t.ownerDocument?.activeElement===t})(t.target))return;if(!t.cancelable)return;if(!iosActiveScrollElement||iosTouchStartY===null)return void t.preventDefault();const o=e.clientY-Number(iosTouchStartY);(iosActiveScrollElement.scrollTop<=0&&o>0||iosActiveScrollElement.scrollTop+iosActiveScrollElement.clientHeight>=iosActiveScrollElement.scrollHeight&&o<0)&&t.preventDefault()},document.addEventListener('touchstart',touchStartHandler,TOUCH_EVENT_OPTIONS),document.addEventListener('touchmove',touchMoveHandler,TOUCH_EVENT_OPTIONS))),setScrollLockCount(e+1)})(o),()=>{(()=>{iosScrollableBlocks.pop();const t=getScrollLockCount();const e=Math.max(0,t-1);setScrollLockCount(e),e===0&&(resetScrollLockStyles(),touchStartHandler&&(document.removeEventListener('touchstart',touchStartHandler,TOUCH_EVENT_OPTIONS),touchStartHandler=null),touchMoveHandler&&(document.removeEventListener('touchmove',touchMoveHandler,TOUCH_EVENT_OPTIONS),touchMoveHandler=null),iosActiveScrollElement=null,iosTouchStartY=null)})()}):((()=>{const t=getScrollLockCount();t===0&&applyScrollLockStyles(),setScrollLockCount(t+1)})(),()=>{(()=>{const t=getScrollLockCount();if(t<=0)return;const e=t-1;setScrollLockCount(e),e===0&&resetScrollLockStyles()})()})}),[o,e])};
|
|
2
|
+
//# sourceMappingURL=useScrollLock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollLock.js","sources":["../../../src/hooks/useScrollLock.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport type { Nullable } from 'shared/types'\n\ntype ScrollLockParams = {\n /**\n * Блокировать скролл.\n */\n locked: boolean\n /**\n * Контейнер, в котором разрешена прокрутка на iOS при заблокированном скролле страницы.\n */\n iosAllowedScrollContainer?: HTMLElement\n}\n\nconst TOUCH_EVENT_OPTIONS = { capture: true, passive: false }\nconst DATA_SCROLL_LOCK_COUNT = 'scrollLockCount'\nconst DATA_PREV_OVERFLOW = 'prevOverflow'\nconst DATA_PREV_PADDING_RIGHT = 'prevPaddingRight'\n\nconst supportsScrollbarGutter = typeof CSS !== 'undefined' && CSS.supports('scrollbar-gutter: stable')\nconst isIosDevice =\n typeof window !== 'undefined' &&\n window.navigator?.userAgent &&\n (/iP(ad|hone|od)/.test(window.navigator.userAgent) ||\n (window.navigator.userAgent.includes('Macintosh') && window.navigator.maxTouchPoints > 1))\n\nconst iosScrollableBlocks: HTMLElement[] = []\nlet iosActiveScrollElement: Nullable<HTMLElement> = null\nlet iosTouchStartY: Nullable<number> = null\nlet touchStartHandler: Nullable<(event: TouchEvent) => void> = null\nlet touchMoveHandler: Nullable<(event: TouchEvent) => void> = null\n\nfunction getScrollLockCount(): number {\n return Number(document.documentElement.dataset[DATA_SCROLL_LOCK_COUNT] || 0)\n}\n\nfunction setScrollLockCount(count: number) {\n document.documentElement.dataset[DATA_SCROLL_LOCK_COUNT] = count.toString()\n}\n\nfunction applyScrollLockStyles() {\n const root = document.documentElement\n root.dataset[DATA_PREV_OVERFLOW] = root.style.overflow || ''\n\n if (supportsScrollbarGutter && !isIosDevice) {\n root.style.scrollbarGutter = 'stable'\n } else {\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth\n root.dataset[DATA_PREV_PADDING_RIGHT] = root.style.paddingRight || ''\n if (scrollbarWidth > 0) {\n const currentPaddingRight = parseInt(window.getComputedStyle(root).paddingRight || '0', 10)\n root.style.paddingRight = `${currentPaddingRight + scrollbarWidth}px`\n }\n }\n root.style.overflow = 'hidden'\n}\n\nfunction resetScrollLockStyles() {\n const root = document.documentElement\n root.style.overflow = root.dataset[DATA_PREV_OVERFLOW] || ''\n root.style.paddingRight = root.dataset[DATA_PREV_PADDING_RIGHT] || ''\n delete root.dataset[DATA_PREV_OVERFLOW]\n delete root.dataset[DATA_PREV_PADDING_RIGHT]\n}\n\nfunction lockScroll() {\n const count = getScrollLockCount()\n if (count === 0) {\n applyScrollLockStyles()\n }\n setScrollLockCount(count + 1)\n}\n\nfunction unlockScroll() {\n const currentCount = getScrollLockCount()\n if (currentCount <= 0) {\n return\n }\n\n const nextCount = currentCount - 1\n setScrollLockCount(nextCount)\n if (nextCount === 0) {\n resetScrollLockStyles()\n }\n}\n\nfunction isScrollable(element: HTMLElement): boolean {\n const style = getComputedStyle(element)\n const overflowY = style.overflowY === 'auto' || style.overflowY === 'scroll'\n\n return overflowY && element.scrollHeight > element.clientHeight\n}\n\nfunction findScrollableParent(startElement: HTMLElement, root: HTMLElement): Nullable<HTMLElement> {\n let element: Nullable<HTMLElement> = startElement\n\n while (element && element !== root.parentElement) {\n if (isScrollable(element)) {\n return element\n }\n\n element = element.parentElement\n }\n\n if (isScrollable(root)) {\n return root\n }\n\n return null\n}\n\nfunction isTouchMoveAllowed(target: Nullable<EventTarget>): boolean {\n if (!target || !(target instanceof HTMLElement)) {\n return false\n }\n\n const selection = target.ownerDocument?.defaultView?.getSelection()\n if (selection && !selection.isCollapsed && selection.containsNode(target, true)) {\n return true\n }\n\n if (\n 'selectionStart' in target &&\n 'selectionEnd' in target &&\n Number(target.selectionStart) < Number(target.selectionEnd) &&\n target.ownerDocument?.activeElement === target\n ) {\n return true\n }\n\n return false\n}\n\nfunction addIOSEvents() {\n if (touchMoveHandler || touchStartHandler) {\n return\n }\n\n touchStartHandler = (event: TouchEvent) => {\n const target = event.target\n if (!(target instanceof HTMLElement)) {\n iosActiveScrollElement = null\n iosTouchStartY = null\n\n return\n }\n\n iosTouchStartY = event.touches[0]?.clientY ?? null\n iosActiveScrollElement = null\n for (const block of iosScrollableBlocks) {\n if (block.contains(target)) {\n const scrollElement = findScrollableParent(target, block)\n if (scrollElement) {\n iosActiveScrollElement = scrollElement\n break\n }\n }\n }\n }\n\n touchMoveHandler = (event: TouchEvent) => {\n const touch = event.touches[0]\n if (!touch || event.touches.length === 2 || isTouchMoveAllowed(event.target)) {\n return\n }\n\n if (!event.cancelable) {\n return\n }\n\n if (!iosActiveScrollElement || iosTouchStartY === null) {\n event.preventDefault()\n\n return\n }\n\n const currentY = touch.clientY\n const deltaY = currentY - Number(iosTouchStartY)\n const atTop = iosActiveScrollElement.scrollTop <= 0\n const atBottom =\n iosActiveScrollElement.scrollTop + iosActiveScrollElement.clientHeight >= iosActiveScrollElement.scrollHeight\n if ((atTop && deltaY > 0) || (atBottom && deltaY < 0)) {\n event.preventDefault()\n }\n }\n\n document.addEventListener('touchstart', touchStartHandler, TOUCH_EVENT_OPTIONS)\n document.addEventListener('touchmove', touchMoveHandler, TOUCH_EVENT_OPTIONS)\n}\n\nfunction removeIOSEvents() {\n if (touchStartHandler) {\n document.removeEventListener('touchstart', touchStartHandler, TOUCH_EVENT_OPTIONS)\n touchStartHandler = null\n }\n if (touchMoveHandler) {\n document.removeEventListener('touchmove', touchMoveHandler, TOUCH_EVENT_OPTIONS)\n touchMoveHandler = null\n }\n iosActiveScrollElement = null\n iosTouchStartY = null\n}\n\nfunction lockScrollIOS(scrollableContainer: HTMLElement) {\n iosScrollableBlocks.push(scrollableContainer)\n const count = getScrollLockCount()\n if (count === 0) {\n applyScrollLockStyles()\n addIOSEvents()\n }\n setScrollLockCount(count + 1)\n}\n\nfunction unlockScrollIOS() {\n iosScrollableBlocks.pop()\n const count = getScrollLockCount()\n const nexCount = Math.max(0, count - 1)\n setScrollLockCount(nexCount)\n if (nexCount === 0) {\n resetScrollLockStyles()\n removeIOSEvents()\n }\n}\n\nfunction useScrollLock(params: ScrollLockParams) {\n const { locked, iosAllowedScrollContainer = document.documentElement } = params\n\n useEffect(() => {\n if (!locked) {\n return\n }\n\n if (isIosDevice) {\n lockScrollIOS(iosAllowedScrollContainer)\n\n return () => {\n unlockScrollIOS()\n }\n }\n\n lockScroll()\n\n return () => {\n unlockScroll()\n }\n }, [iosAllowedScrollContainer, locked])\n}\n\nexport { useScrollLock }\n"],"names":["TOUCH_EVENT_OPTIONS","capture","passive","supportsScrollbarGutter","CSS","supports","isIosDevice","window","navigator","userAgent","test","includes","maxTouchPoints","iosScrollableBlocks","iosActiveScrollElement","iosTouchStartY","touchStartHandler","touchMoveHandler","getScrollLockCount","Number","document","documentElement","dataset","setScrollLockCount","count","toString","applyScrollLockStyles","root","style","overflow","scrollbarGutter","scrollbarWidth","innerWidth","clientWidth","paddingRight","currentPaddingRight","parseInt","getComputedStyle","resetScrollLockStyles","isScrollable","element","overflowY","scrollHeight","clientHeight","findScrollableParent","startElement","parentElement","params","locked","iosAllowedScrollContainer","useEffect","scrollableContainer","push","event","target","HTMLElement","touches","clientY","block","contains","scrollElement","touch","length","selection","ownerDocument","defaultView","getSelection","isCollapsed","containsNode","selectionStart","selectionEnd","activeElement","isTouchMoveAllowed","cancelable","preventDefault","deltaY","scrollTop","addEventListener","lockScrollIOS","pop","nexCount","Math","max","removeEventListener","unlockScrollIOS","lockScroll","currentCount","nextCount","unlockScroll"],"mappings":"wCAcA,MAAMA,oBAAsB,CAAEC,SAAS,EAAMC,SAAS,GAKtD,MAAMC,+BAAiCC,KAAQ,aAAeA,IAAIC,SAAS,4BAC3E,MAAMC,mBACGC,QAAW,aAClBA,OAAOC,WAAWC,YACjB,iBAAiBC,KAAKH,OAAOC,UAAUC,YACrCF,OAAOC,UAAUC,UAAUE,SAAS,cAAgBJ,OAAOC,UAAUI,eAAiB,GAE3F,MAAMC,oBAAqC,GAC3C,IAAIC,uBAAgD,KACpD,IAAIC,eAAmC,KACvC,IAAIC,kBAA2D,KAC/D,IAAIC,iBAA0D,KAE9D,SAASC,qBACP,OAAOC,OAAOC,SAASC,gBAAgBC,QAA8B,iBAAK,EAC5E,CAEA,SAASC,mBAAmBC,GAC1BJ,SAASC,gBAAgBC,QAA8B,gBAAIE,EAAMC,UACnE,CAEA,SAASC,wBACP,MAAMC,EAAOP,SAASC,gBAGtB,GAFAM,EAAKL,QAA0B,aAAIK,EAAKC,MAAMC,UAAY,GAEtD1B,0BAA4BG,YAC9BqB,EAAKC,MAAME,gBAAkB,aACxB,CACL,MAAMC,EAAiBxB,OAAOyB,WAAaZ,SAASC,gBAAgBY,YAEpE,GADAN,EAAKL,QAA+B,iBAAIK,EAAKC,MAAMM,cAAgB,GAC/DH,EAAiB,EAAG,CACtB,MAAMI,EAAsBC,SAAS7B,OAAO8B,iBAA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ACE,MAAMC,EAAepE,qBACrB,GAAIoE,GAAgB,EAClB,OAGF,MAAMC,EAAYD,EAAe,EACjC/D,mBAAmBgE,GACfA,IAAc,GAChBjD,uBAEJ,EA+JMkD,EAAc,EACf,GACA,CAACvC,EAA2BD,GACjC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useEffect}from'react';const TOUCH_EVENT_OPTIONS={capture:!0,passive:!1};const supportsScrollbarGutter=typeof CSS!='undefined'&&CSS.supports('scrollbar-gutter: stable');const isIosDevice=typeof window!='undefined'&&window.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window.navigator.userAgent.includes('Macintosh')&&window.navigator.maxTouchPoints>1);const iosScrollableBlocks=[];let iosActiveScrollElement=null;let iosTouchStartY=null;let touchStartHandler=null;let touchMoveHandler=null;function getScrollLockCount(){return Number(document.documentElement.dataset.scrollLockCount||0)}function setScrollLockCount(t){document.documentElement.dataset.scrollLockCount=t.toString()}function applyScrollLockStyles(){const t=document.documentElement;if(t.dataset.prevOverflow=t.style.overflow||'',supportsScrollbarGutter&&!isIosDevice)t.style.scrollbarGutter='stable';else{const e=window.innerWidth-document.documentElement.clientWidth;if(t.dataset.prevPaddingRight=t.style.paddingRight||'',e>0){const o=parseInt(window.getComputedStyle(t).paddingRight||'0',10);t.style.paddingRight=`${o+e}px`}}t.style.overflow='hidden'}function resetScrollLockStyles(){const t=document.documentElement;t.style.overflow=t.dataset.prevOverflow||'',t.style.paddingRight=t.dataset.prevPaddingRight||'',delete t.dataset.prevOverflow,delete t.dataset.prevPaddingRight}function isScrollable(t){const e=getComputedStyle(t);return(e.overflowY==='auto'||e.overflowY==='scroll')&&t.scrollHeight>t.clientHeight}function findScrollableParent(t,e){let o=t;for(;o&&o!==e.parentElement;){if(isScrollable(o))return o;o=o.parentElement}return isScrollable(e)?e:null}function useScrollLock(t){const{locked:e,iosAllowedScrollContainer:o=document.documentElement}=t;useEffect((()=>{if(e)return isIosDevice?((t=>{iosScrollableBlocks.push(t);const e=getScrollLockCount();e===0&&(applyScrollLockStyles(),touchMoveHandler||touchStartHandler||(touchStartHandler=t=>{const e=t.target;if(!(e instanceof HTMLElement))return iosActiveScrollElement=null,void(iosTouchStartY=null);iosTouchStartY=t.touches[0]?.clientY??null,iosActiveScrollElement=null;for(const t of iosScrollableBlocks)if(t.contains(e)){const o=findScrollableParent(e,t);if(o){iosActiveScrollElement=o;break}}},touchMoveHandler=t=>{const e=t.touches[0];if(!e||t.touches.length===2||(t=>{if(!(t&&t instanceof HTMLElement))return!1;const e=t.ownerDocument?.defaultView?.getSelection();return!(!e||e.isCollapsed||!e.containsNode(t,!0))||'selectionStart'in t&&'selectionEnd'in t&&Number(t.selectionStart)<Number(t.selectionEnd)&&t.ownerDocument?.activeElement===t})(t.target))return;if(!t.cancelable)return;if(!iosActiveScrollElement||iosTouchStartY===null)return void t.preventDefault();const o=e.clientY-Number(iosTouchStartY);(iosActiveScrollElement.scrollTop<=0&&o>0||iosActiveScrollElement.scrollTop+iosActiveScrollElement.clientHeight>=iosActiveScrollElement.scrollHeight&&o<0)&&t.preventDefault()},document.addEventListener('touchstart',touchStartHandler,TOUCH_EVENT_OPTIONS),document.addEventListener('touchmove',touchMoveHandler,TOUCH_EVENT_OPTIONS))),setScrollLockCount(e+1)})(o),()=>{(()=>{iosScrollableBlocks.pop();const t=getScrollLockCount();const e=Math.max(0,t-1);setScrollLockCount(e),e===0&&(resetScrollLockStyles(),touchStartHandler&&(document.removeEventListener('touchstart',touchStartHandler,TOUCH_EVENT_OPTIONS),touchStartHandler=null),touchMoveHandler&&(document.removeEventListener('touchmove',touchMoveHandler,TOUCH_EVENT_OPTIONS),touchMoveHandler=null),iosActiveScrollElement=null,iosTouchStartY=null)})()}):((()=>{const t=getScrollLockCount();t===0&&applyScrollLockStyles(),setScrollLockCount(t+1)})(),()=>{(()=>{const t=getScrollLockCount();if(t<=0)return;const e=t-1;setScrollLockCount(e),e===0&&resetScrollLockStyles()})()})}),[o,e])}export{useScrollLock};
|
|
2
|
+
//# sourceMappingURL=useScrollLock.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollLock.mjs","sources":["../../../src/hooks/useScrollLock.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport type { Nullable } from 'shared/types'\n\ntype ScrollLockParams = {\n /**\n * Блокировать скролл.\n */\n locked: boolean\n /**\n * Контейнер, в котором разрешена прокрутка на iOS при заблокированном скролле страницы.\n */\n iosAllowedScrollContainer?: HTMLElement\n}\n\nconst TOUCH_EVENT_OPTIONS = { capture: true, passive: false }\nconst DATA_SCROLL_LOCK_COUNT = 'scrollLockCount'\nconst DATA_PREV_OVERFLOW = 'prevOverflow'\nconst DATA_PREV_PADDING_RIGHT = 'prevPaddingRight'\n\nconst supportsScrollbarGutter = typeof CSS !== 'undefined' && CSS.supports('scrollbar-gutter: stable')\nconst isIosDevice =\n typeof window !== 'undefined' &&\n window.navigator?.userAgent &&\n (/iP(ad|hone|od)/.test(window.navigator.userAgent) ||\n (window.navigator.userAgent.includes('Macintosh') && window.navigator.maxTouchPoints > 1))\n\nconst iosScrollableBlocks: HTMLElement[] = []\nlet iosActiveScrollElement: Nullable<HTMLElement> = null\nlet iosTouchStartY: Nullable<number> = null\nlet touchStartHandler: Nullable<(event: TouchEvent) => void> = null\nlet touchMoveHandler: Nullable<(event: TouchEvent) => void> = null\n\nfunction getScrollLockCount(): number {\n return Number(document.documentElement.dataset[DATA_SCROLL_LOCK_COUNT] || 0)\n}\n\nfunction setScrollLockCount(count: number) {\n document.documentElement.dataset[DATA_SCROLL_LOCK_COUNT] = count.toString()\n}\n\nfunction applyScrollLockStyles() {\n const root = document.documentElement\n root.dataset[DATA_PREV_OVERFLOW] = root.style.overflow || ''\n\n if (supportsScrollbarGutter && !isIosDevice) {\n root.style.scrollbarGutter = 'stable'\n } else {\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth\n root.dataset[DATA_PREV_PADDING_RIGHT] = root.style.paddingRight || ''\n if (scrollbarWidth > 0) {\n const currentPaddingRight = parseInt(window.getComputedStyle(root).paddingRight || '0', 10)\n root.style.paddingRight = `${currentPaddingRight + scrollbarWidth}px`\n }\n }\n root.style.overflow = 'hidden'\n}\n\nfunction resetScrollLockStyles() {\n const root = document.documentElement\n root.style.overflow = root.dataset[DATA_PREV_OVERFLOW] || ''\n root.style.paddingRight = root.dataset[DATA_PREV_PADDING_RIGHT] || ''\n delete root.dataset[DATA_PREV_OVERFLOW]\n delete root.dataset[DATA_PREV_PADDING_RIGHT]\n}\n\nfunction lockScroll() {\n const count = getScrollLockCount()\n if (count === 0) {\n applyScrollLockStyles()\n }\n setScrollLockCount(count + 1)\n}\n\nfunction unlockScroll() {\n const currentCount = getScrollLockCount()\n if (currentCount <= 0) {\n return\n }\n\n const nextCount = currentCount - 1\n setScrollLockCount(nextCount)\n if (nextCount === 0) {\n resetScrollLockStyles()\n }\n}\n\nfunction isScrollable(element: HTMLElement): boolean {\n const style = getComputedStyle(element)\n const overflowY = style.overflowY === 'auto' || style.overflowY === 'scroll'\n\n return overflowY && element.scrollHeight > element.clientHeight\n}\n\nfunction findScrollableParent(startElement: HTMLElement, root: HTMLElement): Nullable<HTMLElement> {\n let element: Nullable<HTMLElement> = startElement\n\n while (element && element !== root.parentElement) {\n if (isScrollable(element)) {\n return element\n }\n\n element = element.parentElement\n }\n\n if (isScrollable(root)) {\n return root\n }\n\n return null\n}\n\nfunction isTouchMoveAllowed(target: Nullable<EventTarget>): boolean {\n if (!target || !(target instanceof HTMLElement)) {\n return false\n }\n\n const selection = target.ownerDocument?.defaultView?.getSelection()\n if (selection && !selection.isCollapsed && selection.containsNode(target, true)) {\n return true\n }\n\n if (\n 'selectionStart' in target &&\n 'selectionEnd' in target &&\n Number(target.selectionStart) < Number(target.selectionEnd) &&\n target.ownerDocument?.activeElement === target\n ) {\n return true\n }\n\n return false\n}\n\nfunction addIOSEvents() {\n if (touchMoveHandler || touchStartHandler) {\n return\n }\n\n touchStartHandler = (event: TouchEvent) => {\n const target = event.target\n if (!(target instanceof HTMLElement)) {\n iosActiveScrollElement = null\n iosTouchStartY = null\n\n return\n }\n\n iosTouchStartY = event.touches[0]?.clientY ?? null\n iosActiveScrollElement = null\n for (const block of iosScrollableBlocks) {\n if (block.contains(target)) {\n const scrollElement = findScrollableParent(target, block)\n if (scrollElement) {\n iosActiveScrollElement = scrollElement\n break\n }\n }\n }\n }\n\n touchMoveHandler = (event: TouchEvent) => {\n const touch = event.touches[0]\n if (!touch || event.touches.length === 2 || isTouchMoveAllowed(event.target)) {\n return\n }\n\n if (!event.cancelable) {\n return\n }\n\n if (!iosActiveScrollElement || iosTouchStartY === null) {\n event.preventDefault()\n\n return\n }\n\n const currentY = touch.clientY\n const deltaY = currentY - Number(iosTouchStartY)\n const atTop = iosActiveScrollElement.scrollTop <= 0\n const atBottom =\n iosActiveScrollElement.scrollTop + iosActiveScrollElement.clientHeight >= iosActiveScrollElement.scrollHeight\n if ((atTop && deltaY > 0) || (atBottom && deltaY < 0)) {\n event.preventDefault()\n }\n }\n\n document.addEventListener('touchstart', touchStartHandler, TOUCH_EVENT_OPTIONS)\n document.addEventListener('touchmove', touchMoveHandler, TOUCH_EVENT_OPTIONS)\n}\n\nfunction removeIOSEvents() {\n if (touchStartHandler) {\n document.removeEventListener('touchstart', touchStartHandler, TOUCH_EVENT_OPTIONS)\n touchStartHandler = null\n }\n if (touchMoveHandler) {\n document.removeEventListener('touchmove', touchMoveHandler, TOUCH_EVENT_OPTIONS)\n touchMoveHandler = null\n }\n iosActiveScrollElement = null\n iosTouchStartY = null\n}\n\nfunction lockScrollIOS(scrollableContainer: HTMLElement) {\n iosScrollableBlocks.push(scrollableContainer)\n const count = getScrollLockCount()\n if (count === 0) {\n applyScrollLockStyles()\n addIOSEvents()\n }\n setScrollLockCount(count + 1)\n}\n\nfunction unlockScrollIOS() {\n iosScrollableBlocks.pop()\n const count = getScrollLockCount()\n const nexCount = Math.max(0, count - 1)\n setScrollLockCount(nexCount)\n if (nexCount === 0) {\n resetScrollLockStyles()\n removeIOSEvents()\n }\n}\n\nfunction useScrollLock(params: ScrollLockParams) {\n const { locked, iosAllowedScrollContainer = document.documentElement } = params\n\n useEffect(() => {\n if (!locked) {\n return\n }\n\n if (isIosDevice) {\n lockScrollIOS(iosAllowedScrollContainer)\n\n return () => {\n unlockScrollIOS()\n }\n }\n\n lockScroll()\n\n return () => {\n unlockScroll()\n }\n }, [iosAllowedScrollContainer, locked])\n}\n\nexport { useScrollLock }\n"],"names":["TOUCH_EVENT_OPTIONS","capture","passive","supportsScrollbarGutter","CSS","supports","isIosDevice","window","navigator","userAgent","test","includes","maxTouchPoints","iosScrollableBlocks","iosActiveScrollElement","iosTouchStartY","touchStartHandler","touchMoveHandler","getScrollLockCount","Number","document","documentElement","dataset","setScrollLockCount","count","toString","applyScrollLockStyles","root","style","overflow","scrollbarGutter","scrollbarWidth","innerWidth","clientWidth","paddingRight","currentPaddingRight","parseInt","getComputedStyle","resetScrollLockStyles","isScrollable","element","overflowY","scrollHeight","clientHeight","findScrollableParent","startElement","parentElement","useScrollLock","params","locked","iosAllowedScrollContainer","useEffect","scrollableContainer","push","event","target","HTMLElement","touches","clientY","block","contains","scrollElement","touch","length","selection","ownerDocument","defaultView","getSelection","isCollapsed","containsNode","selectionStart","selectionEnd","activeElement","isTouchMoveAllowed","cancelable","preventDefault","deltaY","scrollTop","addEventListener","lockScrollIOS","pop","nexCount","Math","max","removeEventListener","unlockScrollIOS","lockScroll","currentCount","nextCount","unlockScroll"],"mappings":"6BAcA,MAAMA,oBAAsB,CAAEC,SAAS,EAAMC,SAAS,GAKtD,MAAMC,+BAAiCC,KAAQ,aAAeA,IAAIC,SAAS,4BAC3E,MAAMC,mBACGC,QAAW,aAClBA,OAAOC,WAAWC,YACjB,iBAAiBC,KAAKH,OAAOC,UAAUC,YACrCF,OAAOC,UAAUC,UAAUE,SAAS,cAAgBJ,OAAOC,UAAUI,eAAiB,GAE3F,MAAMC,oBA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