@progress/kendo-react-popup 7.2.4-develop.3 → 7.3.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Popup.js +8 -0
- package/Popup.mjs +25 -0
- package/PopupWithoutContext.js +8 -0
- package/PopupWithoutContext.mjs +324 -0
- package/animation.js +8 -0
- package/animation.mjs +35 -0
- package/dist/cdn/js/kendo-react-popup.js +8 -5
- package/index.d.mts +468 -5
- package/index.d.ts +468 -16
- package/index.js +8 -5
- package/index.mjs +12 -373
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +2 -2
- package/util.js +8 -0
- package/util.mjs +25 -0
- package/Popup.d.ts +0 -31
- package/PopupWithoutContext.d.ts +0 -188
- package/animation.d.ts +0 -8
- package/models/Align.d.ts +0 -28
- package/models/Collision.d.ts +0 -18
- package/models/CollisionType.d.ts +0 -14
- package/models/Events.d.ts +0 -40
- package/models/Margin.d.ts +0 -18
- package/models/Offset.d.ts +0 -18
- package/models/PopupAnimation.d.ts +0 -17
- package/models/PopupProps.d.ts +0 -119
- package/models/PositionMode.d.ts +0 -9
- package/package-metadata.d.ts +0 -9
- package/util.d.ts +0 -21
package/index.mjs
CHANGED
|
@@ -1,376 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
5
8
|
"use client";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import e from "prop-types";
|
|
9
|
-
import { validatePackage as b, canUseDOM as N, ZIndexContext as A, classNames as O } from "@progress/kendo-react-common";
|
|
10
|
-
import { alignElement as D, positionElement as x, domUtils as I, Collision as g, AlignPoint as l } from "@progress/kendo-popup-common";
|
|
11
|
-
const T = (i) => {
|
|
12
|
-
i.style.transitionDuration = "", Array.from(i.classList).forEach((o) => {
|
|
13
|
-
o.startsWith("k-slide-") && i.classList.remove(o);
|
|
14
|
-
});
|
|
15
|
-
}, R = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), L = (i, o, t, n, r) => {
|
|
16
|
-
if (t === 0)
|
|
17
|
-
return r();
|
|
18
|
-
const s = "k-slide-" + o + "-" + n, a = s + "-active", p = (d) => {
|
|
19
|
-
d.target === i && (i.removeEventListener("transitionend", p), T(i), n === "exit" ? i.style.display = "none" : i.style.display = "", r());
|
|
20
|
-
};
|
|
21
|
-
i.addEventListener("transitionend", p);
|
|
22
|
-
const u = i.ownerDocument;
|
|
23
|
-
if (!u)
|
|
24
|
-
return;
|
|
25
|
-
const f = u.defaultView;
|
|
26
|
-
if (!f)
|
|
27
|
-
return;
|
|
28
|
-
const h = () => {
|
|
29
|
-
T(i), i.classList.add(s), f.requestAnimationFrame(() => {
|
|
30
|
-
i.style.transitionDuration = t + "ms", i.classList.add(a);
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
R ? f.requestAnimationFrame(h) : h();
|
|
34
|
-
}, M = 1e3 / 60, U = function(i, o, t = {}) {
|
|
35
|
-
let n, r, s, a, p = 0;
|
|
36
|
-
t = t || {};
|
|
37
|
-
const u = function() {
|
|
38
|
-
p = t.leading === !1 ? 0 : (/* @__PURE__ */ new Date()).getTime(), n = void 0, a = i.apply(r, s), n || (r = s = null);
|
|
39
|
-
};
|
|
40
|
-
return function() {
|
|
41
|
-
const h = (/* @__PURE__ */ new Date()).getTime();
|
|
42
|
-
!p && t.leading === !1 && (p = h);
|
|
43
|
-
const d = o - (h - p);
|
|
44
|
-
return r = void 0, s = arguments, d <= 0 || d > o ? (n && (clearTimeout(n), n = void 0), p = h, a = i.apply(r, s), n || (r = s = null)) : !n && t.trailing !== !1 && (n = window.setTimeout(u, d)), a;
|
|
45
|
-
};
|
|
46
|
-
}, k = {
|
|
47
|
-
name: "@progress/kendo-react-popup",
|
|
48
|
-
productName: "KendoReact",
|
|
49
|
-
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
50
|
-
publishDate: 1709631722,
|
|
51
|
-
version: "",
|
|
52
|
-
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
53
|
-
}, z = 100, S = 1;
|
|
54
|
-
function w(i, o) {
|
|
55
|
-
if (i === o)
|
|
56
|
-
return !0;
|
|
57
|
-
if (!!i != !!o)
|
|
58
|
-
return !1;
|
|
59
|
-
const t = Object.getOwnPropertyNames(i), n = Object.getOwnPropertyNames(o);
|
|
60
|
-
if (t.length !== n.length)
|
|
61
|
-
return !1;
|
|
62
|
-
for (let r = 0; r < t.length; r++) {
|
|
63
|
-
let s = t[r];
|
|
64
|
-
if (i[s] !== o[s])
|
|
65
|
-
return !1;
|
|
66
|
-
}
|
|
67
|
-
return !0;
|
|
68
|
-
}
|
|
69
|
-
const F = {
|
|
70
|
-
left: -1e3,
|
|
71
|
-
top: 0
|
|
72
|
-
}, H = "k-animation-container", _ = "k-animation-container-shown", K = "k-child-animation-container", j = "k-popup";
|
|
73
|
-
class P extends m.Component {
|
|
74
|
-
constructor(o) {
|
|
75
|
-
super(o), this.context = 0, this.state = { current: "hidden", previous: "hidden", props: {} }, this._popup = null, this.show = (t) => {
|
|
76
|
-
this.setPosition(t), this.animate(t.firstChild, "enter", this.onOpened), this.setState({ current: "shown", previous: this.state.current });
|
|
77
|
-
}, this.setPosition = (t) => {
|
|
78
|
-
let { anchorAlign: n, popupAlign: r, collision: s, offset: a, anchor: p, margin: u, scale: f, positionMode: h } = this.props;
|
|
79
|
-
const { width: d, height: v } = t.style;
|
|
80
|
-
t.style.width = t.offsetWidth + "px", t.style.height = t.offsetHeight + "px";
|
|
81
|
-
const y = D({
|
|
82
|
-
anchor: p,
|
|
83
|
-
anchorAlign: n,
|
|
84
|
-
element: t,
|
|
85
|
-
elementAlign: r,
|
|
86
|
-
offset: a,
|
|
87
|
-
margin: u,
|
|
88
|
-
positionMode: h,
|
|
89
|
-
scale: f
|
|
90
|
-
}), c = x({
|
|
91
|
-
anchor: p,
|
|
92
|
-
anchorAlign: n,
|
|
93
|
-
element: t,
|
|
94
|
-
elementAlign: r,
|
|
95
|
-
collisions: s,
|
|
96
|
-
currentLocation: y,
|
|
97
|
-
margin: this.props.margin
|
|
98
|
-
});
|
|
99
|
-
if (t.style.top = c.offset.top + "px", t.style.left = c.offset.left + "px", t.style.width = d, t.style.height = v, this._collisions = {
|
|
100
|
-
fit: c.fit,
|
|
101
|
-
fitted: c.fitted,
|
|
102
|
-
flip: c.flip,
|
|
103
|
-
flipped: c.flipped
|
|
104
|
-
}, this.props.onPosition) {
|
|
105
|
-
const C = {
|
|
106
|
-
target: this,
|
|
107
|
-
flipped: c.flipped,
|
|
108
|
-
fitted: c.fitted
|
|
109
|
-
};
|
|
110
|
-
this.props.onPosition.call(void 0, C);
|
|
111
|
-
}
|
|
112
|
-
}, this.onOpened = () => {
|
|
113
|
-
const t = this._popup;
|
|
114
|
-
t && (this.props.show && t.classList.add(_), this.attachRepositionHandlers(t), this.props.onOpen && this.props.onOpen.call(void 0, { target: this }));
|
|
115
|
-
}, this.animate = (t, n, r) => {
|
|
116
|
-
if (!this.props.popupAlign)
|
|
117
|
-
return;
|
|
118
|
-
let s;
|
|
119
|
-
const { horizontal: a, vertical: p } = this.props.popupAlign;
|
|
120
|
-
a === "left" && p === "center" ? s = "right" : a === "right" && p === "center" ? s = "left" : p === "top" ? s = "down" : s = "up";
|
|
121
|
-
const u = {
|
|
122
|
-
down: "up",
|
|
123
|
-
up: "down",
|
|
124
|
-
left: "right",
|
|
125
|
-
right: "left"
|
|
126
|
-
};
|
|
127
|
-
this._collisions && this._collisions.flipped && (s = u[s]), L(
|
|
128
|
-
t,
|
|
129
|
-
s,
|
|
130
|
-
this.animationDuration[n],
|
|
131
|
-
n,
|
|
132
|
-
r
|
|
133
|
-
);
|
|
134
|
-
}, this.onClosing = (t) => {
|
|
135
|
-
this.props.show || t.classList.remove(_), this.detachRepositionHandlers();
|
|
136
|
-
}, this.onClosed = () => {
|
|
137
|
-
this.state.current === "hiding" && this.state.previous === "shown" && this.setState({ current: "hidden", previous: this.state.current }), this.props.onClose && this.props.onClose.call(void 0, { target: this });
|
|
138
|
-
}, this.getCurrentZIndex = () => this.context ? this.context + S : z, b(k), this.reposition = U(this.reposition.bind(this), M);
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Represents the Popup DOM element.
|
|
142
|
-
*/
|
|
143
|
-
get element() {
|
|
144
|
-
return this._popup;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* @hidden
|
|
148
|
-
*/
|
|
149
|
-
static getDerivedStateFromProps(o, t) {
|
|
150
|
-
const { show: n, anchor: r, anchorAlign: s, appendTo: a, collision: p, popupAlign: u, className: f, popupClass: h, style: d, offset: v, contentKey: y } = o, c = {
|
|
151
|
-
...t,
|
|
152
|
-
props: {
|
|
153
|
-
show: n,
|
|
154
|
-
anchor: r,
|
|
155
|
-
anchorAlign: s,
|
|
156
|
-
appendTo: a,
|
|
157
|
-
collision: p,
|
|
158
|
-
popupAlign: u,
|
|
159
|
-
className: f,
|
|
160
|
-
popupClass: h,
|
|
161
|
-
style: d,
|
|
162
|
-
offset: v,
|
|
163
|
-
contentKey: y
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
return o.show ? t.current === "hidden" || t.current === "hiding" ? { ...c, current: "showing", previous: t.current } : t.current === "showing" ? { ...c, current: "shown", previous: t.current } : t.current === "shown" && (!w(v, t.props.offset) || !w(s, t.props.anchorAlign) || !w(a, t.props.appendTo) || !w(p, t.props.collision) || !w(u, t.props.popupAlign) || !w(d, t.props.style) || r !== t.props.anchor || h !== t.props.popupClass || f !== t.props.className) ? { ...c, current: "reposition", previous: t.current } : c : t.current === "hiding" || t.current === "hidden" ? { ...c, current: "hidden", previous: t.current } : { ...c, current: "hiding", previous: t.current };
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
*
|
|
170
|
-
* @hidden
|
|
171
|
-
*/
|
|
172
|
-
componentDidUpdate(o) {
|
|
173
|
-
this.state.current === "showing" && this._popup ? this.show(this._popup) : this.state.current === "hiding" && this._popup ? (this.onClosing(this._popup), this.animate(this._popup.firstChild, "exit", this.onClosed)) : this.state.current === "reposition" && this.state.previous === "shown" ? setTimeout(() => {
|
|
174
|
-
this.setState({ current: "shown", previous: this.state.current });
|
|
175
|
-
}, 0) : this.state.current === "shown" && o.contentKey !== this.props.contentKey && this._popup && this.setPosition(this._popup);
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* @hidden
|
|
179
|
-
*/
|
|
180
|
-
componentDidMount() {
|
|
181
|
-
this.state.current === "showing" && this._popup && this.show(this._popup);
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* @hidden
|
|
185
|
-
*/
|
|
186
|
-
componentWillUnmount() {
|
|
187
|
-
this.detachRepositionHandlers();
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* @hidden
|
|
191
|
-
*/
|
|
192
|
-
render() {
|
|
193
|
-
const {
|
|
194
|
-
children: o,
|
|
195
|
-
className: t,
|
|
196
|
-
popupClass: n,
|
|
197
|
-
show: r,
|
|
198
|
-
id: s,
|
|
199
|
-
positionMode: a
|
|
200
|
-
} = this.props, p = this.props.appendTo ? this.props.appendTo : N ? this.props.anchor && this.props.anchor.ownerDocument ? this.props.anchor.ownerDocument.body : document.body : void 0;
|
|
201
|
-
this.state.current === "reposition" && this.state.previous === "shown" && this._popup && this.setPosition(this._popup);
|
|
202
|
-
const u = Object.assign(
|
|
203
|
-
{},
|
|
204
|
-
{ position: a, top: 0, left: -1e4 },
|
|
205
|
-
this.props.style || {}
|
|
206
|
-
), f = this.state.current === "hiding";
|
|
207
|
-
if ((r || f) && p) {
|
|
208
|
-
const h = this.getCurrentZIndex(), d = /* @__PURE__ */ m.createElement(A.Provider, { value: h }, /* @__PURE__ */ m.createElement(
|
|
209
|
-
"div",
|
|
210
|
-
{
|
|
211
|
-
className: O(H, t),
|
|
212
|
-
id: s,
|
|
213
|
-
ref: (v) => this._popup = v,
|
|
214
|
-
style: {
|
|
215
|
-
zIndex: h,
|
|
216
|
-
...u
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
/* @__PURE__ */ m.createElement("div", { className: O(K), style: { transitionDelay: "0ms" } }, /* @__PURE__ */ m.createElement(
|
|
220
|
-
"div",
|
|
221
|
-
{
|
|
222
|
-
role: this.props.role,
|
|
223
|
-
className: O(j, n)
|
|
224
|
-
},
|
|
225
|
-
o
|
|
226
|
-
))
|
|
227
|
-
));
|
|
228
|
-
return this.props.appendTo !== null ? E.createPortal(d, p) : d;
|
|
229
|
-
}
|
|
230
|
-
return null;
|
|
231
|
-
}
|
|
232
|
-
get animationDuration() {
|
|
233
|
-
const o = this.props.animate;
|
|
234
|
-
let t = 0, n = 0;
|
|
235
|
-
return o && (o === !0 ? t = n = 300 : (t = o.openDuration || 0, n = o.closeDuration || 0)), { enter: t, exit: n };
|
|
236
|
-
}
|
|
237
|
-
attachRepositionHandlers(o) {
|
|
238
|
-
this.detachRepositionHandlers(), this._scrollableParents = I.scrollableParents(this.props.anchor || o), this._scrollableParents && this._scrollableParents.map((t) => t.addEventListener("scroll", this.reposition)), window.addEventListener("resize", this.reposition);
|
|
239
|
-
}
|
|
240
|
-
detachRepositionHandlers() {
|
|
241
|
-
this._scrollableParents && (this._scrollableParents.map((o) => o.removeEventListener("scroll", this.reposition)), this._scrollableParents = void 0), window.removeEventListener("resize", this.reposition);
|
|
242
|
-
}
|
|
243
|
-
reposition() {
|
|
244
|
-
this.setState({ current: "reposition", previous: this.state.current });
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
P.propTypes = {
|
|
248
|
-
anchor: function(i) {
|
|
249
|
-
const o = i.anchor;
|
|
250
|
-
return o && typeof o.nodeType != "number" ? new Error(
|
|
251
|
-
"Invalid prop `anchor` supplied to `Kendo React Popup`. Validation failed."
|
|
252
|
-
) : null;
|
|
253
|
-
},
|
|
254
|
-
appendTo: function(i) {
|
|
255
|
-
const o = i.appendTo;
|
|
256
|
-
return o && typeof o.nodeType != "number" ? new Error(
|
|
257
|
-
"Invalid prop `appendTo` supplied to `Kendo React Popup`. Validation failed."
|
|
258
|
-
) : null;
|
|
259
|
-
},
|
|
260
|
-
className: e.oneOfType([
|
|
261
|
-
e.string,
|
|
262
|
-
e.arrayOf(e.string),
|
|
263
|
-
e.object
|
|
264
|
-
]),
|
|
265
|
-
id: e.string,
|
|
266
|
-
popupClass: e.oneOfType([
|
|
267
|
-
e.string,
|
|
268
|
-
e.arrayOf(e.string),
|
|
269
|
-
e.object
|
|
270
|
-
]),
|
|
271
|
-
collision: e.shape({
|
|
272
|
-
horizontal: e.oneOf([
|
|
273
|
-
g.fit,
|
|
274
|
-
g.flip,
|
|
275
|
-
g.none
|
|
276
|
-
]),
|
|
277
|
-
vertical: e.oneOf([
|
|
278
|
-
g.fit,
|
|
279
|
-
g.flip,
|
|
280
|
-
g.none
|
|
281
|
-
])
|
|
282
|
-
}),
|
|
283
|
-
anchorAlign: e.shape({
|
|
284
|
-
horizontal: e.oneOf([
|
|
285
|
-
l.left,
|
|
286
|
-
l.center,
|
|
287
|
-
l.right
|
|
288
|
-
]),
|
|
289
|
-
vertical: e.oneOf([
|
|
290
|
-
l.top,
|
|
291
|
-
l.center,
|
|
292
|
-
l.bottom
|
|
293
|
-
])
|
|
294
|
-
}),
|
|
295
|
-
popupAlign: e.shape({
|
|
296
|
-
horizontal: e.oneOf([
|
|
297
|
-
l.left,
|
|
298
|
-
l.center,
|
|
299
|
-
l.right
|
|
300
|
-
]),
|
|
301
|
-
vertical: e.oneOf([
|
|
302
|
-
l.top,
|
|
303
|
-
l.center,
|
|
304
|
-
l.bottom
|
|
305
|
-
])
|
|
306
|
-
}),
|
|
307
|
-
offset: e.shape({
|
|
308
|
-
left: e.number,
|
|
309
|
-
top: e.number
|
|
310
|
-
}),
|
|
311
|
-
children: e.oneOfType([
|
|
312
|
-
e.element,
|
|
313
|
-
e.node
|
|
314
|
-
]),
|
|
315
|
-
show: e.bool,
|
|
316
|
-
animate: e.oneOfType([
|
|
317
|
-
e.bool,
|
|
318
|
-
e.shape({
|
|
319
|
-
openDuration: e.number,
|
|
320
|
-
closeDuration: e.number
|
|
321
|
-
})
|
|
322
|
-
]),
|
|
323
|
-
margin: e.shape({
|
|
324
|
-
horizontal: e.number,
|
|
325
|
-
vertical: e.number
|
|
326
|
-
}),
|
|
327
|
-
positionMode: e.oneOf([
|
|
328
|
-
"fixed",
|
|
329
|
-
"absolute"
|
|
330
|
-
]),
|
|
331
|
-
scale: e.number,
|
|
332
|
-
style: e.object,
|
|
333
|
-
onClose: e.func,
|
|
334
|
-
onPosition: e.func,
|
|
335
|
-
onOpen: e.func
|
|
336
|
-
};
|
|
337
|
-
P.defaultProps = {
|
|
338
|
-
collision: {
|
|
339
|
-
horizontal: g.fit,
|
|
340
|
-
vertical: g.flip
|
|
341
|
-
},
|
|
342
|
-
anchorAlign: {
|
|
343
|
-
horizontal: l.left,
|
|
344
|
-
vertical: l.bottom
|
|
345
|
-
},
|
|
346
|
-
popupAlign: {
|
|
347
|
-
horizontal: l.left,
|
|
348
|
-
vertical: l.top
|
|
349
|
-
},
|
|
350
|
-
offset: F,
|
|
351
|
-
animate: !0,
|
|
352
|
-
show: !1,
|
|
353
|
-
margin: {
|
|
354
|
-
horizontal: 0,
|
|
355
|
-
vertical: 0
|
|
356
|
-
},
|
|
357
|
-
positionMode: "absolute"
|
|
358
|
-
};
|
|
359
|
-
P.contextType = A;
|
|
360
|
-
P.displayName = "PopupComponent";
|
|
361
|
-
const Z = m.createContext((i) => i), W = m.forwardRef((i, o) => {
|
|
362
|
-
const n = m.useContext(Z).call(void 0, i);
|
|
363
|
-
return /* @__PURE__ */ m.createElement(
|
|
364
|
-
P,
|
|
365
|
-
{
|
|
366
|
-
ref: o,
|
|
367
|
-
...n
|
|
368
|
-
}
|
|
369
|
-
);
|
|
370
|
-
});
|
|
371
|
-
W.displayName = "Popup";
|
|
9
|
+
import { Popup as t, PopupPropsContext as e } from "./Popup.mjs";
|
|
10
|
+
import { PopupWithoutContext as u } from "./PopupWithoutContext.mjs";
|
|
372
11
|
export {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
12
|
+
t as Popup,
|
|
13
|
+
e as PopupPropsContext,
|
|
14
|
+
u as PopupWithoutContext
|
|
376
15
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-popup",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
const e = {
|
|
10
|
+
name: "@progress/kendo-react-popup",
|
|
11
|
+
productName: "KendoReact",
|
|
12
|
+
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
+
publishDate: 1709715151,
|
|
14
|
+
version: "",
|
|
15
|
+
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
e as packageMetadata
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-popup",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0-develop.1",
|
|
4
4
|
"description": "React Popup positions a piece of content next to a specific anchor component. KendoReact Popup package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-licensing": "^1.3.4",
|
|
26
26
|
"@progress/kendo-popup-common": "^1.9.0",
|
|
27
|
-
"@progress/kendo-react-common": "7.
|
|
27
|
+
"@progress/kendo-react-common": "7.3.0-develop.1",
|
|
28
28
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
29
29
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
|
30
30
|
},
|
package/util.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=1e3/60,d=function(u,s,t={}){let e,l,n,r,i=0;t=t||{};const c=function(){i=t.leading===!1?0:new Date().getTime(),e=void 0,r=u.apply(l,n),e||(l=n=null)};return function(){const o=new Date().getTime();!i&&t.leading===!1&&(i=o);const a=s-(o-i);return l=void 0,n=arguments,a<=0||a>s?(e&&(clearTimeout(e),e=void 0),i=o,r=u.apply(l,n),e||(l=n=null)):!e&&t.trailing!==!1&&(e=window.setTimeout(c,a)),r}};exports.FRAME_DURATION=f;exports.throttle=d;
|
package/util.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
const d = 16.666666666666668, g = function(u, s, t = {}) {
|
|
10
|
+
let e, n, l, r, i = 0;
|
|
11
|
+
t = t || {};
|
|
12
|
+
const c = function() {
|
|
13
|
+
i = t.leading === !1 ? 0 : (/* @__PURE__ */ new Date()).getTime(), e = void 0, r = u.apply(n, l), e || (n = l = null);
|
|
14
|
+
};
|
|
15
|
+
return function() {
|
|
16
|
+
const o = (/* @__PURE__ */ new Date()).getTime();
|
|
17
|
+
!i && t.leading === !1 && (i = o);
|
|
18
|
+
const a = s - (o - i);
|
|
19
|
+
return n = void 0, l = arguments, a <= 0 || a > s ? (e && (clearTimeout(e), e = void 0), i = o, r = u.apply(n, l), e || (n = l = null)) : !e && t.trailing !== !1 && (e = window.setTimeout(c, a)), r;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
d as FRAME_DURATION,
|
|
24
|
+
g as throttle
|
|
25
|
+
};
|
package/Popup.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import { PopupWithoutContext } from './PopupWithoutContext';
|
|
7
|
-
import { PopupProps } from './models/PopupProps';
|
|
8
|
-
/**
|
|
9
|
-
* The PopupPropsContext. It allows to configure the Popup props from a wrapper component.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```jsx-no-run
|
|
13
|
-
* <PopupPropsContext.Provider value={props => ({ ...props, appendTo: document.querySelector('myPopupsContainer') })}>
|
|
14
|
-
* <DropDownList />
|
|
15
|
-
* <Editor />
|
|
16
|
-
* </PopupPropsContext.Provider>
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export declare const PopupPropsContext: React.Context<(props: PopupProps) => PopupProps>;
|
|
20
|
-
export interface PopupHandle extends Pick<PopupWithoutContext, keyof PopupWithoutContext> {
|
|
21
|
-
/**
|
|
22
|
-
* @hidden
|
|
23
|
-
*/
|
|
24
|
-
element: any;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* The KendoReact Popup component.
|
|
28
|
-
*/
|
|
29
|
-
export declare const Popup: React.ForwardRefExoticComponent<PopupProps & React.RefAttributes<unknown>>;
|
|
30
|
-
/** @hidden */
|
|
31
|
-
export type Popup = PopupHandle;
|
package/PopupWithoutContext.d.ts
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
|
-
import { ZIndexContext } from '@progress/kendo-react-common';
|
|
8
|
-
import { Offset } from './models/Offset';
|
|
9
|
-
import { PopupProps } from './models/PopupProps';
|
|
10
|
-
import { Align } from './models/Align';
|
|
11
|
-
import { Collision } from './models/Collision';
|
|
12
|
-
declare enum Status {
|
|
13
|
-
hiding = "hiding",
|
|
14
|
-
hidden = "hidden",
|
|
15
|
-
showing = "showing",
|
|
16
|
-
shown = "shown",
|
|
17
|
-
reposition = "reposition"
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* @hidden
|
|
21
|
-
*/
|
|
22
|
-
export interface PopupState {
|
|
23
|
-
current: Status;
|
|
24
|
-
previous: Status;
|
|
25
|
-
props: {
|
|
26
|
-
show?: boolean;
|
|
27
|
-
anchor?: HTMLElement;
|
|
28
|
-
anchorAlign?: Align;
|
|
29
|
-
appendTo?: HTMLElement;
|
|
30
|
-
collision?: Collision;
|
|
31
|
-
popupAlign?: Align;
|
|
32
|
-
className?: string | Array<string>;
|
|
33
|
-
popupClass?: string | Array<string>;
|
|
34
|
-
style?: React.CSSProperties;
|
|
35
|
-
offset?: Offset;
|
|
36
|
-
contentKey?: any;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* @hidden
|
|
41
|
-
*/
|
|
42
|
-
export declare class PopupWithoutContext extends React.Component<PopupProps, PopupState> {
|
|
43
|
-
/**
|
|
44
|
-
* @hidden
|
|
45
|
-
*/
|
|
46
|
-
static propTypes: {
|
|
47
|
-
anchor: (props: PopupProps) => Error | null;
|
|
48
|
-
appendTo: (props: PopupProps) => Error | null;
|
|
49
|
-
className: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
50
|
-
id: PropTypes.Requireable<string>;
|
|
51
|
-
popupClass: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
52
|
-
collision: PropTypes.Requireable<PropTypes.InferProps<{
|
|
53
|
-
horizontal: PropTypes.Requireable<string>;
|
|
54
|
-
vertical: PropTypes.Requireable<string>;
|
|
55
|
-
}>>;
|
|
56
|
-
anchorAlign: PropTypes.Requireable<PropTypes.InferProps<{
|
|
57
|
-
horizontal: PropTypes.Requireable<string>;
|
|
58
|
-
vertical: PropTypes.Requireable<string>;
|
|
59
|
-
}>>;
|
|
60
|
-
popupAlign: PropTypes.Requireable<PropTypes.InferProps<{
|
|
61
|
-
horizontal: PropTypes.Requireable<string>;
|
|
62
|
-
vertical: PropTypes.Requireable<string>;
|
|
63
|
-
}>>;
|
|
64
|
-
offset: PropTypes.Requireable<PropTypes.InferProps<{
|
|
65
|
-
left: PropTypes.Requireable<number>;
|
|
66
|
-
top: PropTypes.Requireable<number>;
|
|
67
|
-
}>>;
|
|
68
|
-
children: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
69
|
-
show: PropTypes.Requireable<boolean>;
|
|
70
|
-
animate: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
71
|
-
openDuration: PropTypes.Requireable<number>;
|
|
72
|
-
closeDuration: PropTypes.Requireable<number>;
|
|
73
|
-
}> | null | undefined>>;
|
|
74
|
-
margin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
75
|
-
horizontal: PropTypes.Requireable<number>;
|
|
76
|
-
vertical: PropTypes.Requireable<number>;
|
|
77
|
-
}>>;
|
|
78
|
-
positionMode: PropTypes.Requireable<string>;
|
|
79
|
-
scale: PropTypes.Requireable<number>;
|
|
80
|
-
style: PropTypes.Requireable<object>;
|
|
81
|
-
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
82
|
-
onPosition: PropTypes.Requireable<(...args: any[]) => any>;
|
|
83
|
-
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* @hidden
|
|
87
|
-
*/
|
|
88
|
-
static defaultProps: {
|
|
89
|
-
collision: {
|
|
90
|
-
horizontal: string;
|
|
91
|
-
vertical: string;
|
|
92
|
-
};
|
|
93
|
-
anchorAlign: {
|
|
94
|
-
horizontal: string;
|
|
95
|
-
vertical: string;
|
|
96
|
-
};
|
|
97
|
-
popupAlign: {
|
|
98
|
-
horizontal: string;
|
|
99
|
-
vertical: string;
|
|
100
|
-
};
|
|
101
|
-
offset: {
|
|
102
|
-
left: number;
|
|
103
|
-
top: number;
|
|
104
|
-
};
|
|
105
|
-
animate: boolean;
|
|
106
|
-
show: boolean;
|
|
107
|
-
margin: {
|
|
108
|
-
horizontal: number;
|
|
109
|
-
vertical: number;
|
|
110
|
-
};
|
|
111
|
-
positionMode: string;
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* @hidden
|
|
115
|
-
*/
|
|
116
|
-
static contextType: React.Context<import("@progress/kendo-react-common").ZIndexContextType>;
|
|
117
|
-
/**
|
|
118
|
-
* @hidden
|
|
119
|
-
*/
|
|
120
|
-
context: React.ContextType<typeof ZIndexContext>;
|
|
121
|
-
/**
|
|
122
|
-
* @hidden
|
|
123
|
-
*/
|
|
124
|
-
static displayName: string;
|
|
125
|
-
/**
|
|
126
|
-
* @hidden
|
|
127
|
-
*/
|
|
128
|
-
readonly state: PopupState;
|
|
129
|
-
private _collisions;
|
|
130
|
-
private _scrollableParents;
|
|
131
|
-
private _popup;
|
|
132
|
-
/**
|
|
133
|
-
* Represents the Popup DOM element.
|
|
134
|
-
*/
|
|
135
|
-
get element(): HTMLDivElement | null;
|
|
136
|
-
constructor(props: PopupProps);
|
|
137
|
-
/**
|
|
138
|
-
* @hidden
|
|
139
|
-
*/
|
|
140
|
-
static getDerivedStateFromProps(props: PopupProps, state: PopupState): {
|
|
141
|
-
props: {
|
|
142
|
-
show: boolean | undefined;
|
|
143
|
-
anchor: HTMLElement | null | undefined;
|
|
144
|
-
anchorAlign: Align | undefined;
|
|
145
|
-
appendTo: HTMLElement | null | undefined;
|
|
146
|
-
collision: Collision | undefined;
|
|
147
|
-
popupAlign: Align | undefined;
|
|
148
|
-
className: string | string[] | undefined;
|
|
149
|
-
popupClass: string | string[] | {
|
|
150
|
-
[key: string]: boolean;
|
|
151
|
-
} | undefined;
|
|
152
|
-
style: React.CSSProperties | undefined;
|
|
153
|
-
offset: Offset | undefined;
|
|
154
|
-
contentKey: any;
|
|
155
|
-
};
|
|
156
|
-
current: Status;
|
|
157
|
-
previous: Status;
|
|
158
|
-
};
|
|
159
|
-
/**
|
|
160
|
-
*
|
|
161
|
-
* @hidden
|
|
162
|
-
*/
|
|
163
|
-
componentDidUpdate(prevProps: PopupProps): void;
|
|
164
|
-
/**
|
|
165
|
-
* @hidden
|
|
166
|
-
*/
|
|
167
|
-
componentDidMount(): void;
|
|
168
|
-
/**
|
|
169
|
-
* @hidden
|
|
170
|
-
*/
|
|
171
|
-
componentWillUnmount(): void;
|
|
172
|
-
/**
|
|
173
|
-
* @hidden
|
|
174
|
-
*/
|
|
175
|
-
render(): import("react/jsx-runtime").JSX.Element | null;
|
|
176
|
-
private show;
|
|
177
|
-
private setPosition;
|
|
178
|
-
private onOpened;
|
|
179
|
-
private animate;
|
|
180
|
-
private onClosing;
|
|
181
|
-
private onClosed;
|
|
182
|
-
private get animationDuration();
|
|
183
|
-
private attachRepositionHandlers;
|
|
184
|
-
private detachRepositionHandlers;
|
|
185
|
-
private reposition;
|
|
186
|
-
private getCurrentZIndex;
|
|
187
|
-
}
|
|
188
|
-
export {};
|