@sheinx/base 3.3.3-beta.5 → 3.3.3-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/cascader/cascader.type.d.ts +2 -2
- package/cjs/dropdown/Item.d.ts.map +1 -1
- package/cjs/dropdown/Item.js +7 -2
- package/cjs/select/result.d.ts.map +1 -1
- package/cjs/select/result.js +4 -2
- package/cjs/select/select.type.d.ts +2 -2
- package/cjs/table/tr.d.ts.map +1 -1
- package/cjs/table/tr.js +12 -2
- package/cjs/tabs/tab.d.ts.map +1 -1
- package/cjs/tabs/tab.js +27 -21
- package/cjs/tree-select/tree-select.type.d.ts +2 -2
- package/esm/cascader/cascader.type.d.ts +2 -2
- package/esm/dropdown/Item.d.ts.map +1 -1
- package/esm/dropdown/Item.js +7 -2
- package/esm/select/result.d.ts.map +1 -1
- package/esm/select/result.js +4 -2
- package/esm/select/select.type.d.ts +2 -2
- package/esm/table/tr.d.ts.map +1 -1
- package/esm/table/tr.js +13 -2
- package/esm/tabs/tab.d.ts.map +1 -1
- package/esm/tabs/tab.js +28 -21
- package/esm/tree-select/tree-select.type.d.ts +2 -2
- package/package.json +2 -2
|
@@ -121,8 +121,8 @@ export interface CascaderProps<DataItem, Value extends KeygenResult[]> extends P
|
|
|
121
121
|
*/
|
|
122
122
|
open?: boolean;
|
|
123
123
|
/**
|
|
124
|
-
* @en Selected key (controlled)
|
|
125
|
-
* @cn 选中的 key (受控)
|
|
124
|
+
* @en Selected key (controlled). Note: Do not use undefined and null as meaningful option values. When the value type is undefined and null, the component will not process data and rendering
|
|
125
|
+
* @cn 选中的 key (受控)。注意,请勿将 undefined 和 null 作为有意义的选项值,当 value 类型为 undefined 和 null 时,组件将不处理数据和渲染
|
|
126
126
|
*/
|
|
127
127
|
value?: Value;
|
|
128
128
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["Item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAgB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAuB1D,cAAM,IAAK,SAAQ,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC;IAC/C,MAAM,CAAC,YAAY;;;MAAgB;gBAEvB,KAAK,EAAE,SAAS;IAK5B,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU;IAY/B,MAAM;
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["Item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAgB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAuB1D,cAAM,IAAK,SAAQ,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC;IAC/C,MAAM,CAAC,YAAY;;;MAAgB;gBAEvB,KAAK,EAAE,SAAS;IAK5B,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU;IAY/B,MAAM;CAyCP;AAED,eAAe,IAAI,CAAC"}
|
package/cjs/dropdown/Item.js
CHANGED
|
@@ -10,7 +10,7 @@ var _hooks = require("@sheinx/hooks");
|
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
var _excluded = ["className"],
|
|
13
|
-
_excluded2 = ["className"];
|
|
13
|
+
_excluded2 = ["className", "onClick"];
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -89,10 +89,15 @@ var Item = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
89
89
|
var _ref2 = content.props,
|
|
90
90
|
_ref2$className = _ref2.className,
|
|
91
91
|
contentPropsClassName = _ref2$className === void 0 ? '' : _ref2$className,
|
|
92
|
+
contentPropsOnClick = _ref2.onClick,
|
|
92
93
|
otherContentProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
93
94
|
var className = (0, _classnames.default)(propsClassName, contentPropsClassName);
|
|
94
95
|
return /*#__PURE__*/(0, _react.cloneElement)(content, Object.assign(otherProps, otherContentProps, {
|
|
95
|
-
className: className
|
|
96
|
+
className: className,
|
|
97
|
+
onClick: function onClick(e) {
|
|
98
|
+
if (contentPropsOnClick) contentPropsOnClick(e);
|
|
99
|
+
if (props.onClick) props.onClick(e);
|
|
100
|
+
}
|
|
96
101
|
}));
|
|
97
102
|
}
|
|
98
103
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("a", _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["result.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQ5C,QAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["result.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQ5C,QAAA,MAAM,MAAM,uEA0XX,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/cjs/select/result.js
CHANGED
|
@@ -65,7 +65,7 @@ var Result = function Result(props) {
|
|
|
65
65
|
onRemove = props.onRemove,
|
|
66
66
|
onResultItemClick = props.onResultItemClick,
|
|
67
67
|
data = props.data;
|
|
68
|
-
var value = isArray(valueProp) ? valueProp : [valueProp];
|
|
68
|
+
var value = [null, undefined].includes(valueProp) ? [] : Array.isArray(valueProp) ? valueProp : [valueProp];
|
|
69
69
|
var _useState = (0, _react.useState)(-1),
|
|
70
70
|
_useState2 = _slicedToArray(_useState, 2),
|
|
71
71
|
more = _useState2[0],
|
|
@@ -222,7 +222,9 @@ var Result = function Result(props) {
|
|
|
222
222
|
}, 'single');
|
|
223
223
|
};
|
|
224
224
|
var getValueArr = function getValueArr(v) {
|
|
225
|
-
return isArray(v) ? v : [v]
|
|
225
|
+
return (isArray(v) ? v : [v]).filter(function (v) {
|
|
226
|
+
return v !== undefined && v !== null;
|
|
227
|
+
});
|
|
226
228
|
};
|
|
227
229
|
var renderMultipleResult = function renderMultipleResult() {
|
|
228
230
|
if (isEmptyResult()) return renderNbsp();
|
|
@@ -147,8 +147,8 @@ export interface SelectPropsBase<DataItem, Value> extends Omit<BaseSelectProps<D
|
|
|
147
147
|
*/
|
|
148
148
|
keygen: KeygenType<DataItem>;
|
|
149
149
|
/**
|
|
150
|
-
* @en In the Form, the value will be taken over by the form and the value will
|
|
151
|
-
* @cn 在 Form 中,value 会被表单接管,value
|
|
150
|
+
* @en In the Form, the value will be taken over by the form, and the value is invalid. Note: Do not use undefined and null as meaningful option values. When the value type is undefined and null, the component will not process data and rendering
|
|
151
|
+
* @cn 在 Form 中,value 会被表单接管,value 无效。注意,请勿将 undefined 和 null 作为有意义的选项值,当 value 类型为 undefined 和 null 时,组件将不处理数据和渲染
|
|
152
152
|
* @override any
|
|
153
153
|
*/
|
|
154
154
|
value?: Value;
|
package/cjs/table/tr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["tr.tsx"],"names":[],"mappings":";AA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AAC;IAC9C,eAAe,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACtD,UAAU,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC5C,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,EAAE,UAAW,OAAO,gBAkTzB,CAAC;AAEF,eAAe,EAAE,CAAC"}
|
package/cjs/table/tr.js
CHANGED
|
@@ -74,12 +74,22 @@ var Tr = function Tr(props) {
|
|
|
74
74
|
columnKey: props.columns[colIndex].key
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
|
-
(0,
|
|
77
|
+
var setVirtualRowHeight = (0, _hooks.usePersistFn)(function () {
|
|
78
78
|
if (props.setRowHeight && trRef.current) {
|
|
79
79
|
var expandHeight = expandRef.current ? expandRef.current.getBoundingClientRect().height : 0;
|
|
80
80
|
props.setRowHeight(props.rowIndex, trRef.current.getBoundingClientRect().height + expandHeight);
|
|
81
81
|
}
|
|
82
|
-
}
|
|
82
|
+
});
|
|
83
|
+
(0, _react.useEffect)(setVirtualRowHeight, [props.expanded, props.rowIndex, props.bodyScrollWidth, props.resizeFlag]);
|
|
84
|
+
(0, _react.useEffect)(function () {
|
|
85
|
+
if (!trRef.current) return;
|
|
86
|
+
var cancelObserver = (0, _hooks.addResizeObserver)(trRef.current, setVirtualRowHeight, {
|
|
87
|
+
direction: 'y'
|
|
88
|
+
});
|
|
89
|
+
return function () {
|
|
90
|
+
cancelObserver();
|
|
91
|
+
};
|
|
92
|
+
}, []);
|
|
83
93
|
var renderTreeExpand = function renderTreeExpand(content) {
|
|
84
94
|
var treeIndent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 22;
|
|
85
95
|
var level = props.treeExpandLevel.get(props.originKey) || 0;
|
package/cjs/tabs/tab.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;;AAyHtC,wBAAqC"}
|
package/cjs/tabs/tab.js
CHANGED
|
@@ -20,7 +20,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
20
20
|
var Tab = function Tab(props, ref) {
|
|
21
21
|
var _jssStyle$tabs;
|
|
22
22
|
var jssStyle = props.jssStyle,
|
|
23
|
-
|
|
23
|
+
propTab = props.tab,
|
|
24
24
|
disabled = props.disabled,
|
|
25
25
|
id = props.id,
|
|
26
26
|
color = props.color;
|
|
@@ -46,13 +46,11 @@ var Tab = function Tab(props, ref) {
|
|
|
46
46
|
};
|
|
47
47
|
var handleClick = function handleClick() {
|
|
48
48
|
if (disabled) return;
|
|
49
|
-
if (_hooks.util.isLink(tab)) {
|
|
50
|
-
if (tab.props.onClick && typeof tab.props.onClick === 'function') {
|
|
51
|
-
tab.props.onClick();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
49
|
onChange === null || onChange === void 0 || onChange(id);
|
|
55
50
|
};
|
|
51
|
+
var tab = _hooks.util.isLink(propTab) ?
|
|
52
|
+
// 直接返回a标签的内容,不要a标签
|
|
53
|
+
propTab.props.children : propTab;
|
|
56
54
|
var renderCardTab = function renderCardTab() {
|
|
57
55
|
return tab;
|
|
58
56
|
};
|
|
@@ -84,27 +82,35 @@ var Tab = function Tab(props, ref) {
|
|
|
84
82
|
if (shape === 'card') {
|
|
85
83
|
style.color = color;
|
|
86
84
|
}
|
|
87
|
-
|
|
88
|
-
className: tabClass,
|
|
89
|
-
jssStyle: {
|
|
90
|
-
button: buttonStyle
|
|
91
|
-
}
|
|
92
|
-
}, getStateProps()), {}, {
|
|
93
|
-
style: style,
|
|
94
|
-
disabled: disabled,
|
|
95
|
-
type: isActive ? 'primary' : 'secondary',
|
|
96
|
-
onClick: handleClick,
|
|
97
|
-
dir: config.direction,
|
|
98
|
-
children: tab
|
|
99
|
-
}));
|
|
100
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({
|
|
101
|
-
dir: config.direction,
|
|
85
|
+
var containerProps = _objectSpread(_objectSpread({
|
|
102
86
|
className: tabClass
|
|
103
87
|
}, getStateProps()), {}, {
|
|
104
88
|
style: style,
|
|
105
89
|
onClick: handleClick,
|
|
106
90
|
ref: ref,
|
|
91
|
+
dir: config.direction
|
|
92
|
+
});
|
|
93
|
+
if (shape === 'button') {
|
|
94
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.default, _objectSpread(_objectSpread({
|
|
95
|
+
jssStyle: {
|
|
96
|
+
button: buttonStyle
|
|
97
|
+
},
|
|
98
|
+
disabled: disabled,
|
|
99
|
+
type: isActive ? 'primary' : 'secondary'
|
|
100
|
+
}, containerProps), {}, {
|
|
101
|
+
children: tab
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
var $children = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
107
105
|
children: [shape === 'card' && renderCardTab(), shape === 'line' && renderLineTab(), shape === 'dash' && renderDashTab(), shape === 'fill' && renderFillTab()]
|
|
106
|
+
});
|
|
107
|
+
if (_hooks.util.isLink(propTab)) {
|
|
108
|
+
return /*#__PURE__*/_react.default.cloneElement(propTab, _objectSpread({
|
|
109
|
+
children: $children
|
|
110
|
+
}, containerProps));
|
|
111
|
+
}
|
|
112
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
113
|
+
children: $children
|
|
108
114
|
}));
|
|
109
115
|
};
|
|
110
116
|
var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(Tab);
|
|
@@ -251,8 +251,8 @@ export interface TreeSelectProps<DataItem, Value> extends Pick<CommonType, 'clas
|
|
|
251
251
|
data?: ResultItem<DataItem>[] | ResultItem<DataItem> | null;
|
|
252
252
|
}) => void;
|
|
253
253
|
/**
|
|
254
|
-
* @
|
|
255
|
-
* @
|
|
254
|
+
* @cn 选中的 key (受控),多选时必须为array。注意,请勿将 undefined 和 null 作为有意义的选项值,当 value 类型为 undefined 和 null 时,组件将不处理数据和渲染
|
|
255
|
+
* @en Selected key (controlled), must be an array in multiple selection. Note: Do not use undefined and null as meaningful option values. When the value type is undefined and null, the component will not process data and rendering
|
|
256
256
|
*/
|
|
257
257
|
value?: Value;
|
|
258
258
|
/**
|
|
@@ -121,8 +121,8 @@ export interface CascaderProps<DataItem, Value extends KeygenResult[]> extends P
|
|
|
121
121
|
*/
|
|
122
122
|
open?: boolean;
|
|
123
123
|
/**
|
|
124
|
-
* @en Selected key (controlled)
|
|
125
|
-
* @cn 选中的 key (受控)
|
|
124
|
+
* @en Selected key (controlled). Note: Do not use undefined and null as meaningful option values. When the value type is undefined and null, the component will not process data and rendering
|
|
125
|
+
* @cn 选中的 key (受控)。注意,请勿将 undefined 和 null 作为有意义的选项值,当 value 类型为 undefined 和 null 时,组件将不处理数据和渲染
|
|
126
126
|
*/
|
|
127
127
|
value?: Value;
|
|
128
128
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["Item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAgB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAuB1D,cAAM,IAAK,SAAQ,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC;IAC/C,MAAM,CAAC,YAAY;;;MAAgB;gBAEvB,KAAK,EAAE,SAAS;IAK5B,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU;IAY/B,MAAM;
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["Item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAgB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAuB1D,cAAM,IAAK,SAAQ,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC;IAC/C,MAAM,CAAC,YAAY;;;MAAgB;gBAEvB,KAAK,EAAE,SAAS;IAK5B,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU;IAY/B,MAAM;CAyCP;AAED,eAAe,IAAI,CAAC"}
|
package/esm/dropdown/Item.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
var _excluded = ["className"],
|
|
4
|
-
_excluded2 = ["className"];
|
|
4
|
+
_excluded2 = ["className", "onClick"];
|
|
5
5
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -81,10 +81,15 @@ var Item = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
81
81
|
var _ref2 = content.props,
|
|
82
82
|
_ref2$className = _ref2.className,
|
|
83
83
|
contentPropsClassName = _ref2$className === void 0 ? '' : _ref2$className,
|
|
84
|
+
contentPropsOnClick = _ref2.onClick,
|
|
84
85
|
otherContentProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
85
86
|
var className = classNames(propsClassName, contentPropsClassName);
|
|
86
87
|
return /*#__PURE__*/cloneElement(content, Object.assign(otherProps, otherContentProps, {
|
|
87
|
-
className: className
|
|
88
|
+
className: className,
|
|
89
|
+
onClick: function onClick(e) {
|
|
90
|
+
if (contentPropsOnClick) contentPropsOnClick(e);
|
|
91
|
+
if (props.onClick) props.onClick(e);
|
|
92
|
+
}
|
|
88
93
|
}));
|
|
89
94
|
}
|
|
90
95
|
return /*#__PURE__*/_jsx("a", _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["result.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQ5C,QAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["result.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQ5C,QAAA,MAAM,MAAM,uEA0XX,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/esm/select/result.js
CHANGED
|
@@ -57,7 +57,7 @@ var Result = function Result(props) {
|
|
|
57
57
|
onRemove = props.onRemove,
|
|
58
58
|
onResultItemClick = props.onResultItemClick,
|
|
59
59
|
data = props.data;
|
|
60
|
-
var value = isArray(valueProp) ? valueProp : [valueProp];
|
|
60
|
+
var value = [null, undefined].includes(valueProp) ? [] : Array.isArray(valueProp) ? valueProp : [valueProp];
|
|
61
61
|
var _useState = useState(-1),
|
|
62
62
|
_useState2 = _slicedToArray(_useState, 2),
|
|
63
63
|
more = _useState2[0],
|
|
@@ -214,7 +214,9 @@ var Result = function Result(props) {
|
|
|
214
214
|
}, 'single');
|
|
215
215
|
};
|
|
216
216
|
var getValueArr = function getValueArr(v) {
|
|
217
|
-
return isArray(v) ? v : [v]
|
|
217
|
+
return (isArray(v) ? v : [v]).filter(function (v) {
|
|
218
|
+
return v !== undefined && v !== null;
|
|
219
|
+
});
|
|
218
220
|
};
|
|
219
221
|
var renderMultipleResult = function renderMultipleResult() {
|
|
220
222
|
if (isEmptyResult()) return renderNbsp();
|
|
@@ -147,8 +147,8 @@ export interface SelectPropsBase<DataItem, Value> extends Omit<BaseSelectProps<D
|
|
|
147
147
|
*/
|
|
148
148
|
keygen: KeygenType<DataItem>;
|
|
149
149
|
/**
|
|
150
|
-
* @en In the Form, the value will be taken over by the form and the value will
|
|
151
|
-
* @cn 在 Form 中,value 会被表单接管,value
|
|
150
|
+
* @en In the Form, the value will be taken over by the form, and the value is invalid. Note: Do not use undefined and null as meaningful option values. When the value type is undefined and null, the component will not process data and rendering
|
|
151
|
+
* @cn 在 Form 中,value 会被表单接管,value 无效。注意,请勿将 undefined 和 null 作为有意义的选项值,当 value 类型为 undefined 和 null 时,组件将不处理数据和渲染
|
|
152
152
|
* @override any
|
|
153
153
|
*/
|
|
154
154
|
value?: Value;
|
package/esm/table/tr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["tr.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["tr.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAMvD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAG7D,UAAU,OACR,SAAQ,IAAI,CACV,UAAU,EACR,UAAU,GACV,cAAc,GACd,O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ey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import React, { useEffect, useRef } from 'react';
|
|
8
8
|
import { usePersistFn, util } from '@sheinx/hooks';
|
|
9
|
+
import { addResizeObserver } from '@sheinx/hooks';
|
|
9
10
|
import classNames from 'classnames';
|
|
10
11
|
import Icons from "../icons";
|
|
11
12
|
import Checkbox from "../checkbox";
|
|
@@ -67,12 +68,22 @@ var Tr = function Tr(props) {
|
|
|
67
68
|
columnKey: props.columns[colIndex].key
|
|
68
69
|
});
|
|
69
70
|
});
|
|
70
|
-
|
|
71
|
+
var setVirtualRowHeight = usePersistFn(function () {
|
|
71
72
|
if (props.setRowHeight && trRef.current) {
|
|
72
73
|
var expandHeight = expandRef.current ? expandRef.current.getBoundingClientRect().height : 0;
|
|
73
74
|
props.setRowHeight(props.rowIndex, trRef.current.getBoundingClientRect().height + expandHeight);
|
|
74
75
|
}
|
|
75
|
-
}
|
|
76
|
+
});
|
|
77
|
+
useEffect(setVirtualRowHeight, [props.expanded, props.rowIndex, props.bodyScrollWidth, props.resizeFlag]);
|
|
78
|
+
useEffect(function () {
|
|
79
|
+
if (!trRef.current) return;
|
|
80
|
+
var cancelObserver = addResizeObserver(trRef.current, setVirtualRowHeight, {
|
|
81
|
+
direction: 'y'
|
|
82
|
+
});
|
|
83
|
+
return function () {
|
|
84
|
+
cancelObserver();
|
|
85
|
+
};
|
|
86
|
+
}, []);
|
|
76
87
|
var renderTreeExpand = function renderTreeExpand(content) {
|
|
77
88
|
var treeIndent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 22;
|
|
78
89
|
var level = props.treeExpandLevel.get(props.originKey) || 0;
|
package/esm/tabs/tab.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["tab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;;AAyHtC,wBAAqC"}
|
package/esm/tabs/tab.js
CHANGED
|
@@ -10,11 +10,12 @@ import Button from "../button";
|
|
|
10
10
|
import { useConfig } from "../config";
|
|
11
11
|
import { useTabsContext, util } from '@sheinx/hooks';
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
15
|
var Tab = function Tab(props, ref) {
|
|
15
16
|
var _jssStyle$tabs;
|
|
16
17
|
var jssStyle = props.jssStyle,
|
|
17
|
-
|
|
18
|
+
propTab = props.tab,
|
|
18
19
|
disabled = props.disabled,
|
|
19
20
|
id = props.id,
|
|
20
21
|
color = props.color;
|
|
@@ -40,13 +41,11 @@ var Tab = function Tab(props, ref) {
|
|
|
40
41
|
};
|
|
41
42
|
var handleClick = function handleClick() {
|
|
42
43
|
if (disabled) return;
|
|
43
|
-
if (util.isLink(tab)) {
|
|
44
|
-
if (tab.props.onClick && typeof tab.props.onClick === 'function') {
|
|
45
|
-
tab.props.onClick();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
44
|
onChange === null || onChange === void 0 || onChange(id);
|
|
49
45
|
};
|
|
46
|
+
var tab = util.isLink(propTab) ?
|
|
47
|
+
// 直接返回a标签的内容,不要a标签
|
|
48
|
+
propTab.props.children : propTab;
|
|
50
49
|
var renderCardTab = function renderCardTab() {
|
|
51
50
|
return tab;
|
|
52
51
|
};
|
|
@@ -78,27 +77,35 @@ var Tab = function Tab(props, ref) {
|
|
|
78
77
|
if (shape === 'card') {
|
|
79
78
|
style.color = color;
|
|
80
79
|
}
|
|
81
|
-
|
|
82
|
-
className: tabClass,
|
|
83
|
-
jssStyle: {
|
|
84
|
-
button: buttonStyle
|
|
85
|
-
}
|
|
86
|
-
}, getStateProps()), {}, {
|
|
87
|
-
style: style,
|
|
88
|
-
disabled: disabled,
|
|
89
|
-
type: isActive ? 'primary' : 'secondary',
|
|
90
|
-
onClick: handleClick,
|
|
91
|
-
dir: config.direction,
|
|
92
|
-
children: tab
|
|
93
|
-
}));
|
|
94
|
-
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
95
|
-
dir: config.direction,
|
|
80
|
+
var containerProps = _objectSpread(_objectSpread({
|
|
96
81
|
className: tabClass
|
|
97
82
|
}, getStateProps()), {}, {
|
|
98
83
|
style: style,
|
|
99
84
|
onClick: handleClick,
|
|
100
85
|
ref: ref,
|
|
86
|
+
dir: config.direction
|
|
87
|
+
});
|
|
88
|
+
if (shape === 'button') {
|
|
89
|
+
return /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
90
|
+
jssStyle: {
|
|
91
|
+
button: buttonStyle
|
|
92
|
+
},
|
|
93
|
+
disabled: disabled,
|
|
94
|
+
type: isActive ? 'primary' : 'secondary'
|
|
95
|
+
}, containerProps), {}, {
|
|
96
|
+
children: tab
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
var $children = /*#__PURE__*/_jsxs(_Fragment, {
|
|
101
100
|
children: [shape === 'card' && renderCardTab(), shape === 'line' && renderLineTab(), shape === 'dash' && renderDashTab(), shape === 'fill' && renderFillTab()]
|
|
101
|
+
});
|
|
102
|
+
if (util.isLink(propTab)) {
|
|
103
|
+
return /*#__PURE__*/React.cloneElement(propTab, _objectSpread({
|
|
104
|
+
children: $children
|
|
105
|
+
}, containerProps));
|
|
106
|
+
}
|
|
107
|
+
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
108
|
+
children: $children
|
|
102
109
|
}));
|
|
103
110
|
};
|
|
104
111
|
export default /*#__PURE__*/React.forwardRef(Tab);
|
|
@@ -251,8 +251,8 @@ export interface TreeSelectProps<DataItem, Value> extends Pick<CommonType, 'clas
|
|
|
251
251
|
data?: ResultItem<DataItem>[] | ResultItem<DataItem> | null;
|
|
252
252
|
}) => void;
|
|
253
253
|
/**
|
|
254
|
-
* @
|
|
255
|
-
* @
|
|
254
|
+
* @cn 选中的 key (受控),多选时必须为array。注意,请勿将 undefined 和 null 作为有意义的选项值,当 value 类型为 undefined 和 null 时,组件将不处理数据和渲染
|
|
255
|
+
* @en Selected key (controlled), must be an array in multiple selection. Note: Do not use undefined and null as meaningful option values. When the value type is undefined and null, the component will not process data and rendering
|
|
256
256
|
*/
|
|
257
257
|
value?: Value;
|
|
258
258
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheinx/base",
|
|
3
|
-
"version": "3.3.3-beta.
|
|
3
|
+
"version": "3.3.3-beta.7",
|
|
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.3.3-beta.
|
|
13
|
+
"@sheinx/hooks": "3.3.3-beta.7",
|
|
14
14
|
"immer": "^10.0.0",
|
|
15
15
|
"classnames": "^2.0.0",
|
|
16
16
|
"@shined/reactive": "^0.1.3-alpha.0"
|