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