Skip to content

Commit ef77b96

Browse files
authored
chore: move to official api (#422)
1 parent 471a79f commit ef77b96

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

src/Popup/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,9 @@ const Popup = React.forwardRef<HTMLDivElement, PopupProps>((props, ref) => {
153153

154154
// Set align style
155155
if (ready || !open) {
156-
const { points, _experimental } = align;
157-
const dynamicInset = _experimental?.dynamicInset;
156+
const { points } = align;
157+
const dynamicInset =
158+
align.dynamicInset || (align as any)._experimental?.dynamicInset;
158159
const alignRight = dynamicInset && points[0][1] === 'r';
159160
const alignBottom = dynamicInset && points[0][0] === 'b';
160161

src/interface.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ export interface AlignType {
2929
* Point can be 't'(top), 'b'(bottom), 'c'(center), 'l'(left), 'r'(right) */
3030
points?: (string | AlignPoint)[];
3131

32-
/**
33-
* @private Do not use in your production code
34-
*/
35-
_experimental?: {
36-
/**
37-
* @private Do not use in your production code. Auto adjust align logic
38-
*/
39-
dynamicInset?: boolean;
40-
};
41-
4232
/**
4333
* offset source node by offset[0] in x and offset[1] in y.
4434
* If offset contains percentage string value, it is relative to sourceNode region.
@@ -74,6 +64,11 @@ export interface AlignType {
7464
* Similar to `visible`, but if `visible` region not satisfy, fallback to `scroll`.
7565
*/
7666
htmlRegion?: 'visible' | 'scroll' | 'visibleFirst';
67+
68+
/**
69+
* Auto chose position with `top` or `bottom` by the align result
70+
*/
71+
dynamicInset?: boolean;
7772
/**
7873
* Whether use css right instead of left to position
7974
*/

0 commit comments

Comments
 (0)