@sheinx/base 3.10.0-beta.14 → 3.10.0-beta.16

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":"tab.d.ts","sourceRoot":"","sources":["tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;;AAsItC,wBAAqC"}
1
+ {"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;;AAwItC,wBAAqC"}
package/cjs/tabs/tab.js CHANGED
@@ -10,8 +10,11 @@ var _button = _interopRequireDefault(require("../button"));
10
10
  var _config = require("../config");
11
11
  var _hooks = require("@sheinx/hooks");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
+ var _excluded = ["ref"];
13
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
15
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
16
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
17
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
15
18
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
19
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
20
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -100,13 +103,16 @@ var Tab = function Tab(props, _ref) {
100
103
  dir: config.direction
101
104
  });
102
105
  if (shape === 'button') {
106
+ var buttonRef = containerProps.ref,
107
+ restContainerProps = _objectWithoutProperties(containerProps, _excluded);
103
108
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.default, _objectSpread(_objectSpread({
104
109
  jssStyle: {
105
110
  button: buttonStyle
106
111
  },
107
112
  disabled: disabled,
108
113
  type: isActive ? 'primary' : 'secondary'
109
- }, containerProps), {}, {
114
+ }, restContainerProps), {}, {
115
+ onRef: buttonRef,
110
116
  children: tab
111
117
  }));
112
118
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tabs-header.d.ts","sourceRoot":"","sources":["tabs-header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAwBrD,QAAA,MAAM,UAAU,UAAW,eAAe,4CA6SzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"tabs-header.d.ts","sourceRoot":"","sources":["tabs-header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAwBrD,QAAA,MAAM,UAAU,UAAW,eAAe,4CAqTzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -232,7 +232,11 @@ var TabsHeader = function TabsHeader(props) {
232
232
  buttonGroup: buttonGroupStyle
233
233
  },
234
234
  children: tabs.map(function (tab, index) {
235
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_tab.default, _objectSpread({}, tab), index);
235
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_tab.default, _objectSpread(_objectSpread({}, tab), {}, {
236
+ ref: function ref(node) {
237
+ tabRef.current[tab.id] = node;
238
+ }
239
+ }), index);
236
240
  })
237
241
  }), shape !== 'button' && tabs.map(function (tab, index) {
238
242
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_tab.default, _objectSpread(_objectSpread({}, tab), {}, {
@@ -1 +1 @@
1
- {"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;;AAsItC,wBAAqC"}
1
+ {"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;;AAwItC,wBAAqC"}
package/esm/tabs/tab.js CHANGED
@@ -1,4 +1,7 @@
1
+ var _excluded = ["ref"];
1
2
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
2
5
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
7
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -95,13 +98,16 @@ var Tab = function Tab(props, _ref) {
95
98
  dir: config.direction
96
99
  });
97
100
  if (shape === 'button') {
101
+ var buttonRef = containerProps.ref,
102
+ restContainerProps = _objectWithoutProperties(containerProps, _excluded);
98
103
  return /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
99
104
  jssStyle: {
100
105
  button: buttonStyle
101
106
  },
102
107
  disabled: disabled,
103
108
  type: isActive ? 'primary' : 'secondary'
104
- }, containerProps), {}, {
109
+ }, restContainerProps), {}, {
110
+ onRef: buttonRef,
105
111
  children: tab
106
112
  }));
107
113
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tabs-header.d.ts","sourceRoot":"","sources":["tabs-header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAwBrD,QAAA,MAAM,UAAU,UAAW,eAAe,4CA6SzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"tabs-header.d.ts","sourceRoot":"","sources":["tabs-header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAwBrD,QAAA,MAAM,UAAU,UAAW,eAAe,4CAqTzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -226,7 +226,11 @@ var TabsHeader = function TabsHeader(props) {
226
226
  buttonGroup: buttonGroupStyle
227
227
  },
228
228
  children: tabs.map(function (tab, index) {
229
- return /*#__PURE__*/_jsx(Tab, _objectSpread({}, tab), index);
229
+ return /*#__PURE__*/_jsx(Tab, _objectSpread(_objectSpread({}, tab), {}, {
230
+ ref: function ref(node) {
231
+ tabRef.current[tab.id] = node;
232
+ }
233
+ }), index);
230
234
  })
231
235
  }), shape !== 'button' && tabs.map(function (tab, index) {
232
236
  return /*#__PURE__*/_jsx(Tab, _objectSpread(_objectSpread({}, tab), {}, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.10.0-beta.14",
3
+ "version": "3.10.0-beta.16",
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.10.0-beta.14",
13
+ "@sheinx/hooks": "3.10.0-beta.16",
14
14
  "immer": "^10.0.0",
15
15
  "classnames": "^2.0.0",
16
16
  "@shined/reactive": "^0.3.3"