@sheinx/base 3.7.9-beta.5 → 3.7.9-beta.6

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 +1 @@
1
- {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["popover.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C,QAAA,MAAM,OAAO,UAAW,YAAY,wDA+LnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["popover.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C,QAAA,MAAM,OAAO,UAAW,YAAY,wDAqMnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -47,7 +47,8 @@ var Popover = function Popover(props) {
47
47
  _props$zIndex = props.zIndex,
48
48
  zIndex = _props$zIndex === void 0 ? 1060 : _props$zIndex;
49
49
  var _React$useRef = _react.default.useRef({
50
- rendered: false
50
+ rendered: false,
51
+ hasOpened: false
51
52
  }),
52
53
  context = _React$useRef.current;
53
54
  var config = (0, _config.useConfig)();
@@ -161,7 +162,14 @@ var Popover = function Popover(props) {
161
162
  });
162
163
  }
163
164
  context.rendered = true;
164
- var childrened = _hooks.util.isFunc(children) ? children(closePop) : children;
165
+
166
+ // Track if popover has ever been opened
167
+ if (open && !context.hasOpened) {
168
+ context.hasOpened = true;
169
+ }
170
+
171
+ // Only execute functional children after popover has been opened at least once
172
+ var childrened = _hooks.util.isFunc(children) ? context.hasOpened ? children(closePop) : null : children;
165
173
  var containerStyle = {
166
174
  borderColor: props.border,
167
175
  backgroundColor: props.background
@@ -1 +1 @@
1
- {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["popover.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C,QAAA,MAAM,OAAO,UAAW,YAAY,wDA+LnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["popover.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C,QAAA,MAAM,OAAO,UAAW,YAAY,wDAqMnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -39,7 +39,8 @@ var Popover = function Popover(props) {
39
39
  _props$zIndex = props.zIndex,
40
40
  zIndex = _props$zIndex === void 0 ? 1060 : _props$zIndex;
41
41
  var _React$useRef = React.useRef({
42
- rendered: false
42
+ rendered: false,
43
+ hasOpened: false
43
44
  }),
44
45
  context = _React$useRef.current;
45
46
  var config = useConfig();
@@ -153,7 +154,14 @@ var Popover = function Popover(props) {
153
154
  });
154
155
  }
155
156
  context.rendered = true;
156
- var childrened = util.isFunc(children) ? children(closePop) : children;
157
+
158
+ // Track if popover has ever been opened
159
+ if (open && !context.hasOpened) {
160
+ context.hasOpened = true;
161
+ }
162
+
163
+ // Only execute functional children after popover has been opened at least once
164
+ var childrened = util.isFunc(children) ? context.hasOpened ? children(closePop) : null : children;
157
165
  var containerStyle = {
158
166
  borderColor: props.border,
159
167
  backgroundColor: props.background
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.7.9-beta.5",
3
+ "version": "3.7.9-beta.6",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -10,7 +10,7 @@
10
10
  "module": "./esm/index.js",
11
11
  "typings": "./cjs/index.d.ts",
12
12
  "dependencies": {
13
- "@sheinx/hooks": "3.7.9-beta.5",
13
+ "@sheinx/hooks": "3.7.9-beta.6",
14
14
  "immer": "^10.0.0",
15
15
  "classnames": "^2.0.0",
16
16
  "@shined/reactive": "^0.1.3-alpha.0"