@progress/kendo-react-popup 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 (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
@@ -1,488 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.PopupWithoutContext = void 0;
30
- var React = require("react");
31
- var ReactDOM = require("react-dom");
32
- var PropTypes = require("prop-types");
33
- var animation_1 = require("./animation");
34
- var kendo_react_common_1 = require("@progress/kendo-react-common");
35
- var kendo_popup_common_1 = require("@progress/kendo-popup-common");
36
- var util_1 = require("./util");
37
- var package_metadata_1 = require("./package-metadata");
38
- var DEFAULT_POPUP_ZINDEX = 100;
39
- var ZINDEX_POPUP_STEP = 1;
40
- function isEquivalent(a, b) {
41
- if (a === b) {
42
- return true;
43
- }
44
- if (!!a !== !!b) {
45
- return false;
46
- }
47
- var aProps = Object.getOwnPropertyNames(a);
48
- var bProps = Object.getOwnPropertyNames(b);
49
- if (aProps.length !== bProps.length) {
50
- return false;
51
- }
52
- for (var i = 0; i < aProps.length; i++) {
53
- var propName = aProps[i];
54
- if (a[propName] !== b[propName]) {
55
- return false;
56
- }
57
- }
58
- return true;
59
- }
60
- var DEFAULT_OFFSET = {
61
- left: -1000,
62
- top: 0
63
- };
64
- var Status;
65
- (function (Status) {
66
- Status["hiding"] = "hiding";
67
- Status["hidden"] = "hidden";
68
- Status["showing"] = "showing";
69
- Status["shown"] = "shown";
70
- Status["reposition"] = "reposition";
71
- })(Status || (Status = {}));
72
- var ANIMATION_CONTAINER = 'k-animation-container';
73
- var ANIMATION_CONTAINER_SHOWN = 'k-animation-container-shown';
74
- var ANIMATION_CONTAINER_CHILD = 'k-child-animation-container';
75
- var K_POPUP = 'k-popup';
76
- /**
77
- * @hidden
78
- */
79
- var PopupWithoutContext = /** @class */ (function (_super) {
80
- __extends(PopupWithoutContext, _super);
81
- function PopupWithoutContext(props) {
82
- var _this = _super.call(this, props) || this;
83
- /**
84
- * @hidden
85
- */
86
- _this.context = 0;
87
- /**
88
- * @hidden
89
- */
90
- _this.state = { current: Status.hidden, previous: Status.hidden, props: {} };
91
- _this._popup = null;
92
- _this.show = function (popup) {
93
- _this.setPosition(popup);
94
- _this.animate(popup.firstChild, 'enter', _this.onOpened);
95
- _this.setState({ current: Status.shown, previous: _this.state.current });
96
- };
97
- _this.setPosition = function (popup) {
98
- var _a = _this.props, anchorAlign = _a.anchorAlign, popupAlign = _a.popupAlign, collision = _a.collision, offset = _a.offset, anchor = _a.anchor, margin = _a.margin, scale = _a.scale, positionMode = _a.positionMode;
99
- var _b = popup.style, width = _b.width, height = _b.height;
100
- // Calculations are wrong if popup does not have set size
101
- popup.style.width = popup.offsetWidth + 'px';
102
- popup.style.height = popup.offsetHeight + 'px';
103
- var alignedOffset = (0, kendo_popup_common_1.alignElement)({
104
- anchor: anchor,
105
- anchorAlign: anchorAlign,
106
- element: popup,
107
- elementAlign: popupAlign,
108
- offset: offset,
109
- margin: margin,
110
- positionMode: positionMode,
111
- scale: scale
112
- });
113
- var position = (0, kendo_popup_common_1.positionElement)({
114
- anchor: anchor,
115
- anchorAlign: anchorAlign,
116
- element: popup,
117
- elementAlign: popupAlign,
118
- collisions: collision,
119
- currentLocation: alignedOffset,
120
- margin: _this.props.margin
121
- });
122
- popup.style.top = position.offset.top + 'px';
123
- popup.style.left = position.offset.left + 'px';
124
- popup.style.width = width;
125
- popup.style.height = height;
126
- _this._collisions = {
127
- fit: position.fit,
128
- fitted: position.fitted,
129
- flip: position.flip,
130
- flipped: position.flipped
131
- };
132
- if (_this.props.onPosition) {
133
- var event_1 = {
134
- target: _this,
135
- flipped: position.flipped,
136
- fitted: position.fitted
137
- };
138
- _this.props.onPosition.call(undefined, event_1);
139
- }
140
- };
141
- _this.onOpened = function () {
142
- var element = _this._popup;
143
- if (!element) {
144
- return;
145
- }
146
- if (_this.props.show) {
147
- element.classList.add(ANIMATION_CONTAINER_SHOWN);
148
- }
149
- _this.attachRepositionHandlers(element);
150
- if (_this.props.onOpen) {
151
- _this.props.onOpen.call(undefined, { target: _this });
152
- }
153
- };
154
- _this.animate = function (element, type, callback) {
155
- if (!_this.props.popupAlign) {
156
- return;
157
- }
158
- var animationDirection;
159
- var _a = _this.props.popupAlign, horizontal = _a.horizontal, vertical = _a.vertical;
160
- if (horizontal === 'left' && vertical === 'center') {
161
- animationDirection = 'right';
162
- }
163
- else if (horizontal === 'right' && vertical === 'center') {
164
- animationDirection = 'left';
165
- }
166
- else if (vertical === 'top') {
167
- animationDirection = 'down';
168
- }
169
- else {
170
- animationDirection = 'up';
171
- }
172
- var flipPositions = {
173
- down: 'up',
174
- up: 'down',
175
- left: 'right',
176
- right: 'left'
177
- };
178
- if (_this._collisions && _this._collisions.flipped) {
179
- animationDirection = flipPositions[animationDirection];
180
- }
181
- (0, animation_1.slide)(element, animationDirection, _this.animationDuration[type], type, callback);
182
- };
183
- _this.onClosing = function (popup) {
184
- if (!_this.props.show) {
185
- popup.classList.remove(ANIMATION_CONTAINER_SHOWN);
186
- }
187
- _this.detachRepositionHandlers();
188
- };
189
- _this.onClosed = function () {
190
- if (_this.state.current === Status.hiding && _this.state.previous === Status.shown) {
191
- _this.setState({ current: Status.hidden, previous: _this.state.current });
192
- }
193
- if (_this.props.onClose) {
194
- _this.props.onClose.call(undefined, { target: _this });
195
- }
196
- };
197
- _this.getCurrentZIndex = function () {
198
- return _this.context ? _this.context + ZINDEX_POPUP_STEP : DEFAULT_POPUP_ZINDEX;
199
- };
200
- (0, kendo_react_common_1.validatePackage)(package_metadata_1.packageMetadata);
201
- _this.reposition = (0, util_1.throttle)(_this.reposition.bind(_this), util_1.FRAME_DURATION);
202
- return _this;
203
- }
204
- Object.defineProperty(PopupWithoutContext.prototype, "element", {
205
- /**
206
- * Represents the Popup DOM element.
207
- */
208
- get: function () {
209
- return this._popup;
210
- },
211
- enumerable: false,
212
- configurable: true
213
- });
214
- /**
215
- * @hidden
216
- */
217
- PopupWithoutContext.getDerivedStateFromProps = function (props, state) {
218
- var show = props.show, anchor = props.anchor, anchorAlign = props.anchorAlign, appendTo = props.appendTo, collision = props.collision, popupAlign = props.popupAlign, className = props.className, popupClass = props.popupClass, style = props.style, offset = props.offset, contentKey = props.contentKey;
219
- var nextState = __assign(__assign({}, state), { props: {
220
- show: show,
221
- anchor: anchor,
222
- anchorAlign: anchorAlign,
223
- appendTo: appendTo,
224
- collision: collision,
225
- popupAlign: popupAlign,
226
- className: className,
227
- popupClass: popupClass,
228
- style: style,
229
- offset: offset,
230
- contentKey: contentKey
231
- } });
232
- if (props.show) {
233
- if (state.current === Status.hidden || state.current === Status.hiding) {
234
- return __assign(__assign({}, nextState), { current: Status.showing, previous: state.current });
235
- }
236
- if (state.current === Status.showing) {
237
- return __assign(__assign({}, nextState), { current: Status.shown, previous: state.current });
238
- }
239
- if (state.current === Status.shown &&
240
- (!isEquivalent(offset, state.props.offset) ||
241
- !isEquivalent(anchorAlign, state.props.anchorAlign) ||
242
- !isEquivalent(appendTo, state.props.appendTo) ||
243
- !isEquivalent(collision, state.props.collision) ||
244
- !isEquivalent(popupAlign, state.props.popupAlign) ||
245
- !isEquivalent(style, state.props.style) ||
246
- anchor !== state.props.anchor ||
247
- popupClass !== state.props.popupClass ||
248
- className !== state.props.className)) {
249
- return __assign(__assign({}, nextState), { current: Status.reposition, previous: state.current });
250
- }
251
- return nextState;
252
- }
253
- if (state.current === Status.hiding || state.current === Status.hidden) {
254
- return __assign(__assign({}, nextState), { current: Status.hidden, previous: state.current });
255
- }
256
- return __assign(__assign({}, nextState), { current: Status.hiding, previous: state.current });
257
- };
258
- /**
259
- * @hidden
260
- */
261
- PopupWithoutContext.prototype.componentDidUpdate = function (prevProps) {
262
- if (this.state.current === Status.showing && this._popup) {
263
- this.show(this._popup);
264
- }
265
- else if (this.state.current === Status.hiding && this._popup) {
266
- this.onClosing(this._popup);
267
- this.animate(this._popup.firstChild, 'exit', this.onClosed);
268
- }
269
- else if (this.state.current === Status.reposition && this.state.previous === Status.shown) {
270
- this.setState({ current: Status.shown, previous: this.state.current });
271
- }
272
- else if (this.state.current === Status.shown &&
273
- prevProps.contentKey !== this.props.contentKey && this._popup) {
274
- this.setPosition(this._popup);
275
- }
276
- };
277
- /**
278
- * @hidden
279
- */
280
- PopupWithoutContext.prototype.componentDidMount = function () {
281
- if (this.state.current === Status.showing && this._popup) {
282
- this.show(this._popup);
283
- }
284
- };
285
- /**
286
- * @hidden
287
- */
288
- PopupWithoutContext.prototype.componentWillUnmount = function () {
289
- this.detachRepositionHandlers();
290
- };
291
- /**
292
- * @hidden
293
- */
294
- PopupWithoutContext.prototype.render = function () {
295
- var _this = this;
296
- var _a = this.props, children = _a.children, className = _a.className, popupClass = _a.popupClass, show = _a.show, id = _a.id, positionMode = _a.positionMode;
297
- var calculatedAppendTo = this.props.appendTo ?
298
- this.props.appendTo :
299
- kendo_react_common_1.canUseDOM ?
300
- (this.props.anchor && this.props.anchor.ownerDocument ? this.props.anchor.ownerDocument.body : document.body)
301
- : undefined;
302
- if (this.state.current === Status.reposition && this.state.previous === Status.shown && this._popup) {
303
- this.setPosition(this._popup);
304
- }
305
- var style = Object.assign({}, { position: positionMode, top: 0, left: -10000 }, this.props.style || {});
306
- var closing = this.state.current === Status.hiding;
307
- if ((show || closing) && calculatedAppendTo) {
308
- var currentZIndex = this.getCurrentZIndex();
309
- var popupElement = (React.createElement(kendo_react_common_1.ZIndexContext.Provider, { value: currentZIndex },
310
- React.createElement("div", { className: (0, kendo_react_common_1.classNames)(ANIMATION_CONTAINER, className), id: id, ref: function (e) { return _this._popup = e; }, style: __assign({ zIndex: currentZIndex }, style) },
311
- React.createElement("div", { className: (0, kendo_react_common_1.classNames)(ANIMATION_CONTAINER_CHILD), style: { transitionDelay: '0ms' } },
312
- React.createElement("div", { role: this.props.role, className: (0, kendo_react_common_1.classNames)(K_POPUP, popupClass) }, children)))));
313
- return this.props.appendTo !== null ?
314
- ReactDOM.createPortal(popupElement, calculatedAppendTo) :
315
- popupElement;
316
- }
317
- return null;
318
- };
319
- Object.defineProperty(PopupWithoutContext.prototype, "animationDuration", {
320
- get: function () {
321
- var animate = this.props.animate;
322
- var enter = 0;
323
- var exit = 0;
324
- if (animate) {
325
- if (animate === true) {
326
- enter = exit = 300;
327
- }
328
- else {
329
- enter = animate.openDuration || 0;
330
- exit = animate.closeDuration || 0;
331
- }
332
- }
333
- return { enter: enter, exit: exit };
334
- },
335
- enumerable: false,
336
- configurable: true
337
- });
338
- PopupWithoutContext.prototype.attachRepositionHandlers = function (element) {
339
- var _this = this;
340
- this.detachRepositionHandlers();
341
- this._scrollableParents = kendo_popup_common_1.domUtils.scrollableParents(this.props.anchor || element);
342
- if (this._scrollableParents) {
343
- this._scrollableParents.map(function (p) { return p.addEventListener('scroll', _this.reposition); });
344
- }
345
- window.addEventListener('resize', this.reposition);
346
- };
347
- PopupWithoutContext.prototype.detachRepositionHandlers = function () {
348
- var _this = this;
349
- if (this._scrollableParents) {
350
- this._scrollableParents.map(function (p) { return p.removeEventListener('scroll', _this.reposition); });
351
- this._scrollableParents = undefined;
352
- }
353
- window.removeEventListener('resize', this.reposition);
354
- };
355
- PopupWithoutContext.prototype.reposition = function () {
356
- this.setState({ current: Status.reposition, previous: this.state.current });
357
- };
358
- /**
359
- * @hidden
360
- */
361
- PopupWithoutContext.propTypes = {
362
- anchor: function (props) {
363
- var anchor = props.anchor;
364
- if (anchor && typeof anchor.nodeType !== 'number') {
365
- return new Error('Invalid prop `anchor` supplied to `Kendo React Popup`. Validation failed.');
366
- }
367
- return null;
368
- },
369
- appendTo: function (props) {
370
- var element = props.appendTo;
371
- if (element && typeof element.nodeType !== 'number') {
372
- return new Error('Invalid prop `appendTo` supplied to `Kendo React Popup`. Validation failed.');
373
- }
374
- return null;
375
- },
376
- className: PropTypes.oneOfType([
377
- PropTypes.string,
378
- PropTypes.arrayOf(PropTypes.string),
379
- PropTypes.object
380
- ]),
381
- id: PropTypes.string,
382
- popupClass: PropTypes.oneOfType([
383
- PropTypes.string,
384
- PropTypes.arrayOf(PropTypes.string),
385
- PropTypes.object
386
- ]),
387
- collision: PropTypes.shape({
388
- horizontal: PropTypes.oneOf([
389
- kendo_popup_common_1.Collision.fit,
390
- kendo_popup_common_1.Collision.flip,
391
- kendo_popup_common_1.Collision.none
392
- ]),
393
- vertical: PropTypes.oneOf([
394
- kendo_popup_common_1.Collision.fit,
395
- kendo_popup_common_1.Collision.flip,
396
- kendo_popup_common_1.Collision.none
397
- ])
398
- }),
399
- anchorAlign: PropTypes.shape({
400
- horizontal: PropTypes.oneOf([
401
- kendo_popup_common_1.AlignPoint.left,
402
- kendo_popup_common_1.AlignPoint.center,
403
- kendo_popup_common_1.AlignPoint.right
404
- ]),
405
- vertical: PropTypes.oneOf([
406
- kendo_popup_common_1.AlignPoint.top,
407
- kendo_popup_common_1.AlignPoint.center,
408
- kendo_popup_common_1.AlignPoint.bottom
409
- ])
410
- }),
411
- popupAlign: PropTypes.shape({
412
- horizontal: PropTypes.oneOf([
413
- kendo_popup_common_1.AlignPoint.left,
414
- kendo_popup_common_1.AlignPoint.center,
415
- kendo_popup_common_1.AlignPoint.right
416
- ]),
417
- vertical: PropTypes.oneOf([
418
- kendo_popup_common_1.AlignPoint.top,
419
- kendo_popup_common_1.AlignPoint.center,
420
- kendo_popup_common_1.AlignPoint.bottom
421
- ])
422
- }),
423
- offset: PropTypes.shape({
424
- left: PropTypes.number,
425
- top: PropTypes.number
426
- }),
427
- children: PropTypes.oneOfType([
428
- PropTypes.element,
429
- PropTypes.node
430
- ]),
431
- show: PropTypes.bool,
432
- animate: PropTypes.oneOfType([
433
- PropTypes.bool,
434
- PropTypes.shape({
435
- openDuration: PropTypes.number,
436
- closeDuration: PropTypes.number
437
- })
438
- ]),
439
- margin: PropTypes.shape({
440
- horizontal: PropTypes.number,
441
- vertical: PropTypes.number
442
- }),
443
- positionMode: PropTypes.oneOf([
444
- 'fixed',
445
- 'absolute'
446
- ]),
447
- scale: PropTypes.number,
448
- style: PropTypes.object,
449
- onClose: PropTypes.func,
450
- onPosition: PropTypes.func,
451
- onOpen: PropTypes.func
452
- };
453
- /**
454
- * @hidden
455
- */
456
- PopupWithoutContext.defaultProps = {
457
- collision: {
458
- horizontal: kendo_popup_common_1.Collision.fit,
459
- vertical: kendo_popup_common_1.Collision.flip
460
- },
461
- anchorAlign: {
462
- horizontal: kendo_popup_common_1.AlignPoint.left,
463
- vertical: kendo_popup_common_1.AlignPoint.bottom
464
- },
465
- popupAlign: {
466
- horizontal: kendo_popup_common_1.AlignPoint.left,
467
- vertical: kendo_popup_common_1.AlignPoint.top
468
- },
469
- offset: DEFAULT_OFFSET,
470
- animate: true,
471
- show: false,
472
- margin: {
473
- horizontal: 0,
474
- vertical: 0
475
- },
476
- positionMode: 'absolute'
477
- };
478
- /**
479
- * @hidden
480
- */
481
- PopupWithoutContext.contextType = kendo_react_common_1.ZIndexContext;
482
- /**
483
- * @hidden
484
- */
485
- PopupWithoutContext.displayName = 'PopupComponent';
486
- return PopupWithoutContext;
487
- }(React.Component));
488
- exports.PopupWithoutContext = PopupWithoutContext;
@@ -1,4 +0,0 @@
1
- /**
2
- * @hidden
3
- */
4
- export declare const slide: (element: HTMLElement, direction: 'up' | 'down' | 'left' | 'right', duration: number, type: 'enter' | 'exit', callback: Function) => any;
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.slide = void 0;
4
- var clearSlide = function (element) {
5
- element.style.transitionDuration = '';
6
- Array.from(element.classList).forEach(function (c) {
7
- if (c.startsWith('k-slide-')) {
8
- element.classList.remove(c);
9
- }
10
- });
11
- };
12
- var firefox = typeof window !== 'undefined' &&
13
- /Firefox/.test(window.navigator.userAgent);
14
- /**
15
- * @hidden
16
- */
17
- var slide = function (element, direction, duration, type, callback) {
18
- if (duration === 0) {
19
- return callback();
20
- }
21
- var slideClass = 'k-slide-' + direction + '-' + type;
22
- var slideActiveClass = slideClass + '-active';
23
- var transitionend = function (e) {
24
- // if event is attached using react,
25
- // the animation does not work well in firefox,
26
- // when the show/hide button is toggled quickly.
27
- if (e.target === element) {
28
- element.removeEventListener('transitionend', transitionend);
29
- clearSlide(element);
30
- if (type === 'exit') {
31
- element.style.display = 'none';
32
- }
33
- else {
34
- element.style.display = '';
35
- }
36
- callback();
37
- }
38
- };
39
- element.addEventListener('transitionend', transitionend);
40
- var ownerDocument = element.ownerDocument;
41
- if (!ownerDocument) {
42
- return;
43
- }
44
- var defaultView = ownerDocument.defaultView;
45
- if (!defaultView) {
46
- return;
47
- }
48
- var animate = function () {
49
- clearSlide(element);
50
- element.classList.add(slideClass);
51
- defaultView.requestAnimationFrame(function () {
52
- element.style.transitionDuration = duration + 'ms';
53
- element.classList.add(slideActiveClass);
54
- });
55
- };
56
- if (firefox) {
57
- defaultView.requestAnimationFrame(animate);
58
- }
59
- else {
60
- animate();
61
- }
62
- };
63
- exports.slide = slide;
@@ -1,12 +0,0 @@
1
- import { Popup, PopupPropsContext } from './Popup';
2
- import { PopupWithoutContext } from './PopupWithoutContext';
3
- import { PopupProps } from './models/PopupProps';
4
- import { Align } from './models/Align';
5
- import { Collision } from './models/Collision';
6
- import { Offset } from './models/Offset';
7
- import { PopupAnimation } from './models/PopupAnimation';
8
- import { OpenEvent as PopupOpenEvent, CloseEvent as PopupCloseEvent } from './models/Events';
9
- import { Margin } from './models/Margin';
10
- import { CollisionType } from './models/CollisionType';
11
- import { PositionMode } from './models/PositionMode';
12
- export { Popup, PopupWithoutContext, PopupPropsContext, PopupProps, Align, Collision, Offset, PopupAnimation, Margin, PositionMode, CollisionType, PopupOpenEvent, PopupCloseEvent };
package/dist/npm/main.js DELETED
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PopupPropsContext = exports.PopupWithoutContext = exports.Popup = void 0;
4
- var Popup_1 = require("./Popup");
5
- Object.defineProperty(exports, "Popup", { enumerable: true, get: function () { return Popup_1.Popup; } });
6
- Object.defineProperty(exports, "PopupPropsContext", { enumerable: true, get: function () { return Popup_1.PopupPropsContext; } });
7
- var PopupWithoutContext_1 = require("./PopupWithoutContext");
8
- Object.defineProperty(exports, "PopupWithoutContext", { enumerable: true, get: function () { return PopupWithoutContext_1.PopupWithoutContext; } });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,36 +0,0 @@
1
- import { Popup } from '../Popup';
2
- /**
3
- * Represents the object of the `Open` Popup event.
4
- */
5
- export interface OpenEvent {
6
- /**
7
- * An event target.
8
- */
9
- target: Popup;
10
- }
11
- /**
12
- * Represents the object of the `Close` Popup event.
13
- */
14
- export interface CloseEvent {
15
- /**
16
- * An event target.
17
- */
18
- target: Popup;
19
- }
20
- /**
21
- * Represents the object of the `Position` Popup event.
22
- */
23
- export interface PositionEvent {
24
- /**
25
- * An event target.
26
- */
27
- target: Popup;
28
- /**
29
- * Indicates if the position is fitted.
30
- */
31
- fitted: boolean;
32
- /**
33
- * Indicates if the position is flipped.
34
- */
35
- flipped: boolean;
36
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,14 +0,0 @@
1
- import { OffsetPosition } from '@progress/kendo-popup-common';
2
- /**
3
- * The offset position of the Popup.
4
- */
5
- export interface Offset extends OffsetPosition {
6
- /**
7
- * Defines the top position of the Popup.
8
- */
9
- top: number;
10
- /**
11
- * Defines the left position of the Popup.
12
- */
13
- left: number;
14
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,13 +0,0 @@
1
- /**
2
- * The animation settings for the Popup component.
3
- */
4
- export interface PopupAnimation {
5
- /**
6
- * The duration of the opening animation in milliseconds. Defaults to `300ms`.
7
- */
8
- openDuration?: number;
9
- /**
10
- * The duration of the closing animation in milliseconds. Defaults to `300ms`.
11
- */
12
- closeDuration?: number;
13
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });