@bit.rhplus/draggable-modal 0.0.15 → 0.0.16
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/package.json +4 -3
- package/dist/RESIZING_GUIDE.md +0 -344
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -157
- package/dist/index.js.map +0 -1
- package/dist/interactiveStyle.css +0 -3
- package/dist/preview-1773314156693.js +0 -7
- package/dist/style.css +0 -58
- package/types/asset.d.ts +0 -43
- package/types/style.d.ts +0 -42
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bit.rhplus/draggable-modal",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"homepage": "https://bit.cloud/remote-scope/draggable-modal",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "remote-scope",
|
|
8
8
|
"name": "draggable-modal",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.16"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"antd": "^5.20.6",
|
|
13
13
|
"react-draggable": "^4.4.6"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@
|
|
16
|
+
"@bitdev/react.react-env": "4.0.14"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"license": "SEE LICENSE IN UNLICENSED",
|
|
23
23
|
"optionalDependencies": {},
|
|
24
24
|
"peerDependenciesMeta": {},
|
|
25
|
+
"type": "module",
|
|
25
26
|
"private": false,
|
|
26
27
|
"publishConfig": {
|
|
27
28
|
"scope": "@bit.rhplus",
|
package/dist/RESIZING_GUIDE.md
DELETED
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
# Návod: Resize modálního okna bez knihovny
|
|
2
|
-
|
|
3
|
-
Kompletní průvodce implementací resize (změna velikosti myší) na Ant Design 5 modálním okně v Reactu — bez použití jakékoliv resize knihovny.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Kontext
|
|
8
|
-
|
|
9
|
-
Komponenta `DraggableModal` rozšiřuje Ant Design `<Modal>` o drag (přetahování) pomocí `react-draggable`. Cílem bylo přidat i resize — změnu velikosti táhnutím za hrany/rohy.
|
|
10
|
-
|
|
11
|
-
**Důležité:** `react-draggable` je výhradně pro drag. Resize nenabízí. Musíme ho implementovat ručně.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Jak resize funguje — princip
|
|
16
|
-
|
|
17
|
-
Resize funguje na třech fázích mouse eventů:
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
mousedown na handle → zapamatuj startovní pozici a rozměry
|
|
21
|
-
↓
|
|
22
|
-
mousemove na document → počítej delta, aktualizuj stav
|
|
23
|
-
↓
|
|
24
|
-
mouseup na document → ukonči resize, odregistruj listenery
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Klíč je přidávat `mousemove`/`mouseup` na **`document`**, ne na handle. Jinak by myš opuštění handle resize přerušila.
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## Krok 1: Stav pro rozměry
|
|
32
|
-
|
|
33
|
-
```js
|
|
34
|
-
const parseWidth = (w) => {
|
|
35
|
-
if (typeof w === 'number') return w;
|
|
36
|
-
if (typeof w === 'string') { const n = parseInt(w, 10); return isNaN(n) ? 520 : n; }
|
|
37
|
-
return 520;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const [modalSize, setModalSize] = React.useState({
|
|
41
|
-
width: parseWidth(props.width), // vždy číslo (ne "1400px")
|
|
42
|
-
height: null, // null = auto výška z obsahu
|
|
43
|
-
});
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
**Proč `parseWidth`?**
|
|
47
|
-
Ant Design přijímá `width` jako číslo i string (`"1400px"`). My potřebujeme číslo pro matematiku (`startW + dx`). Parsujeme hned při inicializaci.
|
|
48
|
-
|
|
49
|
-
**Proč `height: null`?**
|
|
50
|
-
Výchozí výška modalu je `auto` — určená obsahem. Výšku začínáme sledovat až při prvním resize (pak ji fixujeme na pixely).
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## Krok 2: Resize handles — průhledné aktivní zóny
|
|
55
|
-
|
|
56
|
-
Handles jsou prázdné `<div>` elementy bez viditelného obsahu. Stačí jim nastavit správný `cursor` a dostatečnou plochu pro klik.
|
|
57
|
-
|
|
58
|
-
```css
|
|
59
|
-
.drm-handle {
|
|
60
|
-
position: absolute;
|
|
61
|
-
z-index: 10;
|
|
62
|
-
user-select: none;
|
|
63
|
-
pointer-events: auto; /* KRITICKÉ — viz sekce Nástrahy */
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/* Pravá hrana */
|
|
67
|
-
.drm-handle-e { top: 12px; right: -4px; width: 8px; height: calc(100% - 24px); cursor: e-resize; }
|
|
68
|
-
|
|
69
|
-
/* Levá hrana */
|
|
70
|
-
.drm-handle-w { top: 12px; left: -4px; width: 8px; height: calc(100% - 24px); cursor: w-resize; }
|
|
71
|
-
|
|
72
|
-
/* Spodní hrana */
|
|
73
|
-
.drm-handle-s { bottom: -4px; left: 12px; width: calc(100% - 24px); height: 8px; cursor: s-resize; }
|
|
74
|
-
|
|
75
|
-
/* Pravý dolní roh */
|
|
76
|
-
.drm-handle-se { bottom: -4px; right: -4px; width: 16px; height: 16px; cursor: se-resize; }
|
|
77
|
-
|
|
78
|
-
/* Levý dolní roh */
|
|
79
|
-
.drm-handle-sw { bottom: -4px; left: -4px; width: 16px; height: 16px; cursor: sw-resize; }
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Handles jsou umístěny na `-4px` vně okna (polovina šířky 8px přesahuje). To vytváří přirozený aktivní prostor na samé hraně.
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
## Krok 3: Logika resize
|
|
87
|
-
|
|
88
|
-
```js
|
|
89
|
-
const handleResizeStart = (e, direction) => {
|
|
90
|
-
e.preventDefault();
|
|
91
|
-
e.stopPropagation(); // zabrání spuštění drag při tahu za handle
|
|
92
|
-
|
|
93
|
-
// Změříme aktuální rozměry z DOM (ne ze stavu — stav může být zaostalý)
|
|
94
|
-
const modalEl = draggleRef.current?.querySelector('.ant-modal');
|
|
95
|
-
const contentEl = draggleRef.current?.querySelector('.ant-modal-content');
|
|
96
|
-
const startX = e.clientX;
|
|
97
|
-
const startY = e.clientY;
|
|
98
|
-
const startW = modalEl?.offsetWidth || modalSize.width;
|
|
99
|
-
const startH = contentEl?.offsetHeight || modalSize.height || 400;
|
|
100
|
-
|
|
101
|
-
const onMouseMove = (moveEvent) => {
|
|
102
|
-
const dx = moveEvent.clientX - startX; // kolik px jsme se posunuli
|
|
103
|
-
const dy = moveEvent.clientY - startY;
|
|
104
|
-
|
|
105
|
-
setModalSize(prev => {
|
|
106
|
-
let newW = prev.width;
|
|
107
|
-
let newH = prev.height !== null ? prev.height : startH;
|
|
108
|
-
|
|
109
|
-
if (direction.includes('e')) newW = Math.max(300, startW + dx); // tah doprava
|
|
110
|
-
if (direction.includes('w')) newW = Math.max(300, startW - dx); // tah doleva
|
|
111
|
-
if (direction.includes('s')) newH = Math.max(200, startH + dy); // tah dolů
|
|
112
|
-
|
|
113
|
-
return { width: newW, height: newH };
|
|
114
|
-
});
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
const onMouseUp = () => {
|
|
118
|
-
document.removeEventListener('mousemove', onMouseMove);
|
|
119
|
-
document.removeEventListener('mouseup', onMouseUp);
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
// DŮLEŽITÉ: listenery na document, ne na handle
|
|
123
|
-
document.addEventListener('mousemove', onMouseMove);
|
|
124
|
-
document.addEventListener('mouseup', onMouseUp);
|
|
125
|
-
};
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
**Proč čteme z DOM a ne ze stavu?**
|
|
129
|
-
Při zahájení resize chceme **aktuální vizuální rozměry**. Stav `modalSize` může být zaostalý o render cyklus. `offsetWidth`/`offsetHeight` vrací vždy aktuální hodnotu z DOM.
|
|
130
|
-
|
|
131
|
-
**Minimální rozměry:**
|
|
132
|
-
`Math.max(300, ...)` a `Math.max(200, ...)` zabrání zborcení layoutu.
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
## Krok 4: Aplikace rozměrů na modal
|
|
137
|
-
|
|
138
|
-
```jsx
|
|
139
|
-
<Modal
|
|
140
|
-
{...props}
|
|
141
|
-
width={resizable ? modalSize.width : props.width}
|
|
142
|
-
styles={resolveStyles()}
|
|
143
|
-
>
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
```js
|
|
147
|
-
const resolveStyles = () => {
|
|
148
|
-
if (resizable && modalSize.height !== null) {
|
|
149
|
-
return {
|
|
150
|
-
body: {
|
|
151
|
-
paddingBottom: '30px',
|
|
152
|
-
height: `calc(${modalSize.height}px - 110px)`, // odečteme header + footer
|
|
153
|
-
overflow: 'auto',
|
|
154
|
-
display: 'flex',
|
|
155
|
-
flexDirection: 'column',
|
|
156
|
-
},
|
|
157
|
-
content: {
|
|
158
|
-
height: `${modalSize.height}px`,
|
|
159
|
-
display: 'flex',
|
|
160
|
-
flexDirection: 'column',
|
|
161
|
-
},
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
// ... fallback pro statický height prop
|
|
165
|
-
};
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
`110px` je odhadovaná výška headeru + footeru. `overflow: auto` na body zajistí scrollování při přetečení obsahu.
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
## Krok 5: Kam umístit handles — nástraha Ant Design
|
|
173
|
-
|
|
174
|
-
Naivní přístup: vložit handles přímo do `modalRender` wrapperu:
|
|
175
|
-
|
|
176
|
-
```jsx
|
|
177
|
-
// ❌ NEFUNGUJE
|
|
178
|
-
modalRender={(modal) => (
|
|
179
|
-
<Draggable>
|
|
180
|
-
<div ref={draggleRef}>
|
|
181
|
-
{modal}
|
|
182
|
-
{resizeHandles} {/* <-- tady NE */}
|
|
183
|
-
</div>
|
|
184
|
-
</Draggable>
|
|
185
|
-
)}
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
**Proč ne?** Wrapper div je block-level element — má šířku `100% viewportu`. Handles s `position: absolute; right: -4px` se zobrazí na okraji viewportu, ne modálního okna. Uživatel je nevidí.
|
|
189
|
-
|
|
190
|
-
```
|
|
191
|
-
.ant-modal-wrap (100vw)
|
|
192
|
-
[draggleRef div = 100vw] ← handles jsou tady → špatně
|
|
193
|
-
.ant-modal (1400px, margin:auto)
|
|
194
|
-
.ant-modal-content
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### Správné řešení: ReactDOM.createPortal do `.ant-modal-content`
|
|
198
|
-
|
|
199
|
-
```jsx
|
|
200
|
-
// ✅ SPRÁVNĚ
|
|
201
|
-
{resizable && antModalEl && ReactDOM.createPortal(resizeHandles, antModalEl)}
|
|
202
|
-
// antModalEl = element .ant-modal-content
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
`.ant-modal-content` má `position: relative` → handles s `position: absolute` jsou relativní k němu. Handles jsou přesně na hranách viditelného okna.
|
|
206
|
-
|
|
207
|
-
```
|
|
208
|
-
.ant-modal-content (position: relative) ← portal target
|
|
209
|
-
.ant-modal-header
|
|
210
|
-
.ant-modal-body
|
|
211
|
-
.ant-modal-footer
|
|
212
|
-
[drm-handle-e] ← position: absolute, right: -4px ✓
|
|
213
|
-
[drm-handle-se] ← position: absolute, bottom: -4px, right: -4px ✓
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
---
|
|
217
|
-
|
|
218
|
-
## Krok 6: Detekce `.ant-modal-content` elementu
|
|
219
|
-
|
|
220
|
-
Portal cíl musíme najít v DOM poté, co Ant Design modal narenduje. Použijeme `useLayoutEffect` — běží synchronně po DOM mutaci:
|
|
221
|
-
|
|
222
|
-
```js
|
|
223
|
-
const [antModalEl, setAntModalEl] = React.useState(null);
|
|
224
|
-
|
|
225
|
-
React.useLayoutEffect(() => {
|
|
226
|
-
if (resizable && open && draggleRef.current) {
|
|
227
|
-
setAntModalEl(draggleRef.current.querySelector('.ant-modal-content'));
|
|
228
|
-
} else {
|
|
229
|
-
setAntModalEl(null);
|
|
230
|
-
}
|
|
231
|
-
}, [resizable, open]);
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
**Proč `useLayoutEffect` a ne `useEffect`?**
|
|
235
|
-
`useEffect` běží asynchronně po paint — uživatel by na první render viděl modal bez handles. `useLayoutEffect` běží synchronně před paint, takže handles se objeví ihned s modalem (druhý render, ale bez vizuálního bliknutí).
|
|
236
|
-
|
|
237
|
-
**Tok na první otevření:**
|
|
238
|
-
1. `open` změní na `true` → první render → `antModalEl` je `null` → handles se nevykreslí
|
|
239
|
-
2. `useLayoutEffect` najde `.ant-modal-content`, zavolá `setAntModalEl`
|
|
240
|
-
3. Druhý render → handles se vykreslí přes portal
|
|
241
|
-
4. Vše synchronní — uživatel nevidí blikání
|
|
242
|
-
|
|
243
|
-
---
|
|
244
|
-
|
|
245
|
-
## Nástraha: `pointer-events: none` na `.ant-modal`
|
|
246
|
-
|
|
247
|
-
Ant Design 5 nastavuje na `.ant-modal`:
|
|
248
|
-
|
|
249
|
-
```js
|
|
250
|
-
// node_modules/antd/es/modal/style/index.js
|
|
251
|
-
'.ant-modal': {
|
|
252
|
-
pointerEvents: 'none', // ← zabraňuje klikům mimo .ant-modal-content
|
|
253
|
-
}
|
|
254
|
-
'.ant-modal-content': {
|
|
255
|
-
pointerEvents: 'auto', // ← re-aktivuje pro obsah
|
|
256
|
-
}
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
Pokud bychom portálovali handles do `.ant-modal` (ne do `.ant-modal-content`), handles by dědily `pointer-events: none` → `onMouseDown` by se nikdy nespustil.
|
|
260
|
-
|
|
261
|
-
Proto portálujeme do `.ant-modal-content` (má `pointer-events: auto`) + přidáme `pointer-events: auto` na `.drm-handle` jako pojistku.
|
|
262
|
-
|
|
263
|
-
---
|
|
264
|
-
|
|
265
|
-
## Nástraha: `e.stopPropagation()` na resize handle
|
|
266
|
-
|
|
267
|
-
Draggable wrapper obaluje celý modal. Bez `stopPropagation` by `mousedown` na resize handle také spustil drag. Výsledek: modal se táhne místo resize.
|
|
268
|
-
|
|
269
|
-
```js
|
|
270
|
-
const handleResizeStart = (e, direction) => {
|
|
271
|
-
e.preventDefault();
|
|
272
|
-
e.stopPropagation(); // zabrání bubblingu k Draggable
|
|
273
|
-
// ...
|
|
274
|
-
};
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
---
|
|
278
|
-
|
|
279
|
-
## Výsledný strom v DOM
|
|
280
|
-
|
|
281
|
-
```
|
|
282
|
-
[draggleRef div] ← Draggable wrapper (full-width)
|
|
283
|
-
.ant-modal ← width prop → kontroluje vizuální šířku
|
|
284
|
-
.ant-modal-content ← portal target (position: relative)
|
|
285
|
-
.ant-modal-header
|
|
286
|
-
.ant-modal-body
|
|
287
|
-
.ant-modal-footer
|
|
288
|
-
.drm-handle-e ← right: -4px, výška okna
|
|
289
|
-
.drm-handle-w ← left: -4px, výška okna
|
|
290
|
-
.drm-handle-s ← bottom: -4px, šířka okna
|
|
291
|
-
.drm-handle-se ← bottom: -4px, right: -4px
|
|
292
|
-
.drm-handle-sw ← bottom: -4px, left: -4px
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
---
|
|
296
|
-
|
|
297
|
-
## Kompletní flow resize
|
|
298
|
-
|
|
299
|
-
```
|
|
300
|
-
Uživatel → mousedown na .drm-handle-se
|
|
301
|
-
↓
|
|
302
|
-
handleResizeStart('se')
|
|
303
|
-
- e.stopPropagation() → Draggable nezačne drag
|
|
304
|
-
- uloží: startX, startY, startW (.ant-modal.offsetWidth), startH (.ant-modal-content.offsetHeight)
|
|
305
|
-
- registruje: document.onmousemove, document.onmouseup
|
|
306
|
-
↓
|
|
307
|
-
Uživatel táhne myší
|
|
308
|
-
↓
|
|
309
|
-
onMouseMove
|
|
310
|
-
- dx = clientX - startX, dy = clientY - startY
|
|
311
|
-
- 'se' → newW = max(300, startW + dx), newH = max(200, startH + dy)
|
|
312
|
-
- setModalSize({ width: newW, height: newH })
|
|
313
|
-
↓
|
|
314
|
-
React re-render
|
|
315
|
-
- <Modal width={newW}> → .ant-modal dostane novou šířku
|
|
316
|
-
- styles.content.height = newH → .ant-modal-content dostane novou výšku
|
|
317
|
-
- handles v portalu se přesunou s .ant-modal-content
|
|
318
|
-
↓
|
|
319
|
-
Uživatel pustí myš
|
|
320
|
-
↓
|
|
321
|
-
onMouseUp → removeEventListener (cleanup)
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
---
|
|
325
|
-
|
|
326
|
-
## Použití
|
|
327
|
-
|
|
328
|
-
```jsx
|
|
329
|
-
// Resize zapnut (default)
|
|
330
|
-
<DraggableModal open={open} onCancel={onClose} title="Okno" width={800}>
|
|
331
|
-
obsah
|
|
332
|
-
</DraggableModal>
|
|
333
|
-
|
|
334
|
-
// Resize vypnut
|
|
335
|
-
<DraggableModal resizable={false} open={open} onCancel={onClose} title="Okno">
|
|
336
|
-
obsah
|
|
337
|
-
</DraggableModal>
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
---
|
|
341
|
-
|
|
342
|
-
## Proč ne knihovna (re-resizable, react-resizable)?
|
|
343
|
-
|
|
344
|
-
Obě fungují na principu wrapperu kolem elementu. Pro Ant Design Modal je problém, že wrapper musí obalit `.ant-modal`, ale `.ant-modal` je renderován interně knihovnou — nemáme nad ním přímou kontrolu z JSX. Ruční implementace pomocí mouse eventů je přímočařejší a nevyžaduje nové závislosti.
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { default as Modal } from 'antd/es/modal';
|
|
5
|
-
import Draggable from 'react-draggable';
|
|
6
|
-
import ReactDOM from 'react-dom';
|
|
7
|
-
import './style.css';
|
|
8
|
-
const parseWidth = (w) => {
|
|
9
|
-
if (typeof w === 'number')
|
|
10
|
-
return w;
|
|
11
|
-
if (typeof w === 'string') {
|
|
12
|
-
const n = parseInt(w, 10);
|
|
13
|
-
return isNaN(n) ? 520 : n;
|
|
14
|
-
}
|
|
15
|
-
return 520;
|
|
16
|
-
};
|
|
17
|
-
// Wrapper – podmíněné renderování = destroy on close (kompletní unmount při zavření)
|
|
18
|
-
const DraggableModal = (props) => {
|
|
19
|
-
if (!props.open)
|
|
20
|
-
return null;
|
|
21
|
-
return _jsx(DraggableModalInner, { ...props });
|
|
22
|
-
};
|
|
23
|
-
// Inner komponenta – obsahuje veškerou logiku a stav
|
|
24
|
-
// Při zavření se kompletně unmountuje → všechny hooks a stav jsou zničeny
|
|
25
|
-
// Při otevření se vytvoří čerstvá instance → žádný starý stav
|
|
26
|
-
const DraggableModalInner = (props) => {
|
|
27
|
-
const { open, onOk, onCancel, isInteractive = false, title, children, getContainer, height, resizable = true } = props;
|
|
28
|
-
const draggleRef = React.useRef(null);
|
|
29
|
-
const [disabled, setDisabled] = React.useState(true);
|
|
30
|
-
const [bounds, setBounds] = React.useState({
|
|
31
|
-
left: 0,
|
|
32
|
-
top: 0,
|
|
33
|
-
bottom: 0,
|
|
34
|
-
right: 0,
|
|
35
|
-
});
|
|
36
|
-
const [modalSize, setModalSize] = React.useState({
|
|
37
|
-
width: parseWidth(props.width),
|
|
38
|
-
height: null,
|
|
39
|
-
});
|
|
40
|
-
const [antModalEl, setAntModalEl] = React.useState(null);
|
|
41
|
-
const [dragPos, setDragPos] = React.useState({ x: 0, y: 0 });
|
|
42
|
-
React.useEffect(() => {
|
|
43
|
-
if (isInteractive) {
|
|
44
|
-
import('./interactiveStyle.css');
|
|
45
|
-
}
|
|
46
|
-
}, [isInteractive]);
|
|
47
|
-
React.useLayoutEffect(() => {
|
|
48
|
-
if (resizable && open && draggleRef.current) {
|
|
49
|
-
setAntModalEl(draggleRef.current.querySelector('.ant-modal-content'));
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
setAntModalEl(null);
|
|
53
|
-
}
|
|
54
|
-
}, [resizable, open]);
|
|
55
|
-
const onStart = (_event, uiData) => {
|
|
56
|
-
const { clientWidth, clientHeight } = window.document.documentElement;
|
|
57
|
-
const targetRect = draggleRef.current?.getBoundingClientRect();
|
|
58
|
-
if (!targetRect) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
setBounds({
|
|
62
|
-
left: -targetRect.left + uiData.x,
|
|
63
|
-
right: clientWidth - (targetRect.right - uiData.x),
|
|
64
|
-
top: -targetRect.top + uiData.y,
|
|
65
|
-
bottom: clientHeight - (targetRect.bottom - uiData.y),
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
const handleResizeStart = (e, direction) => {
|
|
69
|
-
e.preventDefault();
|
|
70
|
-
e.stopPropagation();
|
|
71
|
-
const modalEl = draggleRef.current?.querySelector('.ant-modal');
|
|
72
|
-
const contentEl = draggleRef.current?.querySelector('.ant-modal-content');
|
|
73
|
-
const startX = e.clientX;
|
|
74
|
-
const startY = e.clientY;
|
|
75
|
-
const startW = modalEl?.offsetWidth || modalSize.width;
|
|
76
|
-
const startH = contentEl?.offsetHeight || modalSize.height || 400;
|
|
77
|
-
const startDragX = dragPos.x;
|
|
78
|
-
const onMouseMove = (moveEvent) => {
|
|
79
|
-
const dx = moveEvent.clientX - startX;
|
|
80
|
-
const dy = moveEvent.clientY - startY;
|
|
81
|
-
setModalSize(prev => {
|
|
82
|
-
let newW = prev.width;
|
|
83
|
-
let newH = prev.height !== null ? prev.height : startH;
|
|
84
|
-
if (direction.includes('e'))
|
|
85
|
-
newW = Math.max(300, startW + dx);
|
|
86
|
-
if (direction.includes('w'))
|
|
87
|
-
newW = Math.max(300, startW - dx);
|
|
88
|
-
if (direction.includes('s'))
|
|
89
|
-
newH = Math.max(200, startH + dy);
|
|
90
|
-
return { width: newW, height: newH };
|
|
91
|
-
});
|
|
92
|
-
// Kompenzace: Ant Design centruje modal přes margin:auto.
|
|
93
|
-
// Při změně width se levý okraj posune o dx/2 — opravíme pozici Draggable.
|
|
94
|
-
if (direction.includes('e') || direction.includes('w')) {
|
|
95
|
-
setDragPos(prev => ({ ...prev, x: startDragX + dx / 2 }));
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const onMouseUp = () => {
|
|
99
|
-
document.removeEventListener('mousemove', onMouseMove);
|
|
100
|
-
document.removeEventListener('mouseup', onMouseUp);
|
|
101
|
-
};
|
|
102
|
-
document.addEventListener('mousemove', onMouseMove);
|
|
103
|
-
document.addEventListener('mouseup', onMouseUp);
|
|
104
|
-
};
|
|
105
|
-
const resolveStyles = () => {
|
|
106
|
-
if (resizable && modalSize.height !== null) {
|
|
107
|
-
return {
|
|
108
|
-
body: {
|
|
109
|
-
paddingBottom: '30px',
|
|
110
|
-
height: `calc(${modalSize.height}px - 110px)`,
|
|
111
|
-
overflow: 'auto',
|
|
112
|
-
display: 'flex',
|
|
113
|
-
flexDirection: 'column',
|
|
114
|
-
boxSizing: 'border-box',
|
|
115
|
-
},
|
|
116
|
-
content: {
|
|
117
|
-
height: `${modalSize.height}px`,
|
|
118
|
-
display: 'flex',
|
|
119
|
-
flexDirection: 'column',
|
|
120
|
-
},
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
body: {
|
|
125
|
-
paddingBottom: '30px',
|
|
126
|
-
...(height && {
|
|
127
|
-
height: `calc(${height} - 110px)`,
|
|
128
|
-
overflow: 'hidden',
|
|
129
|
-
display: 'flex',
|
|
130
|
-
flexDirection: 'column',
|
|
131
|
-
boxSizing: 'border-box',
|
|
132
|
-
}),
|
|
133
|
-
},
|
|
134
|
-
content: height ? {
|
|
135
|
-
height: height,
|
|
136
|
-
display: 'flex',
|
|
137
|
-
flexDirection: 'column',
|
|
138
|
-
} : {},
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
const resizeHandles = (_jsxs(_Fragment, { children: [_jsx("div", { className: "drm-handle drm-handle-e", onMouseDown: (e) => handleResizeStart(e, 'e') }), _jsx("div", { className: "drm-handle drm-handle-w", onMouseDown: (e) => handleResizeStart(e, 'w') }), _jsx("div", { className: "drm-handle drm-handle-s", onMouseDown: (e) => handleResizeStart(e, 's') }), _jsx("div", { className: "drm-handle drm-handle-se", onMouseDown: (e) => handleResizeStart(e, 'se') }), _jsx("div", { className: "drm-handle drm-handle-sw", onMouseDown: (e) => handleResizeStart(e, 'sw') })] }));
|
|
142
|
-
// Sdílený Modal komponent
|
|
143
|
-
const modalContent = (_jsx(Modal, { ...props, mask: !isInteractive, getContainer: getContainer || false, zIndex: props.zIndex || 99999999, width: resizable ? modalSize.width : props.width, title: _jsx("div", { style: { width: '100%', cursor: 'move' }, onMouseOver: () => {
|
|
144
|
-
if (disabled) {
|
|
145
|
-
setDisabled(false);
|
|
146
|
-
}
|
|
147
|
-
}, onMouseOut: () => {
|
|
148
|
-
setDisabled(true);
|
|
149
|
-
}, onFocus: () => { }, onBlur: () => { }, children: title }), open: open, onOk: onOk, onCancel: onCancel, styles: resolveStyles(), modalRender: (modal) => (_jsx(Draggable, { disabled: disabled, bounds: bounds, position: dragPos, onDrag: (e, data) => setDragPos({ x: data.x, y: data.y }), onStart: (event, uiData) => onStart(event, uiData), children: _jsx("div", { ref: draggleRef, style: { position: 'relative' }, children: modal }) })), children: _jsx(_Fragment, { children: children }) }));
|
|
150
|
-
// Pokud je getContainer funkce, použijeme portal
|
|
151
|
-
// Jinak renderujeme přímo (zachová React context)
|
|
152
|
-
return (_jsxs(_Fragment, { children: [typeof getContainer === 'function'
|
|
153
|
-
? ReactDOM.createPortal(modalContent, getContainer())
|
|
154
|
-
: modalContent, resizable && antModalEl && ReactDOM.createPortal(resizeHandles, antModalEl)] }));
|
|
155
|
-
};
|
|
156
|
-
export default DraggableModal;
|
|
157
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.jsx"],"names":[],"mappings":";AAAA,oBAAoB;AACpB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,aAAa,CAAC;AAErB,MAAM,UAAU,GAAG,CAAC,CAAC,EAAE,EAAE;IACvB,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC;IACpC,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAAC,CAAC;IACpF,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF,qFAAqF;AACrF,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,EAAE;IAC/B,IAAI,CAAC,KAAK,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAC7B,OAAO,KAAC,mBAAmB,OAAK,KAAK,GAAI,CAAC;AAC5C,CAAC,CAAC;AAEF,qDAAqD;AACrD,0EAA0E;AAC1E,8DAA8D;AAC9D,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,EAAE;IACpC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,GAAG,KAAK,EAAE,KAAK,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-
}
|
|
4
|
-
|
|
5
|
-
.ant-modal-footer {
|
|
6
|
-
display: flex;
|
|
7
|
-
justify-content: flex-end; /* Tlačítka na pravou stranu */
|
|
8
|
-
gap: 8px; /* Mezery mezi tlačítky */
|
|
9
|
-
padding-top: 50px;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/* Resize handles */
|
|
13
|
-
.drm-handle {
|
|
14
|
-
position: absolute;
|
|
15
|
-
z-index: 10;
|
|
16
|
-
user-select: none;
|
|
17
|
-
pointer-events: auto;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.drm-handle-e {
|
|
21
|
-
top: 12px;
|
|
22
|
-
right: -4px;
|
|
23
|
-
width: 8px;
|
|
24
|
-
height: calc(100% - 24px);
|
|
25
|
-
cursor: e-resize;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.drm-handle-w {
|
|
29
|
-
top: 12px;
|
|
30
|
-
left: -4px;
|
|
31
|
-
width: 8px;
|
|
32
|
-
height: calc(100% - 24px);
|
|
33
|
-
cursor: w-resize;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.drm-handle-s {
|
|
37
|
-
bottom: -4px;
|
|
38
|
-
left: 12px;
|
|
39
|
-
width: calc(100% - 24px);
|
|
40
|
-
height: 8px;
|
|
41
|
-
cursor: s-resize;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.drm-handle-se {
|
|
45
|
-
bottom: -4px;
|
|
46
|
-
right: -4px;
|
|
47
|
-
width: 16px;
|
|
48
|
-
height: 16px;
|
|
49
|
-
cursor: se-resize;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.drm-handle-sw {
|
|
53
|
-
bottom: -4px;
|
|
54
|
-
left: -4px;
|
|
55
|
-
width: 16px;
|
|
56
|
-
height: 16px;
|
|
57
|
-
cursor: sw-resize;
|
|
58
|
-
}
|
package/types/asset.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
declare module '*.png' {
|
|
2
|
-
const value: any;
|
|
3
|
-
export = value;
|
|
4
|
-
}
|
|
5
|
-
declare module '*.svg' {
|
|
6
|
-
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
|
-
|
|
8
|
-
export const ReactComponent: FunctionComponent<
|
|
9
|
-
SVGProps<SVGSVGElement> & { title?: string }
|
|
10
|
-
>;
|
|
11
|
-
const src: string;
|
|
12
|
-
export default src;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// @TODO Gilad
|
|
16
|
-
declare module '*.jpg' {
|
|
17
|
-
const value: any;
|
|
18
|
-
export = value;
|
|
19
|
-
}
|
|
20
|
-
declare module '*.jpeg' {
|
|
21
|
-
const value: any;
|
|
22
|
-
export = value;
|
|
23
|
-
}
|
|
24
|
-
declare module '*.gif' {
|
|
25
|
-
const value: any;
|
|
26
|
-
export = value;
|
|
27
|
-
}
|
|
28
|
-
declare module '*.bmp' {
|
|
29
|
-
const value: any;
|
|
30
|
-
export = value;
|
|
31
|
-
}
|
|
32
|
-
declare module '*.otf' {
|
|
33
|
-
const value: any;
|
|
34
|
-
export = value;
|
|
35
|
-
}
|
|
36
|
-
declare module '*.woff' {
|
|
37
|
-
const value: any;
|
|
38
|
-
export = value;
|
|
39
|
-
}
|
|
40
|
-
declare module '*.woff2' {
|
|
41
|
-
const value: any;
|
|
42
|
-
export = value;
|
|
43
|
-
}
|
package/types/style.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
declare module '*.module.css' {
|
|
2
|
-
const classes: { readonly [key: string]: string };
|
|
3
|
-
export default classes;
|
|
4
|
-
}
|
|
5
|
-
declare module '*.module.scss' {
|
|
6
|
-
const classes: { readonly [key: string]: string };
|
|
7
|
-
export default classes;
|
|
8
|
-
}
|
|
9
|
-
declare module '*.module.sass' {
|
|
10
|
-
const classes: { readonly [key: string]: string };
|
|
11
|
-
export default classes;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
declare module '*.module.less' {
|
|
15
|
-
const classes: { readonly [key: string]: string };
|
|
16
|
-
export default classes;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
declare module '*.less' {
|
|
20
|
-
const classes: { readonly [key: string]: string };
|
|
21
|
-
export default classes;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
declare module '*.css' {
|
|
25
|
-
const classes: { readonly [key: string]: string };
|
|
26
|
-
export default classes;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
declare module '*.sass' {
|
|
30
|
-
const classes: { readonly [key: string]: string };
|
|
31
|
-
export default classes;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
declare module '*.scss' {
|
|
35
|
-
const classes: { readonly [key: string]: string };
|
|
36
|
-
export default classes;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
declare module '*.mdx' {
|
|
40
|
-
const component: any;
|
|
41
|
-
export default component;
|
|
42
|
-
}
|