shineout 3.7.0-beta.22 → 3.7.0-beta.24

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.7.0-beta.22'
525
+ version: '3.7.0-beta.24'
526
526
  };
@@ -2,7 +2,7 @@ import { TagProps as UnStyledTagProps, TagInputProps as UnStyledTagInputProps }
2
2
  /**
3
3
  * @title Tag
4
4
  */
5
- export type TagProps = Omit<UnStyledTagProps, 'jssStyle' | 'inlineStyle'>;
5
+ export type TagProps = Omit<UnStyledTagProps, 'jssStyle' | 'inlineStyle' | 'onMouseDown'>;
6
6
  /**
7
7
  * @title Tag.Input
8
8
  */
package/dist/shineout.js CHANGED
@@ -12226,7 +12226,7 @@ var handleStyle = function handleStyle(style) {
12226
12226
  };
12227
12227
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12228
12228
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12229
- /* harmony default export */ var version = ('3.7.0-beta.22');
12229
+ /* harmony default export */ var version = ('3.7.0-beta.24');
12230
12230
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12231
12231
 
12232
12232
 
@@ -16179,7 +16179,6 @@ var ButtonStyle = {
16179
16179
  borderRadius: src.buttonBorderRadius,
16180
16180
  lineHeight: src.lineHeightDynamic,
16181
16181
  padding: "".concat(src.buttonPaddingY, " ").concat(src.buttonPaddingX),
16182
- transition: 'all .1s linear',
16183
16182
  fontFamily: 'inherit',
16184
16183
  // height: Token.buttonHeight,
16185
16184
 
@@ -16189,6 +16188,9 @@ var ButtonStyle = {
16189
16188
  '[class*="button-group"] > & + &': {
16190
16189
  margin: 0
16191
16190
  },
16191
+ '&:hover': {
16192
+ transition: 'all .1s linear'
16193
+ },
16192
16194
  '&:active': {
16193
16195
  transition: 'none'
16194
16196
  },
@@ -17380,6 +17382,7 @@ var cascaderStyle = objectSpread2_default()(objectSpread2_default()({
17380
17382
  display: 'flex',
17381
17383
  flex: '1',
17382
17384
  minWidth: 0,
17385
+ height: '100%',
17383
17386
  alignItems: 'center',
17384
17387
  lineHeight: src.lineHeightDynamic
17385
17388
  },
@@ -23183,6 +23186,7 @@ var selectStyle = objectSpread2_default()(objectSpread2_default()({
23183
23186
  result: {
23184
23187
  display: 'flex',
23185
23188
  flex: '1',
23189
+ height: '100%',
23186
23190
  minWidth: 0,
23187
23191
  alignItems: 'center',
23188
23192
  lineHeight: src.lineHeightDynamic
@@ -28561,6 +28565,7 @@ var treeSelectStyle = objectSpread2_default()(objectSpread2_default()({
28561
28565
  display: 'flex',
28562
28566
  flex: '1',
28563
28567
  minWidth: 0,
28568
+ height: '100%',
28564
28569
  alignItems: 'center',
28565
28570
  lineHeight: src.lineHeightDynamic
28566
28571
  },
@@ -29940,6 +29945,8 @@ var getPosition = function getPosition(target) {
29940
29945
 
29941
29946
 
29942
29947
  var defaultContext = {
29948
+ addParent: function addParent(_ref) {},
29949
+ removeParent: function removeParent(_ref) {},
29943
29950
  bindChild: function bindChild(_ref) {},
29944
29951
  removeChild: function removeChild(_ref) {}
29945
29952
  };
@@ -29970,21 +29977,32 @@ var usePopup = function usePopup(props) {
29970
29977
  setOpenState = _useState2[1];
29971
29978
  var _useContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(popup_context),
29972
29979
  bindChild = _useContext.bindChild,
29973
- removeChild = _useContext.removeChild;
29980
+ removeChild = _useContext.removeChild,
29981
+ addParent = _useContext.addParent,
29982
+ removeParent = _useContext.removeParent;
29974
29983
  var targetRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
29975
29984
  var popupRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
29976
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
29977
- bindChild(popupRef);
29978
- return function () {
29979
- removeChild(popupRef);
29980
- };
29981
- }, []);
29982
29985
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
29983
29986
  triggerTimer: null,
29984
29987
  // 记录所有的子popup 点击子 popup 不关闭弹窗
29985
29988
  chain: [targetRef, popupRef]
29986
29989
  }),
29987
29990
  context = _useRef.current;
29991
+ var handleAddParent = function handleAddParent(elRef) {
29992
+ context.chain.push(elRef);
29993
+
29994
+ // 继续向上添加当前的 popupRef 到父级
29995
+ addParent(elRef);
29996
+ };
29997
+ var handleRemoveParent = function handleRemoveParent(elRef) {
29998
+ var index = context.chain.findIndex(function (item) {
29999
+ return item === elRef;
30000
+ });
30001
+ if (index > -1) {
30002
+ context.chain.splice(index, 1);
30003
+ removeParent(elRef);
30004
+ }
30005
+ };
29988
30006
  var open = openState;
29989
30007
  var changeOpen = function changeOpen(openIn, delay) {
29990
30008
  if (context.triggerTimer) clearTimeout(context.triggerTimer);
@@ -30014,11 +30032,6 @@ var usePopup = function usePopup(props) {
30014
30032
  updatePosition();
30015
30033
  }
30016
30034
  setOpenState(!!props.open);
30017
-
30018
- // 外部传了open时,需要正常的触发onCollapse;触发了onCollapse才能让组件内部的edit状态正确,否则可能会出现弹出层打开了但是用户却无法选择的情况
30019
- if (props.open !== undefined) {
30020
- changeOpen(!!props.open);
30021
- }
30022
30035
  }, [props.open]);
30023
30036
 
30024
30037
  // const getPopUpHeight = () => {
@@ -30123,8 +30136,13 @@ var usePopup = function usePopup(props) {
30123
30136
  });
30124
30137
  var providerValue = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
30125
30138
  return {
30139
+ addParent: handleAddParent,
30140
+ removeParent: handleRemoveParent,
30126
30141
  bindChild: function bindChild(elRef) {
30127
- context.chain.push(elRef);
30142
+ if (elRef.current) {
30143
+ addParent(elRef);
30144
+ context.chain.push(elRef);
30145
+ }
30128
30146
  },
30129
30147
  removeChild: function removeChild(elRef) {
30130
30148
  var index = context.chain.findIndex(function (item) {
@@ -30132,10 +30150,19 @@ var usePopup = function usePopup(props) {
30132
30150
  });
30133
30151
  if (index > -1) {
30134
30152
  context.chain.splice(index, 1);
30153
+ removeParent(elRef);
30135
30154
  }
30136
30155
  }
30137
30156
  };
30138
30157
  }, []);
30158
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
30159
+ if (open) {
30160
+ bindChild(popupRef);
30161
+ }
30162
+ return function () {
30163
+ removeChild(popupRef);
30164
+ };
30165
+ }, [open]);
30139
30166
  return {
30140
30167
  open: open,
30141
30168
  position: position,
@@ -40354,7 +40381,7 @@ var TagInput = function TagInput(props) {
40354
40381
 
40355
40382
 
40356
40383
 
40357
- var tag_excluded = ["jssStyle", "className", "type", "color", "size", "disabled", "mode", "shape", "children", "onClick", "onClose", "style", "backgroundColor", "inlineStyle", "onKeyUp", "onCompleted", "onEnterPress", "closable"];
40384
+ var tag_excluded = ["jssStyle", "className", "type", "color", "size", "disabled", "mode", "shape", "children", "onClick", "onClose", "style", "backgroundColor", "inlineStyle", "onKeyUp", "onCompleted", "onEnterPress", "closable", "onMouseDown"];
40358
40385
 
40359
40386
 
40360
40387
 
@@ -40385,6 +40412,7 @@ var Tag = function Tag(props) {
40385
40412
  onCompleted = props.onCompleted,
40386
40413
  onEnterPress = props.onEnterPress,
40387
40414
  closable = props.closable,
40415
+ onMouseDown = props.onMouseDown,
40388
40416
  rest = objectWithoutProperties_default()(props, tag_excluded);
40389
40417
  if (props.type) {
40390
40418
  tag_devUseWarning.deprecated('type', 'color', 'Tag');
@@ -40458,6 +40486,7 @@ var Tag = function Tag(props) {
40458
40486
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
40459
40487
  className: tagStyle.closeIcon,
40460
40488
  onClick: handleClose,
40489
+ onMouseDown: onMouseDown,
40461
40490
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
40462
40491
  className: tagStyle.closeIconWrapper,
40463
40492
  children: icons_config.tag.Close
@@ -40612,10 +40641,6 @@ var More = function More(props) {
40612
40641
  className: compressedClassName,
40613
40642
  visible: visible,
40614
40643
  onVisibleChange: setVisible,
40615
- getPopupContainer: function getPopupContainer() {
40616
- var _props$morePopoverCon;
40617
- return (_props$morePopoverCon = props.morePopoverContainer) === null || _props$morePopoverCon === void 0 ? void 0 : _props$morePopoverCon.current;
40618
- },
40619
40644
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
40620
40645
  className: styles.moreWrapper,
40621
40646
  onClick: function onClick(e) {
@@ -40709,6 +40734,7 @@ var result_Result = function Result(props) {
40709
40734
  var render = useRender();
40710
40735
  var resultRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
40711
40736
  var prevMore = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(more);
40737
+ var removeLock = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
40712
40738
  var showInput = allowOnFilter;
40713
40739
  var mounted = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
40714
40740
  var styles = props.classes;
@@ -40784,6 +40810,12 @@ var result_Result = function Result(props) {
40784
40810
  })
40785
40811
  }, 'input');
40786
40812
  };
40813
+ var handleCloseMouseDown = function handleCloseMouseDown() {
40814
+ removeLock.current = true;
40815
+ setTimeout(function () {
40816
+ removeLock.current = false;
40817
+ }, 0);
40818
+ };
40787
40819
  var renderResultItem = function renderResultItem(item, index, nodes, v) {
40788
40820
  var handleClose = function handleClose() {
40789
40821
  onRemove === null || onRemove === void 0 || onRemove(item, v);
@@ -40824,6 +40856,7 @@ var result_Result = function Result(props) {
40824
40856
  className: classnames_default()(styles.tag, more === 1 && styles.tagOnly, resultClassName),
40825
40857
  closable: closeable && 'only',
40826
40858
  onClose: closeable && handleClose,
40859
+ onMouseDown: closeable ? handleCloseMouseDown : undefined,
40827
40860
  onClick: handleClick,
40828
40861
  jssStyle: jssStyle,
40829
40862
  inlineStyle: true
@@ -40910,8 +40943,7 @@ var result_Result = function Result(props) {
40910
40943
  compressed: compressed,
40911
40944
  renderCompressed: renderCompressed,
40912
40945
  compressedClassName: compressedClassName,
40913
- showNum: moreNumber,
40914
- morePopoverContainer: props.morePopoverContainer
40946
+ showNum: moreNumber
40915
40947
  }, 'more');
40916
40948
  var renderResult = function renderResult() {
40917
40949
  if (empty) {
@@ -40940,6 +40972,7 @@ var result_Result = function Result(props) {
40940
40972
  var handleResetMore = function handleResetMore() {
40941
40973
  if (!compressed) return;
40942
40974
  if (isCompressedBound()) return;
40975
+ if (removeLock.current) return;
40943
40976
  setMore(-1);
40944
40977
  setShouldResetMore(true);
40945
40978
  };
@@ -41465,8 +41498,7 @@ var Cascader = function Cascader(props0) {
41465
41498
  onResultItemClick: handleResultItemClick,
41466
41499
  checkUnMatched: checkUnMatched,
41467
41500
  getDataByValues: getDataByValues,
41468
- setInputText: setInputText,
41469
- morePopoverContainer: targetRef
41501
+ setInputText: setInputText
41470
41502
  })
41471
41503
  });
41472
41504
  return /*#__PURE__*/(0,jsx_runtime.jsx)(PopupProvider, {
@@ -41639,6 +41671,9 @@ var Cascader = function Cascader(props0) {
41639
41671
  datum.setValue(value);
41640
41672
  if (!open) return;
41641
41673
  updatePathByValue();
41674
+ if (props.renderOptionList) {
41675
+ updatePath();
41676
+ }
41642
41677
  }, [value, open]);
41643
41678
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
41644
41679
  if (filterText !== undefined) {
@@ -46988,7 +47023,7 @@ var DatePicker = function DatePicker(props0) {
46988
47023
  if (props.open) {
46989
47024
  func.startEdit();
46990
47025
  }
46991
- }, []);
47026
+ }, [props.open]);
46992
47027
  var _usePopup = use_popup({
46993
47028
  open: props.open,
46994
47029
  onCollapse: onCollapse,
@@ -47720,7 +47755,8 @@ var Modal = function Modal(props) {
47720
47755
  renderEd: false,
47721
47756
  isMask: false,
47722
47757
  mouseDownTarget: null,
47723
- mouseUpTarget: null
47758
+ mouseUpTarget: null,
47759
+ content: null
47724
47760
  }),
47725
47761
  context = _useRef.current;
47726
47762
  var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(props.visible || props.autoShow),
@@ -47963,6 +47999,14 @@ var Modal = function Modal(props) {
47963
47999
  if (props.moveable && !props.fullScreen) {
47964
48000
  panelStyle.transform = "translate(".concat(moveInfo.pos.x, "px, ").concat(moveInfo.pos.y, "px)");
47965
48001
  }
48002
+ var renderContent = function renderContent() {
48003
+ if (!props.visible && context.content !== null) return context.content;
48004
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
48005
+ children: [renderHeader(), renderBody(), renderFooter(), renderResize()]
48006
+ });
48007
+ };
48008
+ var content = renderContent();
48009
+ context.content = content;
47966
48010
  return /*#__PURE__*/(0,jsx_runtime.jsx)(FormFooterProvider, {
47967
48011
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
47968
48012
  onClick: function onClick(e) {
@@ -47981,11 +48025,11 @@ var Modal = function Modal(props) {
47981
48025
  onMouseUp: handleMaskMouseUp,
47982
48026
  onClick: handleMaskClick,
47983
48027
  onAnimationStart: updateOrigin,
47984
- children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
48028
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
47985
48029
  ref: panelRef,
47986
48030
  className: classnames_default()(modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.panel, props.className),
47987
48031
  style: panelStyle,
47988
- children: [renderHeader(), renderBody(), renderFooter(), renderResize()]
48032
+ children: content
47989
48033
  })
47990
48034
  }))
47991
48035
  })
@@ -49892,7 +49936,11 @@ var useForm = function useForm(props) {
49892
49936
  fullKeyPaths.forEach(function (key) {
49893
49937
  delete context.serverErrors[key];
49894
49938
  });
49895
- update(fullKeyPaths);
49939
+ if (option.forceUpdate) {
49940
+ update();
49941
+ } else {
49942
+ update(fullKeyPaths);
49943
+ }
49896
49944
  });
49897
49945
  var updateDefaultValue = function updateDefaultValue() {
49898
49946
  if (!context.mounted) return;
@@ -55895,8 +55943,7 @@ function Select(props0) {
55895
55943
  checkUnMatched: checkUnMatched,
55896
55944
  onRemove: handleRemove,
55897
55945
  classes: styles,
55898
- setInputText: setInputText,
55899
- morePopoverContainer: targetRef
55946
+ setInputText: setInputText
55900
55947
  })
55901
55948
  });
55902
55949
  return /*#__PURE__*/(0,jsx_runtime.jsx)(PopupProvider, {
@@ -62298,6 +62345,7 @@ var useTableGroup = function useTableGroup(props) {
62298
62345
  last.colSpan += colSpan;
62299
62346
  if (col.fixed) last.fixed = col.fixed;
62300
62347
  if (col.lastFixed) last.lastFixed = true;
62348
+ if (col.groupProps) last.groupProps = col.groupProps;
62301
62349
  } else {
62302
62350
  var sub = [];
62303
62351
  colSpan = setColumns(sub, col, level + 1, index);
@@ -62310,7 +62358,8 @@ var useTableGroup = function useTableGroup(props) {
62310
62358
  fixed: col.fixed,
62311
62359
  firstFixed: col.firstFixed,
62312
62360
  index: index,
62313
- columns: sub
62361
+ columns: sub,
62362
+ groupProps: col.groupProps
62314
62363
  };
62315
62364
  columns.push(groupCol);
62316
62365
  }
@@ -62772,6 +62821,7 @@ var thead_toNum = toNum;
62772
62821
  };
62773
62822
  };
62774
62823
  var createTh = function createTh(trs, col, level, isLast, columnIndex) {
62824
+ var _colTemp2$groupProps, _colTemp2$groupProps2;
62775
62825
  var colTemp = col;
62776
62826
  var colTemp2 = col;
62777
62827
  var fixedStyle = getFixedStyle(col.fixed, col.index, colTemp2.colSpan || 1, level);
@@ -62826,8 +62876,11 @@ var thead_toNum = toNum;
62826
62876
  var style = typeof colTemp2.name === 'string' ? fixedStyle : objectSpread2_default()({
62827
62877
  padding: 0
62828
62878
  }, fixedStyle);
62879
+ if (colTemp2 !== null && colTemp2 !== void 0 && (_colTemp2$groupProps = colTemp2.groupProps) !== null && _colTemp2$groupProps !== void 0 && _colTemp2$groupProps.style) {
62880
+ style = objectSpread2_default()(objectSpread2_default()({}, style), colTemp2.groupProps.style);
62881
+ }
62829
62882
  trs[level].push( /*#__PURE__*/(0,jsx_runtime.jsx)("th", {
62830
- className: classnames_default()(cellClassName, tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellGroup),
62883
+ className: classnames_default()(cellClassName, tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellGroup, colTemp2 === null || colTemp2 === void 0 || (_colTemp2$groupProps2 = colTemp2.groupProps) === null || _colTemp2$groupProps2 === void 0 ? void 0 : _colTemp2$groupProps2.className),
62831
62884
  style: style,
62832
62885
  colSpan: colTemp2.colSpan,
62833
62886
  dir: config.direction,
@@ -66833,8 +66886,7 @@ var TreeSelect = function TreeSelect(props0) {
66833
66886
  getDataByValues: getResultByValue,
66834
66887
  onRemove: handleRemove,
66835
66888
  classes: styles,
66836
- setInputText: setInputText,
66837
- morePopoverContainer: targetRef
66889
+ setInputText: setInputText
66838
66890
  })
66839
66891
  });
66840
66892
  return /*#__PURE__*/(0,jsx_runtime.jsx)(PopupProvider, {
@@ -70683,7 +70735,7 @@ var upload_interface = __webpack_require__(8821);
70683
70735
 
70684
70736
 
70685
70737
  /* harmony default export */ var src_0 = ({
70686
- version: '3.7.0-beta.22'
70738
+ version: '3.7.0-beta.24'
70687
70739
  });
70688
70740
  }();
70689
70741
  /******/ return __webpack_exports__;