shineout 3.1.27 → 3.1.28

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.27'
479
+ version: '3.1.28'
480
480
  };
package/dist/shineout.js CHANGED
@@ -7096,9 +7096,12 @@ var Alert = function Alert(props) {
7096
7096
  onClick: handleClose
7097
7097
  });
7098
7098
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
7099
- className: alertStyle.close,
7100
- onClick: handleClose,
7101
- children: closeItem || icons_config.alert.Close
7099
+ className: alertStyle.closeWrapper,
7100
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
7101
+ className: alertStyle.close,
7102
+ onClick: handleClose,
7103
+ children: closeItem || icons_config.alert.Close
7104
+ })
7102
7105
  });
7103
7106
  };
7104
7107
  if (dismiss === HIDE) {
@@ -11949,7 +11952,7 @@ var handleStyle = function handleStyle(style) {
11949
11952
  };
11950
11953
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11951
11954
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11952
- /* harmony default export */ var version = ('3.1.27');
11955
+ /* harmony default export */ var version = ('3.1.28');
11953
11956
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11954
11957
 
11955
11958
 
@@ -12111,7 +12114,7 @@ function replaceNonAlphanumeric(str) {
12111
12114
  return result;
12112
12115
  }
12113
12116
  function camelCaseToDash(str) {
12114
- return str.replace(/(?<=.)([A-Z])/g, '-$1').toLowerCase();
12117
+ return str.replace(/([A-Z])/g, '-$1').toLowerCase();
12115
12118
  }
12116
12119
  var cssvar = function cssvar(str, value, key, _size) {
12117
12120
  var _getConfig = getConfig(),
@@ -14819,7 +14822,7 @@ var alertStyle = {
14819
14822
  width: src.alertFontSize,
14820
14823
  color: src.alertCloseFontColor,
14821
14824
  fontSize: src.alertFontSize,
14822
- height: src.lineHeightDynamic,
14825
+ height: src.alertFontSize,
14823
14826
  flex: '0 0 auto',
14824
14827
  display: 'flex',
14825
14828
  alignItems: 'center',
@@ -14829,6 +14832,12 @@ var alertStyle = {
14829
14832
  color: src.alertCloseHoverColor
14830
14833
  }
14831
14834
  },
14835
+ closeWrapper: {
14836
+ width: src.alertFontSize,
14837
+ height: src.lineHeightDynamic,
14838
+ display: 'flex',
14839
+ alignItems: 'center'
14840
+ },
14832
14841
  content: {
14833
14842
  flex: '1 1 0',
14834
14843
  wordBreak: 'break-all'
@@ -28339,7 +28348,10 @@ function useClickAway(params) {
28339
28348
  }
28340
28349
  return function () {
28341
28350
  // @ts-ignore
28342
- document.removeEventListener(event, handleClickAway);
28351
+ document.removeEventListener(event, handleClickAway, {
28352
+ // 解决 点击后立刻删除dom导致获取不到元素; contains(target) 为 false 的问题
28353
+ capture: true
28354
+ });
28343
28355
  };
28344
28356
  }, [effect]);
28345
28357
  }
@@ -44515,9 +44527,9 @@ var form_item_excluded = ["children", "jssStyle", "className", "style", "label",
44515
44527
  style: style,
44516
44528
  children: [label !== undefined ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
44517
44529
  className: classnames_default()(formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.label, labelAlign === 'left' && (formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.labelLeft)),
44518
- style: {
44530
+ style: labelAlign !== 'top' || inline ? {
44519
44531
  width: labelWidth
44520
- },
44532
+ } : undefined,
44521
44533
  children: label
44522
44534
  }) : null, /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({
44523
44535
  className: formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.control
@@ -46786,11 +46798,15 @@ var Scroll = function Scroll(props) {
46786
46798
  height: '100%',
46787
46799
  width: '100%',
46788
46800
  display: 'inline-flex',
46801
+ overflow: 'hidden',
46789
46802
  position: 'sticky'
46790
46803
  }, isRtl ? 'right' : 'left', 0), "top", 0);
46791
- var placeStyle = defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({
46792
- marginTop: height > 0 && scrollHeight > 0 ? Math.max(0, Math.floor(scrollHeight - height)) : 0
46793
- }, "margin".concat(isRtl ? 'Left' : 'Right'), scrollWidth), "height", 0), "width", 0), "overflow", 'hidden');
46804
+ var placeStyle = {
46805
+ marginTop: (height > 0 && scrollHeight > 0 ? Math.max(0, Math.floor(scrollHeight - height)) : 0) - 1,
46806
+ width: scrollWidth,
46807
+ height: 1,
46808
+ overflow: 'hidden'
46809
+ };
46794
46810
  var handleScroll = usePersistFn(function (e) {
46795
46811
  var target = e.currentTarget;
46796
46812
  var scrollLeft = target.scrollLeft,
@@ -51299,9 +51315,11 @@ var message_Message = /*#__PURE__*/function (_React$PureComponent) {
51299
51315
  _this = _super.call(this, props);
51300
51316
  defineProperty_default()(assertThisInitialized_default()(_this), "cachedHeight", void 0);
51301
51317
  defineProperty_default()(assertThisInitialized_default()(_this), "timeoutMap", void 0);
51318
+ defineProperty_default()(assertThisInitialized_default()(_this), "messages", void 0);
51302
51319
  _this.state = {
51303
51320
  messages: []
51304
51321
  };
51322
+ _this.messages = [];
51305
51323
  _this.cachedHeight = {};
51306
51324
  _this.timeoutMap = {};
51307
51325
  _this.removeMessage = _this.removeMessage.bind(assertThisInitialized_default()(_this));
@@ -51309,16 +51327,24 @@ var message_Message = /*#__PURE__*/function (_React$PureComponent) {
51309
51327
  return _this;
51310
51328
  }
51311
51329
  createClass_default()(Message, [{
51330
+ key: "setMessages",
51331
+ value: function setMessages(messages) {
51332
+ this.messages = messages;
51333
+ this.setState({
51334
+ messages: messages
51335
+ });
51336
+ }
51337
+ }, {
51312
51338
  key: "addMessage",
51313
51339
  value: function addMessage(msg) {
51314
51340
  var _this2 = this;
51315
51341
  var id = message_getUidStr();
51316
- var newState = message_produce(this.state, function (state) {
51317
- state.messages.push(Object.assign({
51342
+ var newMessages = message_produce(this.messages, function (messages) {
51343
+ messages.push(Object.assign({
51318
51344
  id: id
51319
51345
  }, msg));
51320
51346
  });
51321
- this.setState(newState);
51347
+ this.setMessages(newMessages);
51322
51348
  if (msg.duration > 0) {
51323
51349
  var closeTimeDelay = setTimeout(function () {
51324
51350
  _this2.closeMessageForAnimation(id, dismissDuration, _this2.cachedHeight[id]);
@@ -51331,7 +51357,7 @@ var message_Message = /*#__PURE__*/function (_React$PureComponent) {
51331
51357
  key: "removeMessage",
51332
51358
  value: function removeMessage(id) {
51333
51359
  var callback;
51334
- var messages = this.state.messages.filter(function (m) {
51360
+ var messages = this.messages.filter(function (m) {
51335
51361
  if (m.id !== id) return true;
51336
51362
  if (m.onClose) {
51337
51363
  callback = m.onClose;
@@ -51342,9 +51368,7 @@ var message_Message = /*#__PURE__*/function (_React$PureComponent) {
51342
51368
  var _this$props$onDestroy, _this$props;
51343
51369
  (_this$props$onDestroy = (_this$props = this.props).onDestroy) === null || _this$props$onDestroy === void 0 || _this$props$onDestroy.call(_this$props);
51344
51370
  } else {
51345
- this.setState({
51346
- messages: messages
51347
- });
51371
+ this.setMessages(messages);
51348
51372
  }
51349
51373
  if (callback) callback();
51350
51374
  }
@@ -51353,16 +51377,15 @@ var message_Message = /*#__PURE__*/function (_React$PureComponent) {
51353
51377
  value: function closeMessageForAnimation(id, duration, msgHeight) {
51354
51378
  var _this3 = this;
51355
51379
  // duration animation duration time
51356
- this.setState(function (preState) {
51357
- return message_produce(preState, function (state) {
51358
- state.messages.forEach(function (m) {
51359
- if (m.id === id) {
51360
- m.dismiss = true;
51361
- m.h = msgHeight || 0;
51362
- }
51363
- });
51380
+ var newMessages = message_produce(this.messages, function (messages) {
51381
+ messages.forEach(function (m) {
51382
+ if (m.id === id) {
51383
+ m.dismiss = true;
51384
+ m.h = msgHeight || 0;
51385
+ }
51364
51386
  });
51365
51387
  });
51388
+ this.setMessages(newMessages);
51366
51389
  setTimeout(function () {
51367
51390
  _this3.removeMessage(id);
51368
51391
  }, duration);
@@ -62400,7 +62423,7 @@ var upload_interface = __webpack_require__(4412);
62400
62423
 
62401
62424
 
62402
62425
  /* harmony default export */ var src_0 = ({
62403
- version: '3.1.27'
62426
+ version: '3.1.28'
62404
62427
  });
62405
62428
  }();
62406
62429
  /******/ return __webpack_exports__;