shineout 3.8.2-beta.1 → 3.8.2-beta.10

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
@@ -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.8.2-beta.1'
525
+ version: '3.8.2-beta.10'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12386,7 +12386,7 @@ var handleStyle = function handleStyle(style) {
12386
12386
  };
12387
12387
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12388
12388
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12389
- /* harmony default export */ var version = ('3.8.2-beta.1');
12389
+ /* harmony default export */ var version = ('3.8.2-beta.10');
12390
12390
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12391
12391
 
12392
12392
 
@@ -41901,18 +41901,25 @@ var More = function More(props) {
41901
41901
  visible = _useState2[0],
41902
41902
  setVisible = _useState2[1];
41903
41903
  var styles = classes;
41904
- var shouldShowMore = showNum < 0 || showNum >= data.length;
41904
+ var shouldShowMore = !showNum || showNum < 0 || showNum >= data.length;
41905
41905
  var before = [];
41906
41906
  var after = [];
41907
41907
  var afterLength = 0;
41908
41908
  if (!shouldShowMore) {
41909
- before = new Array(showNum).fill(undefined).map(function (_item, index) {
41909
+ var validShowNum = showNum || 0;
41910
+ before = new Array(validShowNum).fill(undefined).map(function (_item, index) {
41910
41911
  return data[index];
41911
41912
  });
41912
- after = new Array(data.length - showNum).fill(undefined).map(function (_item, index) {
41913
- return data[showNum + index];
41914
- });
41915
- afterLength = after.length;
41913
+ var afterCount = Math.max(0, data.length - validShowNum);
41914
+ try {
41915
+ after = new Array(afterCount).fill(undefined).map(function (_item, index) {
41916
+ return data[validShowNum + index];
41917
+ });
41918
+ afterLength = after.length;
41919
+ } catch (error) {
41920
+ after = [];
41921
+ afterLength = 0;
41922
+ }
41916
41923
  }
41917
41924
  if (shouldShowMore) {
41918
41925
  return /*#__PURE__*/(0,jsx_runtime.jsxs)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
@@ -41954,6 +41961,9 @@ var More = function More(props) {
41954
41961
  onClick: function onClick(e) {
41955
41962
  return e.stopPropagation();
41956
41963
  },
41964
+ onScroll: function onScroll(e) {
41965
+ return e.stopPropagation();
41966
+ },
41957
41967
  children: [compressed === 'no-repeat' ? null : before, after]
41958
41968
  })
41959
41969
  })]
@@ -51235,9 +51245,16 @@ var SchemaBuilder = /*#__PURE__*/function () {
51235
51245
  } else {
51236
51246
  var enumData = this.mapEnumData(componentElement.props.data, format);
51237
51247
  if (enumData.length > 0) {
51238
- fieldSchemaInfo.enum = enumData;
51248
+ if (componentElement.props.multiple) {
51249
+ fieldSchemaInfo.items.enum = enumData;
51250
+ } else {
51251
+ fieldSchemaInfo.enum = enumData;
51252
+ }
51239
51253
  }
51240
51254
  }
51255
+ if (componentElement.props.data.length > 0) {
51256
+ fieldSchemaInfo.description += "enumData: ".concat(JSON.stringify(componentElement.props.data), ";");
51257
+ }
51241
51258
  break;
51242
51259
  }
51243
51260
  case 'ShineoutDatePicker':
@@ -51289,6 +51306,9 @@ var SchemaBuilder = /*#__PURE__*/function () {
51289
51306
  } else {
51290
51307
  fieldSchemaInfo.items.enum = this.mapEnumData(componentElement.props.data, format);
51291
51308
  }
51309
+ if (componentElement.props.data.length > 0) {
51310
+ fieldSchemaInfo.description += "enumData: ".concat(JSON.stringify(componentElement.props.data), ";");
51311
+ }
51292
51312
  break;
51293
51313
  }
51294
51314
  case 'ShineoutRadio':
@@ -51321,6 +51341,9 @@ var SchemaBuilder = /*#__PURE__*/function () {
51321
51341
  } else {
51322
51342
  fieldSchemaInfo.enum = this.mapEnumData(componentElement.props.data, format);
51323
51343
  }
51344
+ if (componentElement.props.data.length > 0) {
51345
+ fieldSchemaInfo.description += "enumData: ".concat(JSON.stringify(componentElement.props.data), ";");
51346
+ }
51324
51347
  break;
51325
51348
  }
51326
51349
  case 'ShineoutSwitch':
@@ -52661,7 +52684,7 @@ var FormFieldSet = function FormFieldSet(props) {
52661
52684
  },
52662
52685
  children: children({
52663
52686
  list: valueArr,
52664
- value: valueProxy,
52687
+ value: v && typeof_default()(v) === 'object' ? valueProxy : v,
52665
52688
  index: i,
52666
52689
  error: errorList,
52667
52690
  onChange: function onChange(val, options) {
@@ -62902,8 +62925,7 @@ var scroll_table_Scroll = function Scroll(props) {
62902
62925
  var wrapperRef = useForkRef(scrollRef, props.wrapperRef);
62903
62926
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
62904
62927
  isMouseDown: false,
62905
- lastTableHeight: 0,
62906
- unmounted: false
62928
+ lastTableHeight: 0
62907
62929
  }),
62908
62930
  context = _useRef.current;
62909
62931
  var _props$scrollHeight = props.scrollHeight,
@@ -63012,9 +63034,12 @@ var scroll_table_Scroll = function Scroll(props) {
63012
63034
 
63013
63035
  // 非定高的Table但依旧采用了virtual渲染方式,需要渲染出全部的data
63014
63036
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
63015
- if (!props.tableRef.current || context.unmounted) return;
63037
+ if (!props.tableRef.current) return;
63016
63038
  var rootTableHeight = props.tableRef.current.clientHeight;
63017
63039
  var container = containerRef.current;
63040
+ var isContainerVisible = (container === null || container === void 0 ? void 0 : container.offsetParent) !== null;
63041
+ if (!isContainerVisible) return;
63042
+
63018
63043
  // 判断内容滚动高度是否真的超过了容器高度
63019
63044
  var isRealScroll = (container === null || container === void 0 ? void 0 : container.scrollHeight) !== undefined && container.scrollHeight > rootTableHeight;
63020
63045
  // 判断Table的根节点dom高度是否发生变化,如果变化了,则是因为不定高,被内部元素撑高了导致的
@@ -63024,9 +63049,6 @@ var scroll_table_Scroll = function Scroll(props) {
63024
63049
  } else {
63025
63050
  context.lastTableHeight = rootTableHeight;
63026
63051
  }
63027
- return function () {
63028
- context.unmounted = true;
63029
- };
63030
63052
  }, [paddingTop]);
63031
63053
  if (props.isEmpty) {
63032
63054
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({}, scrollRoleProps), {}, {
@@ -66190,6 +66212,7 @@ var emptyRef = {
66190
66212
  props.onScroll(info.x, info.y, info.scrollLeft, info.scrollTop);
66191
66213
  }
66192
66214
  syncHeaderScroll(info.scrollLeft);
66215
+ if (props.virtual !== "lazy") return;
66193
66216
  if (context.scrollingTimer) {
66194
66217
  clearTimeout(context.scrollingTimer);
66195
66218
  }
@@ -66348,11 +66371,12 @@ var emptyRef = {
66348
66371
  }));
66349
66372
  };
66350
66373
  var renderBottomMirrorScroller = function renderBottomMirrorScroller() {
66351
- var _scrollRef$current5, _scrollRef$current6, _scrollRef$current7;
66374
+ var _scrollRef$current5, _scrollRef$current6, _scrollRef$current7, _scrollRef$current8, _scrollRef$current9;
66352
66375
  if (!props.showBottomScrollbar) return null;
66353
66376
  var scrollRefWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current5 = scrollRef.current) === null || _scrollRef$current5 === void 0 ? void 0 : _scrollRef$current5.clientWidth) || 0;
66354
66377
  var scrollRefScrollWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current6 = scrollRef.current) === null || _scrollRef$current6 === void 0 ? void 0 : _scrollRef$current6.scrollWidth) || 0;
66355
- var mirrorScrollRefWidth = scrollRefWidth + scrollBarWidth;
66378
+ var hasVerticalScroll = ((scrollRef === null || scrollRef === void 0 || (_scrollRef$current7 = scrollRef.current) === null || _scrollRef$current7 === void 0 ? void 0 : _scrollRef$current7.scrollHeight) || 0) > ((scrollRef === null || scrollRef === void 0 || (_scrollRef$current8 = scrollRef.current) === null || _scrollRef$current8 === void 0 ? void 0 : _scrollRef$current8.clientHeight) || 0);
66379
+ var mirrorScrollRefWidth = scrollRefWidth + (hasVerticalScroll ? 0 : scrollBarWidth);
66356
66380
  var showScroll = scrollRefScrollWidth > scrollRefWidth;
66357
66381
  // 开启了双滚,但是没有滚动条,不显示
66358
66382
  if (!scrollRefWidth || !mirrorScrollRefWidth || !showScroll) return null;
@@ -66360,7 +66384,8 @@ var emptyRef = {
66360
66384
  var scrollerStickyProps = {
66361
66385
  bottom: options.bottom || 0,
66362
66386
  zIndex: options.zIndex || defaultZIndex + 1,
66363
- parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
66387
+ parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current,
66388
+ scrollContainer: options.scrollContainer
66364
66389
  };
66365
66390
  return /*#__PURE__*/(0,jsx_runtime.jsx)(src_sticky_sticky, objectSpread2_default()(objectSpread2_default()({}, scrollerStickyProps), {}, {
66366
66391
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
@@ -66379,7 +66404,7 @@ var emptyRef = {
66379
66404
  ref: bottomMirrorScrollRef,
66380
66405
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
66381
66406
  style: {
66382
- width: scrollRef === null || scrollRef === void 0 || (_scrollRef$current7 = scrollRef.current) === null || _scrollRef$current7 === void 0 ? void 0 : _scrollRef$current7.scrollWidth,
66407
+ width: scrollRef === null || scrollRef === void 0 || (_scrollRef$current9 = scrollRef.current) === null || _scrollRef$current9 === void 0 ? void 0 : _scrollRef$current9.scrollWidth,
66383
66408
  height: 1
66384
66409
  }
66385
66410
  })
@@ -66494,10 +66519,10 @@ var emptyRef = {
66494
66519
  theadRef.current.parentElement.scrollLeft = left;
66495
66520
  });
66496
66521
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
66497
- var _scrollRef$current8;
66522
+ var _scrollRef$current10;
66498
66523
  if (!props.sticky || !scrollRef.current || !isScrollX) return;
66499
66524
  // sticky场景下,从空数据到有数据切换时,同步一次滚动条的位置
66500
- syncHeaderScroll(((_scrollRef$current8 = scrollRef.current) === null || _scrollRef$current8 === void 0 ? void 0 : _scrollRef$current8.scrollLeft) || 0);
66525
+ syncHeaderScroll(((_scrollRef$current10 = scrollRef.current) === null || _scrollRef$current10 === void 0 ? void 0 : _scrollRef$current10.scrollLeft) || 0);
66501
66526
  }, [isScrollX, props.sticky, $empty]);
66502
66527
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
66503
66528
  // 绑定 wheel 事件
@@ -73075,7 +73100,7 @@ var upload_interface = __webpack_require__(8821);
73075
73100
 
73076
73101
 
73077
73102
  /* harmony default export */ var src_0 = ({
73078
- version: '3.8.2-beta.1'
73103
+ version: '3.8.2-beta.10'
73079
73104
  });
73080
73105
  }();
73081
73106
  /******/ return __webpack_exports__;