@rc-component/trigger 1.8.0 → 1.9.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.
@@ -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,11 @@
1
+ import * as React from 'react';
2
+ var PopupContent = /*#__PURE__*/React.memo(function (_ref) {
3
+ var children = _ref.children;
4
+ return children;
5
+ }, function (_, next) {
6
+ return next.cache;
7
+ });
8
+ if (process.env.NODE_ENV !== 'production') {
9
+ PopupContent.displayName = 'PopupContent';
10
+ }
11
+ export default PopupContent;
package/es/Popup/index.js CHANGED
@@ -9,6 +9,7 @@ import { composeRef } from "rc-util/es/ref";
9
9
  import * as React from 'react';
10
10
  import Arrow from "./Arrow";
11
11
  import Mask from "./Mask";
12
+ import PopupContent from "./PopupContent";
12
13
  var Popup = /*#__PURE__*/React.forwardRef(function (props, ref) {
13
14
  var popup = props.popup,
14
15
  className = props.className,
@@ -142,7 +143,9 @@ var Popup = /*#__PURE__*/React.forwardRef(function (props, ref) {
142
143
  align: align,
143
144
  arrowX: arrowX,
144
145
  arrowY: arrowY
145
- }), childNode);
146
+ }), /*#__PURE__*/React.createElement(PopupContent, {
147
+ cache: !open
148
+ }, childNode));
146
149
  });
147
150
  }));
148
151
  });
@@ -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,19 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var React = _interopRequireWildcard(require("react"));
9
+ var PopupContent = /*#__PURE__*/React.memo(function (_ref) {
10
+ var children = _ref.children;
11
+ return children;
12
+ }, function (_, next) {
13
+ return next.cache;
14
+ });
15
+ if (process.env.NODE_ENV !== 'production') {
16
+ PopupContent.displayName = 'PopupContent';
17
+ }
18
+ var _default = PopupContent;
19
+ exports.default = _default;
@@ -17,6 +17,7 @@ var _ref2 = require("rc-util/lib/ref");
17
17
  var React = _interopRequireWildcard(require("react"));
18
18
  var _Arrow = _interopRequireDefault(require("./Arrow"));
19
19
  var _Mask = _interopRequireDefault(require("./Mask"));
20
+ var _PopupContent = _interopRequireDefault(require("./PopupContent"));
20
21
  var Popup = /*#__PURE__*/React.forwardRef(function (props, ref) {
21
22
  var popup = props.popup,
22
23
  className = props.className,
@@ -150,7 +151,9 @@ var Popup = /*#__PURE__*/React.forwardRef(function (props, ref) {
150
151
  align: align,
151
152
  arrowX: arrowX,
152
153
  arrowY: arrowY
153
- }), childNode);
154
+ }), /*#__PURE__*/React.createElement(_PopupContent.default, {
155
+ cache: !open
156
+ }, childNode));
154
157
  });
155
158
  }));
156
159
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/trigger",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "base abstract trigger component for react",
5
5
  "engines": {
6
6
  "node": ">=8.x"