@rc-component/trigger 3.6.8 → 3.6.10

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,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { CSSMotionProps } from '@rc-component/motion';
3
- import type { AlignType } from '../interface';
3
+ import type { AlignType, ArrowPos } from '../interface';
4
4
  export interface UniqueBodyProps {
5
5
  prefixCls: string;
6
6
  isMobile: boolean;
@@ -11,6 +11,7 @@ export interface UniqueBodyProps {
11
11
  offsetB: number;
12
12
  offsetX: number;
13
13
  offsetY: number;
14
+ arrowPos?: ArrowPos;
14
15
  popupSize?: {
15
16
  width: number;
16
17
  height: number;
@@ -14,6 +14,7 @@ const UniqueBody = props => {
14
14
  offsetB,
15
15
  offsetX,
16
16
  offsetY,
17
+ arrowPos,
17
18
  popupSize,
18
19
  motion,
19
20
  uniqueBgClassName,
@@ -54,6 +55,8 @@ const UniqueBody = props => {
54
55
  return /*#__PURE__*/React.createElement("div", {
55
56
  className: cls,
56
57
  style: {
58
+ '--arrow-x': `${arrowPos?.x || 0}px`,
59
+ '--arrow-y': `${arrowPos?.y || 0}px`,
57
60
  ...offsetStyle,
58
61
  ...sizeStyle,
59
62
  ...motionStyle,
@@ -147,9 +147,13 @@ const UniqueProvider = ({
147
147
  offsetB: offsetB,
148
148
  offsetX: offsetX,
149
149
  offsetY: offsetY,
150
+ arrowPos: {
151
+ x: arrowX,
152
+ y: arrowY
153
+ },
150
154
  popupSize: popupSize,
151
155
  motion: options.popupMotion,
152
- uniqueBgClassName: options.uniqueBgClassName,
156
+ uniqueBgClassName: classNames(options.uniqueBgClassName, alignedClassName),
153
157
  uniqueBgStyle: options.uniqueBgStyle
154
158
  }))));
155
159
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { CSSMotionProps } from '@rc-component/motion';
3
- import type { AlignType } from '../interface';
3
+ import type { AlignType, ArrowPos } from '../interface';
4
4
  export interface UniqueBodyProps {
5
5
  prefixCls: string;
6
6
  isMobile: boolean;
@@ -11,6 +11,7 @@ export interface UniqueBodyProps {
11
11
  offsetB: number;
12
12
  offsetX: number;
13
13
  offsetY: number;
14
+ arrowPos?: ArrowPos;
14
15
  popupSize?: {
15
16
  width: number;
16
17
  height: number;
@@ -21,6 +21,7 @@ const UniqueBody = props => {
21
21
  offsetB,
22
22
  offsetX,
23
23
  offsetY,
24
+ arrowPos,
24
25
  popupSize,
25
26
  motion,
26
27
  uniqueBgClassName,
@@ -61,6 +62,8 @@ const UniqueBody = props => {
61
62
  return /*#__PURE__*/_react.default.createElement("div", {
62
63
  className: cls,
63
64
  style: {
65
+ '--arrow-x': `${arrowPos?.x || 0}px`,
66
+ '--arrow-y': `${arrowPos?.y || 0}px`,
64
67
  ...offsetStyle,
65
68
  ...sizeStyle,
66
69
  ...motionStyle,
@@ -156,9 +156,13 @@ const UniqueProvider = ({
156
156
  offsetB: offsetB,
157
157
  offsetX: offsetX,
158
158
  offsetY: offsetY,
159
+ arrowPos: {
160
+ x: arrowX,
161
+ y: arrowY
162
+ },
159
163
  popupSize: popupSize,
160
164
  motion: options.popupMotion,
161
- uniqueBgClassName: options.uniqueBgClassName,
165
+ uniqueBgClassName: (0, _classnames.default)(options.uniqueBgClassName, alignedClassName),
162
166
  uniqueBgStyle: options.uniqueBgStyle
163
167
  }))));
164
168
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/trigger",
3
- "version": "3.6.8",
3
+ "version": "3.6.10",
4
4
  "description": "base abstract trigger component for react",
5
5
  "engines": {
6
6
  "node": ">=8.x"