@sheinx/base 3.9.6-beta.4 → 3.9.6-beta.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["input-group.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;gCAK9B,eAAe;AAAtC,wBA2EE"}
1
+ {"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["input-group.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;gCAe9B,eAAe;AAAtC,wBAsFE"}
@@ -26,6 +26,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
26
26
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
27
27
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
28
28
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // @flow
29
+ // Components that support innerTitle and placeTitle props
30
+ var INNER_TITLE_SUPPORTED_COMPONENTS = ['Input', 'Select', 'Cascader', 'DatePicker', 'Textarea', 'EditableArea'];
29
31
  var _default = exports.default = function _default(props) {
30
32
  var _jssStyle$input;
31
33
  var _React$useState = React.useState(false),
@@ -105,12 +107,23 @@ var _default = exports.default = function _default(props) {
105
107
  }, i);
106
108
  }
107
109
  if ( /*#__PURE__*/React.isValidElement(child)) {
108
- return /*#__PURE__*/(0, _react.cloneElement)(child, _objectSpread(_objectSpread({}, getProps(child)), {}, {
110
+ var _child$type;
111
+ var additionalProps = _objectSpread(_objectSpread({}, getProps(child)), {}, {
109
112
  disabled: child.props.disabled || disabled,
110
- size: child.props.size || size,
111
- innerTitle: child.props.innerTitle || innerTitle,
112
- placeTitle: child.props.placeTitle || placeTitle
113
- }));
113
+ size: child.props.size || size
114
+ });
115
+
116
+ // Only pass innerTitle and placeTitle to components that support them
117
+ // Check by displayName to identify form components that accept these props
118
+ var displayName = (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName;
119
+ var supportsInnerTitle = displayName && INNER_TITLE_SUPPORTED_COMPONENTS.some(function (name) {
120
+ return displayName.includes(name);
121
+ });
122
+ if (supportsInnerTitle) {
123
+ additionalProps.innerTitle = child.props.innerTitle || innerTitle;
124
+ additionalProps.placeTitle = child.props.placeTitle || placeTitle;
125
+ }
126
+ return /*#__PURE__*/(0, _react.cloneElement)(child, additionalProps);
114
127
  }
115
128
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
116
129
  children: child
@@ -69,7 +69,7 @@ var ListOption = function ListOption(props) {
69
69
  highlight = _useContext.highlight;
70
70
  var result = _hooks.util.getHighlightText({
71
71
  enable: highlight,
72
- nodeList: renderItem(data),
72
+ nodeList: renderItem(data, index),
73
73
  searchWords: filterText,
74
74
  highlightClassName: commonStyles === null || commonStyles === void 0 ? void 0 : commonStyles.highlight
75
75
  });
@@ -1 +1 @@
1
- {"version":3,"file":"thead.d.ts","sourceRoot":"","sources":["thead.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;gCAWnB,UAAU;AAAjC,wBAmVE"}
1
+ {"version":3,"file":"thead.d.ts","sourceRoot":"","sources":["thead.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;gCAWnB,UAAU;AAAjC,wBAqVE"}
@@ -53,8 +53,10 @@ var _default = exports.default = function _default(props) {
53
53
  var handleDragMove = (0, _hooks.usePersistFn)(function (deltaX) {
54
54
  props === null || props === void 0 || props.dragCol(context.dragIndex, deltaX);
55
55
  });
56
- var handleDragEnd = (0, _hooks.usePersistFn)(function () {
57
- props === null || props === void 0 || props.resizeCol(context.dragIndex);
56
+ var handleDragEnd = (0, _hooks.usePersistFn)(function (deltaX) {
57
+ if (deltaX !== 0) {
58
+ props === null || props === void 0 || props.resizeCol(context.dragIndex);
59
+ }
58
60
  context.dragIndex = -1;
59
61
  });
60
62
  var _useDragMock = (0, _hooks.useDragMock)({
@@ -5,12 +5,12 @@ export interface UploadImageProps<T> extends Omit<UploadProps<T>, 'listType'> {
5
5
  * @en Upload image container width
6
6
  * @default 80
7
7
  */
8
- width?: number;
8
+ width?: number | string;
9
9
  /**
10
10
  * @cn 上传图片容器高度
11
11
  * @en Upload image container height
12
12
  * @default 80
13
13
  */
14
- height?: number;
14
+ height?: number | string;
15
15
  }
16
16
  //# sourceMappingURL=image.type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"image.type.d.ts","sourceRoot":"","sources":["image.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC;IAC3E;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"image.type.d.ts","sourceRoot":"","sources":["image.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC;IAC3E;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["input-group.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;gCAK9B,eAAe;AAAtC,wBA2EE"}
1
+ {"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["input-group.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;gCAe9B,eAAe;AAAtC,wBAsFE"}
@@ -17,7 +17,10 @@ import classNames from 'classnames';
17
17
  import useWithFormConfig from "../common/use-with-form-config";
18
18
  import { util } from '@sheinx/hooks';
19
19
  import { useConfig } from "../config";
20
+
21
+ // Components that support innerTitle and placeTitle props
20
22
  import { jsx as _jsx } from "react/jsx-runtime";
23
+ var INNER_TITLE_SUPPORTED_COMPONENTS = ['Input', 'Select', 'Cascader', 'DatePicker', 'Textarea', 'EditableArea'];
21
24
  export default (function (props) {
22
25
  var _jssStyle$input;
23
26
  var _React$useState = React.useState(false),
@@ -97,12 +100,23 @@ export default (function (props) {
97
100
  }, i);
98
101
  }
99
102
  if ( /*#__PURE__*/React.isValidElement(child)) {
100
- return /*#__PURE__*/cloneElement(child, _objectSpread(_objectSpread({}, getProps(child)), {}, {
103
+ var _child$type;
104
+ var additionalProps = _objectSpread(_objectSpread({}, getProps(child)), {}, {
101
105
  disabled: child.props.disabled || disabled,
102
- size: child.props.size || size,
103
- innerTitle: child.props.innerTitle || innerTitle,
104
- placeTitle: child.props.placeTitle || placeTitle
105
- }));
106
+ size: child.props.size || size
107
+ });
108
+
109
+ // Only pass innerTitle and placeTitle to components that support them
110
+ // Check by displayName to identify form components that accept these props
111
+ var displayName = (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName;
112
+ var supportsInnerTitle = displayName && INNER_TITLE_SUPPORTED_COMPONENTS.some(function (name) {
113
+ return displayName.includes(name);
114
+ });
115
+ if (supportsInnerTitle) {
116
+ additionalProps.innerTitle = child.props.innerTitle || innerTitle;
117
+ additionalProps.placeTitle = child.props.placeTitle || placeTitle;
118
+ }
119
+ return /*#__PURE__*/cloneElement(child, additionalProps);
106
120
  }
107
121
  return /*#__PURE__*/_jsx("span", {
108
122
  children: child
@@ -63,7 +63,7 @@ var ListOption = function ListOption(props) {
63
63
  highlight = _useContext.highlight;
64
64
  var result = util.getHighlightText({
65
65
  enable: highlight,
66
- nodeList: renderItem(data),
66
+ nodeList: renderItem(data, index),
67
67
  searchWords: filterText,
68
68
  highlightClassName: commonStyles === null || commonStyles === void 0 ? void 0 : commonStyles.highlight
69
69
  });
@@ -1 +1 @@
1
- {"version":3,"file":"thead.d.ts","sourceRoot":"","sources":["thead.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;gCAWnB,UAAU;AAAjC,wBAmVE"}
1
+ {"version":3,"file":"thead.d.ts","sourceRoot":"","sources":["thead.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;gCAWnB,UAAU;AAAjC,wBAqVE"}
@@ -46,8 +46,10 @@ export default (function (props) {
46
46
  var handleDragMove = usePersistFn(function (deltaX) {
47
47
  props === null || props === void 0 || props.dragCol(context.dragIndex, deltaX);
48
48
  });
49
- var handleDragEnd = usePersistFn(function () {
50
- props === null || props === void 0 || props.resizeCol(context.dragIndex);
49
+ var handleDragEnd = usePersistFn(function (deltaX) {
50
+ if (deltaX !== 0) {
51
+ props === null || props === void 0 || props.resizeCol(context.dragIndex);
52
+ }
51
53
  context.dragIndex = -1;
52
54
  });
53
55
  var _useDragMock = useDragMock({
@@ -5,12 +5,12 @@ export interface UploadImageProps<T> extends Omit<UploadProps<T>, 'listType'> {
5
5
  * @en Upload image container width
6
6
  * @default 80
7
7
  */
8
- width?: number;
8
+ width?: number | string;
9
9
  /**
10
10
  * @cn 上传图片容器高度
11
11
  * @en Upload image container height
12
12
  * @default 80
13
13
  */
14
- height?: number;
14
+ height?: number | string;
15
15
  }
16
16
  //# sourceMappingURL=image.type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"image.type.d.ts","sourceRoot":"","sources":["image.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC;IAC3E;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"image.type.d.ts","sourceRoot":"","sources":["image.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC;IAC3E;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.9.6-beta.4",
3
+ "version": "3.9.6-beta.6",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -10,7 +10,7 @@
10
10
  "module": "./esm/index.js",
11
11
  "typings": "./cjs/index.d.ts",
12
12
  "dependencies": {
13
- "@sheinx/hooks": "3.9.6-beta.4",
13
+ "@sheinx/hooks": "3.9.6-beta.6",
14
14
  "immer": "^10.0.0",
15
15
  "classnames": "^2.0.0",
16
16
  "@shined/reactive": "^0.3.3"