shineout 3.10.0-beta.21 → 3.10.0-beta.22

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
@@ -545,5 +545,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
545
545
  // 此文件由脚本自动生成,请勿直接修改。
546
546
  // This file was generated automatically by a script. Please do not modify it directly.
547
547
  var _default = exports.default = {
548
- version: '3.10.0-beta.21'
548
+ version: '3.10.0-beta.22'
549
549
  };
package/dist/shineout.js CHANGED
@@ -13686,7 +13686,7 @@ var handleStyle = function handleStyle(style) {
13686
13686
  };
13687
13687
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
13688
13688
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
13689
- /* harmony default export */ var version = ('3.10.0-beta.21');
13689
+ /* harmony default export */ var version = ('3.10.0-beta.22');
13690
13690
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
13691
13691
 
13692
13692
 
@@ -44760,7 +44760,7 @@ var Cascader = function Cascader(props0) {
44760
44760
  _path = _path || [];
44761
44761
  handlePathChange(lastValue, null, _path);
44762
44762
  } catch (e) {
44763
- console.error(e);
44763
+ devUseWarning.error("".concat(e));
44764
44764
  }
44765
44765
  };
44766
44766
  var handleKeyDown = function handleKeyDown(e) {
@@ -46158,7 +46158,7 @@ var useListSelectMultiple = function useListSelectMultiple(props) {
46158
46158
  if (typeof props.value === 'string') {
46159
46159
  valueArr = (props.value || '').split(props.separator);
46160
46160
  } else {
46161
- console.error('[shineout] use-list-select: separator is string, but value is not string');
46161
+ devUseWarning.error('use-list-select: separator is string, but value is not string');
46162
46162
  valueArr = props.value;
46163
46163
  }
46164
46164
  } else {
@@ -65693,6 +65693,7 @@ var Arrow = /*#__PURE__*/(0,jsx_runtime.jsx)("svg", {
65693
65693
  viewBox: "0 0 40 100",
65694
65694
  xmlns: "http://www.w3.org/2000/svg",
65695
65695
  preserveAspectRatio: "none",
65696
+ "aria-hidden": "true",
65696
65697
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
65697
65698
  d: "M 0 0 L 40 50 L 0 100",
65698
65699
  fill: "currentColor"
@@ -76047,7 +76048,7 @@ var Upload = function Upload(props0) {
76047
76048
  if (!getComponentRef) return;
76048
76049
  var ref = {
76049
76050
  addFiles: function addFiles(files) {
76050
- return func.addFiles(files);
76051
+ func.addFiles(files);
76051
76052
  }
76052
76053
  };
76053
76054
  if (isFunc(getComponentRef)) {
@@ -76055,14 +76056,22 @@ var Upload = function Upload(props0) {
76055
76056
  } else {
76056
76057
  getComponentRef.current = ref;
76057
76058
  }
76058
- }, []);
76059
+ return function () {
76060
+ if (isFunc(getComponentRef)) {
76061
+ getComponentRef(null);
76062
+ } else {
76063
+ getComponentRef.current = null;
76064
+ }
76065
+ };
76066
+ }, [props.getComponentRef]);
76059
76067
 
76060
76068
  // paste 处理:document 级别监听,因为 Upload 没有可聚焦的空白区域
76069
+ // 仅当粘贴事件来自非可编辑区域时才触发,避免干扰 input/textarea 等正常粘贴行为
76061
76070
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
76062
76071
  if (!paste) return;
76063
76072
  var handlePaste = /*#__PURE__*/function () {
76064
76073
  var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(e) {
76065
- var files, _e$clipboardData, filtered, toAdd;
76074
+ var target, tagName, files, _e$clipboardData, filtered, toAdd;
76066
76075
  return regeneratorRuntime_default()().wrap(function _callee$(_context) {
76067
76076
  while (1) switch (_context.prev = _context.next) {
76068
76077
  case 0:
@@ -76072,41 +76081,63 @@ var Upload = function Upload(props0) {
76072
76081
  }
76073
76082
  return _context.abrupt("return");
76074
76083
  case 2:
76084
+ // 过滤掉来自可编辑元素的粘贴事件,避免与 input/textarea/contentEditable 冲突
76085
+ target = e.target;
76086
+ if (!target) {
76087
+ _context.next = 7;
76088
+ break;
76089
+ }
76090
+ tagName = target.tagName;
76091
+ if (!(tagName === 'INPUT' || tagName === 'TEXTAREA' || target.isContentEditable)) {
76092
+ _context.next = 7;
76093
+ break;
76094
+ }
76095
+ return _context.abrupt("return");
76096
+ case 7:
76075
76097
  if (!(props.beforePaste && isFunc(props.beforePaste))) {
76076
- _context.next = 8;
76098
+ _context.next = 20;
76077
76099
  break;
76078
76100
  }
76079
- _context.next = 5;
76101
+ _context.prev = 8;
76102
+ _context.next = 11;
76080
76103
  return props.beforePaste(e);
76081
- case 5:
76104
+ case 11:
76082
76105
  files = _context.sent;
76083
- _context.next = 9;
76106
+ _context.next = 18;
76084
76107
  break;
76085
- case 8:
76108
+ case 14:
76109
+ _context.prev = 14;
76110
+ _context.t0 = _context["catch"](8);
76111
+ devUseWarning.error("beforePaste callback error: ".concat(_context.t0));
76112
+ return _context.abrupt("return");
76113
+ case 18:
76114
+ _context.next = 21;
76115
+ break;
76116
+ case 20:
76086
76117
  files = (_e$clipboardData = e.clipboardData) === null || _e$clipboardData === void 0 ? void 0 : _e$clipboardData.files;
76087
- case 9:
76118
+ case 21:
76088
76119
  if (!(!files || files.length === 0)) {
76089
- _context.next = 11;
76120
+ _context.next = 23;
76090
76121
  break;
76091
76122
  }
76092
76123
  return _context.abrupt("return");
76093
- case 11:
76124
+ case 23:
76094
76125
  filtered = accept ? Array.from(files).filter(function (f) {
76095
76126
  return attrAccept(f, accept);
76096
76127
  }) : Array.from(files);
76097
76128
  if (!(filtered.length === 0)) {
76098
- _context.next = 14;
76129
+ _context.next = 26;
76099
76130
  break;
76100
76131
  }
76101
76132
  return _context.abrupt("return");
76102
- case 14:
76133
+ case 26:
76103
76134
  toAdd = props.multiple || limit > 1 ? filtered : [filtered[0]];
76104
76135
  func.addFiles(toAdd);
76105
- case 16:
76136
+ case 28:
76106
76137
  case "end":
76107
76138
  return _context.stop();
76108
76139
  }
76109
- }, _callee);
76140
+ }, _callee, null, [[8, 14]]);
76110
76141
  }));
76111
76142
  return function handlePaste(_x) {
76112
76143
  return _ref2.apply(this, arguments);
@@ -76116,7 +76147,7 @@ var Upload = function Upload(props0) {
76116
76147
  return function () {
76117
76148
  return document.removeEventListener('paste', handlePaste);
76118
76149
  };
76119
- }, [paste, props.disabled]);
76150
+ }, [paste, props.disabled, accept, props.multiple, limit, props.beforePaste]);
76120
76151
  var handleReplace = function handleReplace(files, index) {
76121
76152
  onChange(dist_immer_produce(value, function (draft) {
76122
76153
  // 删除原来的位置的数据
@@ -79627,7 +79658,7 @@ var watermark_interface = __webpack_require__(6640);
79627
79658
 
79628
79659
 
79629
79660
  /* harmony default export */ var src_0 = ({
79630
- version: '3.10.0-beta.21'
79661
+ version: '3.10.0-beta.22'
79631
79662
  });
79632
79663
  }();
79633
79664
  /******/ return __webpack_exports__;