shineout 3.8.0-beta.2 → 3.8.0-beta.21

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.
@@ -6,11 +6,12 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import React from 'react';
8
8
  import { Breadcrumb } from '@sheinx/base';
9
- import { useBreadcrumbStyle, usePopoverStyle } from '@sheinx/shineout-style';
9
+ import { useBreadcrumbStyle, usePopoverStyle, useTooltipStyle } from '@sheinx/shineout-style';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  var jssStyle = {
12
12
  breadcrumb: useBreadcrumbStyle,
13
- popover: usePopoverStyle
13
+ popover: usePopoverStyle,
14
+ tooltip: useTooltipStyle
14
15
  };
15
16
  export default (function (props) {
16
17
  return /*#__PURE__*/_jsx(Breadcrumb, _objectSpread({
@@ -5,7 +5,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import { useMemo } from 'react';
8
- import { DatePicker, getLocale, useConfig } from '@sheinx/base';
8
+ import { DatePicker as BaseDatePicker, getLocale, useConfig } from '@sheinx/base';
9
9
  import { useButtonStyle, useDatePickerStyle, useInnerTitleStyle, usePopoverStyle, useLinkStyle } from '@sheinx/shineout-style';
10
10
  import { convertValueToDateArr, getFormat, getFormatValueArr } from '@sheinx/hooks';
11
11
  import useFieldCommon from "../hooks/use-field-common";
@@ -17,8 +17,8 @@ var jssStyle = {
17
17
  popover: usePopoverStyle,
18
18
  link: useLinkStyle
19
19
  };
20
- var BaseDatePicker = function BaseDatePicker(props) {
21
- return /*#__PURE__*/_jsx(DatePicker, _objectSpread({
20
+ var DatePicker = function DatePicker(props) {
21
+ return /*#__PURE__*/_jsx(BaseDatePicker, _objectSpread({
22
22
  jssStyle: jssStyle
23
23
  }, props));
24
24
  };
@@ -48,5 +48,5 @@ export default (function (props) {
48
48
  }, []);
49
49
  return useFieldCommon(_objectSpread(_objectSpread({}, props), {}, {
50
50
  defaultValue: defaultValue
51
- }), BaseDatePicker);
51
+ }), DatePicker);
52
52
  });
@@ -1,43 +1,60 @@
1
- import { FormFieldProps as UiFormFieldProps, FormFieldSetProps as UiFormFieldSetProps, FormItemProps as UiFormItemProps, FormProps as UiFormProps, ObjectType, FormFlowProps as UiFormFlowProps, FormRef as UiFormRef } from '@sheinx/base';
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
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>;
9
+ /**
10
+ * @title FormDatum
11
+ * @sort 7
12
+ * @en Form data management object, used to manage the internal data state and validation logic of the form
13
+ * @cn 表单数据管理对象,用于管理表单内部的数据状态和校验逻辑
14
+ */
15
+ export type FormDatum = UiFormDatum;
7
16
  /**
8
17
  * @title Form
9
18
  * @sort 1
10
19
  */
11
20
  export interface FormProps<T extends ObjectType> extends Omit<UiFormProps<T>, 'jssStyle'> {
12
21
  /**
13
- * @en Form value
14
- * @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 使用。适用于需要外部管理表单状态的场景,如跨组件共享表单数据、实时同步表单数据到状态管理器等
15
24
  * @override object
16
25
  */
17
26
  value?: T;
18
27
  /**
19
- * @en callback function, executed when the value is changing
20
- * @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 在受控模式下必须设置此函数来更新外部状态。每当表单内任意字段值改变时都会触发,参数为整个表单的最新数据
21
30
  */
22
31
  onChange?: (value: T) => void;
23
32
  }
24
33
  /**
25
34
  * @title Form.Item
26
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 包裹,以便正确显示标签和校验信息
27
38
  */
28
39
  export type FormItemProps = Omit<UiFormItemProps, 'jssStyle'>;
29
40
  /**
30
41
  * @title Form.Field
31
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 表单字段组件,用于创建自定义的表单控件。提供了表单数据绑定、校验等功能,适用于封装复杂的自定义表单组件
32
45
  */
33
46
  export type FormFieldProps<T> = UiFormFieldProps<T>;
34
47
  /**
35
48
  * @title Form.FieldSet
36
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 表单字段集组件,用于管理一组相关的表单字段。适用于处理对象或数组类型的表单数据,如动态表单列表、嵌套对象等复杂场景
37
52
  */
38
53
  export type FormFieldSetProps<T> = UiFormFieldSetProps<T>;
39
54
  /**
40
55
  * @title Form.Flow
41
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 表单流程组件,用于监听表单数据变化并执行相应的副作用。适用于实现表单联动、条件渲染等场景
42
59
  */
43
60
  export type FormFlowProps = UiFormFlowProps;
@@ -1,3 +1,3 @@
1
1
  export type { FormRef as Ref, FormFieldChildrenFunc as FieldChildrenFunc, FormFieldSetChildrenFunc as FieldSetChildrenFunc, } from '@sheinx/base';
2
- export type { FormProps as Props, FormItemProps as ItemProps, FormFieldProps as FieldProps, FormFieldSetProps as FieldSetProps, } from './form.type';
2
+ export type { FormProps as Props, FormItemProps as ItemProps, FormFieldProps as FieldProps, FormFieldSetProps as FieldSetProps, FormFlowProps as FlowProps, FormDatum as Datum, } from './form.type';
3
3
  export type { ButtonProps as SubmitProps, ButtonProps as ResetProps } from '../button/button.type';
package/esm/index.d.ts CHANGED
@@ -53,7 +53,7 @@ export { setConfig, config, setLocale, setIcons, icons } from '@sheinx/base';
53
53
  export type { ConfigOption } from '@sheinx/base';
54
54
  export { setToken, useToken } from '@sheinx/theme';
55
55
  export { JssProvider, SheetsRegistry, setJssConfig, scopeNormalizeStyle, } from '@sheinx/shineout-style';
56
- export * as utls from './utils';
56
+ export * as utils from './utils';
57
57
  export * from './deprecated';
58
58
  export * as TYPE from './type';
59
59
  declare const _default: {
package/esm/index.js CHANGED
@@ -56,11 +56,11 @@ export { default as Upload } from "./upload";
56
56
  export { setConfig, config, setLocale, setIcons, icons } from '@sheinx/base';
57
57
  export { setToken, useToken } from '@sheinx/theme';
58
58
  export { JssProvider, SheetsRegistry, setJssConfig, scopeNormalizeStyle } from '@sheinx/shineout-style';
59
- import * as _utls from "./utils";
60
- export { _utls as utls };
59
+ import * as _utils from "./utils";
60
+ export { _utils as utils };
61
61
  export * from "./deprecated";
62
62
  import * as _TYPE from "./type";
63
63
  export { _TYPE as TYPE };
64
64
  export default {
65
- version: '3.8.0-beta.2'
65
+ version: '3.8.0-beta.21'
66
66
  };
package/esm/rate/rate.js CHANGED
@@ -11,17 +11,17 @@ import { jsx as _jsx } from "react/jsx-runtime";
11
11
  var jssStyle = {
12
12
  rate: useRateStyle
13
13
  };
14
- var BaseRate = function BaseRate(props) {
14
+ var Rate = function Rate(props) {
15
15
  return /*#__PURE__*/_jsx(UnStyleRate, _objectSpread({
16
16
  jssStyle: jssStyle
17
17
  }, props));
18
18
  };
19
- var Rate = function Rate(props) {
20
- return useFieldCommon(props, BaseRate, 'number');
19
+ var WrappedRate = function WrappedRate(props) {
20
+ return useFieldCommon(props, Rate, 'number');
21
21
  };
22
22
  export default (function (background, front, opts) {
23
23
  var RateIns = function RateIns(props) {
24
- return /*#__PURE__*/_jsx(Rate, _objectSpread(_objectSpread({}, opts), {}, {
24
+ return /*#__PURE__*/_jsx(WrappedRate, _objectSpread(_objectSpread({}, opts), {}, {
25
25
  background: background,
26
26
  front: front || background
27
27
  }, props));
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { SelectPropsA, SelectPropsB } from './select.type';
3
- declare function Select<DataItem, Value>(props: SelectPropsA<DataItem, Value>): JSX.Element;
4
- declare function Select<DataItem, Value>(props: SelectPropsB<DataItem, Value>): JSX.Element;
5
- export default Select;
3
+ declare function SelectComponent<DataItem, Value>(props: SelectPropsA<DataItem, Value>): JSX.Element;
4
+ declare function SelectComponent<DataItem, Value>(props: SelectPropsB<DataItem, Value>): JSX.Element;
5
+ export default SelectComponent;
@@ -20,12 +20,12 @@ var jssStyle = {
20
20
  spin: useSpinStyle,
21
21
  common: useCommonStyle
22
22
  };
23
- function SelectComponent(props) {
23
+ function Select(props) {
24
24
  return /*#__PURE__*/_jsx(BaseSelect, _objectSpread({
25
25
  jssStyle: jssStyle
26
26
  }, props));
27
27
  }
28
- function Select(props) {
29
- return useFieldCommon(props, SelectComponent, 'array');
28
+ function SelectComponent(props) {
29
+ return useFieldCommon(props, Select, 'array');
30
30
  }
31
- export default Select;
31
+ export default SelectComponent;
@@ -7,7 +7,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
7
7
  import React from 'react';
8
8
  import { Transfer as UnStyleTransfer } from '@sheinx/base';
9
9
  import useFieldCommon from "../hooks/use-field-common";
10
- import { useSpinStyle, useEmptyStyle, useInputStyle, useButtonStyle, useTransferStyle, useCheckboxStyle } from '@sheinx/shineout-style';
10
+ import { useSpinStyle, useEmptyStyle, useInputStyle, useButtonStyle, useTransferStyle, useCheckboxStyle, useCommonStyle } from '@sheinx/shineout-style';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  var jssStyle = {
13
13
  transfer: useTransferStyle,
@@ -15,7 +15,8 @@ var jssStyle = {
15
15
  checkbox: useCheckboxStyle,
16
16
  empty: useEmptyStyle,
17
17
  input: useInputStyle,
18
- spin: useSpinStyle
18
+ spin: useSpinStyle,
19
+ common: useCommonStyle
19
20
  };
20
21
  var Transfer = function Transfer(props) {
21
22
  return /*#__PURE__*/_jsx(UnStyleTransfer, _objectSpread(_objectSpread({}, props), {}, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shineout",
3
- "version": "3.8.0-beta.2",
3
+ "version": "3.8.0-beta.21",
4
4
  "description": "A components library for React",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -16,18 +16,18 @@
16
16
  "module": "./esm/index.js",
17
17
  "typings": "./cjs/index.d.ts",
18
18
  "dependencies": {
19
- "@sheinx/base": "3.8.0-beta.2",
20
- "@sheinx/hooks": "3.8.0-beta.2",
21
- "@sheinx/shineout-style": "3.8.0-beta.2",
22
- "@sheinx/theme": "3.8.0-beta.2",
19
+ "@sheinx/base": "3.8.0-beta.21",
20
+ "@sheinx/hooks": "3.8.0-beta.21",
21
+ "@sheinx/shineout-style": "3.8.0-beta.21",
22
+ "@sheinx/theme": "3.8.0-beta.21",
23
23
  "classnames": "^2.0.0",
24
- "immer": "^10.0.0",
25
- "deep-eql": "^4.0.0"
24
+ "deep-eql": "^4.0.0",
25
+ "immer": "^10.0.0"
26
26
  },
27
27
  "peerDependencies": {
28
- "react": ">=16.8",
29
- "react-dom": ">=16.8",
30
- "core-js": ">=3"
28
+ "core-js": ">=3",
29
+ "react": ">=16.14.0",
30
+ "react-dom": ">=16.14.0"
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",