@rc-component/trigger 1.10.1 → 1.11.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.
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
2
  import type { AlignType, ArrowType } from '../interface';
3
3
  export interface ArrowProps {
4
4
  prefixCls: string;
5
5
  align: AlignType;
6
6
  arrow: ArrowType;
7
7
  }
8
- export default function Arrow(props: ArrowProps): JSX.Element;
8
+ export default function Arrow(props: ArrowProps): React.JSX.Element;
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
1
  import type { CSSMotionProps } from 'rc-motion';
2
+ import * as React from 'react';
3
3
  export interface MaskProps {
4
4
  prefixCls: string;
5
5
  open?: boolean;
@@ -7,4 +7,4 @@ export interface MaskProps {
7
7
  mask?: boolean;
8
8
  motion?: CSSMotionProps;
9
9
  }
10
- export default function Mask(props: MaskProps): JSX.Element;
10
+ export default function Mask(props: MaskProps): React.JSX.Element;
package/es/Popup/Mask.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import classNames from 'classnames';
3
3
  import CSSMotion from 'rc-motion';
4
+ import * as React from 'react';
4
5
  export default function Mask(props) {
5
6
  var prefixCls = props.prefixCls,
6
7
  open = props.open,
@@ -6,6 +6,22 @@ import useEvent from "rc-util/es/hooks/useEvent";
6
6
  import useLayoutEffect from "rc-util/es/hooks/useLayoutEffect";
7
7
  import * as React from 'react';
8
8
  import { collectScroller, getVisibleArea, getWin, toNum } from "../util";
9
+ function getUnitOffset(size) {
10
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
11
+ var offsetStr = "".concat(offset);
12
+ var cells = offsetStr.match(/^(.*)\%$/);
13
+ if (cells) {
14
+ return size * (parseFloat(cells[1]) / 100);
15
+ }
16
+ return parseFloat(offsetStr);
17
+ }
18
+ function getNumberOffset(rect, offset) {
19
+ var _ref = offset || [],
20
+ _ref2 = _slicedToArray(_ref, 2),
21
+ offsetX = _ref2[0],
22
+ offsetY = _ref2[1];
23
+ return [getUnitOffset(rect.width, offsetX), getUnitOffset(rect.height, offsetY)];
24
+ }
9
25
  function splitPoints() {
10
26
  var points = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
11
27
  return [points[0], points[1]];
@@ -167,26 +183,22 @@ export default function useAlign(open, popupEle, target, placement, builtinPlace
167
183
  // Offset
168
184
  var offset = placementInfo.offset,
169
185
  targetOffset = placementInfo.targetOffset;
170
- var _ref = offset || [],
171
- _ref2 = _slicedToArray(_ref, 2),
172
- _ref2$ = _ref2[0],
173
- popupOffsetX = _ref2$ === void 0 ? 0 : _ref2$,
174
- _ref2$2 = _ref2[1],
175
- popupOffsetY = _ref2$2 === void 0 ? 0 : _ref2$2;
176
- var _ref3 = targetOffset || [],
177
- _ref4 = _slicedToArray(_ref3, 2),
178
- _ref4$ = _ref4[0],
179
- targetOffsetX = _ref4$ === void 0 ? 0 : _ref4$,
180
- _ref4$2 = _ref4[1],
181
- targetOffsetY = _ref4$2 === void 0 ? 0 : _ref4$2;
182
- targetRect.x += targetOffsetX;
183
- targetRect.y += targetOffsetY;
186
+ var _getNumberOffset = getNumberOffset(popupRect, offset),
187
+ _getNumberOffset2 = _slicedToArray(_getNumberOffset, 2),
188
+ popupOffsetX = _getNumberOffset2[0],
189
+ popupOffsetY = _getNumberOffset2[1];
190
+ var _getNumberOffset3 = getNumberOffset(targetRect, targetOffset),
191
+ _getNumberOffset4 = _slicedToArray(_getNumberOffset3, 2),
192
+ targetOffsetX = _getNumberOffset4[0],
193
+ targetOffsetY = _getNumberOffset4[1];
194
+ targetRect.x -= targetOffsetX;
195
+ targetRect.y -= targetOffsetY;
184
196
 
185
197
  // Points
186
- var _ref5 = placementInfo.points || [],
187
- _ref6 = _slicedToArray(_ref5, 2),
188
- popupPoint = _ref6[0],
189
- targetPoint = _ref6[1];
198
+ var _ref3 = placementInfo.points || [],
199
+ _ref4 = _slicedToArray(_ref3, 2),
200
+ popupPoint = _ref4[0],
201
+ targetPoint = _ref4[1];
190
202
  var targetPoints = splitPoints(targetPoint);
191
203
  var popupPoints = splitPoints(popupPoint);
192
204
  var targetAlignPoint = getAlignPoint(targetRect, targetPoints);
package/es/interface.d.ts CHANGED
@@ -5,6 +5,7 @@ export declare type AlignPointTopBottom = 't' | 'b' | 'c';
5
5
  export declare type AlignPointLeftRight = 'l' | 'r' | 'c';
6
6
  /** Two char of 't' 'b' 'c' 'l' 'r'. Example: 'lt' */
7
7
  export declare type AlignPoint = `${AlignPointTopBottom}${AlignPointLeftRight}`;
8
+ export declare type OffsetType = number | `${number}%`;
8
9
  export interface AlignType {
9
10
  /**
10
11
  * move point of source node to align with point of target node.
@@ -15,12 +16,12 @@ export interface AlignType {
15
16
  * offset source node by offset[0] in x and offset[1] in y.
16
17
  * If offset contains percentage string value, it is relative to sourceNode region.
17
18
  */
18
- offset?: number[];
19
+ offset?: OffsetType[];
19
20
  /**
20
21
  * offset target node by offset[0] in x and offset[1] in y.
21
22
  * If targetOffset contains percentage string value, it is relative to targetNode region.
22
23
  */
23
- targetOffset?: number[];
24
+ targetOffset?: OffsetType[];
24
25
  /**
25
26
  * If adjustX field is true, will adjust source node in x direction if source node is invisible.
26
27
  * If adjustY field is true, will adjust source node in y direction if source node is invisible.
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import type { AlignType, ArrowType } from '../interface';
3
+ export interface ArrowProps {
4
+ prefixCls: string;
5
+ align: AlignType;
6
+ arrow: ArrowType;
7
+ }
8
+ export default function Arrow(props: ArrowProps): React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { CSSMotionProps } from 'rc-motion';
2
+ import * as React from 'react';
3
+ export interface MaskProps {
4
+ prefixCls: string;
5
+ open?: boolean;
6
+ zIndex?: number;
7
+ mask?: boolean;
8
+ motion?: CSSMotionProps;
9
+ }
10
+ export default function Mask(props: MaskProps): React.JSX.Element;
package/lib/Popup/Mask.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
@@ -8,6 +9,7 @@ exports.default = Mask;
8
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
10
  var _classnames = _interopRequireDefault(require("classnames"));
10
11
  var _rcMotion = _interopRequireDefault(require("rc-motion"));
12
+ var React = _interopRequireWildcard(require("react"));
11
13
  function Mask(props) {
12
14
  var prefixCls = props.prefixCls,
13
15
  open = props.open,
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ export interface PopupContentProps {
3
+ children?: React.ReactNode;
4
+ cache?: boolean;
5
+ }
6
+ declare const PopupContent: React.MemoExoticComponent<({ children }: PopupContentProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>>;
7
+ export default PopupContent;
@@ -0,0 +1,38 @@
1
+ import type { CSSMotionProps } from 'rc-motion';
2
+ import * as React from 'react';
3
+ import type { TriggerProps } from '../';
4
+ import type { AlignType, ArrowType } from '../interface';
5
+ export interface PopupProps {
6
+ prefixCls: string;
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ popup?: TriggerProps['popup'];
10
+ target: HTMLElement;
11
+ onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
12
+ onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
13
+ zIndex?: number;
14
+ mask?: boolean;
15
+ onVisibleChanged: (visible: boolean) => void;
16
+ align?: AlignType;
17
+ arrow?: ArrowType;
18
+ open: boolean;
19
+ /** Tell Portal that should keep in screen. e.g. should wait all motion end */
20
+ keepDom: boolean;
21
+ onClick?: React.MouseEventHandler<HTMLDivElement>;
22
+ motion?: CSSMotionProps;
23
+ maskMotion?: CSSMotionProps;
24
+ forceRender?: boolean;
25
+ getPopupContainer?: TriggerProps['getPopupContainer'];
26
+ autoDestroy?: boolean;
27
+ portal: React.ComponentType<any>;
28
+ ready: boolean;
29
+ offsetX: number;
30
+ offsetY: number;
31
+ onAlign: VoidFunction;
32
+ onPrepare: () => Promise<void>;
33
+ stretch?: string;
34
+ targetWidth?: number;
35
+ targetHeight?: number;
36
+ }
37
+ declare const Popup: React.ForwardRefExoticComponent<PopupProps & React.RefAttributes<HTMLDivElement>>;
38
+ export default Popup;
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import type { TriggerProps } from '.';
3
+ export interface TriggerWrapperProps {
4
+ getTriggerDOMNode?: TriggerProps['getTriggerDOMNode'];
5
+ children: React.ReactElement;
6
+ }
7
+ declare const TriggerWrapper: React.ForwardRefExoticComponent<TriggerWrapperProps & React.RefAttributes<HTMLElement>>;
8
+ export default TriggerWrapper;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export interface TriggerContextProps {
3
+ registerSubPopup: (id: string, node: HTMLElement) => void;
4
+ }
5
+ declare const TriggerContext: React.Context<TriggerContextProps>;
6
+ export default TriggerContext;
@@ -0,0 +1,4 @@
1
+ import type { ActionType } from '../interface';
2
+ declare type ActionTypes = ActionType | ActionType[];
3
+ export default function useAction(mobile: boolean, action: ActionTypes, showAction?: ActionTypes, hideAction?: ActionTypes): [showAction: Set<ActionType>, hideAction: Set<ActionType>];
4
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { TriggerProps } from '..';
2
+ import type { AlignType } from '../interface';
3
+ export default function useAlign(open: boolean, popupEle: HTMLElement, target: HTMLElement | [x: number, y: number], placement: string, builtinPlacements: any, popupAlign?: AlignType, onPopupAlign?: TriggerProps['onPopupAlign']): [
4
+ ready: boolean,
5
+ offsetX: number,
6
+ offsetY: number,
7
+ arrowX: number,
8
+ arrowY: number,
9
+ scaleX: number,
10
+ scaleY: number,
11
+ align: AlignType,
12
+ onAlign: VoidFunction
13
+ ];
@@ -14,6 +14,22 @@ var _useEvent = _interopRequireDefault(require("rc-util/lib/hooks/useEvent"));
14
14
  var _useLayoutEffect = _interopRequireDefault(require("rc-util/lib/hooks/useLayoutEffect"));
15
15
  var React = _interopRequireWildcard(require("react"));
16
16
  var _util = require("../util");
17
+ function getUnitOffset(size) {
18
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
19
+ var offsetStr = "".concat(offset);
20
+ var cells = offsetStr.match(/^(.*)\%$/);
21
+ if (cells) {
22
+ return size * (parseFloat(cells[1]) / 100);
23
+ }
24
+ return parseFloat(offsetStr);
25
+ }
26
+ function getNumberOffset(rect, offset) {
27
+ var _ref = offset || [],
28
+ _ref2 = (0, _slicedToArray2.default)(_ref, 2),
29
+ offsetX = _ref2[0],
30
+ offsetY = _ref2[1];
31
+ return [getUnitOffset(rect.width, offsetX), getUnitOffset(rect.height, offsetY)];
32
+ }
17
33
  function splitPoints() {
18
34
  var points = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
19
35
  return [points[0], points[1]];
@@ -175,26 +191,22 @@ function useAlign(open, popupEle, target, placement, builtinPlacements, popupAli
175
191
  // Offset
176
192
  var offset = placementInfo.offset,
177
193
  targetOffset = placementInfo.targetOffset;
178
- var _ref = offset || [],
179
- _ref2 = (0, _slicedToArray2.default)(_ref, 2),
180
- _ref2$ = _ref2[0],
181
- popupOffsetX = _ref2$ === void 0 ? 0 : _ref2$,
182
- _ref2$2 = _ref2[1],
183
- popupOffsetY = _ref2$2 === void 0 ? 0 : _ref2$2;
184
- var _ref3 = targetOffset || [],
185
- _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
186
- _ref4$ = _ref4[0],
187
- targetOffsetX = _ref4$ === void 0 ? 0 : _ref4$,
188
- _ref4$2 = _ref4[1],
189
- targetOffsetY = _ref4$2 === void 0 ? 0 : _ref4$2;
190
- targetRect.x += targetOffsetX;
191
- targetRect.y += targetOffsetY;
194
+ var _getNumberOffset = getNumberOffset(popupRect, offset),
195
+ _getNumberOffset2 = (0, _slicedToArray2.default)(_getNumberOffset, 2),
196
+ popupOffsetX = _getNumberOffset2[0],
197
+ popupOffsetY = _getNumberOffset2[1];
198
+ var _getNumberOffset3 = getNumberOffset(targetRect, targetOffset),
199
+ _getNumberOffset4 = (0, _slicedToArray2.default)(_getNumberOffset3, 2),
200
+ targetOffsetX = _getNumberOffset4[0],
201
+ targetOffsetY = _getNumberOffset4[1];
202
+ targetRect.x -= targetOffsetX;
203
+ targetRect.y -= targetOffsetY;
192
204
 
193
205
  // Points
194
- var _ref5 = placementInfo.points || [],
195
- _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
196
- popupPoint = _ref6[0],
197
- targetPoint = _ref6[1];
206
+ var _ref3 = placementInfo.points || [],
207
+ _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
208
+ popupPoint = _ref4[0],
209
+ targetPoint = _ref4[1];
198
210
  var targetPoints = splitPoints(targetPoint);
199
211
  var popupPoints = splitPoints(popupPoint);
200
212
  var targetAlignPoint = getAlignPoint(targetRect, targetPoints);
@@ -0,0 +1 @@
1
+ export default function useWatch(open: boolean, target: HTMLElement, popup: HTMLElement, onAlign: VoidFunction): void;
package/lib/index.d.ts ADDED
@@ -0,0 +1,64 @@
1
+ import type { CSSMotionProps } from 'rc-motion';
2
+ import * as React from 'react';
3
+ import type { ActionType, AlignType, AnimationType, ArrowTypeOuter, BuildInPlacements, TransitionNameType } from './interface';
4
+ export type { BuildInPlacements, AlignType, ActionType, ArrowTypeOuter as ArrowType, };
5
+ export interface TriggerRef {
6
+ forceAlign: VoidFunction;
7
+ }
8
+ export interface TriggerProps {
9
+ children: React.ReactElement;
10
+ action?: ActionType | ActionType[];
11
+ showAction?: ActionType[];
12
+ hideAction?: ActionType[];
13
+ prefixCls?: string;
14
+ zIndex?: number;
15
+ onPopupAlign?: (element: HTMLElement, align: AlignType) => void;
16
+ stretch?: string;
17
+ popupVisible?: boolean;
18
+ defaultPopupVisible?: boolean;
19
+ onPopupVisibleChange?: (visible: boolean) => void;
20
+ afterPopupVisibleChange?: (visible: boolean) => void;
21
+ getPopupContainer?: (node: HTMLElement) => HTMLElement;
22
+ forceRender?: boolean;
23
+ autoDestroy?: boolean;
24
+ /** @deprecated Please use `autoDestroy` instead */
25
+ destroyPopupOnHide?: boolean;
26
+ mask?: boolean;
27
+ maskClosable?: boolean;
28
+ /** Set popup motion. You can ref `rc-motion` for more info. */
29
+ popupMotion?: CSSMotionProps;
30
+ /** Set mask motion. You can ref `rc-motion` for more info. */
31
+ maskMotion?: CSSMotionProps;
32
+ /** @deprecated Please us `popupMotion` instead. */
33
+ popupTransitionName?: TransitionNameType;
34
+ /** @deprecated Please us `popupMotion` instead. */
35
+ popupAnimation?: AnimationType;
36
+ /** @deprecated Please us `maskMotion` instead. */
37
+ maskTransitionName?: TransitionNameType;
38
+ /** @deprecated Please us `maskMotion` instead. */
39
+ maskAnimation?: AnimationType;
40
+ mouseEnterDelay?: number;
41
+ mouseLeaveDelay?: number;
42
+ focusDelay?: number;
43
+ blurDelay?: number;
44
+ popup: React.ReactNode | (() => React.ReactNode);
45
+ popupPlacement?: string;
46
+ builtinPlacements?: BuildInPlacements;
47
+ popupAlign?: AlignType;
48
+ popupClassName?: string;
49
+ popupStyle?: React.CSSProperties;
50
+ getPopupClassNameFromAlign?: (align: AlignType) => string;
51
+ onPopupClick?: React.MouseEventHandler<HTMLDivElement>;
52
+ alignPoint?: boolean;
53
+ arrow?: boolean | ArrowTypeOuter;
54
+ /** @deprecated Add `className` on `children`. Please add `className` directly instead. */
55
+ className?: string;
56
+ /**
57
+ * @private Get trigger DOM node.
58
+ * Used for some component is function component which can not access by `findDOMNode`
59
+ */
60
+ getTriggerDOMNode?: (node: React.ReactInstance) => HTMLElement;
61
+ }
62
+ export declare function generateTrigger(PortalComponent?: React.ComponentType<any>): React.ForwardRefExoticComponent<TriggerProps & React.RefAttributes<TriggerRef>>;
63
+ declare const _default: React.ForwardRefExoticComponent<TriggerProps & React.RefAttributes<TriggerRef>>;
64
+ export default _default;
@@ -0,0 +1,83 @@
1
+ /// <reference types="react" />
2
+ import type { CSSMotionProps } from 'rc-motion';
3
+ export declare type Placement = 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
4
+ export declare type AlignPointTopBottom = 't' | 'b' | 'c';
5
+ export declare type AlignPointLeftRight = 'l' | 'r' | 'c';
6
+ /** Two char of 't' 'b' 'c' 'l' 'r'. Example: 'lt' */
7
+ export declare type AlignPoint = `${AlignPointTopBottom}${AlignPointLeftRight}`;
8
+ export declare type OffsetType = number | `${number}%`;
9
+ export interface AlignType {
10
+ /**
11
+ * move point of source node to align with point of target node.
12
+ * Such as ['tr','cc'], align top right point of source node with center point of target node.
13
+ * Point can be 't'(top), 'b'(bottom), 'c'(center), 'l'(left), 'r'(right) */
14
+ points?: (string | AlignPoint)[];
15
+ /**
16
+ * offset source node by offset[0] in x and offset[1] in y.
17
+ * If offset contains percentage string value, it is relative to sourceNode region.
18
+ */
19
+ offset?: OffsetType[];
20
+ /**
21
+ * offset target node by offset[0] in x and offset[1] in y.
22
+ * If targetOffset contains percentage string value, it is relative to targetNode region.
23
+ */
24
+ targetOffset?: OffsetType[];
25
+ /**
26
+ * If adjustX field is true, will adjust source node in x direction if source node is invisible.
27
+ * If adjustY field is true, will adjust source node in y direction if source node is invisible.
28
+ */
29
+ overflow?: {
30
+ adjustX?: boolean | number;
31
+ adjustY?: boolean | number;
32
+ shiftX?: boolean | number;
33
+ shiftY?: boolean | number;
34
+ };
35
+ /** Auto adjust arrow position */
36
+ autoArrow?: boolean;
37
+ /**
38
+ * Config visible region check of html node. Default `visible`:
39
+ * - `visible`: The visible region of user browser window. Use `clientHeight` for check.
40
+ * - `scroll`: The whole region of the html scroll area. Use `scrollHeight` for check.
41
+ */
42
+ htmlRegion?: 'visible' | 'scroll';
43
+ /**
44
+ * Whether use css right instead of left to position
45
+ */
46
+ useCssRight?: boolean;
47
+ /**
48
+ * Whether use css bottom instead of top to position
49
+ */
50
+ useCssBottom?: boolean;
51
+ /**
52
+ * Whether use css transform instead of left/top/right/bottom to position if browser supports.
53
+ * Defaults to false.
54
+ */
55
+ useCssTransform?: boolean;
56
+ ignoreShake?: boolean;
57
+ }
58
+ export interface ArrowTypeOuter {
59
+ className?: string;
60
+ }
61
+ export declare type ArrowType = ArrowTypeOuter & {
62
+ x?: number;
63
+ y?: number;
64
+ };
65
+ export declare type BuildInPlacements = Record<string, AlignType>;
66
+ export declare type StretchType = string;
67
+ export declare type ActionType = 'hover' | 'focus' | 'click' | 'contextMenu';
68
+ export declare type AnimationType = string;
69
+ export declare type TransitionNameType = string;
70
+ export interface Point {
71
+ pageX: number;
72
+ pageY: number;
73
+ }
74
+ export interface CommonEventHandler {
75
+ remove: () => void;
76
+ }
77
+ export interface MobileConfig {
78
+ /** Set popup motion. You can ref `rc-motion` for more info. */
79
+ popupMotion?: CSSMotionProps;
80
+ popupClassName?: string;
81
+ popupStyle?: React.CSSProperties;
82
+ popupRender?: (originNode: React.ReactNode) => React.ReactNode;
83
+ }
package/lib/mock.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const _default: React.ForwardRefExoticComponent<import("./index").TriggerProps & React.RefAttributes<import("./index").TriggerRef>>;
3
+ export default _default;
package/lib/util.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ import type { CSSMotionProps } from 'rc-motion';
2
+ import type { AlignType, AnimationType, BuildInPlacements, TransitionNameType } from './interface';
3
+ export declare function getAlignPopupClassName(builtinPlacements: BuildInPlacements, prefixCls: string, align: AlignType, isAlignPoint: boolean): string;
4
+ /** @deprecated We should not use this if we can refactor all deps */
5
+ export declare function getMotion(prefixCls: string, motion: CSSMotionProps, animation: AnimationType, transitionName: TransitionNameType): CSSMotionProps;
6
+ export declare function getWin(ele: HTMLElement): Window & typeof globalThis;
7
+ /**
8
+ * Get all the scrollable parent elements of the element
9
+ * @param ele The element to be detected
10
+ * @param areaOnly Only return the parent which will cut visible area
11
+ */
12
+ export declare function collectScroller(ele: HTMLElement): HTMLElement[];
13
+ export declare function toNum(num: number): number;
14
+ export interface VisibleArea {
15
+ left: number;
16
+ top: number;
17
+ right: number;
18
+ bottom: number;
19
+ }
20
+ export declare function getVisibleArea(initArea: VisibleArea, scrollerList?: HTMLElement[]): {
21
+ left: number;
22
+ top: number;
23
+ right: number;
24
+ bottom: number;
25
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/trigger",
3
- "version": "1.10.1",
3
+ "version": "1.11.0",
4
4
  "description": "base abstract trigger component for react",
5
5
  "engines": {
6
6
  "node": ">=8.x"