shineout 3.8.0-beta.33 → 3.8.0-beta.35

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,4 +1,5 @@
1
1
  import { FormFieldProps as UiFormFieldProps, FormFieldSetProps as UiFormFieldSetProps, FormItemProps as UiFormItemProps, FormProps as UiFormProps, ObjectType, FormFlowProps as UiFormFlowProps, FormRef as UiFormRef, FormDatum as UiFormDatum } from '@sheinx/base';
2
+ import { ButtonProps } from '../button/button.type';
2
3
  /**
3
4
  * @title FormRef
4
5
  * @sort 6
@@ -58,3 +59,17 @@ export type FormFieldSetProps<T> = UiFormFieldSetProps<T>;
58
59
  * @cn 表单流程组件,用于监听表单数据变化并执行相应的副作用。适用于实现表单联动、条件渲染等场景
59
60
  */
60
61
  export type FormFlowProps = UiFormFlowProps;
62
+ /**
63
+ * @title Form.Button
64
+ * @sort 8
65
+ * @en Form button component with htmlType='button'. Prevents accidental form submission when users press Enter in form inputs. Users must explicitly click the button to submit the form. Internally calls formFunc.submit() for better control over submission logic
66
+ * @cn 表单按钮组件,htmlType='button'。防止用户在表单输入框中按回车键时意外提交表单。用户必须显式点击按钮才能提交表单。内部调用 formFunc.submit() 以更好地控制提交逻辑
67
+ */
68
+ export type FormButtonProps = ButtonProps;
69
+ /**
70
+ * @title Form.Submit
71
+ * @sort 9
72
+ * @en Form submit button component with htmlType='submit'. Uses native browser submit behavior. When users press Enter in any form input, it will trigger this button automatically. Suitable for simple forms where Enter-to-submit behavior is desired
73
+ * @cn 表单提交按钮组件,htmlType='submit'。使用浏览器原生提交行为。当用户在任何表单输入框中按回车键时,会自动触发此按钮。适用于希望支持回车提交的简单表单
74
+ */
75
+ export type FormSubmitProps = ButtonProps;
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.8.0-beta.33'
525
+ version: '3.8.0-beta.35'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12386,7 +12386,7 @@ var handleStyle = function handleStyle(style) {
12386
12386
  };
12387
12387
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12388
12388
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12389
- /* harmony default export */ var version = ('3.8.0-beta.33');
12389
+ /* harmony default export */ var version = ('3.8.0-beta.35');
12390
12390
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12391
12391
 
12392
12392
 
@@ -27165,14 +27165,14 @@ var getCardStyle = function getCardStyle() {
27165
27165
  bottom: 0,
27166
27166
  right: -1,
27167
27167
  width: 1,
27168
- background: '#FFFFFF'
27168
+ background: src.tabsCardCheckedBackgroundColor
27169
27169
  })),
27170
27170
  '&[dir=rtl]': objectSpread2_default()(objectSpread2_default()({}, active({
27171
27171
  top: 0,
27172
27172
  bottom: 0,
27173
27173
  left: -1,
27174
27174
  width: 1,
27175
- background: '#FFFFFF'
27175
+ background: src.tabsCardCheckedBackgroundColor
27176
27176
  })), {}, {
27177
27177
  '& $cardHr': {
27178
27178
  '&:before': {
@@ -27205,7 +27205,7 @@ var getCardStyle = function getCardStyle() {
27205
27205
  bottom: 0,
27206
27206
  left: -1,
27207
27207
  width: 1,
27208
- background: '#FFFFFF'
27208
+ background: src.tabsCardCheckedBackgroundColor
27209
27209
  })),
27210
27210
  '&[dir=rtl]': objectSpread2_default()({
27211
27211
  '& $cardHr': {
@@ -27220,7 +27220,7 @@ var getCardStyle = function getCardStyle() {
27220
27220
  bottom: 0,
27221
27221
  right: -1,
27222
27222
  width: 1,
27223
- background: '#FFFFFF'
27223
+ background: src.tabsCardCheckedBackgroundColor
27224
27224
  }))
27225
27225
  },
27226
27226
  '&[data-soui-position^="top-"][data-soui-shape="card"]': objectSpread2_default()({
@@ -27237,7 +27237,7 @@ var getCardStyle = function getCardStyle() {
27237
27237
  left: 0,
27238
27238
  right: 0,
27239
27239
  height: 1,
27240
- background: '#FFFFFF'
27240
+ background: src.tabsCardCheckedBackgroundColor
27241
27241
  })),
27242
27242
  '&[data-soui-position^="bottom-"][data-soui-shape="card"]': objectSpread2_default()({
27243
27243
  '& $tab,& $next,& $prev': {
@@ -27259,13 +27259,13 @@ var getCardStyle = function getCardStyle() {
27259
27259
  left: 0,
27260
27260
  right: 0,
27261
27261
  height: 1,
27262
- background: '#FFFFFF'
27262
+ background: src.tabsCardCheckedBackgroundColor
27263
27263
  }))
27264
27264
  };
27265
27265
  };
27266
27266
  var getLineStyle = function getLineStyle() {
27267
27267
  return {
27268
- '$tab': {
27268
+ '&[data-soui-shape="line"] $tab': {
27269
27269
  '&:after': {
27270
27270
  display: 'none'
27271
27271
  }
@@ -35999,11 +35999,19 @@ var useCheck = function useCheck(props) {
35999
35999
  var handleInputRef = use_fork_ref(inputRef, inputRefPo);
36000
36000
  var handleClick = function handleClick(otherHandlers, needStopPropagation) {
36001
36001
  return function (event) {
36002
- var _inputRef$current, _otherHandlers$onClic;
36002
+ var _otherHandlers$onClic;
36003
36003
  if (needStopPropagation) {
36004
36004
  event.stopPropagation();
36005
36005
  }
36006
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.click();
36006
+
36007
+ // 检查是否被 label 元素包裹,如果是则不需要手动触发 input.click()
36008
+ // 因为 label 会自动将点击事件传递给内部的 input 元素
36009
+ var target = event.currentTarget;
36010
+ var isInsideLabel = target.closest('label') !== null;
36011
+ if (!isInsideLabel) {
36012
+ var _inputRef$current;
36013
+ (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.click();
36014
+ }
36007
36015
  otherHandlers === null || otherHandlers === void 0 || (_otherHandlers$onClic = otherHandlers.onClick) === null || _otherHandlers$onClic === void 0 || _otherHandlers$onClic.call(otherHandlers, event);
36008
36016
  };
36009
36017
  };
@@ -39623,6 +39631,8 @@ var useTree = function useTree(props) {
39623
39631
  var _context$dataFlatStat2;
39624
39632
  context.updateMap.set(id, update);
39625
39633
  var isActive = activeProp === id;
39634
+ // 立即调用update函数设置正确的active状态
39635
+ if (isActive) update('active', isActive);
39626
39636
  return {
39627
39637
  active: isActive,
39628
39638
  expanded: !!((_context$dataFlatStat2 = context.dataFlatStatusMap.get(id)) !== null && _context$dataFlatStat2 !== void 0 && _context$dataFlatStat2.expanded)
@@ -39752,7 +39762,7 @@ var useTree = function useTree(props) {
39752
39762
  context.dataMap.set(id, item);
39753
39763
  if (virtual) {
39754
39764
  context.dataFlatStatusMap.set(id, {
39755
- active: false,
39765
+ active: activeProp === id,
39756
39766
  expanded: defaultExpandAll ? true : (expanded === null || expanded === void 0 ? void 0 : expanded.includes(id)) || false,
39757
39767
  fetching: false
39758
39768
  });
@@ -40103,6 +40113,17 @@ var useTree = function useTree(props) {
40103
40113
  call('expanded', tempExpandMap.has(id));
40104
40114
  });
40105
40115
  });
40116
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
40117
+ if (props.datum) return;
40118
+ if (!dataUpdate) return;
40119
+ setData(data);
40120
+ var nextExpanded = props.expanded || props.defaultExpanded || [];
40121
+ if (!defaultExpandAll && !shallowEqual(nextExpanded, expanded)) {
40122
+ onExpand(nextExpanded);
40123
+ updateExpanded(nextExpanded, true);
40124
+ }
40125
+ updateInnerCheckStatus();
40126
+ }, [props.data]);
40106
40127
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
40107
40128
  if (defaultExpandAll) {
40108
40129
  var nextExpanded = [];
@@ -40115,17 +40136,6 @@ var useTree = function useTree(props) {
40115
40136
  updateExpanded(nextExpanded, true);
40116
40137
  }
40117
40138
  }, [context.dataMap, props.data]);
40118
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
40119
- if (props.datum) return;
40120
- if (!dataUpdate) return;
40121
- setData(data);
40122
- var nextExpanded = props.expanded || props.defaultExpanded || [];
40123
- if (!defaultExpandAll && !shallowEqual(nextExpanded, expanded)) {
40124
- onExpand(nextExpanded);
40125
- updateExpanded(nextExpanded, true);
40126
- }
40127
- updateInnerCheckStatus();
40128
- }, [props.data]);
40129
40139
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
40130
40140
  if (props.datum) return;
40131
40141
  setValue(value);
@@ -66996,10 +67006,33 @@ var TabsHeader = function TabsHeader(props) {
66996
67006
 
66997
67007
  // 使用 offsetWidth/offsetHeight 而不是 getBoundingClientRect()
66998
67008
  // 这样可以避免受到外部容器 CSS transform scale 的影响
66999
- setCurrentTabSize({
67000
- width: (currentTab === null || currentTab === void 0 ? void 0 : currentTab.offsetWidth) || 0,
67001
- height: (currentTab === null || currentTab === void 0 ? void 0 : currentTab.offsetHeight) || 0
67002
- });
67009
+ var width = (currentTab === null || currentTab === void 0 ? void 0 : currentTab.offsetWidth) || 0;
67010
+ var height = (currentTab === null || currentTab === void 0 ? void 0 : currentTab.offsetHeight) || 0;
67011
+ // 微前端场景下,可能出现获取不到元素的尺寸信息
67012
+ if (width === 0 || height === 0) {
67013
+ var timerCount = 0;
67014
+ var timer = setInterval(function () {
67015
+ timerCount++;
67016
+ if (currentTab !== null && currentTab !== void 0 && currentTab.offsetWidth && currentTab !== null && currentTab !== void 0 && currentTab.offsetHeight) {
67017
+ setCurrentTabSize({
67018
+ width: currentTab.offsetWidth,
67019
+ height: currentTab.offsetHeight
67020
+ });
67021
+ clearInterval(timer);
67022
+ }
67023
+ if (timerCount >= 100) {
67024
+ clearInterval(timer);
67025
+ }
67026
+ }, 16);
67027
+ return function () {
67028
+ return clearInterval(timer);
67029
+ };
67030
+ } else {
67031
+ setCurrentTabSize({
67032
+ width: width,
67033
+ height: height
67034
+ });
67035
+ }
67003
67036
  }, [active, tabs]);
67004
67037
  var renderHeaderScrollBar = function renderHeaderScrollBar() {
67005
67038
  if (shape !== 'line' && shape !== 'dash') return;
@@ -72884,7 +72917,7 @@ var upload_interface = __webpack_require__(8821);
72884
72917
 
72885
72918
 
72886
72919
  /* harmony default export */ var src_0 = ({
72887
- version: '3.8.0-beta.33'
72920
+ version: '3.8.0-beta.35'
72888
72921
  });
72889
72922
  }();
72890
72923
  /******/ return __webpack_exports__;