@rc-component/trigger 1.15.6 → 1.16.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/es/Popup/index.js CHANGED
@@ -79,9 +79,9 @@ var Popup = /*#__PURE__*/React.forwardRef(function (props, ref) {
79
79
 
80
80
  // Set align style
81
81
  if (ready || !open) {
82
- var points = align.points,
83
- _experimental = align._experimental;
84
- var dynamicInset = _experimental === null || _experimental === void 0 ? void 0 : _experimental.dynamicInset;
82
+ var _experimental;
83
+ var points = align.points;
84
+ var dynamicInset = align.dynamicInset || ((_experimental = align._experimental) === null || _experimental === void 0 ? void 0 : _experimental.dynamicInset);
85
85
  var alignRight = dynamicInset && points[0][1] === 'r';
86
86
  var alignBottom = dynamicInset && points[0][0] === 'b';
87
87
  if (alignRight) {
package/es/interface.d.ts CHANGED
@@ -12,15 +12,6 @@ export interface AlignType {
12
12
  * Such as ['tr','cc'], align top right point of source node with center point of target node.
13
13
  * Point can be 't'(top), 'b'(bottom), 'c'(center), 'l'(left), 'r'(right) */
14
14
  points?: (string | AlignPoint)[];
15
- /**
16
- * @private Do not use in your production code
17
- */
18
- _experimental?: {
19
- /**
20
- * @private Do not use in your production code. Auto adjust align logic
21
- */
22
- dynamicInset?: boolean;
23
- };
24
15
  /**
25
16
  * offset source node by offset[0] in x and offset[1] in y.
26
17
  * If offset contains percentage string value, it is relative to sourceNode region.
@@ -56,6 +47,10 @@ export interface AlignType {
56
47
  * Similar to `visible`, but if `visible` region not satisfy, fallback to `scroll`.
57
48
  */
58
49
  htmlRegion?: 'visible' | 'scroll' | 'visibleFirst';
50
+ /**
51
+ * Auto chose position with `top` or `bottom` by the align result
52
+ */
53
+ dynamicInset?: boolean;
59
54
  /**
60
55
  * Whether use css right instead of left to position
61
56
  */
@@ -87,9 +87,9 @@ var Popup = /*#__PURE__*/React.forwardRef(function (props, ref) {
87
87
 
88
88
  // Set align style
89
89
  if (ready || !open) {
90
- var points = align.points,
91
- _experimental = align._experimental;
92
- var dynamicInset = _experimental === null || _experimental === void 0 ? void 0 : _experimental.dynamicInset;
90
+ var _experimental;
91
+ var points = align.points;
92
+ var dynamicInset = align.dynamicInset || ((_experimental = align._experimental) === null || _experimental === void 0 ? void 0 : _experimental.dynamicInset);
93
93
  var alignRight = dynamicInset && points[0][1] === 'r';
94
94
  var alignBottom = dynamicInset && points[0][0] === 'b';
95
95
  if (alignRight) {
@@ -12,15 +12,6 @@ export interface AlignType {
12
12
  * Such as ['tr','cc'], align top right point of source node with center point of target node.
13
13
  * Point can be 't'(top), 'b'(bottom), 'c'(center), 'l'(left), 'r'(right) */
14
14
  points?: (string | AlignPoint)[];
15
- /**
16
- * @private Do not use in your production code
17
- */
18
- _experimental?: {
19
- /**
20
- * @private Do not use in your production code. Auto adjust align logic
21
- */
22
- dynamicInset?: boolean;
23
- };
24
15
  /**
25
16
  * offset source node by offset[0] in x and offset[1] in y.
26
17
  * If offset contains percentage string value, it is relative to sourceNode region.
@@ -56,6 +47,10 @@ export interface AlignType {
56
47
  * Similar to `visible`, but if `visible` region not satisfy, fallback to `scroll`.
57
48
  */
58
49
  htmlRegion?: 'visible' | 'scroll' | 'visibleFirst';
50
+ /**
51
+ * Auto chose position with `top` or `bottom` by the align result
52
+ */
53
+ dynamicInset?: boolean;
59
54
  /**
60
55
  * Whether use css right instead of left to position
61
56
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/trigger",
3
- "version": "1.15.6",
3
+ "version": "1.16.0",
4
4
  "description": "base abstract trigger component for react",
5
5
  "engines": {
6
6
  "node": ">=8.x"