@gfazioli/mantine-window 1.2.1 → 3.0.0
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/README.md +27 -12
- package/dist/cjs/LayoutIcons.cjs +118 -0
- package/dist/cjs/LayoutIcons.cjs.map +1 -0
- package/dist/cjs/Window.cjs +173 -29
- package/dist/cjs/Window.cjs.map +1 -1
- package/dist/cjs/Window.module.css.cjs +1 -1
- package/dist/cjs/WindowGroup.cjs +214 -0
- package/dist/cjs/WindowGroup.cjs.map +1 -0
- package/dist/cjs/WindowGroup.context.cjs +14 -0
- package/dist/cjs/WindowGroup.context.cjs.map +1 -0
- package/dist/cjs/hooks/use-mantine-window.cjs +182 -36
- package/dist/cjs/hooks/use-mantine-window.cjs.map +1 -1
- package/dist/cjs/hooks/use-responsive-value.cjs +21 -0
- package/dist/cjs/hooks/use-responsive-value.cjs.map +1 -0
- package/dist/cjs/hooks/use-window-dimensions.cjs +20 -9
- package/dist/cjs/hooks/use-window-dimensions.cjs.map +1 -1
- package/dist/cjs/hooks/use-window-drag.cjs.map +1 -1
- package/dist/cjs/hooks/use-window-state.cjs +142 -64
- package/dist/cjs/hooks/use-window-state.cjs.map +1 -1
- package/dist/cjs/index.cjs +4 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/LayoutIcons.mjs +109 -0
- package/dist/esm/LayoutIcons.mjs.map +1 -0
- package/dist/esm/Window.mjs +175 -31
- package/dist/esm/Window.mjs.map +1 -1
- package/dist/esm/Window.module.css.mjs +1 -1
- package/dist/esm/WindowGroup.context.mjs +11 -0
- package/dist/esm/WindowGroup.context.mjs.map +1 -0
- package/dist/esm/WindowGroup.mjs +212 -0
- package/dist/esm/WindowGroup.mjs.map +1 -0
- package/dist/esm/hooks/use-mantine-window.mjs +184 -38
- package/dist/esm/hooks/use-mantine-window.mjs.map +1 -1
- package/dist/esm/hooks/use-responsive-value.mjs +19 -0
- package/dist/esm/hooks/use-responsive-value.mjs.map +1 -0
- package/dist/esm/hooks/use-window-dimensions.mjs +22 -11
- package/dist/esm/hooks/use-window-dimensions.mjs.map +1 -1
- package/dist/esm/hooks/use-window-drag.mjs.map +1 -1
- package/dist/esm/hooks/use-window-state.mjs +143 -65
- package/dist/esm/hooks/use-window-state.mjs.map +1 -1
- package/dist/esm/index.mjs +2 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.layer.css +1 -1
- package/dist/types/LayoutIcons.d.ts +21 -0
- package/dist/types/Window.d.ts +65 -30
- package/dist/types/WindowGroup.context.d.ts +57 -0
- package/dist/types/WindowGroup.d.ts +30 -0
- package/dist/types/hooks/use-mantine-window.d.ts +3 -0
- package/dist/types/hooks/use-responsive-value.d.ts +3 -0
- package/dist/types/hooks/use-window-constraints.d.ts +7 -7
- package/dist/types/hooks/use-window-dimensions.d.ts +1 -1
- package/dist/types/hooks/use-window-drag.d.ts +1 -1
- package/dist/types/hooks/use-window-state.d.ts +17 -5
- package/dist/types/index.d.mts +5 -0
- package/dist/types/index.d.ts +5 -0
- package/package.json +11 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Mantine Window Component
|
|
2
2
|
|
|
3
|
-
<img alt="Mantine Window" src="https://github.com/gfazioli/mantine-window/blob/master/logo.
|
|
3
|
+
<img alt="Mantine Window" src="https://github.com/gfazioli/mantine-window/blob/master/logo.jpeg" />
|
|
4
4
|
|
|
5
5
|
<div align="center">
|
|
6
6
|
|
|
@@ -18,12 +18,29 @@
|
|
|
18
18
|
## Overview
|
|
19
19
|
|
|
20
20
|
This component is created on top of the [Mantine](https://mantine.dev/) library.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
It requires **Mantine 9.x** and **React 19**.
|
|
22
|
+
|
|
23
|
+
[Mantine Window](https://gfazioli.github.io/mantine-window/) is a versatile UI container that brings a familiar desktop‑like window experience to React applications built with Mantine.
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- Draggable and resizable floating windows with 8-direction resize handles
|
|
28
|
+
- Portal or container-relative positioning (`withinPortal`)
|
|
29
|
+
- Controlled and uncontrolled position/size with mixed unit support (px, vw/vh, %)
|
|
30
|
+
- Responsive values via Mantine breakpoints for all dimension props
|
|
31
|
+
- Persistent state via localStorage (position, size, collapse state)
|
|
32
|
+
- Configurable drag boundaries to constrain movement
|
|
33
|
+
- Min/max size constraints with multi-unit support
|
|
34
|
+
- Collapsible content with double-click header toggle
|
|
35
|
+
- Z-index management with bring-to-front on interaction
|
|
36
|
+
- `Window.Group` compound component for coordinated multi-window management
|
|
37
|
+
- Layout presets: snap, tile, columns, rows, fill
|
|
38
|
+
- Full Mantine Styles API support with fine-grained classNames
|
|
39
|
+
- SSR-safe with hydration-compatible viewport unit resolution
|
|
40
|
+
- `onPositionChange` and `onSizeChange` callbacks
|
|
41
|
+
- `withScrollArea` prop to disable the internal ScrollArea wrapper
|
|
42
|
+
- `controlsPosition` prop for macOS-style (left) or Windows-style (right) button placement
|
|
43
|
+
- `controlsOrder` prop for custom button ordering (close, collapse, tools)
|
|
27
44
|
|
|
28
45
|
> [!note]
|
|
29
46
|
>
|
|
@@ -54,11 +71,9 @@ import { Title } from '@mantine/core';
|
|
|
54
71
|
|
|
55
72
|
function Demo() {
|
|
56
73
|
return (
|
|
57
|
-
<
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
</Window>
|
|
61
|
-
</Stack>
|
|
74
|
+
<Window title="Hello World" opened defaultX={50} defaultY={50} defaultWidth={400} defaultHeight={300}>
|
|
75
|
+
<Title order={4}>This is a window</Title>
|
|
76
|
+
</Window>
|
|
62
77
|
);
|
|
63
78
|
}
|
|
64
79
|
```
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
const VW = 36;
|
|
7
|
+
const VH = 28;
|
|
8
|
+
const R = 4;
|
|
9
|
+
const IR = 2;
|
|
10
|
+
const BX = 3;
|
|
11
|
+
const BY = 3;
|
|
12
|
+
const BW = VW - BX * 2;
|
|
13
|
+
const BH = VH - BY * 2;
|
|
14
|
+
const PAD = 3;
|
|
15
|
+
const GAP = 2;
|
|
16
|
+
const IX = BX + PAD;
|
|
17
|
+
const IY = BY + PAD;
|
|
18
|
+
const FULL_W = BW - PAD * 2;
|
|
19
|
+
const FULL_H = BH - PAD * 2;
|
|
20
|
+
const HALF_W = (FULL_W - GAP) / 2;
|
|
21
|
+
const HALF_H = (FULL_H - GAP) / 2;
|
|
22
|
+
function getRects(layout) {
|
|
23
|
+
switch (layout) {
|
|
24
|
+
case "snap-left":
|
|
25
|
+
return [{ x: IX, y: IY, width: HALF_W, height: FULL_H }];
|
|
26
|
+
case "snap-right":
|
|
27
|
+
return [{ x: IX + HALF_W + GAP, y: IY, width: HALF_W, height: FULL_H }];
|
|
28
|
+
case "snap-top":
|
|
29
|
+
return [{ x: IX, y: IY, width: FULL_W, height: HALF_H }];
|
|
30
|
+
case "snap-bottom":
|
|
31
|
+
return [{ x: IX, y: IY + HALF_H + GAP, width: FULL_W, height: HALF_H }];
|
|
32
|
+
case "fill":
|
|
33
|
+
return [{ x: IX, y: IY, width: FULL_W, height: FULL_H }];
|
|
34
|
+
case "columns":
|
|
35
|
+
return [
|
|
36
|
+
{ x: IX, y: IY, width: HALF_W, height: FULL_H },
|
|
37
|
+
{ x: IX + HALF_W + GAP, y: IY, width: HALF_W, height: FULL_H }
|
|
38
|
+
];
|
|
39
|
+
case "rows":
|
|
40
|
+
return [
|
|
41
|
+
{ x: IX, y: IY, width: FULL_W, height: HALF_H },
|
|
42
|
+
{ x: IX, y: IY + HALF_H + GAP, width: FULL_W, height: HALF_H }
|
|
43
|
+
];
|
|
44
|
+
case "tile":
|
|
45
|
+
return [
|
|
46
|
+
{ x: IX, y: IY, width: HALF_W, height: HALF_H },
|
|
47
|
+
{ x: IX + HALF_W + GAP, y: IY, width: HALF_W, height: HALF_H },
|
|
48
|
+
{ x: IX, y: IY + HALF_H + GAP, width: HALF_W, height: HALF_H },
|
|
49
|
+
{ x: IX + HALF_W + GAP, y: IY + HALF_H + GAP, width: HALF_W, height: HALF_H }
|
|
50
|
+
];
|
|
51
|
+
default:
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function LayoutIconBase({ layout, size = 28 }) {
|
|
56
|
+
const w = size;
|
|
57
|
+
const h = size * (VH / VW);
|
|
58
|
+
const rects = getRects(layout);
|
|
59
|
+
return /* @__PURE__ */ React.createElement("svg", { viewBox: `0 0 ${VW} ${VH}`, width: w, height: h }, /* @__PURE__ */ React.createElement(
|
|
60
|
+
"rect",
|
|
61
|
+
{
|
|
62
|
+
x: BX,
|
|
63
|
+
y: BY,
|
|
64
|
+
width: BW,
|
|
65
|
+
height: BH,
|
|
66
|
+
rx: R,
|
|
67
|
+
fill: "none",
|
|
68
|
+
stroke: "currentColor",
|
|
69
|
+
strokeWidth: 1.4
|
|
70
|
+
}
|
|
71
|
+
), rects.map((r, i) => /* @__PURE__ */ React.createElement(
|
|
72
|
+
"rect",
|
|
73
|
+
{
|
|
74
|
+
key: i,
|
|
75
|
+
x: r.x,
|
|
76
|
+
y: r.y,
|
|
77
|
+
width: r.width,
|
|
78
|
+
height: r.height,
|
|
79
|
+
rx: IR,
|
|
80
|
+
fill: "currentColor",
|
|
81
|
+
opacity: 0.45
|
|
82
|
+
}
|
|
83
|
+
)));
|
|
84
|
+
}
|
|
85
|
+
function SnapLeftIcon({ size }) {
|
|
86
|
+
return /* @__PURE__ */ React.createElement(LayoutIconBase, { layout: "snap-left", size });
|
|
87
|
+
}
|
|
88
|
+
function SnapRightIcon({ size }) {
|
|
89
|
+
return /* @__PURE__ */ React.createElement(LayoutIconBase, { layout: "snap-right", size });
|
|
90
|
+
}
|
|
91
|
+
function SnapTopIcon({ size }) {
|
|
92
|
+
return /* @__PURE__ */ React.createElement(LayoutIconBase, { layout: "snap-top", size });
|
|
93
|
+
}
|
|
94
|
+
function SnapBottomIcon({ size }) {
|
|
95
|
+
return /* @__PURE__ */ React.createElement(LayoutIconBase, { layout: "snap-bottom", size });
|
|
96
|
+
}
|
|
97
|
+
function FillIcon({ size }) {
|
|
98
|
+
return /* @__PURE__ */ React.createElement(LayoutIconBase, { layout: "fill", size });
|
|
99
|
+
}
|
|
100
|
+
function ArrangeColumnsIcon({ size }) {
|
|
101
|
+
return /* @__PURE__ */ React.createElement(LayoutIconBase, { layout: "columns", size });
|
|
102
|
+
}
|
|
103
|
+
function ArrangeRowsIcon({ size }) {
|
|
104
|
+
return /* @__PURE__ */ React.createElement(LayoutIconBase, { layout: "rows", size });
|
|
105
|
+
}
|
|
106
|
+
function TileIcon({ size }) {
|
|
107
|
+
return /* @__PURE__ */ React.createElement(LayoutIconBase, { layout: "tile", size });
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
exports.ArrangeColumnsIcon = ArrangeColumnsIcon;
|
|
111
|
+
exports.ArrangeRowsIcon = ArrangeRowsIcon;
|
|
112
|
+
exports.FillIcon = FillIcon;
|
|
113
|
+
exports.SnapBottomIcon = SnapBottomIcon;
|
|
114
|
+
exports.SnapLeftIcon = SnapLeftIcon;
|
|
115
|
+
exports.SnapRightIcon = SnapRightIcon;
|
|
116
|
+
exports.SnapTopIcon = SnapTopIcon;
|
|
117
|
+
exports.TileIcon = TileIcon;
|
|
118
|
+
//# sourceMappingURL=LayoutIcons.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayoutIcons.cjs","sources":["../../src/LayoutIcons.tsx"],"sourcesContent":["import React from 'react';\n\ninterface LayoutIconProps {\n size?: number;\n}\n\n// 16:9 aspect ratio viewBox — generous padding for rounded border\nconst VW = 36;\nconst VH = 28;\nconst R = 4; // outer border radius\nconst IR = 2; // inner rect radius\nconst BX = 3; // border x\nconst BY = 3; // border y\nconst BW = VW - BX * 2; // border width\nconst BH = VH - BY * 2; // border height\nconst PAD = 3; // padding between border and highlighted area\nconst GAP = 2; // gap between split areas\n\n// Derived layout constants\nconst IX = BX + PAD;\nconst IY = BY + PAD;\nconst FULL_W = BW - PAD * 2;\nconst FULL_H = BH - PAD * 2;\nconst HALF_W = (FULL_W - GAP) / 2;\nconst HALF_H = (FULL_H - GAP) / 2;\n\ninterface RectDef {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nfunction getRects(layout: string): RectDef[] {\n switch (layout) {\n case 'snap-left':\n return [{ x: IX, y: IY, width: HALF_W, height: FULL_H }];\n case 'snap-right':\n return [{ x: IX + HALF_W + GAP, y: IY, width: HALF_W, height: FULL_H }];\n case 'snap-top':\n return [{ x: IX, y: IY, width: FULL_W, height: HALF_H }];\n case 'snap-bottom':\n return [{ x: IX, y: IY + HALF_H + GAP, width: FULL_W, height: HALF_H }];\n case 'fill':\n return [{ x: IX, y: IY, width: FULL_W, height: FULL_H }];\n case 'columns':\n return [\n { x: IX, y: IY, width: HALF_W, height: FULL_H },\n { x: IX + HALF_W + GAP, y: IY, width: HALF_W, height: FULL_H },\n ];\n case 'rows':\n return [\n { x: IX, y: IY, width: FULL_W, height: HALF_H },\n { x: IX, y: IY + HALF_H + GAP, width: FULL_W, height: HALF_H },\n ];\n case 'tile':\n return [\n { x: IX, y: IY, width: HALF_W, height: HALF_H },\n { x: IX + HALF_W + GAP, y: IY, width: HALF_W, height: HALF_H },\n { x: IX, y: IY + HALF_H + GAP, width: HALF_W, height: HALF_H },\n { x: IX + HALF_W + GAP, y: IY + HALF_H + GAP, width: HALF_W, height: HALF_H },\n ];\n default:\n return [];\n }\n}\n\nfunction LayoutIconBase({ layout, size = 28 }: { layout: string } & LayoutIconProps) {\n const w = size;\n const h = size * (VH / VW);\n const rects = getRects(layout);\n return (\n <svg viewBox={`0 0 ${VW} ${VH}`} width={w} height={h}>\n <rect\n x={BX}\n y={BY}\n width={BW}\n height={BH}\n rx={R}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.4}\n />\n {rects.map((r, i) => (\n <rect\n key={i}\n x={r.x}\n y={r.y}\n width={r.width}\n height={r.height}\n rx={IR}\n fill=\"currentColor\"\n opacity={0.45}\n />\n ))}\n </svg>\n );\n}\n\n/** Snap left — left half highlighted */\nexport function SnapLeftIcon({ size }: LayoutIconProps) {\n return <LayoutIconBase layout=\"snap-left\" size={size} />;\n}\n\n/** Snap right — right half highlighted */\nexport function SnapRightIcon({ size }: LayoutIconProps) {\n return <LayoutIconBase layout=\"snap-right\" size={size} />;\n}\n\n/** Snap top — top half highlighted */\nexport function SnapTopIcon({ size }: LayoutIconProps) {\n return <LayoutIconBase layout=\"snap-top\" size={size} />;\n}\n\n/** Snap bottom — bottom half highlighted */\nexport function SnapBottomIcon({ size }: LayoutIconProps) {\n return <LayoutIconBase layout=\"snap-bottom\" size={size} />;\n}\n\n/** Fill — entire area highlighted */\nexport function FillIcon({ size }: LayoutIconProps) {\n return <LayoutIconBase layout=\"fill\" size={size} />;\n}\n\n/** Arrange columns — two vertical columns */\nexport function ArrangeColumnsIcon({ size }: LayoutIconProps) {\n return <LayoutIconBase layout=\"columns\" size={size} />;\n}\n\n/** Arrange rows — two horizontal rows */\nexport function ArrangeRowsIcon({ size }: LayoutIconProps) {\n return <LayoutIconBase layout=\"rows\" size={size} />;\n}\n\n/** Tile — 2x2 grid */\nexport function TileIcon({ size }: LayoutIconProps) {\n return <LayoutIconBase layout=\"tile\" size={size} />;\n}\n"],"names":[],"mappings":";;;;;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAE,GAAG,CAAA,CAAE,CAAA;AACb,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAE,GAAG,CAAA,CAAE,CAAA;AACb,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,GAAG,CAAC,CAAA;AACX,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM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AC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAE,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAE,CAAA,CAAA,CAAA,CAAI,EAAE,CAAC,CAAA;AACtF,CAAA;;;;;;;;;"}
|
package/dist/cjs/Window.cjs
CHANGED
|
@@ -5,8 +5,12 @@ var React = require('react');
|
|
|
5
5
|
var iconsReact = require('@tabler/icons-react');
|
|
6
6
|
var core = require('@mantine/core');
|
|
7
7
|
var useMantineWindow = require('./hooks/use-mantine-window.cjs');
|
|
8
|
+
var useResponsiveValue = require('./hooks/use-responsive-value.cjs');
|
|
9
|
+
var LayoutIcons = require('./LayoutIcons.cjs');
|
|
10
|
+
var WindowGroup = require('./WindowGroup.cjs');
|
|
8
11
|
var Window_module = require('./Window.module.css.cjs');
|
|
9
12
|
|
|
13
|
+
const HEADER_HEIGHT = 40;
|
|
10
14
|
const defaultProps = {
|
|
11
15
|
withBorder: true,
|
|
12
16
|
shadow: "md",
|
|
@@ -15,6 +19,9 @@ const defaultProps = {
|
|
|
15
19
|
withCloseButton: true,
|
|
16
20
|
withCollapseButton: true,
|
|
17
21
|
collapsable: true,
|
|
22
|
+
withToolsButton: true,
|
|
23
|
+
withScrollArea: true,
|
|
24
|
+
controlsPosition: "left",
|
|
18
25
|
persistState: false,
|
|
19
26
|
withinPortal: true,
|
|
20
27
|
minWidth: 250,
|
|
@@ -45,7 +52,7 @@ const varsResolver = core.createVarsResolver((_, { radius, shadow }) => {
|
|
|
45
52
|
resizeHandleLeft: {}
|
|
46
53
|
};
|
|
47
54
|
});
|
|
48
|
-
const Window = core.factory((_props
|
|
55
|
+
const Window = core.factory((_props) => {
|
|
49
56
|
const props = core.useProps("Window", defaultProps, _props);
|
|
50
57
|
const {
|
|
51
58
|
opened,
|
|
@@ -58,8 +65,13 @@ const Window = core.factory((_props, _) => {
|
|
|
58
65
|
withCollapseButton,
|
|
59
66
|
collapsable,
|
|
60
67
|
withCloseButton,
|
|
68
|
+
withToolsButton,
|
|
69
|
+
withScrollArea,
|
|
70
|
+
controlsPosition,
|
|
71
|
+
controlsOrder: controlsOrderProp,
|
|
61
72
|
onClose,
|
|
62
73
|
radius,
|
|
74
|
+
shadow,
|
|
63
75
|
withinPortal,
|
|
64
76
|
persistState,
|
|
65
77
|
minWidth,
|
|
@@ -67,8 +79,14 @@ const Window = core.factory((_props, _) => {
|
|
|
67
79
|
maxWidth,
|
|
68
80
|
maxHeight,
|
|
69
81
|
dragBounds,
|
|
70
|
-
|
|
71
|
-
|
|
82
|
+
x,
|
|
83
|
+
y,
|
|
84
|
+
defaultX,
|
|
85
|
+
defaultY,
|
|
86
|
+
width,
|
|
87
|
+
height,
|
|
88
|
+
defaultWidth,
|
|
89
|
+
defaultHeight,
|
|
72
90
|
onPositionChange,
|
|
73
91
|
onSizeChange,
|
|
74
92
|
withBorder,
|
|
@@ -82,9 +100,12 @@ const Window = core.factory((_props, _) => {
|
|
|
82
100
|
className,
|
|
83
101
|
...others
|
|
84
102
|
} = props;
|
|
103
|
+
const resolvedRadius = useResponsiveValue.useResponsiveValue(radius, void 0);
|
|
104
|
+
const resolvedShadow = useResponsiveValue.useResponsiveValue(shadow, "md");
|
|
105
|
+
const resolvedProps = { ...props, radius: resolvedRadius, shadow: resolvedShadow };
|
|
85
106
|
const getStyles = core.useStyles({
|
|
86
107
|
name: "Window",
|
|
87
|
-
props,
|
|
108
|
+
props: resolvedProps,
|
|
88
109
|
classes: Window_module,
|
|
89
110
|
className,
|
|
90
111
|
style,
|
|
@@ -103,10 +124,13 @@ const Window = core.factory((_props, _) => {
|
|
|
103
124
|
setIsCollapsed,
|
|
104
125
|
isVisible,
|
|
105
126
|
zIndex,
|
|
127
|
+
withinPortal: resolvedWithinPortal,
|
|
106
128
|
handleMouseDownDrag,
|
|
107
129
|
handleTouchStartDrag,
|
|
108
130
|
resizeHandlers,
|
|
109
|
-
handleClose
|
|
131
|
+
handleClose,
|
|
132
|
+
groupCtx,
|
|
133
|
+
applySingleLayout
|
|
110
134
|
} = useMantineWindow.useMantineWindow(props);
|
|
111
135
|
const draggableHeader = draggable === "header" || draggable === "both";
|
|
112
136
|
const draggableWindow = draggable === "window" || draggable === "both";
|
|
@@ -121,12 +145,14 @@ const Window = core.factory((_props, _) => {
|
|
|
121
145
|
mod: [{ "data-with-border": withBorder, "data-window-draggable": draggableWindow }, mod],
|
|
122
146
|
onMouseDown: draggableWindow ? handleMouseDownDrag : void 0,
|
|
123
147
|
onTouchStart: draggableWindow ? handleTouchStartDrag : void 0,
|
|
124
|
-
|
|
148
|
+
role: "dialog",
|
|
149
|
+
"aria-label": title || props.id || "Window",
|
|
125
150
|
"data-mantine-window": true,
|
|
126
151
|
...others,
|
|
152
|
+
bg: color,
|
|
127
153
|
...getStyles("root", {
|
|
128
154
|
style: {
|
|
129
|
-
position:
|
|
155
|
+
position: resolvedWithinPortal ? "fixed" : "absolute",
|
|
130
156
|
left: position.x,
|
|
131
157
|
top: position.y,
|
|
132
158
|
width: size.width,
|
|
@@ -140,36 +166,153 @@ const Window = core.factory((_props, _) => {
|
|
|
140
166
|
{
|
|
141
167
|
...getStyles("header"),
|
|
142
168
|
onClick: bringToFront,
|
|
143
|
-
mod: { "window-draggable": draggableHeader },
|
|
169
|
+
mod: { "window-draggable": draggableHeader, "controls-position": controlsPosition },
|
|
144
170
|
onMouseDown: draggableHeader ? handleMouseDownDrag : void 0,
|
|
145
171
|
onTouchStart: draggableHeader ? handleTouchStartDrag : void 0,
|
|
146
172
|
onDoubleClick: () => collapsable && setIsCollapsed(!isCollapsed)
|
|
147
173
|
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
174
|
+
(() => {
|
|
175
|
+
const defaultOrder = controlsPosition === "right" ? ["tools", "collapse", "close"] : ["close", "collapse", "tools"];
|
|
176
|
+
const order = controlsOrderProp ?? defaultOrder;
|
|
177
|
+
const controlElements = {
|
|
178
|
+
close: withCloseButton ? /* @__PURE__ */ React.createElement(
|
|
179
|
+
core.ActionIcon,
|
|
180
|
+
{
|
|
181
|
+
key: "close",
|
|
182
|
+
radius: 256,
|
|
183
|
+
color: "red",
|
|
184
|
+
onClick: handleClose,
|
|
185
|
+
"aria-label": "Close window",
|
|
186
|
+
...getStyles("closeButton")
|
|
187
|
+
},
|
|
188
|
+
/* @__PURE__ */ React.createElement(iconsReact.IconX, { size: 14 })
|
|
189
|
+
) : null,
|
|
190
|
+
collapse: withCollapseButton && collapsable ? /* @__PURE__ */ React.createElement(
|
|
191
|
+
core.ActionIcon,
|
|
192
|
+
{
|
|
193
|
+
key: "collapse",
|
|
194
|
+
radius: 256,
|
|
195
|
+
color: "yellow",
|
|
196
|
+
onClick: () => setIsCollapsed(!isCollapsed),
|
|
197
|
+
"aria-label": isCollapsed ? "Expand window" : "Collapse window",
|
|
198
|
+
...getStyles("collapseButton")
|
|
199
|
+
},
|
|
200
|
+
isCollapsed ? /* @__PURE__ */ React.createElement(iconsReact.IconPlus, { size: 14 }) : /* @__PURE__ */ React.createElement(iconsReact.IconMinus, { size: 14 })
|
|
201
|
+
) : null,
|
|
202
|
+
tools: withToolsButton && (groupCtx?.showToolsButton ?? true) ? /* @__PURE__ */ React.createElement(core.Menu, { key: "tools", shadow: "md", width: 220, position: "bottom-start", withArrow: true }, /* @__PURE__ */ React.createElement(core.Menu.Target, null, /* @__PURE__ */ React.createElement(
|
|
203
|
+
core.ActionIcon,
|
|
204
|
+
{
|
|
205
|
+
radius: 256,
|
|
206
|
+
color: "green",
|
|
207
|
+
"aria-label": "Window layout options",
|
|
208
|
+
...getStyles("windowToolsButton")
|
|
209
|
+
},
|
|
210
|
+
/* @__PURE__ */ React.createElement(LayoutIcons.FillIcon, { size: 14 })
|
|
211
|
+
)), /* @__PURE__ */ React.createElement(core.Menu.Dropdown, null, /* @__PURE__ */ React.createElement(core.Menu.Label, null, "Move & Resize"), /* @__PURE__ */ React.createElement(core.Flex, { justify: "space-between", pb: "xs", px: "sm" }, /* @__PURE__ */ React.createElement(
|
|
212
|
+
core.ActionIcon,
|
|
213
|
+
{
|
|
214
|
+
variant: "subtle",
|
|
215
|
+
size: "lg",
|
|
216
|
+
"aria-label": "Snap left",
|
|
217
|
+
onClick: () => applySingleLayout("snap-left")
|
|
218
|
+
},
|
|
219
|
+
/* @__PURE__ */ React.createElement(LayoutIcons.SnapLeftIcon, null)
|
|
220
|
+
), /* @__PURE__ */ React.createElement(
|
|
221
|
+
core.ActionIcon,
|
|
222
|
+
{
|
|
223
|
+
variant: "subtle",
|
|
224
|
+
size: "lg",
|
|
225
|
+
"aria-label": "Snap right",
|
|
226
|
+
onClick: () => applySingleLayout("snap-right")
|
|
227
|
+
},
|
|
228
|
+
/* @__PURE__ */ React.createElement(LayoutIcons.SnapRightIcon, null)
|
|
229
|
+
), /* @__PURE__ */ React.createElement(
|
|
230
|
+
core.ActionIcon,
|
|
231
|
+
{
|
|
232
|
+
variant: "subtle",
|
|
233
|
+
size: "lg",
|
|
234
|
+
"aria-label": "Snap top",
|
|
235
|
+
onClick: () => applySingleLayout("snap-top")
|
|
236
|
+
},
|
|
237
|
+
/* @__PURE__ */ React.createElement(LayoutIcons.SnapTopIcon, null)
|
|
238
|
+
), /* @__PURE__ */ React.createElement(
|
|
239
|
+
core.ActionIcon,
|
|
240
|
+
{
|
|
241
|
+
variant: "subtle",
|
|
242
|
+
size: "lg",
|
|
243
|
+
"aria-label": "Snap bottom",
|
|
244
|
+
onClick: () => applySingleLayout("snap-bottom")
|
|
245
|
+
},
|
|
246
|
+
/* @__PURE__ */ React.createElement(LayoutIcons.SnapBottomIcon, null)
|
|
247
|
+
)), /* @__PURE__ */ React.createElement(core.Menu.Divider, null), /* @__PURE__ */ React.createElement(core.Menu.Label, null, "Fill & Arrange"), /* @__PURE__ */ React.createElement(core.Flex, { justify: "space-between", pb: "xs", px: "sm" }, /* @__PURE__ */ React.createElement(
|
|
248
|
+
core.ActionIcon,
|
|
249
|
+
{
|
|
250
|
+
variant: "subtle",
|
|
251
|
+
size: "lg",
|
|
252
|
+
"aria-label": "Fill",
|
|
253
|
+
onClick: () => applySingleLayout("fill")
|
|
254
|
+
},
|
|
255
|
+
/* @__PURE__ */ React.createElement(LayoutIcons.FillIcon, null)
|
|
256
|
+
), groupCtx && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
257
|
+
core.ActionIcon,
|
|
258
|
+
{
|
|
259
|
+
variant: "subtle",
|
|
260
|
+
size: "lg",
|
|
261
|
+
"aria-label": "Arrange columns",
|
|
262
|
+
onClick: () => groupCtx.applyLayout("arrange-columns")
|
|
263
|
+
},
|
|
264
|
+
/* @__PURE__ */ React.createElement(LayoutIcons.ArrangeColumnsIcon, null)
|
|
265
|
+
), /* @__PURE__ */ React.createElement(
|
|
266
|
+
core.ActionIcon,
|
|
267
|
+
{
|
|
268
|
+
variant: "subtle",
|
|
269
|
+
size: "lg",
|
|
270
|
+
"aria-label": "Arrange rows",
|
|
271
|
+
onClick: () => groupCtx.applyLayout("arrange-rows")
|
|
272
|
+
},
|
|
273
|
+
/* @__PURE__ */ React.createElement(LayoutIcons.ArrangeRowsIcon, null)
|
|
274
|
+
), /* @__PURE__ */ React.createElement(
|
|
275
|
+
core.ActionIcon,
|
|
276
|
+
{
|
|
277
|
+
variant: "subtle",
|
|
278
|
+
size: "lg",
|
|
279
|
+
"aria-label": "Tile",
|
|
280
|
+
onClick: () => groupCtx.applyLayout("tile")
|
|
281
|
+
},
|
|
282
|
+
/* @__PURE__ */ React.createElement(LayoutIcons.TileIcon, null)
|
|
283
|
+
))), groupCtx && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(core.Menu.Divider, null), /* @__PURE__ */ React.createElement(core.Menu.Item, { onClick: () => groupCtx.collapseAll() }, "Collapse all"), /* @__PURE__ */ React.createElement(core.Menu.Item, { onClick: () => groupCtx.expandAll() }, "Expand all"), /* @__PURE__ */ React.createElement(core.Menu.Item, { color: "red", onClick: () => groupCtx.closeAll() }, "Close all")))) : null
|
|
284
|
+
};
|
|
285
|
+
const controlsGroup = /* @__PURE__ */ React.createElement(core.Flex, { align: "center", gap: 8 }, order.map((name) => controlElements[name]));
|
|
286
|
+
const titleGroup = /* @__PURE__ */ React.createElement(core.Flex, { align: "center", gap: "xs", miw: 0 }, /* @__PURE__ */ React.createElement(core.Text, { truncate: true, ...getStyles("title") }, title));
|
|
287
|
+
return /* @__PURE__ */ React.createElement(
|
|
288
|
+
core.Flex,
|
|
289
|
+
{
|
|
290
|
+
align: "center",
|
|
291
|
+
gap: "xs",
|
|
292
|
+
miw: 0,
|
|
293
|
+
justify: controlsPosition === "right" ? "space-between" : void 0,
|
|
294
|
+
w: controlsPosition === "right" ? "100%" : void 0
|
|
295
|
+
},
|
|
296
|
+
controlsPosition === "left" ? /* @__PURE__ */ React.createElement(React.Fragment, null, controlsGroup, titleGroup) : /* @__PURE__ */ React.createElement(React.Fragment, null, titleGroup, controlsGroup)
|
|
297
|
+
);
|
|
298
|
+
})()
|
|
299
|
+
), !isCollapsed && /* @__PURE__ */ React.createElement(React.Fragment, null, withScrollArea ? /* @__PURE__ */ React.createElement(
|
|
168
300
|
core.ScrollArea,
|
|
169
301
|
{
|
|
170
302
|
...getStyles("content", {
|
|
171
303
|
style: {
|
|
172
|
-
height: size.height -
|
|
304
|
+
height: Math.max(0, size.height - HEADER_HEIGHT)
|
|
305
|
+
}
|
|
306
|
+
})
|
|
307
|
+
},
|
|
308
|
+
children
|
|
309
|
+
) : /* @__PURE__ */ React.createElement(
|
|
310
|
+
core.Box,
|
|
311
|
+
{
|
|
312
|
+
...getStyles("content", {
|
|
313
|
+
style: {
|
|
314
|
+
height: Math.max(0, size.height - HEADER_HEIGHT),
|
|
315
|
+
overflow: "hidden"
|
|
173
316
|
}
|
|
174
317
|
})
|
|
175
318
|
},
|
|
@@ -239,6 +382,7 @@ const Window = core.factory((_props, _) => {
|
|
|
239
382
|
});
|
|
240
383
|
Window.classes = Window_module;
|
|
241
384
|
Window.displayName = "Window";
|
|
385
|
+
Window.Group = WindowGroup.WindowGroup;
|
|
242
386
|
|
|
243
387
|
exports.Window = Window;
|
|
244
388
|
exports.defaultProps = defaultProps;
|