@progress/kendo-react-layout 13.4.0-develop.2 → 13.4.0-develop.4
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/card/Avatar.js +1 -1
- package/card/Avatar.mjs +1 -2
- package/card/interfaces/AvatarProps.d.ts +2 -1
- package/dist/cdn/js/kendo-react-layout.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +8 -8
- package/tilelayout/InternalTile.d.ts +5 -81
- package/tilelayout/InternalTile.js +1 -1
- package/tilelayout/InternalTile.mjs +194 -209
- package/tilelayout/ResizeHandlers.d.ts +3 -5
- package/tilelayout/ResizeHandlers.js +1 -1
- package/tilelayout/ResizeHandlers.mjs +38 -41
- package/tilelayout/TileLayout.d.ts +24 -69
- package/tilelayout/TileLayout.js +1 -1
- package/tilelayout/TileLayout.mjs +101 -97
- package/tilelayout/interfaces/index.d.ts +2 -2
|
@@ -5,233 +5,218 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
10
|
-
import { getScrollbarWidth as
|
|
11
|
-
import { ResizeHandlers as
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
import * as n from "react";
|
|
9
|
+
import o from "prop-types";
|
|
10
|
+
import { getScrollbarWidth as G, canUseDOM as J, classNames as Y, Draggable as Q } from "@progress/kendo-react-common";
|
|
11
|
+
import { ResizeHandlers as Z } from "./ResizeHandlers.mjs";
|
|
12
|
+
const O = 200, T = {
|
|
13
|
+
resizable: !0,
|
|
14
|
+
reorderable: !0
|
|
15
|
+
}, N = (t) => {
|
|
16
|
+
var B, X;
|
|
17
|
+
const b = (B = t.reorderable) != null ? B : T.reorderable, H = (X = t.resizable) != null ? X : T.resizable, s = n.useRef(null), c = n.useRef(null), k = n.useRef(null), v = n.useRef({}), E = n.useRef(!1), D = n.useRef(!1), z = n.useRef(!1), $ = n.useRef({ x: 0, y: 0 }), w = n.useRef({ x: 0, y: 0 }), u = n.useRef({ x: 0, y: 0 }), P = n.useRef(void 0), x = n.useRef(t), [R, F] = n.useState(!1), [q, I] = n.useState(!1), d = n.useCallback(() => k.current ? k.current.element : void 0, []), S = n.useCallback(() => {
|
|
18
|
+
if (s.current && c.current) {
|
|
19
|
+
const e = s.current.getBoundingClientRect();
|
|
20
|
+
c.current.style.top = e.top + "px", c.current.style.left = e.left + "px", c.current.style.height = s.current.offsetHeight + "px", c.current.style.width = s.current.offsetWidth + "px";
|
|
21
|
+
}
|
|
22
|
+
}, []), A = n.useCallback(() => {
|
|
23
|
+
S();
|
|
24
|
+
}, [S]), p = n.useCallback(() => {
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
S();
|
|
27
|
+
}, 100);
|
|
28
|
+
}, [S]), U = n.useCallback(() => {
|
|
29
|
+
const e = d();
|
|
30
|
+
if (!e || !c.current)
|
|
31
|
+
return;
|
|
32
|
+
const r = e.getBoundingClientRect(), i = r.top + u.current.y, a = r.left + u.current.x;
|
|
33
|
+
c.current.style.top = `${i}px`, c.current.style.left = `${a}px`, c.current.style.display = "block";
|
|
34
|
+
}, [d]), L = n.useCallback(() => {
|
|
35
|
+
E.current = D.current = !1, u.current = { x: 0, y: 0 }, s.current && c.current && (s.current.style.zIndex = "1", c.current.classList.remove("k-layout-item-hint-resize"), I(!1));
|
|
36
|
+
const e = d();
|
|
37
|
+
e && (e.style.transform = "translate(0px, 0px)", e.style.transition = `transform ${O}ms cubic-bezier(0.2, 0, 0, 1) 0s`, e.style.marginRight = "0px", e.style.marginLeft = "0px", e.style.height = "100%", e.classList.remove("k-cursor-grabbing"), b && e.classList.add("k-cursor-move")), t.onRelease();
|
|
38
|
+
}, [t, b, d]), W = n.useCallback(
|
|
39
|
+
(e, r) => {
|
|
40
|
+
if (r.end) {
|
|
41
|
+
L();
|
|
20
42
|
return;
|
|
21
43
|
}
|
|
22
|
-
if (!
|
|
44
|
+
if (!s.current || !c.current)
|
|
23
45
|
return;
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
46
|
+
const i = e.clientX, a = e.clientY;
|
|
47
|
+
D.current = !0;
|
|
48
|
+
const f = (r.direction !== "ns" ? i - w.current.x : 0) * (R ? -1 : 1), l = r.direction !== "ew" ? a - w.current.y : 0, h = d();
|
|
49
|
+
if (h && (R ? h.style.marginLeft = -f + "px" : h.style.marginRight = -f + "px", h.style.height = `calc(100% + ${l}px)`), c.current.classList.add("k-layout-item-hint-resize"), P.current)
|
|
28
50
|
return;
|
|
29
|
-
let
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
51
|
+
let g = 0, y = 0;
|
|
52
|
+
const C = s.current.getBoundingClientRect();
|
|
53
|
+
f > C.width / t.defaultPosition.colSpan / 3 && (g = 1), f < -C.width / t.defaultPosition.colSpan / 1.25 && (g = -1), l > C.height / t.defaultPosition.rowSpan / 3 && (y = 1), l < -C.height / t.defaultPosition.rowSpan / 1.25 && (y = -1), (g !== 0 || y !== 0) && t.update(t.index, 0, 0, y, g);
|
|
54
|
+
},
|
|
55
|
+
[R, t, L, d]
|
|
56
|
+
), M = n.useCallback(
|
|
57
|
+
(e) => {
|
|
58
|
+
var a;
|
|
59
|
+
const r = d();
|
|
60
|
+
if (!r)
|
|
34
61
|
return;
|
|
35
|
-
if (
|
|
36
|
-
x:
|
|
37
|
-
y:
|
|
38
|
-
},
|
|
39
|
-
|
|
62
|
+
if (w.current = {
|
|
63
|
+
x: e.event.clientX,
|
|
64
|
+
y: e.event.clientY
|
|
65
|
+
}, z.current = !1, (a = t.ignoreDrag) != null && a.call(t, e.event.originalEvent)) {
|
|
66
|
+
z.current = !0;
|
|
40
67
|
return;
|
|
41
68
|
}
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
x:
|
|
46
|
-
y:
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (
|
|
69
|
+
s.current && (s.current.style.zIndex = "10", I(!0)), r.classList.remove("k-cursor-move"), r.classList.add("k-cursor-grabbing");
|
|
70
|
+
const i = r.getBoundingClientRect();
|
|
71
|
+
$.current = {
|
|
72
|
+
x: e.event.clientX - i.x,
|
|
73
|
+
y: e.event.clientY - i.y
|
|
74
|
+
}, t.onPress();
|
|
75
|
+
},
|
|
76
|
+
[t, d]
|
|
77
|
+
), j = n.useCallback(
|
|
78
|
+
(e) => {
|
|
79
|
+
var h;
|
|
80
|
+
if (z.current)
|
|
54
81
|
return;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (this.currentTranslate = {
|
|
58
|
-
x: t.event.clientX - n.x - this.pressOffset.x + this.currentTranslate.x,
|
|
59
|
-
y: t.event.clientY - n.y - this.pressOffset.y + this.currentTranslate.y
|
|
60
|
-
}, e.style.transform = `translate(${this.currentTranslate.x}px, ${this.currentTranslate.y}px)`, e.style.transition = "transform 0s", this.preventDataOps)
|
|
82
|
+
const r = d();
|
|
83
|
+
if (e.event.originalEvent.defaultPrevented || !r)
|
|
61
84
|
return;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
}, this.handleRelease = () => {
|
|
70
|
-
this.dragging = this.resizing = !1, this.currentTranslate = { x: 0, y: 0 }, this.element && this.hintElement && (this.element.style.zIndex = "1", this.hintElement.classList.remove("k-layout-item-hint-resize"), this.setState({ visibleHint: !1 }));
|
|
71
|
-
const t = this.dragElement;
|
|
72
|
-
t && (t.style.transform = "translate(0px, 0px)", t.style.transition = `transform ${g}ms cubic-bezier(0.2, 0, 0, 1) 0s`, t.style.marginRight = "0px", t.style.marginLeft = "0px", t.style.height = "100%", t.classList.remove("k-cursor-grabbing"), this.reorderable && t.classList.add("k-cursor-move")), this.props.onRelease();
|
|
73
|
-
}, this.handleMouseDown = () => {
|
|
74
|
-
this.setInitialHintPosition();
|
|
75
|
-
}, this.handleMouseUp = () => {
|
|
76
|
-
setTimeout(() => {
|
|
77
|
-
this.setInitialHintPosition();
|
|
78
|
-
}, 100);
|
|
79
|
-
}, this.calcNewHintPosition = () => {
|
|
80
|
-
if (!this.dragElement || !this.hintElement)
|
|
85
|
+
E.current = !0, e.event.originalEvent.preventDefault();
|
|
86
|
+
const i = r.getBoundingClientRect();
|
|
87
|
+
if (u.current = {
|
|
88
|
+
x: e.event.clientX - i.x - $.current.x + u.current.x,
|
|
89
|
+
y: e.event.clientY - i.y - $.current.y + u.current.y
|
|
90
|
+
}, r.style.transform = `translate(${u.current.x}px, ${u.current.y}px)`, r.style.transition = "transform 0s", P.current)
|
|
81
91
|
return;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
get dragElement() {
|
|
90
|
-
return this.draggable ? this.draggable.element : void 0;
|
|
91
|
-
}
|
|
92
|
-
componentDidMount() {
|
|
93
|
-
this.element && (getComputedStyle(this.element).direction === "rtl" && this.setState({
|
|
94
|
-
rtl: !0
|
|
95
|
-
}), this.hintElement && (this.hintElement.style.height = this.element.offsetHeight + "px", this.hintElement.style.width = this.element.offsetWidth + "px"));
|
|
96
|
-
}
|
|
97
|
-
render() {
|
|
98
|
-
y && clearTimeout && typeof clearTimeout == "function" && (clearTimeout(this.preventDataOps), this.preventDataOps = window.setTimeout(() => {
|
|
99
|
-
this.preventDataOps = void 0;
|
|
100
|
-
}, 200));
|
|
101
|
-
const t = this.props.defaultPosition, e = this.props.resizable !== void 0 ? this.props.resizable : p.defaultProps.resizable, n = {
|
|
102
|
-
gridColumnStart: t.col,
|
|
103
|
-
gridColumnEnd: `span ${t.colSpan}`,
|
|
104
|
-
gridRowStart: t.row,
|
|
105
|
-
gridRowEnd: `span ${t.rowSpan}`,
|
|
106
|
-
outline: "none",
|
|
107
|
-
order: t.order,
|
|
108
|
-
display: "block",
|
|
109
|
-
...this.props.hintStyle
|
|
110
|
-
}, l = {
|
|
111
|
-
gridColumnStart: t.col,
|
|
112
|
-
gridColumnEnd: `span ${t.colSpan}`,
|
|
113
|
-
gridRowStart: t.row,
|
|
114
|
-
gridRowEnd: `span ${t.rowSpan}`,
|
|
115
|
-
order: t.order
|
|
116
|
-
}, r = /* @__PURE__ */ d.createElement(
|
|
117
|
-
"div",
|
|
118
|
-
{
|
|
119
|
-
ref: (s) => {
|
|
120
|
-
this.draggable = s ? { element: s } : null;
|
|
121
|
-
},
|
|
122
|
-
role: "listitem",
|
|
123
|
-
tabIndex: 0,
|
|
124
|
-
"aria-labelledby": typeof this.props.header == "string" ? this.props.header : `tile-${this.props.index}`,
|
|
125
|
-
"aria-keyshortcuts": "Enter",
|
|
126
|
-
className: m(
|
|
127
|
-
"k-tilelayout-item k-card",
|
|
128
|
-
{ "k-cursor-move": this.reorderable },
|
|
129
|
-
this.props.className
|
|
130
|
-
),
|
|
131
|
-
style: { height: "100%", ...l, ...this.props.style },
|
|
132
|
-
onMouseDown: this.handleMouseDown,
|
|
133
|
-
onMouseUp: this.handleMouseUp
|
|
134
|
-
},
|
|
135
|
-
this.props.children,
|
|
136
|
-
/* @__PURE__ */ d.createElement(
|
|
137
|
-
E,
|
|
138
|
-
{
|
|
139
|
-
onPress: this.handlePress,
|
|
140
|
-
onResize: this.handleResize,
|
|
141
|
-
resizable: e,
|
|
142
|
-
rtl: this.state.rtl
|
|
143
|
-
}
|
|
144
|
-
)
|
|
145
|
-
);
|
|
146
|
-
return /* @__PURE__ */ d.createElement(d.Fragment, null, this.state.visibleHint && /* @__PURE__ */ d.createElement(
|
|
147
|
-
"div",
|
|
148
|
-
{
|
|
149
|
-
ref: (s) => {
|
|
150
|
-
this.hintElement = s;
|
|
151
|
-
},
|
|
152
|
-
style: { position: "fixed", ...n },
|
|
153
|
-
className: m("k-layout-item-hint", this.props.hintClassName)
|
|
92
|
+
let a = 0, f = 0;
|
|
93
|
+
u.current.y > 0.7 * i.height / t.defaultPosition.rowSpan && (f = 1), u.current.y < 0.7 * -i.height / t.defaultPosition.rowSpan && (f = -1), u.current.x > 0.7 * i.width / t.defaultPosition.colSpan && (a = 1), u.current.x < 0.7 * -i.width / t.defaultPosition.colSpan && (a = -1), t.update(t.index, f, R ? -a : a, 0, 0);
|
|
94
|
+
const l = (h = s.current) == null ? void 0 : h.closest(".k-tilelayout");
|
|
95
|
+
if (l && c.current) {
|
|
96
|
+
const g = l.getBoundingClientRect(), y = G() || 50;
|
|
97
|
+
e.event.clientX < g.left - y || e.event.clientX > g.right - y || e.event.clientY < g.top || e.event.clientY > g.bottom ? c.current.style.display = "none" : c.current.style.display = "block";
|
|
154
98
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
onRelease: this.props.reorderable ? this.handleRelease : void 0,
|
|
163
|
-
onPress: this.props.reorderable ? this.handlePress : void 0
|
|
164
|
-
},
|
|
165
|
-
r
|
|
166
|
-
));
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* @hidden
|
|
170
|
-
*/
|
|
171
|
-
getSnapshotBeforeUpdate(t) {
|
|
172
|
-
return this.oldSize = {}, this.dragElement && (this.oldSize = this.dragElement.getBoundingClientRect()), null;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* @hidden
|
|
176
|
-
*/
|
|
177
|
-
setInitialHintPosition() {
|
|
178
|
-
if (this.element && this.hintElement) {
|
|
179
|
-
const t = this.element.getBoundingClientRect();
|
|
180
|
-
this.hintElement.style.top = t.top + "px", this.hintElement.style.left = t.left + "px", this.hintElement.style.height = this.element.offsetHeight + "px", this.hintElement.style.width = this.element.offsetWidth + "px";
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* @hidden
|
|
185
|
-
*/
|
|
186
|
-
componentDidUpdate(t) {
|
|
187
|
-
const e = this.dragElement;
|
|
99
|
+
},
|
|
100
|
+
[t, R, d]
|
|
101
|
+
);
|
|
102
|
+
n.useEffect(() => {
|
|
103
|
+
s.current && (getComputedStyle(s.current).direction === "rtl" && F(!0), c.current && (c.current.style.height = s.current.offsetHeight + "px", c.current.style.width = s.current.offsetWidth + "px"));
|
|
104
|
+
}, []), n.useLayoutEffect(() => {
|
|
105
|
+
const e = d();
|
|
188
106
|
if (!e)
|
|
189
107
|
return;
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
108
|
+
const r = e.getBoundingClientRect(), i = v.current;
|
|
109
|
+
if (!(i != null && i.width)) {
|
|
110
|
+
v.current = r, x.current = t;
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (D.current) {
|
|
114
|
+
const l = r.width - i.width;
|
|
115
|
+
if (R) {
|
|
116
|
+
const y = parseFloat(e.style.marginLeft || "0");
|
|
117
|
+
e.style.marginLeft = y - l + "px";
|
|
196
118
|
} else {
|
|
197
|
-
const
|
|
198
|
-
e.style.marginRight =
|
|
119
|
+
const y = parseFloat(e.style.marginRight || "0");
|
|
120
|
+
e.style.marginRight = y + l + "px";
|
|
199
121
|
}
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
e.style.height = `calc(100% + ${
|
|
122
|
+
w.current.x += R ? -l : l;
|
|
123
|
+
const h = r.height - i.height, g = parseFloat(e.style.height.substring(12));
|
|
124
|
+
e.style.height = `calc(100% + ${g + h}px)`, w.current.y += h;
|
|
203
125
|
}
|
|
204
|
-
const
|
|
205
|
-
if (
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
126
|
+
const a = i.left - r.left, f = i.top - r.top;
|
|
127
|
+
if (a === 0 && f === 0) {
|
|
128
|
+
v.current = r, x.current = t;
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (E.current) {
|
|
132
|
+
(x.current.defaultPosition.order !== t.defaultPosition.order || x.current.defaultPosition.col !== t.defaultPosition.col) && (u.current.x = 0, u.current.y = 0, e.style.transform = "", U()), v.current = r, x.current = t;
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (Math.abs(f) < 15 && Math.abs(a) < 15) {
|
|
136
|
+
v.current = r, x.current = t;
|
|
137
|
+
return;
|
|
216
138
|
}
|
|
217
|
-
|
|
139
|
+
requestAnimationFrame(() => {
|
|
140
|
+
const l = s.current;
|
|
141
|
+
l && (l.style.transform = `translate(${a}px, ${f}px)`, l.style.transition = "transform 0s", requestAnimationFrame(() => {
|
|
142
|
+
l.style.transform = "", l.style.transition = `transform ${O}ms cubic-bezier(0.2, 0, 0, 1) 0s`;
|
|
143
|
+
}));
|
|
144
|
+
}), v.current = r, x.current = t;
|
|
145
|
+
}), J && clearTimeout && typeof clearTimeout == "function" && (clearTimeout(P.current), P.current = window.setTimeout(() => {
|
|
146
|
+
P.current = void 0;
|
|
147
|
+
}, 200));
|
|
148
|
+
const m = t.defaultPosition, K = {
|
|
149
|
+
gridColumnStart: m.col,
|
|
150
|
+
gridColumnEnd: `span ${m.colSpan}`,
|
|
151
|
+
gridRowStart: m.row,
|
|
152
|
+
gridRowEnd: `span ${m.rowSpan}`,
|
|
153
|
+
outline: "none",
|
|
154
|
+
order: m.order,
|
|
155
|
+
display: "block",
|
|
156
|
+
...t.hintStyle
|
|
157
|
+
}, V = {
|
|
158
|
+
gridColumnStart: m.col,
|
|
159
|
+
gridColumnEnd: `span ${m.colSpan}`,
|
|
160
|
+
gridRowStart: m.row,
|
|
161
|
+
gridRowEnd: `span ${m.rowSpan}`,
|
|
162
|
+
order: m.order
|
|
163
|
+
}, _ = /* @__PURE__ */ n.createElement(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
role: "listitem",
|
|
167
|
+
tabIndex: 0,
|
|
168
|
+
"aria-labelledby": typeof t.header == "string" ? t.header : `tile-${t.index}`,
|
|
169
|
+
"aria-keyshortcuts": "Enter",
|
|
170
|
+
className: Y("k-tilelayout-item k-card", { "k-cursor-move": b }, t.className),
|
|
171
|
+
style: { height: "100%", ...V, ...t.style },
|
|
172
|
+
onMouseDown: A,
|
|
173
|
+
onMouseUp: p
|
|
174
|
+
},
|
|
175
|
+
t.children,
|
|
176
|
+
/* @__PURE__ */ n.createElement(Z, { onPress: M, onResize: W, resizable: H, rtl: R })
|
|
177
|
+
);
|
|
178
|
+
return /* @__PURE__ */ n.createElement(n.Fragment, null, q && /* @__PURE__ */ n.createElement(
|
|
179
|
+
"div",
|
|
180
|
+
{
|
|
181
|
+
ref: (e) => {
|
|
182
|
+
c.current = e;
|
|
183
|
+
},
|
|
184
|
+
style: { position: "fixed", ...K },
|
|
185
|
+
className: Y("k-layout-item-hint", t.hintClassName)
|
|
186
|
+
}
|
|
187
|
+
), /* @__PURE__ */ n.createElement(
|
|
188
|
+
Q,
|
|
189
|
+
{
|
|
190
|
+
ref: (e) => {
|
|
191
|
+
k.current = e, s.current = e ? e.element : null;
|
|
192
|
+
},
|
|
193
|
+
onDrag: b ? j : void 0,
|
|
194
|
+
onRelease: b ? L : void 0,
|
|
195
|
+
onPress: b ? M : void 0
|
|
196
|
+
},
|
|
197
|
+
_
|
|
198
|
+
));
|
|
218
199
|
};
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
200
|
+
N.propTypes = {
|
|
201
|
+
update: o.func.isRequired,
|
|
202
|
+
index: o.number.isRequired,
|
|
203
|
+
defaultPosition: o.object.isRequired,
|
|
204
|
+
ignoreDrag: o.func,
|
|
205
|
+
onPress: o.func.isRequired,
|
|
206
|
+
onRelease: o.func.isRequired,
|
|
207
|
+
children: o.node,
|
|
208
|
+
style: o.object,
|
|
209
|
+
className: o.string,
|
|
210
|
+
hintStyle: o.object,
|
|
211
|
+
hintClassName: o.string,
|
|
212
|
+
header: o.any,
|
|
213
|
+
body: o.any,
|
|
214
|
+
item: o.any,
|
|
215
|
+
resizable: o.oneOf(["horizontal", "vertical", !0, !1]),
|
|
216
|
+
reorderable: o.bool
|
|
233
217
|
};
|
|
234
|
-
|
|
218
|
+
N.displayName = "KendoTileLayoutItem";
|
|
219
|
+
N.defaultProps = T;
|
|
235
220
|
export {
|
|
236
|
-
|
|
221
|
+
N as InternalTile
|
|
237
222
|
};
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
+
import { TileResizeMode } from './interfaces/index.js';
|
|
8
9
|
import * as React from 'react';
|
|
9
10
|
/**
|
|
10
11
|
* @hidden
|
|
11
12
|
*/
|
|
12
13
|
export interface ResizeHandlersProps {
|
|
13
|
-
resizable:
|
|
14
|
+
resizable: TileResizeMode;
|
|
14
15
|
onResize: (e: any, args: {
|
|
15
16
|
end: boolean;
|
|
16
17
|
direction: any;
|
|
@@ -21,7 +22,4 @@ export interface ResizeHandlersProps {
|
|
|
21
22
|
/**
|
|
22
23
|
* @hidden
|
|
23
24
|
*/
|
|
24
|
-
export declare
|
|
25
|
-
handleResize: (event: any, isEnd: boolean, direction: any) => void;
|
|
26
|
-
render(): React.JSX.Element | null;
|
|
27
|
-
}
|
|
25
|
+
export declare const ResizeHandlers: React.FC<ResizeHandlersProps>;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),u=require("@progress/kendo-react-common");function g(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const l=g(d),i=e=>l.createElement(u.Draggable,{onPress:e.onPress,onDrag:t=>{e.onResize(t.event,!1,e.d)},onRelease:t=>{e.onResize(t.event,!0,e.d)}},l.createElement("div",{className:"k-resize-handle k-cursor-"+e.d+"-resize",style:{bottom:0,right:0,...e.style}})),f=({resizable:e,onResize:t,onPress:n,rtl:r})=>{const a=l.useCallback((c,o,s)=>{c.originalEvent.preventDefault(),t(c,{end:o,direction:s})},[t]);return e?l.createElement(l.Fragment,null,e!=="vertical"&&l.createElement(i,{onPress:n,onResize:a,d:"ew",style:r?{top:0,width:9,left:0,right:""}:{top:0,width:9,right:0,left:""}}),e!=="horizontal"&&l.createElement(i,{onPress:n,onResize:a,d:"ns",style:{left:0,height:9}}),e===!0&&l.createElement(i,{onResize:a,onPress:n,d:r?"nesw":"nwse",style:r?{width:9,height:9,right:"",left:0}:{width:9,height:9,right:0,left:""}})):null};exports.ResizeHandlers=f;
|
|
@@ -5,54 +5,51 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { Draggable as
|
|
10
|
-
const
|
|
11
|
-
|
|
8
|
+
import * as t from "react";
|
|
9
|
+
import { Draggable as o } from "@progress/kendo-react-common";
|
|
10
|
+
const r = (e) => /* @__PURE__ */ t.createElement(
|
|
11
|
+
o,
|
|
12
12
|
{
|
|
13
|
-
onPress:
|
|
14
|
-
onDrag: (
|
|
15
|
-
|
|
13
|
+
onPress: e.onPress,
|
|
14
|
+
onDrag: (n) => {
|
|
15
|
+
e.onResize(n.event, !1, e.d);
|
|
16
16
|
},
|
|
17
|
-
onRelease: (
|
|
18
|
-
|
|
17
|
+
onRelease: (n) => {
|
|
18
|
+
e.onResize(n.event, !0, e.d);
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ t.createElement(
|
|
22
22
|
"div",
|
|
23
23
|
{
|
|
24
|
-
className: "k-resize-handle k-cursor-" +
|
|
25
|
-
style: { bottom: 0, right: 0, ...
|
|
24
|
+
className: "k-resize-handle k-cursor-" + e.d + "-resize",
|
|
25
|
+
style: { bottom: 0, right: 0, ...e.style }
|
|
26
26
|
}
|
|
27
27
|
)
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
)) : null;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
28
|
+
), g = ({ resizable: e, onResize: n, onPress: l, rtl: i }) => {
|
|
29
|
+
const a = t.useCallback(
|
|
30
|
+
(h, s, d) => {
|
|
31
|
+
h.originalEvent.preventDefault(), n(h, { end: s, direction: d });
|
|
32
|
+
},
|
|
33
|
+
[n]
|
|
34
|
+
);
|
|
35
|
+
return e ? /* @__PURE__ */ t.createElement(t.Fragment, null, e !== "vertical" && /* @__PURE__ */ t.createElement(
|
|
36
|
+
r,
|
|
37
|
+
{
|
|
38
|
+
onPress: l,
|
|
39
|
+
onResize: a,
|
|
40
|
+
d: "ew",
|
|
41
|
+
style: i ? { top: 0, width: 9, left: 0, right: "" } : { top: 0, width: 9, right: 0, left: "" }
|
|
42
|
+
}
|
|
43
|
+
), e !== "horizontal" && /* @__PURE__ */ t.createElement(r, { onPress: l, onResize: a, d: "ns", style: { left: 0, height: 9 } }), e === !0 && /* @__PURE__ */ t.createElement(
|
|
44
|
+
r,
|
|
45
|
+
{
|
|
46
|
+
onResize: a,
|
|
47
|
+
onPress: l,
|
|
48
|
+
d: i ? "nesw" : "nwse",
|
|
49
|
+
style: i ? { width: 9, height: 9, right: "", left: 0 } : { width: 9, height: 9, right: 0, left: "" }
|
|
50
|
+
}
|
|
51
|
+
)) : null;
|
|
52
|
+
};
|
|
56
53
|
export {
|
|
57
|
-
|
|
54
|
+
g as ResizeHandlers
|
|
58
55
|
};
|