shineout 3.8.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.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.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
  })]
@@ -51118,6 +51128,19 @@ var SchemaBuilder = /*#__PURE__*/function () {
51118
51128
  };
51119
51129
  }
51120
51130
  createClass_default()(SchemaBuilder, [{
51131
+ key: "mapEnumData",
51132
+ value: function mapEnumData(data, format) {
51133
+ return data.map(function (item) {
51134
+ if (typeof format === 'string') {
51135
+ return item ? item[format] : item;
51136
+ } else if (typeof format === 'function' && item) {
51137
+ return format(item);
51138
+ } else {
51139
+ return item;
51140
+ }
51141
+ });
51142
+ }
51143
+ }, {
51121
51144
  key: "updateSchema",
51122
51145
  value: function updateSchema(_ref) {
51123
51146
  var path = _ref.path,
@@ -51194,11 +51217,9 @@ var SchemaBuilder = /*#__PURE__*/function () {
51194
51217
  }
51195
51218
  if (componentElement.props.multiple) {
51196
51219
  fieldSchemaInfo.type = 'array';
51197
- if (itemType !== 'undefined') {
51198
- fieldSchemaInfo.items = {
51199
- type: itemType
51200
- };
51201
- }
51220
+ fieldSchemaInfo.items = {
51221
+ type: itemType !== 'undefined' ? itemType : 'string'
51222
+ };
51202
51223
  } else {
51203
51224
  if (itemType !== 'undefined') {
51204
51225
  fieldSchemaInfo.type = itemType;
@@ -51222,9 +51243,17 @@ var SchemaBuilder = /*#__PURE__*/function () {
51222
51243
  });
51223
51244
  }
51224
51245
  } else {
51225
- fieldSchemaInfo.enum = componentElement.props.data.map(function (item) {
51226
- return (item === null || item === void 0 ? void 0 : item[format]) || item;
51227
- });
51246
+ var enumData = this.mapEnumData(componentElement.props.data, format);
51247
+ if (enumData.length > 0) {
51248
+ if (componentElement.props.multiple) {
51249
+ fieldSchemaInfo.items.enum = enumData;
51250
+ } else {
51251
+ fieldSchemaInfo.enum = enumData;
51252
+ }
51253
+ }
51254
+ }
51255
+ if (componentElement.props.data.length > 0) {
51256
+ fieldSchemaInfo.description += "enumData: ".concat(JSON.stringify(componentElement.props.data), ";");
51228
51257
  }
51229
51258
  break;
51230
51259
  }
@@ -51275,9 +51304,10 @@ var SchemaBuilder = /*#__PURE__*/function () {
51275
51304
  };
51276
51305
  });
51277
51306
  } else {
51278
- fieldSchemaInfo.items.enum = componentElement.props.data.map(function (item) {
51279
- return (item === null || item === void 0 ? void 0 : item[format]) || item;
51280
- });
51307
+ fieldSchemaInfo.items.enum = this.mapEnumData(componentElement.props.data, format);
51308
+ }
51309
+ if (componentElement.props.data.length > 0) {
51310
+ fieldSchemaInfo.description += "enumData: ".concat(JSON.stringify(componentElement.props.data), ";");
51281
51311
  }
51282
51312
  break;
51283
51313
  }
@@ -51309,9 +51339,10 @@ var SchemaBuilder = /*#__PURE__*/function () {
51309
51339
  };
51310
51340
  });
51311
51341
  } else {
51312
- fieldSchemaInfo.enum = componentElement.props.data.map(function (item) {
51313
- return (item === null || item === void 0 ? void 0 : item[format]) || item;
51314
- });
51342
+ fieldSchemaInfo.enum = this.mapEnumData(componentElement.props.data, format);
51343
+ }
51344
+ if (componentElement.props.data.length > 0) {
51345
+ fieldSchemaInfo.description += "enumData: ".concat(JSON.stringify(componentElement.props.data), ";");
51315
51346
  }
51316
51347
  break;
51317
51348
  }
@@ -52653,7 +52684,7 @@ var FormFieldSet = function FormFieldSet(props) {
52653
52684
  },
52654
52685
  children: children({
52655
52686
  list: valueArr,
52656
- value: valueProxy,
52687
+ value: v && typeof_default()(v) === 'object' ? valueProxy : v,
52657
52688
  index: i,
52658
52689
  error: errorList,
52659
52690
  onChange: function onChange(val, options) {
@@ -62894,8 +62925,7 @@ var scroll_table_Scroll = function Scroll(props) {
62894
62925
  var wrapperRef = useForkRef(scrollRef, props.wrapperRef);
62895
62926
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
62896
62927
  isMouseDown: false,
62897
- lastTableHeight: 0,
62898
- unmounted: false
62928
+ lastTableHeight: 0
62899
62929
  }),
62900
62930
  context = _useRef.current;
62901
62931
  var _props$scrollHeight = props.scrollHeight,
@@ -63004,9 +63034,12 @@ var scroll_table_Scroll = function Scroll(props) {
63004
63034
 
63005
63035
  // 非定高的Table但依旧采用了virtual渲染方式,需要渲染出全部的data
63006
63036
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
63007
- if (!props.tableRef.current || context.unmounted) return;
63037
+ if (!props.tableRef.current) return;
63008
63038
  var rootTableHeight = props.tableRef.current.clientHeight;
63009
63039
  var container = containerRef.current;
63040
+ var isContainerVisible = (container === null || container === void 0 ? void 0 : container.offsetParent) !== null;
63041
+ if (!isContainerVisible) return;
63042
+
63010
63043
  // 判断内容滚动高度是否真的超过了容器高度
63011
63044
  var isRealScroll = (container === null || container === void 0 ? void 0 : container.scrollHeight) !== undefined && container.scrollHeight > rootTableHeight;
63012
63045
  // 判断Table的根节点dom高度是否发生变化,如果变化了,则是因为不定高,被内部元素撑高了导致的
@@ -63016,9 +63049,6 @@ var scroll_table_Scroll = function Scroll(props) {
63016
63049
  } else {
63017
63050
  context.lastTableHeight = rootTableHeight;
63018
63051
  }
63019
- return function () {
63020
- context.unmounted = true;
63021
- };
63022
63052
  }, [paddingTop]);
63023
63053
  if (props.isEmpty) {
63024
63054
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({}, scrollRoleProps), {}, {
@@ -66182,6 +66212,7 @@ var emptyRef = {
66182
66212
  props.onScroll(info.x, info.y, info.scrollLeft, info.scrollTop);
66183
66213
  }
66184
66214
  syncHeaderScroll(info.scrollLeft);
66215
+ if (props.virtual !== "lazy") return;
66185
66216
  if (context.scrollingTimer) {
66186
66217
  clearTimeout(context.scrollingTimer);
66187
66218
  }
@@ -66340,11 +66371,12 @@ var emptyRef = {
66340
66371
  }));
66341
66372
  };
66342
66373
  var renderBottomMirrorScroller = function renderBottomMirrorScroller() {
66343
- var _scrollRef$current5, _scrollRef$current6, _scrollRef$current7;
66374
+ var _scrollRef$current5, _scrollRef$current6, _scrollRef$current7, _scrollRef$current8, _scrollRef$current9;
66344
66375
  if (!props.showBottomScrollbar) return null;
66345
66376
  var scrollRefWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current5 = scrollRef.current) === null || _scrollRef$current5 === void 0 ? void 0 : _scrollRef$current5.clientWidth) || 0;
66346
66377
  var scrollRefScrollWidth = (scrollRef === null || scrollRef === void 0 || (_scrollRef$current6 = scrollRef.current) === null || _scrollRef$current6 === void 0 ? void 0 : _scrollRef$current6.scrollWidth) || 0;
66347
- 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);
66348
66380
  var showScroll = scrollRefScrollWidth > scrollRefWidth;
66349
66381
  // 开启了双滚,但是没有滚动条,不显示
66350
66382
  if (!scrollRefWidth || !mirrorScrollRefWidth || !showScroll) return null;
@@ -66352,7 +66384,8 @@ var emptyRef = {
66352
66384
  var scrollerStickyProps = {
66353
66385
  bottom: options.bottom || 0,
66354
66386
  zIndex: options.zIndex || defaultZIndex + 1,
66355
- 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
66356
66389
  };
66357
66390
  return /*#__PURE__*/(0,jsx_runtime.jsx)(src_sticky_sticky, objectSpread2_default()(objectSpread2_default()({}, scrollerStickyProps), {}, {
66358
66391
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
@@ -66371,7 +66404,7 @@ var emptyRef = {
66371
66404
  ref: bottomMirrorScrollRef,
66372
66405
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
66373
66406
  style: {
66374
- 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,
66375
66408
  height: 1
66376
66409
  }
66377
66410
  })
@@ -66486,10 +66519,10 @@ var emptyRef = {
66486
66519
  theadRef.current.parentElement.scrollLeft = left;
66487
66520
  });
66488
66521
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
66489
- var _scrollRef$current8;
66522
+ var _scrollRef$current10;
66490
66523
  if (!props.sticky || !scrollRef.current || !isScrollX) return;
66491
66524
  // sticky场景下,从空数据到有数据切换时,同步一次滚动条的位置
66492
- 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);
66493
66526
  }, [isScrollX, props.sticky, $empty]);
66494
66527
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
66495
66528
  // 绑定 wheel 事件
@@ -73067,7 +73100,7 @@ var upload_interface = __webpack_require__(8821);
73067
73100
 
73068
73101
 
73069
73102
  /* harmony default export */ var src_0 = ({
73070
- version: '3.8.1'
73103
+ version: '3.8.2-beta.10'
73071
73104
  });
73072
73105
  }();
73073
73106
  /******/ return __webpack_exports__;