@progress/kendo-react-popup 9.0.0-develop.9 → 9.0.0
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 +1 -1
- package/Popup.mjs +300 -10
- package/animation.js +1 -1
- package/animation.mjs +13 -13
- package/dist/cdn/js/kendo-react-popup.js +1 -1
- package/index.d.mts +22 -171
- package/index.d.ts +22 -171
- package/index.js +1 -1
- package/index.mjs +3 -5
- package/package-metadata.mjs +1 -1
- package/package.json +2 -2
- package/PopupWithoutContext.js +0 -8
- package/PopupWithoutContext.mjs +0 -321
package/index.d.mts
CHANGED
|
@@ -7,16 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { AlignStrategy } from '@progress/kendo-popup-common';
|
|
9
9
|
import { CollisionType as CollisionType_2 } from '@progress/kendo-popup-common';
|
|
10
|
-
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
11
10
|
import { MarginSettings } from '@progress/kendo-popup-common';
|
|
12
11
|
import { OffsetPosition } from '@progress/kendo-popup-common';
|
|
13
12
|
import { PopupClassStructure } from '@progress/kendo-react-common';
|
|
14
13
|
import { PopupSettings } from '@progress/kendo-popup-common';
|
|
15
14
|
import { PositionMode as PositionMode_2 } from '@progress/kendo-popup-common';
|
|
16
|
-
import PropTypes from 'prop-types';
|
|
17
15
|
import * as React_2 from 'react';
|
|
18
|
-
import { ZIndexContext } from '@progress/kendo-react-common';
|
|
19
|
-
import { ZIndexContextType } from '@progress/kendo-react-common';
|
|
20
16
|
|
|
21
17
|
/**
|
|
22
18
|
* Defines the horizontal and vertical aligning point of the Popup.
|
|
@@ -87,7 +83,7 @@ export declare interface MouseDownOutsideEvent {
|
|
|
87
83
|
/**
|
|
88
84
|
* An event target.
|
|
89
85
|
*/
|
|
90
|
-
target:
|
|
86
|
+
target: PopupHandle;
|
|
91
87
|
/**
|
|
92
88
|
* The event object.
|
|
93
89
|
*/
|
|
@@ -119,10 +115,7 @@ export declare interface Offset extends OffsetPosition {
|
|
|
119
115
|
/**
|
|
120
116
|
* The KendoReact Popup component.
|
|
121
117
|
*/
|
|
122
|
-
export declare const Popup: React_2.ForwardRefExoticComponent<PopupProps & React_2.RefAttributes<
|
|
123
|
-
|
|
124
|
-
/** @hidden */
|
|
125
|
-
export declare type Popup = PopupHandle;
|
|
118
|
+
export declare const Popup: React_2.ForwardRefExoticComponent<PopupProps & React_2.RefAttributes<PopupHandle | null>>;
|
|
126
119
|
|
|
127
120
|
/**
|
|
128
121
|
* The animation settings for the Popup component.
|
|
@@ -145,14 +138,21 @@ export declare interface PopupCloseEvent {
|
|
|
145
138
|
/**
|
|
146
139
|
* An event target.
|
|
147
140
|
*/
|
|
148
|
-
target:
|
|
141
|
+
target: PopupHandle;
|
|
149
142
|
}
|
|
150
143
|
|
|
151
|
-
|
|
144
|
+
/**
|
|
145
|
+
* The KendoReact PopupHandle component.
|
|
146
|
+
*/
|
|
147
|
+
export declare interface PopupHandle {
|
|
152
148
|
/**
|
|
153
|
-
*
|
|
149
|
+
* Represents the Popup DOM element.
|
|
154
150
|
*/
|
|
155
151
|
element: any;
|
|
152
|
+
/**
|
|
153
|
+
* The props of the PopupHandle component.
|
|
154
|
+
*/
|
|
155
|
+
props: PopupProps;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
/**
|
|
@@ -162,7 +162,7 @@ export declare interface PopupOpenEvent {
|
|
|
162
162
|
/**
|
|
163
163
|
* An event target.
|
|
164
164
|
*/
|
|
165
|
-
target:
|
|
165
|
+
target: PopupHandle;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
/**
|
|
@@ -306,172 +306,23 @@ declare interface PopupState {
|
|
|
306
306
|
previous: Status;
|
|
307
307
|
props: {
|
|
308
308
|
show?: boolean;
|
|
309
|
-
anchor?: HTMLElement;
|
|
309
|
+
anchor?: HTMLElement | null;
|
|
310
310
|
anchorAlign?: Align;
|
|
311
|
-
appendTo?: HTMLElement;
|
|
311
|
+
appendTo?: HTMLElement | null;
|
|
312
312
|
collision?: Collision;
|
|
313
313
|
popupAlign?: Align;
|
|
314
|
-
className?: string |
|
|
315
|
-
|
|
314
|
+
className?: string | string[] | {
|
|
315
|
+
[key: string]: boolean;
|
|
316
|
+
};
|
|
317
|
+
popupClass?: string | string[] | {
|
|
318
|
+
[key: string]: boolean;
|
|
319
|
+
};
|
|
316
320
|
style?: React_2.CSSProperties;
|
|
317
321
|
offset?: Offset;
|
|
318
322
|
contentKey?: any;
|
|
319
323
|
};
|
|
320
324
|
}
|
|
321
325
|
|
|
322
|
-
/**
|
|
323
|
-
* @hidden
|
|
324
|
-
*/
|
|
325
|
-
export declare class PopupWithoutContext extends React_2.Component<PopupProps, PopupState> {
|
|
326
|
-
/**
|
|
327
|
-
* @hidden
|
|
328
|
-
*/
|
|
329
|
-
static propTypes: {
|
|
330
|
-
anchor: (props: PopupProps) => Error | null;
|
|
331
|
-
appendTo: (props: PopupProps) => Error | null;
|
|
332
|
-
className: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
333
|
-
id: PropTypes.Requireable<string>;
|
|
334
|
-
popupClass: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
335
|
-
collision: PropTypes.Requireable<PropTypes.InferProps<{
|
|
336
|
-
horizontal: PropTypes.Requireable<string>;
|
|
337
|
-
vertical: PropTypes.Requireable<string>;
|
|
338
|
-
}>>;
|
|
339
|
-
anchorAlign: PropTypes.Requireable<PropTypes.InferProps<{
|
|
340
|
-
horizontal: PropTypes.Requireable<string>;
|
|
341
|
-
vertical: PropTypes.Requireable<string>;
|
|
342
|
-
}>>;
|
|
343
|
-
popupAlign: PropTypes.Requireable<PropTypes.InferProps<{
|
|
344
|
-
horizontal: PropTypes.Requireable<string>;
|
|
345
|
-
vertical: PropTypes.Requireable<string>;
|
|
346
|
-
}>>;
|
|
347
|
-
offset: PropTypes.Requireable<PropTypes.InferProps<{
|
|
348
|
-
left: PropTypes.Requireable<number>;
|
|
349
|
-
top: PropTypes.Requireable<number>;
|
|
350
|
-
}>>;
|
|
351
|
-
children: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
352
|
-
show: PropTypes.Requireable<boolean>;
|
|
353
|
-
animate: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
354
|
-
openDuration: PropTypes.Requireable<number>;
|
|
355
|
-
closeDuration: PropTypes.Requireable<number>;
|
|
356
|
-
}> | null | undefined>>;
|
|
357
|
-
margin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
358
|
-
horizontal: PropTypes.Requireable<number>;
|
|
359
|
-
vertical: PropTypes.Requireable<number>;
|
|
360
|
-
}>>;
|
|
361
|
-
positionMode: PropTypes.Requireable<string>;
|
|
362
|
-
scale: PropTypes.Requireable<number>;
|
|
363
|
-
style: PropTypes.Requireable<object>;
|
|
364
|
-
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
365
|
-
onPosition: PropTypes.Requireable<(...args: any[]) => any>;
|
|
366
|
-
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
367
|
-
onKeyPress: PropTypes.Requireable<(...args: any[]) => any>;
|
|
368
|
-
onMouseDownOutside: PropTypes.Requireable<(...args: any[]) => any>;
|
|
369
|
-
};
|
|
370
|
-
/**
|
|
371
|
-
* @hidden
|
|
372
|
-
*/
|
|
373
|
-
static defaultProps: {
|
|
374
|
-
collision: {
|
|
375
|
-
horizontal: string;
|
|
376
|
-
vertical: string;
|
|
377
|
-
};
|
|
378
|
-
anchorAlign: {
|
|
379
|
-
horizontal: string;
|
|
380
|
-
vertical: string;
|
|
381
|
-
};
|
|
382
|
-
popupAlign: {
|
|
383
|
-
horizontal: string;
|
|
384
|
-
vertical: string;
|
|
385
|
-
};
|
|
386
|
-
offset: {
|
|
387
|
-
left: number;
|
|
388
|
-
top: number;
|
|
389
|
-
};
|
|
390
|
-
animate: boolean;
|
|
391
|
-
show: boolean;
|
|
392
|
-
margin: {
|
|
393
|
-
horizontal: number;
|
|
394
|
-
vertical: number;
|
|
395
|
-
};
|
|
396
|
-
positionMode: string;
|
|
397
|
-
};
|
|
398
|
-
/**
|
|
399
|
-
* @hidden
|
|
400
|
-
*/
|
|
401
|
-
static contextType: React_2.Context<ZIndexContextType>;
|
|
402
|
-
/**
|
|
403
|
-
* @hidden
|
|
404
|
-
*/
|
|
405
|
-
context: React_2.ContextType<typeof ZIndexContext>;
|
|
406
|
-
/**
|
|
407
|
-
* @hidden
|
|
408
|
-
*/
|
|
409
|
-
static displayName: string;
|
|
410
|
-
/**
|
|
411
|
-
* @hidden
|
|
412
|
-
*/
|
|
413
|
-
readonly state: PopupState;
|
|
414
|
-
private _collisions;
|
|
415
|
-
private _scrollableParents;
|
|
416
|
-
private _popup;
|
|
417
|
-
/**
|
|
418
|
-
* Represents the Popup DOM element.
|
|
419
|
-
*/
|
|
420
|
-
get element(): HTMLDivElement | null;
|
|
421
|
-
constructor(props: PopupProps);
|
|
422
|
-
/**
|
|
423
|
-
* @hidden
|
|
424
|
-
*/
|
|
425
|
-
static getDerivedStateFromProps(props: PopupProps, state: PopupState): {
|
|
426
|
-
props: {
|
|
427
|
-
show: boolean | undefined;
|
|
428
|
-
anchor: HTMLElement | null | undefined;
|
|
429
|
-
anchorAlign: Align | undefined;
|
|
430
|
-
appendTo: HTMLElement | null | undefined;
|
|
431
|
-
collision: Collision | undefined;
|
|
432
|
-
popupAlign: Align | undefined;
|
|
433
|
-
className: string | string[] | undefined;
|
|
434
|
-
popupClass: string | string[] | {
|
|
435
|
-
[key: string]: boolean;
|
|
436
|
-
} | undefined;
|
|
437
|
-
style: React_2.CSSProperties | undefined;
|
|
438
|
-
offset: Offset | undefined;
|
|
439
|
-
contentKey: any;
|
|
440
|
-
};
|
|
441
|
-
current: Status;
|
|
442
|
-
previous: Status;
|
|
443
|
-
};
|
|
444
|
-
/**
|
|
445
|
-
*
|
|
446
|
-
* @hidden
|
|
447
|
-
*/
|
|
448
|
-
componentDidUpdate(prevProps: PopupProps): void;
|
|
449
|
-
/**
|
|
450
|
-
* @hidden
|
|
451
|
-
*/
|
|
452
|
-
componentDidMount(): void;
|
|
453
|
-
/**
|
|
454
|
-
* @hidden
|
|
455
|
-
*/
|
|
456
|
-
componentWillUnmount(): void;
|
|
457
|
-
/**
|
|
458
|
-
* @hidden
|
|
459
|
-
*/
|
|
460
|
-
render(): JSX_2.Element | null;
|
|
461
|
-
private show;
|
|
462
|
-
private setPosition;
|
|
463
|
-
private onOpened;
|
|
464
|
-
private animate;
|
|
465
|
-
private handleMouseDown;
|
|
466
|
-
private onClosing;
|
|
467
|
-
private onClosed;
|
|
468
|
-
private get animationDuration();
|
|
469
|
-
private attachRepositionHandlers;
|
|
470
|
-
private detachRepositionHandlers;
|
|
471
|
-
private reposition;
|
|
472
|
-
private getCurrentZIndex;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
326
|
/**
|
|
476
327
|
* Represents the object of the `Position` Popup event.
|
|
477
328
|
*/
|
|
@@ -479,7 +330,7 @@ export declare interface PositionEvent {
|
|
|
479
330
|
/**
|
|
480
331
|
* An event target.
|
|
481
332
|
*/
|
|
482
|
-
target:
|
|
333
|
+
target: PopupHandle;
|
|
483
334
|
/**
|
|
484
335
|
* Indicates if the position is fitted.
|
|
485
336
|
*/
|
package/index.d.ts
CHANGED
|
@@ -7,16 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { AlignStrategy } from '@progress/kendo-popup-common';
|
|
9
9
|
import { CollisionType as CollisionType_2 } from '@progress/kendo-popup-common';
|
|
10
|
-
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
11
10
|
import { MarginSettings } from '@progress/kendo-popup-common';
|
|
12
11
|
import { OffsetPosition } from '@progress/kendo-popup-common';
|
|
13
12
|
import { PopupClassStructure } from '@progress/kendo-react-common';
|
|
14
13
|
import { PopupSettings } from '@progress/kendo-popup-common';
|
|
15
14
|
import { PositionMode as PositionMode_2 } from '@progress/kendo-popup-common';
|
|
16
|
-
import PropTypes from 'prop-types';
|
|
17
15
|
import * as React_2 from 'react';
|
|
18
|
-
import { ZIndexContext } from '@progress/kendo-react-common';
|
|
19
|
-
import { ZIndexContextType } from '@progress/kendo-react-common';
|
|
20
16
|
|
|
21
17
|
/**
|
|
22
18
|
* Defines the horizontal and vertical aligning point of the Popup.
|
|
@@ -87,7 +83,7 @@ export declare interface MouseDownOutsideEvent {
|
|
|
87
83
|
/**
|
|
88
84
|
* An event target.
|
|
89
85
|
*/
|
|
90
|
-
target:
|
|
86
|
+
target: PopupHandle;
|
|
91
87
|
/**
|
|
92
88
|
* The event object.
|
|
93
89
|
*/
|
|
@@ -119,10 +115,7 @@ export declare interface Offset extends OffsetPosition {
|
|
|
119
115
|
/**
|
|
120
116
|
* The KendoReact Popup component.
|
|
121
117
|
*/
|
|
122
|
-
export declare const Popup: React_2.ForwardRefExoticComponent<PopupProps & React_2.RefAttributes<
|
|
123
|
-
|
|
124
|
-
/** @hidden */
|
|
125
|
-
export declare type Popup = PopupHandle;
|
|
118
|
+
export declare const Popup: React_2.ForwardRefExoticComponent<PopupProps & React_2.RefAttributes<PopupHandle | null>>;
|
|
126
119
|
|
|
127
120
|
/**
|
|
128
121
|
* The animation settings for the Popup component.
|
|
@@ -145,14 +138,21 @@ export declare interface PopupCloseEvent {
|
|
|
145
138
|
/**
|
|
146
139
|
* An event target.
|
|
147
140
|
*/
|
|
148
|
-
target:
|
|
141
|
+
target: PopupHandle;
|
|
149
142
|
}
|
|
150
143
|
|
|
151
|
-
|
|
144
|
+
/**
|
|
145
|
+
* The KendoReact PopupHandle component.
|
|
146
|
+
*/
|
|
147
|
+
export declare interface PopupHandle {
|
|
152
148
|
/**
|
|
153
|
-
*
|
|
149
|
+
* Represents the Popup DOM element.
|
|
154
150
|
*/
|
|
155
151
|
element: any;
|
|
152
|
+
/**
|
|
153
|
+
* The props of the PopupHandle component.
|
|
154
|
+
*/
|
|
155
|
+
props: PopupProps;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
/**
|
|
@@ -162,7 +162,7 @@ export declare interface PopupOpenEvent {
|
|
|
162
162
|
/**
|
|
163
163
|
* An event target.
|
|
164
164
|
*/
|
|
165
|
-
target:
|
|
165
|
+
target: PopupHandle;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
/**
|
|
@@ -306,172 +306,23 @@ declare interface PopupState {
|
|
|
306
306
|
previous: Status;
|
|
307
307
|
props: {
|
|
308
308
|
show?: boolean;
|
|
309
|
-
anchor?: HTMLElement;
|
|
309
|
+
anchor?: HTMLElement | null;
|
|
310
310
|
anchorAlign?: Align;
|
|
311
|
-
appendTo?: HTMLElement;
|
|
311
|
+
appendTo?: HTMLElement | null;
|
|
312
312
|
collision?: Collision;
|
|
313
313
|
popupAlign?: Align;
|
|
314
|
-
className?: string |
|
|
315
|
-
|
|
314
|
+
className?: string | string[] | {
|
|
315
|
+
[key: string]: boolean;
|
|
316
|
+
};
|
|
317
|
+
popupClass?: string | string[] | {
|
|
318
|
+
[key: string]: boolean;
|
|
319
|
+
};
|
|
316
320
|
style?: React_2.CSSProperties;
|
|
317
321
|
offset?: Offset;
|
|
318
322
|
contentKey?: any;
|
|
319
323
|
};
|
|
320
324
|
}
|
|
321
325
|
|
|
322
|
-
/**
|
|
323
|
-
* @hidden
|
|
324
|
-
*/
|
|
325
|
-
export declare class PopupWithoutContext extends React_2.Component<PopupProps, PopupState> {
|
|
326
|
-
/**
|
|
327
|
-
* @hidden
|
|
328
|
-
*/
|
|
329
|
-
static propTypes: {
|
|
330
|
-
anchor: (props: PopupProps) => Error | null;
|
|
331
|
-
appendTo: (props: PopupProps) => Error | null;
|
|
332
|
-
className: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
333
|
-
id: PropTypes.Requireable<string>;
|
|
334
|
-
popupClass: PropTypes.Requireable<NonNullable<string | object | null | undefined>>;
|
|
335
|
-
collision: PropTypes.Requireable<PropTypes.InferProps<{
|
|
336
|
-
horizontal: PropTypes.Requireable<string>;
|
|
337
|
-
vertical: PropTypes.Requireable<string>;
|
|
338
|
-
}>>;
|
|
339
|
-
anchorAlign: PropTypes.Requireable<PropTypes.InferProps<{
|
|
340
|
-
horizontal: PropTypes.Requireable<string>;
|
|
341
|
-
vertical: PropTypes.Requireable<string>;
|
|
342
|
-
}>>;
|
|
343
|
-
popupAlign: PropTypes.Requireable<PropTypes.InferProps<{
|
|
344
|
-
horizontal: PropTypes.Requireable<string>;
|
|
345
|
-
vertical: PropTypes.Requireable<string>;
|
|
346
|
-
}>>;
|
|
347
|
-
offset: PropTypes.Requireable<PropTypes.InferProps<{
|
|
348
|
-
left: PropTypes.Requireable<number>;
|
|
349
|
-
top: PropTypes.Requireable<number>;
|
|
350
|
-
}>>;
|
|
351
|
-
children: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
352
|
-
show: PropTypes.Requireable<boolean>;
|
|
353
|
-
animate: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
354
|
-
openDuration: PropTypes.Requireable<number>;
|
|
355
|
-
closeDuration: PropTypes.Requireable<number>;
|
|
356
|
-
}> | null | undefined>>;
|
|
357
|
-
margin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
358
|
-
horizontal: PropTypes.Requireable<number>;
|
|
359
|
-
vertical: PropTypes.Requireable<number>;
|
|
360
|
-
}>>;
|
|
361
|
-
positionMode: PropTypes.Requireable<string>;
|
|
362
|
-
scale: PropTypes.Requireable<number>;
|
|
363
|
-
style: PropTypes.Requireable<object>;
|
|
364
|
-
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
365
|
-
onPosition: PropTypes.Requireable<(...args: any[]) => any>;
|
|
366
|
-
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
367
|
-
onKeyPress: PropTypes.Requireable<(...args: any[]) => any>;
|
|
368
|
-
onMouseDownOutside: PropTypes.Requireable<(...args: any[]) => any>;
|
|
369
|
-
};
|
|
370
|
-
/**
|
|
371
|
-
* @hidden
|
|
372
|
-
*/
|
|
373
|
-
static defaultProps: {
|
|
374
|
-
collision: {
|
|
375
|
-
horizontal: string;
|
|
376
|
-
vertical: string;
|
|
377
|
-
};
|
|
378
|
-
anchorAlign: {
|
|
379
|
-
horizontal: string;
|
|
380
|
-
vertical: string;
|
|
381
|
-
};
|
|
382
|
-
popupAlign: {
|
|
383
|
-
horizontal: string;
|
|
384
|
-
vertical: string;
|
|
385
|
-
};
|
|
386
|
-
offset: {
|
|
387
|
-
left: number;
|
|
388
|
-
top: number;
|
|
389
|
-
};
|
|
390
|
-
animate: boolean;
|
|
391
|
-
show: boolean;
|
|
392
|
-
margin: {
|
|
393
|
-
horizontal: number;
|
|
394
|
-
vertical: number;
|
|
395
|
-
};
|
|
396
|
-
positionMode: string;
|
|
397
|
-
};
|
|
398
|
-
/**
|
|
399
|
-
* @hidden
|
|
400
|
-
*/
|
|
401
|
-
static contextType: React_2.Context<ZIndexContextType>;
|
|
402
|
-
/**
|
|
403
|
-
* @hidden
|
|
404
|
-
*/
|
|
405
|
-
context: React_2.ContextType<typeof ZIndexContext>;
|
|
406
|
-
/**
|
|
407
|
-
* @hidden
|
|
408
|
-
*/
|
|
409
|
-
static displayName: string;
|
|
410
|
-
/**
|
|
411
|
-
* @hidden
|
|
412
|
-
*/
|
|
413
|
-
readonly state: PopupState;
|
|
414
|
-
private _collisions;
|
|
415
|
-
private _scrollableParents;
|
|
416
|
-
private _popup;
|
|
417
|
-
/**
|
|
418
|
-
* Represents the Popup DOM element.
|
|
419
|
-
*/
|
|
420
|
-
get element(): HTMLDivElement | null;
|
|
421
|
-
constructor(props: PopupProps);
|
|
422
|
-
/**
|
|
423
|
-
* @hidden
|
|
424
|
-
*/
|
|
425
|
-
static getDerivedStateFromProps(props: PopupProps, state: PopupState): {
|
|
426
|
-
props: {
|
|
427
|
-
show: boolean | undefined;
|
|
428
|
-
anchor: HTMLElement | null | undefined;
|
|
429
|
-
anchorAlign: Align | undefined;
|
|
430
|
-
appendTo: HTMLElement | null | undefined;
|
|
431
|
-
collision: Collision | undefined;
|
|
432
|
-
popupAlign: Align | undefined;
|
|
433
|
-
className: string | string[] | undefined;
|
|
434
|
-
popupClass: string | string[] | {
|
|
435
|
-
[key: string]: boolean;
|
|
436
|
-
} | undefined;
|
|
437
|
-
style: React_2.CSSProperties | undefined;
|
|
438
|
-
offset: Offset | undefined;
|
|
439
|
-
contentKey: any;
|
|
440
|
-
};
|
|
441
|
-
current: Status;
|
|
442
|
-
previous: Status;
|
|
443
|
-
};
|
|
444
|
-
/**
|
|
445
|
-
*
|
|
446
|
-
* @hidden
|
|
447
|
-
*/
|
|
448
|
-
componentDidUpdate(prevProps: PopupProps): void;
|
|
449
|
-
/**
|
|
450
|
-
* @hidden
|
|
451
|
-
*/
|
|
452
|
-
componentDidMount(): void;
|
|
453
|
-
/**
|
|
454
|
-
* @hidden
|
|
455
|
-
*/
|
|
456
|
-
componentWillUnmount(): void;
|
|
457
|
-
/**
|
|
458
|
-
* @hidden
|
|
459
|
-
*/
|
|
460
|
-
render(): JSX_2.Element | null;
|
|
461
|
-
private show;
|
|
462
|
-
private setPosition;
|
|
463
|
-
private onOpened;
|
|
464
|
-
private animate;
|
|
465
|
-
private handleMouseDown;
|
|
466
|
-
private onClosing;
|
|
467
|
-
private onClosed;
|
|
468
|
-
private get animationDuration();
|
|
469
|
-
private attachRepositionHandlers;
|
|
470
|
-
private detachRepositionHandlers;
|
|
471
|
-
private reposition;
|
|
472
|
-
private getCurrentZIndex;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
326
|
/**
|
|
476
327
|
* Represents the object of the `Position` Popup event.
|
|
477
328
|
*/
|
|
@@ -479,7 +330,7 @@ export declare interface PositionEvent {
|
|
|
479
330
|
/**
|
|
480
331
|
* An event target.
|
|
481
332
|
*/
|
|
482
|
-
target:
|
|
333
|
+
target: PopupHandle;
|
|
483
334
|
/**
|
|
484
335
|
* Indicates if the position is fitted.
|
|
485
336
|
*/
|
package/index.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./Popup.js");exports.Popup=o.Popup;exports.PopupPropsContext=o.PopupPropsContext;
|
package/index.mjs
CHANGED
|
@@ -6,10 +6,8 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import { Popup as
|
|
10
|
-
import { PopupWithoutContext as u } from "./PopupWithoutContext.mjs";
|
|
9
|
+
import { Popup as e, PopupPropsContext as t } from "./Popup.mjs";
|
|
11
10
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
u as PopupWithoutContext
|
|
11
|
+
e as Popup,
|
|
12
|
+
t as PopupPropsContext
|
|
15
13
|
};
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-popup",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1731417566,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-popup",
|
|
3
|
-
"version": "9.0.0
|
|
3
|
+
"version": "9.0.0",
|
|
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": "9.0.0
|
|
27
|
+
"@progress/kendo-react-common": "9.0.0",
|
|
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/PopupWithoutContext.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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 D=require("react"),_=require("react-dom"),e=require("prop-types"),T=require("./animation.js"),l=require("@progress/kendo-react-common"),i=require("@progress/kendo-popup-common"),b=require("./util.js"),E=require("./package-metadata.js");function A(h){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const t in h)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(h,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:()=>h[t]})}}return o.default=h,Object.freeze(o)}const O=A(D),N=A(_),M=100,x=1;function w(h,o){if(h===o)return!0;if(!!h!=!!o)return!1;const t=Object.getOwnPropertyNames(h),n=Object.getOwnPropertyNames(o);if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++){const s=t[r];if(h[s]!==o[s])return!1}return!0}const R={left:-1e3,top:0},y=class y extends O.Component{constructor(o){super(o),this.context=0,this.state={current:"hidden",previous:"hidden",props:{}},this._popup=null,this.show=t=>{window==null||window.addEventListener("mousedown",this.handleMouseDown),this.setPosition(t),this.animate(t.firstChild,"enter",this.onOpened),this.setState({current:"shown",previous:this.state.current})},this.setPosition=t=>{const{anchorAlign:n,popupAlign:r,collision:s,offset:c,anchor:a,margin:u,scale:d,positionMode:f}=this.props,{width:g,height:m}=t.style;t.style.width=t.offsetWidth+"px",t.style.height=t.offsetHeight+"px";const P=i.alignElement({anchor:a,anchorAlign:n,element:t,elementAlign:r,offset:c,margin:u,positionMode:f,scale:d}),p=i.positionElement({anchor:a,anchorAlign:n,element:t,elementAlign:r,collisions:s,currentLocation:P,margin:this.props.margin});if(t.style.top=p.offset.top+"px",t.style.left=p.offset.left+"px",t.style.width=g,t.style.height=m,this._collisions={fit:p.fit,fitted:p.fitted,flip:p.flip,flipped:p.flipped},this.props.onPosition){const C={target:this,flipped:p.flipped,fitted:p.fitted};this.props.onPosition.call(void 0,C)}},this.onOpened=()=>{const t=this._popup;if(t){if(this.props.show){const{unstyled:n}=this.props,r=n&&n.uPopup;t.classList.add(...l.classNames(l.uPopup.animationContainerShown({c:r})).split(" ").filter(s=>s))}this.attachRepositionHandlers(t),this.props.onOpen&&this.props.onOpen.call(void 0,{target:this})}},this.animate=(t,n,r)=>{if(!this.props.popupAlign)return;let s;const{horizontal:c,vertical:a}=this.props.popupAlign;c==="left"&&a==="center"?s="right":c==="right"&&a==="center"?s="left":a==="top"?s="down":s="up";const u={down:"up",up:"down",left:"right",right:"left"};this._collisions&&this._collisions.flipped&&(s=u[s]);const{unstyled:d}=this.props,f=d&&d.uPopup;T.slide(t,s,this.animationDuration[n],n,r,f)},this.handleMouseDown=t=>{var s,c;const n=((s=t==null?void 0:t.target)==null?void 0:s.closest(".k-animation-container"))===null,r=((c=this.props.anchor)==null?void 0:c.contains(t==null?void 0:t.target))||!1;if(n){if(this.props.onMouseDownOutside){const a={target:this,event:t,state:this.state,isAnchorClicked:r};this.props.onMouseDownOutside.call(void 0,a)}window==null||window.removeEventListener("mousedown",this.handleMouseDown)}},this.onClosing=t=>{if(!this.props.show){const{unstyled:n}=this.props,r=n&&n.uPopup;t.classList.remove(...l.classNames(l.uPopup.animationContainerShown({c:r})).split(" ").filter(s=>s))}this.detachRepositionHandlers()},this.onClosed=()=>{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})},this.getCurrentZIndex=()=>this.context?this.context+x:M,l.validatePackage(E.packageMetadata),this.reposition=b.throttle(this.reposition.bind(this),b.FRAME_DURATION)}get element(){return this._popup}static getDerivedStateFromProps(o,t){const{show:n,anchor:r,anchorAlign:s,appendTo:c,collision:a,popupAlign:u,className:d,popupClass:f,style:g,offset:m,contentKey:P}=o,p={...t,props:{show:n,anchor:r,anchorAlign:s,appendTo:c,collision:a,popupAlign:u,className:d,popupClass:f,style:g,offset:m,contentKey:P}};return o.show?t.current==="hidden"||t.current==="hiding"?{...p,current:"showing",previous:t.current}:t.current==="showing"?{...p,current:"shown",previous:t.current}:t.current==="shown"&&(!w(m,t.props.offset)||!w(s,t.props.anchorAlign)||!w(c,t.props.appendTo)||!w(a,t.props.collision)||!w(u,t.props.popupAlign)||!w(g,t.props.style)||r!==t.props.anchor||f!==t.props.popupClass||d!==t.props.className)?{...p,current:"reposition",previous:t.current}:p:t.current==="hiding"||t.current==="hidden"?{...p,current:"hidden",previous:t.current}:{...p,current:"hiding",previous:t.current}}componentDidUpdate(o){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(()=>{this.setState({current:"shown",previous:this.state.current})},0):this.state.current==="shown"&&o.contentKey!==this.props.contentKey&&this._popup&&this.setPosition(this._popup)}componentDidMount(){this.state.current==="showing"&&this._popup&&this.show(this._popup)}componentWillUnmount(){this.detachRepositionHandlers()}render(){const{children:o,className:t,popupClass:n,unstyled:r,show:s,id:c,positionMode:a}=this.props,u=r&&r.uPopup,d=this.props.appendTo?this.props.appendTo:l.canUseDOM?this.props.anchor&&this.props.anchor.ownerDocument?this.props.anchor.ownerDocument.body:document.body:void 0;this.state.current==="reposition"&&this.state.previous==="shown"&&this._popup&&this.setPosition(this._popup);const f=Object.assign({},{position:a,top:0,left:-1e4},this.props.style||{}),g=this.state.current==="hiding";if((s||g)&&d){const m=this.getCurrentZIndex(),P=O.createElement(l.ZIndexContext.Provider,{value:m},O.createElement("div",{onKeyDown:this.props.onKeyDown,className:l.classNames(l.uPopup.animationContainer({c:u}),t),id:c,ref:p=>this._popup=p,style:{zIndex:m,...f}},O.createElement("div",{className:l.classNames(l.uPopup.animationChild({c:u})),style:{transitionDelay:"0ms"}},O.createElement("div",{role:this.props.role,className:l.classNames(l.uPopup.popup({c:u}),n)},o))));return this.props.appendTo!==null?N.createPortal(P,d):P}return null}get animationDuration(){const o=this.props.animate;let t=0,n=0;return o&&(o===!0?t=n=300:(t=o.openDuration||0,n=o.closeDuration||0)),{enter:t,exit:n}}attachRepositionHandlers(o){this.detachRepositionHandlers(),this._scrollableParents=i.domUtils.scrollableParents(this.props.anchor||o),this._scrollableParents&&this._scrollableParents.map(t=>t.addEventListener("scroll",this.reposition)),window.addEventListener("resize",this.reposition)}detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(o=>o.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),window.removeEventListener("resize",this.reposition)}reposition(){this.setState({current:"reposition",previous:this.state.current})}};y.propTypes={anchor:function(o){const t=o.anchor;return t&&typeof t.nodeType!="number"?new Error("Invalid prop `anchor` supplied to `Kendo React Popup`. Validation failed."):null},appendTo:function(o){const t=o.appendTo;return t&&typeof t.nodeType!="number"?new Error("Invalid prop `appendTo` supplied to `Kendo React Popup`. Validation failed."):null},className:e.oneOfType([e.string,e.arrayOf(e.string),e.object]),id:e.string,popupClass:e.oneOfType([e.string,e.arrayOf(e.string),e.object]),collision:e.shape({horizontal:e.oneOf([i.Collision.fit,i.Collision.flip,i.Collision.none]),vertical:e.oneOf([i.Collision.fit,i.Collision.flip,i.Collision.none])}),anchorAlign:e.shape({horizontal:e.oneOf([i.AlignPoint.left,i.AlignPoint.center,i.AlignPoint.right]),vertical:e.oneOf([i.AlignPoint.top,i.AlignPoint.center,i.AlignPoint.bottom])}),popupAlign:e.shape({horizontal:e.oneOf([i.AlignPoint.left,i.AlignPoint.center,i.AlignPoint.right]),vertical:e.oneOf([i.AlignPoint.top,i.AlignPoint.center,i.AlignPoint.bottom])}),offset:e.shape({left:e.number,top:e.number}),children:e.oneOfType([e.element,e.node]),show:e.bool,animate:e.oneOfType([e.bool,e.shape({openDuration:e.number,closeDuration:e.number})]),margin:e.shape({horizontal:e.number,vertical:e.number}),positionMode:e.oneOf(["fixed","absolute"]),scale:e.number,style:e.object,onClose:e.func,onPosition:e.func,onOpen:e.func,onKeyPress:e.func,onMouseDownOutside:e.func},y.defaultProps={collision:{horizontal:i.Collision.fit,vertical:i.Collision.flip},anchorAlign:{horizontal:i.AlignPoint.left,vertical:i.AlignPoint.bottom},popupAlign:{horizontal:i.AlignPoint.left,vertical:i.AlignPoint.top},offset:R,animate:!0,show:!1,margin:{horizontal:0,vertical:0},positionMode:"absolute"},y.contextType=l.ZIndexContext,y.displayName="PopupComponent";let v=y;exports.PopupWithoutContext=v;
|