shineout 3.7.8-beta.9 → 3.7.9-beta.1

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.
@@ -2,11 +2,15 @@ import { FormFieldProps as UiFormFieldProps, FormFieldSetProps as UiFormFieldSet
2
2
  /**
3
3
  * @title FormRef
4
4
  * @sort 6
5
+ * @en Form reference object that provides a series of methods to operate the form. After obtaining the instance through ref or useForm, you can actively control the form's validation, submission, reset and other behaviors
6
+ * @cn 表单引用对象,提供了一系列操作表单的方法。通过 ref 或 useForm 获取实例后,可以主动控制表单的校验、提交、重置等行为
5
7
  */
6
8
  export type FormRef<T> = UiFormRef<T>;
7
9
  /**
8
10
  * @title FormDatum
9
11
  * @sort 7
12
+ * @en Form data management object, used to manage the internal data state and validation logic of the form
13
+ * @cn 表单数据管理对象,用于管理表单内部的数据状态和校验逻辑
10
14
  */
11
15
  export type FormDatum = UiFormDatum;
12
16
  /**
@@ -15,34 +19,42 @@ export type FormDatum = UiFormDatum;
15
19
  */
16
20
  export interface FormProps<T extends ObjectType> extends Omit<UiFormProps<T>, 'jssStyle'> {
17
21
  /**
18
- * @en Form value
19
- * @cn 表单数据
22
+ * @en When set, the form becomes a controlled component and needs to be used with onChange. Suitable for scenarios where external management of form state is required, such as sharing form data across components, real-time synchronization of form data to state managers, etc.
23
+ * @cn 设置后表单变为受控组件,需要配合 onChange 使用。适用于需要外部管理表单状态的场景,如跨组件共享表单数据、实时同步表单数据到状态管理器等
20
24
  * @override object
21
25
  */
22
26
  value?: T;
23
27
  /**
24
- * @en callback function, executed when the value is changing
25
- * @cn 表单内组件值变化函数
28
+ * @en Must be set in controlled mode to update external state. Triggered whenever any field value in the form changes, with the parameter being the latest data of the entire form
29
+ * @cn 在受控模式下必须设置此函数来更新外部状态。每当表单内任意字段值改变时都会触发,参数为整个表单的最新数据
26
30
  */
27
31
  onChange?: (value: T) => void;
28
32
  }
29
33
  /**
30
34
  * @title Form.Item
31
35
  * @sort 2
36
+ * @en Form item component, used to wrap form controls and provide label, error tips and other functions. Each form control should be wrapped with Form.Item to properly display labels and validation information
37
+ * @cn 表单项组件,用于包装表单控件并提供标签、错误提示等功能。每个表单控件都应该被 Form.Item 包裹,以便正确显示标签和校验信息
32
38
  */
33
39
  export type FormItemProps = Omit<UiFormItemProps, 'jssStyle'>;
34
40
  /**
35
41
  * @title Form.Field
36
42
  * @sort 3
43
+ * @en Form field component for creating custom form controls. Provides form data binding, validation and other functions, suitable for encapsulating complex custom form components
44
+ * @cn 表单字段组件,用于创建自定义的表单控件。提供了表单数据绑定、校验等功能,适用于封装复杂的自定义表单组件
37
45
  */
38
46
  export type FormFieldProps<T> = UiFormFieldProps<T>;
39
47
  /**
40
48
  * @title Form.FieldSet
41
49
  * @sort 4
50
+ * @en Form field set component for managing a group of related form fields. Suitable for handling object or array type form data, such as dynamic form lists, nested objects and other complex scenarios
51
+ * @cn 表单字段集组件,用于管理一组相关的表单字段。适用于处理对象或数组类型的表单数据,如动态表单列表、嵌套对象等复杂场景
42
52
  */
43
53
  export type FormFieldSetProps<T> = UiFormFieldSetProps<T>;
44
54
  /**
45
55
  * @title Form.Flow
46
56
  * @sort 5
57
+ * @en Form flow component for listening to form data changes and executing corresponding side effects. Suitable for implementing form linkage, conditional rendering and other scenarios
58
+ * @cn 表单流程组件,用于监听表单数据变化并执行相应的副作用。适用于实现表单联动、条件渲染等场景
47
59
  */
48
60
  export type FormFlowProps = UiFormFlowProps;
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.7.8-beta.9'
525
+ version: '3.7.9-beta.1'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12234,7 +12234,7 @@ var handleStyle = function handleStyle(style) {
12234
12234
  };
12235
12235
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12236
12236
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12237
- /* harmony default export */ var version = ('3.7.8-beta.9');
12237
+ /* harmony default export */ var version = ('3.7.9-beta.1');
12238
12238
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12239
12239
 
12240
12240
 
@@ -23692,7 +23692,6 @@ var selectStyle = objectSpread2_default()(objectSpread2_default()({
23692
23692
  height: 32,
23693
23693
  padding: "".concat(src.selectHeaderPaddingY, " ").concat(src.selectHeaderPaddingX),
23694
23694
  borderBottom: "1px solid ".concat(src.selectHeaderBorderColor),
23695
- marginBottom: 4,
23696
23695
  '& $columnsCheckbox': {
23697
23696
  marginRight: 0,
23698
23697
  marginLeft: 4,
@@ -27672,7 +27671,6 @@ var textarea_input = objectSpread2_default()(objectSpread2_default()(objectSprea
27672
27671
  color: src.textareaPlaceholderColor
27673
27672
  },
27674
27673
  width: '100%',
27675
- height: '100%',
27676
27674
  background: 'transparent',
27677
27675
  border: '0',
27678
27676
  margin: '0',
@@ -27689,6 +27687,9 @@ var textarea_input = objectSpread2_default()(objectSpread2_default()(objectSprea
27689
27687
  scrollbarColor: "".concat(src.inputBorderColor, " transparent"),
27690
27688
  '&$resize': {
27691
27689
  resize: 'vertical'
27690
+ },
27691
+ '&:not($shadow)': {
27692
+ minHeight: '-webkit-fill-available'
27692
27693
  }
27693
27694
  },
27694
27695
  resize: {
@@ -31081,6 +31082,23 @@ var getCurrentCSSZoom = function getCurrentCSSZoom() {
31081
31082
  // height: rect.height * zoomRatio,
31082
31083
  // }
31083
31084
  // }
31085
+
31086
+ var getScrollPosition = function getScrollPosition(element) {
31087
+ if (!element) return {
31088
+ scrollTop: 0,
31089
+ scrollLeft: 0
31090
+ };
31091
+ if (element === document.documentElement || element === document.body) {
31092
+ return {
31093
+ scrollTop: document.documentElement.scrollTop || document.body.scrollTop,
31094
+ scrollLeft: document.documentElement.scrollLeft || document.body.scrollLeft
31095
+ };
31096
+ }
31097
+ return {
31098
+ scrollTop: element.scrollTop,
31099
+ scrollLeft: element.scrollLeft
31100
+ };
31101
+ };
31084
31102
  ;// CONCATENATED MODULE: ../hooks/src/common/use-position-style/index.ts
31085
31103
 
31086
31104
 
@@ -31324,17 +31342,18 @@ var usePositionStyle = function usePositionStyle(config) {
31324
31342
  };
31325
31343
  };
31326
31344
  var getAbsoluteStyle = function getAbsoluteStyle(position) {
31327
- var _scrollElRef$current, _scrollElRef$current2, _scrollElRef$current3;
31345
+ var _scrollElRef$current;
31328
31346
  if (!parentElRef.current) return {
31329
31347
  style: hideStyle
31330
31348
  };
31331
31349
  var rect = context.parentRect;
31332
31350
  var needCheck = !show || !shallow_equal(context.prevParentPosition, parentElNewPosition);
31333
- var scrollTop = (scrollElRef === null || scrollElRef === void 0 || (_scrollElRef$current = scrollElRef.current) === null || _scrollElRef$current === void 0 ? void 0 : _scrollElRef$current.scrollTop) || 0;
31334
- var scrollLeft = (scrollElRef === null || scrollElRef === void 0 || (_scrollElRef$current2 = scrollElRef.current) === null || _scrollElRef$current2 === void 0 ? void 0 : _scrollElRef$current2.scrollLeft) || 0;
31335
- if (needCheck && scrollElRef !== null && scrollElRef !== void 0 && scrollElRef.current && (_scrollElRef$current3 = scrollElRef.current) !== null && _scrollElRef$current3 !== void 0 && _scrollElRef$current3.contains(parentElRef.current)) {
31336
- var _scrollElRef$current4;
31337
- var visibleRect = ((_scrollElRef$current4 = scrollElRef.current) === null || _scrollElRef$current4 === void 0 ? void 0 : _scrollElRef$current4.getBoundingClientRect()) || {};
31351
+ var _getScrollPosition = getScrollPosition(scrollElRef === null || scrollElRef === void 0 ? void 0 : scrollElRef.current),
31352
+ scrollTop = _getScrollPosition.scrollTop,
31353
+ scrollLeft = _getScrollPosition.scrollLeft;
31354
+ if (needCheck && scrollElRef !== null && scrollElRef !== void 0 && scrollElRef.current && (_scrollElRef$current = scrollElRef.current) !== null && _scrollElRef$current !== void 0 && _scrollElRef$current.contains(parentElRef.current)) {
31355
+ var _scrollElRef$current2;
31356
+ var visibleRect = ((_scrollElRef$current2 = scrollElRef.current) === null || _scrollElRef$current2 === void 0 ? void 0 : _scrollElRef$current2.getBoundingClientRect()) || {};
31338
31357
  if (rect.bottom < visibleRect.top || rect.top > visibleRect.bottom + scrollTop || rect.right < visibleRect.left || rect.left > visibleRect.right + scrollLeft) {
31339
31358
  return {
31340
31359
  style: hideStyle
@@ -50857,7 +50876,7 @@ var useForm = function useForm(props) {
50857
50876
  var _props$onChange;
50858
50877
  var newValue = typeof change === 'function' ? utils_immer_produce(context.value, change) : change;
50859
50878
  context.value = newValue;
50860
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, deepClone(context.value));
50879
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newValue);
50861
50880
  });
50862
50881
  var scrollToField = use_persist_fn(function (name) {
50863
50882
  var _document;
@@ -56364,7 +56383,8 @@ var ColumnsList = function ColumnsList(props) {
56364
56383
  colNum: columns,
56365
56384
  lineHeight: lineHeight,
56366
56385
  rowsInView: itemsInView,
56367
- renderItem: renderItem
56386
+ renderItem: renderItem,
56387
+ paddingY: 4
56368
56388
  });
56369
56389
  };
56370
56390
  var renderSelectAll = function renderSelectAll() {
@@ -71863,7 +71883,7 @@ var upload_interface = __webpack_require__(8821);
71863
71883
 
71864
71884
 
71865
71885
  /* harmony default export */ var src_0 = ({
71866
- version: '3.7.8-beta.9'
71886
+ version: '3.7.9-beta.1'
71867
71887
  });
71868
71888
  }();
71869
71889
  /******/ return __webpack_exports__;