shineout 3.7.0-beta.40 → 3.7.0-beta.41

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,3 +1,6 @@
1
1
  import { GridProps } from './grid.type';
2
- declare const _default: (props: GridProps) => import("react/jsx-runtime").JSX.Element;
3
- export default _default;
2
+ declare const GridWithStyle: {
3
+ (props: GridProps): import("react/jsx-runtime").JSX.Element;
4
+ isGrid: boolean;
5
+ };
6
+ export default GridWithStyle;
package/cjs/grid/grid.js CHANGED
@@ -13,11 +13,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
13
13
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
15
15
  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); }
16
- var _default = exports.default = function _default(props) {
16
+ var GridWithStyle = function GridWithStyle(props) {
17
17
  var jssStyle = {
18
18
  grid: _shineoutStyle.useGridStyle
19
19
  };
20
20
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_base.Grid, _objectSpread({
21
21
  jssStyle: jssStyle
22
22
  }, props));
23
- };
23
+ };
24
+ GridWithStyle.isGrid = true;
25
+ var _default = exports.default = GridWithStyle;
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.0-beta.40'
525
+ version: '3.7.0-beta.41'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12227,7 +12227,7 @@ var handleStyle = function handleStyle(style) {
12227
12227
  };
12228
12228
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12229
12229
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12230
- /* harmony default export */ var version = ('3.7.0-beta.40');
12230
+ /* harmony default export */ var version = ('3.7.0-beta.41');
12231
12231
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12232
12232
 
12233
12233
 
@@ -50059,8 +50059,7 @@ var useForm = function useForm(props) {
50059
50059
  resetTime: 0,
50060
50060
  mounted: false,
50061
50061
  unmounted: false,
50062
- removeLock: false,
50063
- settingMap: {}
50062
+ removeLock: false
50064
50063
  }),
50065
50064
  context = _React$useRef.current;
50066
50065
  var update = function update(name) {
@@ -50297,8 +50296,6 @@ var useForm = function useForm(props) {
50297
50296
  // upload组件返回的可能是函数: (prev) => [...prev, file]
50298
50297
  var valueOfKey = typeof vals[key] === 'function' ? vals[key](getValue(key)) : vals[key];
50299
50298
  deepSet(draft, key, valueOfKey, deepSetOptions);
50300
- // 设置 settingMap 用于标记该字段正在被设置值
50301
- context.settingMap[key] = true;
50302
50299
  });
50303
50300
  values.forEach(function (key) {
50304
50301
  if (option.validate) {
@@ -50309,13 +50306,6 @@ var useForm = function useForm(props) {
50309
50306
  });
50310
50307
  }
50311
50308
  });
50312
-
50313
- // 设置 settingMap 的值为 false,表示该字段设置值完成
50314
- setTimeout(function () {
50315
- values.forEach(function (key) {
50316
- delete context.settingMap[key];
50317
- });
50318
- });
50319
50309
  });
50320
50310
 
50321
50311
  // 获取vals的所有key,包括嵌套对象的key
@@ -50494,20 +50484,11 @@ var useForm = function useForm(props) {
50494
50484
  context.updateMap[n] = new Set();
50495
50485
  }
50496
50486
  context.updateMap[n].add(updateFn);
50497
- var shouldTriggerResetChange = context.removeArr.has(n);
50498
50487
  context.removeArr.delete(n);
50499
- var currentValue = deepGet(context.value, n);
50500
- var shouldTriggerDefaultChange = df !== undefined && currentValue === undefined;
50501
- if (shouldTriggerDefaultChange || shouldTriggerResetChange) {
50488
+ if (df !== undefined && deepGet(context.value, n) === undefined) {
50502
50489
  if (!context.mounted) context.defaultValues[n] = df;
50503
- var _defaultValue = df;
50504
-
50505
- // 如果组件是重新 bind ,比如更改了 key 或者通过三元表达式切换了组件但 name 都是相同的情况下,在切换过程中改了 value 的值(比如通过 datum.set),需要阻止 defaultValue 的上位,按照当前的 value 来设置 defaultValue
50506
- if (shouldTriggerResetChange && context.settingMap[n]) {
50507
- _defaultValue = currentValue !== undefined ? currentValue : df;
50508
- }
50509
50490
  onChange(function (v) {
50510
- deepSet(v, n, _defaultValue, deepSetOptions);
50491
+ deepSet(v, n, df, deepSetOptions);
50511
50492
  });
50512
50493
  update(n);
50513
50494
  }
@@ -51629,7 +51610,7 @@ var grid_excluded = ["width", "offset", "responsive", "stretch", "children", "gu
51629
51610
 
51630
51611
 
51631
51612
 
51632
- var Gird = function Gird(props) {
51613
+ var Grid = function Grid(props) {
51633
51614
  var _jssStyle$grid;
51634
51615
  var _props$width = props.width,
51635
51616
  width = _props$width === void 0 ? 1 : _props$width,
@@ -51688,21 +51669,23 @@ var Gird = function Gird(props) {
51688
51669
  })
51689
51670
  }));
51690
51671
  };
51691
- Gird.isGrid = true;
51692
- /* harmony default export */ var grid_grid = (Gird);
51672
+ Grid.isGrid = true;
51673
+ /* harmony default export */ var grid_grid = (Grid);
51693
51674
  ;// CONCATENATED MODULE: ./src/grid/grid.tsx
51694
51675
 
51695
51676
 
51696
51677
 
51697
51678
 
51698
- /* harmony default export */ var src_grid_grid = (function (props) {
51679
+ var GridWithStyle = function GridWithStyle(props) {
51699
51680
  var jssStyle = {
51700
51681
  grid: useGridStyle
51701
51682
  };
51702
51683
  return /*#__PURE__*/(0,jsx_runtime.jsx)(grid_grid, objectSpread2_default()({
51703
51684
  jssStyle: jssStyle
51704
51685
  }, props));
51705
- });
51686
+ };
51687
+ GridWithStyle.isGrid = true;
51688
+ /* harmony default export */ var src_grid_grid = (GridWithStyle);
51706
51689
  ;// CONCATENATED MODULE: ./src/grid/index.ts
51707
51690
 
51708
51691
  var GridComp = src_grid_grid;
@@ -71308,7 +71291,7 @@ var upload_interface = __webpack_require__(8821);
71308
71291
 
71309
71292
 
71310
71293
  /* harmony default export */ var src_0 = ({
71311
- version: '3.7.0-beta.40'
71294
+ version: '3.7.0-beta.41'
71312
71295
  });
71313
71296
  }();
71314
71297
  /******/ return __webpack_exports__;