shineout 3.3.0-beta.6 → 3.3.0-beta.7

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.3.0-beta.6'
479
+ version: '3.3.0-beta.7'
480
480
  };
package/dist/shineout.js CHANGED
@@ -11960,7 +11960,7 @@ var handleStyle = function handleStyle(style) {
11960
11960
  };
11961
11961
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11962
11962
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11963
- /* harmony default export */ var version = ('3.3.0-beta.6');
11963
+ /* harmony default export */ var version = ('3.3.0-beta.7');
11964
11964
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11965
11965
 
11966
11966
 
@@ -22001,6 +22001,7 @@ var selectStyle = objectSpread2_default()(objectSpread2_default()({
22001
22001
  display: 'block',
22002
22002
  overflow: 'hidden',
22003
22003
  textOverflow: 'ellipsis',
22004
+ flex: 1,
22004
22005
  whiteSpace: 'nowrap',
22005
22006
  marginTop: src.selectPlaceholderMarginY,
22006
22007
  marginBottom: src.selectPlaceholderMarginY
@@ -26862,6 +26863,7 @@ var treeSelectStyle = objectSpread2_default()(objectSpread2_default()({
26862
26863
  display: 'block',
26863
26864
  overflow: 'hidden',
26864
26865
  textOverflow: 'ellipsis',
26866
+ flex: 1,
26865
26867
  whiteSpace: 'nowrap',
26866
26868
  marginTop: src.treeSelectPlaceholderMarginY,
26867
26869
  marginBottom: src.treeSelectPlaceholderMarginY
@@ -44810,6 +44812,15 @@ function spliceValue(obj, name, index) {
44810
44812
  delete obj[n];
44811
44813
  });
44812
44814
  }
44815
+ ;// CONCATENATED MODULE: ../hooks/src/common/use-default-value/use-previous.ts
44816
+
44817
+ function use_previous_usePrevious(value) {
44818
+ var ref = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
44819
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
44820
+ ref.current = value;
44821
+ });
44822
+ return ref.current;
44823
+ }
44813
44824
  ;// CONCATENATED MODULE: ../hooks/src/components/use-form/use-form.ts
44814
44825
 
44815
44826
 
@@ -44821,6 +44832,7 @@ function spliceValue(obj, name, index) {
44821
44832
 
44822
44833
 
44823
44834
 
44835
+
44824
44836
  var globalKey = '__global__&&@@';
44825
44837
 
44826
44838
 
@@ -44848,6 +44860,7 @@ var useForm = function useForm(props) {
44848
44860
  removeUndefined: removeUndefined,
44849
44861
  forceSet: true
44850
44862
  };
44863
+ var preValue = use_previous_usePrevious(props.value);
44851
44864
  var formRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
44852
44865
  var _React$useRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({
44853
44866
  defaultValues: {},
@@ -45218,8 +45231,8 @@ var useForm = function useForm(props) {
45218
45231
  var updateValue = function updateValue() {
45219
45232
  if (props.value !== context.lastValue && props.value !== context.value) {
45220
45233
  context.value = deepClone(props.value) || emptyObj;
45221
- context.lastValue = props.value;
45222
45234
  }
45235
+ context.lastValue = props.value;
45223
45236
  };
45224
45237
  updateValue();
45225
45238
  external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
@@ -45242,14 +45255,13 @@ var useForm = function useForm(props) {
45242
45255
  if (props.value === context.value) return;
45243
45256
  if (initValidate && !context.resetTime) {
45244
45257
  var keys = Object.keys(context.validateMap).filter(function (key) {
45245
- var oldValue = deepGet(context.lastValue || emptyObj, key);
45258
+ var oldValue = deepGet(preValue || emptyObj, key);
45246
45259
  var newValue = deepGet(context.value || emptyObj, key);
45247
45260
  return !shallowEqual(oldValue, newValue);
45248
45261
  });
45249
45262
  validateFields(keys).catch(function () {});
45250
45263
  }
45251
45264
  update();
45252
- context.lastValue = props.value;
45253
45265
  context.resetTime = 0;
45254
45266
  }, [props.value]);
45255
45267
  external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
@@ -56467,6 +56479,14 @@ var Tr = function Tr(props) {
56467
56479
  var fixedStyle = getFixedStyle(column.fixed, index, colSpan);
56468
56480
  return objectSpread2_default()(objectSpread2_default()({}, column.style), fixedStyle);
56469
56481
  };
56482
+ var handleCellClick = usePersistFn(function (data, colIndex) {
56483
+ if (!props.onCellClick) return;
56484
+ props.onCellClick(data, {
56485
+ rowIndex: props.rowIndex,
56486
+ columnIndex: colIndex,
56487
+ columnKey: props.columns[colIndex].key
56488
+ });
56489
+ });
56470
56490
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
56471
56491
  if (props.setRowHeight && trRef.current) {
56472
56492
  var expandHeight = expandRef.current ? expandRef.current.getBoundingClientRect().height : 0;
@@ -56594,6 +56614,9 @@ var Tr = function Tr(props) {
56594
56614
  className: classnames_default()(col.className, col.type === 'checkbox' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellCheckbox), col.fixed === 'left' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), col.fixed === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), col.align === 'center' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignCenter), col.align === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignRight), (col.lastFixed || col.firstFixed || last.lastFixed) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLast), lastRowIndex === i && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellIgnoreBorder), props.isCellHover(props.rowIndex, data[i].rowSpan) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellHover)),
56595
56615
  style: getTdStyle(col, data[i].colSpan),
56596
56616
  dir: config.direction,
56617
+ onClick: props.onCellClick ? function () {
56618
+ return handleCellClick(data[i].data, i);
56619
+ } : undefined,
56597
56620
  children: renderContent(col, data[i].data)
56598
56621
  }, col.key);
56599
56622
  tds.push(td);
@@ -56735,7 +56758,8 @@ var Tr = function Tr(props) {
56735
56758
  disabled: props.datum.disabledCheck(item),
56736
56759
  bodyScrollWidth: props.bodyScrollWidth,
56737
56760
  resizeFlag: props.resizeFlag,
56738
- treeCheckAll: props.treeCheckAll
56761
+ treeCheckAll: props.treeCheckAll,
56762
+ onCellClick: props.onCellClick
56739
56763
  }, originKey);
56740
56764
  };
56741
56765
  return /*#__PURE__*/(0,jsx_runtime.jsx)("tbody", {
@@ -57116,7 +57140,8 @@ var emptyRef = {
57116
57140
  rowEvents: props.rowEvents,
57117
57141
  bodyScrollWidth: scrollWidth,
57118
57142
  resizeFlag: resizeFlag,
57119
- treeCheckAll: props.treeCheckAll
57143
+ treeCheckAll: props.treeCheckAll,
57144
+ onCellClick: props.onCellClick
57120
57145
  };
57121
57146
  var headCommonProps = {
57122
57147
  disabled: props.disabled,
@@ -63398,7 +63423,7 @@ var upload_interface = __webpack_require__(4412);
63398
63423
 
63399
63424
 
63400
63425
  /* harmony default export */ var src_0 = ({
63401
- version: '3.3.0-beta.6'
63426
+ version: '3.3.0-beta.7'
63402
63427
  });
63403
63428
  }();
63404
63429
  /******/ return __webpack_exports__;