shineout 3.1.7 → 3.1.9-beta.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
@@ -476,5 +476,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
476
476
  // 此文件由脚本自动生成,请勿直接修改。
477
477
  // This file was generated automatically by a script. Please do not modify it directly.
478
478
  var _default = exports.default = {
479
- version: '3.1.7'
479
+ version: '3.1.9-beta.1'
480
480
  };
@@ -5,7 +5,7 @@ export declare const TRANSFORMS: {
5
5
  MozTransform: string;
6
6
  transform: string;
7
7
  };
8
- export declare function getTransformName(): "transform" | "webkitTransform" | "msTransform" | "OTransform" | "MozTransform";
8
+ export declare function getTransformName(): "transform" | "msTransform" | "OTransform" | "webkitTransform" | "MozTransform";
9
9
  export declare function has3d(): boolean;
10
10
  export declare const eventPassive: boolean | {
11
11
  passive: boolean;
package/dist/shineout.js CHANGED
@@ -11949,7 +11949,7 @@ var handleStyle = function handleStyle(style) {
11949
11949
  };
11950
11950
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11951
11951
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11952
- /* harmony default export */ var version = ('3.1.7');
11952
+ /* harmony default export */ var version = ('3.1.9-beta.1');
11953
11953
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11954
11954
 
11955
11955
 
@@ -33881,18 +33881,14 @@ function castImmutable(value) {
33881
33881
  }
33882
33882
 
33883
33883
  ;// CONCATENATED MODULE: ../hooks/src/utils/immer.ts
33884
- // import { produce as produce2, getSnapshot } from '@shined/reactive/vanilla';
33885
33884
 
33886
- // export const produce = ((...args: any) => {
33887
- // return produce2.apply(null, args);
33888
- // }) as typeof produce2;
33889
33885
 
33890
- // export const current = getSnapshot;
33891
-
33892
-
33893
-
33894
- var utils_immer_produce = function produce(value, cb) {
33895
- return immer_produce(value, cb);
33886
+ var utils_immer_produce = function produce() {
33887
+ setAutoFreeze(false);
33888
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
33889
+ args[_key] = arguments[_key];
33890
+ }
33891
+ return immer_produce.apply(null, args);
33896
33892
  };
33897
33893
  ;// CONCATENATED MODULE: ../hooks/src/utils/clone.ts
33898
33894
 
@@ -46607,7 +46603,7 @@ var Scroll = function Scroll(props) {
46607
46603
  position: 'sticky'
46608
46604
  }, isRtl ? 'right' : 'left', 0), "top", 0);
46609
46605
  var placeStyle = defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({
46610
- marginTop: Math.max(0, scrollHeight - height)
46606
+ marginTop: Math.max(0, Math.floor(scrollHeight - height))
46611
46607
  }, "margin".concat(isRtl ? 'Left' : 'Right'), scrollWidth), "height", 0), "width", 0), "overflow", 'hidden');
46612
46608
  var handleScroll = usePersistFn(function (e) {
46613
46609
  var target = e.currentTarget;
@@ -47634,7 +47630,7 @@ var Node = function Node(props) {
47634
47630
  var children = data[childrenKey];
47635
47631
  var hasChildren = children && children.length > 0;
47636
47632
  var contentStyle = (jssStyle === null || jssStyle === void 0 ? void 0 : jssStyle.tree()) || {};
47637
- var rootClass = classnames_default()(contentStyle.node, isLeaf() && leafClass, isString(nodeClass) && nodeClass, isFunc(nodeClass) && nodeClass(data), defineProperty_default()({}, contentStyle.leaf, !hasChildren));
47633
+ var rootClass = classnames_default()(contentStyle.node, isLeaf() && (isString(leafClass) ? leafClass : isFunc(leafClass) && leafClass(data)), isString(nodeClass) && nodeClass, isFunc(nodeClass) && nodeClass(data), defineProperty_default()({}, contentStyle.leaf, !hasChildren));
47638
47634
  if (placeElement) {
47639
47635
  placeElement.className = contentStyle.placement;
47640
47636
  }
@@ -48129,6 +48125,10 @@ var Tree = function Tree(props) {
48129
48125
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
48130
48126
  handleUpdateExpanded(expanded);
48131
48127
  }, [expanded]);
48128
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
48129
+ if (!active) return;
48130
+ handleUpdateActive(active);
48131
+ }, [active]);
48132
48132
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
48133
48133
  if (getDatum) getDatum(datum);
48134
48134
  }, []);
@@ -53837,7 +53837,8 @@ var useTableLayout = function useTableLayout(props) {
53837
53837
  changeColGroup(newCols, false);
53838
53838
  });
53839
53839
  var checkFloat = use_persist_fn(function () {
53840
- var scrollEl = scrollRef.current;
53840
+ var scrollEl = scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current;
53841
+ if (!scrollEl) return;
53841
53842
  var max = scrollEl.scrollWidth - scrollEl.clientWidth;
53842
53843
  var min = 0;
53843
53844
  var left = scrollEl.scrollLeft;
@@ -55446,10 +55447,12 @@ var Tr = function Tr(props) {
55446
55447
 
55447
55448
 
55448
55449
 
55450
+
55449
55451
  var tfoot_isArray = isArray;
55450
55452
  /* harmony default export */ var tfoot = (function (props) {
55451
55453
  var _props$jssStyle, _props$jssStyle$table;
55452
55454
  var tableClasses = (_props$jssStyle = props.jssStyle) === null || _props$jssStyle === void 0 || (_props$jssStyle$table = _props$jssStyle.table) === null || _props$jssStyle$table === void 0 ? void 0 : _props$jssStyle$table.call(_props$jssStyle);
55455
+ var config = useConfig();
55453
55456
  var getFixedStyle = function getFixedStyle(fixed, index, colSpan) {
55454
55457
  var colgroup = props.colgroup;
55455
55458
  if (fixed === 'left') {
@@ -55502,9 +55505,10 @@ var tfoot_isArray = isArray;
55502
55505
  }
55503
55506
  }
55504
55507
  return /*#__PURE__*/(0,jsx_runtime.jsx)("td", {
55508
+ dir: config.direction,
55505
55509
  colSpan: colSpan,
55506
55510
  style: getFixedStyle(fixed.fixed, index, colSpan),
55507
- className: classnames_default()(fixed['fixed'] === 'left' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), fixed['fixed'] === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), (fixed.lastFixed || fixed.firstFixed) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLast), isLast && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellIgnoreBorder)),
55511
+ className: classnames_default()(fixed['fixed'] === 'left' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), fixed['fixed'] === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), fixed.firstFixed && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), fixed.lastFixed && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), (fixed.lastFixed || fixed.firstFixed) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLast), isLast && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellIgnoreBorder)),
55508
55512
  children: content
55509
55513
  }, index);
55510
55514
  };
@@ -55569,6 +55573,9 @@ var virtualScrollerStyle = {
55569
55573
  overflow: 'auto',
55570
55574
  width: '100%'
55571
55575
  };
55576
+ var table_emptyStyle = objectSpread2_default()(objectSpread2_default()({}, virtualScrollerStyle), {}, {
55577
+ height: 0
55578
+ });
55572
55579
  var scrollWrapperStyle = {
55573
55580
  flex: 1,
55574
55581
  minHeight: 0,
@@ -55739,6 +55746,18 @@ var emptyRef = {
55739
55746
  e.preventDefault();
55740
55747
  scrollEl.scrollLeft = Math.min(Math.max(scrollLeft, 0), max);
55741
55748
  });
55749
+ var handleBodyScroll = usePersistFn(function (e) {
55750
+ var target = e.currentTarget;
55751
+ if (!target) return;
55752
+ layoutFunc.checkFloat();
55753
+ if (props.onScroll && typeof props.onScroll === 'function') {
55754
+ var maxWidth = target.scrollWidth - target.clientWidth;
55755
+ var maxHeight = target.scrollHeight - target.clientHeight;
55756
+ var x = Math.min(target.scrollLeft / maxWidth, 1);
55757
+ var y = Math.min(target.scrollTop / maxHeight, 1);
55758
+ props.onScroll(x, y, target.scrollLeft);
55759
+ }
55760
+ });
55742
55761
  var handleVirtualScroll = usePersistFn(function (info) {
55743
55762
  virtualInfo.handleScroll(info);
55744
55763
  layoutFunc.checkFloat();
@@ -55757,7 +55776,7 @@ var emptyRef = {
55757
55776
  });
55758
55777
  };
55759
55778
  var renderTable = function renderTable() {
55760
- var _props$summary, _sticky$top;
55779
+ var _props$summary, _sticky$top, _props$data3, _props$data4;
55761
55780
  var Group = /*#__PURE__*/(0,jsx_runtime.jsx)(table_colgroup, {
55762
55781
  colgroup: colgroup,
55763
55782
  columns: columns,
@@ -55830,6 +55849,20 @@ var emptyRef = {
55830
55849
  css: sticky === null || sticky === void 0 ? void 0 : sticky.css,
55831
55850
  parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
55832
55851
  };
55852
+ if (!virtual && !isScrollY && !props.sticky && (_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length) {
55853
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
55854
+ ref: scrollRef,
55855
+ className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.bodyWrapper,
55856
+ onScroll: handleBodyScroll,
55857
+ children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
55858
+ style: {
55859
+ width: width
55860
+ },
55861
+ ref: tbodyRef,
55862
+ children: [Group, !props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(thead, objectSpread2_default()({}, headCommonProps)), /*#__PURE__*/(0,jsx_runtime.jsx)(tbody, objectSpread2_default()({}, bodyCommonProps)), /*#__PURE__*/(0,jsx_runtime.jsx)(tfoot, objectSpread2_default()({}, footCommonProps))]
55863
+ })
55864
+ });
55865
+ }
55833
55866
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
55834
55867
  children: [!props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(Wrapper, objectSpread2_default()(objectSpread2_default()({}, props.sticky ? stickyProps : {}), {}, {
55835
55868
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
@@ -55848,7 +55881,7 @@ var emptyRef = {
55848
55881
  })
55849
55882
  })), /*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_scroll, {
55850
55883
  style: scrollWrapperStyle,
55851
- scrollerStyle: virtualScrollerStyle,
55884
+ scrollerStyle: (_props$data4 = props.data) !== null && _props$data4 !== void 0 && _props$data4.length ? virtualScrollerStyle : table_emptyStyle,
55852
55885
  wrapperRef: scrollRef,
55853
55886
  scrollWidth: width || 1,
55854
55887
  scrollHeight: virtual ? virtualInfo.scrollHeight : tbodyHeight,
@@ -57850,13 +57883,13 @@ var useTreeSelect = function useTreeSelect(props) {
57850
57883
  }
57851
57884
  if (!multiple && isArray(v)) {
57852
57885
  onChange === null || onChange === void 0 || onChange.apply(void 0, [v[0]].concat(reset));
57853
- }
57854
- if (multiple && !isArray(v)) {
57886
+ } else if (multiple && !isArray(v)) {
57855
57887
  if (v === undefined || v === null) {
57856
57888
  onChange === null || onChange === void 0 || onChange.apply(void 0, [[]].concat(reset));
57857
57889
  } else onChange === null || onChange === void 0 || onChange.apply(void 0, [[v]].concat(reset));
57890
+ } else {
57891
+ onChange === null || onChange === void 0 || onChange.apply(void 0, [v].concat(reset));
57858
57892
  }
57859
- onChange === null || onChange === void 0 || onChange.apply(void 0, [v].concat(reset));
57860
57893
  });
57861
57894
  return {
57862
57895
  value: valueArr,
@@ -58018,6 +58051,7 @@ var TreeSelect = function TreeSelect(props0) {
58018
58051
  data: data,
58019
58052
  unmatch: unmatch,
58020
58053
  disabled: disabled,
58054
+ active: multiple ? undefined : value[0],
58021
58055
  childrenKey: childrenKey,
58022
58056
  keygen: keygen,
58023
58057
  onExpand: onExpand,
@@ -58383,7 +58417,7 @@ var TreeSelect = function TreeSelect(props0) {
58383
58417
  } else {
58384
58418
  treeProps.onClick = handleTreeClick;
58385
58419
  treeProps.renderItem = renderActive;
58386
- treeProps.active = value;
58420
+ treeProps.active = value[0];
58387
58421
  }
58388
58422
  if ('expanded' in props) {
58389
58423
  treeProps.expanded = expanded;
@@ -58404,6 +58438,7 @@ var TreeSelect = function TreeSelect(props0) {
58404
58438
  keygen: keygen,
58405
58439
  unmatch: unmatch,
58406
58440
  value: value,
58441
+ highlight: true,
58407
58442
  loader: loader,
58408
58443
  onExpand: onExpandTree,
58409
58444
  expanded: controlExpanded,
@@ -62041,7 +62076,7 @@ var upload_interface = __webpack_require__(4412);
62041
62076
 
62042
62077
 
62043
62078
  /* harmony default export */ var src_0 = ({
62044
- version: '3.1.7'
62079
+ version: '3.1.9-beta.1'
62045
62080
  });
62046
62081
  }();
62047
62082
  /******/ return __webpack_exports__;