@sheinx/base 3.1.0-rc.2 → 3.1.0-rc.3
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/LICENSE +21 -0
- package/cjs/button/button-group.d.ts.map +1 -1
- package/cjs/button/button-group.js +3 -0
- package/cjs/button/button.d.ts.map +1 -1
- package/cjs/button/button.js +5 -1
- package/cjs/card/card-header.d.ts.map +1 -1
- package/cjs/card/card-header.js +3 -0
- package/cjs/carousel/carousel.d.ts.map +1 -1
- package/cjs/carousel/carousel.js +6 -4
- package/cjs/cascader/cascader.d.ts.map +1 -1
- package/cjs/cascader/cascader.js +3 -2
- package/cjs/cascader/node.d.ts.map +1 -1
- package/cjs/cascader/node.js +4 -6
- package/cjs/collapse/collapse-item.d.ts.map +1 -1
- package/cjs/collapse/collapse-item.js +5 -1
- package/cjs/image/image-gallery.d.ts.map +1 -1
- package/cjs/image/image-gallery.js +6 -1
- package/cjs/pagination/pagination-buttons.d.ts.map +1 -1
- package/cjs/pagination/pagination-buttons.js +5 -4
- package/cjs/pagination/pagination-next.d.ts.map +1 -1
- package/cjs/pagination/pagination-next.js +6 -6
- package/cjs/pagination/pagination-prev.d.ts.map +1 -1
- package/cjs/pagination/pagination-prev.js +6 -6
- package/cjs/pagination/pagination.type.d.ts +0 -1
- package/cjs/pagination/pagination.type.d.ts.map +1 -1
- package/cjs/popover/popover.d.ts.map +1 -1
- package/cjs/popover/popover.js +3 -0
- package/cjs/select/result.d.ts.map +1 -1
- package/cjs/select/result.js +4 -1
- package/cjs/select/result.type.d.ts +1 -0
- package/cjs/select/result.type.d.ts.map +1 -1
- package/cjs/select/select.d.ts.map +1 -1
- package/cjs/select/select.js +4 -2
- package/cjs/slider/slider.d.ts.map +1 -1
- package/cjs/slider/slider.js +9 -2
- package/cjs/table/table.d.ts.map +1 -1
- package/cjs/table/table.js +71 -124
- package/cjs/table/table.type.d.ts +1 -0
- package/cjs/table/table.type.d.ts.map +1 -1
- package/cjs/table/thead.d.ts.map +1 -1
- package/cjs/table/thead.js +10 -3
- package/cjs/table/tr.d.ts.map +1 -1
- package/cjs/table/tr.js +8 -5
- package/cjs/tabs/tabs-header.d.ts.map +1 -1
- package/cjs/tabs/tabs-header.js +2 -2
- package/cjs/tree-select/tree-select.d.ts.map +1 -1
- package/cjs/tree-select/tree-select.js +5 -3
- package/cjs/virtual-scroll/scroll.d.ts.map +1 -1
- package/cjs/virtual-scroll/scroll.js +28 -14
- package/esm/button/button-group.d.ts.map +1 -1
- package/esm/button/button-group.js +3 -0
- package/esm/button/button.d.ts.map +1 -1
- package/esm/button/button.js +5 -1
- package/esm/card/card-header.d.ts.map +1 -1
- package/esm/card/card-header.js +3 -0
- package/esm/carousel/carousel.d.ts.map +1 -1
- package/esm/carousel/carousel.js +6 -4
- package/esm/cascader/cascader.d.ts.map +1 -1
- package/esm/cascader/cascader.js +3 -2
- package/esm/cascader/node.d.ts.map +1 -1
- package/esm/cascader/node.js +4 -6
- package/esm/collapse/collapse-item.d.ts.map +1 -1
- package/esm/collapse/collapse-item.js +5 -1
- package/esm/image/image-gallery.d.ts.map +1 -1
- package/esm/image/image-gallery.js +6 -1
- package/esm/pagination/pagination-buttons.d.ts.map +1 -1
- package/esm/pagination/pagination-buttons.js +5 -4
- package/esm/pagination/pagination-next.d.ts.map +1 -1
- package/esm/pagination/pagination-next.js +6 -6
- package/esm/pagination/pagination-prev.d.ts.map +1 -1
- package/esm/pagination/pagination-prev.js +6 -6
- package/esm/pagination/pagination.type.d.ts +0 -1
- package/esm/pagination/pagination.type.d.ts.map +1 -1
- package/esm/popover/popover.d.ts.map +1 -1
- package/esm/popover/popover.js +3 -0
- package/esm/select/result.d.ts.map +1 -1
- package/esm/select/result.js +4 -1
- package/esm/select/result.type.d.ts +1 -0
- package/esm/select/result.type.d.ts.map +1 -1
- package/esm/select/select.d.ts.map +1 -1
- package/esm/select/select.js +4 -2
- package/esm/slider/slider.d.ts.map +1 -1
- package/esm/slider/slider.js +9 -2
- package/esm/table/table.d.ts.map +1 -1
- package/esm/table/table.js +72 -125
- package/esm/table/table.type.d.ts +1 -0
- package/esm/table/table.type.d.ts.map +1 -1
- package/esm/table/thead.d.ts.map +1 -1
- package/esm/table/thead.js +10 -3
- package/esm/table/tr.d.ts.map +1 -1
- package/esm/table/tr.js +8 -5
- package/esm/tabs/tabs-header.d.ts.map +1 -1
- package/esm/tabs/tabs-header.js +2 -2
- package/esm/tree-select/tree-select.d.ts.map +1 -1
- package/esm/tree-select/tree-select.js +5 -3
- package/esm/virtual-scroll/scroll.d.ts.map +1 -1
- package/esm/virtual-scroll/scroll.js +28 -14
- package/package.json +9 -4
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _hooks = require("@sheinx/hooks");
|
|
9
|
+
var _config = require("../config");
|
|
9
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
11
|
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); }
|
|
11
12
|
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; }
|
|
@@ -27,6 +28,8 @@ var Scroll = function Scroll(props) {
|
|
|
27
28
|
}),
|
|
28
29
|
width = _useResize.width,
|
|
29
30
|
height = _useResize.height;
|
|
31
|
+
var config = (0, _config.useConfig)();
|
|
32
|
+
var isRtl = config.direction === 'rtl';
|
|
30
33
|
var _props$scrollHeight = props.scrollHeight,
|
|
31
34
|
scrollHeight = _props$scrollHeight === void 0 ? 0 : _props$scrollHeight,
|
|
32
35
|
_props$scrollWidth = props.scrollWidth,
|
|
@@ -36,27 +39,32 @@ var Scroll = function Scroll(props) {
|
|
|
36
39
|
width: '100%',
|
|
37
40
|
overflow: 'auto'
|
|
38
41
|
};
|
|
39
|
-
var containerStyle = {
|
|
42
|
+
var containerStyle = _defineProperty(_defineProperty({
|
|
40
43
|
height: '100%',
|
|
41
44
|
width: '100%',
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
marginRight: scrollWidth,
|
|
49
|
-
height: 0,
|
|
50
|
-
width: 0,
|
|
51
|
-
overflow: 'hidden'
|
|
52
|
-
};
|
|
45
|
+
display: 'inline-flex',
|
|
46
|
+
position: 'sticky'
|
|
47
|
+
}, isRtl ? 'right' : 'left', 0), "top", 0);
|
|
48
|
+
var placeStyle = _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
49
|
+
marginTop: Math.max(0, scrollHeight - height)
|
|
50
|
+
}, "margin".concat(isRtl ? 'Left' : 'Right'), scrollWidth), "height", 0), "width", 0), "overflow", 'hidden');
|
|
53
51
|
var handleScroll = (0, _hooks.usePersistFn)(function (e) {
|
|
54
52
|
var target = e.currentTarget;
|
|
55
53
|
var scrollLeft = target.scrollLeft,
|
|
56
54
|
scrollTop = target.scrollTop;
|
|
57
55
|
var maxY = target.scrollHeight - target.clientHeight;
|
|
58
56
|
var maxX = target.scrollWidth - target.clientWidth;
|
|
59
|
-
|
|
57
|
+
if (!isRtl) {
|
|
58
|
+
// 解决浏览器缩放以后导致滚动条长度出现小数
|
|
59
|
+
if (maxX - scrollLeft < 0 || maxX - scrollLeft < 1) scrollLeft = maxX;
|
|
60
|
+
if (scrollLeft < 0) scrollLeft = 0;
|
|
61
|
+
} else {
|
|
62
|
+
if (maxX + scrollLeft < 0 || maxX + scrollLeft < 1) scrollLeft = 0 - maxX;
|
|
63
|
+
if (scrollLeft > 0) scrollLeft = 0;
|
|
64
|
+
}
|
|
65
|
+
if (scrollTop > maxY || maxY - scrollTop < 1) scrollTop = maxY;
|
|
66
|
+
if (scrollTop < 0) scrollTop = 0;
|
|
67
|
+
var x = maxX === 0 ? 0 : Math.min(Math.abs(scrollLeft) / maxX, 1);
|
|
60
68
|
var y = maxY === 0 ? 0 : Math.min(scrollTop / maxY, 1);
|
|
61
69
|
if (props.onScroll) props.onScroll({
|
|
62
70
|
scrollLeft: scrollLeft,
|
|
@@ -89,7 +97,13 @@ var Scroll = function Scroll(props) {
|
|
|
89
97
|
})), {}, {
|
|
90
98
|
style: containerStyle,
|
|
91
99
|
ref: containerRef,
|
|
92
|
-
children:
|
|
100
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
101
|
+
style: {
|
|
102
|
+
flexShrink: 0,
|
|
103
|
+
flexGrow: 1
|
|
104
|
+
},
|
|
105
|
+
children: props.children
|
|
106
|
+
})
|
|
93
107
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
94
108
|
style: placeStyle,
|
|
95
109
|
children: "\xA0"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["button-group.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["button-group.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAiB,gBAAgB,EAAe,MAAM,eAAe,CAAC;AAE7E,QAAA,MAAM,KAAK,UAAW,gBAAgB,gBAoCrC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { Children, cloneElement } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
+
import { useConfig } from "../config";
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
var Group = function Group(props) {
|
|
5
6
|
var _jssStyle$button;
|
|
@@ -13,6 +14,7 @@ var Group = function Group(props) {
|
|
|
13
14
|
text = props.text,
|
|
14
15
|
shape = props.shape,
|
|
15
16
|
type = props.type;
|
|
17
|
+
var config = useConfig();
|
|
16
18
|
if (outline || text) {
|
|
17
19
|
console.warn('[Button / Button.Group] The properties outline, and text are being deprecated and you should use the mode property to specify the style of the button instead.');
|
|
18
20
|
}
|
|
@@ -23,6 +25,7 @@ var Group = function Group(props) {
|
|
|
23
25
|
return /*#__PURE__*/_jsx("div", {
|
|
24
26
|
className: groupClass,
|
|
25
27
|
style: style,
|
|
28
|
+
dir: config.direction,
|
|
26
29
|
children: Children.toArray(children).map(function (child) {
|
|
27
30
|
var Child = child;
|
|
28
31
|
return /*#__PURE__*/cloneElement(Child, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["button.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["button.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAiB,WAAW,EAAE,MAAM,eAAe,CAAC;AAI3D,QAAA,MAAM,MAAM;YAAW,WAAW;;CAgHjC,CAAC;AAIF,eAAe,MAAM,CAAC"}
|
package/esm/button/button.js
CHANGED
|
@@ -11,6 +11,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
11
11
|
import { useButton } from '@sheinx/hooks';
|
|
12
12
|
import classNames from 'classnames';
|
|
13
13
|
import React from 'react';
|
|
14
|
+
import { useConfig } from "../config";
|
|
14
15
|
import ButtonGroup from "./button-group";
|
|
15
16
|
import Spin from "../spin";
|
|
16
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -36,6 +37,7 @@ var Button = function Button(props) {
|
|
|
36
37
|
htmlTypeProp = _props$htmlType === void 0 ? 'button' : _props$htmlType,
|
|
37
38
|
renderLoading = props.renderLoading,
|
|
38
39
|
rest = _objectWithoutProperties(props, _excluded);
|
|
40
|
+
var config = useConfig();
|
|
39
41
|
var _useButton = useButton(_objectSpread({
|
|
40
42
|
loading: loading,
|
|
41
43
|
htmlType: htmlTypeProp
|
|
@@ -102,7 +104,9 @@ var Button = function Button(props) {
|
|
|
102
104
|
return (
|
|
103
105
|
/*#__PURE__*/
|
|
104
106
|
// eslint-disable-next-line react/button-has-type
|
|
105
|
-
_jsxs("button", _objectSpread(_objectSpread({
|
|
107
|
+
_jsxs("button", _objectSpread(_objectSpread({
|
|
108
|
+
dir: config.direction
|
|
109
|
+
}, buttonProps), {}, {
|
|
106
110
|
type: htmlType,
|
|
107
111
|
ref: onRef,
|
|
108
112
|
className: rootClass,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-header.d.ts","sourceRoot":"","sources":["card-header.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"card-header.d.ts","sourceRoot":"","sources":["card-header.tsx"],"names":[],"mappings":";AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,QAAA,MAAM,UAAU,UAAW,eAAe,gBAmCzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/esm/card/card-header.js
CHANGED
|
@@ -2,12 +2,14 @@ import classNames from 'classnames';
|
|
|
2
2
|
import { CardContext } from "./card.context";
|
|
3
3
|
import { useContext } from 'react';
|
|
4
4
|
import Icons from "../icons";
|
|
5
|
+
import { useConfig } from "../config";
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
8
|
var CardHeader = function CardHeader(props) {
|
|
8
9
|
var _props$jssStyle, _props$jssStyle$card;
|
|
9
10
|
var align = props.align;
|
|
10
11
|
var cardClasses = (_props$jssStyle = props.jssStyle) === null || _props$jssStyle === void 0 || (_props$jssStyle$card = _props$jssStyle.card) === null || _props$jssStyle$card === void 0 ? void 0 : _props$jssStyle$card.call(_props$jssStyle);
|
|
12
|
+
var config = useConfig();
|
|
11
13
|
var _useContext = useContext(CardContext),
|
|
12
14
|
collapsible = _useContext.collapsible,
|
|
13
15
|
onCollapse = _useContext.onCollapse,
|
|
@@ -18,6 +20,7 @@ var CardHeader = function CardHeader(props) {
|
|
|
18
20
|
className: cardClasses === null || cardClasses === void 0 ? void 0 : cardClasses.indicator,
|
|
19
21
|
children: /*#__PURE__*/_jsx("div", {
|
|
20
22
|
className: cardClasses === null || cardClasses === void 0 ? void 0 : cardClasses.indicatorIcon,
|
|
23
|
+
dir: config.direction,
|
|
21
24
|
children: Icons.card.CollapseArrow
|
|
22
25
|
})
|
|
23
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["carousel.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["carousel.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD,QAAA,MAAM,QAAQ,UAAW,aAAa,gBA8IrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/esm/carousel/carousel.js
CHANGED
|
@@ -8,6 +8,7 @@ import { useCarousel } from '@sheinx/hooks';
|
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import Icons from "../icons";
|
|
11
|
+
import { useConfig } from "../config";
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
14
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -21,6 +22,7 @@ var Carousel = function Carousel(props) {
|
|
|
21
22
|
indicatorType = _props$indicatorType === void 0 ? 'circle' : _props$indicatorType;
|
|
22
23
|
var total = React.Children.toArray(props.children).length;
|
|
23
24
|
var carouselClasses = (_props$jssStyle = props.jssStyle) === null || _props$jssStyle === void 0 || (_props$jssStyle$carou = _props$jssStyle.carousel) === null || _props$jssStyle$carou === void 0 ? void 0 : _props$jssStyle$carou.call(_props$jssStyle);
|
|
25
|
+
var config = useConfig();
|
|
24
26
|
var _useCarousel = useCarousel({
|
|
25
27
|
total: total,
|
|
26
28
|
interval: props.interval,
|
|
@@ -53,11 +55,11 @@ var Carousel = function Carousel(props) {
|
|
|
53
55
|
className: classNames(props.showArrow === 'hover' && (carouselClasses === null || carouselClasses === void 0 ? void 0 : carouselClasses.arrowHover), carouselClasses === null || carouselClasses === void 0 ? void 0 : carouselClasses.arrowWrapper, props.arrowClassName),
|
|
54
56
|
children: [/*#__PURE__*/_jsx("div", {
|
|
55
57
|
className: classNames(carouselClasses === null || carouselClasses === void 0 ? void 0 : carouselClasses.arrowLeft, carouselClasses === null || carouselClasses === void 0 ? void 0 : carouselClasses.arrowItem),
|
|
56
|
-
onClick: func.backward,
|
|
58
|
+
onClick: config.direction === 'ltr' ? func.backward : func.forward,
|
|
57
59
|
children: Icons.carousel.Backward
|
|
58
60
|
}, 'left'), /*#__PURE__*/_jsx("div", {
|
|
59
61
|
className: classNames(carouselClasses === null || carouselClasses === void 0 ? void 0 : carouselClasses.arrowRight, carouselClasses === null || carouselClasses === void 0 ? void 0 : carouselClasses.arrowItem),
|
|
60
|
-
onClick: func.forward,
|
|
62
|
+
onClick: config.direction === 'ltr' ? func.forward : func.backward,
|
|
61
63
|
children: Icons.carousel.Forward
|
|
62
64
|
}, 'right')]
|
|
63
65
|
});
|
|
@@ -72,7 +74,7 @@ var Carousel = function Carousel(props) {
|
|
|
72
74
|
children: [/*#__PURE__*/_jsx("div", {
|
|
73
75
|
className: carouselClasses === null || carouselClasses === void 0 ? void 0 : carouselClasses.indicatorArrow,
|
|
74
76
|
onClick: func.backward,
|
|
75
|
-
children: Icons.carousel.Backward
|
|
77
|
+
children: config.direction === 'rtl' && ['center', 'outer'].includes(indicatorPosition) ? Icons.carousel.Forward : Icons.carousel.Backward
|
|
76
78
|
}), /*#__PURE__*/_jsxs("div", {
|
|
77
79
|
className: carouselClasses === null || carouselClasses === void 0 ? void 0 : carouselClasses.indicatorNumber,
|
|
78
80
|
children: [/*#__PURE__*/_jsx("span", {
|
|
@@ -85,7 +87,7 @@ var Carousel = function Carousel(props) {
|
|
|
85
87
|
}), /*#__PURE__*/_jsx("div", {
|
|
86
88
|
className: carouselClasses === null || carouselClasses === void 0 ? void 0 : carouselClasses.indicatorArrow,
|
|
87
89
|
onClick: func.forward,
|
|
88
|
-
children: Icons.carousel.Forward
|
|
90
|
+
children: config.direction === 'rtl' && ['center', 'outer'].includes(indicatorPosition) ? Icons.carousel.Backward : Icons.carousel.Forward
|
|
89
91
|
})]
|
|
90
92
|
});
|
|
91
93
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cascader.d.ts","sourceRoot":"","sources":["cascader.tsx"],"names":[],"mappings":";AAEA,OAAO,EAML,YAAY,EAIb,MAAM,eAAe,CAAC;AAMvB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAYhD,QAAA,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"cascader.d.ts","sourceRoot":"","sources":["cascader.tsx"],"names":[],"mappings":";AAEA,OAAO,EAML,YAAY,EAIb,MAAM,eAAe,CAAC;AAMvB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAYhD,QAAA,MAAM,QAAQ,iGA8rBb,CAAC;AACF,eAAe,QAAQ,CAAC"}
|
package/esm/cascader/cascader.js
CHANGED
|
@@ -214,7 +214,7 @@ var Cascader = function Cascader(props0) {
|
|
|
214
214
|
// 点击结果框的处理方法
|
|
215
215
|
var handleResultClick = usePersistFn(function (e) {
|
|
216
216
|
if (disabled === true) return;
|
|
217
|
-
if (!
|
|
217
|
+
if (!focused) {
|
|
218
218
|
var _inputRef$current;
|
|
219
219
|
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
220
220
|
}
|
|
@@ -426,7 +426,8 @@ var Cascader = function Cascader(props0) {
|
|
|
426
426
|
onRemove: handleRemove,
|
|
427
427
|
onResultItemClick: handleResultItemClick,
|
|
428
428
|
checkUnMatched: checkUnMatched,
|
|
429
|
-
getDataByValues: getDataByValues
|
|
429
|
+
getDataByValues: getDataByValues,
|
|
430
|
+
setInputText: setInputText
|
|
430
431
|
})
|
|
431
432
|
});
|
|
432
433
|
return /*#__PURE__*/_jsx(PopupProvider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["node.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAQ,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAOhD,QAAA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["node.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAQ,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAOhD,QAAA,MAAM,YAAY,oGAyHjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/esm/cascader/node.js
CHANGED
|
@@ -54,15 +54,13 @@ var CascaderNode = function CascaderNode(props) {
|
|
|
54
54
|
onPathChange === null || onPathChange === void 0 || onPathChange(id, data, path);
|
|
55
55
|
};
|
|
56
56
|
var handleClick = function handleClick(e) {
|
|
57
|
-
if (shouldFinal && hasChildren) {
|
|
58
|
-
handlePathChange();
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
57
|
if (onPathChange) onPathChange(id, data, path, true);
|
|
62
58
|
if (!multiple) {
|
|
63
|
-
|
|
59
|
+
// 单选设置了 final 属性后 如果不是末节点不触发onChange
|
|
60
|
+
var shouldJump = shouldFinal && hasChildren;
|
|
61
|
+
if (onChange && path && !shouldJump) onChange([].concat(_toConsumableArray(path), [id]), datum.getDataById(id));
|
|
64
62
|
}
|
|
65
|
-
if (loader && !loading && !util.getParent(e.target, "[".concat(getDataAttributeName('role'), "=checkbox-indicator]"))) {
|
|
63
|
+
if (loader && uncertainChildren && !loading && !util.getParent(e.target, "[".concat(getDataAttributeName('role'), "=checkbox-indicator]"))) {
|
|
66
64
|
setLoading(true);
|
|
67
65
|
loader(id, data);
|
|
68
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse-item.d.ts","sourceRoot":"","sources":["collapse-item.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"collapse-item.d.ts","sourceRoot":"","sources":["collapse-item.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAM9D,QAAA,MAAM,YAAY,UAAW,iBAAiB,gBAyG7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -7,6 +7,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
7
7
|
import React, { useContext } from 'react';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import groupContext from "./group-context";
|
|
10
|
+
import { useConfig } from "../config";
|
|
10
11
|
import { useCollapseItem } from '@sheinx/hooks';
|
|
11
12
|
import AnimationList from "..//animation-list";
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -32,6 +33,7 @@ var CollapseItem = function CollapseItem(props) {
|
|
|
32
33
|
title = props.title,
|
|
33
34
|
extra = props.extra,
|
|
34
35
|
contentStyle = props.contentStyle;
|
|
36
|
+
var config = useConfig();
|
|
35
37
|
var _useCollapseItem = useCollapseItem({
|
|
36
38
|
active: active,
|
|
37
39
|
keygen: keygen,
|
|
@@ -50,7 +52,9 @@ var CollapseItem = function CollapseItem(props) {
|
|
|
50
52
|
// : jssStyle?.collapseItem.activeTransform,
|
|
51
53
|
);
|
|
52
54
|
var headerIcon = showExpandIcon ? expandIcon !== undefined ? expandIcon : parentExpandIcon : null;
|
|
53
|
-
return headerIcon && /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
55
|
+
return headerIcon && /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
56
|
+
dir: config.direction
|
|
57
|
+
}, getHeaderIconProps({
|
|
54
58
|
className: collapseItemIconClassName
|
|
55
59
|
})), {}, {
|
|
56
60
|
children: headerIcon
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-gallery.d.ts","sourceRoot":"","sources":["image-gallery.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAS,iBAAiB,EAAuB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"image-gallery.d.ts","sourceRoot":"","sources":["image-gallery.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAS,iBAAiB,EAAuB,MAAM,cAAc,CAAC;AAI7E,QAAA,MAAM,UAAU,UAAW,iBAAiB,gBAmF3C,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -11,6 +11,7 @@ import classNames from 'classnames';
|
|
|
11
11
|
import { useImageGallery } from '@sheinx/hooks';
|
|
12
12
|
import Magnify from "./image-magnify";
|
|
13
13
|
import Icons from "../icons";
|
|
14
|
+
import { useConfig } from "../config";
|
|
14
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
16
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
17
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -19,8 +20,10 @@ var ImageModal = function ImageModal(props) {
|
|
|
19
20
|
var jssStyle = props.jssStyle,
|
|
20
21
|
images = props.images,
|
|
21
22
|
rest = _objectWithoutProperties(props, _excluded);
|
|
23
|
+
var config = useConfig();
|
|
22
24
|
var _useImageGallery = useImageGallery(_objectSpread(_objectSpread({}, rest), {}, {
|
|
23
|
-
images: images
|
|
25
|
+
images: images,
|
|
26
|
+
direction: config.direction
|
|
24
27
|
})),
|
|
25
28
|
current = _useImageGallery.current,
|
|
26
29
|
direction = _useImageGallery.direction,
|
|
@@ -37,6 +40,7 @@ var ImageModal = function ImageModal(props) {
|
|
|
37
40
|
return /*#__PURE__*/_jsx("a", _objectSpread(_objectSpread({
|
|
38
41
|
className: closeClass
|
|
39
42
|
}, closeIconProps), {}, {
|
|
43
|
+
dir: config.direction,
|
|
40
44
|
children: Icons.image.Close
|
|
41
45
|
}));
|
|
42
46
|
};
|
|
@@ -51,6 +55,7 @@ var ImageModal = function ImageModal(props) {
|
|
|
51
55
|
src: image.src
|
|
52
56
|
});
|
|
53
57
|
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({}, galleryProps), {}, {
|
|
58
|
+
dir: config.direction,
|
|
54
59
|
children: [renderColseIcon(), /*#__PURE__*/_jsx(Magnify, _objectSpread({}, magnifyProps))]
|
|
55
60
|
}), image.key);
|
|
56
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-buttons.d.ts","sourceRoot":"","sources":["pagination-buttons.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"pagination-buttons.d.ts","sourceRoot":"","sources":["pagination-buttons.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,sBAAsB,EAAuB,MAAM,2BAA2B,CAAC;AAOxF,QAAA,MAAM,iBAAiB,UAAW,sBAAsB,gBAqLvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -16,6 +16,7 @@ import Icons from "../icons";
|
|
|
16
16
|
import Button from "./pagination-button";
|
|
17
17
|
import Next from "./pagination-next";
|
|
18
18
|
import Prev from "./pagination-prev";
|
|
19
|
+
import { useConfig } from "../config";
|
|
19
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
21
|
import { createElement as _createElement } from "react";
|
|
21
22
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -41,6 +42,7 @@ var PaginationButtons = function PaginationButtons(props) {
|
|
|
41
42
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
42
43
|
showNextMore = _useState4[0],
|
|
43
44
|
setShowNextMore = _useState4[1];
|
|
45
|
+
var config = useConfig();
|
|
44
46
|
var paginationStyle = jssStyle === null || jssStyle === void 0 || (_jssStyle$pagination = jssStyle.pagination) === null || _jssStyle$pagination === void 0 ? void 0 : _jssStyle$pagination.call(jssStyle);
|
|
45
47
|
var rootClasses = classNames(paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.section, paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.buttons);
|
|
46
48
|
var getLinks = function getLinks() {
|
|
@@ -132,10 +134,10 @@ var PaginationButtons = function PaginationButtons(props) {
|
|
|
132
134
|
};
|
|
133
135
|
var renderMore = function renderMore(type) {
|
|
134
136
|
if (type === 'prev' && showPrevMore) {
|
|
135
|
-
return Icons.pagination.PrePage;
|
|
137
|
+
return config.direction === 'rtl' ? Icons.pagination.NetPage : Icons.pagination.PrePage;
|
|
136
138
|
}
|
|
137
139
|
if (type === 'next' && showNextMore) {
|
|
138
|
-
return Icons.pagination.NetPage;
|
|
140
|
+
return config.direction === 'rtl' ? Icons.pagination.PrePage : Icons.pagination.NetPage;
|
|
139
141
|
}
|
|
140
142
|
return Icons.pagination.More;
|
|
141
143
|
};
|
|
@@ -166,8 +168,7 @@ var PaginationButtons = function PaginationButtons(props) {
|
|
|
166
168
|
moreType: pageNum,
|
|
167
169
|
onMouseEnter: handleHoverMore,
|
|
168
170
|
shape: "square",
|
|
169
|
-
onMouseLeave: handleHoverMore
|
|
170
|
-
className: paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.sectionSize
|
|
171
|
+
onMouseLeave: handleHoverMore
|
|
171
172
|
}), /*#__PURE__*/_jsx("span", {
|
|
172
173
|
className: paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.icon,
|
|
173
174
|
children: renderMore(pageNum)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-next.d.ts","sourceRoot":"","sources":["pagination-next.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"pagination-next.d.ts","sourceRoot":"","sources":["pagination-next.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAKxE,QAAA,MAAM,oBAAoB,UAAW,2BAA2B,gBAgC/D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import Button from "./pagination-button";
|
|
3
3
|
import Icons from "../icons";
|
|
4
|
+
import { useConfig } from "../config";
|
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
var PaginationButtonNext = function PaginationButtonNext(props) {
|
|
6
7
|
var _jssStyle$pagination;
|
|
@@ -15,25 +16,24 @@ var PaginationButtonNext = function PaginationButtonNext(props) {
|
|
|
15
16
|
mode = props.mode,
|
|
16
17
|
onChange = props.onChange;
|
|
17
18
|
var paginationStyle = jssStyle === null || jssStyle === void 0 || (_jssStyle$pagination = jssStyle.pagination) === null || _jssStyle$pagination === void 0 ? void 0 : _jssStyle$pagination.call(jssStyle);
|
|
18
|
-
var rootClasses = classNames(paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.section
|
|
19
|
+
var rootClasses = classNames(paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.section);
|
|
19
20
|
var max = Math.ceil(total / pageSize);
|
|
20
21
|
var next = current + 1;
|
|
21
22
|
var hasText = text && text.next;
|
|
23
|
+
var config = useConfig();
|
|
22
24
|
return /*#__PURE__*/_jsx(Button, {
|
|
23
25
|
className: rootClasses,
|
|
24
26
|
jssStyle: jssStyle,
|
|
25
27
|
mode: mode,
|
|
26
28
|
page: next,
|
|
27
29
|
size: size,
|
|
28
|
-
style: style
|
|
29
|
-
|
|
30
|
-
,
|
|
31
|
-
shape: 'square',
|
|
30
|
+
style: style,
|
|
31
|
+
shape: hasText ? undefined : 'square',
|
|
32
32
|
disabled: disabled || next > max,
|
|
33
33
|
onClick: onChange,
|
|
34
34
|
children: hasText ? text.next : /*#__PURE__*/_jsx("span", {
|
|
35
35
|
className: paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.icon,
|
|
36
|
-
children: Icons.pagination.NextInButton
|
|
36
|
+
children: config.direction === 'rtl' ? Icons.pagination.PreInButton : Icons.pagination.NextInButton
|
|
37
37
|
})
|
|
38
38
|
});
|
|
39
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-prev.d.ts","sourceRoot":"","sources":["pagination-prev.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"pagination-prev.d.ts","sourceRoot":"","sources":["pagination-prev.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAKxE,QAAA,MAAM,oBAAoB,UAAW,2BAA2B,gBA+B/D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import Button from "./pagination-button";
|
|
3
3
|
import Icons from "../icons";
|
|
4
|
+
import { useConfig } from "../config";
|
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
var PaginationButtonPrev = function PaginationButtonPrev(props) {
|
|
6
7
|
var _jssStyle$pagination;
|
|
@@ -12,23 +13,22 @@ var PaginationButtonPrev = function PaginationButtonPrev(props) {
|
|
|
12
13
|
size = props.size,
|
|
13
14
|
onChange = props.onChange;
|
|
14
15
|
var paginationStyle = jssStyle === null || jssStyle === void 0 || (_jssStyle$pagination = jssStyle.pagination) === null || _jssStyle$pagination === void 0 ? void 0 : _jssStyle$pagination.call(jssStyle);
|
|
15
|
-
var rootClasses = classNames(paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.section
|
|
16
|
+
var rootClasses = classNames(paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.section);
|
|
16
17
|
var prev = current - 1;
|
|
17
18
|
var hasText = text && text.prev;
|
|
19
|
+
var config = useConfig();
|
|
18
20
|
return /*#__PURE__*/_jsx(Button, {
|
|
19
21
|
className: rootClasses,
|
|
20
22
|
jssStyle: jssStyle,
|
|
21
23
|
mode: mode,
|
|
22
24
|
disabled: disabled || prev < 1,
|
|
23
25
|
page: prev,
|
|
24
|
-
size: size
|
|
25
|
-
|
|
26
|
-
,
|
|
27
|
-
shape: "square",
|
|
26
|
+
size: size,
|
|
27
|
+
shape: hasText ? undefined : 'square',
|
|
28
28
|
onClick: onChange,
|
|
29
29
|
children: hasText ? text.prev : /*#__PURE__*/_jsx("span", {
|
|
30
30
|
className: paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.icon,
|
|
31
|
-
children: Icons.pagination.PreInButton
|
|
31
|
+
children: config.direction === 'rtl' ? Icons.pagination.NextInButton : Icons.pagination.PreInButton
|
|
32
32
|
})
|
|
33
33
|
});
|
|
34
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.type.d.ts","sourceRoot":"","sources":["pagination.type.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEpD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f;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7E;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["popover.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["popover.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,QAAA,MAAM,OAAO,UAAW,YAAY,gBAkJnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/esm/popover/popover.js
CHANGED
|
@@ -7,6 +7,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
7
7
|
import { usePersistFn, usePopup, useRender, util } from '@sheinx/hooks';
|
|
8
8
|
import AbsoluteList from "../absolute-list";
|
|
9
9
|
import React, { useEffect } from 'react';
|
|
10
|
+
import { useConfig } from "../config";
|
|
10
11
|
import classNames from 'classnames';
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -29,6 +30,7 @@ var Popover = function Popover(props) {
|
|
|
29
30
|
rendered: false
|
|
30
31
|
}),
|
|
31
32
|
context = _React$useRef.current;
|
|
33
|
+
var config = useConfig();
|
|
32
34
|
var popoverStyle = jssStyle === null || jssStyle === void 0 || (_jssStyle$popover = jssStyle.popover) === null || _jssStyle$popover === void 0 ? void 0 : _jssStyle$popover.call(jssStyle);
|
|
33
35
|
var render = useRender();
|
|
34
36
|
var onVisibleChange = usePersistFn(function (v) {
|
|
@@ -141,6 +143,7 @@ var Popover = function Popover(props) {
|
|
|
141
143
|
})), {}, {
|
|
142
144
|
ref: popupRef,
|
|
143
145
|
onMouseLeave: events.onMouseLeave,
|
|
146
|
+
dir: config.direction,
|
|
144
147
|
children: [showArrow && /*#__PURE__*/_jsx("div", {
|
|
145
148
|
className: popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.arrow
|
|
146
149
|
}), /*#__PURE__*/_jsx("div", {
|
|
@@ -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,uEAgXX,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/esm/select/result.js
CHANGED
|
@@ -106,7 +106,9 @@ var Result = function Result(props) {
|
|
|
106
106
|
var _result = getDataByValues(value);
|
|
107
107
|
// 获取合法的 content
|
|
108
108
|
var content = renderResultContent(_result[0]);
|
|
109
|
-
|
|
109
|
+
if (typeof content === 'string') {
|
|
110
|
+
placeholder2 = content;
|
|
111
|
+
}
|
|
110
112
|
}
|
|
111
113
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
112
114
|
children: /*#__PURE__*/_jsx(Input, {
|
|
@@ -280,6 +282,7 @@ var Result = function Result(props) {
|
|
|
280
282
|
};
|
|
281
283
|
useEffect(function () {
|
|
282
284
|
if (!focus && mounted.current) {
|
|
285
|
+
props.setInputText('');
|
|
283
286
|
setTimeout(function () {
|
|
284
287
|
onFilter === null || onFilter === void 0 || onFilter('', 'blur');
|
|
285
288
|
}, 400);
|
|
@@ -14,6 +14,7 @@ export interface ResultProps<DataItem, Value> extends Pick<SelectProps<DataItem,
|
|
|
14
14
|
closeable?: boolean;
|
|
15
15
|
renderItem: (data: DataItem, index?: number) => React.ReactNode;
|
|
16
16
|
renderResultContent?: (props: any) => React.ReactNode;
|
|
17
|
+
setInputText: (text: string) => void;
|
|
17
18
|
onCreate?: (text: string) => string | DataItem | undefined;
|
|
18
19
|
onFilter?: (text: string, form?: string) => void;
|
|
19
20
|
onInputBlur?: (text?: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.type.d.ts","sourceRoot":"","sources":["result.type.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,MAAM,UAAU,CAAC,KAAK,IAAI,aAAa,GAAG,KAAK,CAAC;AAEtD,MAAM,WAAW,WAAW,CAAC,QAAQ,EAAE,KAAK,CAC1C,SAAQ,IAAI,CACV,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,EAC1B,UAAU,GACV,MAAM,GACN,UAAU,GACV,aAAa,GACb,QAAQ,GACR,OAAO,GACP,YAAY,GACZ,iBAAiB,GACjB,qBAAqB,GACrB,UAAU,GACV,iBAAiB,GACjB,iBAAiB,GACjB,eAA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,QAAQ,GAAG,aAAa,KAAK,OAAO,CAAC;IAC5D,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,aAAa,EAAE,GAAG,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxF,iBAAiB,CAAC,EAAE,CAClB,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,EAC/C,IAAI,EAAE,QAAQ,EACd,KAAK,CAAC,EAAE,MAAM,KACX,IAAI,CAAC;IACV,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IAChD,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,CAAC;QACZ,iBAAiB,EAAE,MAAM,CAAC;QAC1B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,qBAAqB,EAAE,MAAM,CAAC;QAC9B,yBAAyB,EAAE,MAAM,CAAC;QAClC,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["select.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,eAAe,EAAqB,MAAM,eAAe,CAAC;AAkBnE,iBAAS,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["select.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,eAAe,EAAqB,MAAM,eAAe,CAAC;AAkBnE,iBAAS,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,eA6tBxE;AAED,eAAe,MAAM,CAAC"}
|
package/esm/select/select.js
CHANGED
|
@@ -155,6 +155,7 @@ function Select(props0) {
|
|
|
155
155
|
createdData = _useFilter.createdData,
|
|
156
156
|
expanded = _useFilter.expanded,
|
|
157
157
|
onFilter0 = _useFilter.onFilter,
|
|
158
|
+
setInputText = _useFilter.setInputText,
|
|
158
159
|
onCreate = _useFilter.onCreate,
|
|
159
160
|
onClearCreatedData = _useFilter.onClearCreatedData,
|
|
160
161
|
rawData = _useFilter.rawData;
|
|
@@ -274,7 +275,7 @@ function Select(props0) {
|
|
|
274
275
|
// 点击 Select 结果框的处理方法
|
|
275
276
|
var handleResultClick = usePersistFn(function (e) {
|
|
276
277
|
if (disabled === true) return;
|
|
277
|
-
if (!
|
|
278
|
+
if (!focused) {
|
|
278
279
|
var _inputRef$current3;
|
|
279
280
|
(_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 || _inputRef$current3.focus();
|
|
280
281
|
}
|
|
@@ -527,7 +528,8 @@ function Select(props0) {
|
|
|
527
528
|
getDataByValues: getDataByValues,
|
|
528
529
|
checkUnMatched: checkUnMatched,
|
|
529
530
|
onRemove: handleRemove,
|
|
530
|
-
classes: styles
|
|
531
|
+
classes: styles,
|
|
532
|
+
setInputText: setInputText
|
|
531
533
|
})
|
|
532
534
|
});
|
|
533
535
|
return /*#__PURE__*/_jsx(PopupProvider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["slider.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["slider.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,QAAA,MAAM,MAAM,8EAmHX,CAAC;AAEF,eAAe,MAAM,CAAC"}
|