shineout 3.5.5-beta.5 → 3.5.5-beta.7

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/cjs/index.js CHANGED
@@ -507,5 +507,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
507
507
  // 此文件由脚本自动生成,请勿直接修改。
508
508
  // This file was generated automatically by a script. Please do not modify it directly.
509
509
  var _default = exports.default = {
510
- version: '3.5.5-beta.5'
510
+ version: '3.5.5-beta.7'
511
511
  };
@@ -3,4 +3,4 @@ import { TabsPanelProps as UnStyleTabsPanelProps } from '@sheinx/base';
3
3
  * @title Tabs.Panel
4
4
  * @sort 2
5
5
  */
6
- export type TabsPanelProps = Omit<UnStyleTabsPanelProps, 'jssStyle' | 'active' | 'shape' | 'isVertical' | 'lazy' | 'inactiveBackground' | 'onChange' | 'onCollapsible' | 'setTabs' | 'tabs'>;
6
+ export type TabsPanelProps = Omit<UnStyleTabsPanelProps, 'jssStyle' | 'active' | 'shape' | 'isVertical' | 'lazy' | 'inactiveBackground' | 'onChange' | 'onCollapsible' | 'setTabs' | 'tabs' | 'index'>;
package/dist/shineout.js CHANGED
@@ -12040,7 +12040,7 @@ var handleStyle = function handleStyle(style) {
12040
12040
  };
12041
12041
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12042
12042
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12043
- /* harmony default export */ var version = ('3.5.5-beta.5');
12043
+ /* harmony default export */ var version = ('3.5.5-beta.7');
12044
12044
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12045
12045
 
12046
12046
 
@@ -32478,6 +32478,10 @@ var FormFooterProvider = function FormFooterProvider(props) {
32478
32478
  context.hasSubmit = true;
32479
32479
  }
32480
32480
  });
32481
+ var deleteFormInfo = usePersistFn(function () {
32482
+ context.hasSubmit = false;
32483
+ context.submit = function () {};
32484
+ });
32481
32485
  var setFormStats = usePersistFn(function (disabled) {
32482
32486
  if (disabled !== formStats) {
32483
32487
  setFormS(disabled);
@@ -32487,6 +32491,7 @@ var FormFooterProvider = function FormFooterProvider(props) {
32487
32491
  return {
32488
32492
  setFormStats: setFormStats,
32489
32493
  setFormInfo: setFormInfo,
32494
+ deleteFormInfo: deleteFormInfo,
32490
32495
  formStats: formStats,
32491
32496
  func: context
32492
32497
  };
@@ -48293,6 +48298,9 @@ var Form = function Form(props) {
48293
48298
  };
48294
48299
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
48295
48300
  handleFormModalInfo();
48301
+ return function () {
48302
+ modalFormContext === null || modalFormContext === void 0 || modalFormContext.deleteFormInfo();
48303
+ };
48296
48304
  }, [props.disabled, props.pending]);
48297
48305
  var rootClass = classnames_default()([formClasses === null || formClasses === void 0 ? void 0 : formClasses.rootClass, formClasses === null || formClasses === void 0 ? void 0 : formClasses.wrapper, className, props.inline && (formClasses === null || formClasses === void 0 ? void 0 : formClasses.wrapperInline)]);
48298
48306
  var formProps = getFormProps({
@@ -61113,6 +61121,7 @@ var TabsPanel = function TabsPanel(props) {
61113
61121
  var _jssStyle$tabs;
61114
61122
  var children = props.children,
61115
61123
  id = props.id,
61124
+ indexInTabs = props.index,
61116
61125
  tab = props.tab,
61117
61126
  className = props.className,
61118
61127
  style = props.style,
@@ -61134,16 +61143,22 @@ var TabsPanel = function TabsPanel(props) {
61134
61143
  color: props.color || (active === id ? color : undefined)
61135
61144
  };
61136
61145
  setTabs(function (prev) {
61137
- var prevTab = prev.find(function (item) {
61146
+ var oldTab = prev.find(function (item) {
61138
61147
  return item.id === id;
61139
61148
  });
61140
- if (prevTab) {
61149
+ if (oldTab) {
61141
61150
  return prev.map(function (item) {
61142
61151
  if (item.id !== id) return item;
61143
61152
  return objectSpread2_default()(objectSpread2_default()({}, item), tabData);
61144
61153
  });
61145
61154
  }
61146
- return [].concat(toConsumableArray_default()(prev), [tabData]);
61155
+ if (indexInTabs === undefined) {
61156
+ return [].concat(toConsumableArray_default()(prev), [tabData]);
61157
+ }
61158
+
61159
+ // 向indexInTabs位置插入tabData
61160
+ var newTabs = [].concat(toConsumableArray_default()(prev.slice(0, indexInTabs)), [tabData], toConsumableArray_default()(prev.slice(indexInTabs)));
61161
+ return newTabs;
61147
61162
  });
61148
61163
  return function () {
61149
61164
  // Panel卸载了通知父组件,去销毁相应的TabsHeader
@@ -61153,7 +61168,7 @@ var TabsPanel = function TabsPanel(props) {
61153
61168
  });
61154
61169
  });
61155
61170
  };
61156
- }, [id, tab, color].concat(toConsumableArray_default()(color ? [active] : []), [props.disabled, props.jssStyle]));
61171
+ }, [id, tab, color, active, props.disabled, props.jssStyle]);
61157
61172
  if (!isActive && lazy && !keekAlive.current) {
61158
61173
  return null;
61159
61174
  }
@@ -61489,14 +61504,9 @@ var TabsHeader = function TabsHeader(props) {
61489
61504
  extra = props.extra,
61490
61505
  splitColor = props.splitColor,
61491
61506
  tabBarStyle = props.tabBarStyle,
61492
- getPosition = props.getPosition,
61493
- sticky = props.sticky;
61507
+ getPosition = props.getPosition;
61494
61508
  var headerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
61495
61509
  var scrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
61496
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
61497
- _useState2 = slicedToArray_default()(_useState, 2),
61498
- loaded = _useState2[0],
61499
- setLoaded = _useState2[1];
61500
61510
  var tabRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({});
61501
61511
  var _useTabsContext = useTabsContext(),
61502
61512
  shape = _useTabsContext.shape,
@@ -61505,11 +61515,6 @@ var TabsHeader = function TabsHeader(props) {
61505
61515
  active = _useTabsContext.active;
61506
61516
  var config = useConfig();
61507
61517
  var isRtl = config.direction === 'rtl';
61508
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
61509
- if (sticky && headerRef.current && scrollRef.current && !loaded) {
61510
- setLoaded(true);
61511
- }
61512
- }, [loaded, sticky]);
61513
61518
  var _useTransform = use_transform({
61514
61519
  autoScroll: true,
61515
61520
  direction: isVertical ? 'Y' : 'X',
@@ -61571,17 +61576,17 @@ var TabsHeader = function TabsHeader(props) {
61571
61576
  var single = isRtl && !isVertical ? -1 : 1;
61572
61577
  setTransform(delta + headerRef.current.clientWidth * single);
61573
61578
  };
61574
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
61579
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
61575
61580
  offsetTop: 0,
61576
61581
  offsetLeft: 0
61577
61582
  }),
61583
+ _useState2 = slicedToArray_default()(_useState, 2),
61584
+ currentTabOffset = _useState2[0],
61585
+ setCurrentTabOffset = _useState2[1];
61586
+ var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
61578
61587
  _useState4 = slicedToArray_default()(_useState3, 2),
61579
- currentTabOffset = _useState4[0],
61580
- setCurrentTabOffset = _useState4[1];
61581
- var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
61582
- _useState6 = slicedToArray_default()(_useState5, 2),
61583
- currentTabRect = _useState6[0],
61584
- setCurrentTabRect = _useState6[1];
61588
+ currentTabRect = _useState4[0],
61589
+ setCurrentTabRect = _useState4[1];
61585
61590
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
61586
61591
  var _currentTab$getBoundi;
61587
61592
  if (shape !== 'line' && shape !== 'dash') return;
@@ -61877,7 +61882,8 @@ var Tabs = function Tabs(props) {
61877
61882
  var Child = child;
61878
61883
  if (tabs_isNamedComponent(Child.type) && Child.type.displayName === 'ShineoutTabsPanel') {
61879
61884
  return /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(Child, {
61880
- id: Child.props.id !== undefined ? Child.props.id : index
61885
+ id: Child.props.id !== undefined ? Child.props.id : index,
61886
+ index: index
61881
61887
  });
61882
61888
  }
61883
61889
  if (allowNonPanel) {
@@ -67184,7 +67190,7 @@ var upload_interface = __webpack_require__(8821);
67184
67190
 
67185
67191
 
67186
67192
  /* harmony default export */ var src_0 = ({
67187
- version: '3.5.5-beta.5'
67193
+ version: '3.5.5-beta.7'
67188
67194
  });
67189
67195
  }();
67190
67196
  /******/ return __webpack_exports__;