shineout 3.9.0-beta.28 → 3.9.0-beta.29

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
@@ -522,5 +522,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
522
522
  // 此文件由脚本自动生成,请勿直接修改。
523
523
  // This file was generated automatically by a script. Please do not modify it directly.
524
524
  var _default = exports.default = {
525
- version: '3.9.0-beta.28'
525
+ version: '3.9.0-beta.29'
526
526
  };
@@ -9,7 +9,7 @@ export declare function textContentTest(element: Element, text: string | null |
9
9
  export declare function classContentTest(element: Element, name: string, bool?: boolean): void;
10
10
  export declare function styleTest(element: Element, style: string | null): void;
11
11
  export declare function styleContainTest(element: Element, styleObject: object): void;
12
- export declare function styleContentTest(element: Element, name: string, bool?: boolean): void;
12
+ export declare function styleContentTest(element: Element, styles: string | string[], bool?: boolean): void;
13
13
  export interface StyleProps {
14
14
  [key: string]: string;
15
15
  }
@@ -87,10 +87,19 @@ function styleTest(element, style) {
87
87
  function styleContainTest(element, styleObject) {
88
88
  expect(element.style).toEqual(expect.objectContaining(styleObject));
89
89
  }
90
- function styleContentTest(element, name) {
91
- var _element$getAttribute2;
90
+ function styleContentTest(element, styles) {
92
91
  var bool = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
93
- expect((_element$getAttribute2 = element.getAttribute('style')) === null || _element$getAttribute2 === void 0 ? void 0 : _element$getAttribute2.includes(name)).toBe(bool);
92
+ var elementStyle = element.getAttribute('style');
93
+ if (Array.isArray(styles)) {
94
+ // 如果是数组,检查每个样式属性是否都存在
95
+ var allMatch = styles.every(function (style) {
96
+ return elementStyle === null || elementStyle === void 0 ? void 0 : elementStyle.includes(style);
97
+ });
98
+ expect(allMatch).toBe(bool);
99
+ } else {
100
+ // 原有的字符串匹配方式
101
+ expect(elementStyle === null || elementStyle === void 0 ? void 0 : elementStyle.includes(styles)).toBe(bool);
102
+ }
94
103
  }
95
104
  function baseTest(Component, selector) {
96
105
  var styleV = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
package/dist/shineout.js CHANGED
@@ -12400,7 +12400,7 @@ var handleStyle = function handleStyle(style) {
12400
12400
  };
12401
12401
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12402
12402
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12403
- /* harmony default export */ var version = ('3.9.0-beta.28');
12403
+ /* harmony default export */ var version = ('3.9.0-beta.29');
12404
12404
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12405
12405
 
12406
12406
 
@@ -33678,6 +33678,30 @@ var getDuration = function getDuration(duration) {
33678
33678
  }
33679
33679
  };
33680
33680
  var mm = 30;
33681
+
33682
+ /**
33683
+ * AnimationList - 动画列表组件
33684
+ *
33685
+ * 动画状态流程:
33686
+ *
33687
+ * 展开动画 (show: false -> true):
33688
+ * beforeEnter: 设置初始状态(display, height: 0, opacity: 0 等)
33689
+ * ↓ 等待 mm(30ms) - 触发浏览器重绘
33690
+ * enter: 应用过渡动画(height: ${height}px, opacity: 1 等)
33691
+ * ↓ 等待 durationNum(240ms) - 动画执行
33692
+ * afterEnter: 清理动画状态(height: auto, pointer-events: initial)
33693
+ *
33694
+ * 收起动画 (show: true -> false):
33695
+ * beforeLeave: 固定当前状态(height: ${height}px, pointer-events: none)
33696
+ * ↓ 等待 mm(30ms) - 触发浏览器重绘
33697
+ * leave: 应用过渡动画(height: 0, opacity: 0 等)
33698
+ * ↓ 等待 durationNum(240ms) - 动画执行
33699
+ * afterLeave: 清理并隐藏(display: none, pointer-events: initial)
33700
+ *
33701
+ * pointer-events 控制:
33702
+ * - beforeLeave: 设置为 'none',防止动画过程中的误操作
33703
+ * - afterEnter/afterLeave: 恢复为 'initial',确保动画结束后可正常交互
33704
+ */
33681
33705
  var AnimationList = function AnimationList(props) {
33682
33706
  var _props$display = props.display,
33683
33707
  display = _props$display === void 0 ? 'block' : _props$display,
@@ -33756,6 +33780,11 @@ var AnimationList = function AnimationList(props) {
33756
33780
  width: 0
33757
33781
  };
33758
33782
  };
33783
+
33784
+ /**
33785
+ * 展开动画阶段1: 设置初始状态
33786
+ * 设置 display 显示元素,并将动画属性设为起始值(如 height: 0)
33787
+ */
33759
33788
  var beforeEnter = function beforeEnter() {
33760
33789
  var newStyle = {
33761
33790
  display: display
@@ -33782,6 +33811,11 @@ var AnimationList = function AnimationList(props) {
33782
33811
  return objectSpread2_default()(objectSpread2_default()({}, s), newStyle);
33783
33812
  });
33784
33813
  };
33814
+
33815
+ /**
33816
+ * 展开动画阶段2: 执行过渡动画
33817
+ * 添加 transition 并将动画属性过渡到目标值
33818
+ */
33785
33819
  var enter = function enter() {
33786
33820
  var newStyle = {
33787
33821
  transition: transition
@@ -33801,8 +33835,15 @@ var AnimationList = function AnimationList(props) {
33801
33835
  });
33802
33836
  setStatus('enter');
33803
33837
  };
33838
+
33839
+ /**
33840
+ * 展开动画阶段3: 清理动画状态
33841
+ * 移除固定尺寸,恢复自动布局,恢复交互能力
33842
+ */
33804
33843
  var afterEnter = function afterEnter() {
33805
- var newStyle = {};
33844
+ var newStyle = {
33845
+ pointerEvents: 'initial'
33846
+ };
33806
33847
  if (type.indexOf('collapse') >= 0) {
33807
33848
  newStyle.height = 'auto';
33808
33849
  newStyle.overflow = '';
@@ -33813,9 +33854,16 @@ var AnimationList = function AnimationList(props) {
33813
33854
  setStatus('afterEnter');
33814
33855
  onAnimationAfterEnter === null || onAnimationAfterEnter === void 0 || onAnimationAfterEnter();
33815
33856
  };
33857
+
33858
+ /**
33859
+ * 收起动画阶段1: 固定当前状态
33860
+ * 禁用交互,固定当前高度,准备执行收起动画
33861
+ */
33816
33862
  var beforeLeave = function beforeLeave() {
33817
33863
  var el = ref.current;
33818
- var newStyle = {};
33864
+ var newStyle = {
33865
+ pointerEvents: 'none'
33866
+ };
33819
33867
  if (type.indexOf('collapse') >= 0) {
33820
33868
  context.height = el.offsetHeight;
33821
33869
  newStyle.height = "".concat(context.height, "px");
@@ -33833,6 +33881,11 @@ var AnimationList = function AnimationList(props) {
33833
33881
  });
33834
33882
  setStatus('beforeLeave');
33835
33883
  };
33884
+
33885
+ /**
33886
+ * 收起动画阶段2: 执行过渡动画
33887
+ * 添加 transition 并将动画属性过渡到收起状态(如 height: 0)
33888
+ */
33836
33889
  var leave = function leave() {
33837
33890
  var newStyle = {
33838
33891
  transition: transition
@@ -33852,8 +33905,15 @@ var AnimationList = function AnimationList(props) {
33852
33905
  });
33853
33906
  setStatus('leave');
33854
33907
  };
33908
+
33909
+ /**
33910
+ * 收起动画阶段3: 清理并隐藏
33911
+ * 恢复交互能力,清理动画状态,设置 display: none 完全隐藏元素
33912
+ */
33855
33913
  var afterLeave = function afterLeave() {
33856
- var newStyle = {};
33914
+ var newStyle = {
33915
+ pointerEvents: 'initial'
33916
+ };
33857
33917
  if (type.indexOf('collapse') >= 0) {
33858
33918
  newStyle.height = 'auto';
33859
33919
  newStyle.overflow = '';
@@ -74235,7 +74295,7 @@ var upload_interface = __webpack_require__(8821);
74235
74295
 
74236
74296
 
74237
74297
  /* harmony default export */ var src_0 = ({
74238
- version: '3.9.0-beta.28'
74298
+ version: '3.9.0-beta.29'
74239
74299
  });
74240
74300
  }();
74241
74301
  /******/ return __webpack_exports__;