@rowsncolumns/grid 9.0.3 → 13.2.32
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/LICENSE.md +100 -0
- package/Readme.md +53 -59
- package/dist/cjs/Cell.d.ts +35 -0
- package/dist/cjs/Cell.d.ts.map +1 -0
- package/dist/cjs/Cell.js +29 -0
- package/dist/{CellOverlay.d.ts → cjs/CellOverlay.d.ts} +5 -5
- package/dist/cjs/CellOverlay.d.ts.map +1 -0
- package/dist/cjs/CellOverlay.js +126 -0
- package/dist/cjs/Context.d.ts +8 -0
- package/dist/cjs/Context.d.ts.map +1 -0
- package/dist/cjs/Context.js +13 -0
- package/dist/{FillHandle.d.ts → cjs/FillHandle.d.ts} +2 -1
- package/dist/cjs/FillHandle.d.ts.map +1 -0
- package/dist/cjs/FillHandle.js +26 -0
- package/dist/cjs/Grid.d.ts +558 -0
- package/dist/cjs/Grid.d.ts.map +1 -0
- package/dist/cjs/Grid.js +2446 -0
- package/dist/{GridLine.d.ts → cjs/GridLine.d.ts} +2 -1
- package/dist/cjs/GridLine.d.ts.map +1 -0
- package/dist/cjs/GridLine.js +10 -0
- package/dist/cjs/Image.d.ts +11 -0
- package/dist/cjs/Image.d.ts.map +1 -0
- package/dist/cjs/Image.js +57 -0
- package/dist/cjs/MemoizedGrid.d.ts +49 -0
- package/dist/cjs/MemoizedGrid.d.ts.map +1 -0
- package/dist/cjs/MemoizedGrid.js +105 -0
- package/dist/cjs/Selection.d.ts +5 -0
- package/dist/cjs/Selection.d.ts.map +1 -0
- package/dist/cjs/Selection.js +10 -0
- package/dist/{helpers.d.ts → cjs/helpers.d.ts} +59 -39
- package/dist/cjs/helpers.d.ts.map +1 -0
- package/dist/cjs/helpers.js +1409 -0
- package/dist/{hooks → cjs/hooks}/useCopyPaste.d.ts +3 -2
- package/dist/cjs/hooks/useCopyPaste.d.ts.map +1 -0
- package/dist/cjs/hooks/useCopyPaste.js +230 -0
- package/dist/{hooks → cjs/hooks}/useEditable.d.ts +21 -8
- package/dist/cjs/hooks/useEditable.d.ts.map +1 -0
- package/dist/cjs/hooks/useEditable.js +491 -0
- package/dist/{hooks → cjs/hooks}/useFilter.d.ts +3 -2
- package/dist/cjs/hooks/useFilter.d.ts.map +1 -0
- package/dist/cjs/hooks/useFilter.js +97 -0
- package/dist/{hooks → cjs/hooks}/useImage.d.ts +1 -0
- package/dist/cjs/hooks/useImage.d.ts.map +1 -0
- package/dist/cjs/hooks/useImage.js +80 -0
- package/dist/{hooks → cjs/hooks}/usePagination.d.ts +3 -2
- package/dist/cjs/hooks/usePagination.d.ts.map +1 -0
- package/dist/cjs/hooks/usePagination.js +53 -0
- package/dist/{hooks → cjs/hooks}/useSizer.d.ts +28 -29
- package/dist/cjs/hooks/useSizer.d.ts.map +1 -0
- package/dist/cjs/hooks/useSizer.js +176 -0
- package/dist/{hooks → cjs/hooks}/useTooltip.d.ts +2 -1
- package/dist/cjs/hooks/useTooltip.d.ts.map +1 -0
- package/dist/cjs/hooks/useTooltip.js +82 -0
- package/dist/{hooks → cjs/hooks}/useUndo.d.ts +2 -1
- package/dist/cjs/hooks/useUndo.d.ts.map +1 -0
- package/dist/cjs/hooks/useUndo.js +87 -0
- package/dist/cjs/index.d.ts +19 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +29 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/{types.d.ts → cjs/types.d.ts} +8 -3
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/{types.js → cjs/types.js} +7 -8
- package/dist/cjs/utils.d.ts +9 -0
- package/dist/cjs/utils.d.ts.map +1 -0
- package/dist/cjs/utils.js +58 -0
- package/dist/cjs/vitest.config.d.ts +3 -0
- package/dist/cjs/vitest.config.d.ts.map +1 -0
- package/dist/cjs/vitest.config.js +24 -0
- package/dist/esm/Cell.d.ts +35 -0
- package/dist/esm/Cell.d.ts.map +1 -0
- package/dist/esm/Cell.js +24 -0
- package/dist/esm/CellOverlay.d.ts +21 -0
- package/dist/esm/CellOverlay.d.ts.map +1 -0
- package/dist/esm/CellOverlay.js +120 -0
- package/dist/esm/Context.d.ts +8 -0
- package/dist/esm/Context.d.ts.map +1 -0
- package/dist/esm/Context.js +9 -0
- package/dist/esm/FillHandle.d.ts +8 -0
- package/dist/esm/FillHandle.d.ts.map +1 -0
- package/dist/{FillHandle.js → esm/FillHandle.js} +5 -11
- package/dist/esm/Grid.d.ts +558 -0
- package/dist/esm/Grid.d.ts.map +1 -0
- package/dist/esm/Grid.js +2451 -0
- package/dist/esm/GridLine.d.ts +5 -0
- package/dist/esm/GridLine.d.ts.map +1 -0
- package/dist/esm/GridLine.js +7 -0
- package/dist/esm/Image.d.ts +11 -0
- package/dist/esm/Image.d.ts.map +1 -0
- package/dist/esm/Image.js +53 -0
- package/dist/esm/MemoizedGrid.d.ts +49 -0
- package/dist/esm/MemoizedGrid.d.ts.map +1 -0
- package/dist/esm/MemoizedGrid.js +98 -0
- package/dist/esm/Selection.d.ts +5 -0
- package/dist/esm/Selection.d.ts.map +1 -0
- package/dist/esm/Selection.js +7 -0
- package/dist/esm/helpers.d.ts +281 -0
- package/dist/esm/helpers.d.ts.map +1 -0
- package/dist/esm/helpers.js +1260 -0
- package/dist/esm/hooks/useCopyPaste.d.ts +53 -0
- package/dist/esm/hooks/useCopyPaste.d.ts.map +1 -0
- package/dist/{hooks → esm/hooks}/useCopyPaste.js +40 -46
- package/dist/esm/hooks/useEditable.d.ts +253 -0
- package/dist/esm/hooks/useEditable.d.ts.map +1 -0
- package/dist/esm/hooks/useEditable.js +482 -0
- package/dist/esm/hooks/useFilter.d.ts +69 -0
- package/dist/esm/hooks/useFilter.d.ts.map +1 -0
- package/dist/{hooks → esm/hooks}/useFilter.js +22 -42
- package/dist/esm/hooks/useImage.d.ts +13 -0
- package/dist/esm/hooks/useImage.d.ts.map +1 -0
- package/dist/esm/hooks/useImage.js +76 -0
- package/dist/esm/hooks/usePagination.d.ts +69 -0
- package/dist/esm/hooks/usePagination.d.ts.map +1 -0
- package/dist/esm/hooks/usePagination.js +47 -0
- package/dist/esm/hooks/useSizer.d.ts +114 -0
- package/dist/esm/hooks/useSizer.d.ts.map +1 -0
- package/dist/esm/hooks/useSizer.js +176 -0
- package/dist/esm/hooks/useTooltip.d.ts +43 -0
- package/dist/esm/hooks/useTooltip.d.ts.map +1 -0
- package/dist/esm/hooks/useTooltip.js +80 -0
- package/dist/esm/hooks/useUndo.d.ts +36 -0
- package/dist/esm/hooks/useUndo.d.ts.map +1 -0
- package/dist/{hooks → esm/hooks}/useUndo.js +16 -25
- package/dist/esm/index.d.ts +19 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +17 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/esm/types.d.ts +70 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +68 -0
- package/dist/esm/utils.d.ts +9 -0
- package/dist/esm/utils.d.ts.map +1 -0
- package/dist/esm/utils.js +104 -0
- package/dist/esm/vitest.config.d.ts +3 -0
- package/dist/esm/vitest.config.d.ts.map +1 -0
- package/dist/esm/vitest.config.js +22 -0
- package/package.json +28 -29
- package/dist/Cell.d.ts +0 -23
- package/dist/Cell.js +0 -55
- package/dist/Cell.js.map +0 -1
- package/dist/CellOverlay.js +0 -116
- package/dist/CellOverlay.js.map +0 -1
- package/dist/FillHandle.js.map +0 -1
- package/dist/Grid.d.ts +0 -385
- package/dist/Grid.js +0 -1684
- package/dist/Grid.js.map +0 -1
- package/dist/GridLine.js +0 -13
- package/dist/GridLine.js.map +0 -1
- package/dist/Image.d.ts +0 -8
- package/dist/Image.js +0 -50
- package/dist/Image.js.map +0 -1
- package/dist/Selection.d.ts +0 -4
- package/dist/Selection.js +0 -9
- package/dist/Selection.js.map +0 -1
- package/dist/helpers.js +0 -1033
- package/dist/helpers.js.map +0 -1
- package/dist/hooks/useCopyPaste.js.map +0 -1
- package/dist/hooks/useEditable.js +0 -477
- package/dist/hooks/useEditable.js.map +0 -1
- package/dist/hooks/useFilter.js.map +0 -1
- package/dist/hooks/useImage.js +0 -42
- package/dist/hooks/useImage.js.map +0 -1
- package/dist/hooks/usePagination.js +0 -73
- package/dist/hooks/usePagination.js.map +0 -1
- package/dist/hooks/useSelection.d.ts +0 -175
- package/dist/hooks/useSelection.js +0 -980
- package/dist/hooks/useSelection.js.map +0 -1
- package/dist/hooks/useSizer.js +0 -150
- package/dist/hooks/useSizer.js.map +0 -1
- package/dist/hooks/useTooltip.js +0 -106
- package/dist/hooks/useTooltip.js.map +0 -1
- package/dist/hooks/useTouch.d.ts +0 -21
- package/dist/hooks/useTouch.js +0 -73
- package/dist/hooks/useTouch.js.map +0 -1
- package/dist/hooks/useUndo.js.map +0 -1
- package/dist/index.d.ts +0 -25
- package/dist/index.js +0 -61
- package/dist/index.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils.d.ts +0 -8
- package/dist/utils.js +0 -153
- package/dist/utils.js.map +0 -1
- package/src/Cell.tsx +0 -100
- package/src/CellOverlay.tsx +0 -191
- package/src/FillHandle.tsx +0 -37
- package/src/Grid.tsx +0 -2677
- package/src/GridLine.tsx +0 -23
- package/src/Image.tsx +0 -43
- package/src/Selection.tsx +0 -9
- package/src/helpers.ts +0 -1455
- package/src/hooks/useCopyPaste.ts +0 -265
- package/src/hooks/useEditable.tsx +0 -945
- package/src/hooks/useFilter.tsx +0 -233
- package/src/hooks/useImage.ts +0 -57
- package/src/hooks/usePagination.tsx +0 -153
- package/src/hooks/useSelection.ts +0 -1437
- package/src/hooks/useSizer.ts +0 -312
- package/src/hooks/useTooltip.tsx +0 -172
- package/src/hooks/useTouch.ts +0 -116
- package/src/hooks/useUndo.ts +0 -134
- package/src/index.tsx +0 -46
- package/src/tests/Grid.spec.tsx +0 -47
- package/src/tests/helpers.test.ts +0 -292
- package/src/tests/usePagination.test.ts +0 -28
- package/src/tests/useSelection.test.ts +0 -27
- package/src/tests/useUndo.test.ts +0 -73
- package/src/types.ts +0 -69
- package/src/utils.tsx +0 -287
package/src/types.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
export enum KeyCodes {
|
|
2
|
-
Right = 39,
|
|
3
|
-
Left = 37,
|
|
4
|
-
Up = 38,
|
|
5
|
-
Down = 40,
|
|
6
|
-
Escape = 27,
|
|
7
|
-
Tab = 9,
|
|
8
|
-
Meta = 91,
|
|
9
|
-
Delete = 46,
|
|
10
|
-
BackSpace = 8,
|
|
11
|
-
Enter = 13,
|
|
12
|
-
A = 65,
|
|
13
|
-
SPACE = 32,
|
|
14
|
-
ALT = 18,
|
|
15
|
-
C = 67,
|
|
16
|
-
Home = 36,
|
|
17
|
-
End = 35,
|
|
18
|
-
PageDown = 34,
|
|
19
|
-
PageUp = 33,
|
|
20
|
-
Z = 90,
|
|
21
|
-
CapsLock = 20,
|
|
22
|
-
KEY_B = 66,
|
|
23
|
-
KEY_I = 73,
|
|
24
|
-
KEY_U = 85,
|
|
25
|
-
KEY_X = 88,
|
|
26
|
-
KEY_L = 76,
|
|
27
|
-
KEY_E = 69,
|
|
28
|
-
KEY_R = 82,
|
|
29
|
-
BACK_SLASH = 220,
|
|
30
|
-
KEY_Y = 89,
|
|
31
|
-
ScrollLock = 145,
|
|
32
|
-
NumLock = 144,
|
|
33
|
-
Pause = 19,
|
|
34
|
-
Insert = 45,
|
|
35
|
-
F1 = 112,
|
|
36
|
-
F2 = 113,
|
|
37
|
-
F3 = 114,
|
|
38
|
-
F4 = 115,
|
|
39
|
-
F5 = 116,
|
|
40
|
-
F6 = 117,
|
|
41
|
-
F7 = 118,
|
|
42
|
-
F8 = 119,
|
|
43
|
-
F9 = 120,
|
|
44
|
-
F10 = 121,
|
|
45
|
-
F11 = 122,
|
|
46
|
-
F12 = 123,
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export enum Direction {
|
|
50
|
-
Up = "UP",
|
|
51
|
-
Down = "DOWN",
|
|
52
|
-
Left = "LEFT",
|
|
53
|
-
Right = "RIGHT",
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export enum MimeType {
|
|
57
|
-
html = "text/html",
|
|
58
|
-
csv = "text/csv",
|
|
59
|
-
plain = "text/plain",
|
|
60
|
-
json = "application/json",
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export enum MouseButtonCodes {
|
|
64
|
-
"left" = 1,
|
|
65
|
-
"middle" = 2,
|
|
66
|
-
"right" = 3,
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export type SelectionPolicy = "single" | "range" | "multiple";
|
package/src/utils.tsx
DELETED
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ShapeConfig } from "konva/lib/Shape";
|
|
3
|
-
import { Line, Rect } from "react-konva";
|
|
4
|
-
import { SelectionProps } from "./Grid";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Create a box with custom top/right/bottom/left colors and widths
|
|
8
|
-
* @param param0
|
|
9
|
-
*/
|
|
10
|
-
export const createCanvasBox = ({
|
|
11
|
-
x = 0,
|
|
12
|
-
y = 0,
|
|
13
|
-
width = 0,
|
|
14
|
-
height = 0,
|
|
15
|
-
fill,
|
|
16
|
-
stroke,
|
|
17
|
-
strokeLeftColor = stroke,
|
|
18
|
-
strokeTopColor = stroke,
|
|
19
|
-
strokeRightColor = stroke,
|
|
20
|
-
strokeBottomColor = stroke,
|
|
21
|
-
strokeWidth = 0,
|
|
22
|
-
strokeTopWidth = strokeWidth,
|
|
23
|
-
strokeRightWidth = strokeWidth,
|
|
24
|
-
strokeBottomWidth = strokeWidth,
|
|
25
|
-
strokeLeftWidth = strokeWidth,
|
|
26
|
-
dash,
|
|
27
|
-
dashEnabled,
|
|
28
|
-
lineCap = "square",
|
|
29
|
-
key,
|
|
30
|
-
}: ShapeConfig) => {
|
|
31
|
-
const commonProps = {
|
|
32
|
-
perfectDrawEnabled: false,
|
|
33
|
-
shadowForStrokeEnabled: false,
|
|
34
|
-
hitStrokeWidth: 0,
|
|
35
|
-
listening: false,
|
|
36
|
-
};
|
|
37
|
-
const composite = undefined;
|
|
38
|
-
const lines = [
|
|
39
|
-
<Line
|
|
40
|
-
points={[x, y, x + width, y]}
|
|
41
|
-
stroke={strokeTopColor}
|
|
42
|
-
strokeWidth={strokeTopWidth}
|
|
43
|
-
dash={dash}
|
|
44
|
-
dashEnabled={dashEnabled}
|
|
45
|
-
lineCap={lineCap}
|
|
46
|
-
key="top"
|
|
47
|
-
globalCompositeOperation={composite}
|
|
48
|
-
{...commonProps}
|
|
49
|
-
/>,
|
|
50
|
-
<Line
|
|
51
|
-
points={[x + width, y, x + width, y + height]}
|
|
52
|
-
stroke={strokeRightColor}
|
|
53
|
-
strokeWidth={strokeRightWidth}
|
|
54
|
-
dash={dash}
|
|
55
|
-
dashEnabled={dashEnabled}
|
|
56
|
-
lineCap={lineCap}
|
|
57
|
-
key="right"
|
|
58
|
-
globalCompositeOperation={composite}
|
|
59
|
-
{...commonProps}
|
|
60
|
-
/>,
|
|
61
|
-
<Line
|
|
62
|
-
points={[x + width, y + height, x, y + height]}
|
|
63
|
-
stroke={strokeBottomColor}
|
|
64
|
-
strokeWidth={strokeBottomWidth}
|
|
65
|
-
dash={dash}
|
|
66
|
-
dashEnabled={dashEnabled}
|
|
67
|
-
lineCap={lineCap}
|
|
68
|
-
key="bottom"
|
|
69
|
-
globalCompositeOperation={composite}
|
|
70
|
-
{...commonProps}
|
|
71
|
-
/>,
|
|
72
|
-
<Line
|
|
73
|
-
points={[x, y + height, x, y]}
|
|
74
|
-
stroke={strokeLeftColor}
|
|
75
|
-
strokeWidth={strokeLeftWidth}
|
|
76
|
-
dash={dash}
|
|
77
|
-
dashEnabled={dashEnabled}
|
|
78
|
-
lineCap={lineCap}
|
|
79
|
-
key="left"
|
|
80
|
-
globalCompositeOperation={composite}
|
|
81
|
-
{...commonProps}
|
|
82
|
-
/>,
|
|
83
|
-
];
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<React.Fragment key={key}>
|
|
87
|
-
{fill && (
|
|
88
|
-
<Rect
|
|
89
|
-
globalCompositeOperation={composite}
|
|
90
|
-
fill={fill}
|
|
91
|
-
x={x}
|
|
92
|
-
y={y}
|
|
93
|
-
width={width}
|
|
94
|
-
height={height}
|
|
95
|
-
{...commonProps}
|
|
96
|
-
/>
|
|
97
|
-
)}
|
|
98
|
-
{lines}
|
|
99
|
-
</React.Fragment>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export const createHTMLBox = ({
|
|
104
|
-
x = 0,
|
|
105
|
-
y = 0,
|
|
106
|
-
width = 0,
|
|
107
|
-
height = 0,
|
|
108
|
-
fill,
|
|
109
|
-
stroke,
|
|
110
|
-
strokeLeftColor = stroke,
|
|
111
|
-
strokeTopColor = stroke,
|
|
112
|
-
strokeRightColor = stroke,
|
|
113
|
-
strokeBottomColor = stroke,
|
|
114
|
-
strokeWidth = 0,
|
|
115
|
-
strokeTopWidth = strokeWidth,
|
|
116
|
-
strokeRightWidth = strokeWidth,
|
|
117
|
-
strokeBottomWidth = strokeWidth,
|
|
118
|
-
strokeLeftWidth = strokeWidth,
|
|
119
|
-
key,
|
|
120
|
-
strokeStyle = "solid",
|
|
121
|
-
fillOpacity = 1,
|
|
122
|
-
draggable,
|
|
123
|
-
isDragging,
|
|
124
|
-
borderCoverWidth = 5,
|
|
125
|
-
type,
|
|
126
|
-
bounds,
|
|
127
|
-
activeCell,
|
|
128
|
-
...props
|
|
129
|
-
}: SelectionProps) => {
|
|
130
|
-
const lineStyles: Partial<React.CSSProperties> = {
|
|
131
|
-
borderWidth: 0,
|
|
132
|
-
position: "absolute",
|
|
133
|
-
pointerEvents: "none",
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* Border cover is so that there is enough
|
|
137
|
-
* draggable handle area for the user.
|
|
138
|
-
* Default is 5px
|
|
139
|
-
*/
|
|
140
|
-
const showBorderCover = draggable;
|
|
141
|
-
const borderCoverStyle: React.CSSProperties = {
|
|
142
|
-
position: "absolute",
|
|
143
|
-
pointerEvents: draggable ? "auto" : "none",
|
|
144
|
-
cursor: draggable ? (isDragging ? "grabbing" : "grab") : "initial",
|
|
145
|
-
};
|
|
146
|
-
width = width - Math.floor(strokeWidth / 2);
|
|
147
|
-
height = height - Math.floor(strokeWidth / 2);
|
|
148
|
-
// y = y - Math.ceil(strokeWidth / 2);
|
|
149
|
-
const lines = [
|
|
150
|
-
<div
|
|
151
|
-
style={{
|
|
152
|
-
...lineStyles,
|
|
153
|
-
left: x,
|
|
154
|
-
top: y,
|
|
155
|
-
width: width,
|
|
156
|
-
height: strokeTopWidth,
|
|
157
|
-
borderColor: strokeTopColor,
|
|
158
|
-
borderTopWidth: strokeTopWidth,
|
|
159
|
-
borderStyle: strokeStyle,
|
|
160
|
-
}}
|
|
161
|
-
key="top"
|
|
162
|
-
{...props}
|
|
163
|
-
/>,
|
|
164
|
-
<div
|
|
165
|
-
style={{
|
|
166
|
-
...lineStyles,
|
|
167
|
-
left: x + width,
|
|
168
|
-
top: y,
|
|
169
|
-
width: strokeRightWidth,
|
|
170
|
-
height: height,
|
|
171
|
-
borderColor: strokeRightColor,
|
|
172
|
-
borderRightWidth: strokeRightWidth,
|
|
173
|
-
borderStyle: strokeStyle,
|
|
174
|
-
}}
|
|
175
|
-
key="right"
|
|
176
|
-
{...props}
|
|
177
|
-
/>,
|
|
178
|
-
<div
|
|
179
|
-
style={{
|
|
180
|
-
...lineStyles,
|
|
181
|
-
left: x,
|
|
182
|
-
top: y + height,
|
|
183
|
-
width: width + strokeTopWidth,
|
|
184
|
-
height: strokeBottomWidth,
|
|
185
|
-
borderColor: strokeBottomColor,
|
|
186
|
-
borderBottomWidth: strokeBottomWidth,
|
|
187
|
-
borderStyle: strokeStyle,
|
|
188
|
-
}}
|
|
189
|
-
key="bottom"
|
|
190
|
-
{...props}
|
|
191
|
-
/>,
|
|
192
|
-
<div
|
|
193
|
-
style={{
|
|
194
|
-
...lineStyles,
|
|
195
|
-
left: x,
|
|
196
|
-
top: y,
|
|
197
|
-
width: strokeLeftWidth,
|
|
198
|
-
height: height,
|
|
199
|
-
borderColor: strokeLeftColor,
|
|
200
|
-
borderLeftWidth: strokeLeftWidth,
|
|
201
|
-
borderStyle: strokeStyle,
|
|
202
|
-
}}
|
|
203
|
-
key="left"
|
|
204
|
-
{...props}
|
|
205
|
-
/>,
|
|
206
|
-
];
|
|
207
|
-
const borderCovers = [
|
|
208
|
-
<div
|
|
209
|
-
style={{
|
|
210
|
-
...borderCoverStyle,
|
|
211
|
-
left: x,
|
|
212
|
-
top: y,
|
|
213
|
-
width: width,
|
|
214
|
-
height: 5,
|
|
215
|
-
}}
|
|
216
|
-
key="top"
|
|
217
|
-
{...props}
|
|
218
|
-
/>,
|
|
219
|
-
<div
|
|
220
|
-
style={{
|
|
221
|
-
...borderCoverStyle,
|
|
222
|
-
left: x + width - borderCoverWidth + strokeRightWidth,
|
|
223
|
-
top: y,
|
|
224
|
-
width: borderCoverWidth,
|
|
225
|
-
height: height,
|
|
226
|
-
}}
|
|
227
|
-
key="right"
|
|
228
|
-
{...props}
|
|
229
|
-
/>,
|
|
230
|
-
<div
|
|
231
|
-
style={{
|
|
232
|
-
...borderCoverStyle,
|
|
233
|
-
left: x,
|
|
234
|
-
top: y + height - borderCoverWidth + strokeBottomWidth,
|
|
235
|
-
width: width + strokeTopWidth,
|
|
236
|
-
height: borderCoverWidth,
|
|
237
|
-
}}
|
|
238
|
-
key="bottom"
|
|
239
|
-
{...props}
|
|
240
|
-
/>,
|
|
241
|
-
<div
|
|
242
|
-
style={{
|
|
243
|
-
...borderCoverStyle,
|
|
244
|
-
left: x,
|
|
245
|
-
top: y,
|
|
246
|
-
width: borderCoverWidth,
|
|
247
|
-
height: height,
|
|
248
|
-
}}
|
|
249
|
-
key="left"
|
|
250
|
-
{...props}
|
|
251
|
-
/>,
|
|
252
|
-
];
|
|
253
|
-
/**
|
|
254
|
-
* Display title component
|
|
255
|
-
* Only if title is not null
|
|
256
|
-
*/
|
|
257
|
-
const titleProps = {
|
|
258
|
-
isDragging,
|
|
259
|
-
x,
|
|
260
|
-
y,
|
|
261
|
-
stroke: strokeTopColor,
|
|
262
|
-
width,
|
|
263
|
-
bounds,
|
|
264
|
-
strokeWidth,
|
|
265
|
-
};
|
|
266
|
-
return (
|
|
267
|
-
<React.Fragment key={key}>
|
|
268
|
-
{fill && (
|
|
269
|
-
<div
|
|
270
|
-
style={{
|
|
271
|
-
position: "absolute",
|
|
272
|
-
top: y,
|
|
273
|
-
left: x,
|
|
274
|
-
height,
|
|
275
|
-
width,
|
|
276
|
-
backgroundColor: fill,
|
|
277
|
-
opacity: fillOpacity,
|
|
278
|
-
userSelect: "none",
|
|
279
|
-
pointerEvents: "none",
|
|
280
|
-
}}
|
|
281
|
-
/>
|
|
282
|
-
)}
|
|
283
|
-
{lines}
|
|
284
|
-
{showBorderCover && borderCovers}
|
|
285
|
-
</React.Fragment>
|
|
286
|
-
);
|
|
287
|
-
};
|