@finam/web-ui-kit-components 3.34.0 → 3.34.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ ## 3.34.1
2
+ * В `DraggablePopover` ограничено число последовательных коррекций позиции: окно, размер которого зависит от собственной позиции, больше не вызывает бесконечную цепочку `onChangePosition`; при достижении лимита в консоль выводится `warning` с историей коррекций и метриками экрана
1
3
  ## 3.34.0
2
4
  * В `TextArea` добавлен prop `resizable` — изменение высоты поля пользователем за правый нижний угол
3
5
  * В `TextArea` применён `customScroll`
@@ -1 +1 @@
1
- {"version":3,"file":"DraggablePopover.d.ts","sourceRoot":"","sources":["../../src/DraggablePopover/DraggablePopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,SAAS,EAEV,MAAM,OAAO,CAAC;AAGf,OAAkB,EAAE,eAAe,EAAiC,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAO5G,OAAO,EAAE,YAAY,EAAuB,MAAM,mBAAmB,CAAC;AAUtE,MAAM,WAAW,KAAM,SAAQ,OAAO,CAAC,cAAc,CAAC;IACpD,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,IAAI,EAAE,OAAO,CAAC;IACd,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,uCAAuC;IACvC,QAAQ,EAAE,SAAS,CAAC;IACpB,sEAAsE;IACtE,gBAAgB,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,CAAC;IACtD,yBAAyB;IACzB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,oFAAoF;IACpF,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED,YAAY,EAAE,eAAe,EAAE,CAAC;wMAY7B,KAAK;AAuMR,wBAAsC"}
1
+ {"version":3,"file":"DraggablePopover.d.ts","sourceRoot":"","sources":["../../src/DraggablePopover/DraggablePopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,SAAS,EAEV,MAAM,OAAO,CAAC;AAGf,OAAkB,EAAE,eAAe,EAAiC,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAO5G,OAAO,EAAE,YAAY,EAAuB,MAAM,mBAAmB,CAAC;AAoCtE,MAAM,WAAW,KAAM,SAAQ,OAAO,CAAC,cAAc,CAAC;IACpD,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,IAAI,EAAE,OAAO,CAAC;IACd,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,uCAAuC;IACvC,QAAQ,EAAE,SAAS,CAAC;IACpB,sEAAsE;IACtE,gBAAgB,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,CAAC;IACtD,yBAAyB;IACzB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,oFAAoF;IACpF,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED,YAAY,EAAE,eAAe,EAAE,CAAC;wMAY7B,KAAK;AAiQR,wBAAsC"}
@@ -19,6 +19,7 @@ import { DraggableWrap, PaperStyled, transitionClassName } from "./DraggablePopo
19
19
  import { useIsomorphicEffect } from "../utils/useIsomorphicEffect.js";
20
20
  import { transitionClassNames } from "../utils/transition.js";
21
21
  const DEFAULT_OFFSET = 16;
22
+ const MAX_POSITION_CORRECTIONS = 2;
22
23
  const DraggablePopover = (_0)=>{
23
24
  let { show, children, onEsc, layerId: layerIdProp, className, onChangePosition, onExited, modalManager: modalManagerProp } = _0, draggableProps = _object_without_properties__(_0, [
24
25
  "show",
@@ -38,6 +39,12 @@ const DraggablePopover = (_0)=>{
38
39
  const rootRef = useRef(null);
39
40
  const [zIndex, setZIndex] = useState(0);
40
41
  const [resized, setResized] = useReducer((prev)=>!prev, false);
42
+ const correctionsRef = useRef({
43
+ resized,
44
+ count: 0,
45
+ warned: false,
46
+ log: []
47
+ });
41
48
  const positionX = null != (_ref = null != (_ref1 = null == positionProp ? void 0 : positionProp.x) ? _ref1 : null == defaultPosition ? void 0 : defaultPosition.x) ? _ref : DEFAULT_OFFSET;
42
49
  const positionY = null != (_ref2 = null != (_ref3 = null == positionProp ? void 0 : positionProp.y) ? _ref3 : null == defaultPosition ? void 0 : defaultPosition.y) ? _ref2 : DEFAULT_OFFSET;
43
50
  const position = useMemo(()=>correctPosition(positionX, positionY, popoverRef.current), [
@@ -66,6 +73,8 @@ const DraggablePopover = (_0)=>{
66
73
  onStart
67
74
  ]);
68
75
  const handleDragStop = useCallback((e, data)=>{
76
+ correctionsRef.current.count = 0;
77
+ correctionsRef.current.log = [];
69
78
  onChangePosition({
70
79
  x: data.x,
71
80
  y: data.y
@@ -116,6 +125,12 @@ const DraggablePopover = (_0)=>{
116
125
  useIsomorphicEffect(()=>{
117
126
  const popover = popoverRef.current;
118
127
  if (!popover) return;
128
+ if (correctionsRef.current.resized !== resized) correctionsRef.current = {
129
+ resized,
130
+ count: 0,
131
+ warned: false,
132
+ log: []
133
+ };
119
134
  const screenWidth = document.documentElement.scrollWidth;
120
135
  const screenHeight = document.documentElement.scrollHeight;
121
136
  const prevWidth = popover.style.width;
@@ -133,7 +148,50 @@ const DraggablePopover = (_0)=>{
133
148
  if (screenHeightDiff > 0) nextPosition.y -= screenHeightDiff;
134
149
  nextPosition.x = Math.max(0, nextPosition.x);
135
150
  nextPosition.y = Math.max(0, nextPosition.y);
136
- if (position.x !== nextPosition.x || position.y !== nextPosition.y) onChangePosition(nextPosition);
151
+ if (position.x !== nextPosition.x || position.y !== nextPosition.y) {
152
+ const corrections = correctionsRef.current;
153
+ if (corrections.log.length <= MAX_POSITION_CORRECTIONS) corrections.log.push({
154
+ from: position,
155
+ to: nextPosition,
156
+ diff: {
157
+ width: screenWidthDiff,
158
+ height: screenHeightDiff
159
+ },
160
+ popover: {
161
+ width: popover.offsetWidth,
162
+ height: popover.offsetHeight
163
+ }
164
+ });
165
+ if (corrections.count >= MAX_POSITION_CORRECTIONS) {
166
+ if (!corrections.warned) {
167
+ var _window_visualViewport, _window_visualViewport1, _window_visualViewport2;
168
+ corrections.warned = true;
169
+ console.warn(`DraggablePopover (layer "${layerIdRef.current}"): position corrections limit reached, popover is left outside the screen. If popover size changes together with position, the consumer makes its size depend on position (e.g. max-height from position.y); if size and diff stay the same, removing the popover changes the rest of the layout`, {
170
+ corrections: corrections.log,
171
+ resized,
172
+ screen: {
173
+ scrollWidth: screenWidth,
174
+ scrollHeight: screenHeight,
175
+ scrollWidthWithout: screenWidthWithout,
176
+ scrollHeightWithout: screenHeightWithout,
177
+ clientWidth: document.documentElement.clientWidth,
178
+ clientHeight: document.documentElement.clientHeight
179
+ },
180
+ viewport: {
181
+ devicePixelRatio: window.devicePixelRatio,
182
+ visualViewportScale: null == (_window_visualViewport = window.visualViewport) ? void 0 : _window_visualViewport.scale,
183
+ innerWidth: window.innerWidth,
184
+ innerHeight: window.innerHeight,
185
+ visualViewportWidth: null == (_window_visualViewport1 = window.visualViewport) ? void 0 : _window_visualViewport1.width,
186
+ visualViewportHeight: null == (_window_visualViewport2 = window.visualViewport) ? void 0 : _window_visualViewport2.height
187
+ }
188
+ });
189
+ }
190
+ return;
191
+ }
192
+ corrections.count += 1;
193
+ onChangePosition(nextPosition);
194
+ }
137
195
  }, [
138
196
  position.x,
139
197
  position.y,
@@ -1 +1 @@
1
- {"version":3,"file":"DraggablePopover/DraggablePopover.js","sources":["../../src/DraggablePopover/DraggablePopover.tsx"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n memo,\n useState,\n ReactNode,\n useReducer,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport debounce from 'lodash/debounce.js';\nimport Draggable, { ControlPosition, DraggableData, DraggableEvent, DraggableProps } from 'react-draggable';\nimport { CSSTransition } from 'react-transition-group';\nimport { tokens } from '@finam/web-ui-kit-core/theme/contract';\nimport { transitionGrow, transitionGrowParent } from '@finam/web-ui-kit-core/styles/transition';\nimport classNames from 'clsx';\n\nimport { KeyboardEventKey } from '../types.js';\nimport { ModalManager, defaultModalManager } from '../Modal/index.js';\nimport { useModalState } from '../ModalsProvider/index.js';\nimport { defaultLayersManager } from './layersManager.js';\nimport { correctPosition } from './utils.js';\nimport { PaperStyled, DraggableWrap, transitionClassName } from './DraggablePopover.styles.js';\nimport { useIsomorphicEffect } from '../utils/useIsomorphicEffect.js';\nimport { transitionClassNames } from '../utils/transition.js';\n\nconst DEFAULT_OFFSET = 16;\n\nexport interface Props extends Partial<DraggableProps> {\n /** Кастомные классы передаваемые в компонент Paper перетаскиваемого окна */\n className?: string;\n /** Идентификатор слоя, используется для управления порядком отображения окон */\n layerId?: string;\n /** Управление видимостью перетаскиваемого окна */\n show: boolean;\n /** Коллбэк, вызываемый на нажатие ESCAPE */\n onEsc?: () => void;\n /** Содержимое перетаскиваемого окна */\n children: ReactNode;\n /** Коллбэк, вызываемый при изменении позиции перетаскиваемого окна */\n onChangePosition: (position: ControlPosition) => void;\n /** from CSSTransition */\n onExited?: VoidFunction;\n /** Экземпляр класса ModalManager для управления порядком открытых модальных окон */\n modalManager?: ModalManager;\n}\n\nexport type { ControlPosition };\n\nconst DraggablePopover = ({\n show,\n children,\n onEsc,\n layerId: layerIdProp,\n className,\n onChangePosition,\n onExited,\n modalManager: modalManagerProp,\n ...draggableProps\n}: Props) => {\n const {\n position: positionProp,\n defaultPosition,\n onStart,\n onMouseDown,\n onStop,\n } = draggableProps;\n const { className: modalClassName } = useModalState();\n const layerIdRef = useRef<string>(layerIdProp || Math.random().toString());\n const popoverRef = useRef<HTMLDivElement | null>(null);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [zIndex, setZIndex] = useState(0);\n const [resized, setResized] = useReducer(prev => !prev, false);\n\n const positionX = positionProp?.x ?? defaultPosition?.x ?? DEFAULT_OFFSET;\n const positionY = positionProp?.y ?? defaultPosition?.y ?? DEFAULT_OFFSET;\n const position = useMemo(() => (\n correctPosition(positionX, positionY, popoverRef.current)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ), [positionX, positionY, resized]);\n\n const modalManager = modalManagerProp || defaultModalManager;\n\n const handleMouseDown = useCallback((e: MouseEvent) => {\n const popover = popoverRef.current;\n const layerId = layerIdRef.current;\n\n defaultLayersManager.setLayerActive(layerId);\n if (popover) {\n modalManager.remove(popover);\n modalManager.add(popover);\n }\n onMouseDown?.(e);\n }, [modalManager, onMouseDown]);\n\n const handleDragStart = useCallback((e: DraggableEvent, data: DraggableData) => {\n e.preventDefault();\n onStart?.(e, data);\n }, [onStart]);\n\n const handleDragStop = useCallback((e: DraggableEvent, data: DraggableData) => {\n onChangePosition({ x: data.x, y: data.y });\n onStop?.(e, data);\n }, [onChangePosition, onStop]);\n\n useEffect(() => {\n if (!show) return undefined;\n\n const popover = popoverRef.current;\n const layerId = layerIdRef.current;\n\n defaultLayersManager.addLayerListener(\n layerId,\n () => {\n setZIndex(prev => (defaultLayersManager.isLayerActive(layerId) ? 0 : prev + 1));\n },\n () => {\n setZIndex(prevZIndex => prevZIndex - 1);\n },\n );\n defaultLayersManager.setLayerActive(layerId);\n if (popover) {\n modalManager.add(popover);\n }\n\n return () => {\n defaultLayersManager.removeLayerListener(layerId);\n setZIndex(0);\n if (popover) {\n modalManager.remove(popover);\n }\n };\n }, [modalManager, show]);\n\n useEffect(() => {\n if (!show) return undefined;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const { key } = event;\n if (\n (key === KeyboardEventKey.ESCAPE || key === KeyboardEventKey.ESC) &&\n onEsc && !event.defaultPrevented &&\n defaultLayersManager.isLayerActive(layerIdRef.current) &&\n popoverRef.current && modalManager.isTop(popoverRef.current)\n ) {\n event.preventDefault();\n onEsc();\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [modalManager, onEsc, show]);\n\n useIsomorphicEffect(() => {\n const popover = popoverRef.current;\n if (!popover) return;\n\n const screenWidth = document.documentElement.scrollWidth;\n const screenHeight = document.documentElement.scrollHeight;\n\n const prevWidth = popover.style.width;\n const prevHeight = popover.style.height;\n popover.style.width = '0px';\n popover.style.height = '0px';\n const screenWidthWithout = document.documentElement.scrollWidth;\n const screenHeightWithout = document.documentElement.scrollHeight;\n popover.style.width = prevWidth;\n popover.style.height = prevHeight;\n\n const screenWidthDiff = screenWidth - screenWidthWithout;\n const screenHeightDiff = screenHeight - screenHeightWithout;\n\n const nextPosition = { ...position };\n if (screenWidthDiff > 0) {\n nextPosition.x -= screenWidthDiff;\n }\n if (screenHeightDiff > 0) {\n nextPosition.y -= screenHeightDiff;\n }\n\n nextPosition.x = Math.max(0, nextPosition.x);\n nextPosition.y = Math.max(0, nextPosition.y);\n\n if (position.x !== nextPosition.x || position.y !== nextPosition.y) {\n onChangePosition(nextPosition);\n }\n }, [position.x, position.y, resized, onChangePosition]);\n\n useEffect(() => {\n const popover = popoverRef.current;\n if (!show || !popover) return undefined;\n\n const handleResize = debounce(() => {\n setResized();\n }, 250);\n\n setResized();\n window.addEventListener('resize', handleResize);\n let resizeObserver: ResizeObserver | undefined;\n if ('ResizeObserver' in window) {\n try {\n resizeObserver = new window.ResizeObserver(handleResize);\n resizeObserver.observe(popover);\n } catch (e) {\n console.warn('Failed to create ResizeObserver for handling element resize', e);\n }\n }\n\n return () => {\n handleResize.cancel();\n window.removeEventListener('resize', handleResize);\n resizeObserver?.disconnect();\n };\n }, [show]);\n\n const paperClassName = classNames(\n transitionGrow(),\n className,\n );\n\n return createPortal(\n <Draggable\n bounds=\"parent\"\n {...draggableProps}\n nodeRef={popoverRef}\n position={position}\n onMouseDown={handleMouseDown}\n onStart={handleDragStart}\n onStop={handleDragStop}\n >\n <DraggableWrap\n ref={popoverRef}\n className={modalClassName}\n style={{ zIndex: `calc(${tokens.zIndex.draggablePopover} + ${zIndex})` }}\n >\n <CSSTransition\n nodeRef={rootRef}\n mountOnEnter={true}\n unmountOnExit={true}\n classNames={transitionClassNames([transitionGrowParent, transitionClassName])}\n timeout={300}\n in={show}\n onExited={onExited}\n >\n <PaperStyled shadow=\"modalDialog\" ref={rootRef} className={paperClassName} tabIndex={0}>\n {children}\n </PaperStyled>\n </CSSTransition>\n </DraggableWrap>\n </Draggable>,\n document.body,\n );\n};\n\nexport default memo(DraggablePopover);\n"],"names":["DEFAULT_OFFSET","DraggablePopover","show","children","onEsc","layerIdProp","className","onChangePosition","onExited","modalManagerProp","draggableProps","_ref","_ref2","positionProp","defaultPosition","onStart","onMouseDown","onStop","modalClassName","useModalState","layerIdRef","useRef","Math","popoverRef","rootRef","zIndex","setZIndex","useState","resized","setResized","useReducer","prev","positionX","positionY","position","useMemo","correctPosition","modalManager","defaultModalManager","handleMouseDown","useCallback","e","popover","layerId","defaultLayersManager","handleDragStart","data","handleDragStop","useEffect","prevZIndex","handleKeyDown","event","key","KeyboardEventKey","document","useIsomorphicEffect","screenWidth","screenHeight","prevWidth","prevHeight","screenWidthWithout","screenHeightWithout","screenWidthDiff","screenHeightDiff","nextPosition","handleResize","debounce","window","resizeObserver","console","paperClassName","classNames","transitionGrow","createPortal","Draggable","DraggableWrap","tokens","CSSTransition","transitionClassNames","transitionGrowParent","transitionClassName","PaperStyled","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,MAAMA,iBAAiB;AAuBvB,MAAMC,mBAAmB,CAAC;QAAA,EACxBC,IAAI,EACJC,QAAQ,EACRC,KAAK,EACL,SAASC,WAAW,EACpBC,SAAS,EACTC,gBAAgB,EAChBC,QAAQ,EACR,cAAcC,gBAAgB,EAExB,OADHC,iBAAAA,6BAAAA,IAAAA;;;;;;;;;;QAgBeC,MAAAA,OACAC,OAAAA;IAflB,MAAM,EACJ,UAAUC,YAAY,EACtBC,eAAe,EACfC,OAAO,EACPC,WAAW,EACXC,MAAM,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AOD,GAAG;YACV4B,QAAQ,IAAI,CAAC,+DAA+D5B;QAC9E;QAGF,OAAO;YACLwB,aAAa,MAAM;YACnBE,OAAO,mBAAmB,CAAC,UAAUF;YACrCG,QAAAA,kBAAAA,eAAgB,UAAU;QAC5B;IACF,GAAG;QAAClE;KAAK;IAET,MAAMoE,iBAAiBC,KACrBC,kBACAlE;IAGF,OAAO,WAAP,GAAOmE,aAAa,WAADA,GACjB,IAACC,iBAASA,uBAAAA,EAAAA;QACR,QAAO;OACHhE,iBAAAA;QACJ,SAASa;QACT,UAAUW;QACV,aAAaK;QACb,SAASM;QACT,QAAQE;kBAER,kBAAC4B,eAAaA;YACZ,KAAKpD;YACL,WAAWL;YACX,OAAO;gBAAE,QAAQ,CAAC,KAAK,EAAE0D,OAAO,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAEnD,OAAO,CAAC,CAAC;YAAC;sBAEvE,kBAACoD,eAAaA;gBACZ,SAASrD;gBACT,cAAc;gBACd,eAAe;gBACf,YAAYsD,qBAAqB;oBAACC;oBAAsBC;iBAAoB;gBAC5E,SAAS;gBACT,IAAI9E;gBACJ,UAAUM;0BAEV,kBAACyE,aAAWA;oBAAC,QAAO;oBAAc,KAAKzD;oBAAS,WAAW8C;oBAAgB,UAAU;8BAClFnE;;;;SAKTmD,SAAS,IAAI;AAEjB;AAEA,wDAAe4B,KAAKjF"}
1
+ {"version":3,"file":"DraggablePopover/DraggablePopover.js","sources":["../../src/DraggablePopover/DraggablePopover.tsx"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n memo,\n useState,\n ReactNode,\n useReducer,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport debounce from 'lodash/debounce.js';\nimport Draggable, { ControlPosition, DraggableData, DraggableEvent, DraggableProps } from 'react-draggable';\nimport { CSSTransition } from 'react-transition-group';\nimport { tokens } from '@finam/web-ui-kit-core/theme/contract';\nimport { transitionGrow, transitionGrowParent } from '@finam/web-ui-kit-core/styles/transition';\nimport classNames from 'clsx';\n\nimport { KeyboardEventKey } from '../types.js';\nimport { ModalManager, defaultModalManager } from '../Modal/index.js';\nimport { useModalState } from '../ModalsProvider/index.js';\nimport { defaultLayersManager } from './layersManager.js';\nimport { correctPosition } from './utils.js';\nimport { PaperStyled, DraggableWrap, transitionClassName } from './DraggablePopover.styles.js';\nimport { useIsomorphicEffect } from '../utils/useIsomorphicEffect.js';\nimport { transitionClassNames } from '../utils/transition.js';\n\nconst DEFAULT_OFFSET = 16;\n\n/**\n * Сколько коррекций позиции подряд допускается между изменениями размера окна и перетаскиваниями.\n * Если размер окна зависит от его позиции (например, потребитель задаёт `max-height` от `y`),\n * сдвиг окна не убирает переполнение экрана, и цепочка коррекций становится бесконечной.\n */\nconst MAX_POSITION_CORRECTIONS = 2;\n\n/** Запись об одной коррекции позиции, нужна для диагностики упёршейся в лимит цепочки */\ninterface CorrectionLog {\n /** Позиция, с которой окно отрисовано */\n from: ControlPosition;\n /** Позиция, на которую окно сдвигается */\n to: ControlPosition;\n /** Насколько окно выходит за скролл-размер документа */\n diff: { width: number; height: number; };\n /** Размер окна на момент коррекции: меняется вместе с позицией, если размер от неё зависит */\n popover: { width: number; height: number; };\n}\n\ninterface CorrectionsState {\n resized: boolean;\n count: number;\n warned: boolean;\n log: CorrectionLog[];\n}\n\nexport interface Props extends Partial<DraggableProps> {\n /** Кастомные классы передаваемые в компонент Paper перетаскиваемого окна */\n className?: string;\n /** Идентификатор слоя, используется для управления порядком отображения окон */\n layerId?: string;\n /** Управление видимостью перетаскиваемого окна */\n show: boolean;\n /** Коллбэк, вызываемый на нажатие ESCAPE */\n onEsc?: () => void;\n /** Содержимое перетаскиваемого окна */\n children: ReactNode;\n /** Коллбэк, вызываемый при изменении позиции перетаскиваемого окна */\n onChangePosition: (position: ControlPosition) => void;\n /** from CSSTransition */\n onExited?: VoidFunction;\n /** Экземпляр класса ModalManager для управления порядком открытых модальных окон */\n modalManager?: ModalManager;\n}\n\nexport type { ControlPosition };\n\nconst DraggablePopover = ({\n show,\n children,\n onEsc,\n layerId: layerIdProp,\n className,\n onChangePosition,\n onExited,\n modalManager: modalManagerProp,\n ...draggableProps\n}: Props) => {\n const {\n position: positionProp,\n defaultPosition,\n onStart,\n onMouseDown,\n onStop,\n } = draggableProps;\n const { className: modalClassName } = useModalState();\n const layerIdRef = useRef<string>(layerIdProp || Math.random().toString());\n const popoverRef = useRef<HTMLDivElement | null>(null);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [zIndex, setZIndex] = useState(0);\n const [resized, setResized] = useReducer(prev => !prev, false);\n const correctionsRef = useRef<CorrectionsState>({ resized, count: 0, warned: false, log: [] });\n\n const positionX = positionProp?.x ?? defaultPosition?.x ?? DEFAULT_OFFSET;\n const positionY = positionProp?.y ?? defaultPosition?.y ?? DEFAULT_OFFSET;\n const position = useMemo(() => (\n correctPosition(positionX, positionY, popoverRef.current)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ), [positionX, positionY, resized]);\n\n const modalManager = modalManagerProp || defaultModalManager;\n\n const handleMouseDown = useCallback((e: MouseEvent) => {\n const popover = popoverRef.current;\n const layerId = layerIdRef.current;\n\n defaultLayersManager.setLayerActive(layerId);\n if (popover) {\n modalManager.remove(popover);\n modalManager.add(popover);\n }\n onMouseDown?.(e);\n }, [modalManager, onMouseDown]);\n\n const handleDragStart = useCallback((e: DraggableEvent, data: DraggableData) => {\n e.preventDefault();\n onStart?.(e, data);\n }, [onStart]);\n\n const handleDragStop = useCallback((e: DraggableEvent, data: DraggableData) => {\n correctionsRef.current.count = 0;\n correctionsRef.current.log = [];\n onChangePosition({ x: data.x, y: data.y });\n onStop?.(e, data);\n }, [onChangePosition, onStop]);\n\n useEffect(() => {\n if (!show) return undefined;\n\n const popover = popoverRef.current;\n const layerId = layerIdRef.current;\n\n defaultLayersManager.addLayerListener(\n layerId,\n () => {\n setZIndex(prev => (defaultLayersManager.isLayerActive(layerId) ? 0 : prev + 1));\n },\n () => {\n setZIndex(prevZIndex => prevZIndex - 1);\n },\n );\n defaultLayersManager.setLayerActive(layerId);\n if (popover) {\n modalManager.add(popover);\n }\n\n return () => {\n defaultLayersManager.removeLayerListener(layerId);\n setZIndex(0);\n if (popover) {\n modalManager.remove(popover);\n }\n };\n }, [modalManager, show]);\n\n useEffect(() => {\n if (!show) return undefined;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const { key } = event;\n if (\n (key === KeyboardEventKey.ESCAPE || key === KeyboardEventKey.ESC) &&\n onEsc && !event.defaultPrevented &&\n defaultLayersManager.isLayerActive(layerIdRef.current) &&\n popoverRef.current && modalManager.isTop(popoverRef.current)\n ) {\n event.preventDefault();\n onEsc();\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [modalManager, onEsc, show]);\n\n useIsomorphicEffect(() => {\n const popover = popoverRef.current;\n if (!popover) return;\n\n if (correctionsRef.current.resized !== resized) {\n correctionsRef.current = { resized, count: 0, warned: false, log: [] };\n }\n\n const screenWidth = document.documentElement.scrollWidth;\n const screenHeight = document.documentElement.scrollHeight;\n\n const prevWidth = popover.style.width;\n const prevHeight = popover.style.height;\n popover.style.width = '0px';\n popover.style.height = '0px';\n const screenWidthWithout = document.documentElement.scrollWidth;\n const screenHeightWithout = document.documentElement.scrollHeight;\n popover.style.width = prevWidth;\n popover.style.height = prevHeight;\n\n const screenWidthDiff = screenWidth - screenWidthWithout;\n const screenHeightDiff = screenHeight - screenHeightWithout;\n\n const nextPosition = { ...position };\n if (screenWidthDiff > 0) {\n nextPosition.x -= screenWidthDiff;\n }\n if (screenHeightDiff > 0) {\n nextPosition.y -= screenHeightDiff;\n }\n\n nextPosition.x = Math.max(0, nextPosition.x);\n nextPosition.y = Math.max(0, nextPosition.y);\n\n if (position.x !== nextPosition.x || position.y !== nextPosition.y) {\n const corrections = correctionsRef.current;\n\n // Последняя запись — проход, упёршийся в лимит, остальные — применённые коррекции\n if (corrections.log.length <= MAX_POSITION_CORRECTIONS) {\n corrections.log.push({\n from: position,\n to: nextPosition,\n diff: { width: screenWidthDiff, height: screenHeightDiff },\n popover: { width: popover.offsetWidth, height: popover.offsetHeight },\n });\n }\n\n if (corrections.count >= MAX_POSITION_CORRECTIONS) {\n if (!corrections.warned) {\n corrections.warned = true;\n console.warn(\n `DraggablePopover (layer \"${layerIdRef.current}\"): position corrections limit reached, ` +\n 'popover is left outside the screen. If popover size changes together with position, ' +\n 'the consumer makes its size depend on position (e.g. max-height from position.y); ' +\n 'if size and diff stay the same, removing the popover changes the rest of the layout',\n {\n corrections: corrections.log,\n resized,\n screen: {\n scrollWidth: screenWidth,\n scrollHeight: screenHeight,\n scrollWidthWithout: screenWidthWithout,\n scrollHeightWithout: screenHeightWithout,\n clientWidth: document.documentElement.clientWidth,\n clientHeight: document.documentElement.clientHeight,\n },\n viewport: {\n /** Зум браузера и масштаб системы по отдельности не различимы, меняется оба раза */\n devicePixelRatio: window.devicePixelRatio,\n /** Масштаб жестом, на десктопе всегда 1 */\n visualViewportScale: window.visualViewport?.scale,\n /** Больше clientWidth/clientHeight на полосы скроллбаров */\n innerWidth: window.innerWidth,\n innerHeight: window.innerHeight,\n /** Дробный размер вьюпорта: при зуме не совпадает с целым clientWidth/clientHeight */\n visualViewportWidth: window.visualViewport?.width,\n visualViewportHeight: window.visualViewport?.height,\n },\n },\n );\n }\n\n return;\n }\n\n corrections.count += 1;\n onChangePosition(nextPosition);\n }\n }, [position.x, position.y, resized, onChangePosition]);\n\n useEffect(() => {\n const popover = popoverRef.current;\n if (!show || !popover) return undefined;\n\n const handleResize = debounce(() => {\n setResized();\n }, 250);\n\n setResized();\n window.addEventListener('resize', handleResize);\n let resizeObserver: ResizeObserver | undefined;\n if ('ResizeObserver' in window) {\n try {\n resizeObserver = new window.ResizeObserver(handleResize);\n resizeObserver.observe(popover);\n } catch (e) {\n console.warn('Failed to create ResizeObserver for handling element resize', e);\n }\n }\n\n return () => {\n handleResize.cancel();\n window.removeEventListener('resize', handleResize);\n resizeObserver?.disconnect();\n };\n }, [show]);\n\n const paperClassName = classNames(\n transitionGrow(),\n className,\n );\n\n return createPortal(\n <Draggable\n bounds=\"parent\"\n {...draggableProps}\n nodeRef={popoverRef}\n position={position}\n onMouseDown={handleMouseDown}\n onStart={handleDragStart}\n onStop={handleDragStop}\n >\n <DraggableWrap\n ref={popoverRef}\n className={modalClassName}\n style={{ zIndex: `calc(${tokens.zIndex.draggablePopover} + ${zIndex})` }}\n >\n <CSSTransition\n nodeRef={rootRef}\n mountOnEnter={true}\n unmountOnExit={true}\n classNames={transitionClassNames([transitionGrowParent, transitionClassName])}\n timeout={300}\n in={show}\n onExited={onExited}\n >\n <PaperStyled shadow=\"modalDialog\" ref={rootRef} className={paperClassName} tabIndex={0}>\n {children}\n </PaperStyled>\n </CSSTransition>\n </DraggableWrap>\n </Draggable>,\n document.body,\n );\n};\n\nexport default memo(DraggablePopover);\n"],"names":["DEFAULT_OFFSET","MAX_POSITION_CORRECTIONS","DraggablePopover","show","children","onEsc","layerIdProp","className","onChangePosition","onExited","modalManagerProp","draggableProps","_ref","_ref2","positionProp","defaultPosition","onStart","onMouseDown","onStop","modalClassName","useModalState","layerIdRef","useRef","Math","popoverRef","rootRef","zIndex","setZIndex","useState","resized","setResized","useReducer","prev","correctionsRef","positionX","positionY","position","useMemo","correctPosition","modalManager","defaultModalManager","handleMouseDown","useCallback","e","popover","layerId","defaultLayersManager","handleDragStart","data","handleDragStop","useEffect","prevZIndex","handleKeyDown","event","key","KeyboardEventKey","document","useIsomorphicEffect","screenWidth","screenHeight","prevWidth","prevHeight","screenWidthWithout","screenHeightWithout","screenWidthDiff","screenHeightDiff","nextPosition","corrections","_window_visualViewport","_window_visualViewport1","_window_visualViewport2","console","window","handleResize","debounce","resizeObserver","paperClassName","classNames","transitionGrow","createPortal","Draggable","DraggableWrap","tokens","CSSTransition","transitionClassNames","transitionGrowParent","transitionClassName","PaperStyled","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2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AoB;gBAC5E,SAAS;gBACT,IAAInF;gBACJ,UAAUM;0BAEV,kBAAC8E,aAAWA;oBAAC,QAAO;oBAAc,KAAK9D;oBAAS,WAAWmD;oBAAgB,UAAU;8BAClFxE;;;;SAKToD,SAAS,IAAI;AAEjB;AAEA,wDAAegC,KAAKtF"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./types.js";
2
- const version = "3.34.0";
2
+ const version = "3.34.1";
3
3
  export { default as Button } from "./Button/index.js";
4
4
  export { default as ButtonAsync } from "./ButtonAsync/index.js";
5
5
  export { default as MarketingButton } from "./MarketingButton/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finam/web-ui-kit-components",
3
- "version": "3.34.0",
3
+ "version": "3.34.1",
4
4
  "description": "Components library for web-ui-kit",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "scripts": {
55
55
  "clean": "rimraf dist tsconfig.tsbuildinfo",
56
- "build:lib": "npm run clean && npm run lint:es && npm run lint:styles && npm run compile:es && npm run compile:styles:es",
56
+ "build:lib": "npm run clean && npm run compile:es && npm run compile:styles:es",
57
57
  "compile:es": "rslib build -c ../../rslib.config.ts",
58
58
  "compile:styles:es": "wyw-in-js -o dist -m es2015 -t true --source-root dist --insert-css-requires dist \"dist/**/*.js\"",
59
59
  "lint:es": "eslint .",