shineout 3.5.0 → 3.5.1-beta.2

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
@@ -500,5 +500,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
500
500
  // 此文件由脚本自动生成,请勿直接修改。
501
501
  // This file was generated automatically by a script. Please do not modify it directly.
502
502
  var _default = exports.default = {
503
- version: '3.5.0'
503
+ version: '3.5.1-beta.2'
504
504
  };
package/dist/shineout.js CHANGED
@@ -12002,7 +12002,7 @@ var handleStyle = function handleStyle(style) {
12002
12002
  };
12003
12003
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12004
12004
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12005
- /* harmony default export */ var version = ('3.5.0');
12005
+ /* harmony default export */ var version = ('3.5.1-beta.2');
12006
12006
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12007
12007
 
12008
12008
 
@@ -38759,7 +38759,20 @@ var result_Result = function Result(props) {
38759
38759
  results: result,
38760
38760
  datas: datas
38761
38761
  };
38762
- }, [props.value, props.data]);
38762
+ }, [props.value,
38763
+ // 必需:控制选中的值
38764
+ props.data,
38765
+ // 必需:数据源
38766
+ separator,
38767
+ // 必需:影响值的分割
38768
+ valueProp,
38769
+ // 必需:影响值的处理
38770
+ renderResultContentProp,
38771
+ // 必需:影响渲染方式
38772
+ renderResultItem,
38773
+ // 必需:渲染每个选项的方法
38774
+ getDataByValues // 必需:根据值获取数据的方法
38775
+ ]);
38763
38776
  var result = renderMultipleResult.results;
38764
38777
  var moreNumber = getCompressedBound();
38765
38778
  var renderMultipleResultMore = /*#__PURE__*/(0,jsx_runtime.jsx)(result_more, {
@@ -39591,7 +39604,8 @@ var FormItemContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_
39591
39604
 
39592
39605
 
39593
39606
  var FieldsetContext = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext)({
39594
- path: ''
39607
+ path: '',
39608
+ validateFieldSet: function validateFieldSet() {}
39595
39609
  });
39596
39610
  function extendName() {
39597
39611
  var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
@@ -39607,7 +39621,8 @@ function extendName() {
39607
39621
  }
39608
39622
  var useFieldSetConsumer = function useFieldSetConsumer(props) {
39609
39623
  var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useContext(FieldsetContext),
39610
- path = _React$useContext.path;
39624
+ path = _React$useContext.path,
39625
+ validateFieldSet = _React$useContext.validateFieldSet;
39611
39626
  var bind = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
39612
39627
  return path ? (props.bind || []).concat(path) : props.bind;
39613
39628
  }, [path, props.bind]);
@@ -39616,7 +39631,8 @@ var useFieldSetConsumer = function useFieldSetConsumer(props) {
39616
39631
  }, [path, props.name]);
39617
39632
  return objectSpread2_default()(objectSpread2_default()({}, props), {}, {
39618
39633
  name: name,
39619
- bind: bind
39634
+ bind: bind,
39635
+ validateFieldSet: validateFieldSet
39620
39636
  });
39621
39637
  };
39622
39638
  /* harmony default export */ var fieldset_context = (FieldsetContext);
@@ -40006,7 +40022,8 @@ function useFormControl(props) {
40006
40022
  bind: props.bind
40007
40023
  }),
40008
40024
  name = _useFieldSetConsumer.name,
40009
- bind = _useFieldSetConsumer.bind;
40025
+ bind = _useFieldSetConsumer.bind,
40026
+ validateFieldSet = _useFieldSetConsumer.validateFieldSet;
40010
40027
  var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(undefined),
40011
40028
  _React$useState2 = slicedToArray_default()(_React$useState, 2),
40012
40029
  errorState = _React$useState2[0],
@@ -40103,7 +40120,19 @@ function useFormControl(props) {
40103
40120
  bindValidate();
40104
40121
  return res;
40105
40122
  }).catch(function (e) {
40106
- formFunc === null || formFunc === void 0 || formFunc.setError(name, e);
40123
+ if (isArray(e)) {
40124
+ e.forEach(function (error, index) {
40125
+ if (error) {
40126
+ var _Object$keys, _Object$values;
40127
+ var fieldSetName = (_Object$keys = Object.keys(error)) === null || _Object$keys === void 0 ? void 0 : _Object$keys[0];
40128
+ var fieldSetError = (_Object$values = Object.values(error)) === null || _Object$values === void 0 ? void 0 : _Object$values[0];
40129
+ var na = "".concat(name, "[").concat(index, "].").concat(fieldSetName);
40130
+ if (fieldSetName && fieldSetError) {
40131
+ formFunc === null || formFunc === void 0 || formFunc.setError(na, fieldSetError);
40132
+ }
40133
+ }
40134
+ });
40135
+ }
40107
40136
  onError === null || onError === void 0 || onError(e);
40108
40137
  bindValidate();
40109
40138
  return e;
@@ -40144,6 +40173,7 @@ function useFormControl(props) {
40144
40173
  other[_key - 1] = arguments[_key];
40145
40174
  }
40146
40175
  if (onChangePo) onChangePo.apply(void 0, [v].concat(other));
40176
+ if (validateFieldSet) validateFieldSet();
40147
40177
  });
40148
40178
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
40149
40179
  if (inForm && controlFunc) {
@@ -46977,7 +47007,8 @@ EmptyComp.displayName = 'ShineoutEmpty';
46977
47007
 
46978
47008
 
46979
47009
  var topPath = {
46980
- path: ''
47010
+ path: '',
47011
+ validateFieldSet: function validateFieldSet() {}
46981
47012
  };
46982
47013
  var Provider = function Provider(props) {
46983
47014
  var children = props.children,
@@ -48020,7 +48051,8 @@ var useFormFieldSet = function useFormFieldSet(props) {
48020
48051
  console.error('[FieldSet] should render in Form');
48021
48052
  }
48022
48053
  var ProviderValue = {
48023
- path: name
48054
+ path: name,
48055
+ validateFieldSet: function validateFieldSet() {}
48024
48056
  };
48025
48057
  return {
48026
48058
  Provider: fieldset_context.Provider,
@@ -48037,6 +48069,7 @@ var useFormFieldSet = function useFormFieldSet(props) {
48037
48069
 
48038
48070
 
48039
48071
 
48072
+
48040
48073
  var form_fieldset_produce = utils_immer_produce;
48041
48074
  var FormFieldSet = function FormFieldSet(props) {
48042
48075
  var children = props.children,
@@ -48046,6 +48079,11 @@ var FormFieldSet = function FormFieldSet(props) {
48046
48079
  }),
48047
48080
  context = _React$useRef.current;
48048
48081
  var formFunc = useFormFunc();
48082
+ var validateFieldSet = function validateFieldSet() {
48083
+ formFunc === null || formFunc === void 0 || formFunc.validateFields(props.name).catch(function (e) {
48084
+ return e;
48085
+ });
48086
+ };
48049
48087
  var getValidateProps = usePersistFn(function () {
48050
48088
  return props;
48051
48089
  });
@@ -48064,7 +48102,9 @@ var FormFieldSet = function FormFieldSet(props) {
48064
48102
  name = _useFormFieldSet.name;
48065
48103
  if (typeof children !== 'function') {
48066
48104
  return /*#__PURE__*/(0,jsx_runtime.jsx)(Provider, {
48067
- value: ProviderValue,
48105
+ value: objectSpread2_default()(objectSpread2_default()({}, ProviderValue), {}, {
48106
+ validateFieldSet: validateFieldSet
48107
+ }),
48068
48108
  children: children
48069
48109
  });
48070
48110
  }
@@ -48093,7 +48133,8 @@ var FormFieldSet = function FormFieldSet(props) {
48093
48133
  valueArr.forEach(function (v, i) {
48094
48134
  result.push( /*#__PURE__*/(0,jsx_runtime.jsx)(Provider, {
48095
48135
  value: {
48096
- path: "".concat(ProviderValue.path, "[").concat(i, "]")
48136
+ path: "".concat(ProviderValue.path, "[").concat(i, "]"),
48137
+ validateFieldSet: validateFieldSet
48097
48138
  },
48098
48139
  children: children({
48099
48140
  list: valueArr,
@@ -57720,7 +57761,16 @@ var useTableLayout = function useTableLayout(props) {
57720
57761
  checkScroll();
57721
57762
  checkFloat();
57722
57763
  }, [colgroup]);
57723
- var tableWidth = isNaN(Number(props.width)) ? undefined : typeof props.width === 'number' ? props.width + deltaXSum : props.width;
57764
+ var tableWidth = props.width;
57765
+ if (typeof props.width === 'string' && props.width.endsWith('%')) {
57766
+ tableWidth = props.width;
57767
+ } else if (typeof props.width === 'number') {
57768
+ tableWidth = props.width + deltaXSum;
57769
+ } else if (!isNaN(Number(props.width))) {
57770
+ tableWidth = props.width;
57771
+ } else {
57772
+ tableWidth = undefined;
57773
+ }
57724
57774
  return {
57725
57775
  isScrollX: !!isScrollX,
57726
57776
  isScrollY: !!isScrollY,
@@ -60981,13 +61031,15 @@ var Tabs = function Tabs(props) {
60981
61031
  setTimeout(function () {
60982
61032
  setPanelStyle({
60983
61033
  height: 0,
60984
- flex: autoFill ? 0 : 'none'
61034
+ flex: autoFill ? 0 : 'none',
61035
+ overflow: 'hidden'
60985
61036
  });
60986
61037
  }, 10);
60987
61038
  } else {
60988
61039
  if (panelHeight.current === 0) return;
60989
61040
  setPanelStyle({
60990
- height: panelHeight.current
61041
+ height: panelHeight.current,
61042
+ overflow: 'hidden'
60991
61043
  });
60992
61044
  setTimeout(function () {
60993
61045
  setPanelStyle({
@@ -66294,7 +66346,7 @@ var upload_interface = __webpack_require__(8821);
66294
66346
 
66295
66347
 
66296
66348
  /* harmony default export */ var src_0 = ({
66297
- version: '3.5.0'
66349
+ version: '3.5.1-beta.2'
66298
66350
  });
66299
66351
  }();
66300
66352
  /******/ return __webpack_exports__;