shineout 3.5.1-beta.5 → 3.5.1-fix.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.
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.1-beta.5'
503
+ version: '3.5.1-fix.1'
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.1-beta.5');
12005
+ /* harmony default export */ var version = ('3.5.1-fix.1');
12006
12006
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12007
12007
 
12008
12008
 
@@ -33275,19 +33275,18 @@ function useInputAble(props) {
33275
33275
  var render = useRender(syncValue);
33276
33276
  var shouldUseState = delay || !control;
33277
33277
  var value = shouldUseState ? stateValue : valuePo;
33278
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
33279
- if (context.timer) {
33280
- clearTimeout(context.timer);
33281
- context.timer = null;
33282
- }
33278
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
33283
33279
  if (delay && control && props.value !== stateValue) {
33284
33280
  changeStateValue(props.value);
33281
+ } else if (context.timer) {
33282
+ clearTimeout(context.timer);
33283
+ context.timer = null;
33285
33284
  }
33286
33285
  }, [props.value, delay, control]);
33287
33286
  var forceDelayChange = use_persist_fn(function () {
33288
- if (context.timer && context.delayChange) {
33287
+ if (context.delayChange) context.delayChange();
33288
+ if (context.timer) {
33289
33289
  clearTimeout(context.timer);
33290
- context.delayChange();
33291
33290
  context.timer = null;
33292
33291
  context.delayChange = null;
33293
33292
  }
@@ -36554,6 +36553,7 @@ var useFilter = function useFilter(props) {
36554
36553
 
36555
36554
 
36556
36555
 
36556
+
36557
36557
  function use_tree_toArray(value) {
36558
36558
  if (!value) return [];
36559
36559
  if (!Array.isArray(value)) return [value];
@@ -36602,6 +36602,10 @@ var useTree = function useTree(props) {
36602
36602
  unmatch = props.unmatch,
36603
36603
  isControlled = props.isControlled,
36604
36604
  onExpandProp = props.onExpand;
36605
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
36606
+ _useState2 = slicedToArray_default()(_useState, 2),
36607
+ inited = _useState2[0],
36608
+ setInited = _useState2[1];
36605
36609
  var _useInputAble = useInputAble({
36606
36610
  value: expandedProp,
36607
36611
  defaultValue: defaultExpanded,
@@ -36727,10 +36731,12 @@ var useTree = function useTree(props) {
36727
36731
  if (oroginData) {
36728
36732
  return oroginData;
36729
36733
  }
36730
- if (!unmatch) return null;
36734
+ // if (!unmatch) return null;
36735
+ // if (!unmatch) return { IS_NOT_MATCHED_VALUE: true, value: null};
36736
+ // return { IS_NOT_MATCHED_VALUE: true, value: !unmatch ? null : id };
36731
36737
  return {
36732
36738
  IS_NOT_MATCHED_VALUE: true,
36733
- value: id
36739
+ value: !unmatch ? null : id
36734
36740
  };
36735
36741
  };
36736
36742
  var getDataByValues = function getDataByValues(values) {
@@ -36767,7 +36773,6 @@ var useTree = function useTree(props) {
36767
36773
  console.error("There is already a key \"".concat(id, "\" exists. The key must be unique."));
36768
36774
  continue;
36769
36775
  }
36770
-
36771
36776
  // 制作 data mapping
36772
36777
  context.dataMap.set(id, item);
36773
36778
  var _isDisabled = !!disabled;
@@ -36945,6 +36950,9 @@ var useTree = function useTree(props) {
36945
36950
  if (props.datum) return;
36946
36951
  setValue(value);
36947
36952
  }, [value]);
36953
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
36954
+ setInited(true);
36955
+ }, []);
36948
36956
  var datum = use_latest_obj({
36949
36957
  get: get,
36950
36958
  set: set,
@@ -36969,6 +36977,7 @@ var useTree = function useTree(props) {
36969
36977
  updateMap: context.updateMap
36970
36978
  });
36971
36979
  return {
36980
+ inited: inited,
36972
36981
  datum: props.datum || datum,
36973
36982
  expanded: expanded,
36974
36983
  onExpand: onExpand
@@ -38666,7 +38675,7 @@ var result_Result = function Result(props) {
38666
38675
  };
38667
38676
  var empty = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
38668
38677
  return isEmptyResult();
38669
- }, [props.value]);
38678
+ }, [props.value, props.data, getDataByValues]);
38670
38679
  var basePlaceholder = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
38671
38680
  return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
38672
38681
  className: classnames_default()(styles.placeholder, styles.ellipsis),
@@ -38921,7 +38930,7 @@ var result_Result = function Result(props) {
38921
38930
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
38922
38931
  handleResetMore();
38923
38932
  }, [valueProp, data]);
38924
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
38933
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
38925
38934
  // datum.getDataByValues(value); 需要等待 useTree useEffect 执行完毕 才能获取到
38926
38935
  render();
38927
38936
  }, [data]);
@@ -66408,7 +66417,7 @@ var upload_interface = __webpack_require__(8821);
66408
66417
 
66409
66418
 
66410
66419
  /* harmony default export */ var src_0 = ({
66411
- version: '3.5.1-beta.5'
66420
+ version: '3.5.1-fix.1'
66412
66421
  });
66413
66422
  }();
66414
66423
  /******/ return __webpack_exports__;