@sheinx/base 3.8.4-beta.7 → 3.8.4-beta.9

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":"tooltip.d.ts","sourceRoot":"","sources":["tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,QAAA,MAAM,OAAO,UAAW,YAAY,mDAgJnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,QAAA,MAAM,OAAO,UAAW,YAAY,mDA8JnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -122,6 +122,17 @@ var Tooltip = function Tooltip(props) {
122
122
  })
123
123
  })
124
124
  }) : children;
125
+ var innerProps = (0, _react.useMemo)(function () {
126
+ if (persistent) {
127
+ return trigger === 'hover' ? _objectSpread(_objectSpread({}, events), {}, {
128
+ onMouseEnter: undefined,
129
+ onMouseLeave: undefined
130
+ }) : _objectSpread(_objectSpread({}, events), {}, {
131
+ onClick: undefined
132
+ });
133
+ }
134
+ return events;
135
+ }, [persistent, events, trigger]);
125
136
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
126
137
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("noscript", {
127
138
  ref: function ref(el) {
@@ -131,7 +142,7 @@ var Tooltip = function Tooltip(props) {
131
142
  if (targetRef.current === targetEl) return;
132
143
  targetRef.current = targetEl;
133
144
  }
134
- }, 'ns'), /*#__PURE__*/(0, _react.cloneElement)(inner, events), /*#__PURE__*/(0, _jsxRuntime.jsx)(_absoluteList.default, {
145
+ }, 'ns'), /*#__PURE__*/(0, _react.cloneElement)(inner, innerProps), /*#__PURE__*/(0, _jsxRuntime.jsx)(_absoluteList.default, {
135
146
  focus: open,
136
147
  parentElRef: targetRef,
137
148
  popupElRef: popupRef,
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAA8B,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAS9E,QAAA,MAAM,YAAY,6EAyFjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAA8B,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAS9E,QAAA,MAAM,YAAY,6EA0FjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -91,6 +91,7 @@ var UploadButton = function UploadButton(props) {
91
91
  var uploading = process >= 0;
92
92
  var style = _defineProperty(_defineProperty({}, isRtl ? 'left' : 'right', uploading ? "".concat(100 - Math.min(99, process), "%") : '100%'), isRtl ? 'right' : 'left', 0);
93
93
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_upload.default, _objectSpread(_objectSpread(_objectSpread({}, props), innerProps), {}, {
94
+ limit: undefined,
94
95
  onProgress: onProgress,
95
96
  onStart: onStart,
96
97
  onSuccess: onSuccess,
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,QAAA,MAAM,OAAO,UAAW,YAAY,mDAgJnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,QAAA,MAAM,OAAO,UAAW,YAAY,mDA8JnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -12,7 +12,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { usePersistFn, usePopup, util } from '@sheinx/hooks';
14
14
  import classNames from 'classnames';
15
- import React, { cloneElement, isValidElement, useEffect } from 'react';
15
+ import React, { cloneElement, isValidElement, useEffect, useMemo } from 'react';
16
16
  import AbsoluteList from "../absolute-list";
17
17
  import { useConfig } from "../config";
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -115,6 +115,17 @@ var Tooltip = function Tooltip(props) {
115
115
  })
116
116
  })
117
117
  }) : children;
118
+ var innerProps = useMemo(function () {
119
+ if (persistent) {
120
+ return trigger === 'hover' ? _objectSpread(_objectSpread({}, events), {}, {
121
+ onMouseEnter: undefined,
122
+ onMouseLeave: undefined
123
+ }) : _objectSpread(_objectSpread({}, events), {}, {
124
+ onClick: undefined
125
+ });
126
+ }
127
+ return events;
128
+ }, [persistent, events, trigger]);
118
129
  return /*#__PURE__*/_jsxs(_Fragment, {
119
130
  children: [/*#__PURE__*/_jsx("noscript", {
120
131
  ref: function ref(el) {
@@ -124,7 +135,7 @@ var Tooltip = function Tooltip(props) {
124
135
  if (targetRef.current === targetEl) return;
125
136
  targetRef.current = targetEl;
126
137
  }
127
- }, 'ns'), /*#__PURE__*/cloneElement(inner, events), /*#__PURE__*/_jsx(AbsoluteList, {
138
+ }, 'ns'), /*#__PURE__*/cloneElement(inner, innerProps), /*#__PURE__*/_jsx(AbsoluteList, {
128
139
  focus: open,
129
140
  parentElRef: targetRef,
130
141
  popupElRef: popupRef,
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAA8B,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAS9E,QAAA,MAAM,YAAY,6EAyFjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAA8B,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAS9E,QAAA,MAAM,YAAY,6EA0FjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -83,6 +83,7 @@ var UploadButton = function UploadButton(props) {
83
83
  var uploading = process >= 0;
84
84
  var style = _defineProperty(_defineProperty({}, isRtl ? 'left' : 'right', uploading ? "".concat(100 - Math.min(99, process), "%") : '100%'), isRtl ? 'right' : 'left', 0);
85
85
  return /*#__PURE__*/_jsx(Upload, _objectSpread(_objectSpread(_objectSpread({}, props), innerProps), {}, {
86
+ limit: undefined,
86
87
  onProgress: onProgress,
87
88
  onStart: onStart,
88
89
  onSuccess: onSuccess,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.8.4-beta.7",
3
+ "version": "3.8.4-beta.9",
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.8.4-beta.7",
13
+ "@sheinx/hooks": "3.8.4-beta.9",
14
14
  "immer": "^10.0.0",
15
15
  "classnames": "^2.0.0",
16
16
  "@shined/reactive": "^0.1.3-alpha.0"