@progress/kendo-react-animation 6.1.1 → 7.0.0-develop.2

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 (64) hide show
  1. package/{dist/es/Animation.d.ts → Animation.d.ts} +5 -1
  2. package/{dist/npm/AnimationChild.d.ts → AnimationChild.d.ts} +5 -1
  3. package/{dist/es/AnimationInterface.d.ts → AnimationInterface.d.ts} +4 -1
  4. package/{dist/npm/Expand.d.ts → Expand.d.ts} +6 -2
  5. package/{dist/es/Fade.d.ts → Fade.d.ts} +5 -1
  6. package/LICENSE.md +1 -1
  7. package/{dist/npm/Push.d.ts → Push.d.ts} +6 -2
  8. package/{dist/npm/Reveal.d.ts → Reveal.d.ts} +6 -2
  9. package/{dist/es/Slide.d.ts → Slide.d.ts} +6 -2
  10. package/{dist/npm/Zoom.d.ts → Zoom.d.ts} +6 -2
  11. package/dist/cdn/js/kendo-react-animation.js +5 -1
  12. package/hooks/useAnimation.d.ts +16 -0
  13. package/index.d.ts +14 -0
  14. package/index.js +5 -0
  15. package/index.mjs +669 -0
  16. package/package-metadata.d.ts +9 -0
  17. package/package.json +28 -27
  18. package/util.d.ts +15 -0
  19. package/about.md +0 -3
  20. package/dist/es/Animation.js +0 -98
  21. package/dist/es/AnimationChild.d.ts +0 -89
  22. package/dist/es/AnimationChild.js +0 -175
  23. package/dist/es/AnimationInterface.js +0 -2
  24. package/dist/es/Expand.d.ts +0 -81
  25. package/dist/es/Expand.js +0 -88
  26. package/dist/es/Fade.js +0 -83
  27. package/dist/es/Push.d.ts +0 -89
  28. package/dist/es/Push.js +0 -92
  29. package/dist/es/Reveal.d.ts +0 -101
  30. package/dist/es/Reveal.js +0 -152
  31. package/dist/es/Slide.js +0 -90
  32. package/dist/es/Zoom.d.ts +0 -87
  33. package/dist/es/Zoom.js +0 -90
  34. package/dist/es/hooks/useAnimation.d.ts +0 -12
  35. package/dist/es/hooks/useAnimation.js +0 -48
  36. package/dist/es/main.d.ts +0 -10
  37. package/dist/es/main.js +0 -10
  38. package/dist/es/package-metadata.d.ts +0 -5
  39. package/dist/es/package-metadata.js +0 -11
  40. package/dist/es/util.d.ts +0 -11
  41. package/dist/es/util.js +0 -138
  42. package/dist/npm/Animation.d.ts +0 -82
  43. package/dist/npm/Animation.js +0 -101
  44. package/dist/npm/AnimationChild.js +0 -178
  45. package/dist/npm/AnimationInterface.d.ts +0 -89
  46. package/dist/npm/AnimationInterface.js +0 -3
  47. package/dist/npm/Expand.js +0 -91
  48. package/dist/npm/Fade.d.ts +0 -67
  49. package/dist/npm/Fade.js +0 -86
  50. package/dist/npm/Push.js +0 -95
  51. package/dist/npm/Reveal.js +0 -155
  52. package/dist/npm/Slide.d.ts +0 -83
  53. package/dist/npm/Slide.js +0 -93
  54. package/dist/npm/Zoom.js +0 -93
  55. package/dist/npm/hooks/useAnimation.d.ts +0 -12
  56. package/dist/npm/hooks/useAnimation.js +0 -52
  57. package/dist/npm/main.d.ts +0 -10
  58. package/dist/npm/main.js +0 -21
  59. package/dist/npm/package-metadata.d.ts +0 -5
  60. package/dist/npm/package-metadata.js +0 -14
  61. package/dist/npm/util.d.ts +0 -11
  62. package/dist/npm/util.js +0 -140
  63. package/dist/systemjs/kendo-react-animation.js +0 -1
  64. package/e2e-next/basic.tests.ts +0 -25
package/index.mjs ADDED
@@ -0,0 +1,669 @@
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 a from "react";
6
+ import * as e from "prop-types";
7
+ import { classNames as C, noop as v, validatePackage as V } from "@progress/kendo-react-common";
8
+ import { CSSTransition as _, TransitionGroup as B } from "react-transition-group";
9
+ const G = (o) => {
10
+ if (!o || !o.ownerDocument.defaultView)
11
+ return 0;
12
+ const t = o.ownerDocument.defaultView.getComputedStyle(o), n = parseFloat(t.marginTop), s = parseFloat(t.marginBottom);
13
+ return o.offsetHeight + n + s;
14
+ }, K = (o) => {
15
+ if (!o || !o.ownerDocument.defaultView)
16
+ return 0;
17
+ const t = o.ownerDocument.defaultView.getComputedStyle(o), n = parseFloat(t.marginLeft), s = parseFloat(t.marginRight);
18
+ return o.offsetWidth + n + s;
19
+ }, X = {
20
+ "animation-container": "k-animation-container",
21
+ "animation-container-relative": "k-animation-container-relative",
22
+ "animation-container-fixed": "k-animation-container-fixed",
23
+ "push-right-enter": "k-push-right-enter",
24
+ "push-right-appear": "k-push-right-appear",
25
+ "push-right-enter-active": "k-push-right-enter-active",
26
+ "push-right-appear-active": "k-push-right-appear-active",
27
+ "push-right-exit": "k-push-right-exit",
28
+ "push-right-exit-active": "k-push-right-exit-active",
29
+ "push-left-enter": "k-push-left-enter",
30
+ "push-left-appear": "k-push-left-appear",
31
+ "push-left-enter-active": "k-push-left-enter-active",
32
+ "push-left-appear-active": "k-push-left-appear-active",
33
+ "push-left-exit": "k-push-left-exit",
34
+ "push-left-exit-active": "k-push-left-exit-active",
35
+ "push-down-enter": "k-push-down-enter",
36
+ "push-down-appear": "k-push-down-appear",
37
+ "push-down-enter-active": "k-push-down-enter-active",
38
+ "push-down-appear-active": "k-push-down-appear-active",
39
+ "push-down-exit": "k-push-down-exit",
40
+ "push-down-exit-active": "k-push-down-exit-active",
41
+ "push-up-enter": "k-push-up-enter",
42
+ "push-up-appear": "k-push-up-appear",
43
+ "push-up-enter-active": "k-push-up-enter-active",
44
+ "push-up-appear-active": "k-push-up-appear-active",
45
+ "push-up-exit": "k-push-up-exit",
46
+ "push-up-exit-active": "k-push-up-exit-active",
47
+ expand: "k-expand",
48
+ "expand-vertical-enter": "k-expand-vertical-enter",
49
+ "expand-vertical-appear": "k-expand-vertical-appear",
50
+ "expand-vertical-enter-active": "k-expand-vertical-enter-active",
51
+ "expand-vertical-appear-active": "k-expand-vertical-appear-active",
52
+ "expand-vertical-exit": "k-expand-vertical-exit",
53
+ "expand-vertical-exit-active": "k-expand-vertical-exit-active",
54
+ "expand-horizontal-enter": "k-expand-horizontal-enter",
55
+ "expand-horizontal-appear": "k-expand-horizontal-appear",
56
+ "expand-horizontal-enter-active": "k-expand-horizontal-enter-active",
57
+ "expand-horizontal-appear-active": "k-expand-horizontal-appear-active",
58
+ "expand-horizontal-exit": "k-expand-horizontal-exit",
59
+ "expand-horizontal-exit-active": "k-expand-horizontal-exit-active",
60
+ "child-animation-container": "k-child-animation-container",
61
+ "fade-enter": "k-fade-enter",
62
+ "fade-appear": "k-fade-appear",
63
+ "fade-enter-active": "k-fade-enter-active",
64
+ "fade-appear-active": "k-fade-appear-active",
65
+ "fade-exit": "k-fade-exit",
66
+ "fade-exit-active": "k-fade-exit-active",
67
+ "zoom-in-enter": "k-zoom-in-enter",
68
+ "zoom-in-appear": "k-zoom-in-appear",
69
+ "zoom-in-enter-active": "k-zoom-in-enter-active",
70
+ "zoom-in-appear-active": "k-zoom-in-appear-active",
71
+ "zoom-in-exit": "k-zoom-in-exit",
72
+ "zoom-in-exit-active": "k-zoom-in-exit-active",
73
+ "zoom-out-enter": "k-zoom-out-enter",
74
+ "zoom-out-appear": "k-zoom-out-appear",
75
+ "zoom-out-enter-active": "k-zoom-out-enter-active",
76
+ "zoom-out-appear-active": "k-zoom-out-appear-active",
77
+ "zoom-out-exit": "k-zoom-out-exit",
78
+ "zoom-out-exit-active": "k-zoom-out-exit-active",
79
+ "slide-in-appear": "k-slide-in-appear",
80
+ centered: "k-centered",
81
+ "slide-in-appear-active": "k-slide-in-appear-active",
82
+ "slide-down-enter": "k-slide-down-enter",
83
+ "slide-down-appear": "k-slide-down-appear",
84
+ "slide-down-enter-active": "k-slide-down-enter-active",
85
+ "slide-down-appear-active": "k-slide-down-appear-active",
86
+ "slide-down-exit": "k-slide-down-exit",
87
+ "slide-down-exit-active": "k-slide-down-exit-active",
88
+ "slide-up-enter": "k-slide-up-enter",
89
+ "slide-up-appear": "k-slide-up-appear",
90
+ "slide-up-enter-active": "k-slide-up-enter-active",
91
+ "slide-up-appear-active": "k-slide-up-appear-active",
92
+ "slide-up-exit": "k-slide-up-exit",
93
+ "slide-up-exit-active": "k-slide-up-exit-active",
94
+ "slide-right-enter": "k-slide-right-enter",
95
+ "slide-right-appear": "k-slide-right-appear",
96
+ "slide-right-enter-active": "k-slide-right-enter-active",
97
+ "slide-right-appear-active": "k-slide-right-appear-active",
98
+ "slide-right-exit": "k-slide-right-exit",
99
+ "slide-right-exit-active": "k-slide-right-exit-active",
100
+ "slide-left-enter": "k-slide-left-enter",
101
+ "slide-left-appear": "k-slide-left-appear",
102
+ "slide-left-enter-active": "k-slide-left-enter-active",
103
+ "slide-left-appear-active": "k-slide-left-appear-active",
104
+ "slide-left-exit": "k-slide-left-exit",
105
+ "slide-left-exit-active": "k-slide-left-exit-active",
106
+ "reveal-vertical-enter": "k-reveal-vertical-enter",
107
+ "reveal-vertical-appear": "k-reveal-vertical-appear",
108
+ "reveal-vertical-enter-active": "k-reveal-vertical-enter-active",
109
+ "reveal-vertical-appear-active": "k-reveal-vertical-appear-active",
110
+ "reveal-vertical-exit": "k-reveal-vertical-exit",
111
+ "reveal-vertical-exit-active": "k-reveal-vertical-exit-active",
112
+ "reveal-horizontal-enter": "k-reveal-horizontal-enter",
113
+ "reveal-horizontal-appear": "k-reveal-horizontal-appear",
114
+ "reveal-horizontal-enter-active": "k-reveal-horizontal-enter-active",
115
+ "reveal-horizontal-appear-active": "k-reveal-horizontal-appear-active",
116
+ "reveal-horizontal-exit": "k-reveal-horizontal-exit",
117
+ "reveal-horizontal-exit-active": "k-reveal-horizontal-exit-active"
118
+ }, Y = {
119
+ outerHeight: G,
120
+ outerWidth: K,
121
+ styles: X
122
+ }, k = Y, g = k.styles;
123
+ class E extends a.Component {
124
+ constructor() {
125
+ super(...arguments), this.elementRef = a.createRef();
126
+ }
127
+ /**
128
+ * The element that is being animated.
129
+ */
130
+ get element() {
131
+ return this.elementRef.current;
132
+ }
133
+ /**
134
+ * @hidden
135
+ */
136
+ render() {
137
+ const {
138
+ children: i,
139
+ style: t,
140
+ appear: n,
141
+ enter: s,
142
+ exit: c,
143
+ transitionName: r,
144
+ transitionEnterDuration: l,
145
+ transitionExitDuration: d,
146
+ className: h,
147
+ onEnter: u,
148
+ onEntering: p,
149
+ onEntered: f,
150
+ onExit: m,
151
+ onExiting: y,
152
+ onExited: z,
153
+ onAfterExited: w,
154
+ mountOnEnter: b,
155
+ unmountOnExit: F,
156
+ animationEnteringStyle: A,
157
+ animationEnteredStyle: P,
158
+ animationExitingStyle: W,
159
+ animationExitedStyle: H,
160
+ ...I
161
+ } = this.props, q = C(
162
+ h,
163
+ g["child-animation-container"]
164
+ ), L = {
165
+ transitionDelay: "0ms",
166
+ ...t
167
+ }, M = {
168
+ entering: { transitionDuration: `${l}ms`, ...A },
169
+ entered: { ...P },
170
+ exiting: { transitionDuration: `${d}ms`, ...W },
171
+ exited: { ...H }
172
+ }, U = {
173
+ in: this.props.in,
174
+ appear: n,
175
+ enter: s,
176
+ exit: c,
177
+ mountOnEnter: b,
178
+ unmountOnExit: F,
179
+ timeout: {
180
+ enter: l,
181
+ exit: d
182
+ },
183
+ onEnter: () => {
184
+ u && u.call(void 0, { animatedElement: this.element, target: this });
185
+ },
186
+ onEntering: () => {
187
+ p && p.call(void 0, { animatedElement: this.element, target: this });
188
+ },
189
+ onEntered: () => {
190
+ f && f.call(void 0, { animatedElement: this.element, target: this });
191
+ },
192
+ onExit: () => {
193
+ m && m.call(void 0, { animatedElement: this.element, target: this });
194
+ },
195
+ onExiting: () => {
196
+ y && y.call(void 0, { animatedElement: this.element, target: this });
197
+ },
198
+ onExited: () => {
199
+ w && w.call(void 0, { animatedElement: this.element, target: this }), z && z.call(void 0, { animatedElement: this.element, target: this });
200
+ },
201
+ classNames: {
202
+ appear: g[`${r}-appear`] || `${r}-appear`,
203
+ appearActive: g[`${r}-appear-active`] || `${r}-appear-active`,
204
+ enter: g[`${r}-enter`] || `${r}-enter`,
205
+ enterActive: g[`${r}-enter-active`] || `${r}-enter-active`,
206
+ exit: g[`${r}-exit`] || `${r}-exit`,
207
+ exitActive: g[`${r}-exit-active`] || `${r}-exit-active`
208
+ }
209
+ };
210
+ return /* @__PURE__ */ a.createElement(_, { ...U, ...I, nodeRef: this.elementRef }, (j) => /* @__PURE__ */ a.createElement(
211
+ "div",
212
+ {
213
+ style: {
214
+ ...L,
215
+ ...M[j]
216
+ },
217
+ className: q,
218
+ ref: this.elementRef
219
+ },
220
+ i
221
+ ));
222
+ }
223
+ }
224
+ E.propTypes = {
225
+ in: e.bool,
226
+ children: e.oneOfType([
227
+ e.arrayOf(e.node),
228
+ e.node
229
+ ]),
230
+ transitionName: e.string.isRequired,
231
+ className: e.string,
232
+ appear: e.bool,
233
+ enter: e.bool,
234
+ exit: e.bool,
235
+ transitionEnterDuration: e.number.isRequired,
236
+ transitionExitDuration: e.number.isRequired,
237
+ mountOnEnter: e.bool,
238
+ unmountOnExit: e.bool,
239
+ animationEnteringStyle: e.object,
240
+ animationEnteredStyle: e.object,
241
+ animationExitingStyle: e.object,
242
+ animationExitedStyle: e.object
243
+ };
244
+ E.defaultProps = {
245
+ mountOnEnter: !0,
246
+ unmountOnExit: !1,
247
+ onEnter: v,
248
+ onEntering: v,
249
+ onEntered: v,
250
+ onExit: v,
251
+ onExiting: v,
252
+ onExited: v,
253
+ onAfterExited: v,
254
+ animationEnteringStyle: {},
255
+ animationEnteredStyle: {},
256
+ animationExitingStyle: {},
257
+ animationExitedStyle: {}
258
+ };
259
+ const Z = {
260
+ name: "@progress/kendo-react-animation",
261
+ productName: "KendoReact",
262
+ productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
263
+ publishDate: 1700572990,
264
+ version: "",
265
+ licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
266
+ }, N = k.styles;
267
+ class x extends a.Component {
268
+ constructor(i) {
269
+ super(i), V(Z);
270
+ }
271
+ /**
272
+ * @hidden
273
+ */
274
+ render() {
275
+ const {
276
+ id: i,
277
+ style: t,
278
+ children: n,
279
+ component: s,
280
+ className: c,
281
+ childFactory: r,
282
+ stackChildren: l,
283
+ componentChildStyle: d,
284
+ componentChildClassName: h,
285
+ ...u
286
+ } = this.props, p = {
287
+ id: i,
288
+ style: t,
289
+ component: s,
290
+ childFactory: r,
291
+ className: C(
292
+ N["animation-container"],
293
+ N["animation-container-relative"],
294
+ c
295
+ )
296
+ }, f = a.Children.map(n || null, (m) => /* @__PURE__ */ a.createElement(
297
+ E,
298
+ {
299
+ ...u,
300
+ style: d,
301
+ className: h
302
+ },
303
+ m
304
+ ));
305
+ return /* @__PURE__ */ a.createElement(B, { ...p }, f);
306
+ }
307
+ }
308
+ x.propTypes = {
309
+ children: e.oneOfType([
310
+ e.arrayOf(e.node),
311
+ e.node
312
+ ]),
313
+ childFactory: e.any,
314
+ className: e.string,
315
+ component: e.string,
316
+ id: e.string,
317
+ style: e.any,
318
+ transitionName: e.string.isRequired,
319
+ appear: e.bool.isRequired,
320
+ enter: e.bool.isRequired,
321
+ exit: e.bool.isRequired,
322
+ transitionEnterDuration: e.number.isRequired,
323
+ transitionExitDuration: e.number.isRequired
324
+ };
325
+ x.defaultProps = {
326
+ component: "div"
327
+ };
328
+ class D extends a.Component {
329
+ /**
330
+ * @hidden
331
+ */
332
+ render() {
333
+ const {
334
+ children: i,
335
+ ...t
336
+ } = this.props, n = {
337
+ transitionName: "fade"
338
+ };
339
+ return /* @__PURE__ */ a.createElement(x, { ...n, ...t }, i);
340
+ }
341
+ }
342
+ D.propTypes = {
343
+ children: e.oneOfType([
344
+ e.arrayOf(e.node),
345
+ e.node
346
+ ]),
347
+ childFactory: e.any,
348
+ className: e.string,
349
+ component: e.string,
350
+ id: e.string,
351
+ style: e.any
352
+ };
353
+ D.defaultProps = {
354
+ appear: !1,
355
+ enter: !0,
356
+ exit: !1,
357
+ transitionEnterDuration: 500,
358
+ transitionExitDuration: 500
359
+ };
360
+ class O extends a.Component {
361
+ /**
362
+ * @hidden
363
+ */
364
+ render() {
365
+ const {
366
+ direction: i,
367
+ children: t,
368
+ ...n
369
+ } = this.props, s = {
370
+ transitionName: `expand-${i}`
371
+ };
372
+ return /* @__PURE__ */ a.createElement(x, { ...s, ...n }, t);
373
+ }
374
+ }
375
+ O.propTypes = {
376
+ children: e.oneOfType([
377
+ e.arrayOf(e.node),
378
+ e.node
379
+ ]),
380
+ childFactory: e.any,
381
+ className: e.string,
382
+ direction: e.oneOf([
383
+ "horizontal",
384
+ "vertical"
385
+ ]),
386
+ component: e.string,
387
+ id: e.string,
388
+ style: e.any
389
+ };
390
+ O.defaultProps = {
391
+ appear: !1,
392
+ enter: !0,
393
+ exit: !0,
394
+ transitionEnterDuration: 300,
395
+ transitionExitDuration: 300,
396
+ direction: "vertical"
397
+ };
398
+ const J = { position: "absolute", top: "0", left: "0" };
399
+ class S extends a.Component {
400
+ /**
401
+ * @hidden
402
+ */
403
+ render() {
404
+ const {
405
+ children: i,
406
+ direction: t,
407
+ ...n
408
+ } = this.props;
409
+ return /* @__PURE__ */ a.createElement(
410
+ x,
411
+ {
412
+ ...n,
413
+ transitionName: `push-${t}`,
414
+ animationExitingStyle: this.props.stackChildren ? J : void 0
415
+ },
416
+ i
417
+ );
418
+ }
419
+ }
420
+ S.propTypes = {
421
+ children: e.oneOfType([
422
+ e.arrayOf(e.node),
423
+ e.node
424
+ ]),
425
+ childFactory: e.any,
426
+ className: e.string,
427
+ direction: e.oneOf([
428
+ "up",
429
+ "down",
430
+ "left",
431
+ "right"
432
+ ]),
433
+ component: e.string,
434
+ id: e.string,
435
+ style: e.any,
436
+ stackChildren: e.bool
437
+ };
438
+ S.defaultProps = {
439
+ appear: !1,
440
+ enter: !0,
441
+ exit: !0,
442
+ transitionEnterDuration: 300,
443
+ transitionExitDuration: 300,
444
+ direction: "right",
445
+ stackChildren: !1
446
+ };
447
+ class T extends a.Component {
448
+ /**
449
+ * @hidden
450
+ */
451
+ render() {
452
+ const {
453
+ direction: i,
454
+ children: t,
455
+ ...n
456
+ } = this.props, s = {
457
+ transitionName: `slide-${i}`
458
+ };
459
+ return /* @__PURE__ */ a.createElement(x, { ...s, ...n }, t);
460
+ }
461
+ }
462
+ T.propTypes = {
463
+ children: e.oneOfType([
464
+ e.arrayOf(e.node),
465
+ e.node
466
+ ]),
467
+ childFactory: e.any,
468
+ className: e.string,
469
+ direction: e.oneOf([
470
+ "up",
471
+ "down",
472
+ "left",
473
+ "right"
474
+ ]),
475
+ component: e.string,
476
+ id: e.string,
477
+ style: e.any
478
+ };
479
+ T.defaultProps = {
480
+ appear: !1,
481
+ enter: !0,
482
+ exit: !0,
483
+ transitionEnterDuration: 300,
484
+ transitionExitDuration: 300,
485
+ direction: "down"
486
+ };
487
+ const Q = { position: "absolute", top: "0", left: "0" };
488
+ class R extends a.Component {
489
+ /**
490
+ * @hidden
491
+ */
492
+ render() {
493
+ const {
494
+ children: i,
495
+ direction: t,
496
+ ...n
497
+ } = this.props;
498
+ return /* @__PURE__ */ a.createElement(
499
+ x,
500
+ {
501
+ ...n,
502
+ transitionName: `zoom-${t}`,
503
+ animationExitingStyle: this.props.stackChildren ? Q : void 0
504
+ },
505
+ i
506
+ );
507
+ }
508
+ }
509
+ R.propTypes = {
510
+ children: e.oneOfType([
511
+ e.arrayOf(e.node),
512
+ e.node
513
+ ]),
514
+ childFactory: e.any,
515
+ className: e.string,
516
+ direction: e.oneOf([
517
+ "in",
518
+ "out"
519
+ ]),
520
+ component: e.string,
521
+ id: e.string,
522
+ style: e.any,
523
+ stackChildren: e.bool
524
+ };
525
+ R.defaultProps = {
526
+ appear: !1,
527
+ enter: !0,
528
+ exit: !0,
529
+ transitionEnterDuration: 300,
530
+ transitionExitDuration: 300,
531
+ direction: "out",
532
+ stackChildren: !1
533
+ };
534
+ class $ extends a.Component {
535
+ constructor() {
536
+ super(...arguments), this.state = {
537
+ maxHeight: void 0,
538
+ maxWidth: void 0
539
+ }, this.componentWillEnter = (i) => {
540
+ const { onEnter: t, onBeforeEnter: n } = this.props;
541
+ n && n.call(void 0, i), this.updateContainerDimensions(i.animatedElement, () => {
542
+ t && t.call(void 0, i);
543
+ });
544
+ }, this.componentIsEntering = (i) => {
545
+ const { onEntering: t } = this.props;
546
+ this.updateContainerDimensions(i.animatedElement, () => {
547
+ t && t.call(void 0, i);
548
+ });
549
+ }, this.componentWillExit = (i) => {
550
+ const { onExit: t } = this.props;
551
+ this.updateContainerDimensions(i.animatedElement, () => {
552
+ t && t.call(void 0, i);
553
+ });
554
+ }, this.updateContainerDimensions = (i, t = v) => {
555
+ const n = i.firstChild;
556
+ if (n) {
557
+ const s = k.outerHeight(n), c = k.outerWidth(n);
558
+ this.setState(
559
+ {
560
+ maxHeight: s,
561
+ maxWidth: c
562
+ },
563
+ t
564
+ );
565
+ }
566
+ };
567
+ }
568
+ /**
569
+ * @hidden
570
+ */
571
+ render() {
572
+ const {
573
+ direction: i,
574
+ children: t,
575
+ childFactory: n,
576
+ ...s
577
+ } = this.props, {
578
+ maxHeight: c,
579
+ maxWidth: r
580
+ } = this.state;
581
+ let l;
582
+ i === "vertical" ? l = { maxHeight: c ? `${c}px` : "" } : l = { maxWidth: r ? `${r}px` : "" };
583
+ const d = {
584
+ maxHeight: l.maxHeight,
585
+ maxWidth: l.maxWidth
586
+ }, h = (u) => {
587
+ let p = n ? n(u) : u;
588
+ return p.props.in ? p : a.cloneElement(p, {
589
+ ...p.props,
590
+ style: {
591
+ ...p.props.style,
592
+ maxHeight: l.maxHeight,
593
+ maxWidth: l.maxWidth
594
+ }
595
+ });
596
+ };
597
+ return /* @__PURE__ */ a.createElement(
598
+ x,
599
+ {
600
+ ...s,
601
+ childFactory: h,
602
+ onEnter: this.componentWillEnter,
603
+ onEntering: this.componentIsEntering,
604
+ onExit: this.componentWillExit,
605
+ animationEnteringStyle: d,
606
+ transitionName: `reveal-${i}`
607
+ },
608
+ t
609
+ );
610
+ }
611
+ }
612
+ $.propTypes = {
613
+ children: e.oneOfType([
614
+ e.arrayOf(e.node),
615
+ e.node
616
+ ]),
617
+ childFactory: e.any,
618
+ className: e.string,
619
+ direction: e.oneOf([
620
+ "horizontal",
621
+ "vertical"
622
+ ]),
623
+ component: e.string,
624
+ id: e.string,
625
+ style: e.any
626
+ };
627
+ $.defaultProps = {
628
+ appear: !1,
629
+ enter: !0,
630
+ exit: !0,
631
+ transitionEnterDuration: 300,
632
+ transitionExitDuration: 300,
633
+ direction: "vertical"
634
+ };
635
+ const ie = (o, i) => {
636
+ const t = a.useRef(0), n = a.useRef(!1), s = a.useRef(), c = (r) => {
637
+ const l = r.duration;
638
+ let d, h, u = t.current && 1 - t.current;
639
+ r.onStart && r.onStart();
640
+ const p = (f) => {
641
+ d || (d = f), h = f - d + 1;
642
+ const m = h / l + u;
643
+ m <= 1 ? (r.onUpdate && r.onUpdate(m), s.current = window.requestAnimationFrame(p), t.current = m) : (r.onEnd && r.onEnd(1), t.current = 0);
644
+ };
645
+ s.current = window.requestAnimationFrame(p);
646
+ };
647
+ a.useEffect(
648
+ () => (c(o), () => {
649
+ s.current && window.cancelAnimationFrame(s.current);
650
+ }),
651
+ i
652
+ ), a.useEffect(
653
+ () => {
654
+ n.current = !0;
655
+ },
656
+ []
657
+ );
658
+ };
659
+ export {
660
+ x as Animation,
661
+ E as AnimationChild,
662
+ O as Expand,
663
+ D as Fade,
664
+ S as Push,
665
+ $ as Reveal,
666
+ T as Slide,
667
+ R as Zoom,
668
+ ie as useAnimation
669
+ };
@@ -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;